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
PFCandidateManager Class Reference

A benchmark managing several benchmarks. More...

#include <PFCandidateManager.h>

Inheritance diagram for PFCandidateManager:
Benchmark PFCandidateManagerAnalyzer

Public Member Functions

template<class C >
void fill (const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection)
 fill histograms with all particle More...
 
 PFCandidateManager (float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
 
void setDirectory (TDirectory *dir)
 set directory (to use in ROOT) More...
 
void setParameters (float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
 set the benchmark parameters More...
 
void setup (DQMStore::IBooker &b)
 book histograms More...
 
virtual ~PFCandidateManager ()
 
- Public Member Functions inherited from Benchmark
 Benchmark (Mode mode=DEFAULT)
 
bool isInRange (float pt, float eta, float phi) const
 
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

CandidateBenchmark candBench_
 
float dRMax_
 
MatchCandidateBenchmark matchCandBench_
 
bool matchCharge_
 
PFCandidateBenchmark pfCandBench_
 
- 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

A benchmark managing several benchmarks.

The benchmarks are filled only for the PFCandidates matched to a candidate in the matching collection within the limits in delta R. The parameters for this benchmark are:

Definition at line 24 of file PFCandidateManager.h.

Constructor & Destructor Documentation

PFCandidateManager::PFCandidateManager ( float  dRMax = 0.3,
bool  matchCharge = true,
Benchmark::Mode  mode = Benchmark::DEFAULT 
)
inline

Definition at line 28 of file PFCandidateManager.h.

31  :
32  Benchmark(mode),
34  dRMax_(dRMax), matchCharge_(matchCharge) {}
CandidateBenchmark candBench_
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:41
MatchCandidateBenchmark matchCandBench_
PFCandidateBenchmark pfCandBench_
PFCandidateManager::~PFCandidateManager ( )
virtual

Definition at line 19 of file PFCandidateManager.cc.

19 {}

Member Function Documentation

template<class C >
void PFCandidateManager::fill ( const reco::PFCandidateCollection candCollection,
const C &  matchedCandCollection 
)

fill histograms with all particle

Definition at line 68 of file PFCandidateManager.h.

References assert(), candBench_, dRMax_, reco::LeafCandidate::eta(), PFCandidateBenchmark::fillOne(), CandidateBenchmark::fillOne(), MatchCandidateBenchmark::fillOne(), i, Benchmark::isInRange(), PFB::match(), matchCandBench_, matchCharge_, pfCandBench_, reco::LeafCandidate::phi(), and reco::LeafCandidate::pt().

Referenced by PFCandidateManagerAnalyzer::analyze().

69  {
70 
71 
72  std::vector<int> matchIndices;
73  PFB::match( candCollection, matchCandCollection, matchIndices,
75 
76  for (unsigned int i = 0; i < candCollection.size(); i++) {
77  const reco::PFCandidate& cand = candCollection[i];
78 
79  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) continue;
80 
81  int iMatch = matchIndices[i];
82 
83  assert(iMatch< static_cast<int>(matchCandCollection.size()));
84 
85  //COLIN how to handle efficiency plots?
86 
87  // filling the histograms in CandidateBenchmark only in case
88  // of a matching.
89  if( iMatch!=-1 ) {
90  candBench_.fillOne(cand);
91  pfCandBench_.fillOne(cand);
92  matchCandBench_.fillOne(cand, matchCandCollection[ iMatch ]);
93  }
94  }
95 }
int i
Definition: DBlmapReader.cc:9
void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
fill histograms with a given particle
void match(const C &candCollection, const M &matchedCandCollection, std::vector< int > &matchIndices, bool matchCharge=false, float dRMax=-1)
Definition: Matchers.h:17
void fillOne(const reco::Candidate &candidate)
fill histograms with a given particle
assert(m_qm.get())
virtual double phi() const final
momentum azimuthal angle
CandidateBenchmark candBench_
MatchCandidateBenchmark matchCandBench_
void fillOne(const reco::PFCandidate &pfCand)
fill histograms with a given particle
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
virtual double eta() const final
momentum pseudorapidity
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
PFCandidateBenchmark pfCandBench_
virtual double pt() const final
transverse momentum
void PFCandidateManager::setDirectory ( TDirectory *  dir)
virtual

set directory (to use in ROOT)

Reimplemented from Benchmark.

Definition at line 22 of file PFCandidateManager.cc.

References Benchmark::setDirectory().

22  {
23 
25 
29 
30 }
CandidateBenchmark candBench_
virtual void setDirectory(TDirectory *dir)
Definition: Benchmark.cc:18
MatchCandidateBenchmark matchCandBench_
dbl *** dir
Definition: mlp_gen.cc:35
PFCandidateBenchmark pfCandBench_
void PFCandidateManager::setParameters ( float  dRMax = 0.3,
bool  matchCharge = true,
Benchmark::Mode  mode = Benchmark::DEFAULT 
)

set the benchmark parameters

Definition at line 32 of file PFCandidateManager.cc.

References HLT_25ns10e33_v2_cff::dRMax, and alignBH_cfg::mode.

34  {
35  dRMax_ = dRMax;
36  matchCharge_ = matchCharge;
37  mode_ = mode;
38 
42 
43 }
CandidateBenchmark candBench_
void setParameters(Mode mode)
Definition: Benchmark.h:49
MatchCandidateBenchmark matchCandBench_
Mode mode_
Definition: Benchmark.h:105
PFCandidateBenchmark pfCandBench_
void PFCandidateManager::setup ( DQMStore::IBooker b)

book histograms

Definition at line 45 of file PFCandidateManager.cc.

Referenced by PFCandidateManagerAnalyzer::bookHistograms().

45  {
46  candBench_.setup(b);
49 }
void setup(DQMStore::IBooker &b)
book histograms
CandidateBenchmark candBench_
MatchCandidateBenchmark matchCandBench_
void setup(DQMStore::IBooker &b)
book histograms
void setup(DQMStore::IBooker &b)
book histograms
PFCandidateBenchmark pfCandBench_

Member Data Documentation

CandidateBenchmark PFCandidateManager::candBench_
protected

Definition at line 55 of file PFCandidateManager.h.

Referenced by fill().

float PFCandidateManager::dRMax_
protected

Definition at line 59 of file PFCandidateManager.h.

Referenced by fill().

MatchCandidateBenchmark PFCandidateManager::matchCandBench_
protected

Definition at line 57 of file PFCandidateManager.h.

Referenced by fill().

bool PFCandidateManager::matchCharge_
protected

Definition at line 60 of file PFCandidateManager.h.

Referenced by fill().

PFCandidateBenchmark PFCandidateManager::pfCandBench_
protected

Definition at line 56 of file PFCandidateManager.h.

Referenced by fill().