41 if (iConfig.
exists(
"simHits"))
64 msm_ =
new std::map<std::string, MonitorElement*>();
67 else edm::LogInfo(
"OutputInfo") <<
" Hcal Digi Task histograms will NOT be saved";
117 book1D(ib,
"nevtot", 1, 0, 1);
120 if (
subdet_ ==
"noise") bnoise = 1;
121 if (
mc_ ==
"yes") bmc = 1;
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(72,-0.5,71.5);
140 book1D(ib,
"HcalDigiTask_tp_et", tp_hl_et);
141 book1D(ib,
"HcalDigiTask_tp_et_v0", tp_hl_et);
142 book1D(ib,
"HcalDigiTask_tp_et_v1", tp_hl_et);
143 book1D(ib,
"HcalDigiTask_tp_et_HB", tp_hl_et);
144 book1D(ib,
"HcalDigiTask_tp_et_HE", tp_hl_et);
145 book1D(ib,
"HcalDigiTask_tp_et_HF", tp_hl_et);
146 book1D(ib,
"HcalDigiTask_tp_et_HF_v0", tp_hl_et);
147 book1D(ib,
"HcalDigiTask_tp_et_HF_v1", tp_hl_et);
148 book1D(ib,
"HcalDigiTask_tp_ntp", tp_hl_ntp);
149 book1D(ib,
"HcalDigiTask_tp_ntp_v0", tp_hl_ntp);
150 book1D(ib,
"HcalDigiTask_tp_ntp_v1", tp_hl_ntp);
151 book1D(ib,
"HcalDigiTask_tp_ntp_HB", tp_hl_ntp_sub);
152 book1D(ib,
"HcalDigiTask_tp_ntp_HE", tp_hl_ntp_sub);
153 book1D(ib,
"HcalDigiTask_tp_ntp_HF", tp_hl_ntp_sub);
154 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v0", tp_hl_ntp_sub);
155 book1D(ib,
"HcalDigiTask_tp_ntp_HF_v1", tp_hl_ntp_sub);
156 book1D(ib,
"HcalDigiTask_tp_ntp_ieta", tp_hl_ieta);
157 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v0", tp_hl_ieta);
158 book1D(ib,
"HcalDigiTask_tp_ntp_ieta_v1", tp_hl_ieta);
159 book1D(ib,
"HcalDigiTask_tp_ntp_iphi", tp_hl_iphi);
160 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v0", tp_hl_iphi);
161 book1D(ib,
"HcalDigiTask_tp_ntp_iphi_v1", tp_hl_iphi);
162 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta", tp_hl_ieta);
163 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v0", tp_hl_ieta);
164 book1D(ib,
"HcalDigiTask_tp_ntp_10_ieta_v1", tp_hl_ieta);
165 book2D(ib,
"HcalDigiTask_tp_et_ieta", tp_hl_ieta, tp_hl_et);
166 book2D(ib,
"HcalDigiTask_tp_et_ieta_v0", tp_hl_ieta, tp_hl_et);
167 book2D(ib,
"HcalDigiTask_tp_et_ieta_v1", tp_hl_ieta, tp_hl_et);
168 book2D(ib,
"HcalDigiTask_tp_ieta_iphi", tp_hl_ieta, tp_hl_iphi);
169 book2D(ib,
"HcalDigiTask_tp_ieta_iphi_v0", tp_hl_ieta, tp_hl_iphi);
170 book2D(ib,
"HcalDigiTask_tp_ieta_iphi_v1", tp_hl_ieta, tp_hl_iphi);
171 bookPf(ib,
"HcalDigiTask_tp_ave_et_ieta", tp_hl_ieta, tp_hl_et,
" ");
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,
" ");
181 HistLim Ndigis(2600, 0., 2600.);
182 HistLim ndigis(520, -20., 1020.);
185 HistLim digiAmp(360, -100., 7100.);
186 HistLim ratio(2000, -100., 3900.);
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);
225 if (bsubdet==
"HB") isubdet=1;
226 else if (bsubdet==
"HE") isubdet=2;
227 else if (bsubdet==
"HO") isubdet=3;
228 else if (bsubdet==
"HF") isubdet=4;
229 else edm::LogWarning(
"HcalDigisValidation") <<
"HcalDigisValidation Warning: not HB/HE/HF/HO " << bsubdet << std::endl;
232 const char * sub = bsubdet.c_str();
235 sprintf(histo,
"HcalDigiTask_Ndigis_%s", sub);
236 book1D(ib, histo, Ndigis);
240 sprintf(histo,
"HcalDigiTask_ieta_iphi_occupancy_map_depth%d_%s",
depth, sub);
241 book2D(ib, histo, ietaLim, iphiLim);
245 sprintf(histo,
"HcalDigiTask_depths_%s",sub);
246 book1D(ib,histo, depthLim);
250 sprintf(histo,
"HcalDigiTask_occupancy_vs_ieta_depth%d_%s",
depth, sub);
251 book1D(ib, histo, ietaLim);
256 sprintf(histo,
"HcalDigiTask_sum_all_amplitudes_%s", sub);
257 book1D(ib, histo, sumAmp);
259 sprintf(histo,
"HcalDigiTask_number_of_amplitudes_above_10fC_%s", sub);
260 book1D(ib, histo, ndigis);
263 sprintf(histo,
"HcalDigiTask_ADC0_adc_depth%d_%s",
depth, sub);
264 book1D(ib, histo, pedestal);
268 sprintf(histo,
"HcalDigiTask_ADC0_fC_depth%d_%s",
depth, sub);
269 book1D(ib, histo, pedestalfC);
272 sprintf(histo,
"HcalDigiTask_signal_amplitude_%s", sub);
273 book1D(ib, histo, digiAmp);
276 sprintf(histo,
"HcalDigiTask_signal_amplitude_depth%d_%s",
depth, sub);
277 book1D(ib, histo, digiAmp);
280 sprintf(histo,
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_%s", sub);
281 book2D(ib, histo, nbin, digiAmp);
284 sprintf(histo,
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth%d_%s",
depth, sub);
288 sprintf(histo,
"HcalDigiTask_bin_5_frac_%s", sub);
290 sprintf(histo,
"HcalDigiTask_bin_6_7_frac_%s", sub);
294 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_%s", sub);
295 book2D(ib, histo, sime, digiAmp);
297 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_depth%d_%s",
depth, sub);
298 book2D(ib, histo, sime, digiAmp);
301 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_%s", sub);
302 bookPf(ib, histo, sime, digiAmp);
304 sprintf(histo,
"HcalDigiTask_amplitude_vs_simhits_profile_depth%d_%s",
depth, sub);
305 bookPf(ib, histo, sime, digiAmp);
308 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_%s", sub);
311 sprintf(histo,
"HcalDigiTask_ratio_amplitude_vs_simhits_depth%d_%s",
depth, sub);
322 sprintf(histo,
"HcalDigiTask_gain_capId0_Depth%d_%s",
depth, sub);
323 book1D(ib, histo, gainLim);
324 sprintf(histo,
"HcalDigiTask_gain_capId1_Depth%d_%s",
depth, sub);
325 book1D(ib, histo, gainLim);
326 sprintf(histo,
"HcalDigiTask_gain_capId2_Depth%d_%s",
depth, sub);
327 book1D(ib, histo, gainLim);
328 sprintf(histo,
"HcalDigiTask_gain_capId3_Depth%d_%s",
depth, sub);
329 book1D(ib, histo, gainLim);
331 sprintf(histo,
"HcalDigiTask_gainWidth_capId0_Depth%d_%s",
depth, sub);
332 book1D(ib, histo, gainWidthLim);
333 sprintf(histo,
"HcalDigiTask_gainWidth_capId1_Depth%d_%s",
depth, sub);
334 book1D(ib, histo, gainWidthLim);
335 sprintf(histo,
"HcalDigiTask_gainWidth_capId2_Depth%d_%s",
depth, sub);
336 book1D(ib, histo, gainWidthLim);
337 sprintf(histo,
"HcalDigiTask_gainWidth_capId3_Depth%d_%s",
depth, sub);
338 book1D(ib, histo, gainWidthLim);
340 sprintf(histo,
"HcalDigiTask_pedestal_capId0_Depth%d_%s",
depth, sub);
341 book1D(ib, histo, pedLim);
342 sprintf(histo,
"HcalDigiTask_pedestal_capId1_Depth%d_%s",
depth, sub);
343 book1D(ib, histo, pedLim);
344 sprintf(histo,
"HcalDigiTask_pedestal_capId2_Depth%d_%s",
depth, sub);
345 book1D(ib, histo, pedLim);
346 sprintf(histo,
"HcalDigiTask_pedestal_capId3_Depth%d_%s",
depth, sub);
347 book1D(ib, histo, pedLim);
349 sprintf(histo,
"HcalDigiTask_pedestal_width_capId0_Depth%d_%s",
depth, sub);
350 book1D(ib, histo, pedWidthLim);
351 sprintf(histo,
"HcalDigiTask_pedestal_width_capId1_Depth%d_%s",
depth, sub);
352 book1D(ib, histo, pedWidthLim);
353 sprintf(histo,
"HcalDigiTask_pedestal_width_capId2_Depth%d_%s",
depth, sub);
354 book1D(ib, histo, pedWidthLim);
355 sprintf(histo,
"HcalDigiTask_pedestal_width_capId3_Depth%d_%s",
depth, sub);
356 book1D(ib, histo, pedWidthLim);
362 sprintf(histo,
"HcalDigiTask_gainMap_Depth%d_%s",
depth, sub);
363 book2D(ib, histo, ietaLim, iphiLim);
364 sprintf(histo,
"HcalDigiTask_pwidthMap_Depth%d_%s",
depth, sub);
365 book2D(ib, histo, ietaLim, iphiLim);
445 int c = 0, cv0 = 0, cv1 = 0, chb = 0, che = 0, chf = 0, chfv0 = 0, chfv1 = 0;
450 int ieta = itr->id().ieta();
451 int iphi = itr->id().iphi();
456 if (
abs(ieta) <= 16 )
458 else if (
abs(ieta) < tp_geometry->firstHFTower(itr->id().version()) )
460 else if (
abs(ieta) <= 42 )
467 float en = decoder->hcaletValue(itr->id(), itr->t0());
469 if (en < 0.00001)
continue;
476 fill1D(
"HcalDigiTask_tp_et",en);
477 fill2D(
"HcalDigiTask_tp_et_ieta",ieta,en);
478 fill2D(
"HcalDigiTask_tp_ieta_iphi",ieta,iphi);
479 fillPf(
"HcalDigiTask_tp_ave_et_ieta",ieta,en);
480 fill1D(
"HcalDigiTask_tp_ntp_ieta",ieta);
481 fill1D(
"HcalDigiTask_tp_ntp_iphi",iphi);
482 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta",ieta);
486 fill1D(
"HcalDigiTask_tp_et_v0",en);
487 fill2D(
"HcalDigiTask_tp_et_ieta_v0",ieta,en);
488 fill2D(
"HcalDigiTask_tp_ieta_iphi_v0",ieta,iphi);
489 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v0",ieta,en);
490 fill1D(
"HcalDigiTask_tp_ntp_ieta_v0",ieta);
491 fill1D(
"HcalDigiTask_tp_ntp_iphi_v0",iphi);
492 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v0",ieta);
497 fill1D(
"HcalDigiTask_tp_et_v1",en);
498 fill2D(
"HcalDigiTask_tp_et_ieta_v1",ieta,en);
499 fill2D(
"HcalDigiTask_tp_ieta_iphi_v1",ieta,iphi);
500 fillPf(
"HcalDigiTask_tp_ave_et_ieta_v1",ieta,en);
501 fill1D(
"HcalDigiTask_tp_ntp_ieta_v1",ieta);
502 fill1D(
"HcalDigiTask_tp_ntp_iphi_v1",iphi);
503 if ( en > 10. )
fill1D(
"HcalDigiTask_tp_ntp_10_ieta_v1",ieta);
508 fill1D(
"HcalDigiTask_tp_et_HB",en);
514 fill1D(
"HcalDigiTask_tp_et_HE",en);
520 fill1D(
"HcalDigiTask_tp_et_HF",en);
524 fill1D(
"HcalDigiTask_tp_et_HF_v0",en);
530 fill1D(
"HcalDigiTask_tp_et_HF_v1",en);
539 fill1D(
"HcalDigiTask_tp_ntp",
c);
540 fill1D(
"HcalDigiTask_tp_ntp_v0",cv0);
541 fill1D(
"HcalDigiTask_tp_ntp_v1",cv1);
542 fill1D(
"HcalDigiTask_tp_ntp_HB",chb);
543 fill1D(
"HcalDigiTask_tp_ntp_HE",che);
544 fill1D(
"HcalDigiTask_tp_ntp_HF",chf);
545 fill1D(
"HcalDigiTask_tp_ntp_HF_v0",chfv0);
546 fill1D(
"HcalDigiTask_tp_ntp_HF_v1",chfv1);
569 if (
subdet_ ==
"HB") isubdet = 1;
570 if (
subdet_ ==
"HE") isubdet = 2;
571 if (
subdet_ ==
"HO") isubdet = 3;
572 if (
subdet_ ==
"HF") isubdet = 4;
581 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
588 double emax_Sim = -9999.;
597 if (isubdet != 0 &&
noise_ == 0) {
599 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
601 unsigned int id_ = simhits->id();
602 int sub,
depth, ieta, iphi;
606 int sign = (z==0) ? (-1):(1);
616 double en = simhits->energy();
618 if (en > emax_Sim && sub == isubdet) {
623 if (
mode_ ==
"multi" &&
624 ((sub == 4 && en < 100. && en > 1.)
625 || ((sub != 4) && en < 1. && en > 0.02))) {
635 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
645 int depth = cell.depth();
646 int iphi = cell.iphi();
647 int ieta = cell.ieta();
648 int sub = cell.subdet();
650 if(depth >
maxDepth_[isubdet] && sub == isubdet){
651 edm::LogWarning(
"HcalDetId") <<
"HcalDetID presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
656 std::vector<double> v_ampl(
maxDepth_[isubdet]+1,0);
659 if (((
nevent1 == 1 && isubdet == 1) ||
660 (
nevent2 == 1 && isubdet == 2) ||
661 (
nevent3 == 1 && isubdet == 3) ||
662 (
nevent4 == 1 && isubdet == 4)) &&
noise_ == 1 && sub == isubdet) {
670 for (
int i = 0;
i < 4;
i++) {
673 fill1D(
"HcalDigiTask_pedestal_capId" +
str(
i) +
"_Depth" +
str(depth) +
"_" +
subdet_, pedestal->getValue(
i));
678 fill2D(
"HcalDigiTask_pwidthMap_Depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi), pedWidth->
getWidth(0));
682 if (sub == isubdet) Ndig++;
686 if (sub == isubdet &&
noise_ == 0) {
693 coder.
adc2fC(*digiItr, tool);
695 double noiseADC = (*digiItr)[0].adc();
696 double noisefC = tool[0];
698 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
703 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
713 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
715 for (
int ii = 0;
ii < tool.size();
ii++) {
716 int capid = (*digiItr)[
ii].capid();
721 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
722 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
727 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
733 if (isubdet != 4 &&
ii >= 4 &&
ii <= 7) {
744 if (isubdet == 4 &&
ii >= 2 &&
ii <= 4) {
757 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
758 fill1D(strtmp, v_ampl[0]);
760 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
761 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
762 if (ampl_max>10.) indigis++;
766 if (v_ampl[1] > 30. && depth == 1 && closen == 1 && isubdet != 4) {
767 double fBin5 = tool[4] - calibrations.
pedestal((*digiItr)[4].capid());
768 double fBin67 = tool[5] + tool[6]
769 - calibrations.
pedestal((*digiItr)[5].capid())
770 - calibrations.
pedestal((*digiItr)[6].capid());
775 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
777 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
783 if (isubdet == 4 && v_ampl[1] > 30. && depth == 1) {
784 double fBin5 = tool[2] - calibrations.
pedestal((*digiItr)[2].capid());
785 double fBin67 = tool[3] + tool[4]
786 - calibrations.
pedestal((*digiItr)[3].capid())
787 - calibrations.
pedestal((*digiItr)[4].capid());
790 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
792 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
796 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
797 fill1D(strtmp, v_ampl[0]);
798 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
799 fill1D(strtmp, v_ampl[depth]);
803 if (isubdet != 0 &&
noise_ == 0) {
804 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
809 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
815 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
817 unsigned int id_ = simhits->id();
818 int sub,
depth, ieta, iphi;
822 int sign = (z==0) ? (-1):(1);
832 if(depth >
maxDepth_[isubdet] && sub == isubdet){
833 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
839 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
840 double en = simhits->energy();
843 v_ehits[
depth] += en;
848 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
849 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
851 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
855 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
856 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
858 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
862 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
863 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
865 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
867 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
868 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
874 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
875 fill1D(strtmp,
double(Ndig));
897 if (!digiHandle.isValid())
return;
900 if (
subdet_ ==
"HB") isubdet = 1;
901 if (
subdet_ ==
"HE") isubdet = 2;
902 if (
subdet_ ==
"HO") isubdet = 3;
903 if (
subdet_ ==
"HF") isubdet = 4;
912 std::vector<double> v_ampl_c(
maxDepth_[isubdet]+1,0);
919 double emax_Sim = -9999.;
928 if (isubdet != 0 &&
noise_ == 0) {
930 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
932 unsigned int id_ = simhits->id();
933 int sub,
depth, ieta, iphi;
937 int sign = (z==0) ? (-1):(1);
947 double en = simhits->energy();
949 if (en > emax_Sim && sub == isubdet) {
954 if (
mode_ ==
"multi" &&
955 ((sub == 4 && en < 100. && en > 1.)
956 || ((sub != 4) && en < 1. && en > 0.02))) {
966 if (
mode_ !=
"multi" && emax_Sim > 0.) seedSimHit = 1;
975 dataFrameType dataFrame = *digiItr;
978 int depth = cell.depth();
979 int iphi = cell.iphi();
980 int ieta = cell.ieta();
981 int sub = cell.subdet();
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);
1029 double noiseADC = (dataFrame)[0].
adc();
1030 double noisefC = tool[0];
1032 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1033 fill1D(
"HcalDigiTask_ADC0_fC_depth" +
str(depth) +
"_" +
subdet_, noisefC);
1037 fill2D(
"HcalDigiTask_ieta_iphi_occupancy_map_depth" +
str(depth) +
"_" +
subdet_,
double(ieta),
double(iphi));
1047 if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
1049 for (
int ii = 0;
ii < tool.size();
ii++) {
1050 int capid = (dataFrame)[
ii].capid();
1055 fill1D(
"HcalDigiTask_ADC0_adc_depth" +
str(depth) +
"_" +
subdet_, noiseADC);
1056 strtmp =
"HcalDigiTask_all_amplitudes_vs_bin_1D_depth" +
str(depth) +
"_" +
subdet_;
1061 strtmp =
"HcalDigiTask_signal_amplitude_vs_bin_all_depths_" +
subdet_;
1067 if (isubdet != 4 &&
ii >= 4 &&
ii <= 7) {
1078 if (isubdet == 4 &&
ii >= 2 &&
ii <= 4) {
1090 strtmp =
"HcalDigiTask_sum_all_amplitudes_" +
subdet_;
1091 fill1D(strtmp, v_ampl[0]);
1093 std::vector<int> v_ampl_sub(v_ampl.begin() + 1, v_ampl.end());
1094 double ampl_max = *std::max_element(v_ampl_sub.begin(),v_ampl_sub.end());
1095 if (ampl_max>10.) indigis++;
1099 if (v_ampl[1] > 30. && depth == 1 && closen == 1 && isubdet != 4) {
1100 double fBin5 = tool[4] - calibrations.
pedestal((dataFrame)[4].capid());
1101 double fBin67 = tool[5] + tool[6]
1102 - calibrations.
pedestal((dataFrame)[5].capid())
1103 - calibrations.
pedestal((dataFrame)[6].capid());
1106 fBin67 /= v_ampl[1];
1108 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
1110 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
1116 if (isubdet == 4 && v_ampl[1] > 30. && depth == 1) {
1117 double fBin5 = tool[2] - calibrations.
pedestal((dataFrame)[2].capid());
1118 double fBin67 = tool[3] + tool[4]
1119 - calibrations.
pedestal((dataFrame)[3].capid())
1120 - calibrations.
pedestal((dataFrame)[4].capid());
1122 fBin67 /= v_ampl[1];
1123 strtmp =
"HcalDigiTask_bin_5_frac_" +
subdet_;
1125 strtmp =
"HcalDigiTask_bin_6_7_frac_" +
subdet_;
1129 strtmp =
"HcalDigiTask_signal_amplitude_" +
subdet_;
1130 fill1D(strtmp, v_ampl[0]);
1131 strtmp =
"HcalDigiTask_signal_amplitude_depth" +
str(depth) +
"_" +
subdet_;
1132 fill1D(strtmp, v_ampl[depth]);
1136 if (isubdet != 0 &&
noise_ == 0) {
1137 strtmp =
"HcalDigiTask_number_of_amplitudes_above_10fC_" +
subdet_;
1142 std::vector<double> v_ehits(
maxDepth_[isubdet]+1,0);
1148 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
1150 unsigned int id_ = simhits->id();
1151 int sub,
depth, ieta, iphi;
1155 int sign = (z==0) ? (-1):(1);
1165 if(depth >
maxDepth_[isubdet] && sub == isubdet){
1166 edm::LogWarning(
"HcalDetId") <<
"HcalDetID(SimHit) presents conflicting information. Depth: " << depth <<
", iphi: " << iphi <<
", ieta: " << ieta <<
". Max depth from geometry is: " <<
maxDepth_[isubdet] <<
". TestNumber = " <<
testNumber_;
1172 if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
1173 double en = simhits->energy();
1176 v_ehits[
depth] += en;
1181 strtmp =
"HcalDigiTask_amplitude_vs_simhits_" +
subdet_;
1182 if (v_ehits[0] > eps)
fill2D(strtmp, v_ehits[0], v_ampl_c[0]);
1184 strtmp =
"HcalDigiTask_amplitude_vs_simhits_depth" +
str(
depth) +
"_" +
subdet_;
1188 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_" +
subdet_;
1189 if (v_ehits[0] > eps)
fillPf(strtmp, v_ehits[0], v_ampl_c[0]);
1191 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1195 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_" +
subdet_;
1196 if (v_ehits[0] > eps)
fill1D(strtmp, v_ampl_c[0] / v_ehits[0]);
1198 strtmp =
"HcalDigiTask_amplitude_vs_simhits_profile_depth" +
str(
depth) +
"_" +
subdet_;
1200 strtmp =
"HcalDigiTask_ratio_amplitude_vs_simhits_depth" +
str(depth) +
"_" +
subdet_;
1201 if (v_ehits[depth] > eps)
fill1D(strtmp, v_ampl_c[depth] / v_ehits[depth]);
1207 strtmp =
"HcalDigiTask_Ndigis_" +
subdet_;
1208 fill1D(strtmp,
double(Ndig));
1223 msm_->find(name)->second->Fill(X, weight);
1231 msm_->find(name)->second->Fill(X, Y, weight);
1243 msm_->find(name)->second->Fill(X, Y);
1247 if (!
msm_->count(name))
return NULL;
1248 else return msm_->find(name)->second;
1252 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
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)