CMS 3D CMS Logo

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...
 
 ~PFCandidateBenchmark () override
 
- 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 () noexcept(false)
 

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
typedef dqm::legacy::DQMStore DQMStore
 
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, either through IBooker 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::PFCandidateBenchmark ( Mode  mode)
inline

◆ ~PFCandidateBenchmark()

PFCandidateBenchmark::~PFCandidateBenchmark ( )
override

Definition at line 12 of file PFCandidateBenchmark.cc.

12 {}

Member Function Documentation

◆ fill()

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

Definition at line 39 of file PFCandidateBenchmark.cc.

References mps_fire::i.

Referenced by PFCandidateBenchmarkAnalyzer::analyze().

39  {
40  for (unsigned i = 0; i < pfCands.size(); ++i) {
41  fillOne(pfCands[i]);
42  }
43 }
void fillOne(const reco::PFCandidate &pfCand)
fill histograms with a given particle

◆ fillOne()

void PFCandidateBenchmark::fillOne ( const reco::PFCandidate pfCand)

fill histograms with a given particle

Definition at line 45 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().

45  {
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 }
double pt() const final
transverse momentum
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:663
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:233
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:50
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
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

◆ setup()

void PFCandidateBenchmark::setup ( DQMStore::IBooker b)

book histograms

Definition at line 14 of file PFCandidateBenchmark.cc.

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

Referenced by PFCandidateBenchmarkAnalyzer::bookHistograms().

14  {
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 }
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:15
double b
Definition: hdecay.h:118
Mode mode_
Definition: Benchmark.h:118

Member Data Documentation

◆ ecalEnergy_

TH1F* PFCandidateBenchmark::ecalEnergy_
protected

Definition at line 26 of file PFCandidateBenchmark.h.

◆ elementsInBlocksSize_

TH1F* PFCandidateBenchmark::elementsInBlocksSize_
protected

Definition at line 29 of file PFCandidateBenchmark.h.

◆ hcalEnergy_

TH1F* PFCandidateBenchmark::hcalEnergy_
protected

Definition at line 27 of file PFCandidateBenchmark.h.

◆ mva_e_pi_

TH1F* PFCandidateBenchmark::mva_e_pi_
protected

Definition at line 28 of file PFCandidateBenchmark.h.

◆ particleId_

TH1F* PFCandidateBenchmark::particleId_
protected

Definition at line 25 of file PFCandidateBenchmark.h.