CMS 3D CMS Logo

Public Member Functions | Protected Attributes

PFCandidateManager Class Reference

A benchmark managing several benchmarks. More...

#include <PFCandidateManager.h>

Inheritance diagram for PFCandidateManager:
Benchmark PFCandidateManagerAnalyzer

List of all members.

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_

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.

PFCandidateManager::~PFCandidateManager ( ) [virtual]

Definition at line 19 of file PFCandidateManager.cc.

{}

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 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]
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().

void PFCandidateManager::setup ( void  )

Member Data Documentation

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().

Definition at line 60 of file PFCandidateManager.h.

Referenced by fill().

Definition at line 56 of file PFCandidateManager.h.

Referenced by fill().