CMS 3D CMS Logo

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

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
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 *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...
 
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...
 
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...
 
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...
 

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 26 of file PFCandidateManager.h.

Constructor & Destructor Documentation

◆ PFCandidateManager()

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

Definition at line 28 of file PFCandidateManager.h.

◆ ~PFCandidateManager()

PFCandidateManager::~PFCandidateManager ( )
override

Definition at line 14 of file PFCandidateManager.cc.

14 {}

Member Function Documentation

◆ fill()

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

fill histograms with all particle

Definition at line 63 of file PFCandidateManager.h.

63  {
64  std::vector<int> matchIndices;
65  PFB::match(candCollection, matchCandCollection, matchIndices, matchCharge_, dRMax_);
66 
67  for (unsigned int i = 0; i < candCollection.size(); i++) {
68  const reco::PFCandidate &cand = candCollection[i];
69 
70  if (!isInRange(cand.pt(), cand.eta(), cand.phi()))
71  continue;
72 
73  int iMatch = matchIndices[i];
74 
75  assert(iMatch < static_cast<int>(matchCandCollection.size()));
76 
77  // COLIN how to handle efficiency plots?
78 
79  // filling the histograms in CandidateBenchmark only in case
80  // of a matching.
81  if (iMatch != -1) {
84  matchCandBench_.fillOne(cand, matchCandCollection[iMatch]);
85  }
86  }
87 }

References cms::cuda::assert(), candBench_, dRMax_, PFCandidateBenchmark::fillOne(), CandidateBenchmark::fillOne(), MatchCandidateBenchmark::fillOne(), mps_fire::i, Benchmark::isInRange(), PFB::match(), matchCandBench_, matchCharge_, and pfCandBench_.

Referenced by PFCandidateManagerAnalyzer::analyze().

◆ setDirectory()

void PFCandidateManager::setDirectory ( TDirectory *  dir)
overridevirtual

set directory (to use in ROOT)

Reimplemented from Benchmark.

Definition at line 16 of file PFCandidateManager.cc.

References DeadROC_duringRun::dir, and Benchmark::setDirectory().

◆ setParameters()

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

◆ setup()

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

book histograms

Definition at line 34 of file PFCandidateManager.cc.

34  {
38 }

References b.

Referenced by PFCandidateManagerAnalyzer::bookHistograms().

Member Data Documentation

◆ candBench_

CandidateBenchmark PFCandidateManager::candBench_
protected

Definition at line 52 of file PFCandidateManager.h.

Referenced by fill().

◆ dRMax_

float PFCandidateManager::dRMax_
protected

Definition at line 56 of file PFCandidateManager.h.

Referenced by fill().

◆ matchCandBench_

MatchCandidateBenchmark PFCandidateManager::matchCandBench_
protected

Definition at line 54 of file PFCandidateManager.h.

Referenced by fill().

◆ matchCharge_

bool PFCandidateManager::matchCharge_
protected

Definition at line 57 of file PFCandidateManager.h.

Referenced by fill().

◆ pfCandBench_

PFCandidateBenchmark PFCandidateManager::pfCandBench_
protected

Definition at line 53 of file PFCandidateManager.h.

Referenced by fill().

PFCandidateBenchmark::setup
void setup(DQMStore::IBooker &b)
book histograms
Definition: PFCandidateBenchmark.cc:14
PFCandidateManager::matchCharge_
bool matchCharge_
Definition: PFCandidateManager.h:57
mps_fire.i
i
Definition: mps_fire.py:428
MatchCandidateBenchmark::setup
void setup(DQMStore::IBooker &b)
book histograms
Definition: MatchCandidateBenchmark.cc:28
Benchmark::isInRange
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:50
PFB::match
void match(const C &candCollection, const M &matchedCandCollection, std::vector< int > &matchIndices, bool matchCharge=false, float dRMax=-1)
Definition: Matchers.h:17
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
cms::cuda::assert
assert(be >=bs)
Benchmark::setParameters
void setParameters(Mode mode)
Definition: Benchmark.h:39
MatchCandidateBenchmark::fillOne
void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
fill histograms with a given particle
Definition: MatchCandidateBenchmark.cc:228
CandidateBenchmark::setup
void setup(DQMStore::IBooker &b)
book histograms
Definition: CandidateBenchmark.cc:24
pfCandidateManager_cfi.matchCharge
matchCharge
Definition: pfCandidateManager_cfi.py:15
Benchmark::mode_
Mode mode_
Definition: Benchmark.h:118
b
double b
Definition: hdecay.h:118
Benchmark::Benchmark
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:34
cand
Definition: decayParser.h:32
CandidateBenchmark::fillOne
void fillOne(const reco::Candidate &candidate)
fill histograms with a given particle
Definition: CandidateBenchmark.cc:90
PFCandidateManager::candBench_
CandidateBenchmark candBench_
Definition: PFCandidateManager.h:52
Benchmark::setDirectory
virtual void setDirectory(TDirectory *dir)
Definition: Benchmark.cc:13
PFCandidateManager::pfCandBench_
PFCandidateBenchmark pfCandBench_
Definition: PFCandidateManager.h:53
PFCandidateManager::dRMax_
float dRMax_
Definition: PFCandidateManager.h:56
metBenchmark_cfi.dRMax
dRMax
Definition: metBenchmark_cfi.py:18
PFCandidateManager::matchCandBench_
MatchCandidateBenchmark matchCandBench_
Definition: PFCandidateManager.h:54
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
PFCandidateBenchmark::fillOne
void fillOne(const reco::PFCandidate &pfCand)
fill histograms with a given particle
Definition: PFCandidateBenchmark.cc:45
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23