test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
PFCandidateBenchmark Class Reference

#include <PFCandidateBenchmark.h>

Inheritance diagram for PFCandidateBenchmark:
Benchmark PFCandidateBenchmarkAnalyzer

Public Member Functions

void fill (const reco::PFCandidateCollection &pfCands)
 
void fillOne (const reco::PFCandidate &pfCand)
 fill histograms with a given particle More...
 
 PFCandidateBenchmark (Mode mode)
 
void setup (DQMStore::IBooker &b)
 book histograms More...
 
virtual ~PFCandidateBenchmark ()
 
- Public Member Functions inherited from Benchmark
 Benchmark (Mode mode=DEFAULT)
 
bool isInRange (float pt, float eta, float phi) const
 
virtual void setDirectory (TDirectory *dir)
 
void setParameters (Mode mode)
 
void setRange (float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
 
void write ()
 write to the TFile, in plain ROOT mode. No need to call this function in DQM mode More...
 
virtual ~Benchmark ()
 

Protected Attributes

TH1F * ecalEnergy_
 
TH1F * elementsInBlocksSize_
 
TH1F * hcalEnergy_
 
TH1F * mva_e_pi_
 
TH1F * particleId_
 
- Protected Attributes inherited from Benchmark
TDirectory * dir_
 
float etaMax_
 
float etaMin_
 
Mode mode_
 
float phiMax_
 
float phiMin_
 
float ptMax_
 
float ptMin_
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum  Mode { DEFAULT, DQMOFFLINE, VALIDATION }
 
- Protected Member Functions inherited from Benchmark
TH1F * book1D (DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax)
 book a 1D histogram, either with DQM or plain root depending if DQM_ has been initialized in a child analyzer or not. More...
 
TH2F * book2D (DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax)
 book a 2D histogram, either with DQM or plain root depending if DQM_ has been initialized in a child analyzer or not. More...
 
TH2F * book2D (DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float *xbins, int nbinsy, float ymin, float ymax)
 book a 2D histogram, either with DQM or plain root depending if DQM_ has been initialized in a child analyzer or not. More...
 
TProfile * bookProfile (DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float xmin, float xmax, float ymin, float ymax, const char *option)
 book a TProfile histogram, either with DQM or plain root depending if DQM_ has been initialized in a child analyzer or not. More...
 
TProfile * bookProfile (DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float *xbins, float ymin, float ymax, const char *option)
 book a TProfile histogram, either with DQM or plain root depending if DQM_ has been initialized in a child analyzer or not. More...
 

Detailed Description

To plot specific PFCandidate quantities the name of the histograms corresponds to the name of the PFCandidate accessors.

Definition at line 11 of file PFCandidateBenchmark.h.

Constructor & Destructor Documentation

PFCandidateBenchmark::PFCandidateBenchmark ( Mode  mode)
inline

Definition at line 15 of file PFCandidateBenchmark.h.

15 : Benchmark(mode) {}
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:41
PFCandidateBenchmark::~PFCandidateBenchmark ( )
virtual

Definition at line 17 of file PFCandidateBenchmark.cc.

17 {}

Member Function Documentation

void PFCandidateBenchmark::fill ( const reco::PFCandidateCollection pfCands)

Definition at line 49 of file PFCandidateBenchmark.cc.

References i.

Referenced by PFCandidateBenchmarkAnalyzer::analyze().

49  {
50 
51  for(unsigned i=0; i<pfCands.size(); ++i) {
52  fillOne(pfCands[i]);
53  }
54 }
int i
Definition: DBlmapReader.cc:9
void fillOne(const reco::PFCandidate &pfCand)
fill histograms with a given particle
void PFCandidateBenchmark::fillOne ( const reco::PFCandidate pfCand)

fill histograms with a given particle

Definition at line 57 of file PFCandidateBenchmark.cc.

References reco::PFCandidate::ecalEnergy(), reco::PFCandidate::elementsInBlocks(), reco::LeafCandidate::eta(), reco::PFCandidate::hcalEnergy(), reco::PFCandidate::mva_e_pi(), reco::PFCandidate::particleId(), reco::LeafCandidate::phi(), and reco::LeafCandidate::pt().

Referenced by PFCandidateManager::fill().

57  {
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
virtual double phi() const final
momentum azimuthal angle
float mva_e_pi() const
mva for electron-pion discrimination
Definition: PFCandidate.h:313
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:231
virtual double eta() const final
momentum pseudorapidity
virtual ParticleType particleId() const
Definition: PFCandidate.h:373
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:682
virtual double pt() const final
transverse momentum
void PFCandidateBenchmark::setup ( DQMStore::IBooker b)

book histograms

Definition at line 20 of file PFCandidateBenchmark.cc.

References Benchmark::PhaseSpace::m, Benchmark::PhaseSpace::M, and Benchmark::PhaseSpace::n.

Referenced by PFCandidateBenchmarkAnalyzer::bookHistograms().

20  {
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 }
TH1F * book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root depending if DQM_ has been initialized in a child ...
Definition: Benchmark.cc:23
Mode mode_
Definition: Benchmark.h:105

Member Data Documentation

TH1F* PFCandidateBenchmark::ecalEnergy_
protected

Definition at line 29 of file PFCandidateBenchmark.h.

TH1F* PFCandidateBenchmark::elementsInBlocksSize_
protected

Definition at line 32 of file PFCandidateBenchmark.h.

TH1F* PFCandidateBenchmark::hcalEnergy_
protected

Definition at line 30 of file PFCandidateBenchmark.h.

TH1F* PFCandidateBenchmark::mva_e_pi_
protected

Definition at line 31 of file PFCandidateBenchmark.h.

TH1F* PFCandidateBenchmark::particleId_
protected

Definition at line 28 of file PFCandidateBenchmark.h.