CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFCandidateBenchmark.cc
Go to the documentation of this file.
2 
3 
5 
6 
7 #include <TROOT.h>
8 #include <TFile.h>
9 #include <TH1.h>
10 #include <TH2.h>
11 
12 
13 using namespace std;
14 
15 
16 
18 
19 
21 
22  PhaseSpace ecalEnergyPS(100,0,100);
23  PhaseSpace hcalEnergyPS(100,0,100);
24  PhaseSpace mva_e_piPS(100,-1,1);
25  switch(mode_) {
26  case VALIDATION:
27  break;
28  case DQMOFFLINE:
29  default:
30  ecalEnergyPS.n = 50;
31  hcalEnergyPS.n = 50;
32  mva_e_piPS.n = 50;
33  break;
34  break;
35  }
36 
37  particleId_ = book1D(b, "particleId_", "particle ID", 7,1,8);
38  ecalEnergy_ = book1D(b, "ecalEnergy_", "ECAL energy, corrected;E_{ECAL} (GeV)",
39  ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M);
40  hcalEnergy_ = book1D(b, "hcalEnergy_", "HCAL energy, corrected;E_{HCAL} (GeV)",
41  ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M);
42  mva_e_pi_ = book1D(b, "mva_e_pi_", "e VS #pi MVA output;MVA",
43  mva_e_piPS.n, mva_e_piPS.m, mva_e_piPS.M);
44  elementsInBlocksSize_ = book1D(b, "elementsInBlocksSize_", "number of elements used", 10, 0, 10);
45 
46 }
47 
48 
50 
51  for(unsigned i=0; i<pfCands.size(); ++i) {
52  fillOne(pfCands[i]);
53  }
54 }
55 
56 
58 
59  if( !isInRange(pfCand.pt(), pfCand.eta(), pfCand.phi() ) ) return;
60 
61  particleId_->Fill( pfCand.particleId() );
62  ecalEnergy_->Fill( pfCand.ecalEnergy() );
63  hcalEnergy_->Fill( pfCand.hcalEnergy() );
64  mva_e_pi_->Fill( pfCand.mva_e_pi() );
65  elementsInBlocksSize_->Fill( pfCand.elementsInBlocks().size() );
66 }
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
int i
Definition: DBlmapReader.cc:9
void fill(const reco::PFCandidateCollection &pfCands)
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
float mva_e_pi() const
mva for electron-pion discrimination
Definition: PFCandidate.h:313
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:39
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:231
virtual ParticleType particleId() const
Definition: PFCandidate.h:373
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:682
virtual double phi() const
momentum azimuthal angle