From e9afbfd228e7e666b560c33b55ee3d28242d803c Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 15 Apr 2021 11:58:30 -0500 Subject: [PATCH 1/5] Load CLCT pre-trigger digis --- .../CSCRawToDigi/interface/CSCDigiToRaw.h | 7 +++- .../plugins/CSCDigiToRawModule.cc | 40 +++++++++---------- .../CSCRawToDigi/python/cscPacker_cfi.py | 20 ++-------- .../CSCRawToDigi/python/cscUnpacker_cfi.py | 4 +- EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc | 4 +- 5 files changed, 31 insertions(+), 44 deletions(-) diff --git a/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h b/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h index 07a5111d24749..590f79d23d9da 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,6 +13,7 @@ #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/GEMDigi/interface/GEMPadDigiClusterCollection.h" #include "EventFilter/CSCRawToDigi/interface/CSCEventData.h" @@ -34,6 +35,7 @@ class CSCDigiToRaw { const CSCALCTDigiCollection& alctDigis, const CSCCLCTDigiCollection& clctDigis, const CSCCLCTPreTriggerCollection* preTriggers, + const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis, const GEMPadDigiClusterCollection* padDigiClusters, FEDRawDataCollection& fed_buffers, @@ -55,6 +57,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, diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc b/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc index 95c78b7da29b8..15ed7b13f800d 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc @@ -28,6 +28,7 @@ #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/GEMDigi/interface/GEMPadDigiClusterCollection.h" @@ -62,6 +63,7 @@ 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::ESGetToken cham_token; edm::EDGetTokenT gem_token; @@ -70,8 +72,6 @@ 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 @@ -83,6 +83,7 @@ CSCDigiToRawModule::CSCDigiToRawModule(const edm::ParameterSet& pset) : packer_( 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")); @@ -95,23 +96,6 @@ CSCDigiToRawModule::CSCDigiToRawModule(const edm::ParameterSet& pset) : packer_( } 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) @@ -127,6 +111,7 @@ 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")); @@ -137,7 +122,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,15 +140,25 @@ 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); @@ -175,6 +170,7 @@ void CSCDigiToRawModule::produce(edm::StreamID, edm::Event& e, const edm::EventS *alctDigis, *clctDigis, preTriggersPtr, + preTriggerDigisPtr, *correlatedLCTDigis, padDigiClustersPtr, fed_buffers, diff --git a/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py b/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py index cb027f09fa676..e31eeec2b0123 100644 --- a/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py +++ b/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py @@ -1,22 +1,8 @@ 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 diff --git a/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py b/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py index fc753203eebe1..d79b3aa51172c 100644 --- a/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py +++ b/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py @@ -1,9 +1,9 @@ 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 = muonCSCDCCUnpacker.clone() -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 diff --git a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc index 66f933d7c83f2..d8564253b03fb 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) { @@ -350,6 +351,7 @@ void CSCDigiToRaw::createFedBuffers(const CSCStripDigiCollection& stripDigis, const CSCALCTDigiCollection& alctDigis, const CSCCLCTDigiCollection& clctDigis, const CSCCLCTPreTriggerCollection* preTriggers, + const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis, const GEMPadDigiClusterCollection* gemPadDigiClusters, FEDRawDataCollection& fed_buffers, @@ -362,7 +364,7 @@ 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); From dcc1fab866e63f78affe4f0bb9b756c365bbe44d Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 15 Apr 2021 12:01:13 -0500 Subject: [PATCH 2/5] Skeleton code to pack CSC showers --- .../CSCRawToDigi/interface/CSCDigiToRaw.h | 3 +++ .../CSCRawToDigi/interface/CSCEventData.h | 1 + .../CSCRawToDigi/interface/CSCTMBHeader.h | 2 ++ .../interface/CSCVTMBHeaderFormat.h | 2 ++ .../CSCRawToDigi/plugins/CSCDCCUnpacker.cc | 18 +++++++++++++++++- .../CSCRawToDigi/plugins/CSCDigiToRawModule.cc | 17 +++++++++++++++++ EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc | 16 ++++++++++++++++ EventFilter/CSCRawToDigi/src/CSCEventData.cc | 2 ++ EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc | 5 +++++ 9 files changed, 65 insertions(+), 1 deletion(-) diff --git a/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h b/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h index 590f79d23d9da..75a1b72daf2c8 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h +++ b/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h @@ -15,6 +15,7 @@ #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" @@ -37,6 +38,7 @@ class CSCDigiToRaw { const CSCCLCTPreTriggerCollection* preTriggers, const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis, + const CSCShowerDigiCollection* showerDigis, const GEMPadDigiClusterCollection* padDigiClusters, FEDRawDataCollection& fed_buffers, const CSCChamberMap* theMapping, @@ -72,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/CSCVTMBHeaderFormat.h b/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h index 5a079e0261a58..ee13cece1ce16 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; + void addShower(const CSCShowerDigi& digi) {} 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 15ed7b13f800d..f250bd3d93e3e 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc @@ -30,6 +30,7 @@ #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 { @@ -54,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_; @@ -65,6 +67,7 @@ class CSCDigiToRawModule : public edm::global::EDProducer<> { edm::EDGetTokenT pr_token; edm::EDGetTokenT prdigi_token; edm::EDGetTokenT co_token; + edm::EDGetTokenT shower_token; edm::ESGetToken cham_token; edm::EDGetTokenT gem_token; @@ -78,6 +81,7 @@ CSCDigiToRawModule::CSCDigiToRawModule(const edm::ParameterSet& pset) : packer_( // 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")); @@ -92,6 +96,9 @@ 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"); } @@ -104,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")); @@ -114,6 +122,7 @@ void CSCDigiToRawModule::fillDescriptions(edm::ConfigurationDescriptions& descri 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); @@ -163,6 +172,13 @@ void CSCDigiToRawModule::produce(edm::StreamID, edm::Event& e, const edm::EventS 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, @@ -172,6 +188,7 @@ void CSCDigiToRawModule::produce(edm::StreamID, edm::Event& e, const edm::EventS preTriggersPtr, preTriggerDigisPtr, *correlatedLCTDigis, + cscShowerDigisPtr, padDigiClustersPtr, fed_buffers, theMapping, diff --git a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc index d8564253b03fb..d0a9fd2f21c10 100644 --- a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc +++ b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc @@ -333,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; @@ -353,6 +362,7 @@ void CSCDigiToRaw::createFedBuffers(const CSCStripDigiCollection& stripDigis, const CSCCLCTPreTriggerCollection* preTriggers, const CSCCLCTPreTriggerDigiCollection* preTriggerDigis, const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis, + const CSCShowerDigiCollection* cscShowerDigis, const GEMPadDigiClusterCollection* gemPadDigiClusters, FEDRawDataCollection& fed_buffers, const CSCChamberMap* mapping, @@ -368,6 +378,12 @@ void CSCDigiToRaw::createFedBuffers(const CSCStripDigiCollection& stripDigis, 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) { From 89d23b66c0a8a792214f2131c1547211343a8a23 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Apr 2021 09:10:08 -0500 Subject: [PATCH 3/5] Save pretriggers --- .../python/cscTriggerPrimitiveDigis_cfi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(), From 1b8cdb6420b356e7ad56b23eb161a2e9fc9a0ee1 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 23 Apr 2021 20:29:49 -0500 Subject: [PATCH 4/5] Comments by Slava --- .../CSCRawToDigi/python/cscPacker_cfi.py | 12 ++++---- .../CSCRawToDigi/python/cscUnpacker_cfi.py | 28 ++++--------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py b/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py index e31eeec2b0123..57cfec0c0ddc0 100644 --- a/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py +++ b/EventFilter/CSCRawToDigi/python/cscPacker_cfi.py @@ -9,11 +9,13 @@ ## # 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 d79b3aa51172c..ff699fe62f890 100644 --- a/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py +++ b/EventFilter/CSCRawToDigi/python/cscUnpacker_cfi.py @@ -2,30 +2,12 @@ # Import from the generic cfi file for CSC unpacking from EventFilter.CSCRawToDigi.muonCSCDCCUnpacker_cfi import muonCSCDCCUnpacker -muonCSCDigis = 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 ) From dce3bc41a1a5b5404b13882e01a8676376b62946 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 26 Apr 2021 08:38:10 -0500 Subject: [PATCH 5/5] Comments by Slava --- EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h | 1 + EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h | 1 + EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h | 1 + EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h | 1 + EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) 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 ee13cece1ce16..2f32bc8dbe0c9 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h +++ b/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h @@ -57,7 +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; - void addShower(const CSCShowerDigi& digi) {} + virtual void addShower(const CSCShowerDigi& digi) = 0; virtual void print(std::ostream& os) const = 0;