51 ib.setCurrentFolder(
"ZDCValidation");
64 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits");
65 meAllZdcNHit_ =
ib.book1D(
"ZDC Hits",
"Number of All Hits in ZDC", 100, 0., 100.);
69 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Debug_Helper");
70 meBadZdcDetHit_ =
ib.book1D(
"Hiits with the wrong Det",
"Hits with wrong Det in ZDC", 100, 0., 100.);
74 meBadZdcSecHit_ =
ib.book1D(
"Wrong Section Hits",
"Hits with wrong Section in ZDC", 100, 0., 100.);
78 meBadZdcIdHit_ =
ib.book1D(
"Wrong_ID_Hits",
"Hits with wrong ID in ZDC", 100, 0., 100.);
82 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo");
83 meZdcNHitEM_ =
ib.book1D(
"Hits in EM",
"Number of Hits in ZDC EM", 100, 0., 100.);
87 meZdcNHitHad_ =
ib.book1D(
"Hits in HAD",
"Number of Hits in ZDC Had", 100, 0., 100.);
91 meZdcNHitLum_ =
ib.book1D(
"Hits in LUM",
"Number of Hits in ZDC Lum", 100, 0., 100.);
111 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/");
116 meZdcHadEnergyHit_ =
ib.book1D(
"Hit Energy HAD",
"Hits Energy in Had Section", 4000, 0., 8000.);
120 meZdcEMEnergyHit_ =
ib.book1D(
"Hit Energy EM",
"Hits Energy in EM Section", 4000, 0., 8000.);
124 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo");
125 meZdcTimeHit_ =
ib.book1D(
"Time in ZDC",
"Time in ZDC", 300, 0., 600.);
129 meZdcTimeWHit_ =
ib.book1D(
"Energy Weighted Time in ZDC",
"Time in ZDC (E wtd)", 300, 0., 600.);
133 meZdc10Ene_ =
ib.book1D(
"ZDC Log(E)",
"Log10Energy in ZDC", 140, -20., 20.);
138 "Log(EHAD) vs Contribution",
"Log10Energy in Had ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1.);
143 "Log(EEM) vs Contribution",
"Log10Energy in EM ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1.);
147 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits");
148 meZdcEHadCh_ =
ib.book2D(
"ZDC EHAD vs Channel",
"ZDC Had Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6.);
152 meZdcEEMCh_ =
ib.book2D(
"ZDC EEM vs Channel",
"ZDC EM Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6.);
156 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo");
157 meZdcETime_ =
ib.book2D(
"E vs T",
"Hits ZDC Energy vs Time", 4000, 0., 8000., 300, 0., 600.);
161 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/NZDC");
162 meZdcEneEmN1_ =
ib.book1D(
"NZDC EM1 Energy",
"Energy EM module N1", 4000, 0., 8000.);
166 meZdcEneEmN2_ =
ib.book1D(
"NZDC EM2 Energy",
"Energy EM module N2", 4000, 0., 8000.);
170 meZdcEneEmN3_ =
ib.book1D(
"NZDC EM3 Energy",
"Energy EM module N3", 4000, 0., 8000.);
174 meZdcEneEmN4_ =
ib.book1D(
"NZDC EM4 Energy",
"Energy EM module N4", 4000, 0., 8000.);
178 meZdcEneEmN5_ =
ib.book1D(
"NZDC EM5 Energy",
"Energy EM module N5", 4000, 0., 8000.);
182 meZdcEneHadN1_ =
ib.book1D(
"NZDC HAD1 Energy",
"Energy HAD module N1", 4000, 0., 8000.);
186 meZdcEneHadN2_ =
ib.book1D(
"NZDC HAD2 Energy",
"Energy HAD module N2", 4000, 0., 8000.);
190 meZdcEneHadN3_ =
ib.book1D(
"NZDC HAD3 Energy",
"Energy HAD module N3", 4000, 0., 8000.);
194 meZdcEneHadN4_ =
ib.book1D(
"NZDC HAD4 Energy",
"Energy HAD module N4", 4000, 0., 8000.);
198 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/NZDC");
199 meZdcEneTEmN1_ =
ib.book2D(
"NZDC EM1 Energy vs Time",
"Energy EM mod N1 vs Time", 4000, 0., 8000., 300, 0., 600.);
203 meZdcEneTEmN2_ =
ib.book2D(
"NZDC EM2 Energy vs Time",
"Energy EM mod N2 vs Time", 4000, 0., 8000., 300, 0., 600.);
207 meZdcEneTEmN3_ =
ib.book2D(
"NZDC EM3 Energy vs Time",
"Energy EM mod N3 vs Time", 4000, 0., 8000., 300, 0., 600.);
211 meZdcEneTEmN4_ =
ib.book2D(
"NZDC EM4 Energy vs Time",
"Energy EM mod N4 vs Time", 4000, 0., 8000., 300, 0., 600.);
215 meZdcEneTEmN5_ =
ib.book2D(
"NZDC EM5 Energy vs Time",
"Energy EM mod N5 vs Time", 4000, 0., 8000., 300, 0., 600.);
220 ib.book2D(
"NZDC HAD1 Energy vs Time",
"Energy HAD mod N1 vs Time", 4000, 0., 8000., 300, 0., 600.);
225 ib.book2D(
"NZDC HAD2 Energy vs Time",
"Energy HAD mod N2 vs Time", 4000, 0., 8000., 300, 0., 600.);
230 ib.book2D(
"NZDC HAD3 Energy vs Time",
"Energy HAD mod N3 vs Time", 4000, 0., 8000., 300, 0., 600.);
235 ib.book2D(
"NZDC HAD4 Energy vs Time",
"Energy HAD mod N4 vs Time", 4000, 0., 8000., 300, 0., 600.);
239 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/NZDC");
244 meZdcEneEmNTot_ =
ib.book1D(
"NZDC EEM",
"Total N-ZDC EM Energy", 3000, 0., 3000.);
248 meZdcEneNTot_ =
ib.book1D(
"NZDC ETOT",
"Total N-ZDC Energy ", 7000, 0., 7000.);
252 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/PZDC");
253 meZdcEneEmP1_ =
ib.book1D(
"PZDC EM1 Energy",
"Energy EM module P1", 3000, 0., 3000.);
257 meZdcEneEmP2_ =
ib.book1D(
"PZDC EM2 Energy",
"Energy EM module P2", 3000, 0., 3000.);
261 meZdcEneEmP3_ =
ib.book1D(
"PZDC EM3 Energy",
"Energy EM module P3", 3000, 0., 3000.);
265 meZdcEneEmP4_ =
ib.book1D(
"PZDC EM4 Energy",
"Energy EM module P4", 3000, 0., 3000.);
269 meZdcEneEmP5_ =
ib.book1D(
"PZDC EM5 Energy",
"Energy EM module P5", 3000, 0., 3000.);
273 meZdcEneHadP1_ =
ib.book1D(
"PZDC HAD1 Energy",
"Energy HAD module P1", 3000, 0., 3000.);
277 meZdcEneHadP2_ =
ib.book1D(
"PZDC HAD2 Energy",
"Energy HAD module P2", 3000, 0., 3000.);
281 meZdcEneHadP3_ =
ib.book1D(
"PZDC HAD3 Energy",
"Energy HAD module P3", 3000, 0., 3000.);
285 meZdcEneHadP4_ =
ib.book1D(
"PZDC HAD4 Energy",
"Energy HAD module P4", 3000, 0., 3000.);
289 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/PZDC");
290 meZdcEneTEmP1_ =
ib.book2D(
"PZDC EM1 Energy vs Time",
"Energy EM mod P1 vs Time", 4000, 0., 8000., 300, 0., 600.);
294 meZdcEneTEmP2_ =
ib.book2D(
"PZDC EM2 Energy vs Time",
"Energy EM mod P2 vs Time", 4000, 0., 8000., 300, 0., 600.);
298 meZdcEneTEmP3_ =
ib.book2D(
"PZDC EM3 Energy vs Time",
"Energy EM mod P3 vs Time", 4000, 0., 8000., 300, 0., 600.);
302 meZdcEneTEmP4_ =
ib.book2D(
"PZDC EM4 Energy vs Time",
"Energy EM mod P4 vs Time", 4000, 0., 8000., 300, 0., 600.);
306 meZdcEneTEmP5_ =
ib.book2D(
"PZDC EM5 Energy vs Time",
"Energy EM mod P5 vs Time", 4000, 0., 8000., 300, 0., 600.);
311 ib.book2D(
"PZDC HAD1 Energy vs Time",
"Energy HAD mod P1 vs Time", 4000, 0., 8000., 300, 0., 600.);
316 ib.book2D(
"PZDC HAD2 Energy vs Time",
"Energy HAD mod P2 vs Time", 4000, 0., 8000., 300, 0., 600.);
321 ib.book2D(
"PZDC HAD3 Energy vs Time",
"Energy HAD mod P3 vs Time", 4000, 0., 8000., 300, 0., 600.);
326 ib.book2D(
"PZDC HAD4 Energy vs Time",
"Energy HAD mod P4 vs Time", 4000, 0., 8000., 300, 0., 600.);
330 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/PZDC");
331 meZdcEneHadPTot_ =
ib.book1D(
"PZDC EHAD",
"Total P-ZDC HAD Energy", 10000, 0., 10000.);
335 meZdcEneEmPTot_ =
ib.book1D(
"PZDC EEM",
"Total P-ZDC EM Energy", 10000, 0., 10000.);
339 meZdcEnePTot_ =
ib.book1D(
"PZDC ETOT",
"Total P-ZDC Energy", 10000, 0., 10000.);
343 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/NZDC");
344 meZdcCorEEmNEHadN_ =
ib.book2D(
"NZDC EMvHAD",
"N-ZDC Energy EM vs HAD", 3000, 0., 3000., 3000, 0., 3000.);
348 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/PZDC");
349 meZdcCorEEmPEHadP_ =
ib.book2D(
"PZDC EMvHAD",
"P-ZDC Energy EM vs HAD", 3000, 0., 3000., 3000, 0., 3000.);
353 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS");
354 meZdcCorEtotNEtotP_ =
ib.book2D(
"PZDC vs NZDC",
"Energy N-ZDC vs P-ZDC", 3000, 0., 3000., 3000, 0., 3000.);
358 meZdcEneTot_ =
ib.book1D(
"ETOT ZDCs",
"Total Energy ZDCs", 3000, 0., 3000.);
367 ib.setCurrentFolder(
"ZDCValidation/GenParticles/Forward");
370 genpart_Pi0F =
ib.book2D(
"Pi0_Forward",
"Forward Generated Pi0s", 200, 7.5, 13, 100, -3.15, 3.15);
379 ib.book2D(
"Pi0_Forward_Counts",
"Number of Forward Generated Pi0s", 200, 7.5, 13, 100, -3.15, 3.15);
389 genpart_NeutF =
ib.book2D(
"Neutron_Forward",
"Forward Generated Neutrons", 200, 7.5, 13, 100, -3.15, 3.15);
398 ib.book2D(
"Neutron_Forward_Counts",
"Number of Forward Generated Neutrons", 200, 7.5, 13, 100, -3.15, 3.15);
408 genpart_GammaF =
ib.book2D(
"Gamma_Forward",
"Forward Generated Gammas", 200, 7.5, 13, 100, -3.15, 3.15);
417 ib.book2D(
"Gamma_Forward_Counts",
"Number of Forward Generated Gammas", 200, 7.5, 13, 100, -3.15, 3.15);
438 ib.book1D(
"Gamma_Forward_EDistribution",
"Gen-Level Fowarad Gamma Energy", 1500, 0, 1500);
442 ib.setCurrentFolder(
"ZDCValidation/GenParticles/Backward");
445 genpart_Pi0B =
ib.book2D(
"Pi0_Backward",
"Backward Generated Pi0s", 1000, -13, -7.5, 100, -3.15, 3.15);
454 ib.book2D(
"Pi0_Backwards_Counts",
"Number of Backward Generated Pi0s", 200, -13, -7.5, 100, -3.15, 3.15);
464 genpart_NeutB =
ib.book2D(
"Neutron_Backward",
"Backward Generated Neutrons", 1000, -13, -7.5, 100, -3.15, 3.15);
473 "Neutron_Backwards_Counts",
"Number of Backward Generated Neutrons", 200, -13, -7.5, 100, -3.15, 3.15);
482 genpart_GammaB =
ib.book2D(
"Gamma_Backward",
"Backward Generated Gammas", 1000, -13, -7.5, 100, -3.15, 3.15);
491 ib.book2D(
"Gamma_Backwards_Counts",
"Number of Backward Generated Gammas", 200, -13, -7.5, 100, -3.15, 3.15);
514 ib.book1D(
"Gamma_Backward_EDistribution",
"Gen-Level Backward Gamma Energy", 1500, 0, 1500);
531 bool gotGenParticles =
true;
536 gotGenParticles =
false;
540 gotGenParticles =
false;
548 if (gotGenParticles ==
true) {
550 for (reco::GenParticleCollection::const_iterator
gen = genhandle->begin();
gen != genhandle->end();
555 double energy_2 = thisParticle.
energy();
558 double gen_phi = thisParticle.
phi();
559 double gen_eta = thisParticle.
eta();
560 int gen_id = thisParticle.
pdgId();
580 if (gen_eta < -8.3) {
587 if (gen_id == 2112) {
594 if (gen_eta < -8.3) {
609 if (gen_eta < -8.3) {
627 <<
"Run = " <<
iEvent.id().run() <<
" Event = " <<
iEvent.id().event();
632 std::vector<PCaloHit> caloHits;
635 bool getHits =
false;
642 LogDebug(
"ZdcSim") <<
"ZdcValidation: Input flags Hits " << getHits;
645 caloHits.insert(caloHits.end(), hitsZdc->begin(), hitsZdc->end());
648 <<
"ZdcValidation: Hit buffer " << caloHits.size();
655 int nHit =
hits.size();
656 int nZdcEM = 0, nZdcHad = 0, nZdcLum = 0;
657 int nBad1 = 0, nBad2 = 0, nBad = 0;
658 std::vector<double> encontZdcEM(140, 0.);
659 std::vector<double> encontZdcHad(140, 0.);
660 double entotZdcEM = 0;
661 double entotZdcHad = 0;
671 for (
int i = 0;
i < nHit;
i++) {
673 double log10en = log10(
energy);
674 int log10i =
int((log10en + 10.) * 10.);
676 unsigned int id_ =
hits[
i].id();
679 int side =
id.zside();
681 int channel =
id.channel();
687 <<
"Hit[" <<
i <<
"] ID " << std::hex << id_ <<
std::dec <<
" DetID " <<
id <<
" Det " << det <<
" side "
688 << side <<
" Section " <<
section <<
" channel " << channel <<
" E " <<
energy <<
" time \n"
717 if (log10i >= 0 && log10i < 140)
718 encontZdcEM[log10i] +=
energy;
724 if (log10i >= 0 && log10i < 140)
725 encontZdcHad[log10i] +=
energy;
736 for (
int i = 0;
i < 140;
i++)
738 if (entotZdcHad != 0)
739 for (
int i = 0;
i < 140;
i++)
763 <<
"HcalSimHitStudy::analyzeHits: Had " << nZdcHad <<
" EM " << nZdcEM <<
" Bad " << nBad <<
" All " << nHit;