9 : topFolderName_(conf.getParameter<
std::
string>(
"TopFolderName")) {
16 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
79 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
82 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
85 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
91 sprintf(
histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HB");
94 sprintf(
histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HB");
97 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HB");
100 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HB");
103 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB");
106 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB");
110 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HB");
112 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HB");
119 sprintf(
histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HE");
122 sprintf(
histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HE");
125 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HE");
128 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE");
131 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HE");
135 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HE");
137 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HE");
144 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HO");
147 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HO");
150 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO");
154 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HO");
156 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HO");
163 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HF");
166 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF");
169 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HF");
173 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HF");
175 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFL");
177 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFS");
179 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HF");
181 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFL");
183 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFS");
201 double eHcalCone = 0.;
202 double eHcalConeHB = 0.;
203 double eHcalConeHE = 0.;
204 double eHcalConeHO = 0.;
205 double eHcalConeHF = 0.;
206 double eHcalConeHFL = 0.;
207 double eHcalConeHFS = 0.;
211 int nrechitsCone = 0;
212 int nrechitsThresh = 0;
218 double eEcalCone = 0.;
219 int numrechitsEcal = 0;
222 double phi_MC = -999999.;
223 double eta_MC = -999999.;
232 edm::LogInfo(
"HcalRecHitsValidation") <<
"no HepMCProduct found";
238 double maxPt = -99999.;
241 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
243 double phip = (*p)->momentum().phi();
244 double etap = (*p)->momentum().eta();
247 double pt = (*p)->momentum().perp();
282 for (; RecHit != RecHitEnd; ++RecHit) {
285 auto cellGeometry =
geometry->getSubdetectorGeometry(EBid)->getGeometry(EBid);
286 double eta = cellGeometry->getPosition().eta();
287 double phi = cellGeometry->getPosition().phi();
288 double en = RecHit->energy();
306 for (; RecHit != RecHitEnd; ++RecHit) {
309 auto cellGeometry =
geometry->getSubdetectorGeometry(EEid)->getGeometry(EEid);
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);
440 double enSimHits = 0.;
441 double enSimHitsHB = 0.;
442 double enSimHitsHE = 0.;
443 double enSimHitsHO = 0.;
444 double enSimHitsHF = 0.;
445 double enSimHitsHFL = 0.;
446 double enSimHitsHFS = 0.;
449 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end();
460 depth = cell.depth();
471 double en = SimHits->energy();
473 double r =
dR(eta_MC, phi_MC, etaS, phiS);
549 double eta = cellGeometry->getPosition(cell).eta();
550 double phi = cellGeometry->getPosition(cell).phi();
551 double zc = cellGeometry->getPosition(cell).z();
552 int sub = cell.subdet();
553 int depth = cell.depth();
554 int inteta = cell.ieta();
555 int intphi = cell.iphi() - 1;
556 double en =
j->energy();
557 double t =
j->time();
558 double chi2 =
j->chi2();
560 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
566 cieta.push_back(inteta);
567 ciphi.push_back(intphi);
582 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
584 double eta = cellGeometry->getPosition().eta();
585 double phi = cellGeometry->getPosition().phi();
586 double zc = cellGeometry->getPosition().z();
587 int sub = cell.subdet();
588 int depth = cell.depth();
589 int inteta = cell.ieta();
590 int intphi = cell.iphi() - 1;
591 double en =
j->energy();
592 double t =
j->time();
594 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
600 cieta.push_back(inteta);
601 ciphi.push_back(intphi);
616 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
618 double eta = cellGeometry->getPosition().eta();
619 double phi = cellGeometry->getPosition().phi();
620 double zc = cellGeometry->getPosition().z();
621 int sub = cell.subdet();
622 int depth = cell.depth();
623 int inteta = cell.ieta();
624 int intphi = cell.iphi() - 1;
625 double t =
j->time();
626 double en =
j->energy();
628 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
634 cieta.push_back(inteta);
635 ciphi.push_back(intphi);
646 double PI = 3.1415926535898;
647 double deltaphi = phi1 - phi2;
649 deltaphi = phi2 - phi1;
652 deltaphi = 2. *
PI - deltaphi;
655 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
663 double PI = 3.1415926535898;
667 if (a1 > 0.5 *
PI &&
a2 < 0.)
669 if (
a2 > 0.5 *
PI && a1 < 0.)
671 tmp = (a1 * en1 +
a2 * en2) / (en1 + en2);
682 double PI = 3.1415926535898;
685 double tmp =
a2 - a1;