21 HepMCLabel(ps.getParameter<
std::
string>(
"moduleLabelMC")),
22 g4InfoLabel(ps.getParameter<
std::
string>(
"moduleLabelG4")),
35 ib.setCurrentFolder(
"EcalHitsV/EcalSimHitsValidation");
36 ib.setScope(MonitorElementData::Scope::RUN);
41 histo =
"ES hits layer 2 multiplicity z+";
44 histo =
"ES hits layer 1 multiplicity z-";
47 histo =
"ES hits layer 2 multiplicity z-";
50 histo =
"ES hits energy layer 1 z+";
53 histo =
"ES hits energy layer 2 z+";
56 histo =
"ES hits energy layer 1 z-";
59 histo =
"ES hits energy layer 2 z-";
62 histo =
"ES hits log10energy spectrum";
65 histo =
"ES hits log10energy spectrum vs normalized energy";
68 histo =
"ES E1+07E2 z+";
71 histo =
"ES E1+07E2 z-";
74 histo =
"EE vs ES z+";
77 histo =
"EE vs ES z-";
80 histo =
"ES ene2oEne1 z+";
83 histo =
"ES ene2oEne1 z-";
88 edm::LogInfo(
"EventInfo") <<
" Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
99 std::vector<PCaloHit> theEECaloHits;
101 theEECaloHits.insert(theEECaloHits.end(), EcalHitsEE->begin(), EcalHitsEE->end());
104 std::vector<PCaloHit> theESCaloHits;
106 theESCaloHits.insert(theESCaloHits.end(), EcalHitsES->begin(), EcalHitsES->end());
109 double ESEnergy_ = 0.;
116 for (std::vector<PCaloHit>::iterator isim = theEECaloHits.begin(); isim != theEECaloHits.end(); ++isim) {
118 if (eeid.zside() > 0)
119 EEetzp_ += isim->energy();
120 if (eeid.zside() < 0)
121 EEetzm_ += isim->energy();
124 uint32_t nESHits1zp = 0;
125 uint32_t nESHits1zm = 0;
126 uint32_t nESHits2zp = 0;
127 uint32_t nESHits2zm = 0;
128 double ESet1zp_ = 0.;
129 double ESet2zp_ = 0.;
130 double ESet1zm_ = 0.;
131 double ESet2zm_ = 0.;
132 std::vector<double> econtr(140, 0.);
134 for (std::vector<PCaloHit>::iterator isim = theESCaloHits.begin(); isim != theESCaloHits.end(); ++isim) {
139 LogDebug(
"HitInfo") <<
" CaloHit " << isim->getName() <<
"\n"
140 <<
" DetID = " << isim->id() <<
" ESDetId: z side " << esid.zside() <<
" plane "
141 << esid.plane() << esid.six() <<
',' << esid.siy() <<
':' << esid.strip() <<
"\n"
142 <<
" Time = " << isim->time() <<
"\n"
143 <<
" Track Id = " << isim->geantTrackId() <<
"\n"
144 <<
" Energy = " << isim->energy();
146 ESEnergy_ += isim->energy();
147 if (isim->energy() > 0) {
149 int log10i =
int((log10(isim->energy()) + 10.) * 10.);
150 if (log10i >= 0 && log10i < 140)
151 econtr[log10i] += isim->energy();
154 if (esid.plane() == 1) {
155 if (esid.zside() > 0) {
157 ESet1zp_ += isim->energy();
159 }
else if (esid.zside() < 0) {
161 ESet1zm_ += isim->energy();
164 }
else if (esid.plane() == 2) {
165 if (esid.zside() > 0) {
167 ESet2zp_ += isim->energy();
169 }
else if (esid.zside() < 0) {
171 ESet2zm_ += isim->energy();
183 if (ESEnergy_ != 0) {
184 for (
int i = 0;
i < 140;
i++) {
189 for (HepMC::GenEvent::particle_const_iterator
p = MCEvt->
GetEvent()->particles_begin();
192 double htheta = (*p)->momentum().theta();
193 double heta = -99999.;
194 if (
tan(htheta * 0.5) > 0) {
195 heta = -
log(
tan(htheta * 0.5));
198 if (heta > 1.653 && heta < 2.6) {
204 if (heta < -1.653 && heta > -2.6) {