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_.size() != 0 ) {
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" );
72 sprintf (histo,
"emean_vs_ieta_E" );
74 sprintf (histo,
"emean_vs_ieta_H" );
76 sprintf (histo,
"emean_vs_ieta_EH" );
80 sprintf (histo,
"emean_vs_ieta_E1" );
82 sprintf (histo,
"emean_vs_ieta_H1" );
84 sprintf (histo,
"emean_vs_ieta_EH1" );
90 sprintf (histo,
"CaloTowersTask_map_energy_E" );
92 sprintf (histo,
"CaloTowersTask_map_energy_H");
94 sprintf (histo,
"CaloTowersTask_map_energy_EH" );
100 sprintf (histo,
"number_of_bad_cells_Ecal_EB");
102 sprintf (histo,
"number_of_bad_cells_Ecal_EE");
104 sprintf (histo,
"number_of_recovered_cells_Ecal_EB");
106 sprintf (histo,
"number_of_recovered_cells_Ecal_EE");
108 sprintf (histo,
"number_of_problematic_cells_Ecal_EB");
110 sprintf (histo,
"number_of_problematic_cells_Ecal_EE");
114 sprintf (histo,
"CaloTowersTask_map_occupancy" );
117 sprintf (histo,
"CaloTowersTask_occupancy_vs_ieta" );
122 sprintf (histo,
"number_of_bad_cells_Hcal_HB");
124 sprintf (histo,
"number_of_recovered_cells_Hcal_HB");
126 sprintf (histo,
"number_of_problematic_cells_Hcal_HB");
131 sprintf (histo,
"CaloTowersTask_energy_HCAL_HB" ) ;
134 sprintf (histo,
"CaloTowersTask_energy_ECAL_HB" ) ;
137 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HB" ) ;
140 sprintf (histo,
"CaloTowersTask_MET_HB" ) ;
141 MET_HB = ibooker.
book1D(histo, histo, 3000, 0. , 3000. ) ;
143 sprintf (histo,
"CaloTowersTask_SET_HB" ) ;
144 SET_HB = ibooker.
book1D(histo, histo, 8000, 0. , 8000. ) ;
149 sprintf (histo,
"CaloTowersTask_EM_Timing_HB" ) ;
152 sprintf (histo,
"CaloTowersTask_HAD_Timing_HB" ) ;
157 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_Low_HB" ) ;
160 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HB" ) ;
163 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_High_HB" ) ;
166 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HB" ) ;
169 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HB" ) ;
172 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_High_HB" ) ;
176 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HB" ) ;
179 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HB" ) ;
182 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_High_HB" ) ;
185 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HB" ) ;
188 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HB" ) ;
191 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_High_HB" ) ;
197 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HB") ;
200 sprintf (histo,
"CaloTowersTask_energy_OUTER_HB" ) ;
203 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HB" ) ;
206 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HB" ) ;
209 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HB" ) ;
212 sprintf (histo,
"CaloTowersTask_map_energy_HB" );
214 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HB");
216 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HB" );
219 sprintf (histo,
"CaloTowersTask_phi_MET_HB" ) ;
220 phiMET_HB = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
226 sprintf (histo,
"number_of_bad_cells_Hcal_HE");
228 sprintf (histo,
"number_of_recovered_cells_Hcal_HE");
230 sprintf (histo,
"number_of_problematic_cells_Hcal_HE");
235 sprintf (histo,
"CaloTowersTask_energy_HCAL_HE" ) ;
238 sprintf (histo,
"CaloTowersTask_energy_ECAL_HE" ) ;
241 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HE" ) ;
244 sprintf (histo,
"CaloTowersTask_MET_HE" ) ;
245 MET_HE = ibooker.
book1D(histo, histo, 1000, 0. , 1000. ) ;
247 sprintf (histo,
"CaloTowersTask_SET_HE" ) ;
248 SET_HE = ibooker.
book1D(histo, histo, 2000, 0. , 2000. ) ;
253 sprintf (histo,
"CaloTowersTask_EM_Timing_HE" ) ;
256 sprintf (histo,
"CaloTowersTask_HAD_Timing_HE" ) ;
261 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_Low_HE" ) ;
264 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HE" ) ;
267 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HE" ) ;
270 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HE" ) ;
274 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HE" ) ;
277 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HE" ) ;
280 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HE" ) ;
283 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HE" ) ;
289 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HE") ;
292 sprintf (histo,
"CaloTowersTask_energy_OUTER_HE" ) ;
295 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HE" ) ;
298 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HE" ) ;
301 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HE" ) ;
304 sprintf (histo,
"CaloTowersTask_map_energy_HE" );
306 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HE");
308 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HE" );
311 sprintf (histo,
"CaloTowersTask_phi_MET_HE" ) ;
312 phiMET_HE = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
319 sprintf (histo,
"number_of_bad_cells_Hcal_HF");
321 sprintf (histo,
"number_of_recovered_cells_Hcal_HF");
323 sprintf (histo,
"number_of_problematic_cells_Hcal_HF");
328 sprintf (histo,
"CaloTowersTask_energy_HCAL_HF" ) ;
331 sprintf (histo,
"CaloTowersTask_energy_ECAL_HF" ) ;
334 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HF" ) ;
337 sprintf (histo,
"CaloTowersTask_MET_HF" ) ;
338 MET_HF = ibooker.
book1D(histo, histo, 500, 0. , 500. ) ;
340 sprintf (histo,
"CaloTowersTask_SET_HF" ) ;
341 SET_HF = ibooker.
book1D(histo, histo, 2000, 0. , 2000. ) ;
346 sprintf (histo,
"CaloTowersTask_EM_Timing_HF" ) ;
349 sprintf (histo,
"CaloTowersTask_HAD_Timing_HF" ) ;
353 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HF" ) ;
356 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HF" ) ;
360 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HF" ) ;
363 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HF" ) ;
366 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HF" ) ;
369 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HF" ) ;
375 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HF") ;
378 sprintf (histo,
"CaloTowersTask_energy_OUTER_HF" ) ;
381 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HF" ) ;
384 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HF" ) ;
387 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HF" ) ;
390 sprintf (histo,
"CaloTowersTask_map_energy_HF" );
392 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HF");
394 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HF" );
397 sprintf (histo,
"CaloTowersTask_phi_MET_HF" ) ;
398 phiMET_HF = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
413 double phi_MC = 9999.;
414 double eta_MC = 9999.;
420 std::cout <<
"no HepMCProduct found" << std::endl;
427 double maxPt = -99999.;
429 const HepMC::GenEvent * myGenEvent = evtMC->
GetEvent();
430 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
431 p != myGenEvent->particles_end(); ++
p ) {
432 double phip = (*p)->momentum().phi();
433 double etap = (*p)->momentum().eta();
436 double pt = (*p)->momentum().perp();
437 if(pt > maxPt) { npart++; maxPt =
pt; phi_MC = phip; eta_MC = etap; }
456 double ieta_MC = 9999;
457 double iphi_MC = 9999;
462 double sumEnergyHcal_HB = 0.;
463 double sumEnergyEcal_HB = 0.;
464 double sumEnergyHO_HB = 0.;
465 Int_t numFiredTowers_HB = 0;
471 double sumEnergyHcal_HE = 0.;
472 double sumEnergyEcal_HE = 0.;
473 double sumEnergyHO_HE = 0.;
474 Int_t numFiredTowers_HE = 0;
480 double sumEnergyHcal_HF = 0.;
481 double sumEnergyEcal_HF = 0.;
482 double sumEnergyHO_HF = 0.;
483 Int_t numFiredTowers_HF = 0;
489 for ( cal = towers->
begin(); cal != towers->
end(); ++cal ) {
491 double eE = cal->emEnergy();
492 double eH = cal->hadEnergy();
493 double eHO = cal->outerEnergy();
494 double etaT = cal->eta();
495 double phiT = cal->phi();
496 double en = cal->energy();
497 double etT = cal->et();
498 double had_tm = cal->hcalTime();
499 double em_tm = cal->ecalTime();
501 int numBadEcalCells = cal->numBadEcalCells();
502 int numRcvEcalCells = cal->numRecoveredEcalCells();
503 int numPrbEcalCells = cal->numProblematicEcalCells();
505 int numBadHcalCells = cal->numBadHcalCells();
506 int numRcvHcalCells = cal->numRecoveredHcalCells();
507 int numPrbHcalCells = cal->numProblematicHcalCells();
514 int ieta = idT.
ieta();
515 if(ieta > 0) ieta -= 1;
516 int iphi = idT.iphi();
520 std::vector<int> inEcals(2), inHcals(3);
521 unsigned int constitSize = cal->constituentsSize();
522 for(
unsigned int ic=0; ic<constitSize; ic++){
523 DetId detId = cal->constituent(ic);
547 double r =
dR(eta_MC, phi_MC, etaT, phiT);
555 if( fabs(eta_MC) < 3.0 && (ieta > 29 || ieta < -29)) {;}
573 && (fabs(etaT) <
etaMax[0] && fabs(etaT) >=
etaMin[0] )) {
589 sumEnergyHcal_HB += eH;
590 sumEnergyEcal_HB += eE;
591 sumEnergyHO_HB += eHO;
627 && (fabs(etaT) <
etaMax[1] && fabs(etaT) >=
etaMin[1] )) {
643 sumEnergyHcal_HE += eH;
644 sumEnergyEcal_HE += eE;
645 sumEnergyHO_HE += eHO;
676 && (fabs(etaT) <
etaMax[2] && fabs(etaT) >=
etaMin[2] )) {
692 sumEnergyHcal_HF += eH;
693 sumEnergyEcal_HF += eE;
694 sumEnergyHO_HF += eHO;
745 met =
sqrt(metx_HB*metx_HB + mety_HB*mety_HB);
746 Vector metv(metx_HB,mety_HB,metz_HB);
767 met =
sqrt(metx_HE*metx_HE + mety_HE*mety_HE);
768 Vector metv(metx_HE,mety_HE,metz_HE);
788 met =
sqrt(metx_HF*metx_HF + mety_HF*mety_HF);
789 Vector metv(metx_HF,mety_HF,metz_HF);
811 double PI = 3.1415926535898;
812 double deltaphi= phi1 - phi2;
813 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
814 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
815 double deltaeta = eta2 - eta1;
816 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
virtual 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
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
MonitorElement * book1D(Args &&...args)
MonitorElement * mapEnergy_E
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
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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
void setCurrentFolder(const std::string &fullpath)
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
virtual 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
Detector det() const
get the detector field from this detid
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
MonitorElement * mapEnergy_HB