42 if (iConfig.
exists(
"simHits"))
65 msm_ =
new std::map<std::string, MonitorElement*>();
68 else edm::LogInfo(
"OutputInfo") <<
" Hcal Digi Task histograms will NOT be saved";
118 book1D(ib,
"nevtot", 1, 0, 1);
121 if (
subdet_ ==
"noise") bnoise = 1;
122 if (
mc_ ==
"yes") bmc = 1;
134 HistLim tp_hl_et(260, -10, 250);
135 HistLim tp_hl_ntp(640, -20, 3180);
136 HistLim tp_hl_ntp_sub(404, -20, 2000);
137 HistLim tp_hl_ieta(85, -42.5, 42.5);
138 HistLim tp_hl_iphi(72,-0.5,71.5);
141 book1D(ib,
"HcalDigiTask_tp_et", tp_hl_et);
142 book1D(ib,
"HcalDigiTask_tp_et_v0", tp_hl_et);
143 book1D(ib,
"HcalDigiTask_tp_et_v1", tp_hl_et);
144 book1D(ib,
"HcalDigiTask_tp_et_HB", tp_hl_et);
145 book1D(ib,
"HcalDigiTask_tp_et_HE", tp_hl_et);
146 book1D(ib,
"HcalDigiTask_tp_et_HF", tp_hl_et);
147 book1D(ib,
"HcalDigiTask_tp_et_HF_v0", tp_hl_et);
148 book1D(ib,
"HcalDigiTask_tp_et_HF_v1", tp_hl_et);
149 book1D(ib,
"HcalDigiTask_tp_ntp", tp_hl_ntp);
150 book1D(ib,
"HcalDigiTask_tp_ntp_v0", tp_hl_ntp);
151 book1D(ib,
"HcalDigiTask_tp_ntp_v1", tp_hl_ntp);
152 book1D(ib,
"HcalDigiTask_tp_ntp_HB", tp_hl_ntp_sub);
153 book1D(ib,
"HcalDigiTask_tp_ntp_HE", tp_hl_ntp_sub);
154 book1D(ib,
"HcalDigiTask_tp_ntp_HF", tp_hl_ntp_sub);
155 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v0", tp_hl_ntp_sub);
156 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v1", tp_hl_ntp_sub);
157 book1D(ib,
"HcalDigiTask_tp_ntp_ieta", tp_hl_ieta);
158 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v0", tp_hl_ieta);
159 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v1", tp_hl_ieta);
160 book1D(ib,
"HcalDigiTask_tp_ntp_iphi", tp_hl_iphi);
161 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v0", tp_hl_iphi);
162 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v1", tp_hl_iphi);
163 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta", tp_hl_ieta);
164 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v0", tp_hl_ieta);
165 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v1", tp_hl_ieta);
166 book2D(ib,
"HcalDigiTask_tp_et_ieta", tp_hl_ieta, tp_hl_et);
167 book2D(ib,
"HcalDigiTask_tp_et_ieta_v0", tp_hl_ieta, tp_hl_et);
168 book2D(ib,
"HcalDigiTask_tp_et_ieta_v1", tp_hl_ieta, tp_hl_et);
169 book2D(ib,
"HcalDigiTask_tp_ieta_iphi", tp_hl_ieta, tp_hl_iphi);
170 book2D(ib,
"HcalDigiTask_tp_ieta_iphi_v0", tp_hl_ieta, tp_hl_iphi);
171 book2D(ib,
"HcalDigiTask_tp_ieta_iphi_v1", tp_hl_ieta, tp_hl_iphi);
172 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta", tp_hl_ieta, tp_hl_et,
" ");
173 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta_v0", tp_hl_ieta, tp_hl_et,
" ");
174 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta_v1", tp_hl_ieta, tp_hl_et,
" ");
182 HistLim Ndigis(2600, 0., 2600.);
183 HistLim ndigis(520, -20., 1020.);
186 HistLim digiAmp(360, -100., 7100.);
187 HistLim ratio(2000, -100., 3900.);
188 HistLim sumAmp(100, -500., 1500.);
193 HistLim pedestalfC(400, -10., 30.);
198 HistLim pedWidthLim(100, 0., 2.);
201 HistLim gainWidthLim(160, 0., 0.32);
203 HistLim ietaLim(85, -42.5, 42.5);
204 HistLim iphiLim(74, -0.5, 73.5);
206 HistLim depthLim(15,-0.5,14.5);
208 if (bsubdet ==
"HB") {
210 }
else if (bsubdet ==
"HE") {
213 }
else if (bsubdet ==
"HF") {
215 pedLim =
HistLim(100, 0., 20.);
216 pedWidthLim =
HistLim(100, 0., 5.);
217 frac =
HistLim(400, -4.00, 4.00);
219 }
else if (bsubdet ==
"HO") {
221 gainLim =
HistLim(160, 0., 1.6);
226 if (bsubdet==
"HB") isubdet=1;
227 else if (bsubdet==
"HE") isubdet=2;
228 else if (bsubdet==
"HO") isubdet=3;
229 else if (bsubdet==
"HF") isubdet=4;
230 else edm::LogWarning(
"HcalDigisValidation") <<
"HcalDigisValidation Warning: not HB/HE/HF/HO " << bsubdet << std::endl;
233 const char * sub = bsubdet.c_str();
236 sprintf(histo,
"HcalDigiTask_Ndigis_%s", sub);
237 book1D(ib, histo, Ndigis);
241 sprintf(histo,
"HcalDigiTask_ieta_iphi_occupancy_map_depth%d_%s",
depth, sub);
242 book2D(ib, histo, ietaLim, iphiLim);
246 sprintf(histo,
"HcalDigiTask_depths_%s",sub);
247 book1D(ib,histo, depthLim);
251 sprintf(histo,
"HcalDigiTask_occupancy_vs_ieta_depth%d_%s",
depth, sub);
252 book1D(ib, histo, ietaLim);
257 sprintf(histo,
"HcalDigiTask_sum_all_amplitudes_%s", sub);
258 book1D(ib, histo, sumAmp);
260 sprintf(histo,
"HcalDigiTask_number_of_amplitudes_above_10fC_%s", sub);
261 book1D(ib, histo, ndigis);
264 sprintf(histo,
"HcalDigiTask_ADC0_adc_depth%d_%s",
depth, sub);
265 book1D(ib, histo, pedestal);
269 sprintf(histo,
"HcalDigiTask_ADC0_fC_depth%d_%s",
depth, sub);
270 book1D(ib, histo, pedestalfC);
273 sprintf(histo,
"HcalDigiTask_signal_amplitude_%s", sub);
274 book1D(ib, histo, digiAmp);
277 sprintf(histo,
"HcalDigiTask_signal_amplitude_depth%d_%s",
depth, sub);
278 book1D(ib, histo, digiAmp);
281 sprintf(histo,
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_%s", sub);
282 book2D(ib, histo, nbin, digiAmp);
285 sprintf(histo,
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth%d_%s",
depth, sub);
289 sprintf(histo,
"HcalDigiTask_bin_5_frac_%s", sub);
291 sprintf(histo,
"HcalDigiTask_bin_6_7_frac_%s", sub);
295 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_%s", sub);
296 book2D(ib, histo, sime, digiAmp);
298 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_depth%d_%s",
depth, sub);
299 book2D(ib, histo, sime, digiAmp);
302 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_%s", sub);
303 bookPf(ib, histo, sime, digiAmp);
305 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_depth%d_%s",
depth, sub);
306 bookPf(ib, histo, sime, digiAmp);
309 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_%s", sub);
312 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_depth%d_%s",
depth, sub);
323 sprintf(histo,
"HcalDigiTask_gain_capId0_Depth%d_%s",
depth, sub);
324 book1D(ib, histo, gainLim);
325 sprintf(histo,
"HcalDigiTask_gain_capId1_Depth%d_%s",
depth, sub);
326 book1D(ib, histo, gainLim);
327 sprintf(histo,
"HcalDigiTask_gain_capId2_Depth%d_%s",
depth, sub);
328 book1D(ib, histo, gainLim);
329 sprintf(histo,
"HcalDigiTask_gain_capId3_Depth%d_%s",
depth, sub);
330 book1D(ib, histo, gainLim);
332 sprintf(histo,
"HcalDigiTask_gainWidth_capId0_Depth%d_%s",
depth, sub);
333 book1D(ib, histo, gainWidthLim);
334 sprintf(histo,
"HcalDigiTask_gainWidth_capId1_Depth%d_%s",
depth, sub);
335 book1D(ib, histo, gainWidthLim);
336 sprintf(histo,
"HcalDigiTask_gainWidth_capId2_Depth%d_%s",
depth, sub);
337 book1D(ib, histo, gainWidthLim);
338 sprintf(histo,
"HcalDigiTask_gainWidth_capId3_Depth%d_%s",
depth, sub);
339 book1D(ib, histo, gainWidthLim);
341 sprintf(histo,
"HcalDigiTask_pedestal_capId0_Depth%d_%s",
depth, sub);
342 book1D(ib, histo, pedLim);
343 sprintf(histo,
"HcalDigiTask_pedestal_capId1_Depth%d_%s",
depth, sub);
344 book1D(ib, histo, pedLim);
345 sprintf(histo,
"HcalDigiTask_pedestal_capId2_Depth%d_%s",
depth, sub);
346 book1D(ib, histo, pedLim);
347 sprintf(histo,
"HcalDigiTask_pedestal_capId3_Depth%d_%s",
depth, sub);
348 book1D(ib, histo, pedLim);
350 sprintf(histo,
"HcalDigiTask_pedestal_width_capId0_Depth%d_%s",
depth, sub);
351 book1D(ib, histo, pedWidthLim);
352 sprintf(histo,
"HcalDigiTask_pedestal_width_capId1_Depth%d_%s",
depth, sub);
353 book1D(ib, histo, pedWidthLim);
354 sprintf(histo,
"HcalDigiTask_pedestal_width_capId2_Depth%d_%s",
depth, sub);
355 book1D(ib, histo, pedWidthLim);
356 sprintf(histo,
"HcalDigiTask_pedestal_width_capId3_Depth%d_%s",
depth, sub);
357 book1D(ib, histo, pedWidthLim);
363 sprintf(histo,
"HcalDigiTask_gainMap_Depth%d_%s",
depth, sub);
364 book2D(ib, histo, ietaLim, iphiLim);
365 sprintf(histo,
"HcalDigiTask_pwidthMap_Depth%d_%s",
depth, sub);
366 book2D(ib, histo, ietaLim, iphiLim);
446 int c = 0, cv0 = 0, cv1 = 0, chb = 0, che = 0, chf = 0, chfv0 = 0, chfv1 = 0;
451 int ieta = itr->id().ieta();
452 int iphi = itr->id().iphi();
457 if (
abs(ieta) <= 16 )
459 else if (
abs(ieta) < tp_geometry->firstHFTower(itr->id().version()) )
461 else if (
abs(ieta) <= 42 )
468 float en = decoder->hcaletValue(itr->id(), itr->t0());
470 if (en < 0.00001)
continue;
477 fill1D(
"HcalDigiTask_tp_et",en);
478 fill2D(
"HcalDigiTask_tp_et_ieta",ieta,en);
479 fill2D(
"HcalDigiTask_tp_ieta_iphi",ieta,iphi);
480 fillPf(
"HcalDigiTask_tp_ave_et_ieta",ieta,en);
481 fill1D(
"HcalDigiTask_tp_ntp_ieta",ieta);
482 fill1D(
"HcalDigiTask_tp_ntp_iphi",iphi);
483 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta",ieta);
487 fill1D(
"HcalDigiTask_tp_et_v0",en);
488 fill2D(
"HcalDigiTask_tp_et_ieta_v0",ieta,en);
489 fill2D(
"HcalDigiTask_tp_ieta_iphi_v0",ieta,iphi);
490 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v0",ieta,en);
491 fill1D(
"HcalDigiTask_tp_ntp_ieta_v0",ieta);
492 fill1D(
"HcalDigiTask_tp_ntp_iphi_v0",iphi);
493 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v0",ieta);
498 fill1D(
"HcalDigiTask_tp_et_v1",en);
499 fill2D(
"HcalDigiTask_tp_et_ieta_v1",ieta,en);
500 fill2D(
"HcalDigiTask_tp_ieta_iphi_v1",ieta,iphi);
501 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v1",ieta,en);
502 fill1D(
"HcalDigiTask_tp_ntp_ieta_v1",ieta);
503 fill1D(
"HcalDigiTask_tp_ntp_iphi_v1",iphi);
504 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v1",ieta);
509 fill1D(
"HcalDigiTask_tp_et_HB",en);
515 fill1D(
"HcalDigiTask_tp_et_HE",en);
521 fill1D(
"HcalDigiTask_tp_et_HF",en);
525 fill1D(
"HcalDigiTask_tp_et_HF_v0",en);
531 fill1D(
"HcalDigiTask_tp_et_HF_v1",en);
540 fill1D(
"HcalDigiTask_tp_ntp",
c);
541 fill1D(
"HcalDigiTask_tp_ntp_v0",cv0);
542 fill1D(
"HcalDigiTask_tp_ntp_v1",cv1);
543 fill1D(
"HcalDigiTask_tp_ntp_HB",chb);
544 fill1D(
"HcalDigiTask_tp_ntp_HE",che);
545 fill1D(
"HcalDigiTask_tp_ntp_HF",chf);
546 fill1D(
"HcalDigiTask_tp_ntp_HF_v0",chfv0);
547 fill1D(
"HcalDigiTask_tp_ntp_HF_v1",chfv1);
570 if (
subdet_ ==
"HB") isubdet = 1;
571 if (
subdet_ ==
"HE") isubdet = 2;
572 if (
subdet_ ==
"HO") isubdet = 3;
573 if (
subdet_ ==
"HF") isubdet = 4;
582 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
589 double emax_Sim = -9999.;
598 if (isubdet != 0 &&
noise_ == 0) {
600 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
602 unsigned int id_ = simhits->id();
603 int sub,
depth, ieta, iphi;
607 int sign = (z==0) ? (-1):(1);
609 ieta = sign*hcid.
eta;
620 double en = simhits->energy();
622 if (en > emax_Sim && sub == isubdet) {
627 if (
mode_ ==
"multi" &&
628 ((sub == 4 && en < 100. && en > 1.)
629 || ((sub != 4) && en < 1. && en > 0.02))) {
639 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
649 int depth = cell.depth();
650 int iphi = cell.iphi();
651 int ieta = cell.ieta();
652 int sub = cell.subdet();
654 if(depth >
maxDepth_[isubdet] && sub == isubdet){
655 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
660 std::vector<double> v_ampl(
maxDepth_[isubdet]+1,0);
663 if (((
nevent1 == 1 && isubdet == 1) ||
664 (
nevent2 == 1 && isubdet == 2) ||
665 (
nevent3 == 1 && isubdet == 3) ||
666 (
nevent4 == 1 && isubdet == 4)) &&
noise_ == 1 && sub == isubdet) {
674 for (
int i = 0;
i < 4;
i++) {
677 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
682 fill2D(
"HcalDigiTask_pwidthMap_Depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi), pedWidth->
getWidth(0));
686 if (sub == isubdet) Ndig++;
690 if (sub == isubdet &&
noise_ == 0) {
697 coder.
adc2fC(*digiItr, tool);
699 double noiseADC = (*digiItr)[0].adc();
700 double noisefC = tool[0];
702 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
707 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
717 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
719 for (
int ii = 0;
ii < tool.size();
ii++) {
720 int capid = (*digiItr)[
ii].capid();
725 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
726 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
731 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
737 if (isubdet != 4 &&
ii >= 4 &&
ii <= 7) {
748 if (isubdet == 4 &&
ii >= 2 &&
ii <= 4) {
761 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
762 fill1D(strtmp, v_ampl[0]);
764 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
765 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
766 if (ampl_max>10.) indigis++;
770 if (v_ampl[1] > 30. && depth == 1 && closen == 1 && isubdet != 4) {
771 double fBin5 = tool[4] - calibrations.
pedestal((*digiItr)[4].capid());
772 double fBin67 = tool[5] + tool[6]
773 - calibrations.
pedestal((*digiItr)[5].capid())
774 - calibrations.
pedestal((*digiItr)[6].capid());
779 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
781 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
787 if (isubdet == 4 && v_ampl[1] > 30. && depth == 1) {
788 double fBin5 = tool[2] - calibrations.
pedestal((*digiItr)[2].capid());
789 double fBin67 = tool[3] + tool[4]
790 - calibrations.
pedestal((*digiItr)[3].capid())
791 - calibrations.
pedestal((*digiItr)[4].capid());
794 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
796 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
800 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
801 fill1D(strtmp, v_ampl[0]);
802 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
803 fill1D(strtmp, v_ampl[depth]);
807 if (isubdet != 0 &&
noise_ == 0) {
808 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
813 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
819 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
821 unsigned int id_ = simhits->id();
822 int sub,
depth, ieta, iphi;
826 int sign = (z==0) ? (-1):(1);
828 ieta = sign*hcid.
eta;
839 if(depth >
maxDepth_[isubdet] && sub == isubdet){
840 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
846 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
847 double en = simhits->energy();
850 v_ehits[
depth] += en;
855 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
856 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
858 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
862 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
863 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
865 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
869 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
870 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
872 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
874 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
875 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
881 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
882 fill1D(strtmp,
double(Ndig));
904 if (!digiHandle.isValid())
return;
907 if (
subdet_ ==
"HB") isubdet = 1;
908 if (
subdet_ ==
"HE") isubdet = 2;
909 if (
subdet_ ==
"HO") isubdet = 3;
910 if (
subdet_ ==
"HF") isubdet = 4;
919 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
926 double emax_Sim = -9999.;
935 if (isubdet != 0 &&
noise_ == 0) {
937 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
939 unsigned int id_ = simhits->id();
940 int sub,
depth, ieta, iphi;
944 int sign = (z==0) ? (-1):(1);
946 ieta = sign*hcid.
eta;
957 double en = simhits->energy();
959 if (en > emax_Sim && sub == isubdet) {
964 if (
mode_ ==
"multi" &&
965 ((sub == 4 && en < 100. && en > 1.)
966 || ((sub != 4) && en < 1. && en > 0.02))) {
976 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
985 dataFrameType dataFrame = *digiItr;
988 int depth = cell.depth();
989 int iphi = cell.iphi();
990 int ieta = cell.ieta();
991 int sub = cell.subdet();
993 if(depth >
maxDepth_[isubdet] && sub == isubdet){
994 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
999 std::vector<double> v_ampl(
maxDepth_[isubdet]+1,0);
1002 if (((
nevent1 == 1 && isubdet == 1) ||
1003 (
nevent2 == 1 && isubdet == 2) ||
1004 (
nevent3 == 1 && isubdet == 3) ||
1005 (
nevent4 == 1 && isubdet == 4)) &&
noise_ == 1 && sub == isubdet) {
1013 for (
int i = 0;
i < 4;
i++) {
1016 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
1021 fill2D(
"HcalDigiTask_pwidthMap_Depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi), pedWidth->
getWidth(0));
1026 if (sub == isubdet) Ndig++;
1030 if (sub == isubdet &&
noise_ == 0) {
1037 coder.
adc2fC(dataFrame, tool);
1039 double noiseADC = (dataFrame)[0].
adc();
1040 double noisefC = tool[0];
1042 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1043 fill1D(
"HcalDigiTask_ADC0_fC_depth" +
str(depth) +
"_" +
subdet_, noisefC);
1047 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
1057 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
1059 for (
int ii = 0;
ii < tool.size();
ii++) {
1060 int capid = (dataFrame)[
ii].capid();
1065 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1066 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1071 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1077 if (isubdet != 4 &&
ii >= 4 &&
ii <= 7) {
1088 if (isubdet == 4 &&
ii >= 2 &&
ii <= 4) {
1100 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
1101 fill1D(strtmp, v_ampl[0]);
1103 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
1104 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
1105 if (ampl_max>10.) indigis++;
1109 if (v_ampl[1] > 30. && depth == 1 && closen == 1 && isubdet != 4) {
1110 double fBin5 = tool[4] - calibrations.
pedestal((dataFrame)[4].capid());
1111 double fBin67 = tool[5] + tool[6]
1112 - calibrations.
pedestal((dataFrame)[5].capid())
1113 - calibrations.
pedestal((dataFrame)[6].capid());
1116 fBin67 /= v_ampl[1];
1118 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
1120 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
1126 if (isubdet == 4 && v_ampl[1] > 30. && depth == 1) {
1127 double fBin5 = tool[2] - calibrations.
pedestal((dataFrame)[2].capid());
1128 double fBin67 = tool[3] + tool[4]
1129 - calibrations.
pedestal((dataFrame)[3].capid())
1130 - calibrations.
pedestal((dataFrame)[4].capid());
1132 fBin67 /= v_ampl[1];
1133 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
1135 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
1139 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1140 fill1D(strtmp, v_ampl[0]);
1141 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1142 fill1D(strtmp, v_ampl[depth]);
1146 if (isubdet != 0 &&
noise_ == 0) {
1147 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
1152 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
1158 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
1160 unsigned int id_ = simhits->id();
1161 int sub,
depth, ieta, iphi;
1165 int sign = (z==0) ? (-1):(1);
1167 ieta = sign*hcid.
eta;
1178 if(depth >
maxDepth_[isubdet] && sub == isubdet){
1179 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
1185 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
1186 double en = simhits->energy();
1189 v_ehits[
depth] += en;
1194 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
1195 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
1197 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
1201 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
1202 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
1204 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1208 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
1209 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
1211 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1213 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
1214 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
1220 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
1221 fill1D(strtmp,
double(Ndig));
1236 msm_->find(name)->second->Fill(X, weight);
1244 msm_->find(name)->second->Fill(X, Y, weight);
1256 msm_->find(name)->second->Fill(X, Y);
1260 if (!
msm_->count(name))
return NULL;
1261 else return msm_->find(name)->second;
1265 std::stringstream
out;
int adc(sample_type sample)
get the ADC sample (12 bits)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
T getUntrackedParameter(std::string const &, T const &) const
edm::ESHandle< CaloGeometry > geometry
std::vector< PCaloHit > PCaloHitContainer
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * bookProfile(Args &&...args)
unsigned int getHxSize(const int type) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const HcalTopology * htopology
std::vector< HcalTriggerPrimitiveDigi >::const_iterator const_iterator
bool exists(std::string const ¶meterName) const
checks if a parameter exists
edm::InputTag dataTPsTag_
void reco(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::EDGetTokenT< edm::SortedCollection< Digi > > &tok)
double pedestal(int fCapId) const
get pedestal for capid=0..3
float getValue(int fCapId) const
get value for capId = 0..3
virtual void analyze(const edm::Event &, const edm::EventSetup &)
float getValue(int fCapId) const
get value for capId = 0..3
edm::EDGetTokenT< QIE11DigiCollection > tok_qie11_hbhe_
edm::EDGetTokenT< QIE10DigiCollection > tok_qie10_hf_
std::map< std::string, MonitorElement * > * msm_
int getMaxDepth(const int type) const
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
MonitorElement * monitor(std::string name)
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const
void fillPf(std::string name, double X, double Y)
void fill2D(std::string name, double X, double Y, double weight=1)
edm::ESHandle< HcalTopology > htopo
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
HcalDigisValidation(const edm::ParameterSet &)
void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
const HcalDDDRecConstants * hcons
virtual void dqmBeginRun(const edm::Run &run, const edm::EventSetup &c)
edm::InputTag QIE10inputTag_
void book2D(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
edm::InputTag emulTPsTag_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
void setCurrentFolder(const std::string &fullpath)
T const * product() const
void fill1D(std::string name, double X, double weight=1)
MonitorElement * book2D(Args &&...args)
edm::EDGetTokenT< edm::PCaloHitContainer > tok_mc_
edm::EDGetTokenT< HODigiCollection > tok_ho_
void booking(DQMStore::IBooker &ib, std::string subdetopt, int bnoise, int bmc)
T const * product() const
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_emulTPs_
edm::InputTag QIE11inputTag_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_dataTPs_
edm::ESHandle< HcalDbService > conditions
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)