CMS 3D CMS Logo

CSCDigiToRawModule.cc
Go to the documentation of this file.
1 
16 
22 
24 
33 
34 namespace edm {
36 }
37 
38 class CSCDigiToRaw;
39 
41 public:
44 
45  // Operations
46  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
47 
48  // Fill parameters descriptions
49  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
50 
51 private:
52  unsigned int theFormatVersion; // Select which version of data format to use Pre-LS1: 2005, Post-LS1: 2013
53  bool usePreTriggers; // Select if to use Pre-Triigers CLCT digis
54  bool packEverything_; // bypass all cuts and (pre)trigger requirements
55  bool useGEMs_;
56 
57  std::unique_ptr<const CSCDigiToRaw> packer_;
58 
68 
70 };
71 
73  //theStrip = pset.getUntrackedParameter<string>("DigiCreator", "cscunpacker");
74 
75  theFormatVersion = pset.getParameter<unsigned int>("useFormatVersion"); // pre-LS1 - '2005'. post-LS1 - '2013'
76  usePreTriggers = pset.getParameter<bool>("usePreTriggers"); // disable checking CLCT PreTriggers digis
77  packEverything_ = pset.getParameter<bool>("packEverything"); // don't check for consistency with trig primitives
78  // overrides usePreTriggers
79 
80  useGEMs_ = pset.getParameter<bool>("useGEMs");
81  wd_token = consumes<CSCWireDigiCollection>(pset.getParameter<edm::InputTag>("wireDigiTag"));
82  sd_token = consumes<CSCStripDigiCollection>(pset.getParameter<edm::InputTag>("stripDigiTag"));
83  cd_token = consumes<CSCComparatorDigiCollection>(pset.getParameter<edm::InputTag>("comparatorDigiTag"));
84  if (usePreTriggers) {
85  pr_token = consumes<CSCCLCTPreTriggerCollection>(pset.getParameter<edm::InputTag>("preTriggerTag"));
86  }
87  al_token = consumes<CSCALCTDigiCollection>(pset.getParameter<edm::InputTag>("alctDigiTag"));
88  cl_token = consumes<CSCCLCTDigiCollection>(pset.getParameter<edm::InputTag>("clctDigiTag"));
89  co_token = consumes<CSCCorrelatedLCTDigiCollection>(pset.getParameter<edm::InputTag>("correlatedLCTDigiTag"));
90  cham_token = esConsumes<CSCChamberMap, CSCChamberMapRcd>();
91  if (useGEMs_) {
92  gem_token = consumes<GEMPadDigiClusterCollection>(pset.getParameter<edm::InputTag>("padDigiClusterTag"));
93  }
94  put_token_ = produces<FEDRawDataCollection>("CSCRawData");
95 }
96 
98  /*** From python/cscPacker_cfi.py
99  wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"),
100  stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"),
101  comparatorDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"),
102  alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
103  clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
104  preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
105  correlatedLCTDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"),
106  # if min parameter = -999 always accept
107  alctWindowMin = cms.int32(-3),
108  alctWindowMax = cms.int32(3),
109  clctWindowMin = cms.int32(-3),
110  clctWindowMax = cms.int32(3),
111  preTriggerWindowMin = cms.int32(-3),
112  preTriggerWindowMax = cms.int32(1)
113 */
114 
116 
117  desc.add<unsigned int>("useFormatVersion", 2005)
118  ->setComment("Set to 2005 for pre-LS1 CSC data format, 2013 - new post-LS1 CSC data format");
119  desc.add<bool>("usePreTriggers", true)->setComment("Set to false if CSCCLCTPreTrigger digis are not available");
120  desc.add<bool>("packEverything", false)
121  ->setComment("Set to true to disable trigger-related constraints on readout data");
122  desc.add<bool>("useGEMs", false)->setComment("Pack GEM trigger data");
123 
124  desc.add<edm::InputTag>("wireDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCWireDigi"));
125  desc.add<edm::InputTag>("stripDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCStripDigi"));
126  desc.add<edm::InputTag>("comparatorDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCComparatorDigi"));
127  desc.add<edm::InputTag>("alctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
128  desc.add<edm::InputTag>("clctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
129  desc.add<edm::InputTag>("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
130  desc.add<edm::InputTag>("correlatedLCTDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"));
131  desc.add<edm::InputTag>("padDigiClusterTag", edm::InputTag("simMuonGEMPadDigiClusters"));
132 
133  desc.add<int32_t>("alctWindowMin", -3)->setComment("If min parameter = -999 always accept");
134  desc.add<int32_t>("alctWindowMax", 3);
135  desc.add<int32_t>("clctWindowMin", -3)->setComment("If min parameter = -999 always accept");
136  desc.add<int32_t>("clctWindowMax", 3);
137  desc.add<int32_t>("preTriggerWindowMin", -3)->setComment("If min parameter = -999 always accept");
138  desc.add<int32_t>("preTriggerWindowMax", 1);
139 
140  descriptions.add("cscPacker", desc);
141 }
142 
145  edm::ESHandle<CSCChamberMap> hcham = c.getHandle(cham_token);
146  const CSCChamberMap* theMapping = hcham.product();
147 
148  FEDRawDataCollection fed_buffers;
149 
150  // Take digis from the event
157 
158  e.getByToken(wd_token, wireDigis);
159  e.getByToken(sd_token, stripDigis);
160  e.getByToken(cd_token, comparatorDigis);
161  e.getByToken(al_token, alctDigis);
162  e.getByToken(cl_token, clctDigis);
163  CSCCLCTPreTriggerCollection const* preTriggersPtr = nullptr;
164  if (usePreTriggers)
165  preTriggersPtr = &e.get(pr_token);
166  e.getByToken(co_token, correlatedLCTDigis);
167  const GEMPadDigiClusterCollection* padDigiClustersPtr = nullptr;
168  if (useGEMs_) {
169  padDigiClustersPtr = &e.get(gem_token);
170  }
171  // Create the packed data
172  packer_->createFedBuffers(*stripDigis,
173  *wireDigis,
174  *comparatorDigis,
175  *alctDigis,
176  *clctDigis,
177  preTriggersPtr,
178  *correlatedLCTDigis,
179  padDigiClustersPtr,
180  fed_buffers,
181  theMapping,
182  e.id(),
185 
186  // put the raw data to the event
187  e.emplace(put_token_, std::move(fed_buffers));
188 }
189 
ConfigurationDescriptions.h
CSCCLCTPreTriggerCollection
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::StreamID
Definition: StreamID.h:30
CSCDigiToRawModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CSCDigiToRawModule.cc:97
Handle.h
CSCCorrelatedLCTDigiCollection.h
CSCDigiToRawModule::usePreTriggers
bool usePreTriggers
Definition: CSCDigiToRawModule.cc:53
ESHandle.h
CSCChamberMapRcd.h
edm::EDGetTokenT< CSCWireDigiCollection >
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT< FEDRawDataCollection >
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CSCDigiToRawModule::sd_token
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
Definition: CSCDigiToRawModule.cc:60
CSCCLCTPreTriggerCollection.h
edm::Handle< CSCWireDigiCollection >
ESGetToken.h
CSCDigiToRawModule::wd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
Definition: CSCDigiToRawModule.cc:59
CSCDigiToRawModule::theFormatVersion
unsigned int theFormatVersion
Definition: CSCDigiToRawModule.cc:52
CSCDigiToRawModule::al_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
Definition: CSCDigiToRawModule.cc:62
CSCDigiToRaw
Definition: CSCDigiToRaw.h:25
GEMPadDigiClusterCollection.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CSCDigiToRawModule::co_token
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
Definition: CSCDigiToRawModule.cc:65
edm::ESHandle
Definition: DTSurvey.h:22
CSCDigiToRawModule::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: CSCDigiToRawModule.cc:143
CSCDigiToRawModule::useGEMs_
bool useGEMs_
Definition: CSCDigiToRawModule.cc:55
GEMPadDigiClusterCollection
ParameterSetDescription.h
CSCDigiToRawModule::gem_token
edm::EDGetTokenT< GEMPadDigiClusterCollection > gem_token
Definition: CSCDigiToRawModule.cc:67
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
CSCDigiToRawModule::cd_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
Definition: CSCDigiToRawModule.cc:61
CSCDigiToRawModule::put_token_
edm::EDPutTokenT< FEDRawDataCollection > put_token_
Definition: CSCDigiToRawModule.cc:69
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
CSCDigiToRawModule::pr_token
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
Definition: CSCDigiToRawModule.cc:64
CSCChamberMap
Definition: CSCChamberMap.h:11
FEDRawDataCollection.h
CSCDigiToRawModule::cham_token
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd > cham_token
Definition: CSCDigiToRawModule.cc:66
CSCStripDigiCollection.h
edm::EventSetup
Definition: EventSetup.h:57
CSCDigiToRawModule::cl_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
Definition: CSCDigiToRawModule.cc:63
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
CSCDigiToRawModule::packEverything_
bool packEverything_
Definition: CSCDigiToRawModule.cc:54
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd >
InputTag.h
CSCDigiToRawModule
Definition: CSCDigiToRawModule.cc:40
CSCDigiToRawModule::CSCDigiToRawModule
CSCDigiToRawModule(const edm::ParameterSet &pset)
Constructor.
Definition: CSCDigiToRawModule.cc:72
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ConfigurationDescriptions
CSCDigiToRaw.h
CSCDigiToRawModule::packer_
std::unique_ptr< const CSCDigiToRaw > packer_
Definition: CSCDigiToRawModule.cc:57
EventSetup.h
CSCComparatorDigiCollection.h
CSCWireDigiCollection.h
CSCALCTDigiCollection.h
ConsumesCollector.h
ParameterSet.h
CSCCLCTDigiCollection.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37