28 if(hcalselector_ ==
"HB")
isub = 1;
29 if(hcalselector_ ==
"HE")
isub = 2;
30 if(hcalselector_ ==
"HF")
isub = 3;
33 if(mc_ ==
"no")
imc = 0;
35 if ( !outputFile_.empty() ) {
36 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will be saved to '" << outputFile_.c_str() <<
"'";
38 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
61 sprintf (histo,
"Ntowers_per_event_vs_ieta" );
64 sprintf (histo,
"CaloTowersTask_map_Nentries" );
70 sprintf (histo,
"emean_vs_ieta_E" );
72 sprintf (histo,
"emean_vs_ieta_H" );
74 sprintf (histo,
"emean_vs_ieta_EH" );
77 sprintf (histo,
"emean_vs_ieta_E1" );
79 sprintf (histo,
"emean_vs_ieta_H1" );
81 sprintf (histo,
"emean_vs_ieta_EH1" );
87 sprintf (histo,
"CaloTowersTask_map_energy_E" );
89 sprintf (histo,
"CaloTowersTask_map_energy_H");
91 sprintf (histo,
"CaloTowersTask_map_energy_EH" );
97 sprintf (histo,
"number_of_bad_cells_Ecal_EB");
99 sprintf (histo,
"number_of_bad_cells_Ecal_EE");
101 sprintf (histo,
"number_of_recovered_cells_Ecal_EB");
103 sprintf (histo,
"number_of_recovered_cells_Ecal_EE");
105 sprintf (histo,
"number_of_problematic_cells_Ecal_EB");
107 sprintf (histo,
"number_of_problematic_cells_Ecal_EE");
111 sprintf (histo,
"CaloTowersTask_map_occupancy" );
114 sprintf (histo,
"CaloTowersTask_occupancy_vs_ieta" );
119 sprintf (histo,
"number_of_bad_cells_Hcal_HB");
121 sprintf (histo,
"number_of_recovered_cells_Hcal_HB");
123 sprintf (histo,
"number_of_problematic_cells_Hcal_HB");
128 sprintf (histo,
"CaloTowersTask_energy_HCAL_HB" ) ;
131 sprintf (histo,
"CaloTowersTask_energy_ECAL_HB" ) ;
134 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HB" ) ;
137 sprintf (histo,
"CaloTowersTask_MET_HB" ) ;
138 MET_HB = ibooker.
book1D(histo, histo, 3000, 0. , 3000. ) ;
140 sprintf (histo,
"CaloTowersTask_SET_HB" ) ;
141 SET_HB = ibooker.
book1D(histo, histo, 8000, 0. , 8000. ) ;
146 sprintf (histo,
"CaloTowersTask_EM_Timing_HB" ) ;
149 sprintf (histo,
"CaloTowersTask_HAD_Timing_HB" ) ;
154 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_Low_HB" ) ;
157 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HB" ) ;
160 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_High_HB" ) ;
163 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HB" ) ;
166 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HB" ) ;
169 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_High_HB" ) ;
173 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HB" ) ;
176 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HB" ) ;
179 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_High_HB" ) ;
182 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HB" ) ;
185 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HB" ) ;
188 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_High_HB" ) ;
194 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HB") ;
197 sprintf (histo,
"CaloTowersTask_energy_OUTER_HB" ) ;
200 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HB" ) ;
203 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HB" ) ;
206 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HB" ) ;
209 sprintf (histo,
"CaloTowersTask_map_energy_HB" );
211 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HB");
213 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HB" );
216 sprintf (histo,
"CaloTowersTask_phi_MET_HB" ) ;
217 phiMET_HB = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
223 sprintf (histo,
"number_of_bad_cells_Hcal_HE");
225 sprintf (histo,
"number_of_recovered_cells_Hcal_HE");
227 sprintf (histo,
"number_of_problematic_cells_Hcal_HE");
232 sprintf (histo,
"CaloTowersTask_energy_HCAL_HE" ) ;
235 sprintf (histo,
"CaloTowersTask_energy_ECAL_HE" ) ;
238 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HE" ) ;
241 sprintf (histo,
"CaloTowersTask_MET_HE" ) ;
242 MET_HE = ibooker.
book1D(histo, histo, 1000, 0. , 1000. ) ;
244 sprintf (histo,
"CaloTowersTask_SET_HE" ) ;
245 SET_HE = ibooker.
book1D(histo, histo, 2000, 0. , 2000. ) ;
250 sprintf (histo,
"CaloTowersTask_EM_Timing_HE" ) ;
253 sprintf (histo,
"CaloTowersTask_HAD_Timing_HE" ) ;
258 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_Low_HE" ) ;
261 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HE" ) ;
264 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HE" ) ;
267 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HE" ) ;
271 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HE" ) ;
274 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HE" ) ;
277 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HE" ) ;
280 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HE" ) ;
286 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HE") ;
289 sprintf (histo,
"CaloTowersTask_energy_OUTER_HE" ) ;
292 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HE" ) ;
295 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HE" ) ;
298 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HE" ) ;
301 sprintf (histo,
"CaloTowersTask_map_energy_HE" );
303 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HE");
305 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HE" );
308 sprintf (histo,
"CaloTowersTask_phi_MET_HE" ) ;
309 phiMET_HE = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
316 sprintf (histo,
"number_of_bad_cells_Hcal_HF");
318 sprintf (histo,
"number_of_recovered_cells_Hcal_HF");
320 sprintf (histo,
"number_of_problematic_cells_Hcal_HF");
325 sprintf (histo,
"CaloTowersTask_energy_HCAL_HF" ) ;
328 sprintf (histo,
"CaloTowersTask_energy_ECAL_HF" ) ;
331 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HF" ) ;
334 sprintf (histo,
"CaloTowersTask_MET_HF" ) ;
335 MET_HF = ibooker.
book1D(histo, histo, 500, 0. , 500. ) ;
337 sprintf (histo,
"CaloTowersTask_SET_HF" ) ;
338 SET_HF = ibooker.
book1D(histo, histo, 2000, 0. , 2000. ) ;
343 sprintf (histo,
"CaloTowersTask_EM_Timing_HF" ) ;
346 sprintf (histo,
"CaloTowersTask_HAD_Timing_HF" ) ;
350 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HF" ) ;
353 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HF" ) ;
357 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HF" ) ;
360 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HF" ) ;
363 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HF" ) ;
366 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HF" ) ;
372 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HF") ;
375 sprintf (histo,
"CaloTowersTask_energy_OUTER_HF" ) ;
378 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HF" ) ;
381 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HF" ) ;
384 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HF" ) ;
387 sprintf (histo,
"CaloTowersTask_map_energy_HF" );
389 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HF");
391 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HF" );
394 sprintf (histo,
"CaloTowersTask_phi_MET_HF" ) ;
395 phiMET_HF = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
410 double phi_MC = 9999.;
411 double eta_MC = 9999.;
417 std::cout <<
"no HepMCProduct found" << std::endl;
424 double maxPt = -99999.;
426 const HepMC::GenEvent * myGenEvent = evtMC->
GetEvent();
427 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
428 p != myGenEvent->particles_end(); ++
p ) {
429 double phip = (*p)->momentum().phi();
430 double etap = (*p)->momentum().eta();
433 double pt = (*p)->momentum().perp();
434 if(pt > maxPt) { npart++; maxPt =
pt; phi_MC = phip; eta_MC = etap; }
453 double ieta_MC = 9999;
454 double iphi_MC = 9999;
459 double sumEnergyHcal_HB = 0.;
460 double sumEnergyEcal_HB = 0.;
461 double sumEnergyHO_HB = 0.;
462 Int_t numFiredTowers_HB = 0;
468 double sumEnergyHcal_HE = 0.;
469 double sumEnergyEcal_HE = 0.;
470 double sumEnergyHO_HE = 0.;
471 Int_t numFiredTowers_HE = 0;
477 double sumEnergyHcal_HF = 0.;
478 double sumEnergyEcal_HF = 0.;
479 double sumEnergyHO_HF = 0.;
480 Int_t numFiredTowers_HF = 0;
486 for ( cal = towers->
begin(); cal != towers->
end(); ++cal ) {
488 double eE = cal->emEnergy();
489 double eH = cal->hadEnergy();
490 double eHO = cal->outerEnergy();
491 double etaT = cal->eta();
492 double phiT = cal->phi();
493 double en = cal->energy();
494 double etT = cal->et();
495 double had_tm = cal->hcalTime();
496 double em_tm = cal->ecalTime();
498 int numBadEcalCells = cal->numBadEcalCells();
499 int numRcvEcalCells = cal->numRecoveredEcalCells();
500 int numPrbEcalCells = cal->numProblematicEcalCells();
502 int numBadHcalCells = cal->numBadHcalCells();
503 int numRcvHcalCells = cal->numRecoveredHcalCells();
504 int numPrbHcalCells = cal->numProblematicHcalCells();
511 int ieta = idT.
ieta();
512 int iphi = idT.iphi();
516 std::vector<int> inEcals(2), inHcals(3);
517 unsigned int constitSize = cal->constituentsSize();
518 for(
unsigned int ic=0; ic<constitSize; ic++){
519 DetId detId = cal->constituent(ic);
543 double r =
dR(eta_MC, phi_MC, etaT, phiT);
551 if( fabs(eta_MC) < 3.0 && (ieta > 29 || ieta < -29)) {;}
569 && (fabs(etaT) <
etaMax[0] && fabs(etaT) >=
etaMin[0] )) {
585 sumEnergyHcal_HB += eH;
586 sumEnergyEcal_HB += eE;
587 sumEnergyHO_HB += eHO;
623 && (fabs(etaT) <
etaMax[1] && fabs(etaT) >=
etaMin[1] )) {
639 sumEnergyHcal_HE += eH;
640 sumEnergyEcal_HE += eE;
641 sumEnergyHO_HE += eHO;
672 && (fabs(etaT) <
etaMax[2] && fabs(etaT) >=
etaMin[2] )) {
688 sumEnergyHcal_HF += eH;
689 sumEnergyEcal_HF += eE;
690 sumEnergyHO_HF += eHO;
739 met =
sqrt(metx_HB*metx_HB + mety_HB*mety_HB);
740 Vector metv(metx_HB,mety_HB,metz_HB);
761 met =
sqrt(metx_HE*metx_HE + mety_HE*mety_HE);
762 Vector metv(metx_HE,mety_HE,metz_HE);
782 met =
sqrt(metx_HF*metx_HF + mety_HF*mety_HF);
783 Vector metv(metx_HF,mety_HF,metz_HF);
805 double PI = 3.1415926535898;
806 double deltaphi= phi1 - phi2;
807 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
808 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
809 double deltaeta = eta2 - eta1;
810 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
MonitorElement * hadEnergyTiming_profile_Low_HE
HcalSubdetector subdet() const
get the subdetector
MonitorElement * emEnergyTiming_HE
MonitorElement * meEnergyHcalTower_HB
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
MonitorElement * mapEnergy_HE
MonitorElement * bookProfile(Args &&...args)
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
MonitorElement * numRcvCellsEcal_EB
MonitorElement * meEnergyHcalTower_HF
void setCurrentFolder(std::string const &fullpath)
MonitorElement * meEnergyEcalTower_HB
MonitorElement * numPrbCellsEcal_EB
MonitorElement * numBadCellsEcal_EB
MonitorElement * emean_vs_ieta_EH
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
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 * book1D(Args &&...args)
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
const_iterator end() const
MonitorElement * numBadCellsHcal_HE
MonitorElement * hadTiming_HF
MonitorElement * numRcvCellsHcal_HE
MonitorElement * meEnergyHcal_HE
MonitorElement * meEnergyEcal_HF
const HepMC::GenEvent * GetEvent() const
MonitorElement * meEnergyHcalTower_HE
MonitorElement * book2D(Args &&...args)
edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
MonitorElement * hadEnergyTiming_HB
MonitorElement * numRcvCellsHcal_HB
MonitorElement * emEnergyTiming_HB
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
std::vector< std::vector< double > > tmp
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 * 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
const_iterator begin() const
constexpr Detector det() const
get the detector field from this detid
MonitorElement * mapEnergy_HB