CMS 3D CMS Logo

PFCandidateBenchmark.cc
Go to the documentation of this file.
2 
4 
5 #include <TFile.h>
6 #include <TH1.h>
7 #include <TH2.h>
8 #include <TROOT.h>
9 
10 using namespace std;
11 
13 
15  PhaseSpace ecalEnergyPS(100, 0, 100);
16  PhaseSpace hcalEnergyPS(100, 0, 100);
17  PhaseSpace mva_e_piPS(100, -1, 1);
18  switch (mode_) {
19  case VALIDATION:
20  break;
21  case DQMOFFLINE:
22  default:
23  ecalEnergyPS.n = 50;
24  hcalEnergyPS.n = 50;
25  mva_e_piPS.n = 50;
26  break;
27  break;
28  }
29 
30  particleId_ = book1D(b, "particleId_", "particle ID", 7, 1, 8);
31  ecalEnergy_ =
32  book1D(b, "ecalEnergy_", "ECAL energy, corrected;E_{ECAL} (GeV)", ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M);
33  hcalEnergy_ =
34  book1D(b, "hcalEnergy_", "HCAL energy, corrected;E_{HCAL} (GeV)", ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M);
35  mva_e_pi_ = book1D(b, "mva_e_pi_", "e VS #pi MVA output;MVA", mva_e_piPS.n, mva_e_piPS.m, mva_e_piPS.M);
36  elementsInBlocksSize_ = book1D(b, "elementsInBlocksSize_", "number of elements used", 10, 0, 10);
37 }
38 
40  for (unsigned i = 0; i < pfCands.size(); ++i) {
41  fillOne(pfCands[i]);
42  }
43 }
44 
46  if (!isInRange(pfCand.pt(), pfCand.eta(), pfCand.phi()))
47  return;
48 
49  particleId_->Fill(pfCand.particleId());
50  ecalEnergy_->Fill(pfCand.ecalEnergy());
51  hcalEnergy_->Fill(pfCand.hcalEnergy());
52  mva_e_pi_->Fill(pfCand.mva_e_pi());
53  elementsInBlocksSize_->Fill(pfCand.elementsInBlocks().size());
54 }
void fill(const reco::PFCandidateCollection &pfCands)
double pt() const final
transverse momentum
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:665
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:233
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
double b
Definition: hdecay.h:120
void setup(DQMStore::IBooker &b)
book histograms
void fillOne(const reco::PFCandidate &pfCand)
fill histograms with a given particle
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
double phi() const final
momentum azimuthal angle
float mva_e_pi() const
mva for electron-pion discrimination
Definition: PFCandidate.h:317
virtual ParticleType particleId() const
Definition: PFCandidate.h:392
double eta() const final
momentum pseudorapidity