28 #include "CLHEP/Units/GlobalSystemOfUnits.h"
43 <<
"Module Label: " <<
g4Label <<
" Hits: "
44 << zdcHits <<
" / "<< checkHit_
137 meZdcHadL10EneP_ = ib.
bookProfile(
"Log(EHAD) vs Contribution",
"Log10Energy in Had ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1. );
141 meZdcEML10EneP_ = ib.
bookProfile(
"Log(EEM) vs Contribution",
"Log10Energy in EM ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1. );
146 meZdcEHadCh_ = ib.
book2D(
"ZDC EHAD vs Channel",
"ZDC Had Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6. );
150 meZdcEEMCh_ = ib.
book2D(
"ZDC EEM vs Channel",
"ZDC EM Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6. );
155 meZdcETime_ = ib.
book2D(
"E vs T",
"Hits ZDC Energy vs Time", 4000, 0., 8000., 300, 0., 600. );
159 ib.
setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/NZDC");
196 ib.
setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/NZDC");
197 meZdcEneTEmN1_ = ib.
book2D(
"NZDC EM1 Energy vs Time",
"Energy EM mod N1 vs Time", 4000, 0., 8000., 300, 0., 600. );
201 meZdcEneTEmN2_ = ib.
book2D(
"NZDC EM2 Energy vs Time",
"Energy EM mod N2 vs Time", 4000, 0., 8000., 300, 0., 600. );
205 meZdcEneTEmN3_ = ib.
book2D(
"NZDC EM3 Energy vs Time",
"Energy EM mod N3 vs Time", 4000, 0., 8000., 300, 0., 600. );
209 meZdcEneTEmN4_ = ib.
book2D(
"NZDC EM4 Energy vs Time",
"Energy EM mod N4 vs Time", 4000, 0., 8000., 300, 0., 600. );
213 meZdcEneTEmN5_ = ib.
book2D(
"NZDC EM5 Energy vs Time",
"Energy EM mod N5 vs Time", 4000, 0., 8000., 300, 0., 600. );
217 meZdcEneTHadN1_ = ib.
book2D(
"NZDC HAD1 Energy vs Time",
"Energy HAD mod N1 vs Time", 4000, 0., 8000., 300, 0., 600. );
221 meZdcEneTHadN2_ = ib.
book2D(
"NZDC HAD2 Energy vs Time",
"Energy HAD mod N2 vs Time", 4000, 0., 8000., 300, 0., 600. );
225 meZdcEneTHadN3_ = ib.
book2D(
"NZDC HAD3 Energy vs Time",
"Energy HAD mod N3 vs Time", 4000, 0., 8000., 300, 0., 600. );
229 meZdcEneTHadN4_ = ib.
book2D(
"NZDC HAD4 Energy vs Time",
"Energy HAD mod N4 vs Time", 4000, 0., 8000., 300, 0., 600. );
246 ib.
setCurrentFolder(
"ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/PZDC");
283 ib.
setCurrentFolder(
"ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/PZDC");
284 meZdcEneTEmP1_ = ib.
book2D(
"PZDC EM1 Energy vs Time",
"Energy EM mod P1 vs Time", 4000, 0., 8000., 300, 0., 600. );
288 meZdcEneTEmP2_ = ib.
book2D(
"PZDC EM2 Energy vs Time",
"Energy EM mod P2 vs Time", 4000, 0., 8000., 300, 0., 600. );
292 meZdcEneTEmP3_ = ib.
book2D(
"PZDC EM3 Energy vs Time",
"Energy EM mod P3 vs Time", 4000, 0., 8000., 300, 0., 600. );
296 meZdcEneTEmP4_ = ib.
book2D(
"PZDC EM4 Energy vs Time",
"Energy EM mod P4 vs Time", 4000, 0., 8000., 300, 0., 600. );
300 meZdcEneTEmP5_ = ib.
book2D(
"PZDC EM5 Energy vs Time",
"Energy EM mod P5 vs Time", 4000, 0., 8000., 300, 0., 600. );
304 meZdcEneTHadP1_ = ib.
book2D(
"PZDC HAD1 Energy vs Time",
"Energy HAD mod P1 vs Time", 4000, 0., 8000., 300, 0., 600. );
308 meZdcEneTHadP2_ = ib.
book2D(
"PZDC HAD2 Energy vs Time",
"Energy HAD mod P2 vs Time", 4000, 0., 8000., 300, 0., 600. );
312 meZdcEneTHadP3_ = ib.
book2D(
"PZDC HAD3 Energy vs Time",
"Energy HAD mod P3 vs Time", 4000, 0., 8000., 300, 0., 600. );
316 meZdcEneTHadP4_ = ib.
book2D(
"PZDC HAD4 Energy vs Time",
"Energy HAD mod P4 vs Time", 4000, 0., 8000., 300, 0., 600. );
362 genpart_Pi0F = ib.
book2D(
"Pi0_Forward",
"Forward Generated Pi0s",200,7.5,13,100,-3.15,3.15);
380 genpart_NeutF = ib.
book2D(
"Neutron_Forward",
"Forward Generated Neutrons",200,7.5,13,100,-3.15,3.15);
398 genpart_GammaF = ib.
book2D(
"Gamma_Forward",
"Forward Generated Gammas",200,7.5,13,100,-3.15,3.15);
433 genpart_Pi0B = ib.
book2D(
"Pi0_Backward",
"Backward Generated Pi0s",1000,-13,-7.5,100,-3.15,3.15);
451 genpart_NeutB = ib.
book2D(
"Neutron_Backward",
"Backward Generated Neutrons",1000,-13,-7.5,100,-3.15,3.15);
459 genpart_NeutB_counts = ib.
book2D(
"Neutron_Backwards_Counts",
"Number of Backward Generated Neutrons",200,-13,-7.5,100,-3.15,3.15);
469 genpart_GammaB = ib.
book2D(
"Gamma_Backward",
"Backward Generated Gammas",1000,-13,-7.5,100,-3.15,3.15);
516 bool gotGenParticles=
true;
523 gotGenParticles=
false;
525 if (!(genhandle.isValid()))
527 gotGenParticles=
false;
537 if (gotGenParticles==
true){
538 for (reco::GenParticleCollection::const_iterator
gen = genhandle->begin();
539 gen!=genhandle->end();
544 double energy_2= thisParticle.
energy();
545 double gen_phi = thisParticle.
phi();
546 double gen_eta = thisParticle.
eta();
547 int gen_id = thisParticle.
pdgId();
620 <<
"Run = " << iEvent.
id().
run() <<
" Event = "
626 std::vector<PCaloHit> caloHits;
629 bool getHits =
false;
632 if (hitsZdc.isValid()) getHits =
true;
635 LogDebug(
"ZdcSim") <<
"ZdcValidation: Input flags Hits " << getHits;
638 caloHits.insert(caloHits.end(),hitsZdc->begin(),hitsZdc->end());
641 <<
"ZdcValidation: Hit buffer "
649 int nHit = hits.size();
650 int nZdcEM = 0, nZdcHad = 0, nZdcLum = 0;
651 int nBad1=0, nBad2=0, nBad=0;
652 std::vector<double> encontZdcEM(140, 0.);
653 std::vector<double> encontZdcHad(140, 0.);
654 double entotZdcEM = 0;
655 double entotZdcHad = 0;
665 for (
int i=0;
i<nHit;
i++) {
666 double energy = hits[
i].energy();
667 double log10en = log10(energy);
668 int log10i = int( (log10en+10.)*10. );
669 double time = hits[
i].time();
670 unsigned int id_ = hits[
i].id();
673 int side =
id.zside();
674 int section =
id.section();
675 int channel =
id.channel();
682 <<
"Hit[" <<
i <<
"] ID " << std::hex << id_
684 <<
" Det "<< det <<
" side "<< side
685 <<
" Section " << section
686 <<
" channel "<< channel
688 <<
" time \n" <<
time;
695 else { nBad++; nBad2++;}
696 }
else { nBad++; nBad1++;}
707 if( log10i >=0 && log10i < 140 )encontZdcEM[log10i] +=
energy;
713 if( log10i >=0 && log10i < 140 )encontZdcHad[log10i] +=
energy;
723 if( entotZdcEM != 0 )
for(
int i=0;
i<140;
i++ )
meZdcEML10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontZdcEM[
i]/entotZdcEM);
724 if( entotZdcHad != 0 )
for(
int i=0;
i<140;
i++ )
meZdcHadL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10.,encontZdcHad[
i]/entotZdcHad);
747 <<
"HcalSimHitStudy::analyzeHits: Had " << nZdcHad
749 <<
" Bad " << nBad <<
" All " << nHit;
MonitorElement * meZdcEneTHadP3_
MonitorElement * meZdcEnergyHit_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meZdcEneTEmN1_
virtual int pdgId() const
PDG identifier.
MonitorElement * genpart_NeutB
void analyzeHits(std::vector< PCaloHit > &)
MonitorElement * genpart_Pi0F
MonitorElement * meZdcEneTEmP1_
MonitorElement * meZdcHadL10EneP_
MonitorElement * bookProfile(Args &&...args)
MonitorElement * meZdcEneEmP3_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meZdcEneEmPTot_
MonitorElement * meZdcEneEmN1_
MonitorElement * meZdcEneTEmP4_
MonitorElement * meZdcEneHadN1_
MonitorElement * meZdcCorEEmNEHadN_
MonitorElement * meZdcEneEmN4_
MonitorElement * meZdcEneTHadN4_
MonitorElement * meZdcEneEmN5_
MonitorElement * meAllZdcNHit_
MonitorElement * genpart_Pi0F_energydist
MonitorElement * meZdcEneTEmN2_
virtual double eta() const
momentum pseudorapidity
MonitorElement * meZdcEneHadN4_
MonitorElement * genpart_GammaF_counts
MonitorElement * genpart_NeutF
MonitorElement * meZdcEneTHadN2_
MonitorElement * genpart_Pi0B
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)
virtual double energy() const
energy
MonitorElement * genpart_GammaB_energydist
MonitorElement * meZdcEneTEmP5_
MonitorElement * genpart_Pi0F_counts
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
MonitorElement * meZdcEnePTot_
MonitorElement * meZdcEneTEmN4_
MonitorElement * meZdcCorEEmPEHadP_
MonitorElement * meZdcEneTHadP2_
MonitorElement * genpart_GammaF_energydist
MonitorElement * meZdcSideHit_
MonitorElement * meZdcEneHadN3_
MonitorElement * book1D(Args &&...args)
MonitorElement * meZdcEneEmN2_
MonitorElement * meZdcEneTHadN1_
MonitorElement * meZdcEneTEmP3_
MonitorElement * genpart_NeutF_energydist
MonitorElement * meZdcDetectHit_
MonitorElement * meZdc10Ene_
edm::EDGetTokenT< reco::GenParticleCollection > tok_gen_
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
void analyze(const edm::Event &e, const edm::EventSetup &c)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * meZdcTimeHit_
MonitorElement * book2D(Args &&...args)
MonitorElement * meBadZdcIdHit_
MonitorElement * meZdcEneTHadP4_
MonitorElement * meZdcEneHadNTot_
MonitorElement * genpart_NeutB_energydist
MonitorElement * meZdcCorEtotNEtotP_
MonitorElement * genpart_NeutF_counts
MonitorElement * meZdcEneHadP2_
MonitorElement * meZdcEneEmP4_
MonitorElement * meZdcHadEnergyHit_
MonitorElement * genpart_Pi0B_energydist
MonitorElement * meZdcEneEmP5_
void endRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * meZdcEneTEmP2_
MonitorElement * genpart_GammaB_counts
MonitorElement * meZdcSectionHit_
MonitorElement * meZdcEneNTot_
MonitorElement * meZdcEneHadN2_
MonitorElement * meZdcEneHadPTot_
MonitorElement * meZdcEEMCh_
MonitorElement * genpart_NeutB_counts
TH2F * getTH2F(void) const
MonitorElement * meZdcEneEmP1_
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * meZdcNHitEM_
MonitorElement * meZdcEneTHadN3_
virtual double phi() const
momentum azimuthal angle
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * meZdcTimeWHit_
MonitorElement * meZdcEHadCh_
MonitorElement * meZdcETime_
MonitorElement * meZdcEMEnergyHit_
MonitorElement * meZdcNHitLum_