15 << hcalHits <<
" / "<< checkHit_
97 LogDebug(
"HcalSim") <<
"Run = " << e.
id().
run() <<
" Event = "
100 std::vector<PCaloHit> caloHits;
103 bool getHits =
false;
106 if (hitsHcal.
isValid()) getHits =
true;
109 LogDebug(
"HcalSim") <<
"HcalValidation: Input flags Hits " << getHits;
112 caloHits.insert(caloHits.end(),hitsHcal->begin(),hitsHcal->end());
113 LogDebug(
"HcalSim") <<
"HcalValidation: Hit buffer "
121 int nHit = hits.size();
122 int nHB=0, nHE=0, nHO=0, nHF=0, nBad1=0, nBad2=0, nBad=0;
123 std::vector<double> encontHB(140, 0.);
124 std::vector<double> encontHE(140, 0.);
125 std::vector<double> encontHF(140, 0.);
126 std::vector<double> encontHO(140, 0.);
127 double entotHB = 0, entotHE = 0, entotHF = 0, entotHO = 0;
129 for (
int i=0;
i<nHit;
i++) {
130 double energy = hits[
i].energy();
131 double log10en = log10(energy);
132 int log10i = int( (log10en+10.)*10. );
133 double time = hits[
i].time();
134 unsigned int id_ = hits[
i].id();
137 int subdet =
id.subdet();
138 int depth =
id.depth();
141 LogDebug(
"HcalSim") <<
"Hit[" <<
i <<
"] ID " << std::hex << id_
142 << std::dec <<
" Det " << det <<
" Sub "
143 << subdet <<
" depth " << depth <<
" Eta " << eta
144 <<
" Phi " << phi <<
" E " << energy <<
" time "
147 if (subdet == static_cast<int>(
HcalBarrel)) nHB++;
148 else if (subdet == static_cast<int>(
HcalEndcap)) nHE++;
149 else if (subdet == static_cast<int>(
HcalOuter)) nHO++;
150 else if (subdet == static_cast<int>(
HcalForward)) nHF++;
151 else { nBad++; nBad2++;}
152 }
else { nBad++; nBad1++;}
171 if( log10i >=0 && log10i < 140 ) encontHB[log10i] +=
energy;
173 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
181 if( log10i >=0 && log10i < 140 ) encontHE[log10i] +=
energy;
183 }
else if (subdet == static_cast<int>(
HcalOuter)) {
191 if( log10i >=0 && log10i < 140 ) encontHO[log10i] +=
energy;
193 }
else if (subdet == static_cast<int>(
HcalForward)) {
201 if( log10i >=0 && log10i < 140 ) encontHF[log10i] +=
energy;
207 if( entotHB != 0 )
for(
int i=0;
i<140;
i++ )
meHBL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHB[
i]/entotHB );
208 if( entotHE != 0 )
for(
int i=0;
i<140;
i++ )
meHEL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHE[
i]/entotHE );
209 if( entotHF != 0 )
for(
int i=0;
i<140;
i++ )
meHFL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHF[
i]/entotHF );
210 if( entotHO != 0 )
for(
int i=0;
i<140;
i++ )
meHOL10EneP_->
Fill( -10.+(
float(
i)+0.5)/10., encontHO[
i]/entotHO );
222 LogDebug(
"HcalSim") <<
"HcalSimHitStudy::analyzeHits: HB " << nHB
223 <<
" HE " << nHE <<
" HO " << nHO <<
" HF " << nHF
224 <<
" Bad " << nBad <<
" All " << nHit;
MonitorElement * mePhiHit_
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_
MonitorElement * meHFEtaHit_
MonitorElement * meHFL10EneP_
MonitorElement * meHFEneHit2_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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_
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_