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(2410, -3000., 720000.);
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);
605 if (!digiCollection.
isValid())
return;
607 if (
subdet_ ==
"HB") isubdet = 1;
608 if (
subdet_ ==
"HE") isubdet = 2;
609 if (
subdet_ ==
"HO") isubdet = 3;
610 if (
subdet_ ==
"HF") isubdet = 4;
619 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
626 double emax_Sim = -9999.;
634 if (isubdet != 0 &&
noise_ == 0) {
636 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
638 unsigned int id_ = simhits->id();
647 double en = simhits->energy();
649 if (en > emax_Sim && sub == isubdet) {
654 if (
mode_ ==
"multi" &&
655 ((sub == 4 && en < 100. && en > 1.)
656 || ((sub != 4) && en < 1. && en > 0.02))) {
666 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
673 for (digiItr = digiCollection->begin(); digiItr != digiCollection->end(); digiItr++) {
676 int depth = cell.depth();
677 int iphi = cell.iphi();
678 int ieta = cell.ieta();
679 int sub = cell.subdet();
681 if(depth >
maxDepth_[isubdet] && sub == isubdet){
682 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
687 std::vector<double> v_ampl(
maxDepth_[isubdet]+1,0);
690 if (((
nevent1 == 1 && isubdet == 1) ||
691 (
nevent2 == 1 && isubdet == 2) ||
692 (
nevent3 == 1 && isubdet == 3) ||
693 (
nevent4 == 1 && isubdet == 4)) &&
noise_ == 1 && sub == isubdet) {
701 for (
int i = 0;
i < 4;
i++) {
704 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
709 fill2D(
"HcalDigiTask_pwidthMap_Depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi), pedWidth->
getWidth(0));
713 if (sub == isubdet) Ndig++;
717 if (sub == isubdet &&
noise_ == 0) {
724 coder.
adc2fC(*digiItr, tool);
728 int lastbin = tool.
size() - 1;
730 double noiseADC = (*digiItr)[0].adc();
731 double noisefC = tool[0];
733 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
737 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
747 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
750 int capid = (*digiItr)[
ii].capid();
755 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
756 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
761 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
767 if (
ii >= soi &&
ii <= lastbin) {
782 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
783 fill1D(strtmp, v_ampl[0]);
785 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
786 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
787 if (ampl_max>10.) indigis++;
791 if (v_ampl[depth] > 30.) {
792 double fbinSOI = tool[soi] - calibrations.
pedestal((*digiItr)[soi].capid());
795 for(
int j = soi+1; j <= lastbin; j++) fbinPS += tool[j] - calibrations.
pedestal((*digiItr)[j].capid());
797 fbinSOI /= v_ampl[
depth];
798 fbinPS /= v_ampl[
depth];
799 strtmp =
"HcalDigiTask_SOI_frac_" +
subdet_;
801 strtmp =
"HcalDigiTask_postSOI_frac_" +
subdet_;
805 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
806 fill1D(strtmp, v_ampl[0]);
807 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
808 fill1D(strtmp, v_ampl[depth]);
812 if (isubdet != 0 &&
noise_ == 0) {
813 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
818 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
824 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
826 unsigned int id_ = simhits->id();
827 int sub,
depth, ieta, iphi;
836 if(depth >
maxDepth_[isubdet] && sub == isubdet){
837 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
843 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
844 double en = simhits->energy();
847 v_ehits[
depth] += en;
852 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
853 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
855 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
859 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
860 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
862 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
866 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
867 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
869 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
871 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
872 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
878 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
879 fill1D(strtmp,
double(Ndig));
900 if (!digiHandle.
isValid())
return;
903 if (
subdet_ ==
"HB") isubdet = 1;
904 if (
subdet_ ==
"HE") isubdet = 2;
905 if (
subdet_ ==
"HO") isubdet = 3;
906 if (
subdet_ ==
"HF") isubdet = 4;
915 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
922 double emax_Sim = -9999.;
930 if (isubdet != 0 &&
noise_ == 0) {
932 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
934 unsigned int id_ = simhits->id();
943 double en = simhits->energy();
945 if (en > emax_Sim && sub == isubdet) {
950 if (
mode_ ==
"multi" &&
951 ((sub == 4 && en < 100. && en > 1.)
952 || ((sub != 4) && en < 1. && en > 0.02))) {
962 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
971 dataFrameType dataFrame = *digiItr;
974 int depth = cell.depth();
975 int iphi = cell.iphi();
976 int ieta = cell.ieta();
977 int sub = cell.subdet();
980 bool isHEP17 = (iphi>=63)&&(iphi<=66)&&(ieta>0)&&(sub == 2);
983 if(depth >
maxDepth_[isubdet] && sub == isubdet){
984 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
989 std::vector<double> v_ampl(
maxDepth_[isubdet]+1,0);
992 if (((
nevent1 == 1 && isubdet == 1) ||
993 (
nevent2 == 1 && isubdet == 2) ||
994 (
nevent3 == 1 && isubdet == 3) ||
995 (
nevent4 == 1 && isubdet == 4)) &&
noise_ == 1 && sub == isubdet) {
1003 for (
int i = 0;
i < 4;
i++) {
1006 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
1011 fill2D(
"HcalDigiTask_pwidthMap_Depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi), pedWidth->
getWidth(0));
1016 if (sub == isubdet) Ndig++;
1020 if (sub == isubdet &&
noise_ == 0) {
1027 coder.
adc2fC(dataFrame, tool);
1031 int lastbin = tool.
size() - 1;
1033 double noiseADC = (dataFrame)[0].
adc();
1034 double noisefC = tool[0];
1036 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1037 fill1D(
"HcalDigiTask_ADC0_fC_depth" +
str(depth) +
"_" +
subdet_, noisefC);
1040 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
1050 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
1053 int capid = (dataFrame)[
ii].capid();
1058 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1061 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1064 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_HEP17";
1068 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1076 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1079 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_HEP17";
1083 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1089 if (
ii >= soi &&
ii <= lastbin) {
1103 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
1104 fill1D(strtmp, v_ampl[0]);
1106 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
1107 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
1108 if (ampl_max>10.) indigis++;
1113 if ((v_ampl[depth] > 30. && (
subdet_ !=
"HE" ||
subdet_ !=
"HB")) || (v_ampl[
depth] > 300.)) {
1114 double fbinSOI = tool[soi] - calibrations.
pedestal((dataFrame)[soi].capid());
1117 for(
int j = soi+1; j <= lastbin; j++) fbinPS += tool[j] - calibrations.
pedestal((dataFrame)[j].capid());
1119 fbinSOI /= v_ampl[
depth];
1120 fbinPS /= v_ampl[
depth];
1121 strtmp =
"HcalDigiTask_SOI_frac_" +
subdet_;
1123 strtmp =
"HcalDigiTask_postSOI_frac_" +
subdet_;
1130 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1131 fill1D(strtmp, v_ampl[0]);
1132 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1133 fill1D(strtmp, v_ampl[depth]);
1135 strtmp =
"HcalDigiTask_signal_amplitude_HEP17";
1136 fill1D(strtmp, v_ampl[0]);
1137 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_HEP17";
1138 fill1D(strtmp, v_ampl[depth]);
1141 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1142 fill1D(strtmp, v_ampl[0]);
1143 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1144 fill1D(strtmp, v_ampl[depth]);
1149 if (isubdet != 0 &&
noise_ == 0) {
1150 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
1155 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
1161 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
1163 unsigned int id_ = simhits->id();
1164 int sub,
depth, ieta, iphi;
1169 depth = hid.
depth();
1173 if(depth >
maxDepth_[isubdet] && sub == isubdet){
1174 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
1180 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
1181 double en = simhits->energy();
1184 v_ehits[
depth] += en;
1189 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
1190 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
1192 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
1196 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
1197 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
1199 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1203 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
1204 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
1206 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1208 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
1209 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
1215 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
1216 fill1D(strtmp,
double(Ndig));
1231 msm_->find(name)->second->Fill(X, weight);
1239 msm_->find(name)->second->Fill(X, Y, weight);
1251 msm_->find(name)->second->Fill(X, Y);
1255 if (!
msm_->count(name))
return nullptr;
1256 else return msm_->find(name)->second;
1260 std::stringstream
out;
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
const HcalTopology * htopology
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &c) override
std::vector< T >::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)
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
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
void setCurrentFolder(std::string const &fullpath)
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)
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
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_
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
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