CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 pedestalPreSample = 0.;
329  double pedestalPreSampleAnalog = 0.;
330 
331  for (int sample = 0; sample < nrSamples; ++sample) {
332  // for (int sample = 0; sample < digis->size(); ++sample) {
333  ebAnalogSignal[sample] = 0.;
334  ebADCCounts[sample] = 0.;
335  ebADCGains[sample] = -1.;
336  }
337 
338  // calculate maximum energy and pedestal
339  for (int sample = 0; sample < nrSamples; ++sample) {
340  // for (int sample = 0; sample < digis->size(); ++sample) {
341 
342  EcalMGPASample thisSample = ebdf[sample];
343  ebADCCounts[sample] = (thisSample.adc());
344  ebADCGains[sample] = (thisSample.gainId());
345  ebAnalogSignal[sample] = (ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_);
346  if (Emax < ebAnalogSignal[sample]) {
347  Emax = ebAnalogSignal[sample];
348  Pmax = sample;
349  }
350  if (sample < 3) {
351  pedestalPreSample += ebADCCounts[sample];
352  pedestalPreSampleAnalog += ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_;
353  }
354  }
355  pedestalPreSample /= 3.;
356  pedestalPreSampleAnalog /= 3.;
357 
358  // calculate pedestal subtracted digi energy in the crystal
359  double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)ebADCGains[Pmax]];
360 
361  // gather necessary information
362  EBCalAEE.push_back(Erec);
363  EBCalSHE.push_back(ebSimMap[ebid.rawId()]);
364  EBCalmaxPos.push_back(Pmax);
365  }
366 
367  if (verbosity > 1) {
368  eventout += "\n Number of EBDigis collected:.............. ";
369  eventout += i;
370  }
371  }
372 
374  // extract EE information
376  bool isEndCap = true;
378  iEvent.getByToken(ECalEESrc_Token_, EcalDigiEE);
379  if (!EcalDigiEE.isValid()) {
380  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalDigiEE in event!";
381  return;
382  }
383  if (EcalDigiEE->empty())
384  isEndCap = false;
385 
386  if (isEndCap) {
387  // loop over simhits
388  iEvent.getByToken(EEHits_Token_, crossingFrame);
389  if (!crossingFrame.isValid()) {
390  edm::LogWarning(MsgLoggerCat) << "Unable to find cal endcap crossingFrame in event!";
391  return;
392  }
393  // std::unique_ptr<MixCollection<PCaloHit> >
394  // endcapHits(new MixCollection<PCaloHit>
395  // (crossingFrame.product(), endcapHitsName));
396  std::unique_ptr<MixCollection<PCaloHit>> endcapHits(new MixCollection<PCaloHit>(crossingFrame.product()));
397 
398  // keep track of sum of simhit energy in each crystal
399  MapType eeSimMap;
400  for (MixCollection<PCaloHit>::MixItr hitItr = endcapHits->begin(); hitItr != endcapHits->end(); ++hitItr) {
401  EEDetId eeid = EEDetId(hitItr->id());
402 
403  uint32_t crystid = eeid.rawId();
404  eeSimMap[crystid] += hitItr->energy();
405  }
406 
407  // loop over digis
408  const EEDigiCollection *endcapDigi = EcalDigiEE.product();
409 
410  std::vector<double> eeAnalogSignal;
411  std::vector<double> eeADCCounts;
412  std::vector<double> eeADCGains;
413  eeAnalogSignal.reserve(EEDataFrame::MAXSAMPLES);
414  eeADCCounts.reserve(EEDataFrame::MAXSAMPLES);
415  eeADCGains.reserve(EEDataFrame::MAXSAMPLES);
416 
417  int i = 0;
418  // for (std::vector<EEDataFrame>::const_iterator digis =
419  // endcapDigi->begin();
420  // digis != endcapDigi->end();
421  // ++digis) {
422  for (unsigned int digis = 0; digis < EcalDigiEE->size(); ++digis) {
423  ++i;
424 
425  EEDataFrame eedf = (*endcapDigi)[digis];
426  int nrSamples = eedf.size();
427 
428  EEDetId eeid = eedf.id();
429  // EEDetId eeid = digis->id();
430 
431  double Emax = 0;
432  int Pmax = 0;
433  double pedestalPreSample = 0.;
434  double pedestalPreSampleAnalog = 0.;
435 
436  for (int sample = 0; sample < nrSamples; ++sample) {
437  // for (int sample = 0; sample < digis->size(); ++sample) {
438  eeAnalogSignal[sample] = 0.;
439  eeADCCounts[sample] = 0.;
440  eeADCGains[sample] = -1.;
441  }
442 
443  // calculate maximum enery and pedestal
444  for (int sample = 0; sample < nrSamples; ++sample) {
445  // for (int sample = 0; sample < digis->size(); ++sample) {
446 
447  EcalMGPASample thisSample = eedf[sample];
448 
449  eeADCCounts[sample] = (thisSample.adc());
450  eeADCGains[sample] = (thisSample.gainId());
451  eeAnalogSignal[sample] = (eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_);
452  if (Emax < eeAnalogSignal[sample]) {
453  Emax = eeAnalogSignal[sample];
454  Pmax = sample;
455  }
456  if (sample < 3) {
457  pedestalPreSample += eeADCCounts[sample];
458  pedestalPreSampleAnalog += eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_;
459  }
460  }
461  pedestalPreSample /= 3.;
462  pedestalPreSampleAnalog /= 3.;
463 
464  // calculate pedestal subtracted digi energy in the crystal
465  double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)eeADCGains[Pmax]];
466 
467  // gather necessary information
468  EECalAEE.push_back(Erec);
469  EECalSHE.push_back(eeSimMap[eeid.rawId()]);
470  EECalmaxPos.push_back(Pmax);
471  }
472 
473  if (verbosity > 1) {
474  eventout += "\n Number of EEDigis collected:.............. ";
475  eventout += i;
476  }
477  }
478 
480  // extract ES information
482  bool isPreshower = true;
484  iEvent.getByToken(ECalESSrc_Token_, EcalDigiES);
485  if (!EcalDigiES.isValid()) {
486  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalDigiES in event!";
487  return;
488  }
489  if (EcalDigiES->empty())
490  isPreshower = false;
491 
492  if (isPreshower) {
493  // loop over simhits
494  iEvent.getByToken(ESHits_Token_, crossingFrame);
495  if (!crossingFrame.isValid()) {
496  edm::LogWarning(MsgLoggerCat) << "Unable to find cal preshower crossingFrame in event!";
497  return;
498  }
499  // std::unique_ptr<MixCollection<PCaloHit> >
500  // preshowerHits(new MixCollection<PCaloHit>
501  // (crossingFrame.product(), preshowerHitsName));
502  std::unique_ptr<MixCollection<PCaloHit>> preshowerHits(new MixCollection<PCaloHit>(crossingFrame.product()));
503 
504  // keep track of sum of simhit energy in each crystal
505  MapType esSimMap;
506  for (MixCollection<PCaloHit>::MixItr hitItr = preshowerHits->begin(); hitItr != preshowerHits->end(); ++hitItr) {
507  ESDetId esid = ESDetId(hitItr->id());
508 
509  uint32_t crystid = esid.rawId();
510  esSimMap[crystid] += hitItr->energy();
511  }
512 
513  // loop over digis
514  const ESDigiCollection *preshowerDigi = EcalDigiES.product();
515 
516  std::vector<double> esADCCounts;
517  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
518 
519  int i = 0;
520  for (unsigned int digis = 0; digis < EcalDigiES->size(); ++digis) {
521  // for (std::vector<ESDataFrame>::const_iterator digis =
522  // preshowerDigi->begin();
523  // digis != preshowerDigi->end();
524  // ++digis) {
525 
526  ++i;
527 
528  ESDataFrame esdf = (*preshowerDigi)[digis];
529  int nrSamples = esdf.size();
530 
531  ESDetId esid = esdf.id();
532  // ESDetId esid = digis->id();
533 
534  for (int sample = 0; sample < nrSamples; ++sample) {
535  // for (int sample = 0; sample < digis->size(); ++sample) {
536  esADCCounts[sample] = 0.;
537  }
538 
539  // gether ADC counts
540  for (int sample = 0; sample < nrSamples; ++sample) {
541  ESSample thisSample = esdf[sample];
542  // for (int sample = 0; sample < digis->size(); ++sample) {
543  esADCCounts[sample] = (thisSample.adc());
544  }
545 
546  ESCalADC0.push_back(esADCCounts[0]);
547  ESCalADC1.push_back(esADCCounts[1]);
548  ESCalADC2.push_back(esADCCounts[2]);
549  ESCalSHE.push_back(esSimMap[esid.rawId()]);
550  }
551 
552  if (verbosity > 1) {
553  eventout += "\n Number of ESDigis collected:.............. ";
554  eventout += i;
555  }
556  }
557 
558  if (verbosity > 0)
559  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
560 
561  return;
562 }
563 
565  std::string MsgLoggerCat = "GlobalDigisProducer_storeECal";
566 
567  if (verbosity > 2) {
568  TString eventout("\n nEBDigis = ");
569  eventout += EBCalmaxPos.size();
570  for (unsigned int i = 0; i < EBCalmaxPos.size(); ++i) {
571  eventout += "\n (maxPos, AEE, SHE) = (";
572  eventout += EBCalmaxPos[i];
573  eventout += ", ";
574  eventout += EBCalAEE[i];
575  eventout += ", ";
576  eventout += EBCalSHE[i];
577  eventout += ")";
578  }
579  eventout += "\n nEEDigis = ";
580  eventout += EECalmaxPos.size();
581  for (unsigned int i = 0; i < EECalmaxPos.size(); ++i) {
582  eventout += "\n (maxPos, AEE, SHE) = (";
583  eventout += EECalmaxPos[i];
584  eventout += ", ";
585  eventout += EECalAEE[i];
586  eventout += ", ";
587  eventout += EECalSHE[i];
588  eventout += ")";
589  }
590  eventout += "\n nESDigis = ";
591  eventout += ESCalADC0.size();
592  for (unsigned int i = 0; i < ESCalADC0.size(); ++i) {
593  eventout += "\n (ADC0, ADC1, ADC2, SHE) = (";
594  eventout += ESCalADC0[i];
595  eventout += ", ";
596  eventout += ESCalADC1[i];
597  eventout += ", ";
598  eventout += ESCalADC2[i];
599  eventout += ", ";
600  eventout += ESCalSHE[i];
601  eventout += ")";
602  }
603  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
604  }
605 
609 
610  return;
611 }
612 
614  std::string MsgLoggerCat = "GlobalDigisProducer_fillHCal";
615 
616  TString eventout;
617  if (verbosity > 0)
618  eventout = "\nGathering info:";
619 
620  // get calibration info
621  const auto &HCalconditions = iSetup.getHandle(hcaldbToken_);
622  if (!HCalconditions.isValid()) {
623  edm::LogWarning(MsgLoggerCat) << "Unable to find HCalconditions in event!";
624  return;
625  }
626  // HcalCalibrations calibrations;
627  CaloSamples tool;
628 
630  // extract simhit info
633  iEvent.getByToken(HCalSrc_Token_, hcalHits);
634  if (!hcalHits.isValid()) {
635  edm::LogWarning(MsgLoggerCat) << "Unable to find hcalHits in event!";
636  return;
637  }
638  const edm::PCaloHitContainer *simhitResult = hcalHits.product();
639 
640  MapType fHBEnergySimHits;
641  MapType fHEEnergySimHits;
642  MapType fHOEnergySimHits;
643  MapType fHFEnergySimHits;
644  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end();
645  ++simhits) {
646  HcalDetId detId(simhits->id());
647  uint32_t cellid = detId.rawId();
648 
649  if (detId.subdet() == sdHcalBrl) {
650  fHBEnergySimHits[cellid] += simhits->energy();
651  }
652  if (detId.subdet() == sdHcalEC) {
653  fHEEnergySimHits[cellid] += simhits->energy();
654  }
655  if (detId.subdet() == sdHcalOut) {
656  fHOEnergySimHits[cellid] += simhits->energy();
657  }
658  if (detId.subdet() == sdHcalFwd) {
659  fHFEnergySimHits[cellid] += simhits->energy();
660  }
661  }
662 
664  // get HBHE information
667  iEvent.getByToken(HBHEDigi_Token_, hbhe);
668  if (!hbhe.isValid()) {
669  edm::LogWarning(MsgLoggerCat) << "Unable to find HBHEDataFrame in event!";
670  return;
671  }
673 
674  int iHB = 0;
675  int iHE = 0;
676  for (ihbhe = hbhe->begin(); ihbhe != hbhe->end(); ++ihbhe) {
677  HcalDetId cell(ihbhe->id());
678 
679  if ((cell.subdet() == sdHcalBrl) || (cell.subdet() == sdHcalEC)) {
680  // HCalconditions->makeHcalCalibration(cell, &calibrations);
681  const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell);
682  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
683  const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder);
684 
685  HcalCoderDb coder(*channelCoder, *shape);
686  coder.adc2fC(*ihbhe, tool);
687 
688  // get HB info
689  if (cell.subdet() == sdHcalBrl) {
690  ++iHB;
691  float fDigiSum = 0.0;
692  for (int ii = 0; ii < tool.size(); ++ii) {
693  // default ped is 4.5
694  int capid = (*ihbhe)[ii].capid();
695  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
696  }
697 
698  HBCalAEE.push_back(fDigiSum);
699  HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
700  }
701 
702  // get HE info
703  if (cell.subdet() == sdHcalEC) {
704  ++iHE;
705  float fDigiSum = 0.0;
706  for (int ii = 0; ii < tool.size(); ++ii) {
707  int capid = (*ihbhe)[ii].capid();
708  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
709  }
710 
711  HECalAEE.push_back(fDigiSum);
712  HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
713  }
714  }
715  }
716 
717  if (verbosity > 1) {
718  eventout += "\n Number of HBDigis collected:.............. ";
719  eventout += iHB;
720  }
721 
722  if (verbosity > 1) {
723  eventout += "\n Number of HEDigis collected:.............. ";
724  eventout += iHE;
725  }
726 
728  // get HO information
731  iEvent.getByToken(HODigi_Token_, ho);
732  if (!ho.isValid()) {
733  edm::LogWarning(MsgLoggerCat) << "Unable to find HODataFrame in event!";
734  return;
735  }
737 
738  int iHO = 0;
739  for (iho = ho->begin(); iho != ho->end(); ++iho) {
740  HcalDetId cell(iho->id());
741 
742  if (cell.subdet() == sdHcalOut) {
743  // HCalconditions->makeHcalCalibration(cell, &calibrations);
744  const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell);
745  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
746  const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder);
747 
748  HcalCoderDb coder(*channelCoder, *shape);
749  coder.adc2fC(*iho, tool);
750 
751  ++iHO;
752  float fDigiSum = 0.0;
753  for (int ii = 0; ii < tool.size(); ++ii) {
754  // default ped is 4.5
755  int capid = (*iho)[ii].capid();
756  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
757  }
758 
759  HOCalAEE.push_back(fDigiSum);
760  HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
761  }
762  }
763 
764  if (verbosity > 1) {
765  eventout += "\n Number of HODigis collected:.............. ";
766  eventout += iHO;
767  }
768 
770  // get HF information
773  iEvent.getByToken(HFDigi_Token_, hf);
774  if (!hf.isValid()) {
775  edm::LogWarning(MsgLoggerCat) << "Unable to find HFDataFrame in event!";
776  return;
777  }
779 
780  int iHF = 0;
781  for (ihf = hf->begin(); ihf != hf->end(); ++ihf) {
782  HcalDetId cell(ihf->id());
783 
784  if (cell.subdet() == sdHcalFwd) {
785  // HCalconditions->makeHcalCalibration(cell, &calibrations);
786  const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell);
787  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
788  const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder);
789 
790  HcalCoderDb coder(*channelCoder, *shape);
791  coder.adc2fC(*ihf, tool);
792 
793  ++iHF;
794  float fDigiSum = 0.0;
795  for (int ii = 0; ii < tool.size(); ++ii) {
796  // default ped is 1.73077
797  int capid = (*ihf)[ii].capid();
798  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
799  }
800 
801  HFCalAEE.push_back(fDigiSum);
802  HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
803  }
804  }
805 
806  if (verbosity > 1) {
807  eventout += "\n Number of HFDigis collected:.............. ";
808  eventout += iHF;
809  }
810 
811  if (verbosity > 0)
812  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
813 
814  return;
815 }
816 
818  std::string MsgLoggerCat = "GlobalDigisProducer_storeHCal";
819 
820  if (verbosity > 2) {
821  TString eventout("\n nHBDigis = ");
822  eventout += HBCalAEE.size();
823  for (unsigned int i = 0; i < HBCalAEE.size(); ++i) {
824  eventout += "\n (AEE, SHE) = (";
825  eventout += HBCalAEE[i];
826  eventout += ", ";
827  eventout += HBCalSHE[i];
828  eventout += ")";
829  }
830  eventout += "\n nHEDigis = ";
831  eventout += HECalAEE.size();
832  for (unsigned int i = 0; i < HECalAEE.size(); ++i) {
833  eventout += "\n (AEE, SHE) = (";
834  eventout += HECalAEE[i];
835  eventout += ", ";
836  eventout += HECalSHE[i];
837  eventout += ")";
838  }
839  eventout += "\n nHODigis = ";
840  eventout += HOCalAEE.size();
841  for (unsigned int i = 0; i < HOCalAEE.size(); ++i) {
842  eventout += "\n (AEE, SHE) = (";
843  eventout += HOCalAEE[i];
844  eventout += ", ";
845  eventout += HOCalSHE[i];
846  eventout += ")";
847  }
848  eventout += "\n nHFDigis = ";
849  eventout += HFCalAEE.size();
850  for (unsigned int i = 0; i < HFCalAEE.size(); ++i) {
851  eventout += "\n (AEE, SHE) = (";
852  eventout += HFCalAEE[i];
853  eventout += ", ";
854  eventout += HFCalSHE[i];
855  eventout += ")";
856  }
857 
858  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
859  }
860 
861  product.putHBCalDigis(HBCalAEE, HBCalSHE);
862  product.putHECalDigis(HECalAEE, HECalSHE);
863  product.putHOCalDigis(HOCalAEE, HOCalSHE);
864  product.putHFCalDigis(HFCalAEE, HFCalSHE);
865 
866  return;
867 }
868 
870  // Retrieve tracker topology from geometry
871  const TrackerTopology *const tTopo = &iSetup.getData(tTopoToken_);
872 
873  std::string MsgLoggerCat = "GlobalDigisProducer_fillTrk";
874 
875  TString eventout;
876  if (verbosity > 0)
877  eventout = "\nGathering info:";
878 
879  // get strip information
881  iEvent.getByToken(SiStripSrc_Token_, stripDigis);
882  if (!stripDigis.isValid()) {
883  edm::LogWarning(MsgLoggerCat) << "Unable to find stripDigis in event!";
884  return;
885  }
886 
887  int nStripBrl = 0, nStripFwd = 0;
889  for (DSViter = stripDigis->begin(); DSViter != stripDigis->end(); ++DSViter) {
890  unsigned int id = DSViter->id;
891  DetId detId(id);
895 
896  // get TIB
897  if (detId.subdetId() == sdSiTIB) {
898  for (iter = begin; iter != end; ++iter) {
899  ++nStripBrl;
900  if (tTopo->tibLayer(id) == 1) {
901  TIBL1ADC.push_back((*iter).adc());
902  TIBL1Strip.push_back((*iter).strip());
903  }
904  if (tTopo->tibLayer(id) == 2) {
905  TIBL2ADC.push_back((*iter).adc());
906  TIBL2Strip.push_back((*iter).strip());
907  }
908  if (tTopo->tibLayer(id) == 3) {
909  TIBL3ADC.push_back((*iter).adc());
910  TIBL3Strip.push_back((*iter).strip());
911  }
912  if (tTopo->tibLayer(id) == 4) {
913  TIBL4ADC.push_back((*iter).adc());
914  TIBL4Strip.push_back((*iter).strip());
915  }
916  }
917  }
918 
919  // get TOB
920  if (detId.subdetId() == sdSiTOB) {
921  for (iter = begin; iter != end; ++iter) {
922  ++nStripBrl;
923  if (tTopo->tobLayer(id) == 1) {
924  TOBL1ADC.push_back((*iter).adc());
925  TOBL1Strip.push_back((*iter).strip());
926  }
927  if (tTopo->tobLayer(id) == 2) {
928  TOBL2ADC.push_back((*iter).adc());
929  TOBL2Strip.push_back((*iter).strip());
930  }
931  if (tTopo->tobLayer(id) == 3) {
932  TOBL3ADC.push_back((*iter).adc());
933  TOBL3Strip.push_back((*iter).strip());
934  }
935  if (tTopo->tobLayer(id) == 4) {
936  TOBL4ADC.push_back((*iter).adc());
937  TOBL4Strip.push_back((*iter).strip());
938  }
939  }
940  }
941 
942  // get TID
943  if (detId.subdetId() == sdSiTID) {
944  for (iter = begin; iter != end; ++iter) {
945  ++nStripFwd;
946  if (tTopo->tidWheel(id) == 1) {
947  TIDW1ADC.push_back((*iter).adc());
948  TIDW1Strip.push_back((*iter).strip());
949  }
950  if (tTopo->tidWheel(id) == 2) {
951  TIDW2ADC.push_back((*iter).adc());
952  TIDW2Strip.push_back((*iter).strip());
953  }
954  if (tTopo->tidWheel(id) == 3) {
955  TIDW3ADC.push_back((*iter).adc());
956  TIDW3Strip.push_back((*iter).strip());
957  }
958  }
959  }
960 
961  // get TEC
962  if (detId.subdetId() == sdSiTEC) {
963  for (iter = begin; iter != end; ++iter) {
964  ++nStripFwd;
965  if (tTopo->tecWheel(id) == 1) {
966  TECW1ADC.push_back((*iter).adc());
967  TECW1Strip.push_back((*iter).strip());
968  }
969  if (tTopo->tecWheel(id) == 2) {
970  TECW2ADC.push_back((*iter).adc());
971  TECW2Strip.push_back((*iter).strip());
972  }
973  if (tTopo->tecWheel(id) == 3) {
974  TECW3ADC.push_back((*iter).adc());
975  TECW3Strip.push_back((*iter).strip());
976  }
977  if (tTopo->tecWheel(id) == 4) {
978  TECW4ADC.push_back((*iter).adc());
979  TECW4Strip.push_back((*iter).strip());
980  }
981  if (tTopo->tecWheel(id) == 5) {
982  TECW5ADC.push_back((*iter).adc());
983  TECW5Strip.push_back((*iter).strip());
984  }
985  if (tTopo->tecWheel(id) == 6) {
986  TECW6ADC.push_back((*iter).adc());
987  TECW6Strip.push_back((*iter).strip());
988  }
989  if (tTopo->tecWheel(id) == 7) {
990  TECW7ADC.push_back((*iter).adc());
991  TECW7Strip.push_back((*iter).strip());
992  }
993  if (tTopo->tecWheel(id) == 8) {
994  TECW8ADC.push_back((*iter).adc());
995  TECW8Strip.push_back((*iter).strip());
996  }
997  }
998  }
999  } // end loop over DataSetVector
1000 
1001  if (verbosity > 1) {
1002  eventout += "\n Number of BrlStripDigis collected:........ ";
1003  eventout += nStripBrl;
1004  }
1005 
1006  if (verbosity > 1) {
1007  eventout += "\n Number of FrwdStripDigis collected:....... ";
1008  eventout += nStripFwd;
1009  }
1010 
1011  // get pixel information
1013  iEvent.getByToken(SiPxlSrc_Token_, pixelDigis);
1014  if (!pixelDigis.isValid()) {
1015  edm::LogWarning(MsgLoggerCat) << "Unable to find pixelDigis in event!";
1016  return;
1017  }
1018 
1019  int nPxlBrl = 0, nPxlFwd = 0;
1021  for (DPViter = pixelDigis->begin(); DPViter != pixelDigis->end(); ++DPViter) {
1022  unsigned int id = DPViter->id;
1023  DetId detId(id);
1027 
1028  // get Barrel pixels
1029  if (detId.subdetId() == sdPxlBrl) {
1030  for (iter = begin; iter != end; ++iter) {
1031  ++nPxlBrl;
1032  if (tTopo->pxbLayer(id) == 1) {
1033  BRL1ADC.push_back((*iter).adc());
1034  BRL1Row.push_back((*iter).row());
1035  BRL1Col.push_back((*iter).column());
1036  }
1037  if (tTopo->pxbLayer(id) == 2) {
1038  BRL2ADC.push_back((*iter).adc());
1039  BRL2Row.push_back((*iter).row());
1040  BRL2Col.push_back((*iter).column());
1041  }
1042  if (tTopo->pxbLayer(id) == 3) {
1043  BRL3ADC.push_back((*iter).adc());
1044  BRL3Row.push_back((*iter).row());
1045  BRL3Col.push_back((*iter).column());
1046  }
1047  }
1048  }
1049 
1050  // get Forward pixels
1051  if (detId.subdetId() == sdPxlFwd) {
1052  for (iter = begin; iter != end; ++iter) {
1053  ++nPxlFwd;
1054  if (tTopo->pxfDisk(id) == 1) {
1055  if (tTopo->pxfSide(id) == 1) {
1056  FWD1nADC.push_back((*iter).adc());
1057  FWD1nRow.push_back((*iter).row());
1058  FWD1nCol.push_back((*iter).column());
1059  }
1060  if (tTopo->pxfSide(id) == 2) {
1061  FWD1pADC.push_back((*iter).adc());
1062  FWD1pRow.push_back((*iter).row());
1063  FWD1pCol.push_back((*iter).column());
1064  }
1065  }
1066  if (tTopo->pxfDisk(id) == 2) {
1067  if (tTopo->pxfSide(id) == 1) {
1068  FWD2nADC.push_back((*iter).adc());
1069  FWD2nRow.push_back((*iter).row());
1070  FWD2nCol.push_back((*iter).column());
1071  }
1072  if (tTopo->pxfSide(id) == 2) {
1073  FWD2pADC.push_back((*iter).adc());
1074  FWD2pRow.push_back((*iter).row());
1075  FWD2pCol.push_back((*iter).column());
1076  }
1077  }
1078  }
1079  }
1080  }
1081 
1082  if (verbosity > 1) {
1083  eventout += "\n Number of BrlPixelDigis collected:........ ";
1084  eventout += nPxlBrl;
1085  }
1086 
1087  if (verbosity > 1) {
1088  eventout += "\n Number of FrwdPixelDigis collected:....... ";
1089  eventout += nPxlFwd;
1090  }
1091 
1092  if (verbosity > 0)
1093  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1094 
1095  return;
1096 }
1097 
1099  std::string MsgLoggerCat = "GlobalDigisProducer_storeTrk";
1100 
1101  if (verbosity > 2) {
1102  // strip output
1103  TString eventout("\n nTIBL1 = ");
1104  eventout += TIBL1ADC.size();
1105  for (unsigned int i = 0; i < TIBL1ADC.size(); ++i) {
1106  eventout += "\n (ADC, strip) = (";
1107  eventout += TIBL1ADC[i];
1108  eventout += ", ";
1109  eventout += TIBL1Strip[i];
1110  eventout += ")";
1111  }
1112  eventout += "\n nTIBL2 = ";
1113  eventout += TIBL2ADC.size();
1114  for (unsigned int i = 0; i < TIBL2ADC.size(); ++i) {
1115  eventout += "\n (ADC, strip) = (";
1116  eventout += TIBL2ADC[i];
1117  eventout += ", ";
1118  eventout += TIBL2Strip[i];
1119  eventout += ")";
1120  }
1121  eventout += "\n nTIBL3 = ";
1122  eventout += TIBL3ADC.size();
1123  for (unsigned int i = 0; i < TIBL3ADC.size(); ++i) {
1124  eventout += "\n (ADC, strip) = (";
1125  eventout += TIBL3ADC[i];
1126  eventout += ", ";
1127  eventout += TIBL3Strip[i];
1128  eventout += ")";
1129  }
1130  eventout += "\n nTIBL4 = ";
1131  eventout += TIBL4ADC.size();
1132  for (unsigned int i = 0; i < TIBL4ADC.size(); ++i) {
1133  eventout += "\n (ADC, strip) = (";
1134  eventout += TIBL4ADC[i];
1135  eventout += ", ";
1136  eventout += TIBL4Strip[i];
1137  eventout += ")";
1138  }
1139  eventout += "\n nTOBL1 = ";
1140  eventout += TOBL1ADC.size();
1141  for (unsigned int i = 0; i < TOBL1ADC.size(); ++i) {
1142  eventout += "\n (ADC, strip) = (";
1143  eventout += TOBL1ADC[i];
1144  eventout += ", ";
1145  eventout += TOBL1Strip[i];
1146  eventout += ")";
1147  }
1148  eventout += "\n nTOBL2 = ";
1149  eventout += TOBL2ADC.size();
1150  for (unsigned int i = 0; i < TOBL2ADC.size(); ++i) {
1151  eventout += "\n (ADC, strip) = (";
1152  eventout += TOBL2ADC[i];
1153  eventout += ", ";
1154  eventout += TOBL2Strip[i];
1155  eventout += ")";
1156  }
1157  eventout += "\n nTOBL3 = ";
1158  eventout += TOBL3ADC.size();
1159  for (unsigned int i = 0; i < TOBL3ADC.size(); ++i) {
1160  eventout += "\n (ADC, strip) = (";
1161  eventout += TOBL3ADC[i];
1162  eventout += ", ";
1163  eventout += TOBL3Strip[i];
1164  eventout += ")";
1165  }
1166  eventout += "\n nTOBL4 = ";
1167  eventout += TOBL4ADC.size();
1168  for (unsigned int i = 0; i < TOBL4ADC.size(); ++i) {
1169  eventout += "\n (ADC, strip) = (";
1170  eventout += TOBL4ADC[i];
1171  eventout += ", ";
1172  eventout += TOBL4Strip[i];
1173  eventout += ")";
1174  }
1175  eventout += "\n nTIDW1 = ";
1176  eventout += TIDW1ADC.size();
1177  for (unsigned int i = 0; i < TIDW1ADC.size(); ++i) {
1178  eventout += "\n (ADC, strip) = (";
1179  eventout += TIDW1ADC[i];
1180  eventout += ", ";
1181  eventout += TIDW1Strip[i];
1182  eventout += ")";
1183  }
1184  eventout += "\n nTIDW2 = ";
1185  eventout += TIDW2ADC.size();
1186  for (unsigned int i = 0; i < TIDW2ADC.size(); ++i) {
1187  eventout += "\n (ADC, strip) = (";
1188  eventout += TIDW2ADC[i];
1189  eventout += ", ";
1190  eventout += TIDW2Strip[i];
1191  eventout += ")";
1192  }
1193  eventout += "\n nTIDW3 = ";
1194  eventout += TIDW3ADC.size();
1195  for (unsigned int i = 0; i < TIDW3ADC.size(); ++i) {
1196  eventout += "\n (ADC, strip) = (";
1197  eventout += TIDW3ADC[i];
1198  eventout += ", ";
1199  eventout += TIDW3Strip[i];
1200  eventout += ")";
1201  }
1202  eventout += "\n nTECW1 = ";
1203  eventout += TECW1ADC.size();
1204  for (unsigned int i = 0; i < TECW1ADC.size(); ++i) {
1205  eventout += "\n (ADC, strip) = (";
1206  eventout += TECW1ADC[i];
1207  eventout += ", ";
1208  eventout += TECW1Strip[i];
1209  eventout += ")";
1210  }
1211  eventout += "\n nTECW2 = ";
1212  eventout += TECW2ADC.size();
1213  for (unsigned int i = 0; i < TECW2ADC.size(); ++i) {
1214  eventout += "\n (ADC, strip) = (";
1215  eventout += TECW2ADC[i];
1216  eventout += ", ";
1217  eventout += TECW2Strip[i];
1218  eventout += ")";
1219  }
1220  eventout += "\n nTECW3 = ";
1221  eventout += TECW3ADC.size();
1222  for (unsigned int i = 0; i < TECW3ADC.size(); ++i) {
1223  eventout += "\n (ADC, strip) = (";
1224  eventout += TECW3ADC[i];
1225  eventout += ", ";
1226  eventout += TECW3Strip[i];
1227  eventout += ")";
1228  }
1229  eventout += "\n nTECW4 = ";
1230  eventout += TECW4ADC.size();
1231  for (unsigned int i = 0; i < TECW4ADC.size(); ++i) {
1232  eventout += "\n (ADC, strip) = (";
1233  eventout += TECW4ADC[i];
1234  eventout += ", ";
1235  eventout += TECW4Strip[i];
1236  eventout += ")";
1237  }
1238  eventout += "\n nTECW5 = ";
1239  eventout += TECW5ADC.size();
1240  for (unsigned int i = 0; i < TECW5ADC.size(); ++i) {
1241  eventout += "\n (ADC, strip) = (";
1242  eventout += TECW5ADC[i];
1243  eventout += ", ";
1244  eventout += TECW5Strip[i];
1245  eventout += ")";
1246  }
1247  eventout += "\n nTECW6 = ";
1248  eventout += TECW6ADC.size();
1249  for (unsigned int i = 0; i < TECW6ADC.size(); ++i) {
1250  eventout += "\n (ADC, strip) = (";
1251  eventout += TECW6ADC[i];
1252  eventout += ", ";
1253  eventout += TECW6Strip[i];
1254  eventout += ")";
1255  }
1256  eventout += "\n nTECW7 = ";
1257  eventout += TECW7ADC.size();
1258  for (unsigned int i = 0; i < TECW7ADC.size(); ++i) {
1259  eventout += "\n (ADC, strip) = (";
1260  eventout += TECW7ADC[i];
1261  eventout += ", ";
1262  eventout += TECW7Strip[i];
1263  eventout += ")";
1264  }
1265  eventout += "\n nTECW8 = ";
1266  eventout += TECW8ADC.size();
1267  for (unsigned int i = 0; i < TECW8ADC.size(); ++i) {
1268  eventout += "\n (ADC, strip) = (";
1269  eventout += TECW8ADC[i];
1270  eventout += ", ";
1271  eventout += TECW8Strip[i];
1272  eventout += ")";
1273  }
1274 
1275  // pixel output
1276  eventout += "\n nBRL1 = ";
1277  eventout += BRL1ADC.size();
1278  for (unsigned int i = 0; i < BRL1ADC.size(); ++i) {
1279  eventout += "\n (ADC, row, column) = (";
1280  eventout += BRL1ADC[i];
1281  eventout += ", ";
1282  eventout += BRL1Row[i];
1283  eventout += ", ";
1284  eventout += BRL1Col[i];
1285  eventout += ")";
1286  }
1287  eventout += "\n nBRL2 = ";
1288  eventout += BRL2ADC.size();
1289  for (unsigned int i = 0; i < BRL2ADC.size(); ++i) {
1290  eventout += "\n (ADC, row, column) = (";
1291  eventout += BRL2ADC[i];
1292  eventout += ", ";
1293  eventout += BRL2Row[i];
1294  eventout += ", ";
1295  eventout += BRL2Col[i];
1296  eventout += ")";
1297  }
1298  eventout += "\n nBRL3 = ";
1299  eventout += BRL3ADC.size();
1300  for (unsigned int i = 0; i < BRL3ADC.size(); ++i) {
1301  eventout += "\n (ADC, row, column) = (";
1302  eventout += BRL3ADC[i];
1303  eventout += ", ";
1304  eventout += BRL3Row[i];
1305  eventout += ", ";
1306  eventout += BRL3Col[i];
1307  eventout += ")";
1308  }
1309  eventout += "\n nFWD1p = ";
1310  eventout += FWD1pADC.size();
1311  for (unsigned int i = 0; i < FWD1pADC.size(); ++i) {
1312  eventout += "\n (ADC, row, column) = (";
1313  eventout += FWD1pADC[i];
1314  eventout += ", ";
1315  eventout += FWD1pRow[i];
1316  eventout += ", ";
1317  eventout += FWD1pCol[i];
1318  eventout += ")";
1319  }
1320  eventout += "\n nFWD1p = ";
1321  eventout += FWD1nADC.size();
1322  for (unsigned int i = 0; i < FWD1nADC.size(); ++i) {
1323  eventout += "\n (ADC, row, column) = (";
1324  eventout += FWD1nADC[i];
1325  eventout += ", ";
1326  eventout += FWD1nRow[i];
1327  eventout += ", ";
1328  eventout += FWD1nCol[i];
1329  eventout += ")";
1330  }
1331  eventout += "\n nFWD1p = ";
1332  eventout += FWD2pADC.size();
1333  for (unsigned int i = 0; i < FWD2pADC.size(); ++i) {
1334  eventout += "\n (ADC, row, column) = (";
1335  eventout += FWD2pADC[i];
1336  eventout += ", ";
1337  eventout += FWD2pRow[i];
1338  eventout += ", ";
1339  eventout += FWD2pCol[i];
1340  eventout += ")";
1341  }
1342  eventout += "\n nFWD2p = ";
1343  eventout += FWD2nADC.size();
1344  for (unsigned int i = 0; i < FWD2nADC.size(); ++i) {
1345  eventout += "\n (ADC, row, column) = (";
1346  eventout += FWD2nADC[i];
1347  eventout += ", ";
1348  eventout += FWD2nRow[i];
1349  eventout += ", ";
1350  eventout += FWD2nCol[i];
1351  eventout += ")";
1352  }
1353 
1354  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1355  }
1356 
1357  // strip output
1358  product.putTIBL1Digis(TIBL1ADC, TIBL1Strip);
1359  product.putTIBL2Digis(TIBL2ADC, TIBL2Strip);
1360  product.putTIBL3Digis(TIBL3ADC, TIBL3Strip);
1361  product.putTIBL4Digis(TIBL4ADC, TIBL4Strip);
1362  product.putTOBL1Digis(TOBL1ADC, TOBL1Strip);
1363  product.putTOBL2Digis(TOBL2ADC, TOBL2Strip);
1364  product.putTOBL3Digis(TOBL3ADC, TOBL3Strip);
1365  product.putTOBL4Digis(TOBL4ADC, TOBL4Strip);
1366  product.putTIDW1Digis(TIDW1ADC, TIDW1Strip);
1367  product.putTIDW2Digis(TIDW2ADC, TIDW2Strip);
1368  product.putTIDW3Digis(TIDW3ADC, TIDW3Strip);
1369  product.putTECW1Digis(TECW1ADC, TECW1Strip);
1370  product.putTECW2Digis(TECW2ADC, TECW2Strip);
1371  product.putTECW3Digis(TECW3ADC, TECW3Strip);
1372  product.putTECW4Digis(TECW4ADC, TECW4Strip);
1373  product.putTECW5Digis(TECW5ADC, TECW5Strip);
1374  product.putTECW6Digis(TECW6ADC, TECW6Strip);
1375  product.putTECW7Digis(TECW7ADC, TECW7Strip);
1376  product.putTECW8Digis(TECW8ADC, TECW8Strip);
1377 
1378  // pixel output
1379  product.putBRL1Digis(BRL1ADC, BRL1Row, BRL1Col);
1380  product.putBRL2Digis(BRL2ADC, BRL2Row, BRL2Col);
1381  product.putBRL3Digis(BRL3ADC, BRL3Row, BRL3Col);
1386 
1387  return;
1388 }
1389 
1391  std::string MsgLoggerCat = "GlobalDigisProducer_fillMuon";
1392 
1393  TString eventout;
1394  if (verbosity > 0)
1395  eventout = "\nGathering info:";
1396 
1397  // get DT information
1399  iEvent.getByToken(MuDTSrc_Token_, dtDigis);
1400  if (!dtDigis.isValid()) {
1401  edm::LogWarning(MsgLoggerCat) << "Unable to find dtDigis in event!";
1402  return;
1403  }
1404 
1405  int nDt = 0;
1407  for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) {
1408  const DTLayerId &id = (*detUnitIt).first;
1409  const DTDigiCollection::Range &range = (*detUnitIt).second;
1410 
1411  for (DTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) {
1412  ++nDt;
1413 
1414  DTWireId wireId(id, (*digiIt).wire());
1415  if (wireId.station() == 1) {
1416  MB1SLayer.push_back(id.superlayer());
1417  MB1Time.push_back((*digiIt).time());
1418  MB1Layer.push_back(id.layer());
1419  }
1420  if (wireId.station() == 2) {
1421  MB2SLayer.push_back(id.superlayer());
1422  MB2Time.push_back((*digiIt).time());
1423  MB2Layer.push_back(id.layer());
1424  }
1425  if (wireId.station() == 3) {
1426  MB3SLayer.push_back(id.superlayer());
1427  MB3Time.push_back((*digiIt).time());
1428  MB3Layer.push_back(id.layer());
1429  }
1430  if (wireId.station() == 4) {
1431  MB4SLayer.push_back(id.superlayer());
1432  MB4Time.push_back((*digiIt).time());
1433  MB4Layer.push_back(id.layer());
1434  }
1435  }
1436  }
1437 
1438  if (verbosity > 1) {
1439  eventout += "\n Number of DtMuonDigis collected:.......... ";
1440  eventout += nDt;
1441  }
1442 
1443  // get CSC Strip information
1445  iEvent.getByToken(MuCSCStripSrc_Token_, strips);
1446  if (!strips.isValid()) {
1447  edm::LogWarning(MsgLoggerCat) << "Unable to find muon strips in event!";
1448  return;
1449  }
1450 
1451  int nStrips = 0;
1452  for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); ++j) {
1453  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
1454  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
1455 
1456  for (; digiItr != last; ++digiItr) {
1457  ++nStrips;
1458 
1459  // average pedestals
1460  std::vector<int> adcCounts = digiItr->getADCCounts();
1461  theCSCStripPedestalSum += adcCounts[0];
1462  theCSCStripPedestalSum += adcCounts[1];
1464 
1465  // if there are enough pedestal statistics
1466  if (theCSCStripPedestalCount > 100) {
1468  if (adcCounts[5] > (pedestal + 100))
1469  CSCStripADC.push_back(adcCounts[4] - pedestal);
1470  }
1471  }
1472  }
1473 
1474  if (verbosity > 1) {
1475  eventout += "\n Number of CSCStripDigis collected:........ ";
1476  eventout += nStrips;
1477  }
1478 
1479  // get CSC Wire information
1481  iEvent.getByToken(MuCSCWireSrc_Token_, wires);
1482  if (!wires.isValid()) {
1483  edm::LogWarning(MsgLoggerCat) << "Unable to find muon wires in event!";
1484  return;
1485  }
1486 
1487  int nWires = 0;
1488  for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); ++j) {
1489  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
1490  std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
1491 
1492  for (; digiItr != endDigi; ++digiItr) {
1493  ++nWires;
1494 
1495  CSCWireTime.push_back(digiItr->getTimeBin());
1496  }
1497  }
1498 
1499  if (verbosity > 1) {
1500  eventout += "\n Number of CSCWireDigis collected:......... ";
1501  eventout += nWires;
1502  }
1503 
1504  if (verbosity > 0)
1505  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1506 
1507  return;
1508 }
1509 
1511  std::string MsgLoggerCat = "GlobalDigisProducer_storeMuon";
1512 
1513  if (verbosity > 2) {
1514  // dt output
1515  TString eventout("\n nMB1 = ");
1516  eventout += MB1SLayer.size();
1517  for (unsigned int i = 0; i < MB1SLayer.size(); ++i) {
1518  eventout += "\n (slayer, time, layer) = (";
1519  eventout += MB1SLayer[i];
1520  eventout += ", ";
1521  eventout += MB1Time[i];
1522  eventout += ", ";
1523  eventout += MB1Layer[i];
1524  eventout += ")";
1525  }
1526  eventout += "\n nMB2 = ";
1527  eventout += MB2SLayer.size();
1528  for (unsigned int i = 0; i < MB2SLayer.size(); ++i) {
1529  eventout += "\n (slayer, time, layer) = (";
1530  eventout += MB2SLayer[i];
1531  eventout += ", ";
1532  eventout += MB2Time[i];
1533  eventout += ", ";
1534  eventout += MB2Layer[i];
1535  eventout += ")";
1536  }
1537  eventout += "\n nMB3 = ";
1538  eventout += MB3SLayer.size();
1539  for (unsigned int i = 0; i < MB3SLayer.size(); ++i) {
1540  eventout += "\n (slayer, time, layer) = (";
1541  eventout += MB3SLayer[i];
1542  eventout += ", ";
1543  eventout += MB3Time[i];
1544  eventout += ", ";
1545  eventout += MB3Layer[i];
1546  eventout += ")";
1547  }
1548  eventout += "\n nMB2 = ";
1549  eventout += MB4SLayer.size();
1550  for (unsigned int i = 0; i < MB4SLayer.size(); ++i) {
1551  eventout += "\n (slayer, time, layer) = (";
1552  eventout += MB4SLayer[i];
1553  eventout += ", ";
1554  eventout += MB4Time[i];
1555  eventout += ", ";
1556  eventout += MB4Layer[i];
1557  eventout += ")";
1558  }
1559 
1560  // CSC Strip
1561  eventout += "\n nCSCStrip = ";
1562  eventout += CSCStripADC.size();
1563  for (unsigned int i = 0; i < CSCStripADC.size(); ++i) {
1564  eventout += "\n (adc) = (";
1565  eventout += CSCStripADC[i];
1566  eventout += ")";
1567  }
1568 
1569  // CSC Wire
1570  eventout += "\n nCSCWire = ";
1571  eventout += CSCWireTime.size();
1572  for (unsigned int i = 0; i < CSCWireTime.size(); ++i) {
1573  eventout += "\n (time) = (";
1574  eventout += CSCWireTime[i];
1575  eventout += ")";
1576  }
1577 
1578  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1579  }
1580 
1585 
1586  product.putCSCstripDigis(CSCStripADC);
1587 
1588  product.putCSCwireDigis(CSCWireTime);
1589 
1590  return;
1591 }
1592 
1594  std::string MsgLoggerCat = "GlobalDigisProducer_clear";
1595 
1596  if (verbosity > 0)
1597  edm::LogInfo(MsgLoggerCat) << "Clearing event holders";
1598 
1599  // reset electromagnetic info
1600  // EE info
1601  EECalmaxPos.clear();
1602  EECalAEE.clear();
1603  EECalSHE.clear();
1604  // EB info
1605  EBCalmaxPos.clear();
1606  EBCalAEE.clear();
1607  EBCalSHE.clear();
1608  // ES info
1609  ESCalADC0.clear();
1610  ESCalADC1.clear();
1611  ESCalADC2.clear();
1612  ESCalSHE.clear();
1613 
1614  // reset HCal Info
1615  HBCalAEE.clear();
1616  HBCalSHE.clear();
1617  HECalAEE.clear();
1618  HECalSHE.clear();
1619  HOCalAEE.clear();
1620  HOCalSHE.clear();
1621  HFCalAEE.clear();
1622  HFCalSHE.clear();
1623 
1624  // reset Track Info
1625  TIBL1ADC.clear();
1626  TIBL2ADC.clear();
1627  TIBL3ADC.clear();
1628  TIBL4ADC.clear();
1629  TIBL1Strip.clear();
1630  TIBL2Strip.clear();
1631  TIBL3Strip.clear();
1632  TIBL4Strip.clear();
1633 
1634  TOBL1ADC.clear();
1635  TOBL2ADC.clear();
1636  TOBL3ADC.clear();
1637  TOBL4ADC.clear();
1638  TOBL1Strip.clear();
1639  TOBL2Strip.clear();
1640  TOBL3Strip.clear();
1641  TOBL4Strip.clear();
1642 
1643  TIDW1ADC.clear();
1644  TIDW2ADC.clear();
1645  TIDW3ADC.clear();
1646  TIDW1Strip.clear();
1647  TIDW2Strip.clear();
1648  TIDW3Strip.clear();
1649 
1650  TECW1ADC.clear();
1651  TECW2ADC.clear();
1652  TECW3ADC.clear();
1653  TECW4ADC.clear();
1654  TECW5ADC.clear();
1655  TECW6ADC.clear();
1656  TECW7ADC.clear();
1657  TECW8ADC.clear();
1658  TECW1Strip.clear();
1659  TECW2Strip.clear();
1660  TECW3Strip.clear();
1661  TECW4Strip.clear();
1662  TECW5Strip.clear();
1663  TECW6Strip.clear();
1664  TECW7Strip.clear();
1665  TECW8Strip.clear();
1666 
1667  BRL1ADC.clear();
1668  BRL1Row.clear();
1669  BRL1Col.clear();
1670  BRL2ADC.clear();
1671  BRL2Row.clear();
1672  BRL2Col.clear();
1673  BRL3ADC.clear();
1674  BRL3Row.clear();
1675  BRL3Col.clear();
1676 
1677  FWD1pADC.clear();
1678  FWD1pRow.clear();
1679  FWD1pCol.clear();
1680  FWD1nADC.clear();
1681  FWD1nRow.clear();
1682  FWD1nCol.clear();
1683  FWD2pADC.clear();
1684  FWD2pRow.clear();
1685  FWD2pCol.clear();
1686  FWD2nADC.clear();
1687  FWD2nRow.clear();
1688  FWD2nCol.clear();
1689 
1690  // muon clear
1691  MB1SLayer.clear();
1692  MB1Time.clear();
1693  MB1Layer.clear();
1694  MB2SLayer.clear();
1695  MB2Time.clear();
1696  MB2Layer.clear();
1697  MB3SLayer.clear();
1698  MB3Time.clear();
1699  MB3Layer.clear();
1700  MB4SLayer.clear();
1701  MB4Time.clear();
1702  MB4Layer.clear();
1703 
1704  CSCStripADC.clear();
1705 
1706  CSCWireTime.clear();
1707 
1708  return;
1709 }
1710 
1711 // define this as a plug-in
1712 // DEFINE_FWK_MODULE(GlobalDigisProducer);
RunNumber_t run() const
Definition: EventID.h:38
void putTECW7Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putTOBL4Digis(const std::vector< float > &adc, const std::vector< int > &strip)
EventNumber_t event() const
Definition: EventID.h:40
T getUntrackedParameter(std::string const &, T const &) const
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)
std::vector< PCaloHit > PCaloHitContainer
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::ESGetToken< HcalDbService, HcalDbRecord > hcaldbToken_
key_type id() const
Definition: EBDataFrame.h:28
int ihf
unsigned int tibLayer(const DetId &id) const
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_
edm::EDGetTokenT< edm::SortedCollection< HBHEDataFrame > > HBHEDigi_Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
const ESDetId & id() const
Definition: ESDataFrame.h:19
unsigned int pxfDisk(const DetId &id) const
static const int sdSiTID
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
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
unsigned int tidWheel(const DetId &id) const
std::map< uint32_t, float, std::less< uint32_t > > MapType
void fillTrk(edm::Event &, const edm::EventSetup &)
void putHOCalDigis(const std::vector< float > &aee, const std::vector< float > &she)
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > SiStripSrc_Token_
int size() const
Definition: ESDataFrame.h:21
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_
int ii
Definition: cuy.py:589
void putFWD1nDigis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
int gainId() const
get the gainId (2 bits)
void putTECW8Digis(const std::vector< float > &adc, const std::vector< int > &strip)
tuple 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 putFWD1pDigis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
int size() const
Definition: EcalDataFrame.h:26
constexpr std::array< uint8_t, layerIndexSize > layer
void putTIDW3Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putTECW3Digis(const std::vector< float > &adc, const std::vector< int > &strip)
const uint16_t range(const Frame &aFrame)
void putBRL1Digis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
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
tuple 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 produce(edm::Event &, const edm::EventSetup &) override
def move
Definition: eostools.py:511
void beginJob(void) override
void putHFCalDigis(const std::vector< float > &aee, 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
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)
string preshowerHits
static const int sdSiTOB
float gain6Over1() const
edm::EDGetTokenT< edm::SortedCollection< HODataFrame > > HODigi_Token_
edm::EDGetTokenT< ESDigiCollection > ECalESSrc_Token_
bool isValid() const
Definition: HandleBase.h:70
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
key_type id() const
Definition: EEDataFrame.h:24
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
void putBRL2Digis(const std::vector< float > &adc, const std::vector< int > &row, const std::vector< int > &column)
unsigned int pxbLayer(const DetId &id) const
Log< level::Info, false > LogInfo
edm::EDGetTokenT< edm::SortedCollection< HFDataFrame > > HFDigi_Token_
Definition: DetId.h:17
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
std::map< int, double, std::less< int > > ECalgainConv_
void putHECalDigis(const std::vector< float > &aee, const std::vector< float > &she)
T const * product() const
Definition: Handle.h:70
int size() const
get the size
Definition: CaloSamples.h:24
std::pair< const_iterator, const_iterator > Range
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void putEECalDigis(const std::vector< int > &maxpos, const std::vector< double > &aee, const std::vector< float > &she)
static const int sdHcalFwd
float gain12Over6() const
std::vector< DigiType >::const_iterator const_iterator
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > ecalADCtoGevToken_
void putTIBL1Digis(const std::vector< float > &adc, const std::vector< int > &strip)
static const int sdHcalBrl
void putMB2Digis(const std::vector< int > &slayer, const std::vector< float > &time, const std::vector< int > &layer)
std::string const & label() const
Definition: InputTag.h:36
edm::EventID id() const
Definition: EventBase.h:59
static const int sdSiTEC
void putTIDW2Digis(const std::vector< float > &adc, const std::vector< int > &strip)
string end
Definition: dataset.py:937
void storeMuon(PGlobalDigi &)
void putMB3Digis(const std::vector< int > &slayer, const std::vector< float > &time, const std::vector< int > &layer)
unsigned int pxfSide(const DetId &id) const
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:16
void fillHCal(edm::Event &, const edm::EventSetup &)
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
unsigned int RunNumber_t
tuple wires
Definition: DigiDM_cff.py:33
static const int sdPxlFwd
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
void fillECal(edm::Event &, const edm::EventSetup &)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
tuple last
Definition: dqmdumpme.py:56
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)
unsigned int tecWheel(const DetId &id) const
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
std::string const & instance() const
Definition: InputTag.h:37
static const int sdHcalEC
void putTOBL3Digis(const std::vector< float > &adc, const std::vector< int > &strip)
void putCSCstripDigis(const std::vector< float > &adc)
unsigned int tobLayer(const DetId &id) const
int adc() const
get the ADC sample (12 bits)
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:136
void putTIDW1Digis(const std::vector< float > &adc, const std::vector< int > &strip)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_