17 edm::LogInfo(
"OutputInfo") <<
" Hcal SimHit Task histograms will NOT be saved";
36 sprintf (histo,
"N_HB" );
37 Nhb = ib.
book1D(histo, histo, 2600,0.,2600.);
38 sprintf (histo,
"N_HE" );
39 Nhe = ib.
book1D(histo, histo, 2600,0.,2600.);
40 sprintf (histo,
"N_HO" );
41 Nho = ib.
book1D(histo, histo, 2200,0.,2200.);
42 sprintf (histo,
"N_HF" );
43 Nhf = ib.
book1D(histo, histo, 1800,0., 1800.);
46 sprintf (histo,
"emean_vs_ieta_HB1" );
48 sprintf (histo,
"emean_vs_ieta_HB2" );
50 sprintf (histo,
"emean_vs_ieta_HE1" );
52 sprintf (histo,
"emean_vs_ieta_HE2" );
54 sprintf (histo,
"emean_vs_ieta_HE3" );
56 sprintf (histo,
"emean_vs_ieta_HO" );
58 sprintf (histo,
"emean_vs_ieta_HF1" );
60 sprintf (histo,
"emean_vs_ieta_HF2" );
64 sprintf (histo,
"occupancy_vs_ieta_HB1" );
66 sprintf (histo,
"occupancy_vs_ieta_HB2" );
68 sprintf (histo,
"occupancy_vs_ieta_HE1" );
70 sprintf (histo,
"occupancy_vs_ieta_HE2" );
72 sprintf (histo,
"occupancy_vs_ieta_HE3" );
74 sprintf (histo,
"occupancy_vs_ieta_HO" );
76 sprintf (histo,
"occupancy_vs_ieta_HF1" );
78 sprintf (histo,
"occupancy_vs_ieta_HF2" );
82 sprintf (histo,
"HcalSimHitTask_energy_of_simhits_HB" ) ;
85 sprintf (histo,
"HcalSimHitTask_energy_of_simhits_HE" ) ;
88 sprintf (histo,
"HcalSimHitTask_energy_of_simhits_HO" ) ;
91 sprintf (histo,
"HcalSimHitTask_energy_of_simhits_HF" ) ;
95 sprintf (histo,
"HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths");
98 sprintf (histo,
"HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_E");
101 sprintf (histo,
"HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_EH");
126 if(ieta >=0 ) ieta +=1;
130 if (fabs(ieta) <= 20) phi_factor = 72.;
131 else if (fabs(ieta) < 40) phi_factor = 36.;
132 else phi_factor = 18.;
173 double phi_MC = -999.;
174 double eta_MC = -999.;
178 if (!evtMC.isValid()) {
179 std::cout <<
"no HepMCProduct found" << std::endl;
183 double maxPt = -99999.;
186 const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
187 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
188 p != myGenEvent->particles_end(); ++
p ) {
189 double phip = (*p)->momentum().phi();
190 double etap = (*p)->momentum().eta();
191 double pt = (*p)->momentum().perp();
192 if(pt > maxPt) {
npart++; maxPt =
pt; phi_MC = phip; eta_MC = etap; }
201 const float calib_HB = 120.;
202 const float calib_HE = 190.;
203 const float calib_HF1 = 1.0/0.383;
204 const float calib_HF2 = 1.0/0.368;
218 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
221 double etaS = cellGeometry->getPosition().eta () ;
222 double phiS = cellGeometry->getPosition().phi () ;
223 double en = SimHits->energy();
225 int sub = cell.subdet();
226 int depth = cell.depth();
227 double ieta = cell.ieta();
230 double r =
dR(eta_MC, phi_MC, etaS, phiS);
233 eta_diff = fabs(eta_MC - etaS);
236 ietaMax = cell.ieta();
239 if (sub == 1) HcalCone += en*calib_HB;
240 else if (sub == 2) HcalCone += en*calib_HE;
241 else if (sub == 4 && depth == 1) HcalCone += en*calib_HF1;
242 else if (sub == 4 && depth == 2) HcalCone += en*calib_HF2;
246 if (ieta > 0) ieta--;
303 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResultEB->begin () ; SimHits != SimHitResultEB->end(); ++SimHits) {
308 double etaS = cellGeometry->getPosition().eta () ;
309 double phiS = cellGeometry->getPosition().phi () ;
310 double en = SimHits->energy();
312 double r =
dR(eta_MC, phi_MC, etaS, phiS);
314 if (r < partR) EcalCone += en;
322 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResultEE->begin () ; SimHits != SimHitResultEE->end(); ++SimHits) {
327 double etaS = cellGeometry->getPosition().eta () ;
328 double phiS = cellGeometry->getPosition().phi () ;
329 double en = SimHits->energy();
331 double r =
dR(eta_MC, phi_MC, etaS, phiS);
333 if (r < partR) EcalCone += en;
337 if (ietaMax > 0) ietaMax--;
349 double PI = 3.1415926535898;
350 double deltaphi= phi1 - phi2;
351 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
352 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
353 double deltaeta = eta2 - eta1;
354 double tmp =
sqrt(deltaeta* deltaeta + deltaphi*deltaphi);
362 double PI = 3.1415926535898;
363 double a1 = phi1;
double a2 = phi2;
365 if( a1 > 0.5*PI && a2 < 0.) a2 += 2*
PI;
366 if( a2 > 0.5*PI && a1 < 0.) a1 += 2*
PI;
367 tmp = (a1 * en1 + a2 * en2)/(en1 + en2);
368 if(tmp > PI) tmp -= 2.*
PI;
378 double PI = 3.1415926535898;
379 double a1 = phi1;
double a2 = phi2;
380 double tmp = a2 - a1;
382 if(a1 > 0.5 * PI) tmp += 2.*
PI;
383 if(a2 > 0.5 * PI) tmp -= 2.*
PI;
MonitorElement * meEnConeEtaProfile
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meSimHitsEnergyHE
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< PCaloHit > PCaloHitContainer
double dR(double eta1, double phi1, double eta2, double phi2)
MonitorElement * bookProfile(Args &&...args)
double phi12(double phi1, double en1, double phi2, double en2)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
MonitorElement * meSimHitsEnergyHO
MonitorElement * emean_vs_ieta_HE1
edm::EDGetTokenT< edm::PCaloHitContainer > tok_ecalEB_
MonitorElement * meEnConeEtaProfile_E
MonitorElement * occupancy_vs_ieta_HB2
MonitorElement * occupancy_vs_ieta_HE2
edm::EDGetTokenT< edm::PCaloHitContainer > tok_ecalEE_
MonitorElement * meSimHitsEnergyHF
MonitorElement * emean_vs_ieta_HO
MonitorElement * book1D(Args &&...args)
MonitorElement * occupancy_vs_ieta_HE3
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hcal_
double dPhiWsign(double phi1, double phi2)
MonitorElement * emean_vs_ieta_HE2
HcalSimHitsValidation(edm::ParameterSet const &conf)
MonitorElement * emean_vs_ieta_HE3
MonitorElement * emean_vs_ieta_HF1
void setCurrentFolder(const std::string &fullpath)
MonitorElement * occupancy_vs_ieta_HB1
MonitorElement * emean_vs_ieta_HF2
MonitorElement * meEnConeEtaProfile_EH
MonitorElement * emean_vs_ieta_HB1
std::vector< std::vector< double > > tmp
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * occupancy_vs_ieta_HF2
MonitorElement * occupancy_vs_ieta_HO
int getNbinsX(void) const
get # of bins in X-axis
edm::ESHandle< CaloGeometry > geometry
MonitorElement * meSimHitsEnergyHB
edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
virtual void analyze(edm::Event const &ev, edm::EventSetup const &c)
MonitorElement * emean_vs_ieta_HB2
MonitorElement * occupancy_vs_ieta_HF1
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * occupancy_vs_ieta_HE1