48 if (iConfig.
exists(
"simHits")){
70 msm_ =
new std::map<std::string, MonitorElement*>();
72 if (!outputFile_.empty())
edm::LogInfo(
"OutputInfo") <<
" Hcal Digi Task histograms will be saved to '" << outputFile_.c_str() <<
"'";
73 else edm::LogInfo(
"OutputInfo") <<
" Hcal Digi Task histograms will NOT be saved";
121 book1D(ib,
"nevtot", 1, 0, 1);
124 if (
subdet_ ==
"noise") bnoise = 1;
125 if (
mc_ ==
"yes") bmc = 1;
137 HistLim tp_hl_et(260, -10, 250);
138 HistLim tp_hl_ntp(640, -20, 3180);
139 HistLim tp_hl_ntp_sub(404, -20, 2000);
140 HistLim tp_hl_ieta(85, -42.5, 42.5);
141 HistLim tp_hl_iphi(74,-0.5,73.5);
144 book1D(ib,
"HcalDigiTask_tp_et", tp_hl_et);
145 book1D(ib,
"HcalDigiTask_tp_et_HB", tp_hl_et);
146 book1D(ib,
"HcalDigiTask_tp_et_HE", tp_hl_et);
147 book1D(ib,
"HcalDigiTask_tp_et_HF", tp_hl_et);
148 book1D(ib,
"HcalDigiTask_tp_ntp", tp_hl_ntp);
149 book1D(ib,
"HcalDigiTask_tp_ntp_HB", tp_hl_ntp_sub);
150 book1D(ib,
"HcalDigiTask_tp_ntp_HE", tp_hl_ntp_sub);
151 book1D(ib,
"HcalDigiTask_tp_ntp_HF", tp_hl_ntp_sub);
152 book1D(ib,
"HcalDigiTask_tp_ntp_ieta", tp_hl_ieta);
153 book1D(ib,
"HcalDigiTask_tp_ntp_iphi", tp_hl_iphi);
154 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta", tp_hl_ieta);
155 book2D(ib,
"HcalDigiTask_tp_et_ieta", tp_hl_ieta, tp_hl_et);
156 book2D(ib,
"HcalDigiTask_tp_ieta_iphi", tp_hl_ieta, tp_hl_iphi);
157 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta", tp_hl_ieta, tp_hl_et,
" ");
159 book1D(ib,
"HcalDigiTask_tp_et_v0", tp_hl_et);
160 book1D(ib,
"HcalDigiTask_tp_et_v1", tp_hl_et);
161 book1D(ib,
"HcalDigiTask_tp_et_HF_v0", tp_hl_et);
162 book1D(ib,
"HcalDigiTask_tp_et_HF_v1", tp_hl_et);
163 book1D(ib,
"HcalDigiTask_tp_ntp_v0", tp_hl_ntp);
164 book1D(ib,
"HcalDigiTask_tp_ntp_v1", tp_hl_ntp);
165 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v0", tp_hl_ntp_sub);
166 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v1", tp_hl_ntp_sub);
167 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v0", tp_hl_ieta);
168 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v1", tp_hl_ieta);
169 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v0", tp_hl_iphi);
170 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v1", tp_hl_iphi);
171 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v0", tp_hl_ieta);
172 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v1", tp_hl_ieta);
173 book2D(ib,
"HcalDigiTask_tp_et_ieta_v0", tp_hl_ieta, tp_hl_et);
174 book2D(ib,
"HcalDigiTask_tp_et_ieta_v1", tp_hl_ieta, tp_hl_et);
175 book2D(ib,
"HcalDigiTask_tp_ieta_iphi_v0", tp_hl_ieta, tp_hl_iphi);
176 book2D(ib,
"HcalDigiTask_tp_ieta_iphi_v1", tp_hl_ieta, tp_hl_iphi);
177 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta_v0", tp_hl_ieta, tp_hl_et,
" ");
178 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta_v1", tp_hl_ieta, tp_hl_et,
" ");
187 HistLim Ndigis(2600, 0., 2600.);
188 HistLim ndigis(520, -20., 1020.);
191 HistLim digiAmp(360, -100., 7100.);
192 HistLim digiAmpWide(360, -10000., 710000.);
194 HistLim sumAmp(100, -500., 1500.);
199 HistLim pedestalfC(400, -10., 30.);
204 HistLim pedWidthLim(100, 0., 2.);
207 HistLim gainWidthLim(160, 0., 0.32);
209 HistLim ietaLim(85, -42.5, 42.5);
210 HistLim iphiLim(74, -0.5, 73.5);
212 HistLim depthLim(15,-0.5,14.5);
214 if (bsubdet ==
"HB") {
216 }
else if (bsubdet ==
"HE") {
219 }
else if (bsubdet ==
"HF") {
221 pedLim =
HistLim(100, 0., 20.);
222 pedWidthLim =
HistLim(100, 0., 5.);
223 frac =
HistLim(400, -4.00, 4.00);
225 }
else if (bsubdet ==
"HO") {
227 gainLim =
HistLim(160, 0., 1.6);
232 if (bsubdet==
"HB") isubdet=1;
233 else if (bsubdet==
"HE") isubdet=2;
234 else if (bsubdet==
"HO") isubdet=3;
235 else if (bsubdet==
"HF") isubdet=4;
236 else edm::LogWarning(
"HcalDigisValidation") <<
"HcalDigisValidation Warning: not HB/HE/HF/HO " << bsubdet << std::endl;
239 const char * sub = bsubdet.c_str();
242 sprintf(histo,
"HcalDigiTask_Ndigis_%s", sub);
243 book1D(ib, histo, Ndigis);
247 sprintf(histo,
"HcalDigiTask_ieta_iphi_occupancy_map_depth%d_%s",
depth, sub);
248 book2D(ib, histo, ietaLim, iphiLim);
252 sprintf(histo,
"HcalDigiTask_depths_%s",sub);
253 book1D(ib,histo, depthLim);
257 sprintf(histo,
"HcalDigiTask_occupancy_vs_ieta_depth%d_%s",
depth, sub);
258 book1D(ib, histo, ietaLim);
263 sprintf(histo,
"HcalDigiTask_sum_all_amplitudes_%s", sub);
265 else book1D(ib, histo, digiAmp);
267 sprintf(histo,
"HcalDigiTask_number_of_amplitudes_above_10fC_%s", sub);
268 book1D(ib, histo, ndigis);
271 sprintf(histo,
"HcalDigiTask_ADC0_adc_depth%d_%s",
depth, sub);
272 book1D(ib, histo, pedestal);
276 sprintf(histo,
"HcalDigiTask_ADC0_fC_depth%d_%s",
depth, sub);
277 book1D(ib, histo, pedestalfC);
280 sprintf(histo,
"HcalDigiTask_signal_amplitude_%s", sub);
282 else book1D(ib, histo, digiAmp);
284 if(
hep17_ && bsubdet==
"HE"){
285 sprintf(histo,
"HcalDigiTask_signal_amplitude_HEP17");
286 book1D(ib, histo, digiAmpWide);
290 sprintf(histo,
"HcalDigiTask_signal_amplitude_depth%d_%s",
depth, sub);
292 else book1D(ib, histo, digiAmp);
293 if(
hep17_ && bsubdet==
"HE"){
294 sprintf(histo,
"HcalDigiTask_signal_amplitude_depth%d_HEP17",
depth);
295 book1D(ib, histo, digiAmpWide);
299 sprintf(histo,
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_%s", sub);
301 else book2D(ib, histo, nbin, digiAmp);
302 if(
hep17_ && bsubdet==
"HE"){
303 sprintf(histo,
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_HEP17");
304 book2D(ib, histo, nbin, digiAmpWide);
308 sprintf(histo,
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth%d_%s",
depth, sub);
310 if(
hep17_ && bsubdet==
"HE"){
311 sprintf(histo,
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth%d_HEP17",
depth);
316 sprintf(histo,
"HcalDigiTask_SOI_frac_%s", sub);
318 sprintf(histo,
"HcalDigiTask_postSOI_frac_%s", sub);
322 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_%s", sub);
323 book2D(ib, histo, sime, digiAmp);
325 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_depth%d_%s",
depth, sub);
326 book2D(ib, histo, sime, digiAmp);
329 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_%s", sub);
330 bookPf(ib, histo, sime, digiAmp);
332 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_depth%d_%s",
depth, sub);
333 bookPf(ib, histo, sime, digiAmp);
336 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_%s", sub);
339 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_depth%d_%s",
depth, sub);
350 sprintf(histo,
"HcalDigiTask_gain_capId0_Depth%d_%s",
depth, sub);
351 book1D(ib, histo, gainLim);
352 sprintf(histo,
"HcalDigiTask_gain_capId1_Depth%d_%s",
depth, sub);
353 book1D(ib, histo, gainLim);
354 sprintf(histo,
"HcalDigiTask_gain_capId2_Depth%d_%s",
depth, sub);
355 book1D(ib, histo, gainLim);
356 sprintf(histo,
"HcalDigiTask_gain_capId3_Depth%d_%s",
depth, sub);
357 book1D(ib, histo, gainLim);
359 sprintf(histo,
"HcalDigiTask_gainWidth_capId0_Depth%d_%s",
depth, sub);
360 book1D(ib, histo, gainWidthLim);
361 sprintf(histo,
"HcalDigiTask_gainWidth_capId1_Depth%d_%s",
depth, sub);
362 book1D(ib, histo, gainWidthLim);
363 sprintf(histo,
"HcalDigiTask_gainWidth_capId2_Depth%d_%s",
depth, sub);
364 book1D(ib, histo, gainWidthLim);
365 sprintf(histo,
"HcalDigiTask_gainWidth_capId3_Depth%d_%s",
depth, sub);
366 book1D(ib, histo, gainWidthLim);
368 sprintf(histo,
"HcalDigiTask_pedestal_capId0_Depth%d_%s",
depth, sub);
369 book1D(ib, histo, pedLim);
370 sprintf(histo,
"HcalDigiTask_pedestal_capId1_Depth%d_%s",
depth, sub);
371 book1D(ib, histo, pedLim);
372 sprintf(histo,
"HcalDigiTask_pedestal_capId2_Depth%d_%s",
depth, sub);
373 book1D(ib, histo, pedLim);
374 sprintf(histo,
"HcalDigiTask_pedestal_capId3_Depth%d_%s",
depth, sub);
375 book1D(ib, histo, pedLim);
377 sprintf(histo,
"HcalDigiTask_pedestal_width_capId0_Depth%d_%s",
depth, sub);
378 book1D(ib, histo, pedWidthLim);
379 sprintf(histo,
"HcalDigiTask_pedestal_width_capId1_Depth%d_%s",
depth, sub);
380 book1D(ib, histo, pedWidthLim);
381 sprintf(histo,
"HcalDigiTask_pedestal_width_capId2_Depth%d_%s",
depth, sub);
382 book1D(ib, histo, pedWidthLim);
383 sprintf(histo,
"HcalDigiTask_pedestal_width_capId3_Depth%d_%s",
depth, sub);
384 book1D(ib, histo, pedWidthLim);
390 sprintf(histo,
"HcalDigiTask_gainMap_Depth%d_%s",
depth, sub);
391 book2D(ib, histo, ietaLim, iphiLim);
392 sprintf(histo,
"HcalDigiTask_pwidthMap_Depth%d_%s",
depth, sub);
393 book2D(ib, histo, ietaLim, iphiLim);
478 int c = 0, chb = 0, che = 0, chf = 0, cv0 = 0, cv1 = 0, chfv0 = 0, chfv1 = 0;
483 int ieta = itr->id().ieta();
484 int iphi = itr->id().iphi();
489 if(
abs(ieta) <= 16 )
493 else if (
abs(ieta) <= 42 )
500 float en = decoder->
hcaletValue(itr->id(), itr->t0());
502 if (en < 0.00001)
continue;
509 fill1D(
"HcalDigiTask_tp_et",en);
510 fill2D(
"HcalDigiTask_tp_et_ieta",ieta,en);
511 fill2D(
"HcalDigiTask_tp_ieta_iphi",ieta,iphi);
512 fillPf(
"HcalDigiTask_tp_ave_et_ieta",ieta,en);
513 fill1D(
"HcalDigiTask_tp_ntp_ieta",ieta);
514 fill1D(
"HcalDigiTask_tp_ntp_iphi",iphi);
515 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta",ieta);
519 fill1D(
"HcalDigiTask_tp_et_v0",en);
520 fill2D(
"HcalDigiTask_tp_et_ieta_v0",ieta,en);
521 fill2D(
"HcalDigiTask_tp_ieta_iphi_v0",ieta,iphi);
522 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v0",ieta,en);
523 fill1D(
"HcalDigiTask_tp_ntp_ieta_v0",ieta);
524 fill1D(
"HcalDigiTask_tp_ntp_iphi_v0",iphi);
525 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v0",ieta);
530 fill1D(
"HcalDigiTask_tp_et_v1",en);
531 fill2D(
"HcalDigiTask_tp_et_ieta_v1",ieta,en);
532 fill2D(
"HcalDigiTask_tp_ieta_iphi_v1",ieta,iphi);
533 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v1",ieta,en);
534 fill1D(
"HcalDigiTask_tp_ntp_ieta_v1",ieta);
535 fill1D(
"HcalDigiTask_tp_ntp_iphi_v1",iphi);
536 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v1",ieta);
541 fill1D(
"HcalDigiTask_tp_et_HB",en);
549 fill1D(
"HcalDigiTask_tp_et_HE",en);
557 fill1D(
"HcalDigiTask_tp_et_HF",en);
561 fill1D(
"HcalDigiTask_tp_et_HF_v0",en);
567 fill1D(
"HcalDigiTask_tp_et_HF_v1",en);
576 fill1D(
"HcalDigiTask_tp_ntp",c);
577 fill1D(
"HcalDigiTask_tp_ntp_HB",chb);
578 fill1D(
"HcalDigiTask_tp_ntp_HE",che);
579 fill1D(
"HcalDigiTask_tp_ntp_HF",chf);
581 fill1D(
"HcalDigiTask_tp_ntp_v0",cv0);
582 fill1D(
"HcalDigiTask_tp_ntp_v1",cv1);
583 fill1D(
"HcalDigiTask_tp_ntp_HF_v0",chfv0);
584 fill1D(
"HcalDigiTask_tp_ntp_HF_v1",chfv1);
606 if (!digiCollection.
isValid())
return;
608 if (
subdet_ ==
"HB") isubdet = 1;
609 if (
subdet_ ==
"HE") isubdet = 2;
610 if (
subdet_ ==
"HO") isubdet = 3;
611 if (
subdet_ ==
"HF") isubdet = 4;
620 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
627 double emax_Sim = -9999.;
635 if (isubdet != 0 &&
noise_ == 0) {
637 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
639 unsigned int id_ = simhits->id();
648 double en = simhits->energy();
650 if (en > emax_Sim && sub == isubdet) {
655 if (
mode_ ==
"multi" &&
656 ((sub == 4 && en < 100. && en > 1.)
657 || ((sub != 4) && en < 1. && en > 0.02))) {
667 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
674 for (digiItr = digiCollection->begin(); digiItr != digiCollection->end(); digiItr++) {
677 int depth = cell.depth();
678 int iphi = cell.iphi();
679 int ieta = cell.ieta();
680 int sub = cell.subdet();
682 if(depth >
maxDepth_[isubdet] && sub == isubdet){
683 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
688 std::vector<double> v_ampl(
maxDepth_[isubdet]+1,0);
691 if (((
nevent1 == 1 && isubdet == 1) ||
692 (
nevent2 == 1 && isubdet == 2) ||
693 (
nevent3 == 1 && isubdet == 3) ||
694 (
nevent4 == 1 && isubdet == 4)) &&
noise_ == 1 && sub == isubdet) {
702 for (
int i = 0;
i < 4;
i++) {
705 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
710 fill2D(
"HcalDigiTask_pwidthMap_Depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi), pedWidth->
getWidth(0));
714 if (sub == isubdet) Ndig++;
718 if (sub == isubdet &&
noise_ == 0) {
725 coder.
adc2fC(*digiItr, tool);
729 int lastbin = tool.
size() - 1;
731 double noiseADC = (*digiItr)[0].adc();
732 double noisefC = tool[0];
734 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
738 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
748 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
751 int capid = (*digiItr)[
ii].capid();
756 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
757 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
762 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
768 if (
ii >= soi &&
ii <= lastbin) {
783 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
784 fill1D(strtmp, v_ampl[0]);
786 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
787 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
788 if (ampl_max>10.) indigis++;
792 if (v_ampl[depth] > 30.) {
793 double fbinSOI = tool[soi] - calibrations.
pedestal((*digiItr)[soi].capid());
796 for(
int j = soi+1; j <= lastbin; j++) fbinPS += tool[j] - calibrations.
pedestal((*digiItr)[j].capid());
798 fbinSOI /= v_ampl[
depth];
799 fbinPS /= v_ampl[
depth];
800 strtmp =
"HcalDigiTask_SOI_frac_" +
subdet_;
802 strtmp =
"HcalDigiTask_postSOI_frac_" +
subdet_;
806 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
807 fill1D(strtmp, v_ampl[0]);
808 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
809 fill1D(strtmp, v_ampl[depth]);
813 if (isubdet != 0 &&
noise_ == 0) {
814 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
819 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
825 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
827 unsigned int id_ = simhits->id();
828 int sub,
depth, ieta, iphi;
837 if(depth >
maxDepth_[isubdet] && sub == isubdet){
838 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
844 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
845 double en = simhits->energy();
848 v_ehits[
depth] += en;
853 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
854 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
856 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
860 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
861 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
863 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
867 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
868 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
870 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
872 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
873 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
879 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
880 fill1D(strtmp,
double(Ndig));
902 if (!digiHandle.
isValid())
return;
905 if (
subdet_ ==
"HB") isubdet = 1;
906 if (
subdet_ ==
"HE") isubdet = 2;
907 if (
subdet_ ==
"HO") isubdet = 3;
908 if (
subdet_ ==
"HF") isubdet = 4;
917 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
924 double emax_Sim = -9999.;
932 if (isubdet != 0 &&
noise_ == 0) {
934 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
936 unsigned int id_ = simhits->id();
945 double en = simhits->energy();
947 if (en > emax_Sim && sub == isubdet) {
952 if (
mode_ ==
"multi" &&
953 ((sub == 4 && en < 100. && en > 1.)
954 || ((sub != 4) && en < 1. && en > 0.02))) {
964 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
973 dataFrameType dataFrame = *digiItr;
976 int depth = cell.depth();
977 int iphi = cell.iphi();
978 int ieta = cell.ieta();
979 int sub = cell.subdet();
982 bool isHEP17 = (iphi>=63)&&(iphi<=66)&&(ieta>0)&&(sub == 2);
985 if(depth >
maxDepth_[isubdet] && sub == isubdet){
986 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
991 std::vector<double> v_ampl(
maxDepth_[isubdet]+1,0);
994 if (((
nevent1 == 1 && isubdet == 1) ||
995 (
nevent2 == 1 && isubdet == 2) ||
996 (
nevent3 == 1 && isubdet == 3) ||
997 (
nevent4 == 1 && isubdet == 4)) &&
noise_ == 1 && sub == isubdet) {
1005 for (
int i = 0;
i < 4;
i++) {
1008 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
1013 fill2D(
"HcalDigiTask_pwidthMap_Depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi), pedWidth->
getWidth(0));
1018 if (sub == isubdet) Ndig++;
1022 if (sub == isubdet &&
noise_ == 0) {
1029 coder.
adc2fC(dataFrame, tool);
1033 int lastbin = tool.
size() - 1;
1035 double noiseADC = (dataFrame)[0].
adc();
1036 double noisefC = tool[0];
1038 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1039 fill1D(
"HcalDigiTask_ADC0_fC_depth" +
str(depth) +
"_" +
subdet_, noisefC);
1042 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
1052 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
1055 int capid = (dataFrame)[
ii].capid();
1060 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1063 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1066 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_HEP17";
1070 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1078 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1081 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_HEP17";
1085 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1091 if (
ii >= soi &&
ii <= lastbin) {
1105 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
1106 fill1D(strtmp, v_ampl[0]);
1108 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
1109 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
1110 if (ampl_max>10.) indigis++;
1115 if (v_ampl[depth] > 30.) {
1116 double fbinSOI = tool[soi] - calibrations.
pedestal((dataFrame)[soi].capid());
1119 for(
int j = soi+1; j <= lastbin; j++) fbinPS += tool[j] - calibrations.
pedestal((dataFrame)[j].capid());
1121 fbinSOI /= v_ampl[
depth];
1122 fbinPS /= v_ampl[
depth];
1123 strtmp =
"HcalDigiTask_SOI_frac_" +
subdet_;
1125 strtmp =
"HcalDigiTask_postSOI_frac_" +
subdet_;
1132 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1133 fill1D(strtmp, v_ampl[0]);
1134 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1135 fill1D(strtmp, v_ampl[depth]);
1137 strtmp =
"HcalDigiTask_signal_amplitude_HEP17";
1138 fill1D(strtmp, v_ampl[0]);
1139 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_HEP17";
1140 fill1D(strtmp, v_ampl[depth]);
1143 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1144 fill1D(strtmp, v_ampl[0]);
1145 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1146 fill1D(strtmp, v_ampl[depth]);
1151 if (isubdet != 0 &&
noise_ == 0) {
1152 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
1157 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
1163 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
1165 unsigned int id_ = simhits->id();
1166 int sub,
depth, ieta, iphi;
1171 depth = hid.
depth();
1175 if(depth >
maxDepth_[isubdet] && sub == isubdet){
1176 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
1182 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
1183 double en = simhits->energy();
1186 v_ehits[
depth] += en;
1191 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
1192 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
1194 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
1198 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
1199 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
1201 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1205 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
1206 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
1208 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1210 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
1211 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
1217 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
1218 fill1D(strtmp,
double(Ndig));
1233 msm_->find(name)->second->Fill(X, weight);
1241 msm_->find(name)->second->Fill(X, Y, weight);
1253 msm_->find(name)->second->Fill(X, Y);
1257 if (!
msm_->count(name))
return nullptr;
1258 else return msm_->find(name)->second;
1262 std::stringstream
out;
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< PCaloHit > PCaloHitContainer
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
HcalSubdetector subdet() const
get the subdetector
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
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &c) override
std::vector< HcalTriggerPrimitiveDigi >::const_iterator const_iterator
bool exists(std::string const ¶meterName) const
checks if a parameter exists
int presamples() const
access presample information
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
const_iterator begin() const
float getValue(int fCapId) const
get value for capId = 0..3
float getValue(int fCapId) const
get value for capId = 0..3
edm::EDGetTokenT< QIE11DigiCollection > tok_qie11_hbhe_
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< QIE10DigiCollection > tok_qie10_hf_
std::map< std::string, MonitorElement * > * msm_
int depth() const
get the tower depth
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
MonitorElement * monitor(std::string name)
~HcalDigisValidation() override
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
int ieta() const
get the cell ieta
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
HcalDigisValidation(const edm::ParameterSet &)
void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
const HcalDDDRecConstants * hcons
edm::InputTag QIE10inputTag_
void book2D(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
const_iterator end() const
int iphi() const
get the cell iphi
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)
int size() const
get the size
edm::EDGetTokenT< edm::PCaloHitContainer > tok_mc_
edm::EDGetTokenT< HODigiCollection > tok_ho_
int getMaxDepth(const int &type) const
void booking(DQMStore::IBooker &ib, std::string subdetopt, int bnoise, int bmc)
const HcalGain * getGain(const HcalGenericDetId &fId) const
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_emulTPs_
edm::InputTag QIE11inputTag_
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
const_iterator end() const
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_dataTPs_
edm::ESHandle< HcalDbService > conditions
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const =0
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
DetId relabel(const uint32_t testId) const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
const HcalPedestal * getPedestal(const HcalGenericDetId &fId) const
const_iterator begin() const
int firstHFTower(int version) const