47 if (iConfig.
exists(
"simHits")) {
70 msm_ =
new std::map<std::string, MonitorElement*>();
72 if (!outputFile_.empty())
73 edm::LogInfo(
"OutputInfo") <<
" Hcal Digi Task histograms will be saved to '" << outputFile_.c_str() <<
"'";
75 edm::LogInfo(
"OutputInfo") <<
" Hcal Digi Task histograms will NOT be saved";
114 book1D(ib,
"nevtot", 1, 0, 1);
122 booking(ib,
"HB", bnoise, bmc);
123 booking(ib,
"HO", bnoise, bmc);
124 booking(ib,
"HF", bnoise, bmc);
125 booking(ib,
"HE", bnoise, bmc);
133 HistLim tp_hl_et(260, -10, 250);
134 HistLim tp_hl_ntp(640, -20, 3180);
135 HistLim tp_hl_ntp_sub(404, -20, 2000);
136 HistLim tp_hl_ieta(85, -42.5, 42.5);
137 HistLim tp_hl_iphi(74, -0.5, 73.5);
139 book1D(ib,
"HcalDigiTask_tp_et", tp_hl_et);
140 book1D(ib,
"HcalDigiTask_tp_et_HB", tp_hl_et);
141 book1D(ib,
"HcalDigiTask_tp_et_HE", tp_hl_et);
142 book1D(ib,
"HcalDigiTask_tp_et_HF", tp_hl_et);
143 book1D(ib,
"HcalDigiTask_tp_ntp", tp_hl_ntp);
144 book1D(ib,
"HcalDigiTask_tp_ntp_HB", tp_hl_ntp_sub);
145 book1D(ib,
"HcalDigiTask_tp_ntp_HE", tp_hl_ntp_sub);
146 book1D(ib,
"HcalDigiTask_tp_ntp_HF", tp_hl_ntp_sub);
147 book1D(ib,
"HcalDigiTask_tp_ntp_ieta", tp_hl_ieta);
148 book1D(ib,
"HcalDigiTask_tp_ntp_iphi", tp_hl_iphi);
149 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta", tp_hl_ieta);
150 book2D(ib,
"HcalDigiTask_tp_et_ieta", tp_hl_ieta, tp_hl_et);
151 book2D(ib,
"HcalDigiTask_tp_ieta_iphi", tp_hl_ieta, tp_hl_iphi);
152 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta", tp_hl_ieta, tp_hl_et,
" ");
154 book1D(ib,
"HcalDigiTask_tp_et_v0", tp_hl_et);
155 book1D(ib,
"HcalDigiTask_tp_et_v1", tp_hl_et);
156 book1D(ib,
"HcalDigiTask_tp_et_HF_v0", tp_hl_et);
157 book1D(ib,
"HcalDigiTask_tp_et_HF_v1", tp_hl_et);
158 book1D(ib,
"HcalDigiTask_tp_ntp_v0", tp_hl_ntp);
159 book1D(ib,
"HcalDigiTask_tp_ntp_v1", tp_hl_ntp);
160 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v0", tp_hl_ntp_sub);
161 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v1", tp_hl_ntp_sub);
162 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v0", tp_hl_ieta);
163 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v1", tp_hl_ieta);
164 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v0", tp_hl_iphi);
165 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v1", tp_hl_iphi);
166 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v0", tp_hl_ieta);
167 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v1", tp_hl_ieta);
168 book2D(ib,
"HcalDigiTask_tp_et_ieta_v0", tp_hl_ieta, tp_hl_et);
169 book2D(ib,
"HcalDigiTask_tp_et_ieta_v1", tp_hl_ieta, tp_hl_et);
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_v0", tp_hl_ieta, tp_hl_et,
" ");
173 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta_v1", tp_hl_ieta, tp_hl_et,
" ");
180 HistLim Ndigis(2600, 0., 2600.);
181 HistLim ndigis(520, -20., 1020.);
184 HistLim digiAmp(360, -100., 7100.);
185 HistLim digiAmpWide(2410, -3000., 720000.);
187 HistLim sumAmp(100, -500., 1500.);
192 HistLim pedestalfC(400, -10., 30.);
197 HistLim pedWidthLim(100, 0., 2.);
200 HistLim gainWidthLim(160, 0., 0.32);
202 HistLim ietaLim(85, -42.5, 42.5);
203 HistLim iphiLim(74, -0.5, 73.5);
205 HistLim depthLim(15, -0.5, 14.5);
207 if (bsubdet ==
"HB") {
209 }
else if (bsubdet ==
"HE") {
212 }
else if (bsubdet ==
"HF") {
214 pedLim =
HistLim(100, 0., 20.);
215 pedWidthLim =
HistLim(100, 0., 5.);
216 frac =
HistLim(400, -4.00, 4.00);
218 }
else if (bsubdet ==
"HO") {
220 gainLim =
HistLim(160, 0., 1.6);
227 else if (bsubdet ==
"HE")
229 else if (bsubdet ==
"HO")
231 else if (bsubdet ==
"HF")
234 edm::LogWarning(
"HcalDigisValidation") <<
"HcalDigisValidation Warning: not HB/HE/HF/HO " << bsubdet << std::endl;
237 const char* sub = bsubdet.c_str();
240 sprintf(histo,
"HcalDigiTask_Ndigis_%s", sub);
241 book1D(ib, histo, Ndigis);
245 sprintf(histo,
"HcalDigiTask_ieta_iphi_occupancy_map_depth%d_%s",
depth, sub);
246 book2D(ib, histo, ietaLim, iphiLim);
250 sprintf(histo,
"HcalDigiTask_depths_%s", sub);
251 book1D(ib, histo, depthLim);
255 sprintf(histo,
"HcalDigiTask_occupancy_vs_ieta_depth%d_%s",
depth, sub);
256 book1D(ib, histo, ietaLim);
260 sprintf(histo,
"HcalDigiTask_sum_all_amplitudes_%s", sub);
262 book1D(ib, histo, digiAmpWide);
264 book1D(ib, histo, digiAmp);
266 sprintf(histo,
"HcalDigiTask_number_of_amplitudes_above_10fC_%s", sub);
267 book1D(ib, histo, ndigis);
270 sprintf(histo,
"HcalDigiTask_ADC0_adc_depth%d_%s",
depth, sub);
271 book1D(ib, histo, pedestal);
275 sprintf(histo,
"HcalDigiTask_ADC0_fC_depth%d_%s",
depth, sub);
276 book1D(ib, histo, pedestalfC);
279 sprintf(histo,
"HcalDigiTask_signal_amplitude_%s", sub);
281 book1D(ib, histo, digiAmpWide);
283 book1D(ib, histo, digiAmp);
285 if (
hep17_ && bsubdet ==
"HE") {
286 sprintf(histo,
"HcalDigiTask_signal_amplitude_HEP17");
287 book1D(ib, histo, digiAmpWide);
291 sprintf(histo,
"HcalDigiTask_signal_amplitude_depth%d_%s",
depth, sub);
293 book1D(ib, histo, digiAmpWide);
295 book1D(ib, histo, digiAmp);
296 if (
hep17_ && bsubdet ==
"HE") {
297 sprintf(histo,
"HcalDigiTask_signal_amplitude_depth%d_HEP17",
depth);
298 book1D(ib, histo, digiAmpWide);
302 sprintf(histo,
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_%s", sub);
304 book2D(ib, histo, nbin, digiAmpWide);
306 book2D(ib, histo, nbin, digiAmp);
307 if (
hep17_ && bsubdet ==
"HE") {
308 sprintf(histo,
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_HEP17");
309 book2D(ib, histo, nbin, digiAmpWide);
313 sprintf(histo,
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth%d_%s",
depth, sub);
315 if (
hep17_ && bsubdet ==
"HE") {
316 sprintf(histo,
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth%d_HEP17",
depth);
321 sprintf(histo,
"HcalDigiTask_SOI_frac_%s", sub);
323 sprintf(histo,
"HcalDigiTask_postSOI_frac_%s", sub);
327 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_%s", sub);
328 book2D(ib, histo, sime, digiAmp);
330 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_depth%d_%s",
depth, sub);
331 book2D(ib, histo, sime, digiAmp);
334 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_%s", sub);
335 bookPf(ib, histo, sime, digiAmp);
337 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_depth%d_%s",
depth, sub);
338 bookPf(ib, histo, sime, digiAmp);
341 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_%s", sub);
344 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_depth%d_%s",
depth, sub);
355 sprintf(histo,
"HcalDigiTask_gain_capId0_Depth%d_%s",
depth, sub);
356 book1D(ib, histo, gainLim);
357 sprintf(histo,
"HcalDigiTask_gain_capId1_Depth%d_%s",
depth, sub);
358 book1D(ib, histo, gainLim);
359 sprintf(histo,
"HcalDigiTask_gain_capId2_Depth%d_%s",
depth, sub);
360 book1D(ib, histo, gainLim);
361 sprintf(histo,
"HcalDigiTask_gain_capId3_Depth%d_%s",
depth, sub);
362 book1D(ib, histo, gainLim);
364 sprintf(histo,
"HcalDigiTask_gainWidth_capId0_Depth%d_%s",
depth, sub);
365 book1D(ib, histo, gainWidthLim);
366 sprintf(histo,
"HcalDigiTask_gainWidth_capId1_Depth%d_%s",
depth, sub);
367 book1D(ib, histo, gainWidthLim);
368 sprintf(histo,
"HcalDigiTask_gainWidth_capId2_Depth%d_%s",
depth, sub);
369 book1D(ib, histo, gainWidthLim);
370 sprintf(histo,
"HcalDigiTask_gainWidth_capId3_Depth%d_%s",
depth, sub);
371 book1D(ib, histo, gainWidthLim);
373 sprintf(histo,
"HcalDigiTask_pedestal_capId0_Depth%d_%s",
depth, sub);
374 book1D(ib, histo, pedLim);
375 sprintf(histo,
"HcalDigiTask_pedestal_capId1_Depth%d_%s",
depth, sub);
376 book1D(ib, histo, pedLim);
377 sprintf(histo,
"HcalDigiTask_pedestal_capId2_Depth%d_%s",
depth, sub);
378 book1D(ib, histo, pedLim);
379 sprintf(histo,
"HcalDigiTask_pedestal_capId3_Depth%d_%s",
depth, sub);
380 book1D(ib, histo, pedLim);
382 sprintf(histo,
"HcalDigiTask_pedestal_width_capId0_Depth%d_%s",
depth, sub);
383 book1D(ib, histo, pedWidthLim);
384 sprintf(histo,
"HcalDigiTask_pedestal_width_capId1_Depth%d_%s",
depth, sub);
385 book1D(ib, histo, pedWidthLim);
386 sprintf(histo,
"HcalDigiTask_pedestal_width_capId2_Depth%d_%s",
depth, sub);
387 book1D(ib, histo, pedWidthLim);
388 sprintf(histo,
"HcalDigiTask_pedestal_width_capId3_Depth%d_%s",
depth, sub);
389 book1D(ib, histo, pedWidthLim);
394 sprintf(histo,
"HcalDigiTask_gainMap_Depth%d_%s",
depth, sub);
395 book2D(ib, histo, ietaLim, iphiLim);
396 sprintf(histo,
"HcalDigiTask_pwidthMap_Depth%d_%s",
depth, sub);
397 book2D(ib, histo, ietaLim, iphiLim);
484 int c = 0, chb = 0, che = 0, chf = 0, cv0 = 0, cv1 = 0, chfv0 = 0, chfv1 = 0;
490 int ieta = itr->id().ieta();
491 int iphi = itr->id().iphi();
499 else if (
abs(ieta) <= 42)
506 float en = decoder->
hcaletValue(itr->id(), itr->t0());
516 fill1D(
"HcalDigiTask_tp_et", en);
517 fill2D(
"HcalDigiTask_tp_et_ieta", ieta, en);
518 fill2D(
"HcalDigiTask_tp_ieta_iphi", ieta, iphi);
519 fillPf(
"HcalDigiTask_tp_ave_et_ieta", ieta, en);
520 fill1D(
"HcalDigiTask_tp_ntp_ieta", ieta);
521 fill1D(
"HcalDigiTask_tp_ntp_iphi", iphi);
523 fill1D(
"HcalDigiTask_tp_ntp_10_ieta", ieta);
527 fill1D(
"HcalDigiTask_tp_et_v0", en);
528 fill2D(
"HcalDigiTask_tp_et_ieta_v0", ieta, en);
529 fill2D(
"HcalDigiTask_tp_ieta_iphi_v0", ieta, iphi);
530 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v0", ieta, en);
531 fill1D(
"HcalDigiTask_tp_ntp_ieta_v0", ieta);
532 fill1D(
"HcalDigiTask_tp_ntp_iphi_v0", iphi);
534 fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v0", ieta);
539 fill1D(
"HcalDigiTask_tp_et_v1", en);
540 fill2D(
"HcalDigiTask_tp_et_ieta_v1", ieta, en);
541 fill2D(
"HcalDigiTask_tp_ieta_iphi_v1", ieta, iphi);
542 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v1", ieta, en);
543 fill1D(
"HcalDigiTask_tp_ntp_ieta_v1", ieta);
544 fill1D(
"HcalDigiTask_tp_ntp_iphi_v1", iphi);
546 fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v1", ieta);
551 fill1D(
"HcalDigiTask_tp_et_HB", en);
559 fill1D(
"HcalDigiTask_tp_et_HE", en);
567 fill1D(
"HcalDigiTask_tp_et_HF", en);
571 fill1D(
"HcalDigiTask_tp_et_HF_v0", en);
577 fill1D(
"HcalDigiTask_tp_et_HF_v1", en);
585 fill1D(
"HcalDigiTask_tp_ntp", c);
586 fill1D(
"HcalDigiTask_tp_ntp_HB", chb);
587 fill1D(
"HcalDigiTask_tp_ntp_HE", che);
588 fill1D(
"HcalDigiTask_tp_ntp_HF", chf);
590 fill1D(
"HcalDigiTask_tp_ntp_v0", cv0);
591 fill1D(
"HcalDigiTask_tp_ntp_v1", cv1);
592 fill1D(
"HcalDigiTask_tp_ntp_HF_v0", chfv0);
593 fill1D(
"HcalDigiTask_tp_ntp_HF_v1", chfv1);
599 template <
class Digi>
638 std::vector<double> v_ampl_c(
maxDepth_[isubdet] + 1, 0);
645 double emax_Sim = -9999.;
653 if (isubdet != 0 &&
noise_ == 0) {
655 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
657 unsigned int id_ =
simhits->id();
670 if (en > emax_Sim && sub == isubdet) {
675 if (
mode_ ==
"multi" && ((sub == 4 && en < 100. && en > 1.) || ((sub != 4) && en < 1. && en > 0.02))) {
684 if (
mode_ !=
"multi" && emax_Sim > 0.)
692 for (digiItr = digiCollection->begin(); digiItr != digiCollection->end(); digiItr++) {
694 int depth = cell.depth();
695 int iphi = cell.iphi();
696 int ieta = cell.ieta();
697 int sub = cell.subdet();
699 if (depth >
maxDepth_[isubdet] && sub == isubdet) {
700 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth
701 <<
", iphi: " << iphi <<
", ieta: " << ieta
702 <<
". Max depth from geometry is: " <<
maxDepth_[isubdet]
708 std::vector<double> v_ampl(
maxDepth_[isubdet] + 1, 0);
711 if (((
nevent1 == 1 && isubdet == 1) || (
nevent2 == 1 && isubdet == 2) || (
nevent3 == 1 && isubdet == 3) ||
712 (
nevent4 == 1 && isubdet == 4)) &&
713 noise_ == 1 && sub == isubdet) {
720 for (
int i = 0;
i < 4;
i++) {
723 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
741 if (sub == isubdet &&
noise_ == 0) {
747 coder.
adc2fC(*digiItr, tool);
751 int lastbin = tool.
size() - 1;
753 double noiseADC = (*digiItr)[0].adc();
754 double noisefC = tool[0];
756 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
760 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
769 if (ieta == ieta_Sim && iphi == iphi_Sim)
773 int capid = (*digiItr)[
ii].capid();
778 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
779 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
784 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
789 if (
ii >= soi &&
ii <= lastbin) {
803 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
804 fill1D(strtmp, v_ampl[0]);
806 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
807 double ampl_max = *std::max_element(v_ampl_sub.begin(), v_ampl_sub.end());
813 if (v_ampl[depth] > 30.) {
814 double fbinSOI = tool[soi] - calibrations.
pedestal((*digiItr)[soi].capid());
817 for (
int j = soi + 1;
j <= lastbin;
j++)
818 fbinPS += tool[
j] - calibrations.
pedestal((*digiItr)[
j].capid());
820 fbinSOI /= v_ampl[
depth];
821 fbinPS /= v_ampl[
depth];
822 strtmp =
"HcalDigiTask_SOI_frac_" +
subdet_;
824 strtmp =
"HcalDigiTask_postSOI_frac_" +
subdet_;
828 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
829 fill1D(strtmp, v_ampl[0]);
830 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
831 fill1D(strtmp, v_ampl[depth]);
835 if (isubdet != 0 &&
noise_ == 0) {
836 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
841 std::vector<double> v_ehits(
maxDepth_[isubdet] + 1, 0);
847 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
849 unsigned int id_ =
simhits->id();
861 if (depth >
maxDepth_[isubdet] && sub == isubdet) {
862 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth
863 <<
", iphi: " << iphi <<
", ieta: " << ieta
864 <<
". Max depth from geometry is: " <<
maxDepth_[isubdet]
870 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
874 v_ehits[
depth] += en;
878 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
879 if (v_ehits[0] > eps)
880 fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
882 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
883 if (v_ehits[
depth] > eps)
887 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
888 if (v_ehits[0] > eps)
889 fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
891 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
892 if (v_ehits[
depth] > eps)
896 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
897 if (v_ehits[0] > eps)
898 fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
900 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
901 if (v_ehits[
depth] > eps)
903 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
904 if (v_ehits[depth] > eps)
905 fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
910 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
911 fill1D(strtmp,
double(Ndig));
915 template <
class dataFrameType>
955 std::vector<double> v_ampl_c(
maxDepth_[isubdet] + 1, 0);
962 double emax_Sim = -9999.;
970 if (isubdet != 0 &&
noise_ == 0) {
972 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
974 unsigned int id_ =
simhits->id();
987 if (en > emax_Sim && sub == isubdet) {
992 if (
mode_ ==
"multi" && ((sub == 4 && en < 100. && en > 1.) || ((sub != 4) && en < 1. && en > 0.02))) {
1001 if (
mode_ !=
"multi" && emax_Sim > 0.)
1010 digiItr != digiCollection->
end();
1012 dataFrameType dataFrame = *digiItr;
1015 int depth = cell.depth();
1016 int iphi = cell.iphi();
1017 int ieta = cell.ieta();
1018 int sub = cell.subdet();
1021 bool isHEP17 = (iphi >= 63) && (iphi <= 66) && (ieta > 0) && (sub == 2);
1023 if (depth >
maxDepth_[isubdet] && sub == isubdet) {
1024 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth
1025 <<
", iphi: " << iphi <<
", ieta: " << ieta
1026 <<
". Max depth from geometry is: " <<
maxDepth_[isubdet]
1032 std::vector<double> v_ampl(
maxDepth_[isubdet] + 1, 0);
1035 if (((
nevent1 == 1 && isubdet == 1) || (
nevent2 == 1 && isubdet == 2) || (
nevent3 == 1 && isubdet == 3) ||
1036 (
nevent4 == 1 && isubdet == 4)) &&
1037 noise_ == 1 && sub == isubdet) {
1044 for (
int i = 0;
i < 4;
i++) {
1047 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
1066 if (sub == isubdet &&
noise_ == 0) {
1072 coder.
adc2fC(dataFrame, tool);
1076 int lastbin = tool.
size() - 1;
1078 double noiseADC = (dataFrame)[0].
adc();
1079 double noisefC = tool[0];
1081 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1082 fill1D(
"HcalDigiTask_ADC0_fC_depth" +
str(depth) +
"_" +
subdet_, noisefC);
1085 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
1094 if (ieta == ieta_Sim && iphi == iphi_Sim)
1095 closen = seedSimHit;
1098 int capid = (dataFrame)[
ii].capid();
1103 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1106 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1109 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_HEP17";
1113 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1121 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1124 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_HEP17";
1128 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1134 if (
ii >= soi &&
ii <= lastbin) {
1147 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
1148 fill1D(strtmp, v_ampl[0]);
1150 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
1151 double ampl_max = *std::max_element(v_ampl_sub.begin(), v_ampl_sub.end());
1158 if ((v_ampl[depth] > 30. && (
subdet_ !=
"HE" ||
subdet_ !=
"HB")) ||
1159 (v_ampl[
depth] > 300.)) {
1160 double fbinSOI = tool[soi] - calibrations.
pedestal((dataFrame)[soi].capid());
1163 for (
int j = soi + 1;
j <= lastbin;
j++)
1164 fbinPS += tool[
j] - calibrations.
pedestal((dataFrame)[
j].capid());
1166 fbinSOI /= v_ampl[
depth];
1167 fbinPS /= v_ampl[
depth];
1168 strtmp =
"HcalDigiTask_SOI_frac_" +
subdet_;
1170 strtmp =
"HcalDigiTask_postSOI_frac_" +
subdet_;
1176 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1177 fill1D(strtmp, v_ampl[0]);
1178 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1179 fill1D(strtmp, v_ampl[depth]);
1181 strtmp =
"HcalDigiTask_signal_amplitude_HEP17";
1182 fill1D(strtmp, v_ampl[0]);
1183 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_HEP17";
1184 fill1D(strtmp, v_ampl[depth]);
1187 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1188 fill1D(strtmp, v_ampl[0]);
1189 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1190 fill1D(strtmp, v_ampl[depth]);
1195 if (isubdet != 0 &&
noise_ == 0) {
1196 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
1201 std::vector<double> v_ehits(
maxDepth_[isubdet] + 1, 0);
1207 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
1209 unsigned int id_ =
simhits->id();
1217 depth = hid.
depth();
1221 if (depth >
maxDepth_[isubdet] && sub == isubdet) {
1222 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth
1223 <<
", iphi: " << iphi <<
", ieta: " << ieta
1224 <<
". Max depth from geometry is: " <<
maxDepth_[isubdet]
1230 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
1231 double en =
simhits->energy();
1234 v_ehits[
depth] += en;
1238 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
1239 if (v_ehits[0] > eps)
1240 fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
1242 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
1243 if (v_ehits[
depth] > eps)
1247 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
1248 if (v_ehits[0] > eps)
1249 fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
1251 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1252 if (v_ehits[
depth] > eps)
1256 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
1257 if (v_ehits[0] > eps)
1258 fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
1260 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1261 if (v_ehits[
depth] > eps)
1263 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
1264 if (v_ehits[depth] > eps)
1265 fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
1270 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
1271 fill1D(strtmp,
double(Ndig));
1278 if (!
msm_->count(name))
1283 if (!
msm_->count(name))
1288 msm_->find(name)->second->Fill(X, weight);
1292 if (!
msm_->count(name))
1297 msm_->find(name)->second->Fill(X, Y, weight);
1301 if (!
msm_->count(name))
1307 if (!
msm_->count(name))
1315 if (!
msm_->count(name))
1318 return msm_->find(name)->second;
1322 std::stringstream
out;
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
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
edm::EDGetTokenT< HODigiCollection > tok_ho_
std::vector< PCaloHit > PCaloHitContainer
HcalSubdetector subdet() const
get the subdetector
unsigned int getHxSize(const int type) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
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
edm::EDGetTokenT< QIE11DigiCollection > tok_qie11_hbhe_
float getValue(int fCapId) const
get value for capId = 0..3
float getValue(int fCapId) const
get value for capId = 0..3
void analyze(const edm::Event &, const edm::EventSetup &) override
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
int depth() const
get the tower depth
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
#define DEFINE_FWK_MODULE(type)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
~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
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)
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
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_
std::map< std::string, MonitorElement * > * msm_
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)
int size() const
get the size
edm::EDGetTokenT< edm::PCaloHitContainer > tok_mc_
MonitorElement * monitor(std::string name)
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_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
const_iterator end() const
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_dataTPs_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
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
edm::EDGetTokenT< QIE10DigiCollection > tok_qie10_hf_
const HcalPedestal * getPedestal(const HcalGenericDetId &fId) const
const_iterator begin() const
edm::EDGetTokenT< HFDigiCollection > tok_hf_
int firstHFTower(int version) const