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