CMS 3D CMS Logo

CSCViewDigi.cc
Go to the documentation of this file.
1 // Original Author: Alexandre Sakharov
2 // Created: Sun May 10 15:43:28 CEST 2009
3 
4 #include <memory>
5 #include <iostream>
6 
13 
27 
29 public:
30  explicit CSCViewDigi(const edm::ParameterSet&);
31  ~CSCViewDigi() override;
32 
33 private:
34  void analyze(const edm::Event&, const edm::EventSetup&) override;
35  void endJob() override;
36 
41 
57 };
58 
60  wd_token = consumes<CSCWireDigiCollection>(conf.getParameter<edm::InputTag>("wireDigiTag"));
61  sd_token = consumes<CSCStripDigiCollection>(conf.getParameter<edm::InputTag>("stripDigiTag"));
62  cd_token = consumes<CSCComparatorDigiCollection>(conf.getParameter<edm::InputTag>("comparatorDigiTag"));
63  rd_token = consumes<CSCRPCDigiCollection>(conf.getParameter<edm::InputTag>("rpcDigiTag"));
64  al_token = consumes<CSCALCTDigiCollection>(conf.getParameter<edm::InputTag>("alctDigiTag"));
65  cl_token = consumes<CSCCLCTDigiCollection>(conf.getParameter<edm::InputTag>("clctDigiTag"));
66  co_token = consumes<CSCCorrelatedLCTDigiCollection>(conf.getParameter<edm::InputTag>("corrclctDigiTag"));
67  st_token = consumes<CSCDCCFormatStatusDigiCollection>(conf.getParameter<edm::InputTag>("statusDigiTag"));
68  dd_token = consumes<CSCDDUStatusDigiCollection>(conf.getParameter<edm::InputTag>("DDUstatusDigiTag"));
69  dc_token = consumes<CSCDCCStatusDigiCollection>(conf.getParameter<edm::InputTag>("DCCstatusDigiTag"));
70  gem_token = consumes<GEMPadDigiClusterCollection>(conf.getParameter<edm::InputTag>("gemPadsDigiTag"));
71  lct_shwr_token = consumes<CSCShowerDigiCollection>(conf.getParameter<edm::InputTag>("lctShowerDigiTag"));
72  anode_shwr_token = consumes<CSCShowerDigiCollection>(conf.getParameter<edm::InputTag>("anodeShowerDigiTag"));
73  cathode_shwr_token = consumes<CSCShowerDigiCollection>(conf.getParameter<edm::InputTag>("cathodeShowerDigiTag"));
75  consumes<CSCShowerDigiCollection>(conf.getParameter<edm::InputTag>("alct_anodeShowerDigiTag"));
76 
77  WiresDigiDump = conf.getUntrackedParameter<bool>("WiresDigiDump", false);
78  StripDigiDump = conf.getUntrackedParameter<bool>("StripDigiDump", false);
79  ComparatorDigiDump = conf.getUntrackedParameter<bool>("ComparatorDigiDump", false);
80  RpcDigiDump = conf.getUntrackedParameter<bool>("RpcDigiDump", false);
81  AlctDigiDump = conf.getUntrackedParameter<bool>("AlctDigiDump", false);
82  ClctDigiDump = conf.getUntrackedParameter<bool>("ClctDigiDump", false);
83  CorrClctDigiDump = conf.getUntrackedParameter<bool>("CorrClctDigiDump", false);
84  StatusDigiDump = conf.getUntrackedParameter<bool>("StatusDigiDump", false);
85  DDUStatusDigiDump = conf.getUntrackedParameter<bool>("DDUStatus", false);
86  DCCStatusDigiDump = conf.getUntrackedParameter<bool>("DCCStatus", false);
87  gemPadsDigiDump = conf.getUntrackedParameter<bool>("GEMPadsDigiDump", false);
88  showerDigiDump = conf.getUntrackedParameter<bool>("ShowerDigiDump", false);
89 }
90 
92 
94  using namespace edm;
95 
110  edm::Handle<CSCShowerDigiCollection> alct_anodeShower;
111 
112  iEvent.getByToken(wd_token, wires);
113  iEvent.getByToken(sd_token, strips);
114  iEvent.getByToken(cd_token, comparators);
115  iEvent.getByToken(rd_token, rpcs);
116  iEvent.getByToken(al_token, alcts);
117  iEvent.getByToken(cl_token, clcts);
118  iEvent.getByToken(co_token, correlatedlcts);
119 
120  if (StatusDigiDump)
121  iEvent.getByToken(st_token, statusdigis);
122 
123  if (DDUStatusDigiDump)
124  iEvent.getByToken(dd_token, DDUstatusdigi);
125 
126  if (DCCStatusDigiDump)
127  iEvent.getByToken(dc_token, DCCstatusdigi);
128 
129  if (gemPadsDigiDump)
130  iEvent.getByToken(gem_token, gemPadsClusters);
131 
132  if (showerDigiDump) {
133  iEvent.getByToken(lct_shwr_token, lctShower);
134  iEvent.getByToken(anode_shwr_token, anodeShower);
136  iEvent.getByToken(alct_anode_shwr_token, alct_anodeShower);
137  }
138 
139  if (WiresDigiDump) {
140  edm::LogVerbatim("ViewDigi") << std::endl;
141  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
142  edm::LogVerbatim("ViewDigi") << std::endl;
143  edm::LogVerbatim("ViewDigi") << "********WIRES Digis********" << std::endl;
144  for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); j++) {
145  edm::LogVerbatim("ViewDigi") << "Wire digis from " << CSCDetId((*j).first) << std::endl;
146  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
147  std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
148  for (; digiItr != last; ++digiItr) {
149  digiItr->print();
150  }
151  }
152  }
153 
154  if (StripDigiDump) {
155  edm::LogVerbatim("ViewDigi") << std::endl;
156  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
157  edm::LogVerbatim("ViewDigi") << std::endl;
158  edm::LogVerbatim("ViewDigi") << "********STRIPS Digis********" << std::endl;
159  for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); j++) {
160  edm::LogVerbatim("ViewDigi") << "Strip digis from " << CSCDetId((*j).first) << std::endl;
161  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
162  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
163  for (; digiItr != last; ++digiItr) {
164  digiItr->print();
165  }
166  }
167  }
168 
169  if (ComparatorDigiDump) {
170  edm::LogVerbatim("ViewDigi") << std::endl;
171  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
172  edm::LogVerbatim("ViewDigi") << std::endl;
173  edm::LogVerbatim("ViewDigi") << "********COMPARATOR Digis********" << std::endl;
174  for (CSCComparatorDigiCollection::DigiRangeIterator j = comparators->begin(); j != comparators->end(); j++) {
175  edm::LogVerbatim("ViewDigi") << "Comparator digis from " << CSCDetId((*j).first) << std::endl;
176  std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first;
177  std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second;
178  for (; digiItr != last; ++digiItr) {
179  digiItr->print();
180  }
181  }
182  }
183 
184  if (RpcDigiDump) {
185  edm::LogVerbatim("ViewDigi") << std::endl;
186  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
187  edm::LogVerbatim("ViewDigi") << std::endl;
188  edm::LogVerbatim("ViewDigi") << "********RPC Digis********" << std::endl;
189  for (CSCRPCDigiCollection::DigiRangeIterator j = rpcs->begin(); j != rpcs->end(); j++) {
190  edm::LogVerbatim("ViewDigi") << "RPC digis from " << CSCDetId((*j).first) << std::endl;
191  std::vector<CSCRPCDigi>::const_iterator digiItr = (*j).second.first;
192  std::vector<CSCRPCDigi>::const_iterator last = (*j).second.second;
193  for (; digiItr != last; ++digiItr) {
194  digiItr->print();
195  }
196  }
197  }
198 
199  if (AlctDigiDump) {
200  edm::LogVerbatim("ViewDigi") << std::endl;
201  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
202  edm::LogVerbatim("ViewDigi") << std::endl;
203  edm::LogVerbatim("ViewDigi") << "********ALCT Digis********" << std::endl;
204  for (CSCALCTDigiCollection::DigiRangeIterator j = alcts->begin(); j != alcts->end(); j++) {
205  std::vector<CSCALCTDigi>::const_iterator digiItr = (*j).second.first;
206  std::vector<CSCALCTDigi>::const_iterator last = (*j).second.second;
207  for (; digiItr != last; ++digiItr) {
208  digiItr->print();
209  }
210  }
211  }
212 
213  if (ClctDigiDump) {
214  edm::LogVerbatim("ViewDigi") << std::endl;
215  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
216  edm::LogVerbatim("ViewDigi") << std::endl;
217  edm::LogVerbatim("ViewDigi") << "********CLCT Digis********" << std::endl;
218  for (CSCCLCTDigiCollection::DigiRangeIterator j = clcts->begin(); j != clcts->end(); j++) {
219  std::vector<CSCCLCTDigi>::const_iterator digiItr = (*j).second.first;
220  std::vector<CSCCLCTDigi>::const_iterator last = (*j).second.second;
221  for (; digiItr != last; ++digiItr) {
222  digiItr->print();
223  }
224  }
225  }
226 
227  if (CorrClctDigiDump) {
228  edm::LogVerbatim("ViewDigi") << std::endl;
229  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
230  edm::LogVerbatim("ViewDigi") << std::endl;
231  edm::LogVerbatim("ViewDigi") << "********CorrelatedLCT Digis********" << std::endl;
232  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j = correlatedlcts->begin(); j != correlatedlcts->end();
233  j++) {
234  std::vector<CSCCorrelatedLCTDigi>::const_iterator digiItr = (*j).second.first;
235  std::vector<CSCCorrelatedLCTDigi>::const_iterator last = (*j).second.second;
236  for (; digiItr != last; ++digiItr) {
237  digiItr->print();
238  }
239  }
240  }
241 
242  if (StatusDigiDump) {
243  edm::LogVerbatim("ViewDigi") << std::endl;
244  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
245  edm::LogVerbatim("ViewDigi") << std::endl;
246  edm::LogVerbatim("ViewDigi") << "********STATUS Digis********" << std::endl;
247  for (CSCDCCFormatStatusDigiCollection::DigiRangeIterator j = statusdigis->begin(); j != statusdigis->end(); j++) {
248  std::vector<CSCDCCFormatStatusDigi>::const_iterator digiItr = (*j).second.first;
249  std::vector<CSCDCCFormatStatusDigi>::const_iterator last = (*j).second.second;
250  for (; digiItr != last; ++digiItr) {
251  digiItr->print();
252  }
253  }
254  }
255 
256  if (DDUStatusDigiDump) {
257  edm::LogVerbatim("ViewDigi") << std::endl;
258  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
259  edm::LogVerbatim("ViewDigi") << std::endl;
260  edm::LogVerbatim("ViewDigi") << "********DDU STATUS Digis********" << std::endl;
261  for (CSCDDUStatusDigiCollection::DigiRangeIterator j = DDUstatusdigi->begin(); j != DDUstatusdigi->end(); j++) {
262  std::vector<CSCDDUStatusDigi>::const_iterator digiItr = (*j).second.first;
263  std::vector<CSCDDUStatusDigi>::const_iterator last = (*j).second.second;
264  for (; digiItr != last; ++digiItr) {
265  digiItr->print();
266  }
267  }
268  }
269 
270  if (DCCStatusDigiDump) {
271  edm::LogVerbatim("ViewDigi") << std::endl;
272  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
273  edm::LogVerbatim("ViewDigi") << std::endl;
274  edm::LogVerbatim("ViewDigi") << "********DCC STATUS Digis********" << std::endl;
275  for (CSCDCCStatusDigiCollection::DigiRangeIterator j = DCCstatusdigi->begin(); j != DCCstatusdigi->end(); j++) {
276  std::vector<CSCDCCStatusDigi>::const_iterator digiItr = (*j).second.first;
277  std::vector<CSCDCCStatusDigi>::const_iterator last = (*j).second.second;
278  for (; digiItr != last; ++digiItr) {
279  digiItr->print();
280  }
281  }
282  }
283 
284  if (showerDigiDump) {
285  edm::LogVerbatim("ViewDigi") << std::endl;
286  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
287  edm::LogVerbatim("ViewDigi") << std::endl;
288  edm::LogVerbatim("ViewDigi") << "********lct Shower Digis********" << std::endl;
289  for (CSCShowerDigiCollection::DigiRangeIterator j = lctShower->begin(); j != lctShower->end(); j++) {
290  std::vector<CSCShowerDigi>::const_iterator digiItr = (*j).second.first;
291  std::vector<CSCShowerDigi>::const_iterator last = (*j).second.second;
292  for (; digiItr != last; ++digiItr) {
293  edm::LogVerbatim("ViewDigi") << *digiItr << std::endl;
294  }
295  }
296 
297  edm::LogVerbatim("ViewDigi") << "********cathode Shower Digis********" << std::endl;
299  std::vector<CSCShowerDigi>::const_iterator digiItr = (*j).second.first;
300  std::vector<CSCShowerDigi>::const_iterator last = (*j).second.second;
301  for (; digiItr != last; ++digiItr) {
302  edm::LogVerbatim("ViewDigi") << *digiItr << std::endl;
303  }
304  }
305 
306  edm::LogVerbatim("ViewDigi") << "********anode Shower Digis********" << std::endl;
307  for (CSCShowerDigiCollection::DigiRangeIterator j = anodeShower->begin(); j != anodeShower->end(); j++) {
308  std::vector<CSCShowerDigi>::const_iterator digiItr = (*j).second.first;
309  std::vector<CSCShowerDigi>::const_iterator last = (*j).second.second;
310  for (; digiItr != last; ++digiItr) {
311  edm::LogVerbatim("ViewDigi") << *digiItr << std::endl;
312  }
313  }
314 
315  edm::LogVerbatim("ViewDigi") << "********ALCT anode Shower Digis********" << std::endl;
316  for (CSCShowerDigiCollection::DigiRangeIterator j = alct_anodeShower->begin(); j != alct_anodeShower->end(); j++) {
317  std::vector<CSCShowerDigi>::const_iterator digiItr = (*j).second.first;
318  std::vector<CSCShowerDigi>::const_iterator last = (*j).second.second;
319  for (; digiItr != last; ++digiItr) {
320  if (digiItr->isValid())
321  edm::LogVerbatim("ViewDigi") << *digiItr << " bx: " << digiItr->getCSCID() << std::endl;
322  }
323  }
324  }
325 
326  if (gemPadsDigiDump) {
327  edm::LogVerbatim("ViewDigi") << std::endl;
328  edm::LogVerbatim("ViewDigi") << "Event " << iEvent.id() << std::endl;
329  edm::LogVerbatim("ViewDigi") << std::endl;
330  edm::LogVerbatim("ViewDigi") << "********GEMPadDigiCluster Digis********" << std::endl;
331  for (GEMPadDigiClusterCollection::DigiRangeIterator j = gemPadsClusters->begin(); j != gemPadsClusters->end();
332  j++) {
333  GEMDetId gemdetid = (*j).first;
334  std::vector<GEMPadDigiCluster>::const_iterator digiItr = (*j).second.first;
335  std::vector<GEMPadDigiCluster>::const_iterator last = (*j).second.second;
336  edm::LogVerbatim("ViewDigi") << "GEM" << gemdetid << std::endl;
337  for (; digiItr != last; ++digiItr) {
338  digiItr->print();
339  }
340  }
341  }
342 
343 #ifdef THIS_IS_AN_EVENT_EXAMPLE
345  iEvent.getByLabel("example", pIn);
346 #endif
347 
348 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
349  ESHandle<SetupData> pSetup;
350  iSetup.get<SetupRecord>().get(pSetup);
351 #endif
352 }
353 
354 // ------------ method called once each job just after ending the event loop ------------
356 
357 //define this as a plug-in
Log< level::Info, true > LogVerbatim
edm::EDGetTokenT< CSCShowerDigiCollection > alct_anode_shwr_token
Definition: CSCViewDigi.cc:56
bool DDUStatusDigiDump
Definition: CSCViewDigi.cc:39
bool CorrClctDigiDump
Definition: CSCViewDigi.cc:37
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool RpcDigiDump
Definition: CSCViewDigi.cc:38
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
Definition: CSCViewDigi.cc:48
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CSCViewDigi(const edm::ParameterSet &)
Definition: CSCViewDigi.cc:59
edm::EDGetTokenT< CSCRPCDigiCollection > rd_token
Definition: CSCViewDigi.cc:45
bool WiresDigiDump
Definition: CSCViewDigi.cc:37
anodeShower
settings for anode showers (counting CSCWireDigi)
Definition: showerParams.py:51
edm::EDGetTokenT< CSCShowerDigiCollection > cathode_shwr_token
Definition: CSCViewDigi.cc:55
bool StatusDigiDump
Definition: CSCViewDigi.cc:38
bool ClctDigiDump
Definition: CSCViewDigi.cc:37
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
Definition: CSCViewDigi.cc:44
T getUntrackedParameter(std::string const &, T const &) const
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< CSCDCCFormatStatusDigiCollection > st_token
Definition: CSCViewDigi.cc:49
bool DCCStatusDigiDump
Definition: CSCViewDigi.cc:39
bool ComparatorDigiDump
Definition: CSCViewDigi.cc:38
bool gemPadsDigiDump
Definition: CSCViewDigi.cc:40
edm::EDGetTokenT< CSCShowerDigiCollection > lct_shwr_token
Definition: CSCViewDigi.cc:53
T get() const
Definition: EventSetup.h:82
bool showerDigiDump
Definition: CSCViewDigi.cc:40
DigiRangeIterator begin() const
void endJob() override
Definition: CSCViewDigi.cc:355
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
Definition: CSCViewDigi.cc:47
edm::EDGetTokenT< CSCShowerDigiCollection > anode_shwr_token
Definition: CSCViewDigi.cc:54
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CSCViewDigi.cc:93
edm::EDGetTokenT< CSCDCCStatusDigiCollection > dc_token
Definition: CSCViewDigi.cc:51
edm::EDGetTokenT< GEMPadDigiClusterCollection > gem_token
Definition: CSCViewDigi.cc:52
edm::EDGetTokenT< CSCDDUStatusDigiCollection > dd_token
Definition: CSCViewDigi.cc:50
HLT enums.
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
Definition: CSCViewDigi.cc:42
cathodeShower
settings for cathode showers (counting CSCComparatorDigi)
Definition: showerParams.py:19
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
bool StripDigiDump
Definition: CSCViewDigi.cc:38
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
Definition: CSCViewDigi.cc:46
~CSCViewDigi() override
Definition: CSCViewDigi.cc:91
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
Definition: CSCViewDigi.cc:43
DigiRangeIterator end() const
bool AlctDigiDump
Definition: CSCViewDigi.cc:37