CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDigiTester.cc
Go to the documentation of this file.
4 
12 
17 
21 
23 
27 #include <vector>
28 #include <utility>
29 #include <ostream>
30 #include <string>
31 #include <algorithm>
32 #include <cmath>
33 
38 
39 template<class Digi>
40 
42 
43 
46 
47  // ADC2fC
48  HcalCalibrations calibrations;
49  CaloSamples tool;
50 
51 
52  iEvent.getByLabel (inputTag_, digiCollection);
53 
54  int subdet = 0;
55  if (hcalselector_ == "HB" ) subdet = 1;
56  if (hcalselector_ == "HE" ) subdet = 2;
57  if (hcalselector_ == "HO" ) subdet = 3;
58  if (hcalselector_ == "HF" ) subdet = 4;
59 
60  if(subdet == 1) nevent1++;
61  if(subdet == 2) nevent2++;
62  if(subdet == 3) nevent3++;
63  if(subdet == 4) nevent4++;
64 
65  int zsign = 0;
66  if (zside_ == "+") zsign = 1;
67  if (zside_ == "-") zsign = -1;
68 
69  int ndigis = 0;
70  // amplitude for signal cell at diff. depths
71  double ampl1_c = 0.;
72  double ampl2_c = 0.;
73  double ampl3_c = 0.;
74  double ampl4_c = 0.;
75  double ampl_c = 0.;
76 
77  // is set to 1 if "seed" SimHit is found
78  int seedSimHit = 0;
79 
80  // std::cout << " HcalDigiTester::reco : "
81  // << "subdet=" << subdet << " noise="<< noise_ << std::endl;
82 
83  int ieta_Sim = 9999;
84  int iphi_Sim = 9999;
85  double emax_Sim = -9999.;
86 
87 
88  // SimHits MC only
89  if( mc_ == "yes") {
91  iEvent.getByLabel("g4SimHits","HcalHits",hcalHits);
92  const edm::PCaloHitContainer * simhitResult = hcalHits.product () ;
93 
94 
95  if ( subdet != 0 && noise_ == 0) { // signal only SimHits
96 
97  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin (); simhits != simhitResult->end () ; ++simhits) {
98 
99  HcalDetId cell(simhits->id());
100  double en = simhits->energy();
101  int sub = cell.subdet();
102  int ieta = cell.ieta();
103  if(ieta > 0) ieta--;
104  int iphi = cell.iphi()-1;
105 
106 
107  if(en > emax_Sim && sub == subdet) {
108  emax_Sim = en;
109  ieta_Sim = ieta;
110  iphi_Sim = iphi;
111  // to limit "seed" SimHit energy in case of "multi" event
112  if (mode_ == "multi" &&
113  ((sub == 4 && en < 100. && en > 1.)
114  || ((sub !=4) && en < 1. && en > 0.02)))
115  {
116  seedSimHit = 1;
117  break;
118  }
119  }
120 
121  } // end of SimHits cycle
122 
123 
124  // found highest-energy SimHit for single-particle
125  if(mode_ != "multi" && emax_Sim > 0.) seedSimHit = 1;
126  } // end of SimHits
127 
128  } // end of mc_ == "yes"
129 
130  // CYCLE OVER CELLS ========================================================
131  int Ndig = 0;
132 
133  /*
134  std::cout << " HcalDigiTester::reco : nevent 1,2,3,4 = "
135  << nevent1 << " " << nevent2 << " " << nevent3 << " "
136  << nevent4 << std::endl;
137  */
138 
139  for (digiItr=digiCollection->begin();digiItr!=digiCollection->end();digiItr++) {
140 
141  HcalDetId cell(digiItr->id());
142  int depth = cell.depth();
143  int iphi = cell.iphi()-1;
144  int ieta = cell.ieta();
145  if(ieta > 0) ieta--;
146  int sub = cell.subdet();
147 
148 
149  // amplitude for signal cell at diff. depths
150  double ampl = 0.;
151  double ampl1 = 0.;
152  double ampl2 = 0.;
153  double ampl3 = 0.;
154  double ampl4 = 0.;
155 
156  // Gains, pedestals (once !) and only for "noise" case
157  if ( ((nevent1 == 1 && subdet == 1) ||
158  (nevent2 == 1 && subdet == 2) ||
159  (nevent3 == 1 && subdet == 3) ||
160  (nevent4 == 1 && subdet == 4)) && noise_ == 1 && sub == subdet) {
161 
162  HcalGenericDetId hcalGenDetId(digiItr->id());
163  const HcalPedestal* pedestal = conditions->getPedestal(hcalGenDetId);
164  const HcalGain* gain = conditions->getGain(hcalGenDetId);
165  const HcalGainWidth* gainWidth =
166  conditions->getGainWidth(hcalGenDetId);
167  const HcalPedestalWidth* pedWidth =
168  conditions-> getPedestalWidth(hcalGenDetId);
169 
170  double gainValue0 = gain->getValue(0);
171  double gainValue1 = gain->getValue(1);
172  double gainValue2 = gain->getValue(2);
173  double gainValue3 = gain->getValue(3);
174 
175  double gainWidthValue0 = gainWidth->getValue(0);
176  double gainWidthValue1 = gainWidth->getValue(1);
177  double gainWidthValue2 = gainWidth->getValue(2);
178  double gainWidthValue3 = gainWidth->getValue(3);
179 
180 
181 
182  // some printout
183  /*
184  std::cout << " subdet = " << sub << " ieta, iphi, depth : "
185  << ieta << " " << iphi << " " << depth
186  << " gain0 " << gainValue0 << " gainWidth0 "
187  << gainWidthValue0
188  << std::endl;
189  */
190 
191  double pedValue0 = pedestal->getValue(0);
192  double pedValue1 = pedestal->getValue(1);
193  double pedValue2 = pedestal->getValue(2);
194  double pedValue3 = pedestal->getValue(3);
195 
196  double pedWidth0 = pedWidth->getWidth(0);
197  double pedWidth1 = pedWidth->getWidth(1);
198  double pedWidth2 = pedWidth->getWidth(2);
199  double pedWidth3 = pedWidth->getWidth(3);
200 
201  if (depth == 1) {
202 
203  // std::cout << " depth = " << depth << std::endl;
204 
205  monitor()->fillmeGain0Depth1(gainValue0);
206  monitor()->fillmeGain1Depth1(gainValue1);
207  monitor()->fillmeGain2Depth1(gainValue2);
208  monitor()->fillmeGain3Depth1(gainValue3);
209 
210  monitor()->fillmeGainWidth0Depth1(gainWidthValue0);
211  monitor()->fillmeGainWidth1Depth1(gainWidthValue1);
212  monitor()->fillmeGainWidth2Depth1(gainWidthValue2);
213  monitor()->fillmeGainWidth3Depth1(gainWidthValue3);
214 
215  monitor()->fillmePed0Depth1(pedValue0);
216  monitor()->fillmePed1Depth1(pedValue1);
217  monitor()->fillmePed2Depth1(pedValue2);
218  monitor()->fillmePed3Depth1(pedValue3);
219 
220  monitor()->fillmePedWidth0Depth1(pedWidth0);
221  monitor()->fillmePedWidth1Depth1(pedWidth1);
222  monitor()->fillmePedWidth2Depth1(pedWidth2);
223  monitor()->fillmePedWidth3Depth1(pedWidth3);
224 
225  monitor()->fillmeGainMap1 (double(ieta), double(iphi), gainValue0);
226  monitor()->fillmePwidthMap1(double(ieta), double(iphi), pedWidth0) ;
227  }
228 
229  if (depth == 2) {
230 
231  // std::cout << " depth = " << depth << std::endl;
232 
233  monitor()->fillmeGain0Depth2(gainValue0);
234  monitor()->fillmeGain1Depth2(gainValue1);
235  monitor()->fillmeGain2Depth2(gainValue2);
236  monitor()->fillmeGain3Depth2(gainValue3);
237 
238  monitor()->fillmeGainWidth0Depth2(gainWidthValue0);
239  monitor()->fillmeGainWidth1Depth2(gainWidthValue1);
240  monitor()->fillmeGainWidth2Depth2(gainWidthValue2);
241  monitor()->fillmeGainWidth3Depth2(gainWidthValue3);
242 
243  monitor()->fillmePed0Depth2(pedValue0);
244  monitor()->fillmePed1Depth2(pedValue1);
245  monitor()->fillmePed2Depth2(pedValue2);
246  monitor()->fillmePed3Depth2(pedValue3);
247 
248  monitor()->fillmePedWidth0Depth2(pedWidth0);
249  monitor()->fillmePedWidth1Depth2(pedWidth1);
250  monitor()->fillmePedWidth2Depth2(pedWidth2);
251  monitor()->fillmePedWidth3Depth2(pedWidth3);
252 
253  monitor()->fillmeGainMap2 (double(ieta), double(iphi), gainValue0);
254  monitor()->fillmePwidthMap2(double(ieta), double(iphi), pedWidth0) ;
255  }
256 
257  if (depth == 3) {
258 
259  // std::cout << " depth = " << depth << std::endl;
260 
261  monitor()->fillmeGain0Depth3(gainValue0);
262  monitor()->fillmeGain1Depth3(gainValue1);
263  monitor()->fillmeGain2Depth3(gainValue2);
264  monitor()->fillmeGain3Depth3(gainValue3);
265 
266  monitor()->fillmeGainWidth0Depth3(gainWidthValue0);
267  monitor()->fillmeGainWidth1Depth3(gainWidthValue1);
268  monitor()->fillmeGainWidth2Depth3(gainWidthValue2);
269  monitor()->fillmeGainWidth3Depth3(gainWidthValue3);
270 
271  monitor()->fillmePed0Depth3(pedValue0);
272  monitor()->fillmePed1Depth3(pedValue1);
273  monitor()->fillmePed2Depth3(pedValue2);
274  monitor()->fillmePed3Depth3(pedValue3);
275 
276  monitor()->fillmePedWidth0Depth3(pedWidth0);
277  monitor()->fillmePedWidth1Depth3(pedWidth1);
278  monitor()->fillmePedWidth2Depth3(pedWidth2);
279  monitor()->fillmePedWidth3Depth3(pedWidth3);
280 
281  monitor()->fillmeGainMap3 (double(ieta), double(iphi), gainValue0);
282  monitor()->fillmePwidthMap3(double(ieta), double(iphi), pedWidth0) ;
283  }
284 
285  if (depth == 4) {
286 
287  // std::cout << " depth = " << depth << std::endl;
288 
289  monitor()->fillmeGain0Depth4(gainValue0);
290  monitor()->fillmeGain1Depth4(gainValue1);
291  monitor()->fillmeGain2Depth4(gainValue2);
292  monitor()->fillmeGain3Depth4(gainValue3);
293 
294  monitor()->fillmeGainWidth0Depth4(gainWidthValue0);
295  monitor()->fillmeGainWidth1Depth4(gainWidthValue1);
296  monitor()->fillmeGainWidth2Depth4(gainWidthValue2);
297  monitor()->fillmeGainWidth3Depth4(gainWidthValue3);
298 
299  monitor()->fillmePed0Depth4(pedValue0);
300  monitor()->fillmePed1Depth4(pedValue1);
301  monitor()->fillmePed2Depth4(pedValue2);
302  monitor()->fillmePed3Depth4(pedValue3);
303 
304  monitor()->fillmePedWidth0Depth4(pedWidth0);
305  monitor()->fillmePedWidth1Depth4(pedWidth1);
306  monitor()->fillmePedWidth2Depth4(pedWidth2);
307  monitor()->fillmePedWidth3Depth4(pedWidth3);
308 
309  monitor()->fillmeGainMap4 (double(ieta), double(iphi), gainValue0);
310  monitor()->fillmePwidthMap4(double(ieta), double(iphi), pedWidth0) ;
311 
312  }
313 
314  } // end of event #1
315  //std::cout << "==== End of event noise block in cell cycle" << std::endl;
316 
317 
318 
319  if ( sub == subdet) Ndig++; // subdet number of digi
320 
321 // No-noise case, only single subdet selected ===========================
322 
323  if ( sub == subdet && noise_ == 0 ) {
324 
325 
326  HcalCalibrations calibrations = conditions->getHcalCalibrations(cell);
327 
328  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
329  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
330  HcalCoderDb coder (*channelCoder, *shape);
331  coder.adc2fC(*digiItr,tool);
332 
333  double noiseADC = (*digiItr)[0].adc();
334  double noisefC = tool[0];
335 
336  // noise evaluations from "pre-samples"
337  if(depth == 1) {
338  monitor()->fillmeADC0_depth1 (noiseADC);
339  monitor()->fillmeADC0fC_depth1(noisefC);
340  }
341  if(depth == 2) {
342  monitor()->fillmeADC0_depth2 (noiseADC);
343  monitor()->fillmeADC0fC_depth2(noisefC);
344  }
345  if(depth == 3) {
346  monitor()->fillmeADC0_depth3 (noiseADC);
347  monitor()->fillmeADC0fC_depth3(noisefC);
348  }
349  if(depth == 4) {
350  monitor()->fillmeADC0_depth4 (noiseADC);
351  monitor()->fillmeADC0fC_depth4(noisefC);
352  }
353 
354  // OCCUPANCY maps filling
355  double deta = double(ieta);
356  double dphi = double(iphi);
357  if(depth == 1)
358  monitor()->fillmeOccupancy_map_depth1(deta, dphi);
359  if(depth == 2)
360  monitor()->fillmeOccupancy_map_depth2(deta, dphi);
361  if(depth == 3)
362  monitor()->fillmeOccupancy_map_depth3(deta, dphi);
363  if(depth == 4)
364  monitor()->fillmeOccupancy_map_depth4(deta, dphi);
365 
366  // Cycle on time slices
367  // - for each Digi
368  // - for one Digi with max SimHits E in subdet
369 
370  int closen = 0; // =1 if 1) seedSimHit = 1 and 2) the cell is the same
371  if(ieta == ieta_Sim && iphi == iphi_Sim ) closen = seedSimHit;
372 
373  for (int ii=0;ii<tool.size();ii++) {
374  int capid = (*digiItr)[ii].capid();
375  // single ts amplitude
376  double val = (tool[ii]-calibrations.pedestal(capid));
377 
378  if (val > 10.) {
379  if (depth == 1)
380  monitor()->fillmeAll10slices_depth1(double(ii), val);
381  else
382  monitor()->fillmeAll10slices_depth2(double(ii), val);
383  }
384  if (val > 100.) {
385  if (depth == 1)
386  monitor()->fillmeAll10slices1D_depth1(double(ii), val);
387  else
388  monitor()->fillmeAll10slices1D_depth2(double(ii), val);
389  }
390 
391  if( closen == 1 &&( ieta * zsign >= 0 )) {
392  monitor()->fillmeSignalTimeSlice(double(ii), val);
393  }
394 
395 
396  // HB/HE/HO
397  if (subdet != 4 && ii>=4 && ii<=7) {
398  ampl += val;
399  if(depth == 1) ampl1 += val;
400  if(depth == 2) ampl2 += val;
401  if(depth == 3) ampl3 += val;
402  if(depth == 4) ampl4 += val;
403 
404  if( closen == 1 && ( ieta * zsign >= 0 )) {
405  ampl_c += val;
406  if(depth == 1) ampl1_c += val;
407  if(depth == 2) ampl2_c += val;
408  if(depth == 3) ampl3_c += val;
409  if(depth == 4) ampl4_c += val;
410 
411  }
412  }
413 
414  // HF
415  if (subdet == 4 && ii==3 ) {
416  ampl += val;
417  if(depth == 1) ampl1 += val;
418  if(depth == 2) ampl2 += val;
419  if(depth == 3) ampl3 += val;
420  if(depth == 4) ampl4 += val;
421  if( closen == 1 && ( ieta * zsign >= 0 )) {
422  ampl_c += val;
423  if(depth == 1) ampl1_c += val;
424  if(depth == 2) ampl2_c += val;
425  if(depth == 3) ampl3_c += val;
426  if(depth == 4) ampl4_c += val;
427 
428  }
429  }
430  }
431  // end of time bucket sample
432 
433  monitor()->fillmeAmplIetaIphi1(double(ieta),double(iphi), ampl1);
434  monitor()->fillmeAmplIetaIphi2(double(ieta),double(iphi), ampl2);
435  monitor()->fillmeAmplIetaIphi3(double(ieta),double(iphi), ampl3);
436  monitor()->fillmeAmplIetaIphi4(double(ieta),double(iphi), ampl4);
437  monitor()->fillmeSumAmp (ampl);
438 
439 
440  if(ampl1 > 10. || ampl2 > 10. || ampl3 > 10. || ampl4 > 10. ) ndigis++;
441 
442  // fraction 5,6 bins if ampl. is big.
443  if(ampl1 > 30. && depth == 1 && closen == 1 ) {
444  double fBin5 = tool[4] - calibrations.pedestal((*digiItr)[4].capid());
445  double fBin67 = tool[5] + tool[6]
446  - calibrations.pedestal((*digiItr)[5].capid())
447  - calibrations.pedestal((*digiItr)[6].capid());
448  fBin5 /= ampl1;
449  fBin67 /= ampl1;
450  monitor()->fillmeBin5Frac (fBin5);
451  monitor()->fillmeBin67Frac(fBin67);
452  }
453 
454  monitor()->fillmeSignalAmp (ampl);
455  monitor()->fillmeSignalAmp1(ampl1);
456  monitor()->fillmeSignalAmp2(ampl2);
457  monitor()->fillmeSignalAmp3(ampl3);
458  monitor()->fillmeSignalAmp4(ampl4);
459 
460 
461  }
462  } // End of CYCLE OVER CELLS =============================================
463 
464 
465  if ( subdet != 0 && noise_ == 0) { // signal only, once per event
466 
467  monitor()->fillmenDigis(ndigis);
468 
469  // SimHits once again !!!
470  double eps = 1.e-3;
471  double ehits = 0.;
472  double ehits1 = 0.;
473  double ehits2 = 0.;
474  double ehits3 = 0.;
475  double ehits4 = 0.;
476 
477  if(mc_ == "yes") {
479  iEvent.getByLabel("g4SimHits","HcalHits",hcalHits);
480  const edm::PCaloHitContainer * simhitResult = hcalHits.product () ;
481  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin (); simhits != simhitResult->end () ; ++simhits) {
482 
483  HcalDetId cell(simhits->id());
484  int ieta = cell.ieta();
485  if(ieta > 0) ieta--;
486  int iphi = cell.iphi()-1;
487  int sub = cell.subdet();
488 
489  // take cell already found to be max energy in a particular subdet
490  if (sub == subdet && ieta == ieta_Sim && iphi == iphi_Sim){
491  int depth = cell.depth();
492  double en = simhits->energy();
493 
494  ehits += en;
495  if(depth == 1) ehits1 += en;
496  if(depth == 2) ehits2 += en;
497  if(depth == 3) ehits3 += en;
498  if(depth == 4) ehits4 += en;
499  }
500  }
501 
502  if(ehits > eps) monitor()->fillmeDigiSimhit (ehits, ampl_c );
503  if(ehits1 > eps) monitor()->fillmeDigiSimhit1(ehits1, ampl1_c);
504  if(ehits2 > eps) monitor()->fillmeDigiSimhit2(ehits2, ampl2_c);
505  if(ehits3 > eps) monitor()->fillmeDigiSimhit3(ehits3, ampl3_c);
506  if(ehits4 > eps) monitor()->fillmeDigiSimhit4(ehits4, ampl4_c);
507 
508  if(ehits > eps) monitor()->fillmeDigiSimhitProfile (ehits, ampl_c );
509  if(ehits1 > eps) monitor()->fillmeDigiSimhitProfile1(ehits1, ampl1_c);
510  if(ehits2 > eps) monitor()->fillmeDigiSimhitProfile2(ehits2, ampl2_c);
511  if(ehits3 > eps) monitor()->fillmeDigiSimhitProfile3(ehits3, ampl3_c);
512  if(ehits4 > eps) monitor()->fillmeDigiSimhitProfile4(ehits4, ampl4_c);
513 
514  if(ehits > eps) monitor()->fillmeRatioDigiSimhit (ampl_c / ehits);
515  if(ehits1 > eps) monitor()->fillmeRatioDigiSimhit1(ampl1_c / ehits1);
516  if(ehits2 > eps) monitor()->fillmeRatioDigiSimhit2(ampl2_c / ehits2);
517  if(ehits3 > eps) monitor()->fillmeRatioDigiSimhit3(ampl3_c / ehits3);
518  if(ehits4 > eps) monitor()->fillmeRatioDigiSimhit4(ampl4_c / ehits4);
519  } // end of if(mc_ == "yes")
520 
521  monitor()->fillmeNdigis(double(Ndig));
522 
523  } // end of if( subdet != 0 && noise_ == 0) { // signal only
524 
525 }
526 
527 
529  : dbe_(edm::Service<DQMStore>().operator->()),
530  inputTag_(iConfig.getParameter<edm::InputTag>("digiLabel")),
531  outputFile_(iConfig.getUntrackedParameter<std::string>("outputFile", "")),
532  hcalselector_(iConfig.getUntrackedParameter<std::string>("hcalselector", "all")),
533  zside_(iConfig.getUntrackedParameter<std::string>("zside", "*")),
534  mode_(iConfig.getUntrackedParameter<std::string>("mode", "multi")),
535  mc_(iConfig.getUntrackedParameter<std::string>("mc", "no")),
536  monitors_()
537 {
538  if ( outputFile_.size() != 0 ) {
539  edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will be saved to '" << outputFile_.c_str() << "'";
540  } else {
541  edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will NOT be saved";
542  }
543 
544 
545 }
546 
547 
549 
550 
552 
553  if(noise_ != 1) {
554 
555  if( hcalselector_ == "all") {
556  hcalselector_ = "HB";
557  eval_occupancy();
558  hcalselector_ = "HE";
559  eval_occupancy();
560  hcalselector_ = "HO";
561  eval_occupancy();
562  hcalselector_ = "HF";
563  eval_occupancy();
564  }
565  else // one of subsystem only
566  eval_occupancy();
567  }
568 
569 }
570 
571 
572 
574 
575  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
576 
577 }
578 
579 
580  //occupancies evaluation
582 
583  int nx = 82;
584  int ny = 72;
585  float cnorm;
586  float fev = float (nevtot);
587  // std::cout << "*** nevtot " << nevtot << std::endl;
588 
589  float sumphi_1, sumphi_2, sumphi_3, sumphi_4;
590  float phi_factor;
591 
592  for (int i = 1; i <= nx; i++) {
593  sumphi_1 = 0.;
594  sumphi_2 = 0.;
595  sumphi_3 = 0.;
596  sumphi_4 = 0.;
597 
598  for (int j = 1; j <= ny; j++) {
599 
600  // occupancies
601  cnorm = monitor()->getBinContent_depth1(i,j) / fev;
602  monitor()->setBinContent_depth1(i,j,cnorm);
603  cnorm = monitor()->getBinContent_depth2(i,j) / fev;
604  monitor()->setBinContent_depth2(i,j,cnorm);
605  cnorm = monitor()->getBinContent_depth3(i,j) / fev;
606  monitor()->setBinContent_depth3(i,j,cnorm);
607  cnorm = monitor()->getBinContent_depth4(i,j) / fev;
608  monitor()->setBinContent_depth4(i,j,cnorm);
609 
610  sumphi_1 += monitor()->getBinContent_depth1(i,j);
611  sumphi_2 += monitor()->getBinContent_depth2(i,j);
612  sumphi_3 += monitor()->getBinContent_depth3(i,j);
613  sumphi_4 += monitor()->getBinContent_depth4(i,j);
614 
615  }
616 
617  int ieta = i - 42; // -41 -1, 0 40
618  if(ieta >=0 ) ieta +=1; // -41 -1, 1 41 - to make it detector-like
619 
620  if(ieta >= -20 && ieta <= 20 )
621  {phi_factor = 72.;}
622  else {
623  if(ieta >= 40 || ieta <= -40 ) {phi_factor = 18.;}
624  else
625  phi_factor = 36.;
626  }
627 
628 
629  if(ieta >= 0) ieta -= 1; // -41 -1, 0 40 - to bring back to histo num !!!
630  double deta = double(ieta);
631 
632  cnorm = sumphi_1 / phi_factor;
633  monitor() -> fillmeOccupancy_vs_ieta_depth1(deta, cnorm);
634  cnorm = sumphi_2 / phi_factor;
635  monitor() -> fillmeOccupancy_vs_ieta_depth2(deta, cnorm);
636  cnorm = sumphi_3 / phi_factor;
637  monitor() -> fillmeOccupancy_vs_ieta_depth3(deta, cnorm);
638  cnorm = sumphi_4 / phi_factor;
639  monitor() -> fillmeOccupancy_vs_ieta_depth4(deta, cnorm);
640 
641 
642  } // end of i-loop
643 
644 }
645 
647 
648  nevent1 = 0;
649  nevent2 = 0;
650  nevent3 = 0;
651  nevent4 = 0;
652 
653  nevtot = 0;
654 
655 }
656 
657 
659 {
660  std::map<std::string, HcalSubdetDigiMonitor*>::iterator monitorItr
661  = monitors_.find(hcalselector_);
662 
663  if(monitorItr == monitors_.end())
664  {
666  std::pair<std::string, HcalSubdetDigiMonitor*> mapElement(
667  hcalselector_, m);
668  monitorItr = monitors_.insert(mapElement).first;
669  }
670  return monitorItr->second;
671 }
672 
673 void
675 {
676 
677 
678  iSetup.get<CaloGeometryRecord>().get (geometry);
679  iSetup.get<HcalDbRecord>().get(conditions);
680 
681 
682  // std::cout << " >>>>> HcalDigiTester::analyze hcalselector = "
683  // << hcalselector_ << std::endl;
684 
685  if( hcalselector_ != "all") {
686  noise_ = 0;
687 
688 
689 
690  if (hcalselector_ == "HB" ) reco<HBHEDataFrame>(iEvent,iSetup);
691  if (hcalselector_ == "HE" ) reco<HBHEDataFrame>(iEvent,iSetup);
692  if (hcalselector_ == "HO" ) reco<HODataFrame>(iEvent,iSetup);
693  if (hcalselector_ == "HF" ) reco<HFDataFrame>(iEvent,iSetup);
694 
695  if (hcalselector_ == "noise") {
696  noise_ = 1;
697 
698  // std::cout << " >>>>> HcalDigiTester::analyze entering noise "
699  // << std::endl;
700 
701 
702  hcalselector_ = "HB";
703  reco<HBHEDataFrame>(iEvent,iSetup);
704  hcalselector_ = "HE";
705  reco<HBHEDataFrame>(iEvent,iSetup);
706  hcalselector_ = "HO";
707  reco<HODataFrame>(iEvent,iSetup);
708  hcalselector_ = "HF";
709  reco<HFDataFrame>(iEvent,iSetup);
710  hcalselector_ = "noise";
711  }
712  }
713  // all subdetectors
714  else {
715  noise_ = 0;
716 
717  hcalselector_ = "HB";
718  reco<HBHEDataFrame>(iEvent,iSetup);
719  hcalselector_ = "HE";
720  reco<HBHEDataFrame>(iEvent,iSetup);
721  hcalselector_ = "HO";
722  reco<HODataFrame>(iEvent,iSetup);
723  hcalselector_ = "HF";
724  reco<HFDataFrame>(iEvent,iSetup);
725  hcalselector_ = "all";
726  }
727 
728  nevtot++;
729 
730 }
731 
732 double HcalDigiTester::dR(double eta1, double phi1, double eta2, double phi2) {
733  double PI = 3.1415926535898;
734  double deltaphi= phi1 - phi2;
735  if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
736  if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
737  double deltaeta = eta2 - eta1;
738  double tmp = sqrt(deltaeta* deltaeta + deltaphi*deltaphi);
739  return tmp;
740 }
741 
742 
void fillmePed0Depth1(double v1)
void fillmeGain0Depth4(double v1)
void fillmeGainWidth0Depth2(double v1)
void setBinContent_depth2(int i, int j, double v)
void fillmePedWidth2Depth1(double v1)
void fillmeGain2Depth2(double v1)
void fillmeGain1Depth1(double v1)
void fillmePedWidth1Depth3(double v1)
void fillmeGainWidth2Depth1(double v1)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int i
Definition: DBlmapReader.cc:9
void fillmeAmplIetaIphi4(double v1, double v2, double v3)
void fillmeADC0_depth1(double v1)
void fillmeDigiSimhitProfile3(double v1, double v2)
std::vector< PCaloHit > PCaloHitContainer
void fillmeGainWidth0Depth4(double v1)
HcalSubdetDigiMonitor * monitor()
void fillmePed2Depth4(double v1)
void fillmePedWidth1Depth1(double v1)
void fillmeGainWidth2Depth4(double v1)
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
void fillmeGainMap2(double v1, double v2, double v3)
void fillmePwidthMap3(double v1, double v2, double v3)
void fillmeDigiSimhit4(double v1, double v2)
void fillmePed1Depth4(double v1)
edm::ESHandle< CaloGeometry > geometry
std::string hcalselector_
#define PI
void fillmeOccupancy_map_depth2(double v1, double v2)
void fillmeGainWidth3Depth4(double v1)
void fillmeGain2Depth4(double v1)
void fillmeDigiSimhit3(double v1, double v2)
double getBinContent_depth4(int i, int j)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void fillmeADC0fC_depth2(double v1)
void fillmeGainWidth1Depth1(double v1)
void fillmeRatioDigiSimhit4(double v1)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
void fillmeDigiSimhit2(double v1, double v2)
void fillmeRatioDigiSimhit(double v1)
void fillmePedWidth1Depth4(double v1)
std::vector< T >::const_iterator const_iterator
void fillmeGainWidth1Depth4(double v1)
void setBinContent_depth3(int i, int j, double v)
void fillmeAll10slices1D_depth1(double v1, double v2)
void fillmeGain3Depth2(double v1)
std::string mode_
void fillmePed1Depth2(double v1)
void fillmeAll10slices_depth2(double v1, double v2)
double pedestal(int fCapId) const
get pedestal for capid=0..3
void fillmeRatioDigiSimhit2(double v1)
std::string mc_
void fillmeAmplIetaIphi2(double v1, double v2, double v3)
void fillmePwidthMap1(double v1, double v2, double v3)
HcalDigiTester(const edm::ParameterSet &)
std::map< std::string, HcalSubdetDigiMonitor * > monitors_
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGain.h:20
int ii
Definition: cuy.py:588
void fillmeGainWidth1Depth2(double v1)
double getBinContent_depth2(int i, int j)
void fillmeGainWidth2Depth2(double v1)
edm::ESHandle< HcalDbService > conditions
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGainWidth.h:19
double dR(double eta1, double phi1, double eta2, double phi2)
void fillmeGainWidth3Depth2(double v1)
virtual void endJob()
void fillmeSignalAmp4(double v1)
void fillmeAll10slices1D_depth2(double v1, double v2)
void fillmeDigiSimhitProfile2(double v1, double v2)
void fillmePed0Depth4(double v1)
virtual void endRun()
int depth() const
get the tower depth
Definition: HcalDetId.h:42
void fillmeGain3Depth3(double v1)
void fillmePed0Depth3(double v1)
void fillmeGainMap4(double v1, double v2, double v3)
int iEvent
Definition: GenABIO.cc:243
void fillmePed3Depth3(double v1)
void fillmeDigiSimhit(double v1, double v2)
void fillmeRatioDigiSimhit1(double v1)
void fillmeOccupancy_map_depth1(double v1, double v2)
void fillmeGain1Depth2(double v1)
void fillmeGain1Depth3(double v1)
void fillmeGainWidth0Depth1(double v1)
void fillmeGainWidth2Depth3(double v1)
void fillmeSignalAmp1(double v1)
edm::InputTag inputTag_
void fillmeGain3Depth4(double v1)
double getBinContent_depth1(int i, int j)
void fillmeADC0_depth2(double v1)
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
Definition: HcalCoderDb.cc:46
T sqrt(T t)
Definition: SSEVec.h:48
void fillmeGain3Depth1(double v1)
void fillmeDigiSimhitProfile4(double v1, double v2)
void fillmeAmplIetaIphi3(double v1, double v2, double v3)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
void fillmeADC0_depth4(double v1)
void fillmePedWidth2Depth2(double v1)
void fillmeGainMap1(double v1, double v2, double v3)
void fillmeGainWidth0Depth3(double v1)
int j
Definition: DBlmapReader.cc:9
void fillmePedWidth2Depth4(double v1)
void fillmePedWidth1Depth2(double v1)
void fillmePedWidth2Depth3(double v1)
void fillmeSignalTimeSlice(double v1, double v2)
void fillmePedWidth0Depth1(double v1)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
virtual void beginJob()
DQMStore * dbe_
void fillmePedWidth3Depth2(double v1)
void setBinContent_depth4(int i, int j, double v)
void reco(const edm::Event &, const edm::EventSetup &)
void fillmePedWidth3Depth4(double v1)
void fillmeADC0fC_depth4(double v1)
void setBinContent_depth1(int i, int j, double v)
void fillmeSignalAmp(double v1)
std::string zside_
void fillmeGainMap3(double v1, double v2, double v3)
void fillmePedWidth3Depth1(double v1)
int size() const
get the size
Definition: CaloSamples.h:26
void fillmeDigiSimhitProfile(double v1, double v2)
double getBinContent_depth3(int i, int j)
const T & get() const
Definition: EventSetup.h:55
void fillmePed3Depth2(double v1)
void fillmeGain2Depth1(double v1)
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
void fillmeOccupancy_map_depth4(double v1, double v2)
void fillmePed2Depth2(double v1)
void fillmePed3Depth4(double v1)
T const * product() const
Definition: Handle.h:74
void fillmePedWidth0Depth4(double v1)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void fillmeSignalAmp3(double v1)
void fillmePed0Depth2(double v1)
void fillmePwidthMap4(double v1, double v2, double v3)
void fillmeDigiSimhit1(double v1, double v2)
void fillmeADC0fC_depth1(double v1)
void fillmeGain0Depth2(double v1)
void fillmeADC0_depth3(double v1)
void fillmePed2Depth3(double v1)
void fillmeGainWidth3Depth1(double v1)
void fillmePed2Depth1(double v1)
void fillmeRatioDigiSimhit3(double v1)
void fillmeGain2Depth3(double v1)
void fillmePedWidth3Depth3(double v1)
void fillmeGain0Depth1(double v1)
void fillmeDigiSimhitProfile1(double v1, double v2)
void fillmeOccupancy_map_depth3(double v1, double v2)
void fillmePed1Depth1(double v1)
DQMStore * dbe_
void fillmePedWidth0Depth2(double v1)
void fillmeSignalAmp2(double v1)
void fillmeGainWidth1Depth3(double v1)
void fillmePwidthMap2(double v1, double v2, double v3)
void fillmePedWidth0Depth3(double v1)
void fillmeAll10slices_depth1(double v1, double v2)
std::string outputFile_
void fillmeADC0fC_depth3(double v1)
void fillmeGain1Depth4(double v1)
void fillmeAmplIetaIphi1(double v1, double v2, double v3)
void fillmePed3Depth1(double v1)
void fillmePed1Depth3(double v1)
void fillmeGain0Depth3(double v1)
void fillmeGainWidth3Depth3(double v1)