25 tok_HRNDC_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
30 edm::LogInfo(
"OutputInfo") <<
" Hcal SimHit Task histograms will NOT be saved";
68 int iEtaMax = (iEtaHBMax > iEtaHEMax ? iEtaHBMax : iEtaHEMax);
79 float ieta_min_HB = -iEtaHBMax - 1.5;
80 float ieta_max_HB = iEtaHBMax + 1.5;
81 int ieta_bins_HB = (
int)(ieta_max_HB - ieta_min_HB);
83 float ieta_min_HE = -iEtaHEMax - 1.5;
84 float ieta_max_HE = iEtaHEMax + 1.5;
85 int ieta_bins_HE = (
int)(ieta_max_HE - ieta_min_HE);
87 float ieta_min_HF = -iEtaHFMax - 1.5;
88 float ieta_max_HF = iEtaHFMax + 1.5;
89 int ieta_bins_HF = (
int)(ieta_max_HF - ieta_min_HF);
91 float ieta_min_HO = -iEtaHOMax - 1.5;
92 float ieta_max_HO = iEtaHOMax + 1.5;
93 int ieta_bins_HO = (
int)(ieta_max_HO - ieta_min_HO);
97 ib.setCurrentFolder(
"HcalHitsV/HcalSimHitTask");
103 sprintf(
histo,
"N_HB");
112 sprintf(
histo,
"N_HE");
120 sprintf(
histo,
"N_HO");
125 sprintf(
histo,
"N_HF");
136 sprintf(
histo,
"emean_vs_ieta_HB");
142 ib.bookProfile(
histo,
histo, ieta_bins_HB, ieta_min_HB, ieta_max_HB, -10., 2000.,
" "));
146 sprintf(
histo,
"emean_vs_ieta_HE");
152 ib.bookProfile(
histo,
histo, ieta_bins_HE, ieta_min_HE, ieta_max_HE, -10., 2000.,
" "));
155 sprintf(
histo,
"emean_vs_ieta_HO");
160 sprintf(
histo,
"emean_vs_ieta_HF");
166 ib.bookProfile(
histo,
histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF, -10., 2000.,
" "));
172 sprintf(
histo,
"occupancy_vs_ieta_HB");
174 sprintf(
histo,
"occupancy_vs_ieta_HB%d",
depth);
181 sprintf(
histo,
"occupancy_vs_ieta_HE");
183 sprintf(
histo,
"occupancy_vs_ieta_HE%d",
depth);
189 sprintf(
histo,
"occupancy_vs_ieta_HO");
194 sprintf(
histo,
"occupancy_vs_ieta_HF");
196 sprintf(
histo,
"occupancy_vs_ieta_HF%d",
depth);
205 sprintf(
histo,
"HcalSimHitTask_energy_of_simhits_HB");
207 sprintf(
histo,
"HcalSimHitTask_energy_of_simhits_HB%d",
depth);
214 sprintf(
histo,
"HcalSimHitTask_energy_of_simhits_HE");
216 sprintf(
histo,
"HcalSimHitTask_energy_of_simhits_HE%d",
depth);
222 sprintf(
histo,
"HcalSimHitTask_energy_of_simhits_HO");
227 sprintf(
histo,
"HcalSimHitTask_energy_of_simhits_HF");
229 sprintf(
histo,
"HcalSimHitTask_energy_of_simhits_HF%d",
depth);
238 sprintf(
histo,
"HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths");
241 sprintf(
histo,
"HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_E");
244 sprintf(
histo,
"HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_EH");
296 double phi_MC = -999.;
297 double eta_MC = -999.;
302 std::cout <<
"no HepMCProduct found" << std::endl;
306 double maxPt = -99999.;
310 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
312 double phip = (*p)->momentum().phi();
313 double etap = (*p)->momentum().eta();
314 double pt = (*p)->momentum().perp();
328 const float calib_HB = 120.;
329 const float calib_HE = 190.;
330 const float calib_HF1 =
hf1_;
331 const float calib_HF2 =
hf2_;
345 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end();
353 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
354 double etaS = cellGeometry->getPosition().eta();
355 double phiS = cellGeometry->getPosition().phi();
356 double en = SimHits->energy();
359 int depth = cell.depth();
360 double ieta = cell.ieta();
363 double r =
dR(eta_MC, phi_MC, etaS, phiS);
369 ietaMax = cell.ieta();
373 HcalCone += en * calib_HB;
375 HcalCone += en * calib_HE;
376 else if (sub == 4 && (
depth == 1 ||
depth == 3))
377 HcalCone += en * calib_HF1;
378 else if (sub == 4 && (
depth == 2 ||
depth == 4))
379 HcalCone += en * calib_HF2;
437 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResultEB->begin(); SimHits != SimHitResultEB->end();
441 auto cellGeometry =
geometry->getSubdetectorGeometry(EBid)->getGeometry(EBid);
442 double etaS = cellGeometry->getPosition().eta();
443 double phiS = cellGeometry->getPosition().phi();
444 double en = SimHits->energy();
446 double r =
dR(eta_MC, phi_MC, etaS, phiS);
459 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResultEE->begin(); SimHits != SimHitResultEE->end();
463 auto cellGeometry =
geometry->getSubdetectorGeometry(EEid)->getGeometry(EEid);
464 double etaS = cellGeometry->getPosition().eta();
465 double phiS = cellGeometry->getPosition().phi();
466 double en = SimHits->energy();
468 double r =
dR(eta_MC, phi_MC, etaS, phiS);
485 double PI = 3.1415926535898;
486 double deltaphi = phi1 - phi2;
488 deltaphi = phi2 - phi1;
491 deltaphi = 2. *
PI - deltaphi;
494 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
502 double PI = 3.1415926535898;
506 if (a1 > 0.5 *
PI &&
a2 < 0.)
508 if (
a2 > 0.5 *
PI && a1 < 0.)
510 tmp = (a1 * en1 +
a2 * en2) / (en1 + en2);
521 double PI = 3.1415926535898;
524 double tmp =
a2 - a1;