127 : g4Label(ps.getUntrackedParameter<
std::
string>(
"moduleLabel",
"g4SimHits")),
128 zdcHits(ps.getUntrackedParameter<
std::
string>(
"HitCollection",
"ZdcHits")),
129 outFile_(ps.getUntrackedParameter<
std::
string>(
"outputFile",
"zdcHitStudy.root")),
130 verbose_(ps.getUntrackedParameter<
bool>(
"Verbose",
false)),
139 ib.setCurrentFolder(
"ZDCValidation");
152 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits");
153 meAllZdcNHit_ =
ib.book1D(
"ZDC Hits",
"Number of All Hits in ZDC", 100, 0., 100.);
157 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Debug_Helper");
158 meBadZdcDetHit_ =
ib.book1D(
"Hiits with the wrong Det",
"Hits with wrong Det in ZDC", 100, 0., 100.);
162 meBadZdcSecHit_ =
ib.book1D(
"Wrong Section Hits",
"Hits with wrong Section in ZDC", 100, 0., 100.);
166 meBadZdcIdHit_ =
ib.book1D(
"Wrong_ID_Hits",
"Hits with wrong ID in ZDC", 100, 0., 100.);
170 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo");
171 meZdcNHitEM_ =
ib.book1D(
"Hits in EM",
"Number of Hits in ZDC EM", 100, 0., 100.);
175 meZdcNHitHad_ =
ib.book1D(
"Hits in HAD",
"Number of Hits in ZDC Had", 100, 0., 100.);
179 meZdcNHitLum_ =
ib.book1D(
"Hits in LUM",
"Number of Hits in ZDC Lum", 100, 0., 100.);
183 meZdcDetectHit_ =
ib.book1D(
"Calo Detector ID",
"Calo Detector ID", 50, 0., 50.);
199 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/");
204 meZdcHadEnergyHit_ =
ib.book1D(
"Hit Energy HAD",
"Hits Energy in Had Section", 4000, 0., 8000.);
208 meZdcEMEnergyHit_ =
ib.book1D(
"Hit Energy EM",
"Hits Energy in EM Section", 4000, 0., 8000.);
212 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo");
213 meZdcTimeHit_ =
ib.book1D(
"Time in ZDC",
"Time in ZDC", 300, 0., 600.);
217 meZdcTimeWHit_ =
ib.book1D(
"Energy Weighted Time in ZDC",
"Time in ZDC (E wtd)", 300, 0., 600.);
221 meZdc10Ene_ =
ib.book1D(
"ZDC Log(E)",
"Log10Energy in ZDC", 140, -20., 20.);
226 "Log(EHAD) vs Contribution",
"Log10Energy in Had ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1.);
231 "Log(EEM) vs Contribution",
"Log10Energy in EM ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1.);
235 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits");
236 meZdcEHadCh_ =
ib.book2D(
"ZDC EHAD vs Channel",
"ZDC Had Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6.);
240 meZdcEEMCh_ =
ib.book2D(
"ZDC EEM vs Channel",
"ZDC EM Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6.);
244 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo");
245 meZdcETime_ =
ib.book2D(
"E vs T",
"Hits ZDC Energy vs Time", 4000, 0., 8000., 300, 0., 600.);
249 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/NZDC");
250 meZdcEneEmN1_ =
ib.book1D(
"NZDC EM1 Energy",
"Energy EM module N1", 4000, 0., 8000.);
254 meZdcEneEmN2_ =
ib.book1D(
"NZDC EM2 Energy",
"Energy EM module N2", 4000, 0., 8000.);
258 meZdcEneEmN3_ =
ib.book1D(
"NZDC EM3 Energy",
"Energy EM module N3", 4000, 0., 8000.);
262 meZdcEneEmN4_ =
ib.book1D(
"NZDC EM4 Energy",
"Energy EM module N4", 4000, 0., 8000.);
266 meZdcEneEmN5_ =
ib.book1D(
"NZDC EM5 Energy",
"Energy EM module N5", 4000, 0., 8000.);
270 meZdcEneHadN1_ =
ib.book1D(
"NZDC HAD1 Energy",
"Energy HAD module N1", 4000, 0., 8000.);
274 meZdcEneHadN2_ =
ib.book1D(
"NZDC HAD2 Energy",
"Energy HAD module N2", 4000, 0., 8000.);
278 meZdcEneHadN3_ =
ib.book1D(
"NZDC HAD3 Energy",
"Energy HAD module N3", 4000, 0., 8000.);
282 meZdcEneHadN4_ =
ib.book1D(
"NZDC HAD4 Energy",
"Energy HAD module N4", 4000, 0., 8000.);
286 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/NZDC");
287 meZdcEneTEmN1_ =
ib.book2D(
"NZDC EM1 Energy vs Time",
"Energy EM mod N1 vs Time", 4000, 0., 8000., 300, 0., 600.);
291 meZdcEneTEmN2_ =
ib.book2D(
"NZDC EM2 Energy vs Time",
"Energy EM mod N2 vs Time", 4000, 0., 8000., 300, 0., 600.);
295 meZdcEneTEmN3_ =
ib.book2D(
"NZDC EM3 Energy vs Time",
"Energy EM mod N3 vs Time", 4000, 0., 8000., 300, 0., 600.);
299 meZdcEneTEmN4_ =
ib.book2D(
"NZDC EM4 Energy vs Time",
"Energy EM mod N4 vs Time", 4000, 0., 8000., 300, 0., 600.);
303 meZdcEneTEmN5_ =
ib.book2D(
"NZDC EM5 Energy vs Time",
"Energy EM mod N5 vs Time", 4000, 0., 8000., 300, 0., 600.);
308 ib.book2D(
"NZDC HAD1 Energy vs Time",
"Energy HAD mod N1 vs Time", 4000, 0., 8000., 300, 0., 600.);
313 ib.book2D(
"NZDC HAD2 Energy vs Time",
"Energy HAD mod N2 vs Time", 4000, 0., 8000., 300, 0., 600.);
318 ib.book2D(
"NZDC HAD3 Energy vs Time",
"Energy HAD mod N3 vs Time", 4000, 0., 8000., 300, 0., 600.);
323 ib.book2D(
"NZDC HAD4 Energy vs Time",
"Energy HAD mod N4 vs Time", 4000, 0., 8000., 300, 0., 600.);
327 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/NZDC");
332 meZdcEneEmNTot_ =
ib.book1D(
"NZDC EEM",
"Total N-ZDC EM Energy", 3000, 0., 3000.);
336 meZdcEneNTot_ =
ib.book1D(
"NZDC ETOT",
"Total N-ZDC Energy ", 7000, 0., 7000.);
340 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/PZDC");
341 meZdcEneEmP1_ =
ib.book1D(
"PZDC EM1 Energy",
"Energy EM module P1", 3000, 0., 3000.);
345 meZdcEneEmP2_ =
ib.book1D(
"PZDC EM2 Energy",
"Energy EM module P2", 3000, 0., 3000.);
349 meZdcEneEmP3_ =
ib.book1D(
"PZDC EM3 Energy",
"Energy EM module P3", 3000, 0., 3000.);
353 meZdcEneEmP4_ =
ib.book1D(
"PZDC EM4 Energy",
"Energy EM module P4", 3000, 0., 3000.);
357 meZdcEneEmP5_ =
ib.book1D(
"PZDC EM5 Energy",
"Energy EM module P5", 3000, 0., 3000.);
361 meZdcEneHadP1_ =
ib.book1D(
"PZDC HAD1 Energy",
"Energy HAD module P1", 3000, 0., 3000.);
365 meZdcEneHadP2_ =
ib.book1D(
"PZDC HAD2 Energy",
"Energy HAD module P2", 3000, 0., 3000.);
369 meZdcEneHadP3_ =
ib.book1D(
"PZDC HAD3 Energy",
"Energy HAD module P3", 3000, 0., 3000.);
373 meZdcEneHadP4_ =
ib.book1D(
"PZDC HAD4 Energy",
"Energy HAD module P4", 3000, 0., 3000.);
377 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/PZDC");
378 meZdcEneTEmP1_ =
ib.book2D(
"PZDC EM1 Energy vs Time",
"Energy EM mod P1 vs Time", 4000, 0., 8000., 300, 0., 600.);
382 meZdcEneTEmP2_ =
ib.book2D(
"PZDC EM2 Energy vs Time",
"Energy EM mod P2 vs Time", 4000, 0., 8000., 300, 0., 600.);
386 meZdcEneTEmP3_ =
ib.book2D(
"PZDC EM3 Energy vs Time",
"Energy EM mod P3 vs Time", 4000, 0., 8000., 300, 0., 600.);
390 meZdcEneTEmP4_ =
ib.book2D(
"PZDC EM4 Energy vs Time",
"Energy EM mod P4 vs Time", 4000, 0., 8000., 300, 0., 600.);
394 meZdcEneTEmP5_ =
ib.book2D(
"PZDC EM5 Energy vs Time",
"Energy EM mod P5 vs Time", 4000, 0., 8000., 300, 0., 600.);
399 ib.book2D(
"PZDC HAD1 Energy vs Time",
"Energy HAD mod P1 vs Time", 4000, 0., 8000., 300, 0., 600.);
404 ib.book2D(
"PZDC HAD2 Energy vs Time",
"Energy HAD mod P2 vs Time", 4000, 0., 8000., 300, 0., 600.);
409 ib.book2D(
"PZDC HAD3 Energy vs Time",
"Energy HAD mod P3 vs Time", 4000, 0., 8000., 300, 0., 600.);
414 ib.book2D(
"PZDC HAD4 Energy vs Time",
"Energy HAD mod P4 vs Time", 4000, 0., 8000., 300, 0., 600.);
418 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/PZDC");
419 meZdcEneHadPTot_ =
ib.book1D(
"PZDC EHAD",
"Total P-ZDC HAD Energy", 10000, 0., 10000.);
423 meZdcEneEmPTot_ =
ib.book1D(
"PZDC EEM",
"Total P-ZDC EM Energy", 10000, 0., 10000.);
427 meZdcEnePTot_ =
ib.book1D(
"PZDC ETOT",
"Total P-ZDC Energy", 10000, 0., 10000.);
431 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/NZDC");
432 meZdcCorEEmNEHadN_ =
ib.book2D(
"NZDC EMvHAD",
"N-ZDC Energy EM vs HAD", 3000, 0., 3000., 3000, 0., 3000.);
436 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/PZDC");
437 meZdcCorEEmPEHadP_ =
ib.book2D(
"PZDC EMvHAD",
"P-ZDC Energy EM vs HAD", 3000, 0., 3000., 3000, 0., 3000.);
441 ib.setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS");
442 meZdcCorEtotNEtotP_ =
ib.book2D(
"PZDC vs NZDC",
"Energy N-ZDC vs P-ZDC", 3000, 0., 3000., 3000, 0., 3000.);
446 meZdcEneTot_ =
ib.book1D(
"ETOT ZDCs",
"Total Energy ZDCs", 3000, 0., 3000.);
455 ib.setCurrentFolder(
"ZDCValidation/GenParticles/Forward");
458 genpart_Pi0F =
ib.book2D(
"Pi0_Forward",
"Forward Generated Pi0s", 200, 7.5, 13, 100, -3.15, 3.15);
467 ib.book2D(
"Pi0_Forward_Counts",
"Number of Forward Generated Pi0s", 200, 7.5, 13, 100, -3.15, 3.15);
477 genpart_NeutF =
ib.book2D(
"Neutron_Forward",
"Forward Generated Neutrons", 200, 7.5, 13, 100, -3.15, 3.15);
486 ib.book2D(
"Neutron_Forward_Counts",
"Number of Forward Generated Neutrons", 200, 7.5, 13, 100, -3.15, 3.15);
496 genpart_GammaF =
ib.book2D(
"Gamma_Forward",
"Forward Generated Gammas", 200, 7.5, 13, 100, -3.15, 3.15);
505 ib.book2D(
"Gamma_Forward_Counts",
"Number of Forward Generated Gammas", 200, 7.5, 13, 100, -3.15, 3.15);
526 ib.book1D(
"Gamma_Forward_EDistribution",
"Gen-Level Fowarad Gamma Energy", 1500, 0, 1500);
530 ib.setCurrentFolder(
"ZDCValidation/GenParticles/Backward");
533 genpart_Pi0B =
ib.book2D(
"Pi0_Backward",
"Backward Generated Pi0s", 1000, -13, -7.5, 100, -3.15, 3.15);
542 ib.book2D(
"Pi0_Backwards_Counts",
"Number of Backward Generated Pi0s", 200, -13, -7.5, 100, -3.15, 3.15);
552 genpart_NeutB =
ib.book2D(
"Neutron_Backward",
"Backward Generated Neutrons", 1000, -13, -7.5, 100, -3.15, 3.15);
561 "Neutron_Backwards_Counts",
"Number of Backward Generated Neutrons", 200, -13, -7.5, 100, -3.15, 3.15);
570 genpart_GammaB =
ib.book2D(
"Gamma_Backward",
"Backward Generated Gammas", 1000, -13, -7.5, 100, -3.15, 3.15);
579 ib.book2D(
"Gamma_Backwards_Counts",
"Number of Backward Generated Gammas", 200, -13, -7.5, 100, -3.15, 3.15);
602 ib.book1D(
"Gamma_Backward_EDistribution",
"Gen-Level Backward Gamma Energy", 1500, 0, 1500);
619 bool gotGenParticles =
true;
624 gotGenParticles =
false;
632 if (gotGenParticles) {
634 for (reco::GenParticleCollection::const_iterator
gen = genhandle->begin();
gen != genhandle->end();
639 double energy_2 = thisParticle.
energy();
642 double gen_phi = thisParticle.
phi();
643 double gen_eta = thisParticle.
eta();
644 int gen_id = thisParticle.
pdgId();
664 if (gen_eta < -8.3) {
671 if (gen_id == 2112) {
678 if (gen_eta < -8.3) {
693 if (gen_eta < -8.3) {
710 bool getHits =
false;
715 std::vector<PCaloHit> caloHits;
716 caloHits.insert(caloHits.end(), hitsZdc->begin(), hitsZdc->end());
717 edm::LogVerbatim(
"ZdcSimHitStudy") <<
"ZdcValidation: Hit buffer " << caloHits.size();
722 edm::LogVerbatim(
"ZdcSim") <<
"ZdcValidation: Input flags Hits " << getHits;
726 int nHit =
hits.size();
727 int nZdcEM = 0, nZdcHad = 0, nZdcLum = 0;
728 int nBad1 = 0, nBad2 = 0, nBad = 0;
729 std::vector<double> encontZdcEM(140, 0.);
730 std::vector<double> encontZdcHad(140, 0.);
731 double entotZdcEM = 0;
732 double entotZdcHad = 0;
742 for (
int i = 0;
i < nHit;
i++) {
744 double log10en = log10(
energy);
745 int log10i =
int((log10en + 10.) * 10.);
747 unsigned int id_ =
hits[
i].id();
750 int side =
id.zside();
752 int channel =
id.channel();
757 <<
" Det " << det <<
" side " <<
side <<
" Section " <<
section <<
" channel " 758 << channel <<
" E " <<
energy <<
" time \n" 786 if (log10i >= 0 && log10i < 140)
787 encontZdcEM[log10i] +=
energy;
793 if (log10i >= 0 && log10i < 140)
794 encontZdcHad[log10i] +=
energy;
805 for (
int i = 0;
i < 140;
i++)
807 if (entotZdcHad != 0)
808 for (
int i = 0;
i < 140;
i++)
830 edm::LogVerbatim(
"HcalSimHitStudy") <<
"HcalSimHitStudy::analyzeHits: Had " << nZdcHad <<
" EM " << nZdcEM <<
" Bad " 831 << nBad <<
" All " << nHit;
MonitorElement * meZdcEneTHadP3_
Log< level::Info, true > LogVerbatim
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
MonitorElement * meZdcEnergyHit_
MonitorElement * meZdcEneTEmN1_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< PCaloHit > PCaloHitContainer
MonitorElement * genpart_NeutB
void analyzeHits(std::vector< PCaloHit > &)
MonitorElement * genpart_Pi0F
MonitorElement * meZdcEneTEmP1_
MonitorElement * meZdcHadL10EneP_
MonitorElement * meZdcEneEmP3_
MonitorElement * meZdcEneEmPTot_
MonitorElement * meZdcEneEmN1_
virtual void setOption(const char *option)
MonitorElement * meZdcEneTEmP4_
MonitorElement * meZdcEneHadN1_
MonitorElement * meZdcCorEEmNEHadN_
ALPAKA_FN_ACC int side(int ieta, int iphi)
MonitorElement * meZdcEneEmN4_
MonitorElement * meZdcEneTHadN4_
MonitorElement * meZdcEneEmN5_
MonitorElement * meAllZdcNHit_
MonitorElement * genpart_Pi0F_energydist
MonitorElement * meZdcEneTEmN2_
MonitorElement * meZdcEneHadN4_
MonitorElement * genpart_GammaF_counts
MonitorElement * genpart_NeutF
MonitorElement * meZdcEneTHadN2_
const std::string g4Label
MonitorElement * genpart_Pi0B
int pdgId() const final
PDG identifier.
MonitorElement * meZdcEneEmNTot_
MonitorElement * meZdcChannelHit_
MonitorElement * meZdcEneEmP2_
MonitorElement * meZdcEneHadP1_
MonitorElement * meZdcEML10EneP_
MonitorElement * meZdcEneTEmN5_
MonitorElement * meZdcEneEmN3_
MonitorElement * meZdcNHitHad_
MonitorElement * genpart_Pi0B_counts
MonitorElement * meBadZdcDetHit_
ZdcSimHitStudy(const edm::ParameterSet &ps)
MonitorElement * genpart_GammaB_energydist
MonitorElement * meZdcEneTEmP5_
MonitorElement * genpart_Pi0F_counts
MonitorElement * meZdcEnePTot_
MonitorElement * meZdcEneTEmN4_
MonitorElement * meZdcCorEEmPEHadP_
MonitorElement * meZdcEneTHadP2_
MonitorElement * genpart_GammaF_energydist
MonitorElement * meZdcSideHit_
MonitorElement * meZdcEneHadN3_
MonitorElement * meZdcEneEmN2_
MonitorElement * meZdcEneTHadN1_
#define DEFINE_FWK_MODULE(type)
MonitorElement * meZdcEneTEmP3_
MonitorElement * genpart_NeutF_energydist
MonitorElement * meZdcDetectHit_
MonitorElement * meZdc10Ene_
def gen(fragment, howMuch)
Production test section ####.
MonitorElement * meZdcEneHadP4_
int FillHitValHist(int side, int section, int channel, double energy, double time)
MonitorElement * meZdcEneTot_
MonitorElement * meZdcEneHadP3_
MonitorElement * genpart_GammaF
MonitorElement * meZdcEneTEmN3_
MonitorElement * meBadZdcSecHit_
MonitorElement * meZdcEneTHadP1_
MonitorElement * genpart_GammaB
MonitorElement * meZdcNHit_
MonitorElement * meZdcTimeHit_
MonitorElement * meBadZdcIdHit_
MonitorElement * meZdcEneTHadP4_
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
MonitorElement * meZdcEneHadNTot_
MonitorElement * genpart_NeutB_energydist
MonitorElement * meZdcCorEtotNEtotP_
MonitorElement * genpart_NeutF_counts
const edm::EDGetTokenT< reco::GenParticleCollection > tok_gen_
MonitorElement * meZdcEneHadP2_
const std::string zdcHits
MonitorElement * meZdcEneEmP4_
MonitorElement * meZdcHadEnergyHit_
MonitorElement * genpart_Pi0B_energydist
MonitorElement * meZdcEneEmP5_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * meZdcEneTEmP2_
MonitorElement * genpart_GammaB_counts
MonitorElement * meZdcSectionHit_
MonitorElement * meZdcEneNTot_
MonitorElement * meZdcEneHadN2_
MonitorElement * meZdcEneHadPTot_
MonitorElement * meZdcEEMCh_
~ZdcSimHitStudy() override=default
MonitorElement * genpart_NeutB_counts
MonitorElement * meZdcEneEmP1_
MonitorElement * meZdc10EneP_
MonitorElement * meZdcNHitEM_
double phi() const final
momentum azimuthal angle
MonitorElement * meZdcEneTHadN3_
MonitorElement * meZdcTimeWHit_
const std::string outFile_
MonitorElement * meZdcEHadCh_
MonitorElement * meZdcETime_
MonitorElement * meZdcEMEnergyHit_
MonitorElement * meZdcNHitLum_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
double energy() const final
energy
double eta() const final
momentum pseudorapidity