8 : hcalDDDRecConstantsToken_{esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>()} {
9 tok_towers_ = consumes<CaloTowerCollection>(conf.getUntrackedParameter<
edm::InputTag>(
"CaloTowerCollectionLabel"));
12 outputFile_ = conf.getUntrackedParameter<
std::string>(
"outputFile",
"myfile.root");
14 hcalselector_ = conf.getUntrackedParameter<
std::string>(
"hcalselector",
"all");
16 useAllHistos_ = conf.getUntrackedParameter<
bool>(
"useAllHistos",
false);
27 NphiMax = (hcons.
getNPhi(1) > NphiMax ? hcons.
getNPhi(1) : NphiMax);
28 NphiMax = (hcons.
getNPhi(2) > NphiMax ? hcons.
getNPhi(2) : NphiMax);
29 NphiMax = (hcons.
getNPhi(3) > NphiMax ? hcons.
getNPhi(3) : NphiMax);
71 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
81 sprintf(
histo,
"Ntowers_per_event_vs_ieta");
84 sprintf(
histo,
"CaloTowersTask_map_Nentries");
92 sprintf(
histo,
"emean_vs_ieta_E");
94 sprintf(
histo,
"emean_vs_ieta_H");
96 sprintf(
histo,
"emean_vs_ieta_EH");
100 sprintf(
histo,
"emean_vs_ieta_E1");
102 sprintf(
histo,
"emean_vs_ieta_H1");
104 sprintf(
histo,
"emean_vs_ieta_EH1");
110 sprintf(
histo,
"CaloTowersTask_map_energy_E");
112 sprintf(
histo,
"CaloTowersTask_map_energy_H");
114 sprintf(
histo,
"CaloTowersTask_map_energy_EH");
120 sprintf(
histo,
"number_of_bad_cells_Ecal_EB");
122 sprintf(
histo,
"number_of_bad_cells_Ecal_EE");
124 sprintf(
histo,
"number_of_recovered_cells_Ecal_EB");
126 sprintf(
histo,
"number_of_recovered_cells_Ecal_EE");
128 sprintf(
histo,
"number_of_problematic_cells_Ecal_EB");
130 sprintf(
histo,
"number_of_problematic_cells_Ecal_EE");
134 sprintf(
histo,
"CaloTowersTask_map_occupancy");
137 sprintf(
histo,
"CaloTowersTask_occupancy_vs_ieta");
142 sprintf(
histo,
"number_of_bad_cells_Hcal_HB");
144 sprintf(
histo,
"number_of_recovered_cells_Hcal_HB");
146 sprintf(
histo,
"number_of_problematic_cells_Hcal_HB");
152 sprintf(
histo,
"CaloTowersTask_energy_HCAL_HB");
155 sprintf(
histo,
"CaloTowersTask_energy_ECAL_HB");
158 sprintf(
histo,
"CaloTowersTask_number_of_fired_towers_HB");
161 sprintf(
histo,
"CaloTowersTask_MET_HB");
164 sprintf(
histo,
"CaloTowersTask_SET_HB");
170 sprintf(
histo,
"CaloTowersTask_EM_Timing_HB");
173 sprintf(
histo,
"CaloTowersTask_HAD_Timing_HB");
178 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_Low_HB");
181 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_HB");
184 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_High_HB");
187 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HB");
190 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_HB");
193 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_High_HB");
197 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HB");
200 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_HB");
203 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_High_HB");
206 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HB");
209 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HB");
212 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_High_HB");
216 sprintf(
histo,
"CaloTowersTask_Iphi_HCAL_component_of_tower_HBP");
218 sprintf(
histo,
"CaloTowersTask_Iphi_HCAL_component_of_tower_HBM");
225 sprintf(
histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HB");
228 sprintf(
histo,
"CaloTowersTask_energy_OUTER_HB");
231 sprintf(
histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HB");
234 sprintf(
histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HB");
237 sprintf(
histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HB");
240 sprintf(
histo,
"CaloTowersTask_map_energy_HB");
242 sprintf(
histo,
"CaloTowersTask_map_energy_HCAL_HB");
245 sprintf(
histo,
"CaloTowersTask_map_energy_ECAL_HB");
249 sprintf(
histo,
"CaloTowersTask_phi_MET_HB");
256 sprintf(
histo,
"number_of_bad_cells_Hcal_HE");
258 sprintf(
histo,
"number_of_recovered_cells_Hcal_HE");
260 sprintf(
histo,
"number_of_problematic_cells_Hcal_HE");
266 sprintf(
histo,
"CaloTowersTask_energy_HCAL_HE");
269 sprintf(
histo,
"CaloTowersTask_energy_ECAL_HE");
272 sprintf(
histo,
"CaloTowersTask_number_of_fired_towers_HE");
275 sprintf(
histo,
"CaloTowersTask_MET_HE");
278 sprintf(
histo,
"CaloTowersTask_SET_HE");
284 sprintf(
histo,
"CaloTowersTask_EM_Timing_HE");
287 sprintf(
histo,
"CaloTowersTask_HAD_Timing_HE");
292 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_Low_HE");
295 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_HE");
298 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HE");
301 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_HE");
305 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HE");
308 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_HE");
311 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HE");
314 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HE");
318 sprintf(
histo,
"CaloTowersTask_Iphi_HCAL_component_of_tower_HEP");
320 sprintf(
histo,
"CaloTowersTask_Iphi_HCAL_component_of_tower_HEM");
327 sprintf(
histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HE");
330 sprintf(
histo,
"CaloTowersTask_energy_OUTER_HE");
333 sprintf(
histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HE");
336 sprintf(
histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HE");
339 sprintf(
histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HE");
342 sprintf(
histo,
"CaloTowersTask_map_energy_HE");
344 sprintf(
histo,
"CaloTowersTask_map_energy_HCAL_HE");
347 sprintf(
histo,
"CaloTowersTask_map_energy_ECAL_HE");
351 sprintf(
histo,
"CaloTowersTask_phi_MET_HE");
358 sprintf(
histo,
"number_of_bad_cells_Hcal_HF");
360 sprintf(
histo,
"number_of_recovered_cells_Hcal_HF");
362 sprintf(
histo,
"number_of_problematic_cells_Hcal_HF");
368 sprintf(
histo,
"CaloTowersTask_energy_HCAL_HF");
371 sprintf(
histo,
"CaloTowersTask_energy_ECAL_HF");
374 sprintf(
histo,
"CaloTowersTask_number_of_fired_towers_HF");
377 sprintf(
histo,
"CaloTowersTask_MET_HF");
380 sprintf(
histo,
"CaloTowersTask_SET_HF");
386 sprintf(
histo,
"CaloTowersTask_EM_Timing_HF");
389 sprintf(
histo,
"CaloTowersTask_HAD_Timing_HF");
393 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_HF");
396 sprintf(
histo,
"CaloTowersTask_EM_Energy_Timing_profile_HF");
400 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HF");
403 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_HF");
406 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HF");
409 sprintf(
histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HF");
413 sprintf(
histo,
"CaloTowersTask_Iphi_tower_HFP");
415 sprintf(
histo,
"CaloTowersTask_Iphi_tower_HFM");
422 sprintf(
histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HF");
425 sprintf(
histo,
"CaloTowersTask_energy_OUTER_HF");
428 sprintf(
histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HF");
431 sprintf(
histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HF");
434 sprintf(
histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HF");
437 sprintf(
histo,
"CaloTowersTask_map_energy_HF");
439 sprintf(
histo,
"CaloTowersTask_map_energy_HCAL_HF");
442 sprintf(
histo,
"CaloTowersTask_map_energy_ECAL_HF");
446 sprintf(
histo,
"CaloTowersTask_phi_MET_HF");
471 double ieta_MC = 9999;
472 double iphi_MC = 9999;
475 double sumEnergyHcal_HB = 0.;
476 double sumEnergyEcal_HB = 0.;
477 double sumEnergyHO_HB = 0.;
478 Int_t numFiredTowers_HB = 0;
484 double sumEnergyHcal_HE = 0.;
485 double sumEnergyEcal_HE = 0.;
486 double sumEnergyHO_HE = 0.;
487 Int_t numFiredTowers_HE = 0;
493 double sumEnergyHcal_HF = 0.;
494 double sumEnergyEcal_HF = 0.;
495 double sumEnergyHO_HF = 0.;
496 Int_t numFiredTowers_HF = 0;
502 for (cal =
towers->begin(); cal !=
towers->end(); ++cal) {
503 double eE = cal->emEnergy();
504 double eH = cal->hadEnergy();
505 double eHO = cal->outerEnergy();
506 double etaT = cal->eta();
508 double en = cal->energy();
509 double etT = cal->et();
510 double had_tm = cal->hcalTime();
511 double em_tm = cal->ecalTime();
513 int numBadEcalCells = cal->numBadEcalCells();
514 int numRcvEcalCells = cal->numRecoveredEcalCells();
515 int numPrbEcalCells = cal->numProblematicEcalCells();
517 int numBadHcalCells = cal->numBadHcalCells();
518 int numRcvHcalCells = cal->numRecoveredHcalCells();
519 int numPrbHcalCells = cal->numProblematicHcalCells();
526 int ieta = idT.ieta();
527 int iphi = idT.iphi();
531 std::vector<int> inEcals(2), inHcals(3);
532 unsigned int constitSize = cal->constituentsSize();
533 for (
unsigned int ic = 0; ic < constitSize; ic++) {
534 DetId detId = cal->constituent(ic);
588 sumEnergyHcal_HB += eH;
589 sumEnergyEcal_HB += eE;
590 sumEnergyHO_HB += eHO;
647 sumEnergyHcal_HE += eH;
648 sumEnergyEcal_HE += eE;
649 sumEnergyHO_HE += eHO;
699 sumEnergyHcal_HF += eH;
700 sumEnergyEcal_HF += eE;
701 sumEnergyHO_HF += eHO;
735 met =
sqrt(metx_HB * metx_HB + mety_HB * mety_HB);
736 Vector metv(metx_HB, mety_HB, metz_HB);
755 met =
sqrt(metx_HE * metx_HE + mety_HE * mety_HE);
756 Vector metv(metx_HE, mety_HE, metz_HE);
775 met =
sqrt(metx_HF * metx_HF + mety_HF * mety_HF);
776 Vector metv(metx_HF, mety_HF, metz_HF);
796 double PI = 3.1415926535898;
797 double deltaphi = phi1 - phi2;
799 deltaphi = phi2 - phi1;
802 deltaphi = 2. *
PI - deltaphi;
805 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);