diff --git a/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h b/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h index 07a5111d24749..75a1b72daf2c8 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h +++ b/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h @@ -1,5 +1,5 @@ -#ifndef EventFilter_CSCDigiToRaw_h -#define EventFilter_CSCDigiToRaw_h +#ifndef EventFilter_CSCRawToDigi_CSCDigiToRaw_h +#define EventFilter_CSCRawToDigi_CSCDigiToRaw_h /** \class CSCDigiToRaw * @@ -13,7 +13,9 @@ #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCShowerDigiCollection.h" #include "DataFormats/GEMDigi/interface/GEMPadDigiClusterCollection.h" #include "EventFilter/CSCRawToDigi/interface/CSCEventData.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -34,7 +36,9 @@ class CSCDigiToRaw { const CSCALCTDigiCollection& alctDigis, const CSCCLCTDigiCollection& clctDigis, const CSCCLCTPreTriggerCollection* preTriggers, + const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis, + const CSCShowerDigiCollection* showerDigis, const GEMPadDigiClusterCollection* padDigiClusters, FEDRawDataCollection& fed_buffers, const CSCChamberMap* theMapping, @@ -55,6 +59,7 @@ class CSCDigiToRaw { // specialized because it reverses strip direction void add(const CSCStripDigiCollection& stripDigis, const CSCCLCTPreTriggerCollection* preTriggers, + const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, FindEventDataInfo&, bool packEverything) const; void add(const CSCWireDigiCollection& wireDigis, @@ -69,6 +74,7 @@ class CSCDigiToRaw { void add(const CSCALCTDigiCollection& alctDigis, FindEventDataInfo&) const; void add(const CSCCLCTDigiCollection& clctDigis, FindEventDataInfo&) const; void add(const CSCCorrelatedLCTDigiCollection& corrLCTDigis, FindEventDataInfo&) const; + void add(const CSCShowerDigiCollection& cscShowerDigis, FindEventDataInfo&) const; void add(const GEMPadDigiClusterCollection& gemPadClusters, FindEventDataInfo&) const; /// pick out the correct data object for this chamber CSCEventData& findEventData(const CSCDetId& cscDetId, FindEventDataInfo&) const; diff --git a/EventFilter/CSCRawToDigi/interface/CSCEventData.h b/EventFilter/CSCRawToDigi/interface/CSCEventData.h index b36482e9ebf95..70778ab9d2b93 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCEventData.h +++ b/EventFilter/CSCRawToDigi/interface/CSCEventData.h @@ -102,6 +102,7 @@ class CSCEventData { void add(const std::vector &); void add(const std::vector &); void add(const std::vector &); + void add(const std::vector &); void add(const std::vector &, const GEMDetId &); /// this will fill the DMB header, and change all related fields in diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h index 3f10e97797125..6bb53e0b16c84 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h @@ -10,6 +10,7 @@ #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h" #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h" #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h" +#include "DataFormats/CSCDigi/interface/CSCShowerDigi.h" #include "DataFormats/GEMDigi/interface/GEMPadDigiCluster.h" #include "EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h" #include "FWCore/Utilities/interface/Exception.h" @@ -99,6 +100,7 @@ class CSCTMBHeader { /// these methods need more brains to figure which one goes first void add(const std::vector& digis); void add(const std::vector& digis); + void add(const std::vector& digis); /// tests that packing and unpacking give same results static void selfTest(int firmwwareVersion, int firmwareRevision); diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h index 34556549c4b7e..426b8c8ff2f71 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h @@ -47,6 +47,7 @@ struct CSCTMBHeader2006 : public CSCVTMBHeaderFormat { void addALCT1(const CSCALCTDigi& digi) override; void addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) override; void addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) override; + void addShower(const CSCShowerDigi& digi) override {} void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2); diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h index ca4e610462ed0..6bee14ad6d30f 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h @@ -50,6 +50,7 @@ struct CSCTMBHeader2007 : public CSCVTMBHeaderFormat { void addALCT1(const CSCALCTDigi& digi) override; void addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) override; void addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) override; + void addShower(const CSCShowerDigi& digi) override {} void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2); diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h index 12365f5c8062f..84ec227300947 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h @@ -50,6 +50,7 @@ struct CSCTMBHeader2007_rev0x50c3 : public CSCVTMBHeaderFormat { void addALCT1(const CSCALCTDigi& digi) override; void addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) override; void addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) override; + void addShower(const CSCShowerDigi& digi) override {} void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2); diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h index a48cb58bd8724..c58cd36a5ec5d 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h @@ -50,6 +50,7 @@ struct CSCTMBHeader2013 : public CSCVTMBHeaderFormat { void addALCT1(const CSCALCTDigi& digi) override; void addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) override; void addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) override; + void addShower(const CSCShowerDigi& digi) override {} void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2); diff --git a/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h b/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h index 5a079e0261a58..2f32bc8dbe0c9 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h +++ b/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h @@ -4,6 +4,7 @@ #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h" #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h" #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h" +#include "DataFormats/CSCDigi/interface/CSCShowerDigi.h" #include "DataFormats/MuonDetId/interface/CSCDetId.h" #include "DataFormats/CSCDigi/interface/CSCConstants.h" #include @@ -56,6 +57,7 @@ class CSCVTMBHeaderFormat { virtual void addALCT1(const CSCALCTDigi& digi) = 0; virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) = 0; virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) = 0; + virtual void addShower(const CSCShowerDigi& digi) = 0; virtual void print(std::ostream& os) const = 0; diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc b/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc index a5d73400a630a..20a3a224a3b00 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc @@ -39,6 +39,7 @@ #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCRPCDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCShowerDigiCollection.h" #include "DataFormats/GEMDigi/interface/GEMPadDigiClusterCollection.h" #include "DataFormats/CSCDigi/interface/CSCDMBStatusDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCTMBStatusDigiCollection.h" @@ -85,6 +86,9 @@ class CSCDCCUnpacker : public edm::stream::EDProducer<> { /// option to unpack GEM cluster data bool useGEMs_; + /// option to unpack CSC shower data + bool useCSCShowers_; + /// Visualization of raw data bool visualFEDInspect, visualFEDShort, formatedEventDump; /// Suppress zeros LCTs @@ -117,8 +121,9 @@ CSCDCCUnpacker::CSCDCCUnpacker(const edm::ParameterSet& pset) : numOfEvents(0) { useFormatStatus = pset.getParameter("UseFormatStatus"); useGEMs_ = pset.getParameter("useGEMs"); - // Untracked + useCSCShowers_ = pset.getParameter("useCSCShowers"); + // Untracked printEventNumber = pset.getUntrackedParameter("PrintEventNumber", true); debug = pset.getUntrackedParameter("Debug", false); instantiateDQM = pset.getUntrackedParameter("runDQM", false); @@ -159,6 +164,11 @@ CSCDCCUnpacker::CSCDCCUnpacker(const edm::ParameterSet& pset) : numOfEvents(0) { if (useGEMs_) { produces("MuonGEMPadDigiCluster"); } + + if (useCSCShowers_) { + produces("MuonCSCShowerDigi"); + } + //CSCAnodeData::setDebug(debug); CSCALCTHeader::setDebug(debug); CSCComparatorData::setDebug(debug); @@ -188,6 +198,7 @@ void CSCDCCUnpacker::fillDescriptions(edm::ConfigurationDescriptions& descriptio desc.add("UnpackStatusDigis", false)->setComment("# Unpack general status digis?"); desc.add("UseFormatStatus", true)->setComment("# Unpack FormatStatus digi?"); desc.add("useGEMs", false)->setComment("Unpack GEM trigger data"); + desc.add("useCSCShowers", false)->setComment("Unpack CSCShower trigger data"); desc.addUntracked("Debug", false)->setComment("# Turn on lots of output"); desc.addUntracked("PrintEventNumber", false); desc.addUntracked("runDQM", false); @@ -237,6 +248,8 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { auto gemProduct = std::make_unique(); + auto showerProduct = std::make_unique(); + // If set selective unpacking mode // hardcoded examiner mask below to check for DCC and DDU level errors will be used first // then examinerMask for CSC level errors will be used during unpacking of each CSC block @@ -636,6 +649,9 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { if (useGEMs_) { e.put(std::move(gemProduct), "MuonGEMPadDigiCluster"); } + if (useCSCShowers_) { + e.put(std::move(showerProduct), "MuonCSCShowerDigi"); + } if (printEventNumber) LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "[CSCDCCUnpacker]: " << numOfEvents << " events processed "; } diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc b/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc index 95c78b7da29b8..f250bd3d93e3e 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc @@ -28,7 +28,9 @@ #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCShowerDigiCollection.h" #include "DataFormats/GEMDigi/interface/GEMPadDigiClusterCollection.h" namespace edm { @@ -53,6 +55,7 @@ class CSCDigiToRawModule : public edm::global::EDProducer<> { bool usePreTriggers; // Select if to use Pre-Triigers CLCT digis bool packEverything_; // bypass all cuts and (pre)trigger requirements bool useGEMs_; + bool useCSCShowers_; std::unique_ptr packer_; @@ -62,7 +65,9 @@ class CSCDigiToRawModule : public edm::global::EDProducer<> { edm::EDGetTokenT al_token; edm::EDGetTokenT cl_token; edm::EDGetTokenT pr_token; + edm::EDGetTokenT prdigi_token; edm::EDGetTokenT co_token; + edm::EDGetTokenT shower_token; edm::ESGetToken cham_token; edm::EDGetTokenT gem_token; @@ -70,19 +75,19 @@ class CSCDigiToRawModule : public edm::global::EDProducer<> { }; CSCDigiToRawModule::CSCDigiToRawModule(const edm::ParameterSet& pset) : packer_(std::make_unique(pset)) { - //theStrip = pset.getUntrackedParameter("DigiCreator", "cscunpacker"); - theFormatVersion = pset.getParameter("useFormatVersion"); // pre-LS1 - '2005'. post-LS1 - '2013' usePreTriggers = pset.getParameter("usePreTriggers"); // disable checking CLCT PreTriggers digis packEverything_ = pset.getParameter("packEverything"); // don't check for consistency with trig primitives // overrides usePreTriggers useGEMs_ = pset.getParameter("useGEMs"); + useCSCShowers_ = pset.getParameter("useCSCShowers"); wd_token = consumes(pset.getParameter("wireDigiTag")); sd_token = consumes(pset.getParameter("stripDigiTag")); cd_token = consumes(pset.getParameter("comparatorDigiTag")); if (usePreTriggers) { pr_token = consumes(pset.getParameter("preTriggerTag")); + prdigi_token = consumes(pset.getParameter("preTriggerDigiTag")); } al_token = consumes(pset.getParameter("alctDigiTag")); cl_token = consumes(pset.getParameter("clctDigiTag")); @@ -91,27 +96,13 @@ CSCDigiToRawModule::CSCDigiToRawModule(const edm::ParameterSet& pset) : packer_( if (useGEMs_) { gem_token = consumes(pset.getParameter("padDigiClusterTag")); } + if (useCSCShowers_) { + shower_token = consumes(pset.getParameter("showerDigiTag")); + } put_token_ = produces("CSCRawData"); } void CSCDigiToRawModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - /*** From python/cscPacker_cfi.py - wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"), - stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"), - comparatorDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"), - alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"), - clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"), - preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis"), - correlatedLCTDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"), - # if min parameter = -999 always accept - alctWindowMin = cms.int32(-3), - alctWindowMax = cms.int32(3), - clctWindowMin = cms.int32(-3), - clctWindowMax = cms.int32(3), - preTriggerWindowMin = cms.int32(-3), - preTriggerWindowMax = cms.int32(1) -*/ - edm::ParameterSetDescription desc; desc.add("useFormatVersion", 2005) @@ -120,6 +111,7 @@ void CSCDigiToRawModule::fillDescriptions(edm::ConfigurationDescriptions& descri desc.add("packEverything", false) ->setComment("Set to true to disable trigger-related constraints on readout data"); desc.add("useGEMs", false)->setComment("Pack GEM trigger data"); + desc.add("useCSCShowers", false)->setComment("Pack CSC shower trigger data"); desc.add("wireDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCWireDigi")); desc.add("stripDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCStripDigi")); @@ -127,8 +119,10 @@ void CSCDigiToRawModule::fillDescriptions(edm::ConfigurationDescriptions& descri desc.add("alctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis")); desc.add("clctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis")); desc.add("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis")); + desc.add("preTriggerDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis")); desc.add("correlatedLCTDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED")); desc.add("padDigiClusterTag", edm::InputTag("simMuonGEMPadDigiClusters")); + desc.add("showerDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis")); desc.add("alctWindowMin", -3)->setComment("If min parameter = -999 always accept"); desc.add("alctWindowMax", 3); @@ -137,7 +131,7 @@ void CSCDigiToRawModule::fillDescriptions(edm::ConfigurationDescriptions& descri desc.add("preTriggerWindowMin", -3)->setComment("If min parameter = -999 always accept"); desc.add("preTriggerWindowMax", 1); - descriptions.add("cscPacker", desc); + descriptions.add("cscPackerDef", desc); } void CSCDigiToRawModule::produce(edm::StreamID, edm::Event& e, const edm::EventSetup& c) const { @@ -155,19 +149,36 @@ void CSCDigiToRawModule::produce(edm::StreamID, edm::Event& e, const edm::EventS edm::Handle clctDigis; edm::Handle correlatedLCTDigis; + // collections that are always packed e.getByToken(wd_token, wireDigis); e.getByToken(sd_token, stripDigis); e.getByToken(cd_token, comparatorDigis); e.getByToken(al_token, alctDigis); e.getByToken(cl_token, clctDigis); + e.getByToken(co_token, correlatedLCTDigis); + + // packing with pre-triggers CSCCLCTPreTriggerCollection const* preTriggersPtr = nullptr; - if (usePreTriggers) + CSCCLCTPreTriggerDigiCollection const* preTriggerDigisPtr = nullptr; + if (usePreTriggers) { preTriggersPtr = &e.get(pr_token); - e.getByToken(co_token, correlatedLCTDigis); + preTriggerDigisPtr = &e.get(prdigi_token); + } + + // collections that are packed optionally + + // packing of GEM hits const GEMPadDigiClusterCollection* padDigiClustersPtr = nullptr; if (useGEMs_) { padDigiClustersPtr = &e.get(gem_token); } + + // packing of CSC shower digis + const CSCShowerDigiCollection* cscShowerDigisPtr = nullptr; + if (useCSCShowers_) { + cscShowerDigisPtr = &e.get(shower_token); + } + // Create the packed data packer_->createFedBuffers(*stripDigis, *wireDigis, @@ -175,7 +186,9 @@ void CSCDigiToRawModule::produce(edm::StreamID, edm::Event& e, const edm::EventS *alctDigis, *clctDigis, preTriggersPtr, + preTriggerDigisPtr, *correlatedLCTDigis, + cscShowerDigisPtr, padDigiClustersPtr, fed_buffers, theMapping, diff --git a/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py b/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py index cb027f09fa676..57cfec0c0ddc0 100644 --- a/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py +++ b/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py @@ -1,33 +1,21 @@ import FWCore.ParameterSet.Config as cms -cscpacker = cms.EDProducer("CSCDigiToRawModule", - wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"), - stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"), - comparatorDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"), - alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"), - clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"), - preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis"), - correlatedLCTDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"), - # if min parameter = -999 always accept - alctWindowMin = cms.int32(-3), - alctWindowMax = cms.int32(3), - clctWindowMin = cms.int32(-3), - clctWindowMax = cms.int32(3), - preTriggerWindowMin = cms.int32(-3), - preTriggerWindowMax = cms.int32(1) -) - +## baseline configuration in the class itself +from EventFilter.CSCRawToDigi.cscPackerDef_cfi import cscPackerDef +cscpacker = cscPackerDef.clone() ## ## Make changes for running in Run 2 ## # packer - simply get rid of it from Configuration.Eras.Modifier_run2_common_cff import run2_common -run2_common.toModify( cscpacker, useFormatVersion = cms.uint32(2013) ) -run2_common.toModify( cscpacker, usePreTriggers = cms.bool(False) ) -run2_common.toModify( cscpacker, packEverything = cms.bool(True) ) +run2_common.toModify( cscpacker, + useFormatVersion = 2013, + usePreTriggers = False, + packEverything = True) ## in Run-3 include GEMs from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM -run3_GEM.toModify( cscpacker, padDigiClusterTag = cms.InputTag("simMuonGEMPadDigiClusters") ) -run3_GEM.toModify( cscpacker, useGEMs = cms.bool(False) ) +run3_GEM.toModify( cscpacker, + padDigiClusterTag = "simMuonGEMPadDigiClusters", + useGEMs = False) diff --git a/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py b/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py index fc753203eebe1..ff699fe62f890 100644 --- a/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py +++ b/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py @@ -1,31 +1,13 @@ import FWCore.ParameterSet.Config as cms # Import from the generic cfi file for CSC unpacking -import EventFilter.CSCRawToDigi.muonCSCDCCUnpacker_cfi +from EventFilter.CSCRawToDigi.muonCSCDCCUnpacker_cfi import muonCSCDCCUnpacker -muonCSCDigis = EventFilter.CSCRawToDigi.muonCSCDCCUnpacker_cfi.muonCSCDCCUnpacker.clone() -# Define input to the unpacker -muonCSCDigis.InputObjects = cms.InputTag("rawDataCollector") -# Use CSC examiner to check for corrupt or semi-corrupt data & avoid unpacker crashes -muonCSCDigis.UseExaminer = cms.bool(True) -# This mask is needed by the examiner -muonCSCDigis.ExaminerMask = cms.uint32(0x1FEBF7F6) -# Use Examiner to unpack good chambers and skip only bad ones -muonCSCDigis.UseSelectiveUnpacking = cms.bool(True) -# This mask simply reduces error reporting -muonCSCDigis.ErrorMask = cms.uint32(0x0) -# Unpack general status digis? -muonCSCDigis.UnpackStatusDigis = cms.bool(False) -# Unpack FormatStatus digi? -muonCSCDigis.UseFormatStatus = cms.bool(True) -# Turn on lots of output -muonCSCDigis.Debug = cms.untracked.bool(False) -muonCSCDigis.PrintEventNumber = cms.untracked.bool(False) -# Visualization of raw data in corrupted events -muonCSCDigis.VisualFEDInspect = cms.untracked.bool(False) -muonCSCDigis.VisualFEDShort = cms.untracked.bool(False) -muonCSCDigis.FormatedEventDump = cms.untracked.bool(False) +muonCSCDigis = muonCSCDCCUnpacker.clone( + # This mask is needed by the examiner + ExaminerMask = 0x1FEBF7F6 +) ## in Run-3 include GEMs from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM -run3_GEM.toModify( muonCSCDigis, useGEMs = cms.bool(False) ) +run3_GEM.toModify( muonCSCDigis, useGEMs = False ) diff --git a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc index 66f933d7c83f2..d0a9fd2f21c10 100644 --- a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc +++ b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc @@ -139,6 +139,7 @@ CSCEventData& CSCDigiToRaw::findEventData(const CSCDetId& cscDetId, FindEventDat void CSCDigiToRaw::add(const CSCStripDigiCollection& stripDigis, const CSCCLCTPreTriggerCollection* preTriggers, + const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, FindEventDataInfo& fedInfo, bool packEverything) const { //iterate over chambers with strip digis in them for (CSCStripDigiCollection::DigiRangeIterator j = stripDigis.begin(); j != stripDigis.end(); ++j) { @@ -332,6 +333,15 @@ void CSCDigiToRaw::add(const CSCCorrelatedLCTDigiCollection& corrLCTDigis, FindE } } +void CSCDigiToRaw::add(const CSCShowerDigiCollection& cscShowerDigis, FindEventDataInfo& fedInfo) const { + for (const auto& shower : cscShowerDigis) { + const CSCDetId& cscDetId = shower.first; + CSCEventData& cscData = findEventData(cscDetId, fedInfo); + + cscData.add(std::vector(shower.second.first, shower.second.second)); + } +} + void CSCDigiToRaw::add(const GEMPadDigiClusterCollection& gemPadClusters, FindEventDataInfo& fedInfo) const { for (const auto& jclus : gemPadClusters) { const GEMDetId& gemDetId = jclus.first; @@ -350,7 +360,9 @@ void CSCDigiToRaw::createFedBuffers(const CSCStripDigiCollection& stripDigis, const CSCALCTDigiCollection& alctDigis, const CSCCLCTDigiCollection& clctDigis, const CSCCLCTPreTriggerCollection* preTriggers, + const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis, + const CSCShowerDigiCollection* cscShowerDigis, const GEMPadDigiClusterCollection* gemPadDigiClusters, FEDRawDataCollection& fed_buffers, const CSCChamberMap* mapping, @@ -362,10 +374,16 @@ void CSCDigiToRaw::createFedBuffers(const CSCStripDigiCollection& stripDigis, //get fed object from fed_buffers // make a map from the index of a chamber to the event data from it FindEventDataInfo fedInfo{mapping, format_version}; - add(stripDigis, preTriggers, fedInfo, packEverything); + add(stripDigis, preTriggers, preTriggerDigis, fedInfo, packEverything); add(wireDigis, alctDigis, fedInfo, packEverything); add(comparatorDigis, clctDigis, fedInfo, packEverything); add(correlatedLCTDigis, fedInfo); + + // Starting Run-3, the CSC DAQ will pack/unpack CSC showers + if (cscShowerDigis) { + add(*cscShowerDigis, fedInfo); + } + // Starting Run-3, the CSC DAQ will pack/unpack GEM clusters if (gemPadDigiClusters) { add(*gemPadDigiClusters, fedInfo); diff --git a/EventFilter/CSCRawToDigi/src/CSCEventData.cc b/EventFilter/CSCRawToDigi/src/CSCEventData.cc index ccfd2957d214c..7723a6ba4be92 100644 --- a/EventFilter/CSCRawToDigi/src/CSCEventData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCEventData.cc @@ -506,6 +506,8 @@ void CSCEventData::add(const std::vector& digis) { theTMBData->tmbHeader()->add(digis); } +void CSCEventData::add(const std::vector& digis) { checkTMBClasses(); } + void CSCEventData::add(const std::vector& clusters, const GEMDetId&) { checkTMBClasses(); } std::ostream& operator<<(std::ostream& os, const CSCEventData& evt) { diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc b/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc index dbd8c0bd70961..4793af87d24bc 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc @@ -128,6 +128,11 @@ void CSCTMBHeader::add(const std::vector &digis) { addCorrelatedLCT1(digis[1]); } +void CSCTMBHeader::add(const std::vector &digis) { + if (!digis.empty()) + theHeaderFormat->addShower(digis[0]); +} + CSCTMBHeader2007 CSCTMBHeader::tmbHeader2007() const { CSCTMBHeader2007 *result = dynamic_cast(theHeaderFormat.get()); if (result == nullptr) { diff --git a/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py b/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py index 23387362c1219..59e2d45c27665 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py +++ b/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py @@ -39,8 +39,8 @@ # Write out special trigger collections writeOutAllCLCTs = cms.bool(False), writeOutAllALCTs = cms.bool(False), - savePreTriggers = cms.bool(False), - writeOutShowers = cms.bool(False), + savePreTriggers = cms.bool(True), + writeOutShowers = cms.bool(True), commonParam = auxPSets.commonParam.clone(), mpcParam = auxPSets.mpcParamRun1.clone(),