17 << hcalHits <<
" / "<< checkHit_
99 LogDebug(
"HcalSim") <<
"Run = " << e.
id().
run() <<
" Event = "
102 std::vector<PCaloHit> caloHits;
105 bool getHits =
false;
108 if (hitsHcal.
isValid()) getHits =
true;
111 LogDebug(
"HcalSim") <<
"HcalValidation: Input flags Hits " << getHits;
114 caloHits.insert(caloHits.end(),hitsHcal->begin(),hitsHcal->end());
115 LogDebug(
"HcalSim") <<
"HcalValidation: Hit buffer "
123 int nHit = hits.size();
124 int nHB=0, nHE=0, nHO=0, nHF=0, nBad1=0, nBad2=0, nBad=0;
125 std::vector<double> encontHB(140, 0.);
126 std::vector<double> encontHE(140, 0.);
127 std::vector<double> encontHF(140, 0.);
128 std::vector<double> encontHO(140, 0.);
129 double entotHB = 0, entotHE = 0, entotHF = 0, entotHO = 0;
131 for (
int i=0;
i<nHit;
i++) {
132 double energy = hits[
i].energy();
133 double log10en = log10(energy);
134 int log10i = int( (log10en+10.)*10. );
135 double time = hits[
i].time();
136 unsigned int id_ = hits[
i].id();
139 int subdet =
id.subdet();
140 int depth =
id.depth();
143 LogDebug(
"HcalSim") <<
"Hit[" <<
i <<
"] ID " << std::hex << id_
144 << std::dec <<
" Det " << det <<
" Sub "
145 << subdet <<
" depth " << depth <<
" Eta " << eta
146 <<
" Phi " << phi <<
" E " << energy <<
" time "
149 if (subdet == static_cast<int>(
HcalBarrel)) nHB++;
150 else if (subdet == static_cast<int>(
HcalEndcap)) nHE++;
151 else if (subdet == static_cast<int>(
HcalOuter)) nHO++;
152 else if (subdet == static_cast<int>(
HcalForward)) nHF++;
153 else { nBad++; nBad2++;}
154 }
else { nBad++; nBad1++;}
173 if( log10i >=0 && log10i < 140 ) encontHB[log10i] +=
energy;
175 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
183 if( log10i >=0 && log10i < 140 ) encontHE[log10i] +=
energy;
185 }
else if (subdet == static_cast<int>(
HcalOuter)) {
193 if( log10i >=0 && log10i < 140 ) encontHO[log10i] +=
energy;
195 }
else if (subdet == static_cast<int>(
HcalForward)) {
203 if( log10i >=0 && log10i < 140 ) encontHF[log10i] +=
energy;
209 if( entotHB != 0 )
for(
int i=0;
i<140;
i++ )
meHBL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHB[
i]/entotHB );
210 if( entotHE != 0 )
for(
int i=0;
i<140;
i++ )
meHEL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHE[
i]/entotHE );
211 if( entotHF != 0 )
for(
int i=0;
i<140;
i++ )
meHFL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHF[
i]/entotHF );
212 if( entotHO != 0 )
for(
int i=0;
i<140;
i++ )
meHOL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHO[
i]/entotHO );
224 LogDebug(
"HcalSim") <<
"HcalSimHitStudy::analyzeHits: HB " << nHB
225 <<
" HE " << nHE <<
" HO " << nHO <<
" HF " << nHF
226 <<
" Bad " << nBad <<
" All " << nHit;
MonitorElement * mePhiHit_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meHEDepHit_
MonitorElement * meHOL10Ene_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * meHOPhiHit_
MonitorElement * meDetectHit_
MonitorElement * meHFNHit_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meHFEtaHit_
MonitorElement * meHFL10EneP_
MonitorElement * meHFEneHit2_
MonitorElement * meHOL10EneP_
MonitorElement * meHBNHit_
MonitorElement * meHFTimHit_
MonitorElement * meHBEneHit2_
MonitorElement * meHONHit_
MonitorElement * meAllNHit_
MonitorElement * meHBL10Ene_
MonitorElement * meBadDetHit_
MonitorElement * meHFL10Ene_
MonitorElement * meHETimHit_
MonitorElement * meTimeHit_
void analyzeHits(std::vector< PCaloHit > &)
MonitorElement * meHFDepHit_
MonitorElement * meHBTimHit_
MonitorElement * meTimeWHit_
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 * meHBDepHit_
void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * meBadSubHit_
MonitorElement * meHENHit_
MonitorElement * meBadIdHit_
MonitorElement * meHEL10EneP_
MonitorElement * meEnergyHit_
MonitorElement * meHOEtaHit_
MonitorElement * meEtaHit_
MonitorElement * meHBEneHit_
MonitorElement * meHOTimHit_
MonitorElement * meHBL10EneP_
MonitorElement * meHEEneHit2_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * meHFPhiHit_
MonitorElement * meDepthHit_
MonitorElement * meHBEtaHit_
MonitorElement * meHODepHit_
MonitorElement * meHEL10Ene_
void showDirStructure(void) const
MonitorElement * meHEEneHit_
MonitorElement * meHEPhiHit_
HcalSimHitStudy(const edm::ParameterSet &ps)
MonitorElement * meSubdetHit_
MonitorElement * meHBPhiHit_
void setCurrentFolder(const std::string &fullpath)
MonitorElement * meHFEneHit_
MonitorElement * meHEEtaHit_
MonitorElement * meHOEneHit_
MonitorElement * meHOEneHit2_