26 if (hcalselector_ ==
"HB")
28 if (hcalselector_ ==
"HE")
30 if (hcalselector_ ==
"HF")
37 if (!outputFile_.empty()) {
38 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will be saved to '" << outputFile_.c_str() <<
"'";
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");
215 phiMET_HB = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898);
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");
307 phiMET_HE = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898);
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");
392 phiMET_HF = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898);
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;
798 double deltaeta = eta2 -
eta1;
799 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
MonitorElement * emean_vs_ieta_E1
T getUntrackedParameter(std::string const &, T const &) const
double dR(double eta1, double phi1, double eta2, double phi2)
MonitorElement * emean_vs_ieta_H1
MonitorElement * mapEnergyEcal_HE
MonitorElement * phiMET_HF
const edm::EventSetup & c
MonitorElement * hadEnergyTiming_profile_Low_HE
MonitorElement * emEnergyTiming_HE
MonitorElement * meEnergyHcalTower_HB
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * mapEnergy_HE
MonitorElement * meTotEnergy_HF
MonitorElement * hadTiming_HE
MonitorElement * hadEnergyTiming_profile_HF
#define DEFINE_FWK_MODULE(type)
MonitorElement * mapEnergyEcal_HB
MonitorElement * hadEnergyTiming_profile_HB
MonitorElement * mapEnergy_HF
MonitorElement * meEnergyHcalvsEcal_HE
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * meEnergyEcal_HB
MonitorElement * meTotEnergy_HB
MonitorElement * numPrbCellsHcal_HE
MonitorElement * hadEnergyTiming_profile_High_HB
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meNumFiredTowers_HF
MonitorElement * phiMET_HE
MonitorElement * mapEnergyHcal_HB
MonitorElement * hadEnergyTiming_profile_HE
MonitorElement * meNumFiredTowers_HE
MonitorElement * hadTiming_HB
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
MonitorElement * emTiming_HB
MonitorElement * hadEnergyTiming_Low_HE
MonitorElement * numBadCellsHcal_HB
MonitorElement * numBadCellsEcal_EE
MonitorElement * hadEnergyTiming_profile_Low_HF
constexpr HcalSubdetector subdet() const
get the subdetector
MonitorElement * numRcvCellsEcal_EB
MonitorElement * meEnergyHcalTower_HF
MonitorElement * meEnergyEcalTower_HB
MonitorElement * numPrbCellsEcal_EB
MonitorElement * numBadCellsEcal_EB
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * emean_vs_ieta_EH
MonitorElement * emEnergyTiming_High_HB
MonitorElement * mapEnergyHcal_HE
MonitorElement * phiMET_HB
MonitorElement * hadEnergyTiming_profile_Low_HB
MonitorElement * emTiming_HF
MonitorElement * emEnergyTiming_Low_HE
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * mapEnergy_E
~CaloTowersValidation() override
MonitorElement * numBadCellsHcal_HF
MonitorElement * numPrbCellsHcal_HB
MonitorElement * meEnergyEcalTower_HE
MonitorElement * meEnergyHcal_HF
MonitorElement * occupancy_vs_ieta
MonitorElement * numPrbCellsHcal_HF
MonitorElement * meEnergyEcalTower_HF
MonitorElement * meEnergyHcalvsEcal_HF
MonitorElement * hadEnergyTiming_High_HB
MonitorElement * emEnergyTiming_HF
MonitorElement * mapEnergy_H
MonitorElement * emTiming_HE
std::string hcalselector_
MonitorElement * emEnergyTiming_profile_Low_HB
MonitorElement * hadEnergyTiming_HF
MonitorElement * numRcvCellsEcal_EE
MonitorElement * meEnergyHO_HE
MonitorElement * numBadCellsHcal_HE
Log< level::Info, false > LogInfo
MonitorElement * hadTiming_HF
MonitorElement * numRcvCellsHcal_HE
MonitorElement * meEnergyHcal_HE
MonitorElement * meEnergyEcal_HF
MonitorElement * meEnergyHcalTower_HE
edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
MonitorElement * hadEnergyTiming_HB
MonitorElement * numRcvCellsHcal_HB
MonitorElement * emEnergyTiming_HB
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * emEnergyTiming_profile_HF
MonitorElement * numRcvCellsHcal_HF
MonitorElement * numPrbCellsEcal_EE
MonitorElement * hadEnergyTiming_Low_HB
MonitorElement * meEnergyHO_HF
void analyze(edm::Event const &e, edm::EventSetup const &c) override
MonitorElement * meEnergyHcal_HB
MonitorElement * emEnergyTiming_Low_HB
MonitorElement * meNumFiredTowers_HB
MonitorElement * Ntowers_vs_ieta
MonitorElement * emean_vs_ieta_EH1
MonitorElement * meEnergyEcal_HE
MonitorElement * occupancy_map
MonitorElement * hadEnergyTiming_Low_HF
MonitorElement * meTotEnergy_HE
MonitorElement * mapEnergyHcal_HF
MonitorElement * emEnergyTiming_profile_Low_HE
MonitorElement * hadEnergyTiming_HE
MonitorElement * emean_vs_ieta_E
int ieta() const
get the tower ieta
MonitorElement * emean_vs_ieta_H
MonitorElement * meEnergyHcalvsEcal_HB
MonitorElement * emEnergyTiming_profile_HE
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * meEnergyHO_HB
MonitorElement * emEnergyTiming_profile_HB
MonitorElement * mapEnergy_EH
MonitorElement * emEnergyTiming_profile_High_HB
const double Rmin[kNumberCalorimeter]
math::RhoEtaPhiVector Vector
MonitorElement * mapEnergy_N
CaloTowersValidation(edm::ParameterSet const &conf)
MonitorElement * mapEnergyEcal_HF
constexpr Detector det() const
get the detector field from this detid
MonitorElement * mapEnergy_HB