47 void analyzeHits(std::vector<PCaloHit> &,
const std::vector<SimTrack> &);
72 tok_evt_ = consumes<edm::HepMCProduct>(
86 descriptions.
add(
"HFPMTHitAnalyzer", desc);
96 <<
"please add it to config file";
99 h_HFDepHit = HFHitsDir.
make<TH1F>(
"Hit20",
"Depths in HF", 50, 0., 50.);
100 h_HFDepHit->GetXaxis()->SetTitle(
"Depths in HF");
101 for (
int i = 0;
i < 3;
i++) {
103 sprintf(sub,
"(PMT)");
105 sprintf(sub,
"(Bundle)");
107 sprintf(sub,
"(Jungle)");
108 sprintf(
name,
"Eta%d",
i);
109 sprintf(
title,
"Eta Index of hits in %s", sub);
112 sprintf(
name,
"Phi%d",
i);
113 sprintf(
title,
"Phi Index of hits in %s", sub);
118 hHF_MC_e = HFSourcePart.
make<TH1F>(
"MCEnergy",
"Energy of Generated Particle", 1000, 0., 500.);
119 hHF_MC_e->GetXaxis()->SetTitle(
"Energy of Generated Particle");
123 for (
int i = 0;
i < 3;
i++) {
125 sprintf(sub,
"(Absorber)");
127 sprintf(sub,
"(PMT)");
129 sprintf(sub,
"(All)");
130 sprintf(
name,
"Energy1%d",
i);
131 sprintf(
title,
"Energy in depth 1 %s", sub);
134 sprintf(
name,
"Energy2%d",
i);
135 sprintf(
title,
"Energy in depth 2 %s", sub);
138 sprintf(
name,
"Energy12%d",
i);
139 sprintf(
title,
"Energy in depths 1,2 %s", sub);
142 sprintf(
name,
"Em1%d",
i);
143 sprintf(
title,
"EM energy in depth 1 %s", sub);
146 sprintf(
name,
"Em2%d",
i);
147 sprintf(
title,
"EM energy in depth 2 %s", sub);
150 sprintf(
name,
"Em12%d",
i);
151 sprintf(
title,
"EM energy in depths 1,2 %s", sub);
154 sprintf(
name,
"Had1%d",
i);
155 sprintf(
title,
"Had energy in depth 1 %s", sub);
158 sprintf(
name,
"Had2%d",
i);
159 sprintf(
title,
"Had energy in depth 2 %s", sub);
162 sprintf(
name,
"Had12%d",
i);
163 sprintf(
title,
"Had energy in depths 1,2 %s", sub);
170 for (
int i = 0;
i < 3;
i++) {
172 sprintf(sub,
"(Absorber)");
174 sprintf(sub,
"(PMT)");
176 sprintf(sub,
"(All)");
177 sprintf(
name,
"Time1Ewt%d",
i);
178 sprintf(
title,
"Time (energy weighted) in depth 1 %s", sub);
181 sprintf(
name,
"Time2Ewt%d",
i);
182 sprintf(
title,
"Time (energy weighted) in depth 2 %s", sub);
185 sprintf(
name,
"Time12Ewt%d",
i);
186 sprintf(
title,
"Time (energy weighted) in depths 1,2 %s", sub);
189 sprintf(
name,
"Time1%d",
i);
190 sprintf(
title,
"Time in depth 1 %s", sub);
193 sprintf(
name,
"Time2%d",
i);
194 sprintf(
title,
"Time in depth 2 %s", sub);
197 sprintf(
name,
"Time12%d",
i);
198 sprintf(
title,
"Time in depths 1,2 %s", sub);
209 std::vector<PCaloHit> caloHits;
220 float orig_energy = 0;
221 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
223 orig_energy = (*p)->momentum().e();
227 caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
232 int nHit =
hits.size();
233 float energy1[3], energy2[3], energy12[3];
234 float em1[3], had1[3], em2[3], had2[3], em12[3], had12[3];
235 for (
int i = 0;
i < 3;
i++) {
236 energy1[
i] = energy2[
i] = energy12[
i] = 0;
237 em1[
i] = em2[
i] = em12[
i] = 0;
238 had1[
i] = had2[
i] = had12[
i] = 0;
241 for (
int i = 0;
i < nHit;
i++) {
243 double em =
hits[
i].energyEM();
244 double had =
hits[
i].energyHad();
246 uint32_t id_ =
hits[
i].id();
247 uint16_t pmtHit =
hits[
i].depth();
248 uint16_t depthX = pmtHit;
250 << pmtHit <<
" E (e|h|t) " << em <<
" " << had <<
" " <<
energy <<
" Time " <<
time;
254 int subdet =
id.subdet();
255 int depth =
id.depth();
263 int ieta =
id.ietaAbs();
264 int iphi =
id.iphi();
275 energy1[pmtHit] +=
energy;
276 energy12[pmtHit] +=
energy;
280 had12[pmtHit] += had;
293 energy2[pmtHit] +=
energy;
294 energy12[pmtHit] +=
energy;
298 had12[pmtHit] += had;
313 for (
int i = 0;
i < 3;
i++) {
323 edm::LogVerbatim(
"HFShower") <<
"HFPMTHitAnalyser:: Type " <<
i <<
" Energy 1|2| " << energy1[
i] <<
" "
324 << energy2[
i] <<
" " << energy12[
i] <<
" EM Energy 1|2| " << em1[
i] <<
" " << em2[
i]
325 <<
" " << em12[
i] <<
" Had Energy 1|2| " << had1[
i] <<
" " << had2[
i] <<
" "