33 edm::LogInfo(
"OutputInfo") <<
" Ecal Digi Task histograms will NOT be saved";
69 sprintf(
histo,
"EcalDigiTask Gun Momentum");
72 sprintf(
histo,
"EcalDigiTask Gun Eta");
75 sprintf(
histo,
"EcalDigiTask Gun Phi");
78 sprintf(
histo,
"EcalDigiTask Barrel maximum Digi over Sim ratio");
81 sprintf(
histo,
"EcalDigiTask Endcap maximum Digi over Sim ratio");
84 sprintf(
histo,
"EcalDigiTask Barrel maximum Digi over Sim ratio gt 10 ADC");
87 sprintf(
histo,
"EcalDigiTask Endcap maximum Digi over Sim ratio gt 20 ADC");
90 sprintf(
histo,
"EcalDigiTask Barrel maximum Digi over Sim ratio gt 100 ADC");
93 sprintf(
histo,
"EcalDigiTask Endcap maximum Digi over Sim ratio gt 100 ADC");
98 edm::LogInfo(
"EventInfo") <<
" Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
100 std::vector<SimTrack> theSimTracks;
101 std::vector<SimVertex> theSimVertexes;
126 EBdigis = EcalDigiEB.
product();
127 LogDebug(
"DigiInfo") <<
"total # EBdigis: " << EBdigis->
size();
128 if (EBdigis->
empty())
137 EEdigis = EcalDigiEE.
product();
138 LogDebug(
"DigiInfo") <<
"total # EEdigis: " << EEdigis->
size();
139 if (EEdigis->
empty())
145 bool isPreshower =
true;
148 ESdigis = EcalDigiES.
product();
149 LogDebug(
"DigiInfo") <<
"total # ESdigis: " << ESdigis->
size();
150 if (ESdigis->
empty())
156 theSimTracks.insert(theSimTracks.end(), SimTk->begin(), SimTk->end());
157 theSimVertexes.insert(theSimVertexes.end(), SimVtx->begin(), SimVtx->end());
160 double theGunEnergy = 0.;
161 for (HepMC::GenEvent::particle_const_iterator
p = MCEvt->
GetEvent()->particles_begin();
164 theGunEnergy = (*p)->momentum().e();
165 double htheta = (*p)->momentum().theta();
166 double heta = -
log(
tan(htheta * 0.5));
167 double hphi = (*p)->momentum().phi();
168 hphi = (hphi >= 0) ? hphi : hphi + 2 *
M_PI;
169 hphi = hphi /
M_PI * 180.;
170 LogDebug(
"EventInfo") <<
"Particle gun type form MC = " <<
abs((*p)->pdg_id()) <<
"\n"
171 <<
"Energy = " << (*p)->momentum().e() <<
" Eta = " << heta <<
" Phi = " << hphi;
183 for (std::vector<SimVertex>::iterator isimvtx = theSimVertexes.begin(); isimvtx != theSimVertexes.end(); ++isimvtx) {
184 LogDebug(
"EventInfo") <<
" Vertex index = " << nvtx <<
" event Id = " << isimvtx->eventId().rawId() <<
"\n"
185 <<
" vertex dump: " << *isimvtx;
190 for (std::vector<SimTrack>::iterator isimtrk = theSimTracks.begin(); isimtrk != theSimTracks.end(); ++isimtrk) {
191 LogDebug(
"EventInfo") <<
" Track index = " << ntrk <<
" track Id = " << isimtrk->trackId()
192 <<
" event Id = " << isimtrk->eventId().rawId() <<
"\n"
193 <<
" track dump: " << *isimtrk;
209 LogDebug(
"HitInfo") <<
" CaloHit " << iHit.getName() <<
"\n"
210 <<
" DetID = " << iHit.id() <<
" EBDetId = " << ebid.
ieta() <<
" " << ebid.
iphi() <<
"\n"
211 <<
" Time = " << iHit.time() <<
" Event id. = " << iHit.eventId().rawId() <<
"\n"
212 <<
" Track Id = " << iHit.geantTrackId() <<
"\n"
213 <<
" Energy = " << iHit.energy();
215 uint32_t crystid = ebid.
rawId();
216 ebSimMap[crystid] += iHit.energy();
223 std::vector<double> ebAnalogSignal;
224 std::vector<double> ebADCCounts;
225 std::vector<double> ebADCGains;
230 for (
unsigned int digis = 0; digis < EcalDigiEB->
size(); ++digis) {
232 int nrSamples = ebdf.
size();
238 double pedestalPreSample = 0.;
239 double pedestalPreSampleAnalog = 0.;
242 ebAnalogSignal[
sample] = 0.;
253 if (Emax < ebAnalogSignal[
sample]) {
254 Emax = ebAnalogSignal[
sample];
258 pedestalPreSample += ebADCCounts[
sample];
262 <<
" Gain Id = " << ebADCGains[
sample] <<
" Analog eq = " << ebAnalogSignal[
sample];
265 pedestalPreSample /= 3.;
266 pedestalPreSampleAnalog /= 3.;
267 double Erec = Emax - pedestalPreSampleAnalog *
gainConv_[(
int)ebADCGains[
Pmax]];
269 if (ebSimMap[ebid.
rawId()] != 0.) {
270 LogDebug(
"DigiInfo") <<
" Digi / Hit = " << Erec <<
" / " << ebSimMap[ebid.
rawId()] <<
" gainConv "
294 LogDebug(
"HitInfo") <<
" CaloHit " << iHit.getName() <<
"\n"
295 <<
" DetID = " << iHit.id() <<
" EEDetId side = " << eeid.
zside() <<
" = " << eeid.
ix() <<
" "
297 <<
" Time = " << iHit.time() <<
" Event id. = " << iHit.eventId().rawId() <<
"\n"
298 <<
" Track Id = " << iHit.geantTrackId() <<
"\n"
299 <<
" Energy = " << iHit.energy();
301 uint32_t crystid = eeid.
rawId();
302 eeSimMap[crystid] += iHit.energy();
309 std::vector<double> eeAnalogSignal;
310 std::vector<double> eeADCCounts;
311 std::vector<double> eeADCGains;
316 for (
unsigned int digis = 0; digis < EcalDigiEE->
size(); ++digis) {
318 int nrSamples = eedf.
size();
324 double pedestalPreSample = 0.;
325 double pedestalPreSampleAnalog = 0.;
328 eeAnalogSignal[
sample] = 0.;
339 if (Emax < eeAnalogSignal[
sample]) {
340 Emax = eeAnalogSignal[
sample];
344 pedestalPreSample += eeADCCounts[
sample];
348 <<
" Gain Id = " << eeADCGains[
sample] <<
" Analog eq = " << eeAnalogSignal[
sample];
350 pedestalPreSample /= 3.;
351 pedestalPreSampleAnalog /= 3.;
352 double Erec = Emax - pedestalPreSampleAnalog *
gainConv_[(
int)eeADCGains[
Pmax]];
354 if (eeSimMap[eeid.
rawId()] != 0.) {
355 LogDebug(
"DigiInfo") <<
" Digi / Hit = " << Erec <<
" / " << eeSimMap[eeid.
rawId()] <<
" gainConv "
373 LogDebug(
"HitInfo") <<
" CaloHit " << iHit.getName() <<
"\n"
374 <<
" DetID = " << iHit.id() <<
"ESDetId: z side " << esid.
zside() <<
" plane "
375 << esid.
plane() << esid.
six() <<
',' << esid.
siy() <<
':' << esid.
strip() <<
"\n"
376 <<
" Time = " << iHit.time() <<
" Event id. = " << iHit.eventId().rawId() <<
"\n"
377 <<
" Track Id = " << iHit.geantTrackId() <<
"\n"
378 <<
" Energy = " << iHit.energy();
396 LogDebug(
"EcalDigi") <<
" Gains conversions: "
401 LogDebug(
"EcalDigi") <<
" Gains conversions: "
405 delete defaultRatios;