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 ()
 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 }
 
- Static Public Attributes inherited from Benchmark
static DQMStoreDQM_ = 0
 
- Protected Member Functions inherited from Benchmark
TH1F * book1D (const char *histname, const char *title, int nbins, float xmin, float xmax)
 book a 1D histogram, either with DQM or plain root. More...
 
TH2F * book2D (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. More...
 
TH2F * book2D (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. More...
 
TProfile * bookProfile (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. More...
 
TProfile * bookProfile (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. 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:42
PFCandidateBenchmark::~PFCandidateBenchmark ( )
virtual

Definition at line 18 of file PFCandidateBenchmark.cc.

18 {}

Member Function Documentation

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

Definition at line 50 of file PFCandidateBenchmark.cc.

References i.

Referenced by PFCandidateBenchmarkAnalyzer::analyze().

50  {
51 
52  for(unsigned i=0; i<pfCands.size(); ++i) {
53  fillOne(pfCands[i]);
54  }
55 }
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 58 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().

58  {
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
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
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:214
virtual ParticleType particleId() const
Definition: PFCandidate.h:355
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:59
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:675
void PFCandidateBenchmark::setup ( void  )

book histograms

Definition at line 21 of file PFCandidateBenchmark.cc.

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

Referenced by PFCandidateBenchmarkAnalyzer::beginJob().

21  {
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 }
Mode mode_
Definition: Benchmark.h:96
TH1F * book1D(const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root.
Definition: Benchmark.cc:25

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.