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";
65 sprintf (histo,
"Ntowers_per_event_vs_ieta" );
68 sprintf (histo,
"CaloTowersTask_map_Nentries" );
76 sprintf (histo,
"emean_vs_ieta_E" );
78 sprintf (histo,
"emean_vs_ieta_H" );
80 sprintf (histo,
"emean_vs_ieta_EH" );
84 sprintf (histo,
"emean_vs_ieta_E1" );
86 sprintf (histo,
"emean_vs_ieta_H1" );
88 sprintf (histo,
"emean_vs_ieta_EH1" );
94 sprintf (histo,
"CaloTowersTask_map_energy_E" );
96 sprintf (histo,
"CaloTowersTask_map_energy_H");
98 sprintf (histo,
"CaloTowersTask_map_energy_EH" );
104 sprintf (histo,
"number_of_bad_cells_Ecal_EB");
106 sprintf (histo,
"number_of_bad_cells_Ecal_EE");
108 sprintf (histo,
"number_of_recovered_cells_Ecal_EB");
110 sprintf (histo,
"number_of_recovered_cells_Ecal_EE");
112 sprintf (histo,
"number_of_problematic_cells_Ecal_EB");
114 sprintf (histo,
"number_of_problematic_cells_Ecal_EE");
118 sprintf (histo,
"CaloTowersTask_map_occupancy" );
121 sprintf (histo,
"CaloTowersTask_occupancy_vs_ieta" );
126 sprintf (histo,
"number_of_bad_cells_Hcal_HB");
128 sprintf (histo,
"number_of_recovered_cells_Hcal_HB");
130 sprintf (histo,
"number_of_problematic_cells_Hcal_HB");
135 sprintf (histo,
"CaloTowersTask_energy_HCAL_HB" ) ;
138 sprintf (histo,
"CaloTowersTask_energy_ECAL_HB" ) ;
141 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HB" ) ;
144 sprintf (histo,
"CaloTowersTask_MET_HB" ) ;
145 MET_HB = ibooker.
book1D(histo, histo, 3000, 0. , 3000. ) ;
147 sprintf (histo,
"CaloTowersTask_SET_HB" ) ;
148 SET_HB = ibooker.
book1D(histo, histo, 8000, 0. , 8000. ) ;
153 sprintf (histo,
"CaloTowersTask_EM_Timing_HB" ) ;
156 sprintf (histo,
"CaloTowersTask_HAD_Timing_HB" ) ;
161 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_Low_HB" ) ;
164 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HB" ) ;
167 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_High_HB" ) ;
170 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HB" ) ;
173 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HB" ) ;
176 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_High_HB" ) ;
180 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HB" ) ;
183 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HB" ) ;
186 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_High_HB" ) ;
189 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HB" ) ;
192 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HB" ) ;
195 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_High_HB" ) ;
201 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HB") ;
204 sprintf (histo,
"CaloTowersTask_energy_OUTER_HB" ) ;
207 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HB" ) ;
210 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HB" ) ;
213 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HB" ) ;
216 sprintf (histo,
"CaloTowersTask_map_energy_HB" );
218 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HB");
220 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HB" );
223 sprintf (histo,
"CaloTowersTask_phi_MET_HB" ) ;
224 phiMET_HB = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
230 sprintf (histo,
"number_of_bad_cells_Hcal_HE");
232 sprintf (histo,
"number_of_recovered_cells_Hcal_HE");
234 sprintf (histo,
"number_of_problematic_cells_Hcal_HE");
239 sprintf (histo,
"CaloTowersTask_energy_HCAL_HE" ) ;
242 sprintf (histo,
"CaloTowersTask_energy_ECAL_HE" ) ;
245 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HE" ) ;
248 sprintf (histo,
"CaloTowersTask_MET_HE" ) ;
249 MET_HE = ibooker.
book1D(histo, histo, 1000, 0. , 1000. ) ;
251 sprintf (histo,
"CaloTowersTask_SET_HE" ) ;
252 SET_HE = ibooker.
book1D(histo, histo, 2000, 0. , 2000. ) ;
257 sprintf (histo,
"CaloTowersTask_EM_Timing_HE" ) ;
260 sprintf (histo,
"CaloTowersTask_HAD_Timing_HE" ) ;
265 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_Low_HE" ) ;
268 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HE" ) ;
271 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_Low_HE" ) ;
274 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HE" ) ;
278 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HE" ) ;
281 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HE" ) ;
284 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HE" ) ;
287 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HE" ) ;
293 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HE") ;
296 sprintf (histo,
"CaloTowersTask_energy_OUTER_HE" ) ;
299 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HE" ) ;
302 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HE" ) ;
305 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HE" ) ;
308 sprintf (histo,
"CaloTowersTask_map_energy_HE" );
310 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HE");
312 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HE" );
315 sprintf (histo,
"CaloTowersTask_phi_MET_HE" ) ;
316 phiMET_HE = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
323 sprintf (histo,
"number_of_bad_cells_Hcal_HF");
325 sprintf (histo,
"number_of_recovered_cells_Hcal_HF");
327 sprintf (histo,
"number_of_problematic_cells_Hcal_HF");
332 sprintf (histo,
"CaloTowersTask_energy_HCAL_HF" ) ;
335 sprintf (histo,
"CaloTowersTask_energy_ECAL_HF" ) ;
338 sprintf (histo,
"CaloTowersTask_number_of_fired_towers_HF" ) ;
341 sprintf (histo,
"CaloTowersTask_MET_HF" ) ;
342 MET_HF = ibooker.
book1D(histo, histo, 500, 0. , 500. ) ;
344 sprintf (histo,
"CaloTowersTask_SET_HF" ) ;
345 SET_HF = ibooker.
book1D(histo, histo, 200, 0. , 200. ) ;
350 sprintf (histo,
"CaloTowersTask_EM_Timing_HF" ) ;
353 sprintf (histo,
"CaloTowersTask_HAD_Timing_HF" ) ;
357 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_HF" ) ;
360 sprintf (histo,
"CaloTowersTask_EM_Energy_Timing_profile_HF" ) ;
364 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_Low_HF" ) ;
367 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_HF" ) ;
370 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_Low_HF" ) ;
373 sprintf (histo,
"CaloTowersTask_HAD_Energy_Timing_profile_HF" ) ;
379 sprintf (histo,
"CaloTowersTask_sum_of_energy_HCAL_vs_ECAL_HF") ;
382 sprintf (histo,
"CaloTowersTask_energy_OUTER_HF" ) ;
385 sprintf (histo,
"CaloTowersTask_energy_of_ECAL_component_of_tower_HF" ) ;
388 sprintf (histo,
"CaloTowersTask_energy_of_HCAL_component_of_tower_HF" ) ;
391 sprintf (histo,
"CaloTowersTask_energy_HcalPlusEcalPlusHO_HF" ) ;
394 sprintf (histo,
"CaloTowersTask_map_energy_HF" );
396 sprintf (histo,
"CaloTowersTask_map_energy_HCAL_HF");
398 sprintf (histo,
"CaloTowersTask_map_energy_ECAL_HF" );
401 sprintf (histo,
"CaloTowersTask_phi_MET_HF" ) ;
402 phiMET_HF = ibooker.
book1D(histo, histo, 72, -3.1415926535898, 3.1415926535898 ) ;
417 double phi_MC = 9999.;
418 double eta_MC = 9999.;
424 std::cout <<
"no HepMCProduct found" << std::endl;
431 double maxPt = -99999.;
433 const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
434 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
435 p != myGenEvent->particles_end(); ++
p ) {
436 double phip = (*p)->momentum().phi();
437 double etap = (*p)->momentum().eta();
440 double pt = (*p)->momentum().perp();
441 if(pt > maxPt) { npart++; maxPt =
pt; phi_MC = phip; eta_MC = etap; }
460 double ieta_MC = 9999;
461 double iphi_MC = 9999;
466 double sumEnergyHcal_HB = 0.;
467 double sumEnergyEcal_HB = 0.;
468 double sumEnergyHO_HB = 0.;
469 Int_t numFiredTowers_HB = 0;
475 double sumEnergyHcal_HE = 0.;
476 double sumEnergyEcal_HE = 0.;
477 double sumEnergyHO_HE = 0.;
478 Int_t numFiredTowers_HE = 0;
484 double sumEnergyHcal_HF = 0.;
485 double sumEnergyEcal_HF = 0.;
486 double sumEnergyHO_HF = 0.;
487 Int_t numFiredTowers_HF = 0;
493 for ( cal = towers->begin(); cal != towers->end(); ++cal ) {
495 double eE = cal->emEnergy();
496 double eH = cal->hadEnergy();
497 double eHO = cal->outerEnergy();
498 double etaT = cal->eta();
499 double phiT = cal->phi();
500 double en = cal->energy();
501 double etT = cal->et();
502 double had_tm = cal->hcalTime();
503 double em_tm = cal->ecalTime();
505 int numBadEcalCells = cal->numBadEcalCells();
506 int numRcvEcalCells = cal->numRecoveredEcalCells();
507 int numPrbEcalCells = cal->numProblematicEcalCells();
509 int numBadHcalCells = cal->numBadHcalCells();
510 int numRcvHcalCells = cal->numRecoveredHcalCells();
511 int numPrbHcalCells = cal->numProblematicHcalCells();
518 int ieta = idT.
ieta();
519 if(ieta > 0) ieta -= 1;
520 int iphi = idT.iphi();
524 std::vector<int> inEcals(2), inHcals(3);
525 unsigned int constitSize = cal->constituentsSize();
526 for(
unsigned int ic=0; ic<constitSize; ic++){
527 DetId detId = cal->constituent(ic);
551 double r =
dR(eta_MC, phi_MC, etaT, phiT);
559 if( fabs(eta_MC) < 3.0 && (ieta > 29 || ieta < -29)) {;}
577 && (fabs(etaT) <
etaMax[0] && fabs(etaT) >=
etaMin[0] )) {
593 sumEnergyHcal_HB += eH;
594 sumEnergyEcal_HB += eE;
595 sumEnergyHO_HB += eHO;
631 && (fabs(etaT) <
etaMax[1] && fabs(etaT) >=
etaMin[1] )) {
647 sumEnergyHcal_HE += eH;
648 sumEnergyEcal_HE += eE;
649 sumEnergyHO_HE += eHO;
680 && (fabs(etaT) <
etaMax[2] && fabs(etaT) >=
etaMin[2] )) {
696 sumEnergyHcal_HF += eH;
697 sumEnergyEcal_HF += eE;
698 sumEnergyHO_HF += eHO;
749 met =
sqrt(metx_HB*metx_HB + mety_HB*mety_HB);
750 Vector metv(metx_HB,mety_HB,metz_HB);
771 met =
sqrt(metx_HE*metx_HE + mety_HE*mety_HE);
772 Vector metv(metx_HE,mety_HE,metz_HE);
792 met =
sqrt(metx_HF*metx_HF + mety_HF*mety_HF);
793 Vector metv(metx_HF,mety_HF,metz_HF);
815 double PI = 3.1415926535898;
816 double deltaphi= phi1 - phi2;
817 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
818 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
819 double deltaeta = eta2 - eta1;
820 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
virtual void analyze(edm::Event const &e, edm::EventSetup const &c)
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
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
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
MonitorElement * numBadCellsHcal_HE
MonitorElement * hadTiming_HF
MonitorElement * numRcvCellsHcal_HE
MonitorElement * meEnergyHcal_HE
MonitorElement * meEnergyEcal_HF
void setCurrentFolder(const std::string &fullpath)
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
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
MonitorElement * mapEnergy_HB