73 usesResource(
"TFileService");
86 edm::LogInfo(
"ElectronStudy") <<
"Module Label: " << g4Label <<
" Hits: " << hitLabEB <<
", " << hitLabEE;
88 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
90 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
92 double tempP[
NPBins_ + 1] = {0.0, 10.0, 20.0, 40.0, 60.0, 100.0, 500.0, 1000.0, 10000.0};
93 double tempEta[
NEtaBins_ + 1] = {0.0, 1.2, 1.6, 3.0};
101 if (!
tfile.isAvailable()) {
102 edm::LogInfo(
"ElectronStudy") <<
"TFileService unavailable: no histograms";
105 char name[20],
title[200], cpbin[30], cebin[30];
107 for (
unsigned int i = 0;
i <
NPBins_ + 1; ++
i) {
109 sprintf(cpbin,
" All p");
114 sprintf(cebin,
" All #eta");
117 sprintf(
name,
"R1%d%d",
i,
j);
118 sprintf(
title,
"E1/E9 for %s%s", cpbin, cebin);
121 histoR1[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
122 sprintf(
name,
"R2%d%d",
i,
j);
123 sprintf(
title,
"E1/E25 for %s%s", cpbin, cebin);
126 histoR2[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
127 sprintf(
name,
"R3%d%d",
i,
j);
128 sprintf(
title,
"E9/E25 for %s%s", cpbin, cebin);
131 histoR3[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
132 sprintf(
name,
"E1x1%d%d",
i,
j);
133 sprintf(
title,
"E1/P for %s%s", cpbin, cebin);
137 sprintf(
name,
"E3x3%d%d",
i,
j);
138 sprintf(
title,
"E9/P for %s%s", cpbin, cebin);
142 sprintf(
name,
"E5x5%d%d",
i,
j);
143 sprintf(
title,
"E25/P for %s%s", cpbin, cebin);
157 desc.addUntracked<
int>(
"Verbosity", 0);
158 descriptions.
add(
"electronStudy",
desc);
188 <<
" valid[EE]: " << caloHitEE.
isValid();
193 edm::PCaloHitContainer::const_iterator ihit;
194 for (ihit = caloHitEB->begin(), indx = 0; ihit != caloHitEB->end(); ihit++, indx++) {
196 edm::LogVerbatim(
"IsoTrack") <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy() <<
" T "
199 for (ihit = caloHitEE->begin(), indx = 0; ihit != caloHitEE->end(); ihit++, indx++) {
201 edm::LogVerbatim(
"IsoTrack") <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy() <<
" T "
205 edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin();
206 for (indx = 0; simTrkItr != SimTk->end(); simTrkItr++, indx++) {
208 edm::LogVerbatim(
"IsoTrack") <<
"ElectronStudy: Track[" << indx <<
"] ID " << simTrkItr->trackId() <<
" type "
209 << simTrkItr->type() <<
" charge " << simTrkItr->charge() <<
" p "
210 << simTrkItr->momentum() <<
" Generator Index " << simTrkItr->genpartIndex()
211 <<
" vertex " << simTrkItr->vertIndex();
212 if (
std::abs(simTrkItr->type()) == 11 && simTrkItr->vertIndex() != -1) {
213 int thisTrk = simTrkItr->trackId();
217 DetId hotCell = isoCell;
222 hotCell, caloHitEB, caloHitEE, geo, caloTopology, 0, 0, -100.0, -100.0, -500.0, 500.0, (
verbose_ > 2));
224 hotCell, caloHitEB, caloHitEE, geo, caloTopology, 1, 1, -100.0, -100.0, -500.0, 500.0, (
verbose_ > 2));
226 hotCell, caloHitEB, caloHitEE, geo, caloTopology, 2, 2, -100.0, -100.0, -500.0, 500.0, (
verbose_ > 2));
227 double p = simTrkItr->momentum().P();
228 double eta =
std::abs(simTrkItr->momentum().eta());
229 int etaBin = -1, momBin = -1;
234 for (
int ipt = 0; ipt <
NPBins_; ipt++) {
238 double r1 = -1,
r2 = -1, r3 = -1;
246 edm::LogVerbatim(
"IsoTrack") <<
"ElectronStudy: p " <<
p <<
" [" << momBin <<
"] eta " <<
eta <<
" ["
253 edm::LogVerbatim(
"IsoTrack") <<
" e1x1 " << e1x1 <<
"|" <<
r1 <<
"|" <<
r2 <<
" e3x3 " << e3x3 <<
"|" << r3