A benchmark managing several benchmarks. More...
#include <PFCandidateManager.h>
Public Member Functions | |
template<class C > | |
void | fill (const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection) |
fill histograms with all particle | |
PFCandidateManager (float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT) | |
void | setDirectory (TDirectory *dir) |
set directory (to use in ROOT) | |
void | setParameters (float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT) |
set the benchmark parameters | |
void | setup () |
book histograms | |
virtual | ~PFCandidateManager () |
Protected Attributes | |
CandidateBenchmark | candBench_ |
float | dRMax_ |
MatchCandidateBenchmark | matchCandBench_ |
bool | matchCharge_ |
PFCandidateBenchmark | pfCandBench_ |
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.
PFCandidateManager::PFCandidateManager | ( | float | dRMax = 0.3 , |
bool | matchCharge = true , |
||
Benchmark::Mode | mode = Benchmark::DEFAULT |
||
) | [inline] |
Definition at line 28 of file PFCandidateManager.h.
: Benchmark(mode), candBench_(mode), pfCandBench_(mode), matchCandBench_(mode), dRMax_(dRMax), matchCharge_(matchCharge) {}
PFCandidateManager::~PFCandidateManager | ( | ) | [virtual] |
Definition at line 19 of file PFCandidateManager.cc.
{}
void PFCandidateManager::fill | ( | const reco::PFCandidateCollection & | candCollection, |
const C & | matchedCandCollection | ||
) |
fill histograms with all particle
Definition at line 68 of file PFCandidateManager.h.
References candBench_, dRMax_, reco::LeafCandidate::eta(), CandidateBenchmark::fillOne(), MatchCandidateBenchmark::fillOne(), PFCandidateBenchmark::fillOne(), i, Benchmark::isInRange(), match(), matchCandBench_, matchCharge_, pfCandBench_, reco::LeafCandidate::phi(), and reco::LeafCandidate::pt().
Referenced by PFCandidateManagerAnalyzer::analyze(), and PFRootEventManager::processEntry().
{ std::vector<int> matchIndices; PFB::match( candCollection, matchCandCollection, matchIndices, matchCharge_, dRMax_ ); for (unsigned int i = 0; i < candCollection.size(); i++) { const reco::PFCandidate& cand = candCollection[i]; if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) continue; int iMatch = matchIndices[i]; assert(iMatch< static_cast<int>(matchCandCollection.size())); //COLIN how to handle efficiency plots? // filling the histograms in CandidateBenchmark only in case // of a matching. if( iMatch!=-1 ) { candBench_.fillOne(cand); pfCandBench_.fillOne(cand); matchCandBench_.fillOne(cand, matchCandCollection[ iMatch ]); } } }
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().
Referenced by PFRootEventManager::readOptions().
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 alignBH_cfg::mode.
Referenced by PFRootEventManager::readOptions().
{ dRMax_ = dRMax; matchCharge_ = matchCharge; mode_ = mode; candBench_.setParameters(mode); pfCandBench_.setParameters(mode); matchCandBench_.setParameters(mode); }
void PFCandidateManager::setup | ( | void | ) |
book histograms
Definition at line 45 of file PFCandidateManager.cc.
Referenced by PFCandidateManagerAnalyzer::beginJob(), and PFRootEventManager::readOptions().
{ candBench_.setup(); pfCandBench_.setup(); matchCandBench_.setup(); }
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().
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().