46 void analyzeHits(std::vector<PCaloHit> &,
const std::vector<SimTrack> &);
71 tok_evt_ = consumes<edm::HepMCProduct>(
85 descriptions.
add(
"HFPMTHitAnalyzer",
desc);
95 <<
"please add it to config file";
98 h_HFDepHit = HFHitsDir.
make<TH1F>(
"Hit20",
"Depths in HF", 50, 0., 50.);
99 h_HFDepHit->GetXaxis()->SetTitle(
"Depths in HF");
100 for (
int i = 0;
i < 3;
i++) {
102 sprintf(sub,
"(PMT)");
104 sprintf(sub,
"(Bundle)");
106 sprintf(sub,
"(Jungle)");
107 sprintf(
name,
"Eta%d",
i);
108 sprintf(
title,
"Eta Index of hits in %s", sub);
111 sprintf(
name,
"Phi%d",
i);
112 sprintf(
title,
"Phi Index of hits in %s", sub);
117 hHF_MC_e = HFSourcePart.
make<TH1F>(
"MCEnergy",
"Energy of Generated Particle", 1000, 0., 500.);
118 hHF_MC_e->GetXaxis()->SetTitle(
"Energy of Generated Particle");
122 for (
int i = 0;
i < 3;
i++) {
124 sprintf(sub,
"(Absorber)");
126 sprintf(sub,
"(PMT)");
128 sprintf(sub,
"(All)");
129 sprintf(
name,
"Energy1%d",
i);
130 sprintf(
title,
"Energy in depth 1 %s", sub);
133 sprintf(
name,
"Energy2%d",
i);
134 sprintf(
title,
"Energy in depth 2 %s", sub);
137 sprintf(
name,
"Energy12%d",
i);
138 sprintf(
title,
"Energy in depths 1,2 %s", sub);
141 sprintf(
name,
"Em1%d",
i);
142 sprintf(
title,
"EM energy in depth 1 %s", sub);
145 sprintf(
name,
"Em2%d",
i);
146 sprintf(
title,
"EM energy in depth 2 %s", sub);
149 sprintf(
name,
"Em12%d",
i);
150 sprintf(
title,
"EM energy in depths 1,2 %s", sub);
153 sprintf(
name,
"Had1%d",
i);
154 sprintf(
title,
"Had energy in depth 1 %s", sub);
157 sprintf(
name,
"Had2%d",
i);
158 sprintf(
title,
"Had energy in depth 2 %s", sub);
161 sprintf(
name,
"Had12%d",
i);
162 sprintf(
title,
"Had energy in depths 1,2 %s", sub);
169 for (
int i = 0;
i < 3;
i++) {
171 sprintf(sub,
"(Absorber)");
173 sprintf(sub,
"(PMT)");
175 sprintf(sub,
"(All)");
176 sprintf(
name,
"Time1Ewt%d",
i);
177 sprintf(
title,
"Time (energy weighted) in depth 1 %s", sub);
180 sprintf(
name,
"Time2Ewt%d",
i);
181 sprintf(
title,
"Time (energy weighted) in depth 2 %s", sub);
184 sprintf(
name,
"Time12Ewt%d",
i);
185 sprintf(
title,
"Time (energy weighted) in depths 1,2 %s", sub);
188 sprintf(
name,
"Time1%d",
i);
189 sprintf(
title,
"Time in depth 1 %s", sub);
192 sprintf(
name,
"Time2%d",
i);
193 sprintf(
title,
"Time in depth 2 %s", sub);
196 sprintf(
name,
"Time12%d",
i);
197 sprintf(
title,
"Time in depths 1,2 %s", sub);
208 std::vector<PCaloHit> caloHits;
219 float orig_energy = 0;
220 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
222 orig_energy = (*p)->momentum().e();
226 caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
231 int nHit =
hits.size();
232 float energy1[3], energy2[3], energy12[3];
233 float em1[3], had1[3], em2[3], had2[3], em12[3], had12[3];
234 for (
int i = 0;
i < 3;
i++) {
235 energy1[
i] = energy2[
i] = energy12[
i] = 0;
236 em1[
i] = em2[
i] = em12[
i] = 0;
237 had1[
i] = had2[
i] = had12[
i] = 0;
240 for (
int i = 0;
i < nHit;
i++) {
242 double em =
hits[
i].energyEM();
243 double had =
hits[
i].energyHad();
245 uint32_t id_ =
hits[
i].id();
246 uint16_t pmtHit =
hits[
i].depth();
247 uint16_t depthX = pmtHit;
249 << pmtHit <<
" E (e|h|t) " << em <<
" " << had <<
" " <<
energy <<
" Time " <<
time;
253 int subdet =
id.subdet();
254 int depth =
id.depth();
262 int ieta =
id.ietaAbs();
263 int iphi =
id.iphi();
274 energy1[pmtHit] +=
energy;
275 energy12[pmtHit] +=
energy;
279 had12[pmtHit] += had;
292 energy2[pmtHit] +=
energy;
293 energy12[pmtHit] +=
energy;
297 had12[pmtHit] += had;
312 for (
int i = 0;
i < 3;
i++) {
322 edm::LogVerbatim(
"HFShower") <<
"HFPMTHitAnalyser:: Type " <<
i <<
" Energy 1|2| " << energy1[
i] <<
" "
323 << energy2[
i] <<
" " << energy12[
i] <<
" EM Energy 1|2| " << em1[
i] <<
" " << em2[
i]
324 <<
" " << em12[
i] <<
" Had Energy 1|2| " << had1[
i] <<
" " << had2[
i] <<
" "