CMS 3D CMS Logo

PFCandidateManager.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_Benchmark_BenchmarkManager_h
2 #define RecoParticleFlow_Benchmark_BenchmarkManager_h
3 
8 
11 
12 #include <vector>
13 
26 class PFCandidateManager : public Benchmark {
27 public:
29  : Benchmark(mode),
33  dRMax_(dRMax),
35 
36  ~PFCandidateManager() override;
37 
39  void setParameters(float dRMax = 0.3, bool matchCharge = true, Benchmark::Mode mode = Benchmark::DEFAULT);
40 
42  void setDirectory(TDirectory *dir) override;
43 
45  void setup(DQMStore::IBooker &b);
46 
48  template <class C>
49  void fill(const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection);
50 
51 protected:
55 
56  float dRMax_;
58 };
59 
61 
62 template <class C>
63 void PFCandidateManager::fill(const reco::PFCandidateCollection &candCollection, const C &matchCandCollection) {
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 }
88 
89 #endif
PFCandidateManager::matchCharge_
bool matchCharge_
Definition: PFCandidateManager.h:57
Benchmark
abstract base class
Definition: Benchmark.h:19
mps_fire.i
i
Definition: mps_fire.py:428
PFCandidateManager::setDirectory
void setDirectory(TDirectory *dir) override
set directory (to use in ROOT)
Definition: PFCandidateManager.cc:16
PFCandidate.h
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
Matchers.h
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
PFCandidateBenchmark
Definition: PFCandidateBenchmark.h:11
cms::cuda::assert
assert(be >=bs)
CandidateBenchmark
To plot Candidate quantities.
Definition: CandidateBenchmark.h:10
MatchCandidateBenchmark::fillOne
void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
fill histograms with a given particle
Definition: MatchCandidateBenchmark.cc:228
pfCandidateManager_cfi.matchCharge
matchCharge
Definition: pfCandidateManager_cfi.py:15
MatchCandidateBenchmark
To plot Candidate quantities.
Definition: MatchCandidateBenchmark.h:13
CandidateBenchmark.h
MatchCandidateBenchmark.h
PFCandidateManager::fill
void fill(const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection)
fill histograms with all particle
Definition: PFCandidateManager.h:63
b
double b
Definition: hdecay.h:118
Benchmark.h
Benchmark::Mode
Mode
Definition: Benchmark.h:32
PFCandidateManager
A benchmark managing several benchmarks.
Definition: PFCandidateManager.h:26
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
PFCandidateManager::pfCandBench_
PFCandidateBenchmark pfCandBench_
Definition: PFCandidateManager.h:53
PFCandidateManager::dRMax_
float dRMax_
Definition: PFCandidateManager.h:56
PFCandidateManager::PFCandidateManager
PFCandidateManager(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
Definition: PFCandidateManager.h:28
metBenchmark_cfi.dRMax
dRMax
Definition: metBenchmark_cfi.py:18
PFCandidateBenchmark.h
PFCandidateManager::matchCandBench_
MatchCandidateBenchmark matchCandBench_
Definition: PFCandidateManager.h:54
gen::C
C
Definition: PomwigHadronizer.cc:78
PFCandidateManager::setParameters
void setParameters(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
set the benchmark parameters
Definition: PFCandidateManager.cc:24
PFCandidateManager::~PFCandidateManager
~PFCandidateManager() override
Definition: PFCandidateManager.cc:14
Benchmark::DEFAULT
Definition: Benchmark.h:32
reco::PFCandidateCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Definition: PFCandidateFwd.h:12
dqm::implementation::IBooker
Definition: DQMStore.h:43
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
PFCandidateManager::setup
void setup(DQMStore::IBooker &b)
book histograms
Definition: PFCandidateManager.cc:34
PFCandidateFwd.h
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23