28 #include "CLHEP/Units/GlobalSystemOfUnits.h"
43 <<
"Module Label: " <<
g4Label <<
" Hits: "
44 << zdcHits <<
" / "<< checkHit_
157 meZdcEHadCh_ =
dbe_->
book2D(
"ZDC EHAD vs Channel",
"ZDC Had Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6. );
161 meZdcEEMCh_ =
dbe_->
book2D(
"ZDC EEM vs Channel",
"ZDC EM Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6. );
208 meZdcEneTEmN1_ =
dbe_->
book2D(
"NZDC EM1 Energy vs Time",
"Energy EM mod N1 vs Time", 4000, 0., 8000., 300, 0., 600. );
212 meZdcEneTEmN2_ =
dbe_->
book2D(
"NZDC EM2 Energy vs Time",
"Energy EM mod N2 vs Time", 4000, 0., 8000., 300, 0., 600. );
216 meZdcEneTEmN3_ =
dbe_->
book2D(
"NZDC EM3 Energy vs Time",
"Energy EM mod N3 vs Time", 4000, 0., 8000., 300, 0., 600. );
220 meZdcEneTEmN4_ =
dbe_->
book2D(
"NZDC EM4 Energy vs Time",
"Energy EM mod N4 vs Time", 4000, 0., 8000., 300, 0., 600. );
224 meZdcEneTEmN5_ =
dbe_->
book2D(
"NZDC EM5 Energy vs Time",
"Energy EM mod N5 vs Time", 4000, 0., 8000., 300, 0., 600. );
295 meZdcEneTEmP1_ =
dbe_->
book2D(
"PZDC EM1 Energy vs Time",
"Energy EM mod P1 vs Time", 4000, 0., 8000., 300, 0., 600. );
299 meZdcEneTEmP2_ =
dbe_->
book2D(
"PZDC EM2 Energy vs Time",
"Energy EM mod P2 vs Time", 4000, 0., 8000., 300, 0., 600. );
303 meZdcEneTEmP3_ =
dbe_->
book2D(
"PZDC EM3 Energy vs Time",
"Energy EM mod P3 vs Time", 4000, 0., 8000., 300, 0., 600. );
307 meZdcEneTEmP4_ =
dbe_->
book2D(
"PZDC EM4 Energy vs Time",
"Energy EM mod P4 vs Time", 4000, 0., 8000., 300, 0., 600. );
311 meZdcEneTEmP5_ =
dbe_->
book2D(
"PZDC EM5 Energy vs Time",
"Energy EM mod P5 vs Time", 4000, 0., 8000., 300, 0., 600. );
478 bool gotGenParticles=
true;
485 gotGenParticles=
false;
487 if (!(genhandle.isValid()))
489 gotGenParticles=
false;
499 if (gotGenParticles==
true){
500 for (reco::GenParticleCollection::const_iterator
gen = genhandle->begin();
501 gen!=genhandle->end();
506 double energy_2= thisParticle.
energy();
507 double gen_phi = thisParticle.
phi();
508 double gen_eta = thisParticle.
eta();
509 int gen_id = thisParticle.
pdgId();
570 <<
"Run = " << iEvent.
id().
run() <<
" Event = "
576 std::vector<PCaloHit> caloHits;
579 bool getHits =
false;
582 if (hitsZdc.isValid()) getHits =
true;
585 LogDebug(
"ZdcSim") <<
"ZdcValidation: Input flags Hits " << getHits;
588 caloHits.insert(caloHits.end(),hitsZdc->begin(),hitsZdc->end());
591 <<
"ZdcValidation: Hit buffer "
599 int nHit = hits.size();
600 int nZdcEM = 0, nZdcHad = 0, nZdcLum = 0;
601 int nBad1=0, nBad2=0, nBad=0;
602 std::vector<double> encontZdcEM(140, 0.);
603 std::vector<double> encontZdcHad(140, 0.);
604 double entotZdcEM = 0;
605 double entotZdcHad = 0;
615 for (
int i=0;
i<nHit;
i++) {
616 double energy = hits[
i].energy();
617 double log10en = log10(energy);
618 int log10i = int( (log10en+10.)*10. );
619 double time = hits[
i].time();
620 unsigned int id_ = hits[
i].id();
623 int side =
id.zside();
624 int section =
id.section();
625 int channel =
id.channel();
632 <<
"Hit[" <<
i <<
"] ID " << std::hex << id_
633 << std::dec <<
" DetID "<<
id
634 <<
" Det "<< det <<
" side "<< side
635 <<
" Section " << section
636 <<
" channel "<< channel
638 <<
" time \n" <<
time;
645 else { nBad++; nBad2++;}
646 }
else { nBad++; nBad1++;}
657 if( log10i >=0 && log10i < 140 )encontZdcEM[log10i] +=
energy;
663 if( log10i >=0 && log10i < 140 )encontZdcHad[log10i] +=
energy;
674 if( entotZdcEM != 0 )
for(
int i=0;
i<140;
i++ )
meZdcEML10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontZdcEM[
i]/entotZdcEM);
675 if( entotZdcHad != 0 )
for(
int i=0;
i<140;
i++ )
meZdcHadL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10.,encontZdcHad[
i]/entotZdcHad);
677 if (
dbe_ && nHit>0) {
698 <<
"HcalSimHitStudy::analyzeHits: Had " << nZdcHad
700 <<
" Bad " << nBad <<
" All " << nHit;
MonitorElement * meZdcEneTHadP3_
MonitorElement * meZdcEnergyHit_
virtual double energy() const GCC11_FINAL
energy
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meZdcEneTEmN1_
MonitorElement * genpart_NeutB
void analyzeHits(std::vector< PCaloHit > &)
MonitorElement * genpart_Pi0F
MonitorElement * meZdcEneTEmP1_
MonitorElement * meZdcHadL10EneP_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * meZdcEneEmP3_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meZdcEneEmPTot_
MonitorElement * meZdcEneEmN1_
virtual int pdgId() const GCC11_FINAL
PDG identifier.
MonitorElement * meZdcEneTEmP4_
MonitorElement * meZdcEneHadN1_
MonitorElement * meZdcCorEEmNEHadN_
MonitorElement * meZdcEneEmN4_
MonitorElement * meZdcEneTHadN4_
MonitorElement * meZdcEneEmN5_
MonitorElement * meAllZdcNHit_
MonitorElement * genpart_Pi0F_energydist
MonitorElement * meZdcEneTEmN2_
MonitorElement * meZdcEneHadN4_
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 * meBadZdcDetHit_
ZdcSimHitStudy(const edm::ParameterSet &ps)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
MonitorElement * genpart_GammaB_energydist
MonitorElement * meZdcEneTEmP5_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
MonitorElement * meZdcEnePTot_
MonitorElement * meZdcEneTEmN4_
MonitorElement * meZdcCorEEmPEHadP_
MonitorElement * meZdcEneTHadP2_
MonitorElement * genpart_GammaF_energydist
MonitorElement * meZdcSideHit_
MonitorElement * meZdcEneHadN3_
MonitorElement * meZdcEneEmN2_
MonitorElement * meZdcEneTHadN1_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
MonitorElement * meZdcEneTEmP3_
MonitorElement * genpart_NeutF_energydist
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setVerbose(unsigned level)
MonitorElement * meZdcDetectHit_
MonitorElement * meZdc10Ene_
edm::EDGetTokenT< reco::GenParticleCollection > tok_gen_
MonitorElement * meZdcEneHadP4_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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)
MonitorElement * meZdcTimeHit_
MonitorElement * meBadZdcIdHit_
MonitorElement * meZdcEneTHadP4_
MonitorElement * meZdcEneHadNTot_
MonitorElement * genpart_NeutB_energydist
MonitorElement * meZdcCorEtotNEtotP_
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 * meZdcSectionHit_
MonitorElement * meZdcEneNTot_
MonitorElement * meZdcEneHadN2_
MonitorElement * meZdcEneHadPTot_
MonitorElement * meZdcEEMCh_
void showDirStructure(void) const
TH2F * getTH2F(void) const
MonitorElement * meZdcEneEmP1_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * meZdcNHitEM_
MonitorElement * meZdcEneTHadN3_
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_
void setCurrentFolder(const std::string &fullpath)
MonitorElement * meZdcETime_
MonitorElement * meZdcEMEnergyHit_
MonitorElement * meZdcNHitLum_