7 : topFolderName_(conf.getParameter<
std::
string>(
"TopFolderName")) {
14 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
39 tok_HRNDC_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord>();
40 tok_Geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
80 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
83 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
86 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
92 sprintf(
histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HB");
95 sprintf(
histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HB");
98 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HB");
101 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HB");
104 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB");
107 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB");
111 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HB");
113 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HB");
120 sprintf(
histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HE");
123 sprintf(
histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HE");
126 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HE");
129 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE");
132 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HE");
136 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HE");
138 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HE");
145 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HO");
148 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HO");
151 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO");
155 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HO");
157 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HO");
164 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HF");
167 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF");
170 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HF");
174 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HF");
176 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFL");
178 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFS");
180 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HF");
182 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFL");
184 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFS");
200 double eHcalCone = 0.;
201 double eHcalConeHB = 0.;
202 double eHcalConeHE = 0.;
203 double eHcalConeHO = 0.;
204 double eHcalConeHF = 0.;
205 double eHcalConeHFL = 0.;
206 double eHcalConeHFS = 0.;
210 int nrechitsCone = 0;
211 int nrechitsThresh = 0;
217 double eEcalCone = 0.;
218 int numrechitsEcal = 0;
221 double phi_MC = -999999.;
222 double eta_MC = -999999.;
231 edm::LogInfo(
"HcalRecHitsValidation") <<
"no HepMCProduct found";
237 double maxPt = -99999.;
240 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
242 double phip = (*p)->momentum().phi();
243 double etap = (*p)->momentum().eta();
246 double pt = (*p)->momentum().perp();
282 for (; RecHit != RecHitEnd; ++RecHit) {
286 double eta = cellGeometry->getPosition().eta();
287 double phi = cellGeometry->getPosition().phi();
288 double en = RecHit->energy();
306 for (; RecHit != RecHitEnd; ++RecHit) {
310 double eta = cellGeometry->getPosition().eta();
311 double phi = cellGeometry->getPosition().phi();
312 double en = RecHit->energy();
334 double HcalCone = 0.;
341 for (
unsigned int i = 0;
i <
cen.size();
i++) {
351 double chi2_log10 = 9.99;
353 chi2_log10 = log10(
chi2);
381 float eta_diff = fabs(eta_MC -
eta);
439 double enSimHits = 0.;
440 double enSimHitsHB = 0.;
441 double enSimHitsHE = 0.;
442 double enSimHitsHO = 0.;
443 double enSimHitsHF = 0.;
444 double enSimHitsHFL = 0.;
445 double enSimHitsHFS = 0.;
448 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end();
459 depth = cell.depth();
470 double en = SimHits->energy();
472 double r =
dR(eta_MC, phi_MC, etaS, phiS);
546 double eta = cellGeometry->getPosition(cell).eta();
547 double phi = cellGeometry->getPosition(cell).phi();
548 double zc = cellGeometry->getPosition(cell).z();
549 int sub = cell.subdet();
550 int depth = cell.depth();
551 int inteta = cell.ieta();
552 int intphi = cell.iphi() - 1;
553 double en =
j->energy();
554 double t =
j->time();
555 double chi2 =
j->chi2();
557 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
563 cieta.push_back(inteta);
564 ciphi.push_back(intphi);
581 double eta = cellGeometry->getPosition().eta();
582 double phi = cellGeometry->getPosition().phi();
583 double zc = cellGeometry->getPosition().z();
584 int sub = cell.subdet();
585 int depth = cell.depth();
586 int inteta = cell.ieta();
587 int intphi = cell.iphi() - 1;
588 double en =
j->energy();
589 double t =
j->time();
591 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
597 cieta.push_back(inteta);
598 ciphi.push_back(intphi);
615 double eta = cellGeometry->getPosition().eta();
616 double phi = cellGeometry->getPosition().phi();
617 double zc = cellGeometry->getPosition().z();
618 int sub = cell.subdet();
619 int depth = cell.depth();
620 int inteta = cell.ieta();
621 int intphi = cell.iphi() - 1;
622 double t =
j->time();
623 double en =
j->energy();
625 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
631 cieta.push_back(inteta);
632 ciphi.push_back(intphi);
643 double PI = 3.1415926535898;
644 double deltaphi = phi1 - phi2;
646 deltaphi = phi2 - phi1;
649 deltaphi = 2. *
PI - deltaphi;
652 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
660 double PI = 3.1415926535898;
664 if (a1 > 0.5 *
PI &&
a2 < 0.)
666 if (
a2 > 0.5 *
PI && a1 < 0.)
668 tmp = (a1 * en1 +
a2 * en2) / (en1 + en2);
679 double PI = 3.1415926535898;
682 double tmp =
a2 - a1;