CMS 3D CMS Logo

EgammaObjects.cc
Go to the documentation of this file.
2 
5 
14 
16 
17 #include "TF1.h"
18 
20  particleID = ps.getParameter<int>("particleID");
21  EtCut = ps.getParameter<int>("EtCut");
22 
23  if (particleID == 22)
24  particleString = "Photon";
25  else if (particleID == 11)
26  particleString = "Electron";
27  else
28  throw(std::runtime_error(
29  "\n\nEgammaObjects: Only 11 = Photon and 22 = Electron are acceptable parictleIDs! Exiting...\n\n"));
30 
31  loadCMSSWObjects(ps);
33 
34  rootFile_ = TFile::Open(ps.getParameter<std::string>("outputFile").c_str(), "RECREATE");
35 
36  hist_EtaEfficiency_ = nullptr;
38  hist_deltaEtaVsEt_ = nullptr;
39  hist_deltaEtaVsE_ = nullptr;
40  hist_deltaEtaVsEta_ = nullptr;
41  hist_deltaEtaVsPhi_ = nullptr;
42  hist_resolutionEtaVsEt_ = nullptr;
43  hist_resolutionEtaVsE_ = nullptr;
44  hist_resolutionEtaVsEta_ = nullptr;
45  hist_resolutionEtaVsPhi_ = nullptr;
46 
47  hist_Phi_ = nullptr;
48  hist_PhiOverTruth_ = nullptr;
49  hist_PhiEfficiency_ = nullptr;
51  hist_deltaPhiVsEt_ = nullptr;
52  hist_deltaPhiVsE_ = nullptr;
53  hist_deltaPhiVsEta_ = nullptr;
54  hist_deltaPhiVsPhi_ = nullptr;
55  hist_resolutionPhiVsEt_ = nullptr;
56  hist_resolutionPhiVsE_ = nullptr;
57  hist_resolutionPhiVsEta_ = nullptr;
58  hist_resolutionPhiVsPhi_ = nullptr;
59 
60  hist_All_recoMass_ = nullptr;
61  hist_BarrelOnly_recoMass_ = nullptr;
62  hist_EndcapOnly_recoMass_ = nullptr;
63  hist_Mixed_recoMass_ = nullptr;
64 
69 
74 
79 
84 
89 }
90 
92  MCTruthCollectionT_ = consumes<edm::HepMCProduct>(ps.getParameter<edm::InputTag>("MCTruthCollection"));
93  RecoCollectionT_ = consumes<reco::GsfElectronCollection>(ps.getParameter<edm::InputTag>("RecoCollection"));
94 }
95 
97  hist_min_Et_ = ps.getParameter<double>("hist_min_Et");
98  hist_max_Et_ = ps.getParameter<double>("hist_max_Et");
99  hist_bins_Et_ = ps.getParameter<int>("hist_bins_Et");
100 
101  hist_min_E_ = ps.getParameter<double>("hist_min_E");
102  hist_max_E_ = ps.getParameter<double>("hist_max_E");
103  hist_bins_E_ = ps.getParameter<int>("hist_bins_E");
104 
105  hist_min_Eta_ = ps.getParameter<double>("hist_min_Eta");
106  hist_max_Eta_ = ps.getParameter<double>("hist_max_Eta");
107  hist_bins_Eta_ = ps.getParameter<int>("hist_bins_Eta");
108 
109  hist_min_Phi_ = ps.getParameter<double>("hist_min_Phi");
110  hist_max_Phi_ = ps.getParameter<double>("hist_max_Phi");
111  hist_bins_Phi_ = ps.getParameter<int>("hist_bins_Phi");
112 
113  hist_min_EtOverTruth_ = ps.getParameter<double>("hist_min_EtOverTruth");
114  hist_max_EtOverTruth_ = ps.getParameter<double>("hist_max_EtOverTruth");
115  hist_bins_EtOverTruth_ = ps.getParameter<int>("hist_bins_EtOverTruth");
116 
117  hist_min_EOverTruth_ = ps.getParameter<double>("hist_min_EOverTruth");
118  hist_max_EOverTruth_ = ps.getParameter<double>("hist_max_EOverTruth");
119  hist_bins_EOverTruth_ = ps.getParameter<int>("hist_bins_EOverTruth");
120 
121  hist_min_EtaOverTruth_ = ps.getParameter<double>("hist_min_EtaOverTruth");
122  hist_max_EtaOverTruth_ = ps.getParameter<double>("hist_max_EtaOverTruth");
123  hist_bins_EtaOverTruth_ = ps.getParameter<int>("hist_bins_EtaOverTruth");
124 
125  hist_min_PhiOverTruth_ = ps.getParameter<double>("hist_min_PhiOverTruth");
126  hist_max_PhiOverTruth_ = ps.getParameter<double>("hist_max_PhiOverTruth");
127  hist_bins_PhiOverTruth_ = ps.getParameter<int>("hist_bins_PhiOverTruth");
128 
129  hist_min_deltaEta_ = ps.getParameter<double>("hist_min_deltaEta");
130  hist_max_deltaEta_ = ps.getParameter<double>("hist_max_deltaEta");
131  hist_bins_deltaEta_ = ps.getParameter<int>("hist_bins_deltaEta");
132 
133  hist_min_deltaPhi_ = ps.getParameter<double>("hist_min_deltaPhi");
134  hist_max_deltaPhi_ = ps.getParameter<double>("hist_max_deltaPhi");
135  hist_bins_deltaPhi_ = ps.getParameter<int>("hist_bins_deltaPhi");
136 
137  hist_min_recoMass_ = ps.getParameter<double>("hist_min_recoMass");
138  hist_max_recoMass_ = ps.getParameter<double>("hist_max_recoMass");
139  hist_bins_recoMass_ = ps.getParameter<int>("hist_bins_recoMass");
140 }
141 
143 
145  TH1::SetDefaultSumw2(true);
146 
149 }
150 
152  hist_Et_ =
153  new TH1D("hist_Et_", ("Et Distribution of " + particleString).c_str(), hist_bins_Et_, hist_min_Et_, hist_max_Et_);
154  hist_EtOverTruth_ = new TH1D("hist_EtOverTruth_",
155  ("Reco Et over True Et of " + particleString).c_str(),
159  hist_EtEfficiency_ = new TH1D("hist_EtEfficiency_",
160  ("# of True " + particleString + " Reconstructed over # of True " + particleString +
161  " VS Et of " + particleString)
162  .c_str(),
164  hist_min_Et_,
165  hist_max_Et_);
166  hist_EtNumRecoOverNumTrue_ = new TH1D(
167  "hist_EtNumRecoOverNumTrue_",
168  ("# of Reco " + particleString + " over # of True " + particleString + " VS Et of " + particleString).c_str(),
170  hist_min_Et_,
171  hist_max_Et_);
172 
173  hist_E_ =
174  new TH1D("hist_E_", ("E Distribution of " + particleString).c_str(), hist_bins_E_, hist_min_E_, hist_max_E_);
175  hist_EOverTruth_ = new TH1D("hist_EOverTruth_",
176  ("Reco E over True E of " + particleString).c_str(),
180  hist_EEfficiency_ = new TH1D(
181  "hist_EEfficiency_",
182  ("# of True " + particleString + " Reconstructed over # of True " + particleString + " VS E of " + particleString)
183  .c_str(),
184  hist_bins_E_,
185  hist_min_E_,
186  hist_max_E_);
187  hist_ENumRecoOverNumTrue_ = new TH1D(
188  "hist_ENumRecoOverNumTrue_",
189  ("# of Reco " + particleString + " over # of True " + particleString + " VS E of " + particleString).c_str(),
190  hist_bins_E_,
191  hist_min_E_,
192  hist_max_E_);
193 
194  hist_Eta_ = new TH1D(
195  "hist_Eta_", ("Eta Distribution of " + particleString).c_str(), hist_bins_Eta_, hist_min_Eta_, hist_max_Eta_);
196  hist_EtaOverTruth_ = new TH1D("hist_EtaOverTruth_",
197  ("Reco Eta over True Eta of " + particleString).c_str(),
201  hist_EtaEfficiency_ = new TH1D("hist_EtaEfficiency_",
202  ("# of True " + particleString + " Reconstructed over # of True " + particleString +
203  " VS Eta of " + particleString)
204  .c_str(),
207  hist_max_Eta_);
208  hist_EtaNumRecoOverNumTrue_ = new TH1D(
209  "hist_EtaNumRecoOverNumTrue_",
210  ("# of Reco " + particleString + " over # of True " + particleString + " VS Eta of " + particleString).c_str(),
213  hist_max_Eta_);
214 
215  hist_Phi_ = new TH1D(
216  "hist_Phi_", ("Phi Distribution of " + particleString).c_str(), hist_bins_Phi_, hist_min_Phi_, hist_max_Phi_);
217  hist_PhiOverTruth_ = new TH1D("hist_PhiOverTruth_",
218  ("Reco Phi over True Phi of " + particleString).c_str(),
222  hist_PhiEfficiency_ = new TH1D("hist_PhiEfficiency_",
223  ("# of True " + particleString + " Reconstructed over # of True " + particleString +
224  " VS Phi of " + particleString)
225  .c_str(),
228  hist_max_Phi_);
229  hist_PhiNumRecoOverNumTrue_ = new TH1D(
230  "hist_PhiNumRecoOverNumTrue_",
231  ("# of Reco " + particleString + " over # of True " + particleString + " VS Phi of " + particleString).c_str(),
234  hist_max_Phi_);
235 
236  std::string recoParticleName;
237 
238  if (particleID == 22)
239  recoParticleName = "Higgs";
240  else if (particleID == 11)
241  recoParticleName = "Z";
242 
243  hist_All_recoMass_ = new TH1D("hist_All_recoMass_",
244  (recoParticleName + " Mass from " + particleString + " in All Regions").c_str(),
248  hist_BarrelOnly_recoMass_ = new TH1D("hist_BarrelOnly_recoMass_",
249  (recoParticleName + " Mass from " + particleString + " in Barrel").c_str(),
253  hist_EndcapOnly_recoMass_ = new TH1D("hist_EndcapOnly_recoMass_",
254  (recoParticleName + " Mass from " + particleString + " in EndCap").c_str(),
258  hist_Mixed_recoMass_ = new TH1D("hist_Mixed_recoMass_",
259  (recoParticleName + " Mass from " + particleString + " in Split Detectors").c_str(),
263 
265  new TH1D("hist_recoMass_withBackgroud_NoEtCut_",
266  (recoParticleName + " Mass from " + particleString + " with Background, No Et Cut").c_str(),
271  new TH1D("hist_recoMass_withBackgroud_5EtCut_",
272  (recoParticleName + " Mass from " + particleString + " with Background, 5 Et Cut").c_str(),
277  new TH1D("hist_recoMass_withBackgroud_10EtCut_",
278  (recoParticleName + " Mass from " + particleString + " with Background, 10 Et Cut").c_str(),
283  new TH1D("hist_recoMass_withBackgroud_20EtCut_",
284  (recoParticleName + " Mass from " + particleString + " with Background, 20 Et Cut").c_str(),
288 }
289 
291  _TEMP_scatterPlot_EtOverTruthVsEt_ = new TH2D("_TEMP_scatterPlot_EtOverTruthVsEt_",
292  "_TEMP_scatterPlot_EtOverTruthVsEt_",
294  hist_min_Et_,
295  hist_max_Et_,
299  _TEMP_scatterPlot_EtOverTruthVsE_ = new TH2D("_TEMP_scatterPlot_EtOverTruthVsE_",
300  "_TEMP_scatterPlot_EtOverTruthVsE_",
301  hist_bins_E_,
302  hist_min_E_,
303  hist_max_E_,
307  _TEMP_scatterPlot_EtOverTruthVsEta_ = new TH2D("_TEMP_scatterPlot_EtOverTruthVsEta_",
308  "_TEMP_scatterPlot_EtOverTruthVsEta_",
315  _TEMP_scatterPlot_EtOverTruthVsPhi_ = new TH2D("_TEMP_scatterPlot_EtOverTruthVsPhi_",
316  "_TEMP_scatterPlot_EtOverTruthVsPhi_",
323 
324  _TEMP_scatterPlot_EOverTruthVsEt_ = new TH2D("_TEMP_scatterPlot_EOverTruthVsEt_",
325  "_TEMP_scatterPlot_EOverTruthVsEt_",
327  hist_min_Et_,
328  hist_max_Et_,
332  _TEMP_scatterPlot_EOverTruthVsE_ = new TH2D("_TEMP_scatterPlot_EOverTruthVsE_",
333  "_TEMP_scatterPlot_EOverTruthVsE_",
334  hist_bins_E_,
335  hist_min_E_,
336  hist_max_E_,
340  _TEMP_scatterPlot_EOverTruthVsEta_ = new TH2D("_TEMP_scatterPlot_EOverTruthVsEta_",
341  "_TEMP_scatterPlot_EOverTruthVsEta_",
348  _TEMP_scatterPlot_EOverTruthVsPhi_ = new TH2D("_TEMP_scatterPlot_EOverTruthVsPhi_",
349  "_TEMP_scatterPlot_EOverTruthVsPhi_",
356 
357  _TEMP_scatterPlot_deltaEtaVsEt_ = new TH2D("_TEMP_scatterPlot_deltaEtaVsEt_",
358  "_TEMP_scatterPlot_deltaEtaVsEt_",
360  hist_min_Et_,
361  hist_max_Et_,
365  _TEMP_scatterPlot_deltaEtaVsE_ = new TH2D("_TEMP_scatterPlot_deltaEtaVsE_",
366  "_TEMP_scatterPlot_deltaEtaVsE_",
367  hist_bins_E_,
368  hist_min_E_,
369  hist_max_E_,
373  _TEMP_scatterPlot_deltaEtaVsEta_ = new TH2D("_TEMP_scatterPlot_deltaEtaVsEta_",
374  "_TEMP_scatterPlot_deltaEtaVsEta_",
381  _TEMP_scatterPlot_deltaEtaVsPhi_ = new TH2D("_TEMP_scatterPlot_deltaEtaVsPhi_",
382  "_TEMP_scatterPlot_deltaEtaVsPhi_",
389 
390  _TEMP_scatterPlot_deltaPhiVsEt_ = new TH2D("_TEMP_scatterPlot_deltaPhiVsEt_",
391  "_TEMP_scatterPlot_deltaPhiVsEt_",
393  hist_min_Et_,
394  hist_max_Et_,
398  _TEMP_scatterPlot_deltaPhiVsE_ = new TH2D("_TEMP_scatterPlot_deltaPhiVsE_",
399  "_TEMP_scatterPlot_deltaPhiVsE_",
400  hist_bins_E_,
401  hist_min_E_,
402  hist_max_E_,
406  _TEMP_scatterPlot_deltaPhiVsEta_ = new TH2D("_TEMP_scatterPlot_deltaPhiVsEta_",
407  "_TEMP_scatterPlot_deltaPhiVsEta_",
414  _TEMP_scatterPlot_deltaPhiVsPhi_ = new TH2D("_TEMP_scatterPlot_deltaPhiVsPhi_",
415  "_TEMP_scatterPlot_deltaPhiVsPhi_",
422 }
423 
424 void EgammaObjects::analyze(const edm::Event& evt, const edm::EventSetup& es) {
425  if (particleID == 22)
426  analyzePhotons(evt, es);
427  else if (particleID == 11)
428  analyzeElectrons(evt, es);
429 }
430 
433  evt.getByToken(RecoCollectionT_, pPhotons);
434  if (!pPhotons.isValid()) {
435  Labels l;
437  edm::LogError("EgammaObjects") << "Error! can't get collection with label " << l.module;
438  }
439 
440  const reco::PhotonCollection* photons = pPhotons.product();
441  std::vector<reco::Photon> photonsMCMatched;
442 
443  for (reco::PhotonCollection::const_iterator aClus = photons->begin(); aClus != photons->end(); aClus++) {
444  if (aClus->et() >= EtCut) {
445  hist_Et_->Fill(aClus->et());
446  hist_E_->Fill(aClus->energy());
447  hist_Eta_->Fill(aClus->eta());
448  hist_Phi_->Fill(aClus->phi());
449  }
450  }
451 
452  for (int firstPhoton = 0, numPhotons = photons->size(); firstPhoton < numPhotons - 1; firstPhoton++)
453  for (int secondPhoton = firstPhoton + 1; secondPhoton < numPhotons; secondPhoton++) {
454  reco::Photon pOne = (*photons)[firstPhoton];
455  reco::Photon pTwo = (*photons)[secondPhoton];
456 
457  double recoMass = findRecoMass(pOne, pTwo);
458 
459  hist_recoMass_withBackgroud_NoEtCut_->Fill(recoMass);
460 
461  if (pOne.et() >= 5 && pTwo.et() >= 5)
462  hist_recoMass_withBackgroud_5EtCut_->Fill(recoMass);
463 
464  if (pOne.et() >= 10 && pTwo.et() >= 10)
465  hist_recoMass_withBackgroud_10EtCut_->Fill(recoMass);
466 
467  if (pOne.et() >= 20 && pTwo.et() >= 20)
468  hist_recoMass_withBackgroud_20EtCut_->Fill(recoMass);
469  }
470 
472  evt.getByToken(MCTruthCollectionT_, pMCTruth);
473  if (!pMCTruth.isValid()) {
474  Labels l;
476  edm::LogError("EgammaObjects") << "Error! can't get collection with label " << l.module;
477  }
478 
479  const HepMC::GenEvent* genEvent = pMCTruth->GetEvent();
480 
481  for (HepMC::GenEvent::particle_const_iterator currentParticle = genEvent->particles_begin();
482  currentParticle != genEvent->particles_end();
483  currentParticle++) {
484  if (abs((*currentParticle)->pdg_id()) == 22 && (*currentParticle)->status() == 1 &&
485  (*currentParticle)->momentum().e() /
486  cosh(ecalEta((*currentParticle)->momentum().eta(),
487  (*currentParticle)->production_vertex()->position().z() / 10.,
488  (*currentParticle)->production_vertex()->position().perp() / 10.)) >=
489  EtCut) {
490  HepMC::FourVector vtx = (*currentParticle)->production_vertex()->position();
491  double phiTrue = (*currentParticle)->momentum().phi();
492  double etaTrue = ecalEta((*currentParticle)->momentum().eta(), vtx.z() / 10., vtx.perp() / 10.);
493  double eTrue = (*currentParticle)->momentum().e();
494  double etTrue = (*currentParticle)->momentum().e() / cosh(etaTrue);
495 
496  double etaCurrent, etaFound = -999;
497  double phiCurrent, phiFound = -999;
498  double etCurrent, etFound = -999;
499  double eCurrent, eFound = -999;
500 
501  reco::Photon bestMatchPhoton;
502 
503  double closestParticleDistance = 999;
504 
505  for (reco::PhotonCollection::const_iterator aClus = photons->begin(); aClus != photons->end(); aClus++) {
506  if (aClus->et() > EtCut) {
507  etaCurrent = aClus->eta();
508  phiCurrent = aClus->phi();
509  etCurrent = aClus->et();
510  eCurrent = aClus->energy();
511 
512  double deltaPhi = phiCurrent - phiTrue;
513  if (deltaPhi > Geom::pi())
514  deltaPhi -= 2. * Geom::pi();
515  if (deltaPhi < -Geom::pi())
516  deltaPhi += 2. * Geom::pi();
517  double deltaR = std::sqrt(std::pow(etaCurrent - etaTrue, 2) + std::pow(deltaPhi, 2));
518 
519  if (deltaR < closestParticleDistance) {
520  etFound = etCurrent;
521  eFound = eCurrent;
522  etaFound = etaCurrent;
523  phiFound = phiCurrent;
524  closestParticleDistance = deltaR;
525  bestMatchPhoton = *aClus;
526  }
527  }
528  }
529 
530  if (closestParticleDistance < 0.05 && etFound / etTrue > .5 && etFound / etTrue < 1.5) {
531  hist_EtOverTruth_->Fill(etFound / etTrue);
532  hist_EOverTruth_->Fill(eFound / eTrue);
533  hist_EtaOverTruth_->Fill(etaFound / etaTrue);
534  hist_PhiOverTruth_->Fill(phiFound / phiTrue);
535 
536  hist_EtEfficiency_->Fill(etTrue);
537  hist_EEfficiency_->Fill(eTrue);
538  hist_EtaEfficiency_->Fill(etaTrue);
539  hist_PhiEfficiency_->Fill(phiTrue);
540 
541  double deltaPhi = phiFound - phiTrue;
542  if (deltaPhi > Geom::pi())
543  deltaPhi -= 2. * Geom::pi();
544  if (deltaPhi < -Geom::pi())
545  deltaPhi += 2. * Geom::pi();
546 
547  _TEMP_scatterPlot_EtOverTruthVsEt_->Fill(etFound, etFound / etTrue);
548  _TEMP_scatterPlot_EtOverTruthVsE_->Fill(eFound, etFound / etTrue);
549  _TEMP_scatterPlot_EtOverTruthVsEta_->Fill(etaFound, etFound / etTrue);
550  _TEMP_scatterPlot_EtOverTruthVsPhi_->Fill(phiFound, etFound / etTrue);
551 
552  _TEMP_scatterPlot_EOverTruthVsEt_->Fill(etFound, eFound / eTrue);
553  _TEMP_scatterPlot_EOverTruthVsE_->Fill(eFound, eFound / eTrue);
554  _TEMP_scatterPlot_EOverTruthVsEta_->Fill(etaFound, eFound / eTrue);
555  _TEMP_scatterPlot_EOverTruthVsPhi_->Fill(phiFound, eFound / eTrue);
556 
557  _TEMP_scatterPlot_deltaEtaVsEt_->Fill(etFound, etaFound - etaTrue);
558  _TEMP_scatterPlot_deltaEtaVsE_->Fill(eFound, etaFound - etaTrue);
559  _TEMP_scatterPlot_deltaEtaVsEta_->Fill(etaFound, etaFound - etaTrue);
560  _TEMP_scatterPlot_deltaEtaVsPhi_->Fill(phiFound, etaFound - etaTrue);
561 
566 
567  photonsMCMatched.push_back(bestMatchPhoton);
568  }
569 
570  hist_EtNumRecoOverNumTrue_->Fill(etTrue);
571  hist_ENumRecoOverNumTrue_->Fill(eTrue);
572  hist_EtaNumRecoOverNumTrue_->Fill(etaTrue);
573  hist_PhiNumRecoOverNumTrue_->Fill(phiTrue);
574  }
575  }
576 
577  if (photonsMCMatched.size() == 2) {
578  reco::Photon pOne = photonsMCMatched[0];
579  reco::Photon pTwo = photonsMCMatched[1];
580 
581  double recoMass = findRecoMass(pOne, pTwo);
582 
583  hist_All_recoMass_->Fill(recoMass);
584 
585  if (pOne.superCluster()->seed()->algo() == 1 && pTwo.superCluster()->seed()->algo() == 1)
586  hist_BarrelOnly_recoMass_->Fill(recoMass);
587  else if (pOne.superCluster()->seed()->algo() == 0 && pTwo.superCluster()->seed()->algo() == 0)
588  hist_EndcapOnly_recoMass_->Fill(recoMass);
589  else
590  hist_Mixed_recoMass_->Fill(recoMass);
591  }
592 }
593 
596  evt.getByToken(RecoCollectionT_, pElectrons);
597  if (!pElectrons.isValid()) {
598  Labels l;
600  edm::LogError("DOEPlotsProducerElectrons") << "Error! can't get collection with label " << l.module;
601  }
602 
603  const reco::GsfElectronCollection* electrons = pElectrons.product();
604  std::vector<reco::GsfElectron> electronsMCMatched;
605 
606  for (reco::GsfElectronCollection::const_iterator aClus = electrons->begin(); aClus != electrons->end(); aClus++) {
607  if (aClus->et() >= EtCut) {
608  hist_Et_->Fill(aClus->et());
609  hist_E_->Fill(aClus->energy());
610  hist_Eta_->Fill(aClus->eta());
611  hist_Phi_->Fill(aClus->phi());
612  }
613  }
614 
615  for (int firstElectron = 0, numElectrons = electrons->size(); firstElectron < numElectrons - 1; firstElectron++)
616  for (int secondElectron = firstElectron + 1; secondElectron < numElectrons; secondElectron++) {
617  reco::GsfElectron eOne = (*electrons)[firstElectron];
618  reco::GsfElectron eTwo = (*electrons)[secondElectron];
619 
620  double recoMass = findRecoMass(eOne, eTwo);
621 
622  hist_recoMass_withBackgroud_NoEtCut_->Fill(recoMass);
623 
624  if (eOne.et() >= 5 && eTwo.et() >= 5)
625  hist_recoMass_withBackgroud_5EtCut_->Fill(recoMass);
626 
627  if (eOne.et() >= 10 && eTwo.et() >= 10)
628  hist_recoMass_withBackgroud_10EtCut_->Fill(recoMass);
629 
630  if (eOne.et() >= 20 && eTwo.et() >= 20)
631  hist_recoMass_withBackgroud_20EtCut_->Fill(recoMass);
632  }
633 
635  evt.getByToken(MCTruthCollectionT_, pMCTruth);
636  if (!pMCTruth.isValid()) {
637  Labels l;
639  edm::LogError("DOEPlotsProducerElectrons") << "Error! can't get collection with label " << l.module;
640  }
641 
642  const HepMC::GenEvent* genEvent = pMCTruth->GetEvent();
643  for (HepMC::GenEvent::particle_const_iterator currentParticle = genEvent->particles_begin();
644  currentParticle != genEvent->particles_end();
645  currentParticle++) {
646  if (abs((*currentParticle)->pdg_id()) == 11 && (*currentParticle)->status() == 1 &&
647  (*currentParticle)->momentum().e() / cosh((*currentParticle)->momentum().eta()) >= EtCut) {
648  double phiTrue = (*currentParticle)->momentum().phi();
649  double etaTrue = (*currentParticle)->momentum().eta();
650  double eTrue = (*currentParticle)->momentum().e();
651  double etTrue = (*currentParticle)->momentum().e() / cosh(etaTrue);
652 
653  double etaCurrent, etaFound = -999;
654  double phiCurrent, phiFound = -999;
655  double etCurrent, etFound = -999;
656  double eCurrent, eFound = -999;
657 
658  reco::GsfElectron bestMatchElectron;
659 
660  double closestParticleDistance = 999;
661 
662  for (reco::GsfElectronCollection::const_iterator aClus = electrons->begin(); aClus != electrons->end(); aClus++) {
663  if (aClus->et() > EtCut) {
664  etaCurrent = aClus->eta();
665  phiCurrent = aClus->phi();
666  etCurrent = aClus->et();
667  eCurrent = aClus->energy();
668 
669  double deltaPhi = phiCurrent - phiTrue;
670  if (deltaPhi > Geom::pi())
671  deltaPhi -= 2. * Geom::pi();
672  if (deltaPhi < -Geom::pi())
673  deltaPhi += 2. * Geom::pi();
674  double deltaR = std::sqrt(std::pow(etaCurrent - etaTrue, 2) + std::pow(deltaPhi, 2));
675 
676  if (deltaR < closestParticleDistance) {
677  etFound = etCurrent;
678  eFound = eCurrent;
679  etaFound = etaCurrent;
680  phiFound = phiCurrent;
681  closestParticleDistance = deltaR;
682  bestMatchElectron = *aClus;
683  }
684  }
685  }
686 
687  if (closestParticleDistance < 0.05 && etFound / etTrue > .5 && etFound / etTrue < 1.5) {
688  hist_EtOverTruth_->Fill(etFound / etTrue);
689  hist_EOverTruth_->Fill(eFound / eTrue);
690  hist_EtaOverTruth_->Fill(etaFound / etaTrue);
691  hist_PhiOverTruth_->Fill(phiFound / phiTrue);
692 
693  hist_EtEfficiency_->Fill(etTrue);
694  hist_EEfficiency_->Fill(eTrue);
695  hist_EtaEfficiency_->Fill(etaTrue);
696  hist_PhiEfficiency_->Fill(phiTrue);
697 
698  double deltaPhi = phiFound - phiTrue;
699  if (deltaPhi > Geom::pi())
700  deltaPhi -= 2. * Geom::pi();
701  if (deltaPhi < -Geom::pi())
702  deltaPhi += 2. * Geom::pi();
703 
704  _TEMP_scatterPlot_EtOverTruthVsEt_->Fill(etFound, etFound / etTrue);
705  _TEMP_scatterPlot_EtOverTruthVsE_->Fill(eFound, etFound / etTrue);
706  _TEMP_scatterPlot_EtOverTruthVsEta_->Fill(etaFound, etFound / etTrue);
707  _TEMP_scatterPlot_EtOverTruthVsPhi_->Fill(phiFound, etFound / etTrue);
708 
709  _TEMP_scatterPlot_EOverTruthVsEt_->Fill(etFound, eFound / eTrue);
710  _TEMP_scatterPlot_EOverTruthVsE_->Fill(eFound, eFound / eTrue);
711  _TEMP_scatterPlot_EOverTruthVsEta_->Fill(etaFound, eFound / eTrue);
712  _TEMP_scatterPlot_EOverTruthVsPhi_->Fill(phiFound, eFound / eTrue);
713 
714  _TEMP_scatterPlot_deltaEtaVsEt_->Fill(etFound, etaFound - etaTrue);
715  _TEMP_scatterPlot_deltaEtaVsE_->Fill(eFound, etaFound - etaTrue);
716  _TEMP_scatterPlot_deltaEtaVsEta_->Fill(etaFound, etaFound - etaTrue);
717  _TEMP_scatterPlot_deltaEtaVsPhi_->Fill(phiFound, etaFound - etaTrue);
718 
723 
724  electronsMCMatched.push_back(bestMatchElectron);
725  }
726 
727  hist_EtNumRecoOverNumTrue_->Fill(etTrue);
728  hist_ENumRecoOverNumTrue_->Fill(eTrue);
729  hist_EtaNumRecoOverNumTrue_->Fill(etaTrue);
730  hist_PhiNumRecoOverNumTrue_->Fill(phiTrue);
731  }
732  }
733 
734  if (electronsMCMatched.size() == 2) {
735  reco::GsfElectron eOne = electronsMCMatched[0];
736  reco::GsfElectron eTwo = electronsMCMatched[1];
737 
738  double recoMass = findRecoMass(eOne, eTwo);
739 
740  hist_All_recoMass_->Fill(recoMass);
741 
742  if (eOne.superCluster()->seed()->algo() == 1 && eTwo.superCluster()->seed()->algo() == 1)
743  hist_BarrelOnly_recoMass_->Fill(recoMass);
744  else if (eOne.superCluster()->seed()->algo() == 0 && eTwo.superCluster()->seed()->algo() == 0)
745  hist_EndcapOnly_recoMass_->Fill(recoMass);
746  else
747  hist_Mixed_recoMass_->Fill(recoMass);
748  }
749 }
750 
751 double EgammaObjects::findRecoMass(const reco::Photon& pOne, const reco::Photon& pTwo) {
752  double cosTheta = (cos(pOne.superCluster()->phi() - pTwo.superCluster()->phi()) +
753  sinh(pOne.superCluster()->eta()) * sinh(pTwo.superCluster()->eta())) /
754  (cosh(pOne.superCluster()->eta()) * cosh(pTwo.superCluster()->eta()));
755 
756  double recoMass = sqrt(2 * (pOne.superCluster())->energy() * (pTwo.superCluster())->energy() * (1 - cosTheta));
757 
758  return recoMass;
759 }
760 
762  double cosTheta = (cos(eOne.caloPosition().phi() - eTwo.caloPosition().phi()) +
763  sinh(eOne.caloPosition().eta()) * sinh(eTwo.caloPosition().eta())) /
764  (cosh(eOne.caloPosition().eta()) * cosh(eTwo.caloPosition().eta()));
765 
766  double recoMass = sqrt(2 * eOne.caloEnergy() * eTwo.caloEnergy() * (1 - cosTheta));
767 
768  return recoMass;
769 }
770 
771 float EgammaObjects::ecalEta(float EtaParticle, float Zvertex, float plane_Radius) {
772  const float R_ECAL = 136.5;
773  const float Z_Endcap = 328.0;
774  const float etaBarrelEndcap = 1.479;
775 
776  if (EtaParticle != 0.) {
777  float Theta = 0.0;
778  float ZEcal = (R_ECAL - plane_Radius) * sinh(EtaParticle) + Zvertex;
779 
780  if (ZEcal != 0.0)
781  Theta = atan(R_ECAL / ZEcal);
782  if (Theta < 0.0)
783  Theta = Theta + Geom::pi();
784 
785  float ETA = -log(tan(0.5 * Theta));
786 
787  if (std::abs(ETA) > etaBarrelEndcap) {
788  float Zend = Z_Endcap;
789  if (EtaParticle < 0.0)
790  Zend = -Zend;
791  float Zlen = Zend - Zvertex;
792  float RR = Zlen / sinh(EtaParticle);
793  Theta = atan((RR + plane_Radius) / Zend);
794  if (Theta < 0.0)
795  Theta = Theta + Geom::pi();
796  ETA = -log(tan(0.5 * Theta));
797  }
798 
799  return ETA;
800  } else {
801  edm::LogWarning("") << "[EgammaObjects::ecalEta] Warning: Eta equals to zero, not correcting";
802  return EtaParticle;
803  }
804 }
805 
807  rootFile_->cd();
808  rootFile_->mkdir(particleString.c_str());
809 
812  fitHistos();
813 
814  applyLabels();
815  setDrawOptions();
816  saveHistos();
817  rootFile_->Close();
818 }
819 
821  _TEMP_scatterPlot_EtOverTruthVsEt_->FitSlicesY(nullptr, 1, hist_bins_Et_, 10, "QRG3");
822  _TEMP_scatterPlot_EtOverTruthVsE_->FitSlicesY(nullptr, 1, hist_bins_E_, 10, "QRG3");
823  _TEMP_scatterPlot_EtOverTruthVsEta_->FitSlicesY(nullptr, 1, hist_bins_Eta_, 10, "QRG2");
824  _TEMP_scatterPlot_EtOverTruthVsPhi_->FitSlicesY(nullptr, 1, hist_bins_Phi_, 10, "QRG2");
825 
826  _TEMP_scatterPlot_EOverTruthVsEt_->FitSlicesY(nullptr, 1, hist_bins_Et_, 10, "QRG3");
827  _TEMP_scatterPlot_EOverTruthVsE_->FitSlicesY(nullptr, 1, hist_bins_E_, 10, "QRG3");
828  _TEMP_scatterPlot_EOverTruthVsEta_->FitSlicesY(nullptr, 1, hist_bins_Eta_, 10, "QRG2");
829  _TEMP_scatterPlot_EOverTruthVsPhi_->FitSlicesY(nullptr, 1, hist_bins_Phi_, 10, "QRG2");
830 
831  _TEMP_scatterPlot_deltaEtaVsEt_->FitSlicesY(nullptr, 1, hist_bins_Et_, 10, "QRG3");
832  _TEMP_scatterPlot_deltaEtaVsE_->FitSlicesY(nullptr, 1, hist_bins_E_, 10, "QRG3");
833  _TEMP_scatterPlot_deltaEtaVsEta_->FitSlicesY(nullptr, 1, hist_bins_Eta_, 10, "QRG2");
834  _TEMP_scatterPlot_deltaEtaVsPhi_->FitSlicesY(nullptr, 1, hist_bins_Phi_, 10, "QRG2");
835 
836  _TEMP_scatterPlot_deltaPhiVsEt_->FitSlicesY(nullptr, 1, hist_bins_Et_, 10, "QRG3");
837  _TEMP_scatterPlot_deltaPhiVsE_->FitSlicesY(nullptr, 1, hist_bins_E_, 10, "QRG3");
838  _TEMP_scatterPlot_deltaPhiVsEta_->FitSlicesY(nullptr, 1, hist_bins_Eta_, 10, "QRG2");
839  _TEMP_scatterPlot_deltaPhiVsPhi_->FitSlicesY(nullptr, 1, hist_bins_Phi_, 10, "QRG2");
840 
841  hist_EtOverTruthVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsEt__1");
842  hist_EtOverTruthVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsE__1");
843  hist_EtOverTruthVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsEta__1");
844  hist_EtOverTruthVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsPhi__1");
845 
846  hist_EOverTruthVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsEt__1");
847  hist_EOverTruthVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsE__1");
848  hist_EOverTruthVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsEta__1");
849  hist_EOverTruthVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsPhi__1");
850 
851  hist_deltaEtaVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsEt__1");
852  hist_deltaEtaVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsE__1");
853  hist_deltaEtaVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsEta__1");
854  hist_deltaEtaVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsPhi__1");
855 
856  hist_deltaPhiVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsEt__1");
857  hist_deltaPhiVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsE__1");
858  hist_deltaPhiVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsEta__1");
859  hist_deltaPhiVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsPhi__1");
860 
861  hist_EtOverTruthVsEt_->SetNameTitle("hist_EtOverTruthVsEt_",
862  ("Reco Et over True Et VS Et of " + particleString).c_str());
863  hist_EtOverTruthVsE_->SetNameTitle("hist_EtOverTruthVsE_",
864  ("Reco Et over True Et VS E of " + particleString).c_str());
865  hist_EtOverTruthVsEta_->SetNameTitle("hist_EtOverTruthVsEta_",
866  ("Reco Et over True Et VS Eta of " + particleString).c_str());
867  hist_EtOverTruthVsPhi_->SetNameTitle("hist_EtOverTruthVsPhi_",
868  ("Reco Et over True Et VS Phi of " + particleString).c_str());
869 
870  hist_EOverTruthVsEt_->SetNameTitle("hist_EOverTruthVsEt_", ("Reco E over True E VS Et of " + particleString).c_str());
871  hist_EOverTruthVsE_->SetNameTitle("hist_EOverTruthVsE_", ("Reco E over True E VS E of " + particleString).c_str());
872  hist_EOverTruthVsEta_->SetNameTitle("hist_EOverTruthVsEta_",
873  ("Reco E over True E VS Eta of " + particleString).c_str());
874  hist_EOverTruthVsPhi_->SetNameTitle("hist_EOverTruthVsPhi_",
875  ("Reco E over True E VS Phi of " + particleString).c_str());
876 
877  hist_deltaEtaVsEt_->SetNameTitle("hist_deltaEtaVsEt_", ("delta Eta VS Et of " + particleString).c_str());
878  hist_deltaEtaVsE_->SetNameTitle("hist_deltaEtaVsE_", ("delta Eta VS E of " + particleString).c_str());
879  hist_deltaEtaVsEta_->SetNameTitle("hist_deltaEtaVsEta_", ("delta Eta VS Eta of " + particleString).c_str());
880  hist_deltaEtaVsPhi_->SetNameTitle("hist_deltaEtaVsPhi_", ("delta Eta VS Phi of " + particleString).c_str());
881 
882  hist_deltaPhiVsEt_->SetNameTitle("hist_deltaPhiVsEt_", ("delta Phi VS Et of " + particleString).c_str());
883  hist_deltaPhiVsE_->SetNameTitle("hist_deltaPhiVsE_", ("delta Phi VS E of " + particleString).c_str());
884  hist_deltaPhiVsEta_->SetNameTitle("hist_deltaPhiVsEta_", ("delta Phi VS Eta of " + particleString).c_str());
885  hist_deltaPhiVsPhi_->SetNameTitle("hist_deltaPhiVsPhi_", ("delta Phi VS Phi of " + particleString).c_str());
886 
887  hist_resolutionEtVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsEt__2");
888  hist_resolutionEtVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsE__2");
889  hist_resolutionEtVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsEta__2");
890  hist_resolutionEtVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EtOverTruthVsPhi__2");
891 
892  hist_resolutionEVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsEt__2");
893  hist_resolutionEVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsE__2");
894  hist_resolutionEVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsEta__2");
895  hist_resolutionEVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_EOverTruthVsPhi__2");
896 
897  hist_resolutionEtaVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsEt__2");
898  hist_resolutionEtaVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsE__2");
899  hist_resolutionEtaVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsEta__2");
900  hist_resolutionEtaVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaEtaVsPhi__2");
901 
902  hist_resolutionPhiVsEt_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsEt__2");
903  hist_resolutionPhiVsE_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsE__2");
904  hist_resolutionPhiVsEta_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsEta__2");
905  hist_resolutionPhiVsPhi_ = (TH1D*)gDirectory->Get("_TEMP_scatterPlot_deltaPhiVsPhi__2");
906 
907  hist_resolutionEtVsEt_->SetNameTitle("hist_resolutionEtVsEt_",
908  ("#sigma of Reco Et over True Et VS Et of " + particleString).c_str());
909  hist_resolutionEtVsE_->SetNameTitle("hist_resolutionEtVsE_",
910  ("#sigma of Reco Et over True Et VS E of " + particleString).c_str());
911  hist_resolutionEtVsEta_->SetNameTitle("hist_resolutionEtVsEta_",
912  ("#sigma of Reco Et over True Et VS Eta of " + particleString).c_str());
913  hist_resolutionEtVsPhi_->SetNameTitle("hist_resolutionEtVsPhi_",
914  ("#sigma of Reco Et over True Et VS Phi of " + particleString).c_str());
915 
916  hist_resolutionEVsEt_->SetNameTitle("hist_resolutionEVsEt_",
917  ("#sigma of Reco E over True E VS Et of " + particleString).c_str());
918  hist_resolutionEVsE_->SetNameTitle("hist_resolutionEVsE_",
919  ("#sigma of Reco E over True E VS E of " + particleString).c_str());
920  hist_resolutionEVsEta_->SetNameTitle("hist_resolutionEVsEta_",
921  ("#sigma of Reco E over True E VS Eta of " + particleString).c_str());
922  hist_resolutionEVsPhi_->SetNameTitle("hist_resolutionEVsPhi_",
923  ("#sigma of Reco E over True E VS Phi of " + particleString).c_str());
924 
925  hist_resolutionEtaVsEt_->SetNameTitle("hist_resolutionEtaVsEt_",
926  ("#sigma of delta Eta VS Et of " + particleString).c_str());
927  hist_resolutionEtaVsE_->SetNameTitle("hist_resolutionEtaVsE_",
928  ("#sigma of delta Eta VS E of " + particleString).c_str());
929  hist_resolutionEtaVsEta_->SetNameTitle("hist_resolutionEtaVsEta_",
930  ("#sigma of delta Eta VS Eta of " + particleString).c_str());
931  hist_resolutionEtaVsPhi_->SetNameTitle("hist_resolutionEtaVsPhi_",
932  ("#sigma of delta Eta VS Phi of " + particleString).c_str());
933 
934  hist_resolutionPhiVsEt_->SetNameTitle("hist_resolutionPhiVsEt_",
935  ("#sigma of delta Phi VS Et of " + particleString).c_str());
936  hist_resolutionPhiVsE_->SetNameTitle("hist_resolutionPhiVsE_",
937  ("#sigma of delta Phi VS E of " + particleString).c_str());
938  hist_resolutionPhiVsEta_->SetNameTitle("hist_resolutionPhiVsEta_",
939  ("#sigma of delta Phi VS Eta of " + particleString).c_str());
940  hist_resolutionPhiVsPhi_->SetNameTitle("hist_resolutionPhiVsPhi_",
941  ("#sigma of delta Phi VS Phi of " + particleString).c_str());
942 }
943 
949 
954 }
955 
957  //Use our own copy for thread safety
958  TF1 gaus("mygaus", "gaus");
959  hist_EtOverTruth_->Fit(&gaus, "QEM");
960  // hist_EtNumRecoOverNumTrue_->Fit("pol1","QEM");
961 
962  hist_EOverTruth_->Fit(&gaus, "QEM");
963  // hist_ENumRecoOverNumTrue_->Fit("pol1","QEM");
964 
965  hist_EtaOverTruth_->Fit(&gaus, "QEM");
966  // hist_EtaNumRecoOverNumTrue_->Fit("pol1","QEM");
967 
968  hist_PhiOverTruth_->Fit(&gaus, "QEM");
969  // hist_PhiNumRecoOverNumTrue_->Fit("pol1","QEM");
970 
971  /*
972  hist_EtOverTruthVsEt_->Fit("pol1","QEM");
973  hist_EtOverTruthVsEta_->Fit("pol1","QEM");
974  hist_EtOverTruthVsPhi_->Fit("pol1","QEM");
975  hist_resolutionEtVsEt_->Fit("pol1","QEM");
976  hist_resolutionEtVsEta_->Fit("pol1","QEM");
977  hist_resolutionEtVsPhi_->Fit("pol1","QEM");
978 
979  hist_EOverTruthVsEt_->Fit("pol1","QEM");
980  hist_EOverTruthVsEta_->Fit("pol1","QEM");
981  hist_EOverTruthVsPhi_->Fit("pol1","QEM");
982  hist_resolutionEVsEt_->Fit("pol1","QEM");
983  hist_resolutionEVsEta_->Fit("pol1","QEM");
984  hist_resolutionEVsPhi_->Fit("pol1","QEM");
985 
986  hist_deltaEtaVsEt_->Fit("pol1","QEM");
987  hist_deltaEtaVsEta_->Fit("pol1","QEM");
988  hist_deltaEtaVsPhi_->Fit("pol1","QEM");
989  hist_resolutionEtaVsEt_->Fit("pol1","QEM");
990  hist_resolutionEtaVsEta_->Fit("pol1","QEM");
991  hist_resolutionEtaVsPhi_->Fit("pol1","QEM");
992 
993  hist_deltaPhiVsEt_->Fit("pol1","QEM");
994  hist_deltaPhiVsEta_->Fit("pol1","QEM");
995  hist_deltaPhiVsPhi_->Fit("pol1","QEM");
996  hist_resolutionPhiVsEt_->Fit("pol1","QEM");
997  hist_resolutionPhiVsEta_->Fit("pol1","QEM");
998  hist_resolutionPhiVsPhi_->Fit("pol1","QEM");
999  */
1000 }
1001 
1003  hist_Et_->GetXaxis()->SetTitle("Et (GeV)");
1004  hist_Et_->GetYaxis()->SetTitle("# per Et Bin");
1005  hist_EtOverTruth_->GetXaxis()->SetTitle("Reco Et/True Et");
1006  hist_EtOverTruth_->GetYaxis()->SetTitle("# per Ratio Bin");
1007  hist_EtEfficiency_->GetXaxis()->SetTitle("Et (GeV)");
1008  hist_EtEfficiency_->GetYaxis()->SetTitle("# True Reconstructed/# True per Et Bin");
1009  hist_EtNumRecoOverNumTrue_->GetXaxis()->SetTitle("Et (GeV)");
1010  hist_EtNumRecoOverNumTrue_->GetYaxis()->SetTitle("# Reco/# True per Et Bin");
1011  hist_EtOverTruthVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1012  hist_EtOverTruthVsEt_->GetYaxis()->SetTitle("Reco Et/True Et per Et Bin");
1013  hist_EtOverTruthVsE_->GetXaxis()->SetTitle("E (GeV)");
1014  hist_EtOverTruthVsE_->GetYaxis()->SetTitle("Reco Et/True Et per E Bin");
1015  hist_EtOverTruthVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1016  hist_EtOverTruthVsEta_->GetYaxis()->SetTitle("Reco Et/True Et per Eta Bin");
1017  hist_EtOverTruthVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1018  hist_EtOverTruthVsPhi_->GetYaxis()->SetTitle("Reco Et/True Et per Phi Bin");
1019  hist_resolutionEtVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1020  hist_resolutionEtVsEt_->GetYaxis()->SetTitle("#sigma of Reco Et/True Et per Et Bin");
1021  hist_resolutionEtVsE_->GetXaxis()->SetTitle("E (GeV)");
1022  hist_resolutionEtVsE_->GetYaxis()->SetTitle("#sigma of Reco Et/True Et per E Bin");
1023  hist_resolutionEtVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1024  hist_resolutionEtVsEta_->GetYaxis()->SetTitle("#sigma of Reco Et/True Et per Eta Bin");
1025  hist_resolutionEtVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1026  hist_resolutionEtVsPhi_->GetYaxis()->SetTitle("#sigma of Reco Et/True Et per Phi Bin");
1027 
1028  hist_E_->GetXaxis()->SetTitle("E (GeV)");
1029  hist_E_->GetYaxis()->SetTitle("# per E Bin");
1030  hist_EOverTruth_->GetXaxis()->SetTitle("Reco E/True E");
1031  hist_EOverTruth_->GetYaxis()->SetTitle("# per Ratio Bin");
1032  hist_EEfficiency_->GetXaxis()->SetTitle("E (GeV)");
1033  hist_EEfficiency_->GetYaxis()->SetTitle("# True Reconstructed/# True per E Bin");
1034  hist_ENumRecoOverNumTrue_->GetXaxis()->SetTitle("E (GeV)");
1035  hist_ENumRecoOverNumTrue_->GetYaxis()->SetTitle("# Reco/# True per E Bin");
1036  hist_EOverTruthVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1037  hist_EOverTruthVsEt_->GetYaxis()->SetTitle("Reco E/True E per Et Bin");
1038  hist_EOverTruthVsE_->GetXaxis()->SetTitle("E (GeV)");
1039  hist_EOverTruthVsE_->GetYaxis()->SetTitle("Reco E/True E per E Bin");
1040  hist_EOverTruthVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1041  hist_EOverTruthVsEta_->GetYaxis()->SetTitle("Reco E/True E per Eta Bin");
1042  hist_EOverTruthVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1043  hist_EOverTruthVsPhi_->GetYaxis()->SetTitle("Reco E/True E per Phi Bin");
1044  hist_resolutionEVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1045  hist_resolutionEVsEt_->GetYaxis()->SetTitle("#sigma of Reco E/True E per Et Bin");
1046  hist_resolutionEVsE_->GetXaxis()->SetTitle("E (GeV)");
1047  hist_resolutionEVsE_->GetYaxis()->SetTitle("#sigma of Reco E/True E per E Bin");
1048  hist_resolutionEVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1049  hist_resolutionEVsEta_->GetYaxis()->SetTitle("#sigma of Reco E/True E per Eta Bin");
1050  hist_resolutionEVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1051  hist_resolutionEVsPhi_->GetYaxis()->SetTitle("#sigma of Reco E/True E per Phi Bin");
1052 
1053  hist_Eta_->GetXaxis()->SetTitle("#eta (Radians)");
1054  hist_Eta_->GetYaxis()->SetTitle("# per Eta Bin");
1055  hist_EtaOverTruth_->GetXaxis()->SetTitle("Reco Eta/True Eta");
1056  hist_EtaOverTruth_->GetYaxis()->SetTitle("# per Ratio Bin");
1057  hist_EtaEfficiency_->GetXaxis()->SetTitle("#eta (Radians)");
1058  hist_EtaEfficiency_->GetYaxis()->SetTitle("# True Reconstructed/# True per Eta Bin");
1059  hist_EtaNumRecoOverNumTrue_->GetXaxis()->SetTitle("#eta (Radians)");
1060  hist_EtaNumRecoOverNumTrue_->GetYaxis()->SetTitle("# Reco/# True per Eta Bin");
1061  hist_deltaEtaVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1062  hist_deltaEtaVsEt_->GetYaxis()->SetTitle("Reco Eta - True Eta per Et Bin");
1063  hist_deltaEtaVsE_->GetXaxis()->SetTitle("E (GeV)");
1064  hist_deltaEtaVsE_->GetYaxis()->SetTitle("Reco Eta - True Eta per E Bin");
1065  hist_deltaEtaVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1066  hist_deltaEtaVsEta_->GetYaxis()->SetTitle("Reco Eta - True Eta per Eta Bin");
1067  hist_deltaEtaVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1068  hist_deltaEtaVsPhi_->GetYaxis()->SetTitle("Reco Eta - True Eta per Phi Bin");
1069  hist_resolutionEtaVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1070  hist_resolutionEtaVsEt_->GetYaxis()->SetTitle("#sigma of Reco Eta - True Eta per Et Bin");
1071  hist_resolutionEtaVsE_->GetXaxis()->SetTitle("E (GeV)");
1072  hist_resolutionEtaVsE_->GetYaxis()->SetTitle("#sigma of Reco Eta - True Eta per E Bin");
1073  hist_resolutionEtaVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1074  hist_resolutionEtaVsEta_->GetYaxis()->SetTitle("#sigma of Reco Eta - True Eta per Eta Bin");
1075  hist_resolutionEtaVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1076  hist_resolutionEtaVsPhi_->GetYaxis()->SetTitle("#sigma of Reco Eta - True Eta per Phi Bin");
1077 
1078  hist_Phi_->GetXaxis()->SetTitle("#phi (Radians)");
1079  hist_Phi_->GetYaxis()->SetTitle("# per Phi Bin");
1080  hist_PhiOverTruth_->GetXaxis()->SetTitle("Reco Phi/True Phi");
1081  hist_PhiOverTruth_->GetYaxis()->SetTitle("# per Ratio Bin");
1082  hist_PhiEfficiency_->GetXaxis()->SetTitle("#phi (Radians)");
1083  hist_PhiEfficiency_->GetYaxis()->SetTitle("# True Reconstructed/# True per Phi Bin");
1084  hist_PhiNumRecoOverNumTrue_->GetXaxis()->SetTitle("#Phi (Radians)");
1085  hist_PhiNumRecoOverNumTrue_->GetYaxis()->SetTitle("# Reco/# True per Phi Bin");
1086  hist_deltaPhiVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1087  hist_deltaPhiVsEt_->GetYaxis()->SetTitle("Reco Phi - True Phi per Et Bin");
1088  hist_deltaPhiVsE_->GetXaxis()->SetTitle("E (GeV)");
1089  hist_deltaPhiVsE_->GetYaxis()->SetTitle("Reco Phi - True Phi per E Bin");
1090  hist_deltaPhiVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1091  hist_deltaPhiVsEta_->GetYaxis()->SetTitle("Reco Phi - True Phi per Eta Bin");
1092  hist_deltaPhiVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1093  hist_deltaPhiVsPhi_->GetYaxis()->SetTitle("Reco Phi - True Phi per Phi Bin");
1094  hist_resolutionPhiVsEt_->GetXaxis()->SetTitle("Et (GeV)");
1095  hist_resolutionPhiVsEt_->GetYaxis()->SetTitle("#sigma of Reco Phi - True Phi per Et Bin");
1096  hist_resolutionPhiVsE_->GetXaxis()->SetTitle("E (GeV)");
1097  hist_resolutionPhiVsE_->GetYaxis()->SetTitle("#sigma of Reco Phi - True Phi per E Bin");
1098  hist_resolutionPhiVsEta_->GetXaxis()->SetTitle("#eta (Radians)");
1099  hist_resolutionPhiVsEta_->GetYaxis()->SetTitle("#sigma of Reco Phi - True Phi per Eta Bin");
1100  hist_resolutionPhiVsPhi_->GetXaxis()->SetTitle("#phi (Radians)");
1101  hist_resolutionPhiVsPhi_->GetYaxis()->SetTitle("#sigma of Reco Phi - True Phi per Phi Bin");
1102 
1103  std::string recoParticleName;
1104 
1105  if (particleID == 22)
1106  recoParticleName = "Reco Higgs";
1107  else if (particleID == 11)
1108  recoParticleName = "Reco Z";
1109 
1110  hist_All_recoMass_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1111  hist_All_recoMass_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1112  hist_BarrelOnly_recoMass_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1113  hist_BarrelOnly_recoMass_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1114  hist_EndcapOnly_recoMass_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1115  hist_EndcapOnly_recoMass_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1116  hist_Mixed_recoMass_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1117  hist_Mixed_recoMass_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1118  hist_recoMass_withBackgroud_NoEtCut_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1119  hist_recoMass_withBackgroud_NoEtCut_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1120  hist_recoMass_withBackgroud_5EtCut_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1121  hist_recoMass_withBackgroud_5EtCut_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1122  hist_recoMass_withBackgroud_10EtCut_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1123  hist_recoMass_withBackgroud_10EtCut_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1124  hist_recoMass_withBackgroud_20EtCut_->GetXaxis()->SetTitle((recoParticleName + " Mass (GeV)").c_str());
1125  hist_recoMass_withBackgroud_20EtCut_->GetYaxis()->SetTitle("# of Reco Masses per Mass Bin");
1126 }
1127 
1129  hist_Et_->SetOption("e");
1130  hist_EtOverTruth_->SetOption("e");
1131  hist_EtEfficiency_->SetOption("e");
1132  hist_EtNumRecoOverNumTrue_->SetOption("e");
1133  hist_EtOverTruthVsEt_->SetOption("e");
1134  hist_EtOverTruthVsE_->SetOption("e");
1135  hist_EtOverTruthVsEta_->SetOption("e");
1136  hist_EtOverTruthVsPhi_->SetOption("e");
1137  hist_resolutionEtVsEt_->SetOption("e");
1138  hist_resolutionEtVsE_->SetOption("e");
1139  hist_resolutionEtVsEta_->SetOption("e");
1140  hist_resolutionEtVsPhi_->SetOption("e");
1141 
1142  hist_E_->SetOption("e");
1143  hist_EOverTruth_->SetOption("e");
1144  hist_EEfficiency_->SetOption("e");
1145  hist_ENumRecoOverNumTrue_->SetOption("e");
1146  hist_EOverTruthVsEt_->SetOption("e");
1147  hist_EOverTruthVsE_->SetOption("e");
1148  hist_EOverTruthVsEta_->SetOption("e");
1149  hist_EOverTruthVsPhi_->SetOption("e");
1150  hist_resolutionEVsEt_->SetOption("e");
1151  hist_resolutionEVsE_->SetOption("e");
1152  hist_resolutionEVsEta_->SetOption("e");
1153  hist_resolutionEVsPhi_->SetOption("e");
1154 
1155  hist_Eta_->SetOption("e");
1156  hist_EtaOverTruth_->SetOption("e");
1157  hist_EtaEfficiency_->SetOption("e");
1158  hist_EtaNumRecoOverNumTrue_->SetOption("e");
1159  hist_deltaEtaVsEt_->SetOption("e");
1160  hist_deltaEtaVsE_->SetOption("e");
1161  hist_deltaEtaVsEta_->SetOption("e");
1162  hist_deltaEtaVsPhi_->SetOption("e");
1163  hist_resolutionEtaVsEt_->SetOption("e");
1164  hist_resolutionEtaVsE_->SetOption("e");
1165  hist_resolutionEtaVsEta_->SetOption("e");
1166  hist_resolutionEtaVsPhi_->SetOption("e");
1167 
1168  hist_Phi_->SetOption("e");
1169  hist_PhiOverTruth_->SetOption("e");
1170  hist_PhiEfficiency_->SetOption("e");
1171  hist_PhiNumRecoOverNumTrue_->SetOption("e");
1172  hist_deltaPhiVsEt_->SetOption("e");
1173  hist_deltaPhiVsE_->SetOption("e");
1174  hist_deltaPhiVsEta_->SetOption("e");
1175  hist_deltaPhiVsPhi_->SetOption("e");
1176  hist_resolutionPhiVsEt_->SetOption("e");
1177  hist_resolutionPhiVsE_->SetOption("e");
1178  hist_resolutionPhiVsEta_->SetOption("e");
1179  hist_resolutionPhiVsPhi_->SetOption("e");
1180 
1181  hist_All_recoMass_->SetOption("e");
1182  hist_BarrelOnly_recoMass_->SetOption("e");
1183  hist_EndcapOnly_recoMass_->SetOption("e");
1184  hist_Mixed_recoMass_->SetOption("e");
1185  hist_recoMass_withBackgroud_NoEtCut_->SetOption("e");
1186  hist_recoMass_withBackgroud_5EtCut_->SetOption("e");
1187  hist_recoMass_withBackgroud_10EtCut_->SetOption("e");
1188  hist_recoMass_withBackgroud_20EtCut_->SetOption("e");
1189 }
1190 
1192  rootFile_->cd();
1193  rootFile_->GetDirectory(particleString.c_str())->mkdir("ET");
1194  rootFile_->cd(("/" + particleString + "/ET").c_str());
1195 
1196  hist_Et_->Write();
1197  hist_EtOverTruth_->Write();
1198  hist_EtEfficiency_->Write();
1199  hist_EtNumRecoOverNumTrue_->Write();
1200  hist_EtOverTruthVsEt_->Write();
1201  hist_EtOverTruthVsE_->Write();
1202  hist_EtOverTruthVsEta_->Write();
1203  hist_EtOverTruthVsPhi_->Write();
1204  hist_resolutionEtVsEt_->Write();
1205  hist_resolutionEtVsE_->Write();
1206  hist_resolutionEtVsEta_->Write();
1207  hist_resolutionEtVsPhi_->Write();
1208 
1209  rootFile_->cd();
1210  rootFile_->GetDirectory(particleString.c_str())->mkdir("E");
1211  rootFile_->cd(("/" + particleString + "/E").c_str());
1212 
1213  hist_E_->Write();
1214  hist_EOverTruth_->Write();
1215  hist_EEfficiency_->Write();
1216  hist_ENumRecoOverNumTrue_->Write();
1217  hist_EOverTruthVsEt_->Write();
1218  hist_EOverTruthVsE_->Write();
1219  hist_EOverTruthVsEta_->Write();
1220  hist_EOverTruthVsPhi_->Write();
1221  hist_resolutionEVsEt_->Write();
1222  hist_resolutionEVsE_->Write();
1223  hist_resolutionEVsEta_->Write();
1224  hist_resolutionEVsPhi_->Write();
1225 
1226  rootFile_->cd();
1227  rootFile_->GetDirectory(particleString.c_str())->mkdir("Eta");
1228  rootFile_->cd(("/" + particleString + "/Eta").c_str());
1229 
1230  hist_Eta_->Write();
1231  hist_EtaOverTruth_->Write();
1232  hist_EtaEfficiency_->Write();
1233  hist_EtaNumRecoOverNumTrue_->Write();
1234  hist_deltaEtaVsEt_->Write();
1235  hist_deltaEtaVsE_->Write();
1236  hist_deltaEtaVsEta_->Write();
1237  hist_deltaEtaVsPhi_->Write();
1238  hist_resolutionEtaVsEt_->Write();
1239  hist_resolutionEtaVsE_->Write();
1240  hist_resolutionEtaVsEta_->Write();
1241  hist_resolutionEtaVsPhi_->Write();
1242 
1243  rootFile_->cd();
1244  rootFile_->GetDirectory(particleString.c_str())->mkdir("Phi");
1245  rootFile_->cd(("/" + particleString + "/Phi").c_str());
1246 
1247  hist_Phi_->Write();
1248  hist_PhiOverTruth_->Write();
1249  hist_PhiEfficiency_->Write();
1250  hist_PhiNumRecoOverNumTrue_->Write();
1251  hist_deltaPhiVsEt_->Write();
1252  hist_deltaPhiVsE_->Write();
1253  hist_deltaPhiVsEta_->Write();
1254  hist_deltaPhiVsPhi_->Write();
1255  hist_resolutionPhiVsEt_->Write();
1256  hist_resolutionPhiVsE_->Write();
1257  hist_resolutionPhiVsEta_->Write();
1258  hist_resolutionPhiVsPhi_->Write();
1259 
1260  std::string recoParticleName;
1261 
1262  if (particleID == 22)
1263  recoParticleName = "HiggsRecoMass";
1264  else if (particleID == 11)
1265  recoParticleName = "ZRecoMass";
1266 
1267  rootFile_->cd();
1268  rootFile_->GetDirectory(particleString.c_str())->mkdir(recoParticleName.c_str());
1269  rootFile_->cd(("/" + particleString + "/" + recoParticleName).c_str());
1270 
1271  hist_All_recoMass_->Write();
1272  hist_BarrelOnly_recoMass_->Write();
1273  hist_EndcapOnly_recoMass_->Write();
1274  hist_Mixed_recoMass_->Write();
1279 
1280  rootFile_->cd();
1281  rootFile_->GetDirectory(particleString.c_str())->mkdir("_TempScatterPlots");
1282  rootFile_->cd(("/" + particleString + "/_TempScatterPlots").c_str());
1283 
1288 
1293 
1298 
1303 
1304  rootFile_->cd();
1305 }
EgammaObjects::hist_min_E_
double hist_min_E_
Definition: EgammaObjects.h:49
EgammaObjects::hist_min_Eta_
double hist_min_Eta_
Definition: EgammaObjects.h:53
EgammaObjects::hist_EndcapOnly_recoMass_
TH1D * hist_EndcapOnly_recoMass_
Definition: EgammaObjects.h:143
EgammaObjects::loadHistoParameters
void loadHistoParameters(const edm::ParameterSet &ps)
Definition: EgammaObjects.cc:96
EgammaObjects::analyzePhotons
void analyzePhotons(const edm::Event &, const edm::EventSetup &)
Definition: EgammaObjects.cc:431
Handle.h
EgammaObjects::hist_EOverTruthVsPhi_
TH1D * hist_EOverTruthVsPhi_
Definition: EgammaObjects.h:109
EgammaObjects::hist_resolutionEtaVsE_
TH1D * hist_resolutionEtaVsE_
Definition: EgammaObjects.h:124
EgammaObjects::hist_min_EOverTruth_
double hist_min_EOverTruth_
Definition: EgammaObjects.h:65
EgammaObjects::hist_Mixed_recoMass_
TH1D * hist_Mixed_recoMass_
Definition: EgammaObjects.h:144
reco::Photon::superCluster
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
MessageLogger.h
EgammaObjects::hist_deltaEtaVsEt_
TH1D * hist_deltaEtaVsEt_
Definition: EgammaObjects.h:119
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EgammaObjects::hist_EtaOverTruth_
TH1D * hist_EtaOverTruth_
Definition: EgammaObjects.h:116
EgammaObjects::hist_Et_
TH1D * hist_Et_
Definition: EgammaObjects.h:89
EgammaObjects::_TEMP_scatterPlot_EtOverTruthVsEta_
TH2D * _TEMP_scatterPlot_EtOverTruthVsEta_
Definition: EgammaObjects.h:153
EgammaObjects::hist_min_deltaEta_
double hist_min_deltaEta_
Definition: EgammaObjects.h:77
BasicCluster.h
EgammaObjects::_TEMP_scatterPlot_EtOverTruthVsPhi_
TH2D * _TEMP_scatterPlot_EtOverTruthVsPhi_
Definition: EgammaObjects.h:154
EgammaObjects::_TEMP_scatterPlot_deltaPhiVsEt_
TH2D * _TEMP_scatterPlot_deltaPhiVsEt_
Definition: EgammaObjects.h:166
EgammaObjects::hist_max_EtOverTruth_
double hist_max_EtOverTruth_
Definition: EgammaObjects.h:62
EgammaObjects::_TEMP_scatterPlot_deltaEtaVsE_
TH2D * _TEMP_scatterPlot_deltaEtaVsE_
Definition: EgammaObjects.h:162
EgammaObjects::hist_All_recoMass_
TH1D * hist_All_recoMass_
Definition: EgammaObjects.h:141
EgammaObjects::hist_resolutionEtVsPhi_
TH1D * hist_resolutionEtVsPhi_
Definition: EgammaObjects.h:100
EgammaObjects::hist_recoMass_withBackgroud_10EtCut_
TH1D * hist_recoMass_withBackgroud_10EtCut_
Definition: EgammaObjects.h:148
EgammaObjects::hist_PhiNumRecoOverNumTrue_
TH1D * hist_PhiNumRecoOverNumTrue_
Definition: EgammaObjects.h:131
EgammaObjects::createTempHistoObjects
void createTempHistoObjects()
Definition: EgammaObjects.cc:290
EgammaObjects::rootFile_
TFile * rootFile_
Definition: EgammaObjects.h:35
EgammaObjects::hist_deltaEtaVsE_
TH1D * hist_deltaEtaVsE_
Definition: EgammaObjects.h:120
PhotonFwd.h
EgammaObjects::hist_ENumRecoOverNumTrue_
TH1D * hist_ENumRecoOverNumTrue_
Definition: EgammaObjects.h:105
EgammaObjects::hist_bins_Eta_
int hist_bins_Eta_
Definition: EgammaObjects.h:55
EgammaObjects::hist_Phi_
TH1D * hist_Phi_
Definition: EgammaObjects.h:128
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
EgammaObjects::hist_min_recoMass_
double hist_min_recoMass_
Definition: EgammaObjects.h:85
tools.TF1
TF1
Definition: tools.py:23
edm::Handle< reco::PhotonCollection >
EgammaObjects::hist_bins_PhiOverTruth_
int hist_bins_PhiOverTruth_
Definition: EgammaObjects.h:75
EgammaObjects::_TEMP_scatterPlot_EOverTruthVsPhi_
TH2D * _TEMP_scatterPlot_EOverTruthVsPhi_
Definition: EgammaObjects.h:159
EgammaObjects::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: EgammaObjects.cc:424
EgammaObjects::hist_resolutionEVsPhi_
TH1D * hist_resolutionEVsPhi_
Definition: EgammaObjects.h:113
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
EgammaObjects::hist_EtaNumRecoOverNumTrue_
TH1D * hist_EtaNumRecoOverNumTrue_
Definition: EgammaObjects.h:118
EgammaObjects::hist_deltaPhiVsEt_
TH1D * hist_deltaPhiVsEt_
Definition: EgammaObjects.h:132
EgammaObjects::hist_max_Et_
double hist_max_Et_
Definition: EgammaObjects.h:46
EgammaObjects::hist_deltaPhiVsE_
TH1D * hist_deltaPhiVsE_
Definition: EgammaObjects.h:133
EgammaObjects::hist_max_deltaPhi_
double hist_max_deltaPhi_
Definition: EgammaObjects.h:82
EgammaObjects::hist_min_EtaOverTruth_
double hist_min_EtaOverTruth_
Definition: EgammaObjects.h:69
EgammaObjects::_TEMP_scatterPlot_deltaPhiVsEta_
TH2D * _TEMP_scatterPlot_deltaPhiVsEta_
Definition: EgammaObjects.h:168
EgammaObjects::hist_PhiEfficiency_
TH1D * hist_PhiEfficiency_
Definition: EgammaObjects.h:130
Photon.h
EgammaObjects::hist_min_Et_
double hist_min_Et_
Definition: EgammaObjects.h:45
reco::GsfElectron::caloPosition
math::XYZPoint caloPosition() const
Definition: GsfElectron.h:310
EgammaObjects::EgammaObjects
EgammaObjects(const edm::ParameterSet &)
Definition: EgammaObjects.cc:19
EgammaObjects::fitHistos
void fitHistos()
Definition: EgammaObjects.cc:956
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
EgammaObjects::hist_resolutionEVsE_
TH1D * hist_resolutionEVsE_
Definition: EgammaObjects.h:111
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
EgammaObjects::hist_max_PhiOverTruth_
double hist_max_PhiOverTruth_
Definition: EgammaObjects.h:74
EgammaObjects::hist_max_Eta_
double hist_max_Eta_
Definition: EgammaObjects.h:54
EgammaObjects::hist_BarrelOnly_recoMass_
TH1D * hist_BarrelOnly_recoMass_
Definition: EgammaObjects.h:142
EgammaObjects::hist_EOverTruthVsE_
TH1D * hist_EOverTruthVsE_
Definition: EgammaObjects.h:107
EgammaObjects::hist_EtNumRecoOverNumTrue_
TH1D * hist_EtNumRecoOverNumTrue_
Definition: EgammaObjects.h:92
EgammaObjects::hist_max_deltaEta_
double hist_max_deltaEta_
Definition: EgammaObjects.h:78
EgammaObjects::hist_bins_recoMass_
int hist_bins_recoMass_
Definition: EgammaObjects.h:87
EgammaObjects::hist_resolutionPhiVsEta_
TH1D * hist_resolutionPhiVsEta_
Definition: EgammaObjects.h:138
EgammaObjects::~EgammaObjects
~EgammaObjects() override
Definition: EgammaObjects.cc:142
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EgammaObjects::hist_resolutionEtaVsPhi_
TH1D * hist_resolutionEtaVsPhi_
Definition: EgammaObjects.h:126
EgammaObjects::hist_deltaPhiVsPhi_
TH1D * hist_deltaPhiVsPhi_
Definition: EgammaObjects.h:135
EgammaObjects::hist_EtOverTruthVsPhi_
TH1D * hist_EtOverTruthVsPhi_
Definition: EgammaObjects.h:96
EgammaObjects::hist_resolutionEtaVsEt_
TH1D * hist_resolutionEtaVsEt_
Definition: EgammaObjects.h:123
EgammaObjects::hist_EtOverTruth_
TH1D * hist_EtOverTruth_
Definition: EgammaObjects.h:90
EgammaObjects::hist_EOverTruth_
TH1D * hist_EOverTruth_
Definition: EgammaObjects.h:103
EgammaObjects::ecalEta
float ecalEta(float EtaParticle, float Zvertex, float plane_Radius)
Definition: EgammaObjects.cc:771
Geom::pi
constexpr double pi()
Definition: Pi.h:31
eostools.mkdir
def mkdir(path)
Definition: eostools.py:251
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
reco::GsfElectron
Definition: GsfElectron.h:35
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
GsfElectron.h
EgammaObjects::findRecoMass
double findRecoMass(const reco::Photon &pOne, const reco::Photon &pTwo)
Definition: EgammaObjects.cc:751
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
EgammaObjects::hist_resolutionEtVsEta_
TH1D * hist_resolutionEtVsEta_
Definition: EgammaObjects.h:99
EgammaObjects::hist_bins_Phi_
int hist_bins_Phi_
Definition: EgammaObjects.h:59
EgammaObjects::hist_max_recoMass_
double hist_max_recoMass_
Definition: EgammaObjects.h:86
EgammaObjects::_TEMP_scatterPlot_EOverTruthVsEta_
TH2D * _TEMP_scatterPlot_EOverTruthVsEta_
Definition: EgammaObjects.h:158
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
EgammaObjects::hist_deltaPhiVsEta_
TH1D * hist_deltaPhiVsEta_
Definition: EgammaObjects.h:134
EgammaObjects::hist_Eta_
TH1D * hist_Eta_
Definition: EgammaObjects.h:115
ClusterShape.h
EgammaObjects::hist_resolutionPhiVsE_
TH1D * hist_resolutionPhiVsE_
Definition: EgammaObjects.h:137
GsfElectronFwd.h
EgammaObjects::particleID
int particleID
Definition: EgammaObjects.h:40
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
EgammaObjects.h
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
EgammaObjects::hist_deltaEtaVsPhi_
TH1D * hist_deltaEtaVsPhi_
Definition: EgammaObjects.h:122
EgammaObjects::hist_resolutionPhiVsEt_
TH1D * hist_resolutionPhiVsEt_
Definition: EgammaObjects.h:136
EgammaObjects::_TEMP_scatterPlot_deltaEtaVsEta_
TH2D * _TEMP_scatterPlot_deltaEtaVsEta_
Definition: EgammaObjects.h:163
EgammaObjects::hist_resolutionEVsEta_
TH1D * hist_resolutionEVsEta_
Definition: EgammaObjects.h:112
EgammaObjects::particleString
std::string particleString
Definition: EgammaObjects.h:41
EgammaObjects::applyLabels
void applyLabels()
Definition: EgammaObjects.cc:1002
EgammaObjects::_TEMP_scatterPlot_EOverTruthVsE_
TH2D * _TEMP_scatterPlot_EOverTruthVsE_
Definition: EgammaObjects.h:157
EgammaObjects::hist_bins_EtaOverTruth_
int hist_bins_EtaOverTruth_
Definition: EgammaObjects.h:71
EgammaObjects::hist_EtOverTruthVsE_
TH1D * hist_EtOverTruthVsE_
Definition: EgammaObjects.h:94
EgammaObjects::_TEMP_scatterPlot_deltaEtaVsPhi_
TH2D * _TEMP_scatterPlot_deltaEtaVsPhi_
Definition: EgammaObjects.h:164
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
EgammaObjects::hist_EtEfficiency_
TH1D * hist_EtEfficiency_
Definition: EgammaObjects.h:91
EgammaObjects::hist_deltaEtaVsEta_
TH1D * hist_deltaEtaVsEta_
Definition: EgammaObjects.h:121
EgammaObjects::_TEMP_scatterPlot_deltaEtaVsEt_
TH2D * _TEMP_scatterPlot_deltaEtaVsEt_
Definition: EgammaObjects.h:161
EgammaObjects::createBookedHistoObjects
void createBookedHistoObjects()
Definition: EgammaObjects.cc:151
EgammaObjects::hist_resolutionEtaVsEta_
TH1D * hist_resolutionEtaVsEta_
Definition: EgammaObjects.h:125
EgammaObjects::hist_bins_Et_
int hist_bins_Et_
Definition: EgammaObjects.h:47
EgammaObjects::hist_EtOverTruthVsEt_
TH1D * hist_EtOverTruthVsEt_
Definition: EgammaObjects.h:93
EgammaObjects::hist_EtOverTruthVsEta_
TH1D * hist_EtOverTruthVsEta_
Definition: EgammaObjects.h:95
EgammaObjects::beginJob
void beginJob() override
Definition: EgammaObjects.cc:144
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
EgammaObjects::getDeltaResHistosViaSlicing
void getDeltaResHistosViaSlicing()
Definition: EgammaObjects.cc:820
EgammaObjects::setDrawOptions
void setDrawOptions()
Definition: EgammaObjects.cc:1128
edm::EventSetup
Definition: EventSetup.h:57
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
EgammaObjects::hist_recoMass_withBackgroud_NoEtCut_
TH1D * hist_recoMass_withBackgroud_NoEtCut_
Definition: EgammaObjects.h:146
nano_cff.genEvent
genEvent
Definition: nano_cff.py:97
EgammaObjects::hist_bins_EOverTruth_
int hist_bins_EOverTruth_
Definition: EgammaObjects.h:67
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
EgammaObjects::endJob
void endJob() override
Definition: EgammaObjects.cc:806
edm::EDConsumerBase::labelsForToken
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
Definition: EDConsumerBase.cc:347
EgammaObjects::hist_bins_deltaPhi_
int hist_bins_deltaPhi_
Definition: EgammaObjects.h:83
reco::Photon
Definition: Photon.h:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EgammaObjects::hist_resolutionEtVsE_
TH1D * hist_resolutionEtVsE_
Definition: EgammaObjects.h:98
EgammaObjects::_TEMP_scatterPlot_EtOverTruthVsE_
TH2D * _TEMP_scatterPlot_EtOverTruthVsE_
Definition: EgammaObjects.h:152
EgammaObjects::hist_EtaEfficiency_
TH1D * hist_EtaEfficiency_
Definition: EgammaObjects.h:117
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
EgammaObjects::hist_bins_deltaEta_
int hist_bins_deltaEta_
Definition: EgammaObjects.h:79
EgammaObjects::_TEMP_scatterPlot_EtOverTruthVsEt_
TH2D * _TEMP_scatterPlot_EtOverTruthVsEt_
Definition: EgammaObjects.h:151
EgammaObjects::hist_recoMass_withBackgroud_5EtCut_
TH1D * hist_recoMass_withBackgroud_5EtCut_
Definition: EgammaObjects.h:147
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
EgammaObjects::_TEMP_scatterPlot_deltaPhiVsPhi_
TH2D * _TEMP_scatterPlot_deltaPhiVsPhi_
Definition: EgammaObjects.h:169
SuperCluster.h
EgammaObjects::hist_resolutionEtVsEt_
TH1D * hist_resolutionEtVsEt_
Definition: EgammaObjects.h:97
ETA
#define ETA
Definition: GenericBenchmark.cc:28
EgammaObjects::hist_recoMass_withBackgroud_20EtCut_
TH1D * hist_recoMass_withBackgroud_20EtCut_
Definition: EgammaObjects.h:149
EgammaObjects::hist_min_Phi_
double hist_min_Phi_
Definition: EgammaObjects.h:57
EgammaObjects::hist_max_EtaOverTruth_
double hist_max_EtaOverTruth_
Definition: EgammaObjects.h:70
EgammaObjects::hist_E_
TH1D * hist_E_
Definition: EgammaObjects.h:102
EgammaObjects::hist_bins_EtOverTruth_
int hist_bins_EtOverTruth_
Definition: EgammaObjects.h:63
EgammaObjects::hist_bins_E_
int hist_bins_E_
Definition: EgammaObjects.h:51
Exception.h
reco::GsfElectron::superCluster
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:163
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
EgammaObjects::_TEMP_scatterPlot_deltaPhiVsE_
TH2D * _TEMP_scatterPlot_deltaPhiVsE_
Definition: EgammaObjects.h:167
EgammaObjects::hist_min_PhiOverTruth_
double hist_min_PhiOverTruth_
Definition: EgammaObjects.h:73
EgammaObjects::hist_resolutionPhiVsPhi_
TH1D * hist_resolutionPhiVsPhi_
Definition: EgammaObjects.h:139
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
EgammaObjects::hist_EEfficiency_
TH1D * hist_EEfficiency_
Definition: EgammaObjects.h:104
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
EgammaObjects::hist_PhiOverTruth_
TH1D * hist_PhiOverTruth_
Definition: EgammaObjects.h:129
EgammaObjects::EtCut
int EtCut
Definition: EgammaObjects.h:43
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
EgammaObjects::hist_EOverTruthVsEt_
TH1D * hist_EOverTruthVsEt_
Definition: EgammaObjects.h:106
EgammaObjects::hist_EOverTruthVsEta_
TH1D * hist_EOverTruthVsEta_
Definition: EgammaObjects.h:108
HepMCProduct.h
EgammaObjects::RecoCollectionT_
edm::EDGetTokenT< reco::GsfElectronCollection > RecoCollectionT_
Definition: EgammaObjects.h:38
EgammaObjects::hist_max_Phi_
double hist_max_Phi_
Definition: EgammaObjects.h:58
ZEcal
static constexpr float ZEcal
Definition: L1TkEmParticleProducer.cc:40
EgammaObjects::hist_max_E_
double hist_max_E_
Definition: EgammaObjects.h:50
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
EgammaObjects::hist_min_deltaPhi_
double hist_min_deltaPhi_
Definition: EgammaObjects.h:81
edm::Event
Definition: Event.h:73
EgammaObjects::MCTruthCollectionT_
edm::EDGetTokenT< edm::HepMCProduct > MCTruthCollectionT_
Definition: EgammaObjects.h:37
reco::GsfElectron::caloEnergy
float caloEnergy() const
Definition: GsfElectron.h:823
EgammaObjects::getEfficiencyHistosViaDividing
void getEfficiencyHistosViaDividing()
Definition: EgammaObjects.cc:944
EgammaObjects::hist_min_EtOverTruth_
double hist_min_EtOverTruth_
Definition: EgammaObjects.h:61
EgammaObjects::loadCMSSWObjects
void loadCMSSWObjects(const edm::ParameterSet &ps)
Definition: EgammaObjects.cc:91
EgammaObjects::_TEMP_scatterPlot_EOverTruthVsEt_
TH2D * _TEMP_scatterPlot_EOverTruthVsEt_
Definition: EgammaObjects.h:156
edm::InputTag
Definition: InputTag.h:15
EgammaObjects::hist_max_EOverTruth_
double hist_max_EOverTruth_
Definition: EgammaObjects.h:66
Z_Endcap
static constexpr float Z_Endcap
Definition: ECALPositionCalculator.cc:11
EgammaObjects::analyzeElectrons
void analyzeElectrons(const edm::Event &, const edm::EventSetup &)
Definition: EgammaObjects.cc:594
R_ECAL
static constexpr float R_ECAL
Definition: ECALPositionCalculator.cc:10
edm::ProductLabels
Definition: ProductLabels.h:4
etaBarrelEndcap
static constexpr float etaBarrelEndcap
Definition: ECALPositionCalculator.cc:12
EgammaObjects::saveHistos
void saveHistos()
Definition: EgammaObjects.cc:1191
EgammaObjects::hist_resolutionEVsEt_
TH1D * hist_resolutionEVsEt_
Definition: EgammaObjects.h:110