40 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
59 sprintf(
histo,
"Ntowers_per_event_vs_ieta");
62 sprintf(
histo,
"CaloTowersTask_map_Nentries");
68 sprintf(
histo,
"emean_vs_ieta_E");
70 sprintf(
histo,
"emean_vs_ieta_H");
72 sprintf(
histo,
"emean_vs_ieta_EH");
75 sprintf(
histo,
"emean_vs_ieta_E1");
77 sprintf(
histo,
"emean_vs_ieta_H1");
79 sprintf(
histo,
"emean_vs_ieta_EH1");
85 sprintf(
histo,
"CaloTowersTask_map_energy_E");
87 sprintf(
histo,
"CaloTowersTask_map_energy_H");
89 sprintf(
histo,
"CaloTowersTask_map_energy_EH");
95 sprintf(
histo,
"number_of_bad_cells_Ecal_EB");
97 sprintf(
histo,
"number_of_bad_cells_Ecal_EE");
99 sprintf(
histo,
"number_of_recovered_cells_Ecal_EB");
101 sprintf(
histo,
"number_of_recovered_cells_Ecal_EE");
103 sprintf(
histo,
"number_of_problematic_cells_Ecal_EB");
105 sprintf(
histo,
"number_of_problematic_cells_Ecal_EE");
109 sprintf(
histo,
"CaloTowersTask_map_occupancy");
112 sprintf(
histo,
"CaloTowersTask_occupancy_vs_ieta");
117 sprintf(
histo,
"number_of_bad_cells_Hcal_HB");
119 sprintf(
histo,
"number_of_recovered_cells_Hcal_HB");
121 sprintf(
histo,
"number_of_problematic_cells_Hcal_HB");
126 sprintf(
histo,
"CaloTowersTask_energy_HCAL_HB");
129 sprintf(
histo,
"CaloTowersTask_energy_ECAL_HB");
132 sprintf(
histo,
"CaloTowersTask_number_of_fired_towers_HB");
135 sprintf(
histo,
"CaloTowersTask_MET_HB");
138 sprintf(
histo,
"CaloTowersTask_SET_HB");
144 sprintf(
histo,
"CaloTowersTask_EM_Timing_HB");
147 sprintf(
histo,
"CaloTowersTask_HAD_Timing_HB");
152 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_Low_HB");
155 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_HB");
158 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_High_HB");
161 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HB");
164 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_HB");
167 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_High_HB");
171 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HB");
174 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_HB");
177 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_High_HB");
180 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HB");
183 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HB");
186 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_High_HB");
192 sprintf(
histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HB");
195 sprintf(
histo,
"CaloTowersTask_energy_OUTER_HB");
198 sprintf(
histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HB");
201 sprintf(
histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HB");
204 sprintf(
histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HB");
207 sprintf(
histo,
"CaloTowersTask_map_energy_HB");
209 sprintf(
histo,
"CaloTowersTask_map_energy_HCAL_HB");
211 sprintf(
histo,
"CaloTowersTask_map_energy_ECAL_HB");
214 sprintf(
histo,
"CaloTowersTask_phi_MET_HB");
221 sprintf(
histo,
"number_of_bad_cells_Hcal_HE");
223 sprintf(
histo,
"number_of_recovered_cells_Hcal_HE");
225 sprintf(
histo,
"number_of_problematic_cells_Hcal_HE");
230 sprintf(
histo,
"CaloTowersTask_energy_HCAL_HE");
233 sprintf(
histo,
"CaloTowersTask_energy_ECAL_HE");
236 sprintf(
histo,
"CaloTowersTask_number_of_fired_towers_HE");
239 sprintf(
histo,
"CaloTowersTask_MET_HE");
242 sprintf(
histo,
"CaloTowersTask_SET_HE");
248 sprintf(
histo,
"CaloTowersTask_EM_Timing_HE");
251 sprintf(
histo,
"CaloTowersTask_HAD_Timing_HE");
256 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_Low_HE");
259 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_HE");
262 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HE");
265 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_HE");
269 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HE");
272 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_HE");
275 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HE");
278 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HE");
284 sprintf(
histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HE");
287 sprintf(
histo,
"CaloTowersTask_energy_OUTER_HE");
290 sprintf(
histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HE");
293 sprintf(
histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HE");
296 sprintf(
histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HE");
299 sprintf(
histo,
"CaloTowersTask_map_energy_HE");
301 sprintf(
histo,
"CaloTowersTask_map_energy_HCAL_HE");
303 sprintf(
histo,
"CaloTowersTask_map_energy_ECAL_HE");
306 sprintf(
histo,
"CaloTowersTask_phi_MET_HE");
313 sprintf(
histo,
"number_of_bad_cells_Hcal_HF");
315 sprintf(
histo,
"number_of_recovered_cells_Hcal_HF");
317 sprintf(
histo,
"number_of_problematic_cells_Hcal_HF");
322 sprintf(
histo,
"CaloTowersTask_energy_HCAL_HF");
325 sprintf(
histo,
"CaloTowersTask_energy_ECAL_HF");
328 sprintf(
histo,
"CaloTowersTask_number_of_fired_towers_HF");
331 sprintf(
histo,
"CaloTowersTask_MET_HF");
334 sprintf(
histo,
"CaloTowersTask_SET_HF");
340 sprintf(
histo,
"CaloTowersTask_EM_Timing_HF");
343 sprintf(
histo,
"CaloTowersTask_HAD_Timing_HF");
347 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_HF");
350 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_HF");
354 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HF");
357 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_HF");
360 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HF");
363 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HF");
369 sprintf(
histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HF");
372 sprintf(
histo,
"CaloTowersTask_energy_OUTER_HF");
375 sprintf(
histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HF");
378 sprintf(
histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HF");
381 sprintf(
histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HF");
384 sprintf(
histo,
"CaloTowersTask_map_energy_HF");
386 sprintf(
histo,
"CaloTowersTask_map_energy_HCAL_HF");
388 sprintf(
histo,
"CaloTowersTask_map_energy_ECAL_HF");
391 sprintf(
histo,
"CaloTowersTask_phi_MET_HF");
401 double phi_MC = 9999.;
402 double eta_MC = 9999.;
408 std::cout <<
"no HepMCProduct found" << std::endl;
415 double maxPt = -99999.;
418 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
420 double phip = (*p)->momentum().phi();
421 double etap = (*p)->momentum().eta();
424 double pt = (*p)->momentum().perp();
449 double ieta_MC = 9999;
450 double iphi_MC = 9999;
454 double sumEnergyHcal_HB = 0.;
455 double sumEnergyEcal_HB = 0.;
456 double sumEnergyHO_HB = 0.;
457 Int_t numFiredTowers_HB = 0;
463 double sumEnergyHcal_HE = 0.;
464 double sumEnergyEcal_HE = 0.;
465 double sumEnergyHO_HE = 0.;
466 Int_t numFiredTowers_HE = 0;
472 double sumEnergyHcal_HF = 0.;
473 double sumEnergyEcal_HF = 0.;
474 double sumEnergyHO_HF = 0.;
475 Int_t numFiredTowers_HF = 0;
481 for (cal =
towers->begin(); cal !=
towers->end(); ++cal) {
482 double eE = cal->emEnergy();
483 double eH = cal->hadEnergy();
484 double eHO = cal->outerEnergy();
485 double etaT = cal->eta();
486 double phiT = cal->phi();
487 double en = cal->energy();
488 double etT = cal->et();
489 double had_tm = cal->hcalTime();
490 double em_tm = cal->ecalTime();
492 int numBadEcalCells = cal->numBadEcalCells();
493 int numRcvEcalCells = cal->numRecoveredEcalCells();
494 int numPrbEcalCells = cal->numProblematicEcalCells();
496 int numBadHcalCells = cal->numBadHcalCells();
497 int numRcvHcalCells = cal->numRecoveredHcalCells();
498 int numPrbHcalCells = cal->numProblematicHcalCells();
505 int ieta = idT.ieta();
506 int iphi = idT.iphi();
510 std::vector<int> inEcals(2), inHcals(3);
511 unsigned int constitSize = cal->constituentsSize();
512 for (
unsigned int ic = 0; ic < constitSize; ic++) {
513 DetId detId = cal->constituent(ic);
542 double r =
dR(eta_MC, phi_MC, etaT, phiT);
550 if (fabs(eta_MC) < 3.0 && (
ieta > 29 ||
ieta < -29)) {
582 sumEnergyHcal_HB += eH;
583 sumEnergyEcal_HB += eE;
584 sumEnergyHO_HB += eHO;
634 sumEnergyHcal_HE += eH;
635 sumEnergyEcal_HE += eE;
636 sumEnergyHO_HE += eHO;
681 sumEnergyHcal_HF += eH;
682 sumEnergyEcal_HF += eE;
683 sumEnergyHO_HF += eHO;
729 met =
sqrt(metx_HB * metx_HB + mety_HB * mety_HB);
730 Vector metv(metx_HB, mety_HB, metz_HB);
749 met =
sqrt(metx_HE * metx_HE + mety_HE * mety_HE);
750 Vector metv(metx_HE, mety_HE, metz_HE);
769 met =
sqrt(metx_HF * metx_HF + mety_HF * mety_HF);
770 Vector metv(metx_HF, mety_HF, metz_HF);
790 double PI = 3.1415926535898;
791 double deltaphi = phi1 - phi2;
793 deltaphi = phi2 - phi1;
796 deltaphi = 2. *
PI - deltaphi;
799 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);