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 
4 
5 // #include "DQMServices/Core/interface/MonitorElement.h"
6 // #include "DQMServices/Core/interface/DQMStore.h"
7 
8 #include <TROOT.h>
9 #include <TFile.h>
10 #include <TH1.h>
11 #include <TH2.h>
12 
13 
14 using namespace std;
15 
16 
17 
19 
20 
22 
23  PhaseSpace ecalEnergyPS(100,0,100);
24  PhaseSpace hcalEnergyPS(100,0,100);
25  PhaseSpace mva_e_piPS(100,-1,1);
26  switch(mode_) {
27  case VALIDATION:
28  break;
29  case DQMOFFLINE:
30  default:
31  ecalEnergyPS.n = 50;
32  hcalEnergyPS.n = 50;
33  mva_e_piPS.n = 50;
34  break;
35  break;
36  }
37 
38  particleId_ = book1D("particleId_", "particle ID", 7,1,8);
39  ecalEnergy_ = book1D("ecalEnergy_", "ECAL energy, corrected;E_{ECAL} (GeV)",
40  ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M);
41  hcalEnergy_ = book1D("hcalEnergy_", "HCAL energy, corrected;E_{HCAL} (GeV)",
42  ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M);
43  mva_e_pi_ = book1D("mva_e_pi_", "e VS #pi MVA output;MVA",
44  mva_e_piPS.n, mva_e_piPS.m, mva_e_piPS.M);
45  elementsInBlocksSize_ = book1D("elementsInBlocksSize_", "number of elements used", 10, 0, 10);
46 }
47 
48 
49 
51 
52  for(unsigned i=0; i<pfCands.size(); ++i) {
53  fillOne(pfCands[i]);
54  }
55 }
56 
57 
59 
60  if( !isInRange(pfCand.pt(), pfCand.eta(), pfCand.phi() ) ) return;
61 
62  particleId_->Fill( pfCand.particleId() );
63  ecalEnergy_->Fill( pfCand.ecalEnergy() );
64  hcalEnergy_->Fill( pfCand.hcalEnergy() );
65  mva_e_pi_->Fill( pfCand.mva_e_pi() );
66  elementsInBlocksSize_->Fill( pfCand.elementsInBlocks().size() );
67 }
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:204
int i
Definition: DBlmapReader.cc:9
void fill(const reco::PFCandidateCollection &pfCands)
virtual float pt() const
transverse momentum
virtual float phi() const
momentum azimuthal angle
virtual float eta() const
momentum pseudorapidity
float mva_e_pi() const
mva for electron-pion discrimination
Definition: PFCandidate.h:294
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void fillOne(const reco::PFCandidate &pfCand)
fill histograms with a given particle
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:38
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:214
void setup()
book histograms
virtual ParticleType particleId() const
Definition: PFCandidate.h:355
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:675