CMS 3D CMS Logo

GlobalDigisProducer.cc
Go to the documentation of this file.
1 
12 
14  : fName(""),
15  verbosity(0),
16  frequency(0),
17  label(""),
18  getAllProvenances(false),
19  printProvenanceInfo(false),
20  theCSCStripPedestalSum(0),
21  theCSCStripPedestalCount(0),
22  count(0) {
23  std::string MsgLoggerCat = "GlobalDigisProducer_GlobalDigisProducer";
24 
25  // get information from parameter set
26  fName = iPSet.getUntrackedParameter<std::string>("Name");
27  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
28  frequency = iPSet.getUntrackedParameter<int>("Frequency");
29  label = iPSet.getParameter<std::string>("Label");
30  edm::ParameterSet m_Prov = iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
31  getAllProvenances = m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
32  printProvenanceInfo = m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
33 
34  // get Labels to use to extract information
35  ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
36  ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
37  ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
38  HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
39  HCalDigi_ = iPSet.getParameter<edm::InputTag>("HCalDigi");
40  SiStripSrc_ = iPSet.getParameter<edm::InputTag>("SiStripSrc");
41  SiPxlSrc_ = iPSet.getParameter<edm::InputTag>("SiPxlSrc");
42  MuDTSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSrc");
43  MuCSCStripSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCStripSrc");
44  MuCSCWireSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCWireSrc");
45  // fix for consumes
46  ECalEBSrc_Token_ = consumes<EBDigiCollection>(iPSet.getParameter<edm::InputTag>("ECalEBSrc"));
47  ECalEESrc_Token_ = consumes<EEDigiCollection>(iPSet.getParameter<edm::InputTag>("ECalEESrc"));
48  ECalESSrc_Token_ = consumes<ESDigiCollection>(iPSet.getParameter<edm::InputTag>("ECalESSrc"));
49  HCalSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("HCalSrc"));
50  HBHEDigi_Token_ = consumes<edm::SortedCollection<HBHEDataFrame>>(iPSet.getParameter<edm::InputTag>("HCalDigi"));
51  HODigi_Token_ = consumes<edm::SortedCollection<HODataFrame>>(iPSet.getParameter<edm::InputTag>("HCalDigi"));
52  HFDigi_Token_ = consumes<edm::SortedCollection<HFDataFrame>>(iPSet.getParameter<edm::InputTag>("HCalDigi"));
53  SiStripSrc_Token_ = consumes<edm::DetSetVector<SiStripDigi>>(iPSet.getParameter<edm::InputTag>("SiStripSrc"));
54  SiPxlSrc_Token_ = consumes<edm::DetSetVector<PixelDigi>>(iPSet.getParameter<edm::InputTag>("SiPxlSrc"));
55  MuDTSrc_Token_ = consumes<DTDigiCollection>(iPSet.getParameter<edm::InputTag>("MuDTSrc"));
56  MuCSCStripSrc_Token_ = consumes<CSCStripDigiCollection>(iPSet.getParameter<edm::InputTag>("MuCSCStripSrc"));
57  MuCSCWireSrc_Token_ = consumes<CSCWireDigiCollection>(iPSet.getParameter<edm::InputTag>("MuCSCWireSrc"));
58  //
59  const std::string barrelHitsName("EcalHitsEB");
60  const std::string endcapHitsName("EcalHitsEE");
61  const std::string preshowerHitsName("EcalHitsES");
62  EBHits_Token_ = consumes<CrossingFrame<PCaloHit>>(edm::InputTag(std::string("mix"), std::string("barrelHitsName")));
63  EEHits_Token_ = consumes<CrossingFrame<PCaloHit>>(edm::InputTag(std::string("mix"), std::string("endcapHitsName")));
65  consumes<CrossingFrame<PCaloHit>>(edm::InputTag(std::string("mix"), std::string("preshowerHitsName")));
66 
70  // use value of first digit to determine default output level (inclusive)
71  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
72  verbosity %= 10;
73 
74  // create persistent object
75  produces<PGlobalDigi>(label);
76 
77  // print out Parameter Set information being used
78  if (verbosity >= 0) {
79  edm::LogInfo(MsgLoggerCat) << "\n===============================\n"
80  << "Initialized as EDProducer with parameter values:\n"
81  << " Name = " << fName << "\n"
82  << " Verbosity = " << verbosity << "\n"
83  << " Frequency = " << frequency << "\n"
84  << " Label = " << label << "\n"
85  << " GetProv = " << getAllProvenances << "\n"
86  << " PrintProv = " << printProvenanceInfo << "\n"
87  << " ECalEBSrc = " << ECalEBSrc_.label() << ":" << ECalEBSrc_.instance() << "\n"
88  << " ECalEESrc = " << ECalEESrc_.label() << ":" << ECalEESrc_.instance() << "\n"
89  << " ECalESSrc = " << ECalESSrc_.label() << ":" << ECalESSrc_.instance() << "\n"
90  << " HCalSrc = " << HCalSrc_.label() << ":" << HCalSrc_.instance() << "\n"
91  << " HCalDigi = " << HCalDigi_.label() << ":" << HCalDigi_.instance() << "\n"
92  << " SiStripSrc = " << SiStripSrc_.label() << ":" << SiStripSrc_.instance() << "\n"
93  << " SiPixelSrc = " << SiPxlSrc_.label() << ":" << SiPxlSrc_.instance() << "\n"
94  << " MuDTSrc = " << MuDTSrc_.label() << ":" << MuDTSrc_.instance() << "\n"
95  << " MuCSCStripSrc = " << MuCSCStripSrc_.label() << ":" << MuCSCStripSrc_.instance()
96  << "\n"
97  << " MuCSCWireSrc = " << MuCSCWireSrc_.label() << ":" << MuCSCWireSrc_.instance()
98  << "\n"
99  << "===============================\n";
100  }
101 
102  // set default constants
103  // ECal
104  ECalgainConv_[0] = 0.;
105  ECalgainConv_[1] = 1.;
106  ECalgainConv_[2] = 2.;
107  ECalgainConv_[3] = 12.;
108  ECalbarrelADCtoGeV_ = 0.035;
109  ECalendcapADCtoGeV_ = 0.06;
110 }
111 
113 
115  std::string MsgLoggerCat = "GlobalDigisProducer_beginJob";
116 
117  EcalMGPAGainRatio *defaultRatios = new EcalMGPAGainRatio();
118 
119  ECalgainConv_[0] = 0.;
120  ECalgainConv_[1] = 1.;
121  ECalgainConv_[2] = defaultRatios->gain12Over6();
122  ECalgainConv_[3] = ECalgainConv_[2] * (defaultRatios->gain6Over1());
123 
124  delete defaultRatios;
125 
126  if (verbosity >= 0) {
127  edm::LogInfo(MsgLoggerCat) << "Modified Calorimeter gain constants: g0 = " << ECalgainConv_[0]
128  << ", g1 = " << ECalgainConv_[1] << ", g2 = " << ECalgainConv_[2]
129  << ", g3 = " << ECalgainConv_[3];
130  // edm::LogInfo(MsgLoggerCat)
131  // << "Modified Calorimeter ADCtoGeV constants: barrel = "
132  // << ECalbarrelADCtoGeV_ << ", endcap = " << ECalendcapADCtoGeV_;
133  }
134 
135  // clear storage vectors
136  clear();
137  return;
138 }
139 
141  std::string MsgLoggerCat = "GlobalDigisProducer_endJob";
142  if (verbosity >= 0)
143  edm::LogInfo(MsgLoggerCat) << "Terminating having processed " << count << " events.";
144  return;
145 }
146 
148  std::string MsgLoggerCat = "GlobalDigisProducer_produce";
149 
150  // keep track of number of events processed
151  ++count;
152 
153  // THIS BLOCK MIGRATED HERE FROM beginJob:
154  // setup calorimeter constants from service
155  const EcalADCToGeVConstant *agc = &iSetup.getData(ecalADCtoGevToken_);
158  if (verbosity >= 0) {
159  edm::LogInfo(MsgLoggerCat) << "Modified Calorimeter ADCtoGeV constants: barrel = " << ECalbarrelADCtoGeV_
160  << ", endcap = " << ECalendcapADCtoGeV_;
161  }
162 
163  // get event id information
164  edm::RunNumber_t nrun = iEvent.id().run();
165  edm::EventNumber_t nevt = iEvent.id().event();
166 
167  if (verbosity > 0) {
168  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count << " events total)";
169  } else if (verbosity == 0) {
170  if (nevt % frequency == 0 || nevt == 1) {
171  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count
172  << " events total)";
173  }
174  }
175 
176  // clear event holders
177  clear();
178 
179  // look at information available in the event
180  if (getAllProvenances) {
181  std::vector<const edm::StableProvenance *> AllProv;
182  iEvent.getAllStableProvenance(AllProv);
183 
184  if (verbosity >= 0)
185  edm::LogInfo(MsgLoggerCat) << "Number of Provenances = " << AllProv.size();
186 
187  if (printProvenanceInfo && (verbosity >= 0)) {
188  TString eventout("\nProvenance info:\n");
189 
190  for (unsigned int i = 0; i < AllProv.size(); ++i) {
191  eventout += "\n ******************************";
192  eventout += "\n Module : ";
193  // eventout += (AllProv[i]->product).moduleLabel();
194  eventout += AllProv[i]->moduleLabel();
195  eventout += "\n ProductID : ";
196  // eventout += (AllProv[i]->product).productID_.id_;
197  eventout += AllProv[i]->productID().id();
198  eventout += "\n ClassName : ";
199  // eventout += (AllProv[i]->product).fullClassName_;
200  eventout += AllProv[i]->className();
201  eventout += "\n InstanceName : ";
202  // eventout += (AllProv[i]->product).productInstanceName_;
203  eventout += AllProv[i]->productInstanceName();
204  eventout += "\n BranchName : ";
205  // eventout += (AllProv[i]->product).branchName_;
206  eventout += AllProv[i]->branchName();
207  }
208  eventout += "\n ******************************\n";
209  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
210  printProvenanceInfo = false;
211  }
212  getAllProvenances = false;
213  }
214 
215  // call fill functions
216  // gather Ecal information from event
217  fillECal(iEvent, iSetup);
218  // gather Hcal information from event
219  fillHCal(iEvent, iSetup);
220  // gather Track information from event
221  fillTrk(iEvent, iSetup);
222  // gather Muon information from event
223  fillMuon(iEvent, iSetup);
224 
225  if (verbosity > 0)
226  edm::LogInfo(MsgLoggerCat) << "Done gathering data from event.";
227 
228  // produce object to put into event
229  std::unique_ptr<PGlobalDigi> pOut(new PGlobalDigi);
230 
231  if (verbosity > 2)
232  edm::LogInfo(MsgLoggerCat) << "Saving event contents:";
233 
234  // call store functions
235  // store ECal information in produce
236  storeECal(*pOut);
237  // store HCal information in produce
238  storeHCal(*pOut);
239  // store Track information in produce
240  storeTrk(*pOut);
241  // store Muon information in produce
242  storeMuon(*pOut);
243 
244  // store information in event
245  iEvent.put(std::move(pOut), label);
246 
247  return;
248 }
249 
251  std::string MsgLoggerCat = "GlobalDigisProducer_fillECal";
252 
253  TString eventout;
254  if (verbosity > 0)
255  eventout = "\nGathering info:";
256 
257  // extract crossing frame from event
258  // edm::Handle<CrossingFrame> crossingFrame;
260  // iEvent.getByType(crossingFrame);
261  // if (!crossingFrame.isValid()) {
262  // edm::LogWarning(MsgLoggerCat)
263  // << "Unable to crossingFrame in event!";
264  // return;
265  //}
266 
268  // extract EB information
270  bool isBarrel = true;
272  iEvent.getByToken(ECalEBSrc_Token_, EcalDigiEB);
273  if (!EcalDigiEB.isValid()) {
274  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalDigiEB in event!";
275  return;
276  }
277  if (EcalDigiEB->empty())
278  isBarrel = false;
279 
280  if (isBarrel) {
281  // loop over simhits
282  iEvent.getByToken(EBHits_Token_, crossingFrame);
283  if (!crossingFrame.isValid()) {
284  edm::LogWarning(MsgLoggerCat) << "Unable to find cal barrel crossingFrame in event!";
285  return;
286  }
287  // std::unique_ptr<MixCollection<PCaloHit> >
288  // barrelHits(new MixCollection<PCaloHit>
289  // (crossingFrame.product(), barrelHitsName));
290  std::unique_ptr<MixCollection<PCaloHit>> barrelHits(new MixCollection<PCaloHit>(crossingFrame.product()));
291 
292  // keep track of sum of simhit energy in each crystal
293  MapType ebSimMap;
294  for (MixCollection<PCaloHit>::MixItr hitItr = barrelHits->begin(); hitItr != barrelHits->end(); ++hitItr) {
295  EBDetId ebid = EBDetId(hitItr->id());
296 
297  uint32_t crystid = ebid.rawId();
298  ebSimMap[crystid] += hitItr->energy();
299  }
300 
301  // loop over digis
302  const EBDigiCollection *barrelDigi = EcalDigiEB.product();
303 
304  std::vector<double> ebAnalogSignal;
305  std::vector<double> ebADCCounts;
306  std::vector<double> ebADCGains;
307  ebAnalogSignal.reserve(EBDataFrame::MAXSAMPLES);
308  ebADCCounts.reserve(EBDataFrame::MAXSAMPLES);
309  ebADCGains.reserve(EBDataFrame::MAXSAMPLES);
310 
311  int i = 0;
312  for (unsigned int digis = 0; digis < EcalDigiEB->size(); ++digis) {
313  // for (std::vector<EBDataFrame>::const_iterator digis =
314  // barrelDigi->begin();
315  // digis != barrelDigi->end();
316  // ++digis) {
317 
318  ++i;
319 
320  EBDataFrame ebdf = (*barrelDigi)[digis];
321  int nrSamples = ebdf.size();
322 
323  EBDetId ebid = ebdf.id();
324  // EBDetId ebid = digis->id();
325 
326  double Emax = 0;
327  int Pmax = 0;
328  double pedestalPreSampleAnalog = 0.;
329 
330  for (int sample = 0; sample < nrSamples; ++sample) {
331  // for (int sample = 0; sample < digis->size(); ++sample) {
332  ebAnalogSignal[sample] = 0.;
333  ebADCCounts[sample] = 0.;
334  ebADCGains[sample] = -1.;
335  }
336 
337  // calculate maximum energy and pedestal
338  for (int sample = 0; sample < nrSamples; ++sample) {
339  // for (int sample = 0; sample < digis->size(); ++sample) {
340 
341  EcalMGPASample thisSample = ebdf[sample];
342  ebADCCounts[sample] = (thisSample.adc());
343  ebADCGains[sample] = (thisSample.gainId());
344  ebAnalogSignal[sample] = (ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_);
345  if (Emax < ebAnalogSignal[sample]) {
346  Emax = ebAnalogSignal[sample];
347  Pmax = sample;
348  }
349  if (sample < 3) {
350  pedestalPreSampleAnalog += ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_;
351  }
352  }
353  pedestalPreSampleAnalog /= 3.;
354 
355  // calculate pedestal subtracted digi energy in the crystal
356  double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)ebADCGains[Pmax]];
357 
358  // gather necessary information
359  EBCalAEE.push_back(Erec);
360  EBCalSHE.push_back(ebSimMap[ebid.rawId()]);
361  EBCalmaxPos.push_back(Pmax);
362  }
363 
364  if (verbosity > 1) {
365  eventout += "\n Number of EBDigis collected:.............. ";
366  eventout += i;
367  }
368  }
369 
371  // extract EE information
373  bool isEndCap = true;
375  iEvent.getByToken(ECalEESrc_Token_, EcalDigiEE);
376  if (!EcalDigiEE.isValid()) {
377  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalDigiEE in event!";
378  return;
379  }
380  if (EcalDigiEE->empty())
381  isEndCap = false;
382 
383  if (isEndCap) {
384  // loop over simhits
385  iEvent.getByToken(EEHits_Token_, crossingFrame);
386  if (!crossingFrame.isValid()) {
387  edm::LogWarning(MsgLoggerCat) << "Unable to find cal endcap crossingFrame in event!";
388  return;
389  }
390  // std::unique_ptr<MixCollection<PCaloHit> >
391  // endcapHits(new MixCollection<PCaloHit>
392  // (crossingFrame.product(), endcapHitsName));
393  std::unique_ptr<MixCollection<PCaloHit>> endcapHits(new MixCollection<PCaloHit>(crossingFrame.product()));
394 
395  // keep track of sum of simhit energy in each crystal
396  MapType eeSimMap;
397  for (MixCollection<PCaloHit>::MixItr hitItr = endcapHits->begin(); hitItr != endcapHits->end(); ++hitItr) {
398  EEDetId eeid = EEDetId(hitItr->id());
399 
400  uint32_t crystid = eeid.rawId();
401  eeSimMap[crystid] += hitItr->energy();
402  }
403 
404  // loop over digis
405  const EEDigiCollection *endcapDigi = EcalDigiEE.product();
406 
407  std::vector<double> eeAnalogSignal;
408  std::vector<double> eeADCCounts;
409  std::vector<double> eeADCGains;
410  eeAnalogSignal.reserve(EEDataFrame::MAXSAMPLES);
411  eeADCCounts.reserve(EEDataFrame::MAXSAMPLES);
412  eeADCGains.reserve(EEDataFrame::MAXSAMPLES);
413 
414  int i = 0;
415  // for (std::vector<EEDataFrame>::const_iterator digis =
416  // endcapDigi->begin();
417  // digis != endcapDigi->end();
418  // ++digis) {
419  for (unsigned int digis = 0; digis < EcalDigiEE->size(); ++digis) {
420  ++i;
421 
422  EEDataFrame eedf = (*endcapDigi)[digis];
423  int nrSamples = eedf.size();
424 
425  EEDetId eeid = eedf.id();
426  // EEDetId eeid = digis->id();
427 
428  double Emax = 0;
429  int Pmax = 0;
430  double pedestalPreSampleAnalog = 0.;
431 
432  for (int sample = 0; sample < nrSamples; ++sample) {
433  // for (int sample = 0; sample < digis->size(); ++sample) {
434  eeAnalogSignal[sample] = 0.;
435  eeADCCounts[sample] = 0.;
436  eeADCGains[sample] = -1.;
437  }
438 
439  // calculate maximum enery and pedestal
440  for (int sample = 0; sample < nrSamples; ++sample) {
441  // for (int sample = 0; sample < digis->size(); ++sample) {
442 
443  EcalMGPASample thisSample = eedf[sample];
444 
445  eeADCCounts[sample] = (thisSample.adc());
446  eeADCGains[sample] = (thisSample.gainId());
447  eeAnalogSignal[sample] = (eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_);
448  if (Emax < eeAnalogSignal[sample]) {
449  Emax = eeAnalogSignal[sample];
450  Pmax = sample;
451  }
452  if (sample < 3) {
453  pedestalPreSampleAnalog += eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_;
454  }
455  }
456  pedestalPreSampleAnalog /= 3.;
457 
458  // calculate pedestal subtracted digi energy in the crystal
459  double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)eeADCGains[Pmax]];
460 
461  // gather necessary information
462  EECalAEE.push_back(Erec);
463  EECalSHE.push_back(eeSimMap[eeid.rawId()]);
464  EECalmaxPos.push_back(Pmax);
465  }
466 
467  if (verbosity > 1) {
468  eventout += "\n Number of EEDigis collected:.............. ";
469  eventout += i;
470  }
471  }
472 
474  // extract ES information
476  bool isPreshower = true;
478  iEvent.getByToken(ECalESSrc_Token_, EcalDigiES);
479  if (!EcalDigiES.isValid()) {
480  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalDigiES in event!";
481  return;
482  }
483  if (EcalDigiES->empty())
484  isPreshower = false;
485 
486  if (isPreshower) {
487  // loop over simhits
488  iEvent.getByToken(ESHits_Token_, crossingFrame);
489  if (!crossingFrame.isValid()) {
490  edm::LogWarning(MsgLoggerCat) << "Unable to find cal preshower crossingFrame in event!";
491  return;
492  }
493  // std::unique_ptr<MixCollection<PCaloHit> >
494  // preshowerHits(new MixCollection<PCaloHit>
495  // (crossingFrame.product(), preshowerHitsName));
496  std::unique_ptr<MixCollection<PCaloHit>> preshowerHits(new MixCollection<PCaloHit>(crossingFrame.product()));
497 
498  // keep track of sum of simhit energy in each crystal
499  MapType esSimMap;
500  for (MixCollection<PCaloHit>::MixItr hitItr = preshowerHits->begin(); hitItr != preshowerHits->end(); ++hitItr) {
501  ESDetId esid = ESDetId(hitItr->id());
502 
503  uint32_t crystid = esid.rawId();
504  esSimMap[crystid] += hitItr->energy();
505  }
506 
507  // loop over digis
508  const ESDigiCollection *preshowerDigi = EcalDigiES.product();
509 
510  std::vector<double> esADCCounts;
511  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
512 
513  int i = 0;
514  for (unsigned int digis = 0; digis < EcalDigiES->size(); ++digis) {
515  // for (std::vector<ESDataFrame>::const_iterator digis =
516  // preshowerDigi->begin();
517  // digis != preshowerDigi->end();
518  // ++digis) {
519 
520  ++i;
521 
522  ESDataFrame esdf = (*preshowerDigi)[digis];
523  int nrSamples = esdf.size();
524 
525  ESDetId esid = esdf.id();
526  // ESDetId esid = digis->id();
527 
528  for (int sample = 0; sample < nrSamples; ++sample) {
529  // for (int sample = 0; sample < digis->size(); ++sample) {
530  esADCCounts[sample] = 0.;
531  }
532 
533  // gether ADC counts
534  for (int sample = 0; sample < nrSamples; ++sample) {
535  ESSample thisSample = esdf[sample];
536  // for (int sample = 0; sample < digis->size(); ++sample) {
537  esADCCounts[sample] = (thisSample.adc());
538  }
539 
540  ESCalADC0.push_back(esADCCounts[0]);
541  ESCalADC1.push_back(esADCCounts[1]);
542  ESCalADC2.push_back(esADCCounts[2]);
543  ESCalSHE.push_back(esSimMap[esid.rawId()]);
544  }
545 
546  if (verbosity > 1) {
547  eventout += "\n Number of ESDigis collected:.............. ";
548  eventout += i;
549  }
550  }
551 
552  if (verbosity > 0)
553  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
554 
555  return;
556 }
557 
559  std::string MsgLoggerCat = "GlobalDigisProducer_storeECal";
560 
561  if (verbosity > 2) {
562  TString eventout("\n nEBDigis = ");
563  eventout += EBCalmaxPos.size();
564  for (unsigned int i = 0; i < EBCalmaxPos.size(); ++i) {
565  eventout += "\n (maxPos, AEE, SHE) = (";
566  eventout += EBCalmaxPos[i];
567  eventout += ", ";
568  eventout += EBCalAEE[i];
569  eventout += ", ";
570  eventout += EBCalSHE[i];
571  eventout += ")";
572  }
573  eventout += "\n nEEDigis = ";
574  eventout += EECalmaxPos.size();
575  for (unsigned int i = 0; i < EECalmaxPos.size(); ++i) {
576  eventout += "\n (maxPos, AEE, SHE) = (";
577  eventout += EECalmaxPos[i];
578  eventout += ", ";
579  eventout += EECalAEE[i];
580  eventout += ", ";
581  eventout += EECalSHE[i];
582  eventout += ")";
583  }
584  eventout += "\n nESDigis = ";
585  eventout += ESCalADC0.size();
586  for (unsigned int i = 0; i < ESCalADC0.size(); ++i) {
587  eventout += "\n (ADC0, ADC1, ADC2, SHE) = (";
588  eventout += ESCalADC0[i];
589  eventout += ", ";
590  eventout += ESCalADC1[i];
591  eventout += ", ";
592  eventout += ESCalADC2[i];
593  eventout += ", ";
594  eventout += ESCalSHE[i];
595  eventout += ")";
596  }
597  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
598  }
599 
603 
604  return;
605 }
606 
608  std::string MsgLoggerCat = "GlobalDigisProducer_fillHCal";
609 
610  TString eventout;
611  if (verbosity > 0)
612  eventout = "\nGathering info:";
613 
614  // get calibration info
615  const auto &HCalconditions = iSetup.getHandle(hcaldbToken_);
616  if (!HCalconditions.isValid()) {
617  edm::LogWarning(MsgLoggerCat) << "Unable to find HCalconditions in event!";
618  return;
619  }
620  // HcalCalibrations calibrations;
621  CaloSamples tool;
622 
624  // extract simhit info
627  iEvent.getByToken(HCalSrc_Token_, hcalHits);
628  if (!hcalHits.isValid()) {
629  edm::LogWarning(MsgLoggerCat) << "Unable to find hcalHits in event!";
630  return;
631  }
632  const edm::PCaloHitContainer *simhitResult = hcalHits.product();
633 
634  MapType fHBEnergySimHits;
635  MapType fHEEnergySimHits;
636  MapType fHOEnergySimHits;
637  MapType fHFEnergySimHits;
638  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end();
639  ++simhits) {
640  HcalDetId detId(simhits->id());
641  uint32_t cellid = detId.rawId();
642 
643  if (detId.subdet() == sdHcalBrl) {
644  fHBEnergySimHits[cellid] += simhits->energy();
645  }
646  if (detId.subdet() == sdHcalEC) {
647  fHEEnergySimHits[cellid] += simhits->energy();
648  }
649  if (detId.subdet() == sdHcalOut) {
650  fHOEnergySimHits[cellid] += simhits->energy();
651  }
652  if (detId.subdet() == sdHcalFwd) {
653  fHFEnergySimHits[cellid] += simhits->energy();
654  }
655  }
656 
658  // get HBHE information
661  iEvent.getByToken(HBHEDigi_Token_, hbhe);
662  if (!hbhe.isValid()) {
663  edm::LogWarning(MsgLoggerCat) << "Unable to find HBHEDataFrame in event!";
664  return;
665  }
667 
668  int iHB = 0;
669  int iHE = 0;
670  for (ihbhe = hbhe->begin(); ihbhe != hbhe->end(); ++ihbhe) {
671  HcalDetId cell(ihbhe->id());
672 
673  if ((cell.subdet() == sdHcalBrl) || (cell.subdet() == sdHcalEC)) {
674  // HCalconditions->makeHcalCalibration(cell, &calibrations);
675  const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell);
676  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
677  const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder);
678 
679  HcalCoderDb coder(*channelCoder, *shape);
680  coder.adc2fC(*ihbhe, tool);
681 
682  // get HB info
683  if (cell.subdet() == sdHcalBrl) {
684  ++iHB;
685  float fDigiSum = 0.0;
686  for (int ii = 0; ii < tool.size(); ++ii) {
687  // default ped is 4.5
688  int capid = (*ihbhe)[ii].capid();
689  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
690  }
691 
692  HBCalAEE.push_back(fDigiSum);
693  HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
694  }
695 
696  // get HE info
697  if (cell.subdet() == sdHcalEC) {
698  ++iHE;
699  float fDigiSum = 0.0;
700  for (int ii = 0; ii < tool.size(); ++ii) {
701  int capid = (*ihbhe)[ii].capid();
702  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
703  }
704 
705  HECalAEE.push_back(fDigiSum);
706  HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
707  }
708  }
709  }
710 
711  if (verbosity > 1) {
712  eventout += "\n Number of HBDigis collected:.............. ";
713  eventout += iHB;
714  }
715 
716  if (verbosity > 1) {
717  eventout += "\n Number of HEDigis collected:.............. ";
718  eventout += iHE;
719  }
720 
722  // get HO information
725  iEvent.getByToken(HODigi_Token_, ho);
726  if (!ho.isValid()) {
727  edm::LogWarning(MsgLoggerCat) << "Unable to find HODataFrame in event!";
728  return;
729  }
731 
732  int iHO = 0;
733  for (iho = ho->begin(); iho != ho->end(); ++iho) {
734  HcalDetId cell(iho->id());
735 
736  if (cell.subdet() == sdHcalOut) {
737  // HCalconditions->makeHcalCalibration(cell, &calibrations);
738  const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell);
739  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
740  const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder);
741 
742  HcalCoderDb coder(*channelCoder, *shape);
743  coder.adc2fC(*iho, tool);
744 
745  ++iHO;
746  float fDigiSum = 0.0;
747  for (int ii = 0; ii < tool.size(); ++ii) {
748  // default ped is 4.5
749  int capid = (*iho)[ii].capid();
750  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
751  }
752 
753  HOCalAEE.push_back(fDigiSum);
754  HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
755  }
756  }
757 
758  if (verbosity > 1) {
759  eventout += "\n Number of HODigis collected:.............. ";
760  eventout += iHO;
761  }
762 
764  // get HF information
767  iEvent.getByToken(HFDigi_Token_, hf);
768  if (!hf.isValid()) {
769  edm::LogWarning(MsgLoggerCat) << "Unable to find HFDataFrame in event!";
770  return;
771  }
773 
774  int iHF = 0;
775  for (ihf = hf->begin(); ihf != hf->end(); ++ihf) {
776  HcalDetId cell(ihf->id());
777 
778  if (cell.subdet() == sdHcalFwd) {
779  // HCalconditions->makeHcalCalibration(cell, &calibrations);
780  const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell);
781  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
782  const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder);
783 
784  HcalCoderDb coder(*channelCoder, *shape);
785  coder.adc2fC(*ihf, tool);
786 
787  ++iHF;
788  float fDigiSum = 0.0;
789  for (int ii = 0; ii < tool.size(); ++ii) {
790  // default ped is 1.73077
791  int capid = (*ihf)[ii].capid();
792  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
793  }
794 
795  HFCalAEE.push_back(fDigiSum);
796  HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
797  }
798  }
799 
800  if (verbosity > 1) {
801  eventout += "\n Number of HFDigis collected:.............. ";
802  eventout += iHF;
803  }
804 
805  if (verbosity > 0)
806  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
807 
808  return;
809 }
810 
812  std::string MsgLoggerCat = "GlobalDigisProducer_storeHCal";
813 
814  if (verbosity > 2) {
815  TString eventout("\n nHBDigis = ");
816  eventout += HBCalAEE.size();
817  for (unsigned int i = 0; i < HBCalAEE.size(); ++i) {
818  eventout += "\n (AEE, SHE) = (";
819  eventout += HBCalAEE[i];
820  eventout += ", ";
821  eventout += HBCalSHE[i];
822  eventout += ")";
823  }
824  eventout += "\n nHEDigis = ";
825  eventout += HECalAEE.size();
826  for (unsigned int i = 0; i < HECalAEE.size(); ++i) {
827  eventout += "\n (AEE, SHE) = (";
828  eventout += HECalAEE[i];
829  eventout += ", ";
830  eventout += HECalSHE[i];
831  eventout += ")";
832  }
833  eventout += "\n nHODigis = ";
834  eventout += HOCalAEE.size();
835  for (unsigned int i = 0; i < HOCalAEE.size(); ++i) {
836  eventout += "\n (AEE, SHE) = (";
837  eventout += HOCalAEE[i];
838  eventout += ", ";
839  eventout += HOCalSHE[i];
840  eventout += ")";
841  }
842  eventout += "\n nHFDigis = ";
843  eventout += HFCalAEE.size();
844  for (unsigned int i = 0; i < HFCalAEE.size(); ++i) {
845  eventout += "\n (AEE, SHE) = (";
846  eventout += HFCalAEE[i];
847  eventout += ", ";
848  eventout += HFCalSHE[i];
849  eventout += ")";
850  }
851 
852  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
853  }
854 
855  product.putHBCalDigis(HBCalAEE, HBCalSHE);
856  product.putHECalDigis(HECalAEE, HECalSHE);
857  product.putHOCalDigis(HOCalAEE, HOCalSHE);
858  product.putHFCalDigis(HFCalAEE, HFCalSHE);
859 
860  return;
861 }
862 
864  // Retrieve tracker topology from geometry
865  const TrackerTopology *const tTopo = &iSetup.getData(tTopoToken_);
866 
867  std::string MsgLoggerCat = "GlobalDigisProducer_fillTrk";
868 
869  TString eventout;
870  if (verbosity > 0)
871  eventout = "\nGathering info:";
872 
873  // get strip information
875  iEvent.getByToken(SiStripSrc_Token_, stripDigis);
876  if (!stripDigis.isValid()) {
877  edm::LogWarning(MsgLoggerCat) << "Unable to find stripDigis in event!";
878  return;
879  }
880 
881  int nStripBrl = 0, nStripFwd = 0;
883  for (DSViter = stripDigis->begin(); DSViter != stripDigis->end(); ++DSViter) {
884  unsigned int id = DSViter->id;
885  DetId detId(id);
886  edm::DetSet<SiStripDigi>::const_iterator begin = DSViter->data.begin();
889 
890  // get TIB
891  if (detId.subdetId() == sdSiTIB) {
892  for (iter = begin; iter != end; ++iter) {
893  ++nStripBrl;
894  if (tTopo->tibLayer(id) == 1) {
895  TIBL1ADC.push_back((*iter).adc());
896  TIBL1Strip.push_back((*iter).strip());
897  }
898  if (tTopo->tibLayer(id) == 2) {
899  TIBL2ADC.push_back((*iter).adc());
900  TIBL2Strip.push_back((*iter).strip());
901  }
902  if (tTopo->tibLayer(id) == 3) {
903  TIBL3ADC.push_back((*iter).adc());
904  TIBL3Strip.push_back((*iter).strip());
905  }
906  if (tTopo->tibLayer(id) == 4) {
907  TIBL4ADC.push_back((*iter).adc());
908  TIBL4Strip.push_back((*iter).strip());
909  }
910  }
911  }
912 
913  // get TOB
914  if (detId.subdetId() == sdSiTOB) {
915  for (iter = begin; iter != end; ++iter) {
916  ++nStripBrl;
917  if (tTopo->tobLayer(id) == 1) {
918  TOBL1ADC.push_back((*iter).adc());
919  TOBL1Strip.push_back((*iter).strip());
920  }
921  if (tTopo->tobLayer(id) == 2) {
922  TOBL2ADC.push_back((*iter).adc());
923  TOBL2Strip.push_back((*iter).strip());
924  }
925  if (tTopo->tobLayer(id) == 3) {
926  TOBL3ADC.push_back((*iter).adc());
927  TOBL3Strip.push_back((*iter).strip());
928  }
929  if (tTopo->tobLayer(id) == 4) {
930  TOBL4ADC.push_back((*iter).adc());
931  TOBL4Strip.push_back((*iter).strip());
932  }
933  }
934  }
935 
936  // get TID
937  if (detId.subdetId() == sdSiTID) {
938  for (iter = begin; iter != end; ++iter) {
939  ++nStripFwd;
940  if (tTopo->tidWheel(id) == 1) {
941  TIDW1ADC.push_back((*iter).adc());
942  TIDW1Strip.push_back((*iter).strip());
943  }
944  if (tTopo->tidWheel(id) == 2) {
945  TIDW2ADC.push_back((*iter).adc());
946  TIDW2Strip.push_back((*iter).strip());
947  }
948  if (tTopo->tidWheel(id) == 3) {
949  TIDW3ADC.push_back((*iter).adc());
950  TIDW3Strip.push_back((*iter).strip());
951  }
952  }
953  }
954 
955  // get TEC
956  if (detId.subdetId() == sdSiTEC) {
957  for (iter = begin; iter != end; ++iter) {
958  ++nStripFwd;
959  if (tTopo->tecWheel(id) == 1) {
960  TECW1ADC.push_back((*iter).adc());
961  TECW1Strip.push_back((*iter).strip());
962  }
963  if (tTopo->tecWheel(id) == 2) {
964  TECW2ADC.push_back((*iter).adc());
965  TECW2Strip.push_back((*iter).strip());
966  }
967  if (tTopo->tecWheel(id) == 3) {
968  TECW3ADC.push_back((*iter).adc());
969  TECW3Strip.push_back((*iter).strip());
970  }
971  if (tTopo->tecWheel(id) == 4) {
972  TECW4ADC.push_back((*iter).adc());
973  TECW4Strip.push_back((*iter).strip());
974  }
975  if (tTopo->tecWheel(id) == 5) {
976  TECW5ADC.push_back((*iter).adc());
977  TECW5Strip.push_back((*iter).strip());
978  }
979  if (tTopo->tecWheel(id) == 6) {
980  TECW6ADC.push_back((*iter).adc());
981  TECW6Strip.push_back((*iter).strip());
982  }
983  if (tTopo->tecWheel(id) == 7) {
984  TECW7ADC.push_back((*iter).adc());
985  TECW7Strip.push_back((*iter).strip());
986  }
987  if (tTopo->tecWheel(id) == 8) {
988  TECW8ADC.push_back((*iter).adc());
989  TECW8Strip.push_back((*iter).strip());
990  }
991  }
992  }
993  } // end loop over DataSetVector
994 
995  if (verbosity > 1) {
996  eventout += "\n Number of BrlStripDigis collected:........ ";
997  eventout += nStripBrl;
998  }
999 
1000  if (verbosity > 1) {
1001  eventout += "\n Number of FrwdStripDigis collected:....... ";
1002  eventout += nStripFwd;
1003  }
1004 
1005  // get pixel information
1007  iEvent.getByToken(SiPxlSrc_Token_, pixelDigis);
1008  if (!pixelDigis.isValid()) {
1009  edm::LogWarning(MsgLoggerCat) << "Unable to find pixelDigis in event!";
1010  return;
1011  }
1012 
1013  int nPxlBrl = 0, nPxlFwd = 0;
1015  for (DPViter = pixelDigis->begin(); DPViter != pixelDigis->end(); ++DPViter) {
1016  unsigned int id = DPViter->id;
1017  DetId detId(id);
1018  edm::DetSet<PixelDigi>::const_iterator begin = DPViter->data.begin();
1021 
1022  // get Barrel pixels
1023  if (detId.subdetId() == sdPxlBrl) {
1024  for (iter = begin; iter != end; ++iter) {
1025  ++nPxlBrl;
1026  if (tTopo->pxbLayer(id) == 1) {
1027  BRL1ADC.push_back((*iter).adc());
1028  BRL1Row.push_back((*iter).row());
1029  BRL1Col.push_back((*iter).column());
1030  }
1031  if (tTopo->pxbLayer(id) == 2) {
1032  BRL2ADC.push_back((*iter).adc());
1033  BRL2Row.push_back((*iter).row());
1034  BRL2Col.push_back((*iter).column());
1035  }
1036  if (tTopo->pxbLayer(id) == 3) {
1037  BRL3ADC.push_back((*iter).adc());
1038  BRL3Row.push_back((*iter).row());
1039  BRL3Col.push_back((*iter).column());
1040  }
1041  }
1042  }
1043 
1044  // get Forward pixels
1045  if (detId.subdetId() == sdPxlFwd) {
1046  for (iter = begin; iter != end; ++iter) {
1047  ++nPxlFwd;
1048  if (tTopo->pxfDisk(id) == 1) {
1049  if (tTopo->pxfSide(id) == 1) {
1050  FWD1nADC.push_back((*iter).adc());
1051  FWD1nRow.push_back((*iter).row());
1052  FWD1nCol.push_back((*iter).column());
1053  }
1054  if (tTopo->pxfSide(id) == 2) {
1055  FWD1pADC.push_back((*iter).adc());
1056  FWD1pRow.push_back((*iter).row());
1057  FWD1pCol.push_back((*iter).column());
1058  }
1059  }
1060  if (tTopo->pxfDisk(id) == 2) {
1061  if (tTopo->pxfSide(id) == 1) {
1062  FWD2nADC.push_back((*iter).adc());
1063  FWD2nRow.push_back((*iter).row());
1064  FWD2nCol.push_back((*iter).column());
1065  }
1066  if (tTopo->pxfSide(id) == 2) {
1067  FWD2pADC.push_back((*iter).adc());
1068  FWD2pRow.push_back((*iter).row());
1069  FWD2pCol.push_back((*iter).column());
1070  }
1071  }
1072  }
1073  }
1074  }
1075 
1076  if (verbosity > 1) {
1077  eventout += "\n Number of BrlPixelDigis collected:........ ";
1078  eventout += nPxlBrl;
1079  }
1080 
1081  if (verbosity > 1) {
1082  eventout += "\n Number of FrwdPixelDigis collected:....... ";
1083  eventout += nPxlFwd;
1084  }
1085 
1086  if (verbosity > 0)
1087  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1088 
1089  return;
1090 }
1091 
1093  std::string MsgLoggerCat = "GlobalDigisProducer_storeTrk";
1094 
1095  if (verbosity > 2) {
1096  // strip output
1097  TString eventout("\n nTIBL1 = ");
1098  eventout += TIBL1ADC.size();
1099  for (unsigned int i = 0; i < TIBL1ADC.size(); ++i) {
1100  eventout += "\n (ADC, strip) = (";
1101  eventout += TIBL1ADC[i];
1102  eventout += ", ";
1103  eventout += TIBL1Strip[i];
1104  eventout += ")";
1105  }
1106  eventout += "\n nTIBL2 = ";
1107  eventout += TIBL2ADC.size();
1108  for (unsigned int i = 0; i < TIBL2ADC.size(); ++i) {
1109  eventout += "\n (ADC, strip) = (";
1110  eventout += TIBL2ADC[i];
1111  eventout += ", ";
1112  eventout += TIBL2Strip[i];
1113  eventout += ")";
1114  }
1115  eventout += "\n nTIBL3 = ";
1116  eventout += TIBL3ADC.size();
1117  for (unsigned int i = 0; i < TIBL3ADC.size(); ++i) {
1118  eventout += "\n (ADC, strip) = (";
1119  eventout += TIBL3ADC[i];
1120  eventout += ", ";
1121  eventout += TIBL3Strip[i];
1122  eventout += ")";
1123  }
1124  eventout += "\n nTIBL4 = ";
1125  eventout += TIBL4ADC.size();
1126  for (unsigned int i = 0; i < TIBL4ADC.size(); ++i) {
1127  eventout += "\n (ADC, strip) = (";
1128  eventout += TIBL4ADC[i];
1129  eventout += ", ";
1130  eventout += TIBL4Strip[i];
1131  eventout += ")";
1132  }
1133  eventout += "\n nTOBL1 = ";
1134  eventout += TOBL1ADC.size();
1135  for (unsigned int i = 0; i < TOBL1ADC.size(); ++i) {
1136  eventout += "\n (ADC, strip) = (";
1137  eventout += TOBL1ADC[i];
1138  eventout += ", ";
1139  eventout += TOBL1Strip[i];
1140  eventout += ")";
1141  }
1142  eventout += "\n nTOBL2 = ";
1143  eventout += TOBL2ADC.size();
1144  for (unsigned int i = 0; i < TOBL2ADC.size(); ++i) {
1145  eventout += "\n (ADC, strip) = (";
1146  eventout += TOBL2ADC[i];
1147  eventout += ", ";
1148  eventout += TOBL2Strip[i];
1149  eventout += ")";
1150  }
1151  eventout += "\n nTOBL3 = ";
1152  eventout += TOBL3ADC.size();
1153  for (unsigned int i = 0; i < TOBL3ADC.size(); ++i) {
1154  eventout += "\n (ADC, strip) = (";
1155  eventout += TOBL3ADC[i];
1156  eventout += ", ";
1157  eventout += TOBL3Strip[i];
1158  eventout += ")";
1159  }
1160  eventout += "\n nTOBL4 = ";
1161  eventout += TOBL4ADC.size();
1162  for (unsigned int i = 0; i < TOBL4ADC.size(); ++i) {
1163  eventout += "\n (ADC, strip) = (";
1164  eventout += TOBL4ADC[i];
1165  eventout += ", ";
1166  eventout += TOBL4Strip[i];
1167  eventout += ")";
1168  }
1169  eventout += "\n nTIDW1 = ";
1170  eventout += TIDW1ADC.size();
1171  for (unsigned int i = 0; i < TIDW1ADC.size(); ++i) {
1172  eventout += "\n (ADC, strip) = (";
1173  eventout += TIDW1ADC[i];
1174  eventout += ", ";
1175  eventout += TIDW1Strip[i];
1176  eventout += ")";
1177  }
1178  eventout += "\n nTIDW2 = ";
1179  eventout += TIDW2ADC.size();
1180  for (unsigned int i = 0; i < TIDW2ADC.size(); ++i) {
1181  eventout += "\n (ADC, strip) = (";
1182  eventout += TIDW2ADC[i];
1183  eventout += ", ";
1184  eventout += TIDW2Strip[i];
1185  eventout += ")";
1186  }
1187  eventout += "\n nTIDW3 = ";
1188  eventout += TIDW3ADC.size();
1189  for (unsigned int i = 0; i < TIDW3ADC.size(); ++i) {
1190  eventout += "\n (ADC, strip) = (";
1191  eventout += TIDW3ADC[i];
1192  eventout += ", ";
1193  eventout += TIDW3Strip[i];
1194  eventout += ")";
1195  }
1196  eventout += "\n nTECW1 = ";
1197  eventout += TECW1ADC.size();
1198  for (unsigned int i = 0; i < TECW1ADC.size(); ++i) {
1199  eventout += "\n (ADC, strip) = (";
1200  eventout += TECW1ADC[i];
1201  eventout += ", ";
1202  eventout += TECW1Strip[i];
1203  eventout += ")";
1204  }
1205  eventout += "\n nTECW2 = ";
1206  eventout += TECW2ADC.size();
1207  for (unsigned int i = 0; i < TECW2ADC.size(); ++i) {
1208  eventout += "\n (ADC, strip) = (";
1209  eventout += TECW2ADC[i];
1210  eventout += ", ";
1211  eventout += TECW2Strip[i];
1212  eventout += ")";
1213  }
1214  eventout += "\n nTECW3 = ";
1215  eventout += TECW3ADC.size();
1216  for (unsigned int i = 0; i < TECW3ADC.size(); ++i) {
1217  eventout += "\n (ADC, strip) = (";
1218  eventout += TECW3ADC[i];
1219  eventout += ", ";
1220  eventout += TECW3Strip[i];
1221  eventout += ")";
1222  }
1223  eventout += "\n nTECW4 = ";
1224  eventout += TECW4ADC.size();
1225  for (unsigned int i = 0; i < TECW4ADC.size(); ++i) {
1226  eventout += "\n (ADC, strip) = (";
1227  eventout += TECW4ADC[i];
1228  eventout += ", ";
1229  eventout += TECW4Strip[i];
1230  eventout += ")";
1231  }
1232  eventout += "\n nTECW5 = ";
1233  eventout += TECW5ADC.size();
1234  for (unsigned int i = 0; i < TECW5ADC.size(); ++i) {
1235  eventout += "\n (ADC, strip) = (";
1236  eventout += TECW5ADC[i];
1237  eventout += ", ";
1238  eventout += TECW5Strip[i];
1239  eventout += ")";
1240  }
1241  eventout += "\n nTECW6 = ";
1242  eventout += TECW6ADC.size();
1243  for (unsigned int i = 0; i < TECW6ADC.size(); ++i) {
1244  eventout += "\n (ADC, strip) = (";
1245  eventout += TECW6ADC[i];
1246  eventout += ", ";
1247  eventout += TECW6Strip[i];
1248  eventout += ")";
1249  }
1250  eventout += "\n nTECW7 = ";
1251  eventout += TECW7ADC.size();
1252  for (unsigned int i = 0; i < TECW7ADC.size(); ++i) {
1253  eventout += "\n (ADC, strip) = (";
1254  eventout += TECW7ADC[i];
1255  eventout += ", ";
1256  eventout += TECW7Strip[i];
1257  eventout += ")";
1258  }
1259  eventout += "\n nTECW8 = ";
1260  eventout += TECW8ADC.size();
1261  for (unsigned int i = 0; i < TECW8ADC.size(); ++i) {
1262  eventout += "\n (ADC, strip) = (";
1263  eventout += TECW8ADC[i];
1264  eventout += ", ";
1265  eventout += TECW8Strip[i];
1266  eventout += ")";
1267  }
1268 
1269  // pixel output
1270  eventout += "\n nBRL1 = ";
1271  eventout += BRL1ADC.size();
1272  for (unsigned int i = 0; i < BRL1ADC.size(); ++i) {
1273  eventout += "\n (ADC, row, column) = (";
1274  eventout += BRL1ADC[i];
1275  eventout += ", ";
1276  eventout += BRL1Row[i];
1277  eventout += ", ";
1278  eventout += BRL1Col[i];
1279  eventout += ")";
1280  }
1281  eventout += "\n nBRL2 = ";
1282  eventout += BRL2ADC.size();
1283  for (unsigned int i = 0; i < BRL2ADC.size(); ++i) {
1284  eventout += "\n (ADC, row, column) = (";
1285  eventout += BRL2ADC[i];
1286  eventout += ", ";
1287  eventout += BRL2Row[i];
1288  eventout += ", ";
1289  eventout += BRL2Col[i];
1290  eventout += ")";
1291  }
1292  eventout += "\n nBRL3 = ";
1293  eventout += BRL3ADC.size();
1294  for (unsigned int i = 0; i < BRL3ADC.size(); ++i) {
1295  eventout += "\n (ADC, row, column) = (";
1296  eventout += BRL3ADC[i];
1297  eventout += ", ";
1298  eventout += BRL3Row[i];
1299  eventout += ", ";
1300  eventout += BRL3Col[i];
1301  eventout += ")";
1302  }
1303  eventout += "\n nFWD1p = ";
1304  eventout += FWD1pADC.size();
1305  for (unsigned int i = 0; i < FWD1pADC.size(); ++i) {
1306  eventout += "\n (ADC, row, column) = (";
1307  eventout += FWD1pADC[i];
1308  eventout += ", ";
1309  eventout += FWD1pRow[i];
1310  eventout += ", ";
1311  eventout += FWD1pCol[i];
1312  eventout += ")";
1313  }
1314  eventout += "\n nFWD1p = ";
1315  eventout += FWD1nADC.size();
1316  for (unsigned int i = 0; i < FWD1nADC.size(); ++i) {
1317  eventout += "\n (ADC, row, column) = (";
1318  eventout += FWD1nADC[i];
1319  eventout += ", ";
1320  eventout += FWD1nRow[i];
1321  eventout += ", ";
1322  eventout += FWD1nCol[i];
1323  eventout += ")";
1324  }
1325  eventout += "\n nFWD1p = ";
1326  eventout += FWD2pADC.size();
1327  for (unsigned int i = 0; i < FWD2pADC.size(); ++i) {
1328  eventout += "\n (ADC, row, column) = (";
1329  eventout += FWD2pADC[i];
1330  eventout += ", ";
1331  eventout += FWD2pRow[i];
1332  eventout += ", ";
1333  eventout += FWD2pCol[i];
1334  eventout += ")";
1335  }
1336  eventout += "\n nFWD2p = ";
1337  eventout += FWD2nADC.size();
1338  for (unsigned int i = 0; i < FWD2nADC.size(); ++i) {
1339  eventout += "\n (ADC, row, column) = (";
1340  eventout += FWD2nADC[i];
1341  eventout += ", ";
1342  eventout += FWD2nRow[i];
1343  eventout += ", ";
1344  eventout += FWD2nCol[i];
1345  eventout += ")";
1346  }
1347 
1348  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1349  }
1350 
1351  // strip output
1352  product.putTIBL1Digis(TIBL1ADC, TIBL1Strip);
1353  product.putTIBL2Digis(TIBL2ADC, TIBL2Strip);
1354  product.putTIBL3Digis(TIBL3ADC, TIBL3Strip);
1355  product.putTIBL4Digis(TIBL4ADC, TIBL4Strip);
1356  product.putTOBL1Digis(TOBL1ADC, TOBL1Strip);
1357  product.putTOBL2Digis(TOBL2ADC, TOBL2Strip);
1358  product.putTOBL3Digis(TOBL3ADC, TOBL3Strip);
1359  product.putTOBL4Digis(TOBL4ADC, TOBL4Strip);
1360  product.putTIDW1Digis(TIDW1ADC, TIDW1Strip);
1361  product.putTIDW2Digis(TIDW2ADC, TIDW2Strip);
1362  product.putTIDW3Digis(TIDW3ADC, TIDW3Strip);
1363  product.putTECW1Digis(TECW1ADC, TECW1Strip);
1364  product.putTECW2Digis(TECW2ADC, TECW2Strip);
1365  product.putTECW3Digis(TECW3ADC, TECW3Strip);
1366  product.putTECW4Digis(TECW4ADC, TECW4Strip);
1367  product.putTECW5Digis(TECW5ADC, TECW5Strip);
1368  product.putTECW6Digis(TECW6ADC, TECW6Strip);
1369  product.putTECW7Digis(TECW7ADC, TECW7Strip);
1370  product.putTECW8Digis(TECW8ADC, TECW8Strip);
1371 
1372  // pixel output
1373  product.putBRL1Digis(BRL1ADC, BRL1Row, BRL1Col);
1374  product.putBRL2Digis(BRL2ADC, BRL2Row, BRL2Col);
1375  product.putBRL3Digis(BRL3ADC, BRL3Row, BRL3Col);
1380 
1381  return;
1382 }
1383 
1385  std::string MsgLoggerCat = "GlobalDigisProducer_fillMuon";
1386 
1387  TString eventout;
1388  if (verbosity > 0)
1389  eventout = "\nGathering info:";
1390 
1391  // get DT information
1393  iEvent.getByToken(MuDTSrc_Token_, dtDigis);
1394  if (!dtDigis.isValid()) {
1395  edm::LogWarning(MsgLoggerCat) << "Unable to find dtDigis in event!";
1396  return;
1397  }
1398 
1399  int nDt = 0;
1401  for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) {
1402  const DTLayerId &id = (*detUnitIt).first;
1403  const DTDigiCollection::Range &range = (*detUnitIt).second;
1404 
1405  for (DTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) {
1406  ++nDt;
1407 
1408  DTWireId wireId(id, (*digiIt).wire());
1409  if (wireId.station() == 1) {
1410  MB1SLayer.push_back(id.superlayer());
1411  MB1Time.push_back((*digiIt).time());
1412  MB1Layer.push_back(id.layer());
1413  }
1414  if (wireId.station() == 2) {
1415  MB2SLayer.push_back(id.superlayer());
1416  MB2Time.push_back((*digiIt).time());
1417  MB2Layer.push_back(id.layer());
1418  }
1419  if (wireId.station() == 3) {
1420  MB3SLayer.push_back(id.superlayer());
1421  MB3Time.push_back((*digiIt).time());
1422  MB3Layer.push_back(id.layer());
1423  }
1424  if (wireId.station() == 4) {
1425  MB4SLayer.push_back(id.superlayer());
1426  MB4Time.push_back((*digiIt).time());
1427  MB4Layer.push_back(id.layer());
1428  }
1429  }
1430  }
1431 
1432  if (verbosity > 1) {
1433  eventout += "\n Number of DtMuonDigis collected:.......... ";
1434  eventout += nDt;
1435  }
1436 
1437  // get CSC Strip information
1439  iEvent.getByToken(MuCSCStripSrc_Token_, strips);
1440  if (!strips.isValid()) {
1441  edm::LogWarning(MsgLoggerCat) << "Unable to find muon strips in event!";
1442  return;
1443  }
1444 
1445  int nStrips = 0;
1446  for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); ++j) {
1447  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
1448  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
1449 
1450  for (; digiItr != last; ++digiItr) {
1451  ++nStrips;
1452 
1453  // average pedestals
1454  std::vector<int> adcCounts = digiItr->getADCCounts();
1455  theCSCStripPedestalSum += adcCounts[0];
1456  theCSCStripPedestalSum += adcCounts[1];
1458 
1459  // if there are enough pedestal statistics
1460  if (theCSCStripPedestalCount > 100) {
1462  if (adcCounts[5] > (pedestal + 100))
1463  CSCStripADC.push_back(adcCounts[4] - pedestal);
1464  }
1465  }
1466  }
1467 
1468  if (verbosity > 1) {
1469  eventout += "\n Number of CSCStripDigis collected:........ ";
1470  eventout += nStrips;
1471  }
1472 
1473  // get CSC Wire information
1475  iEvent.getByToken(MuCSCWireSrc_Token_, wires);
1476  if (!wires.isValid()) {
1477  edm::LogWarning(MsgLoggerCat) << "Unable to find muon wires in event!";
1478  return;
1479  }
1480 
1481  int nWires = 0;
1482  for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); ++j) {
1483  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
1484  std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
1485 
1486  for (; digiItr != endDigi; ++digiItr) {
1487  ++nWires;
1488 
1489  CSCWireTime.push_back(digiItr->getTimeBin());
1490  }
1491  }
1492 
1493  if (verbosity > 1) {
1494  eventout += "\n Number of CSCWireDigis collected:......... ";
1495  eventout += nWires;
1496  }
1497 
1498  if (verbosity > 0)
1499  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1500 
1501  return;
1502 }
1503 
1505  std::string MsgLoggerCat = "GlobalDigisProducer_storeMuon";
1506 
1507  if (verbosity > 2) {
1508  // dt output
1509  TString eventout("\n nMB1 = ");
1510  eventout += MB1SLayer.size();
1511  for (unsigned int i = 0; i < MB1SLayer.size(); ++i) {
1512  eventout += "\n (slayer, time, layer) = (";
1513  eventout += MB1SLayer[i];
1514  eventout += ", ";
1515  eventout += MB1Time[i];
1516  eventout += ", ";
1517  eventout += MB1Layer[i];
1518  eventout += ")";
1519  }
1520  eventout += "\n nMB2 = ";
1521  eventout += MB2SLayer.size();
1522  for (unsigned int i = 0; i < MB2SLayer.size(); ++i) {
1523  eventout += "\n (slayer, time, layer) = (";
1524  eventout += MB2SLayer[i];
1525  eventout += ", ";
1526  eventout += MB2Time[i];
1527  eventout += ", ";
1528  eventout += MB2Layer[i];
1529  eventout += ")";
1530  }
1531  eventout += "\n nMB3 = ";
1532  eventout += MB3SLayer.size();
1533  for (unsigned int i = 0; i < MB3SLayer.size(); ++i) {
1534  eventout += "\n (slayer, time, layer) = (";
1535  eventout += MB3SLayer[i];
1536  eventout += ", ";
1537  eventout += MB3Time[i];
1538  eventout += ", ";
1539  eventout += MB3Layer[i];
1540  eventout += ")";
1541  }
1542  eventout += "\n nMB2 = ";
1543  eventout += MB4SLayer.size();
1544  for (unsigned int i = 0; i < MB4SLayer.size(); ++i) {
1545  eventout += "\n (slayer, time, layer) = (";
1546  eventout += MB4SLayer[i];
1547  eventout += ", ";
1548  eventout += MB4Time[i];
1549  eventout += ", ";
1550  eventout += MB4Layer[i];
1551  eventout += ")";
1552  }
1553 
1554  // CSC Strip
1555  eventout += "\n nCSCStrip = ";
1556  eventout += CSCStripADC.size();
1557  for (unsigned int i = 0; i < CSCStripADC.size(); ++i) {
1558  eventout += "\n (adc) = (";
1559  eventout += CSCStripADC[i];
1560  eventout += ")";
1561  }
1562 
1563  // CSC Wire
1564  eventout += "\n nCSCWire = ";
1565  eventout += CSCWireTime.size();
1566  for (unsigned int i = 0; i < CSCWireTime.size(); ++i) {
1567  eventout += "\n (time) = (";
1568  eventout += CSCWireTime[i];
1569  eventout += ")";
1570  }
1571 
1572  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1573  }
1574 
1579 
1580  product.putCSCstripDigis(CSCStripADC);
1581 
1582  product.putCSCwireDigis(CSCWireTime);
1583 
1584  return;
1585 }
1586 
1588  std::string MsgLoggerCat = "GlobalDigisProducer_clear";
1589 
1590  if (verbosity > 0)
1591  edm::LogInfo(MsgLoggerCat) << "Clearing event holders";
1592 
1593  // reset electromagnetic info
1594  // EE info
1595  EECalmaxPos.clear();
1596  EECalAEE.clear();
1597  EECalSHE.clear();
1598  // EB info
1599  EBCalmaxPos.clear();
1600  EBCalAEE.clear();
1601  EBCalSHE.clear();
1602  // ES info
1603  ESCalADC0.clear();
1604  ESCalADC1.clear();
1605  ESCalADC2.clear();
1606  ESCalSHE.clear();
1607 
1608  // reset HCal Info
1609  HBCalAEE.clear();
1610  HBCalSHE.clear();
1611  HECalAEE.clear();
1612  HECalSHE.clear();
1613  HOCalAEE.clear();
1614  HOCalSHE.clear();
1615  HFCalAEE.clear();
1616  HFCalSHE.clear();
1617 
1618  // reset Track Info
1619  TIBL1ADC.clear();
1620  TIBL2ADC.clear();
1621  TIBL3ADC.clear();
1622  TIBL4ADC.clear();
1623  TIBL1Strip.clear();
1624  TIBL2Strip.clear();
1625  TIBL3Strip.clear();
1626  TIBL4Strip.clear();
1627 
1628  TOBL1ADC.clear();
1629  TOBL2ADC.clear();
1630  TOBL3ADC.clear();
1631  TOBL4ADC.clear();
1632  TOBL1Strip.clear();
1633  TOBL2Strip.clear();
1634  TOBL3Strip.clear();
1635  TOBL4Strip.clear();
1636 
1637  TIDW1ADC.clear();
1638  TIDW2ADC.clear();
1639  TIDW3ADC.clear();
1640  TIDW1Strip.clear();
1641  TIDW2Strip.clear();
1642  TIDW3Strip.clear();
1643 
1644  TECW1ADC.clear();
1645  TECW2ADC.clear();
1646  TECW3ADC.clear();
1647  TECW4ADC.clear();
1648  TECW5ADC.clear();
1649  TECW6ADC.clear();
1650  TECW7ADC.clear();
1651  TECW8ADC.clear();
1652  TECW1Strip.clear();
1653  TECW2Strip.clear();
1654  TECW3Strip.clear();
1655  TECW4Strip.clear();
1656  TECW5Strip.clear();
1657  TECW6Strip.clear();
1658  TECW7Strip.clear();
1659  TECW8Strip.clear();
1660 
1661  BRL1ADC.clear();
1662  BRL1Row.clear();
1663  BRL1Col.clear();
1664  BRL2ADC.clear();
1665  BRL2Row.clear();
1666  BRL2Col.clear();
1667  BRL3ADC.clear();
1668  BRL3Row.clear();
1669  BRL3Col.clear();
1670 
1671  FWD1pADC.clear();
1672  FWD1pRow.clear();
1673  FWD1pCol.clear();
1674  FWD1nADC.clear();
1675  FWD1nRow.clear();
1676  FWD1nCol.clear();
1677  FWD2pADC.clear();
1678  FWD2pRow.clear();
1679  FWD2pCol.clear();
1680  FWD2nADC.clear();
1681  FWD2nRow.clear();
1682  FWD2nCol.clear();
1683 
1684  // muon clear
1685  MB1SLayer.clear();
1686  MB1Time.clear();
1687  MB1Layer.clear();
1688  MB2SLayer.clear();
1689  MB2Time.clear();
1690  MB2Layer.clear();
1691  MB3SLayer.clear();
1692  MB3Time.clear();
1693  MB3Layer.clear();
1694  MB4SLayer.clear();
1695  MB4Time.clear();
1696  MB4Layer.clear();
1697 
1698  CSCStripADC.clear();
1699 
1700  CSCWireTime.clear();
1701 
1702  return;
1703 }
1704 
1705 // define this as a plug-in
1706 // DEFINE_FWK_MODULE(GlobalDigisProducer);
void putTECW7Digis(const std::vector< float > &adc, const std::vector< int > &strip)
const ESDetId & id() const
Definition: ESDataFrame.h:19
void putTOBL4Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putFWD2pDigis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
void putTOBL1Digis(const std::vector< float > &adc, const std::vector< int > &strip)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unsigned int tobLayer(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
std::vector< PCaloHit > PCaloHitContainer
edm::ESGetToken< HcalDbService, HcalDbRecord > hcaldbToken_
int size() const
get the size
Definition: CaloSamples.h:24
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< CSCStripDigiCollection > MuCSCStripSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
void putBRL3Digis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
static const int sdHcalOut
edm::InputTag MuCSCStripSrc_
int size() const
Definition: ESDataFrame.h:21
edm::EDGetTokenT< edm::SortedCollection< HBHEDataFrame > > HBHEDigi_Token_
std::string const & instance() const
Definition: InputTag.h:37
unsigned int tidWheel(const DetId &id) const
static const int sdSiTID
unsigned int tecWheel(const DetId &id) const
T const * product() const
Definition: Handle.h:70
void putMB1Digis(const std::vector< int > &slayer, const std::vector< float > &time, const std::vector< int > &layer)
std::vector< T >::const_iterator const_iterator
unsigned long long EventNumber_t
key_type id() const
Definition: EBDataFrame.h:28
std::map< uint32_t, float, std::less< uint32_t > > MapType
void fillTrk(edm::Event &, const edm::EventSetup &)
std::string const & label() const
Definition: InputTag.h:36
void putHOCalDigis(const std::vector< float > &aee, const std::vector< float > &she)
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > SiStripSrc_Token_
key_type id() const
Definition: EEDataFrame.h:24
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
void putFWD2nDigis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
void storeECal(PGlobalDigi &)
edm::EDGetTokenT< EEDigiCollection > ECalEESrc_Token_
void putFWD1nDigis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
void putTECW8Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putFWD1pDigis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
void putTIDW3Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putTECW3Digis(const std::vector< float > &adc, const std::vector< int > &strip)
int size() const
Definition: EcalDataFrame.h:26
void putBRL1Digis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
T getUntrackedParameter(std::string const &, T const &) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:16
void fillMuon(edm::Event &, const edm::EventSetup &)
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
Definition: HcalCoderDb.cc:73
char const * label
GlobalDigisProducer(const edm::ParameterSet &)
void putTECW6Digis(const std::vector< float > &adc, const std::vector< int > &strip)
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< DTDigiCollection > MuDTSrc_Token_
void putHBCalDigis(const std::vector< float > &aee, const std::vector< float > &she)
void putTECW2Digis(const std::vector< float > &adc, const std::vector< int > &strip)
static const int sdSiTIB
void putEBCalDigis(const std::vector< int > &maxpos, const std::vector< double > &aee, const std::vector< float > &she)
static const int sdPxlBrl
void putTECW1Digis(const std::vector< float > &adc, const std::vector< int > &strip)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > SiPxlSrc_Token_
static const int MAXSAMPLES
Definition: ESDataFrame.h:30
void produce(edm::Event &, const edm::EventSetup &) override
void beginJob(void) override
void putHFCalDigis(const std::vector< float > &aee, const std::vector< float > &she)
unsigned int pxfDisk(const DetId &id) const
void putTECW4Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putTOBL2Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void storeTrk(PGlobalDigi &)
void storeHCal(PGlobalDigi &)
edm::EDGetTokenT< EBDigiCollection > ECalEBSrc_Token_
void putESCalDigis(const std::vector< float > &adc0, const std::vector< float > &adc1, const std::vector< float > &adc2, const std::vector< float > &she)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int sdSiTOB
edm::EDGetTokenT< edm::SortedCollection< HODataFrame > > HODigi_Token_
edm::EDGetTokenT< ESDigiCollection > ECalESSrc_Token_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
void putTECW5Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putMB4Digis(const std::vector< int > &slayer, const std::vector< float > &time, const std::vector< int > &layer)
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
ii
Definition: cuy.py:589
const int verbosity
void putBRL2Digis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
void reserve(size_t isize)
Log< level::Info, false > LogInfo
edm::EDGetTokenT< edm::SortedCollection< HFDataFrame > > HFDigi_Token_
float gain12Over6() const
Definition: DetId.h:17
unsigned int pxfSide(const DetId &id) const
std::map< int, double, std::less< int > > ECalgainConv_
void putHECalDigis(const std::vector< float > &aee, const std::vector< float > &she)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::pair< const_iterator, const_iterator > Range
void putEECalDigis(const std::vector< int > &maxpos, const std::vector< double > &aee, const std::vector< float > &she)
static const int sdHcalFwd
std::vector< DigiType >::const_iterator const_iterator
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > ecalADCtoGevToken_
void putTIBL1Digis(const std::vector< float > &adc, const std::vector< int > &strip)
float gain6Over1() const
static const int sdHcalBrl
void putMB2Digis(const std::vector< int > &slayer, const std::vector< float > &time, const std::vector< int > &layer)
bool isValid() const
Definition: HandleBase.h:70
static const int sdSiTEC
void putTIDW2Digis(const std::vector< float > &adc, const std::vector< int > &strip)
int adc() const
get the ADC sample (12 bits)
void storeMuon(PGlobalDigi &)
void putMB3Digis(const std::vector< int > &slayer, const std::vector< float > &time, const std::vector< int > &layer)
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
void fillHCal(edm::Event &, const edm::EventSetup &)
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
unsigned int RunNumber_t
unsigned int tibLayer(const DetId &id) const
static const int sdPxlFwd
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
void fillECal(edm::Event &, const edm::EventSetup &)
Log< level::Warning, false > LogWarning
void putCSCwireDigis(const std::vector< float > &time)
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
void putTIBL4Digis(const std::vector< float > &adc, const std::vector< int > &strip)
edm::EDGetTokenT< CSCWireDigiCollection > MuCSCWireSrc_Token_
void putTIBL2Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putTIBL3Digis(const std::vector< float > &adc, const std::vector< int > &strip)
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
static const int sdHcalEC
void putTOBL3Digis(const std::vector< float > &adc, const std::vector< int > &strip)
def move(src, dest)
Definition: eostools.py:511
int gainId() const
get the gainId (2 bits)
void putCSCstripDigis(const std::vector< float > &adc)
void putTIDW1Digis(const std::vector< float > &adc, const std::vector< int > &strip)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_