CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
PFCandConnector Class Reference

Based on a class from : V. Roberfroid, February 2008. More...

#include <PFCandConnector.h>

Public Member Functions

std::auto_ptr
< reco::PFCandidateCollection
connect (std::auto_ptr< reco::PFCandidateCollection > &pfCand)
 
 PFCandConnector ()
 
void setDebug (bool debug)
 
void setParameters (const edm::ParameterSet &iCfgCandConnector)
 
void setParameters (bool bCorrect, bool bCalibPrimary, double dptRel_PrimaryTrack, double dptRel_MergedTrack, double ptErrorSecondary, const std::vector< double > &nuclCalibFactors)
 

Private Member Functions

void analyseNuclearWPrim (std::auto_ptr< reco::PFCandidateCollection > &, unsigned int)
 Analyse nuclear interactions where a primary or merged track is present. More...
 
void analyseNuclearWSec (std::auto_ptr< reco::PFCandidateCollection > &, unsigned int)
 Analyse nuclear interactions where a secondary track is present. More...
 
bool isPrimaryNucl (const reco::PFCandidate &pf) const
 
bool isSecondaryNucl (const reco::PFCandidate &pf) const
 
double rescaleFactor (const double pt, const double cFrac) const
 Return a calibration factor for a reconstructed nuclear interaction. More...
 

Private Attributes

bool bCalibPrimary_
 Calibration parameters for the reconstructed nuclear interactions. More...
 
bool bCorrect_
 
std::vector< bool > bMask_
 A mask to define the candidates which shall not be transmitted. More...
 
bool debug_
 Parameters. More...
 
double dptRel_MergedTrack_
 
double dptRel_PrimaryTrack_
 
std::vector< double > fConst_
 
std::vector< double > fExp_
 
std::vector< double > fNorm_
 
std::auto_ptr
< reco::PFCandidateCollection
pfC_
 Collection of primary PFCandidates to be transmitted to the Event. More...
 
double ptErrorSecondary_
 

Static Private Attributes

static const
reco::PFCandidate::Flags 
fT_FROM_DISP_ = PFCandidate::T_FROM_DISP
 
static const
reco::PFCandidate::Flags 
fT_TO_DISP_ = PFCandidate::T_TO_DISP
 
static const double pion_mass2 = 0.0194
 Useful constants. More...
 

Detailed Description

Based on a class from : V. Roberfroid, February 2008.

Definition at line 16 of file PFCandConnector.h.

Constructor & Destructor Documentation

PFCandConnector::PFCandConnector ( )
inline

Definition at line 20 of file PFCandConnector.h.

References bCalibPrimary_, bCorrect_, debug_, dptRel_MergedTrack_, dptRel_PrimaryTrack_, fConst_, fExp_, fNorm_, pfC_, and ptErrorSecondary_.

20  {
21  pfC_ = std::auto_ptr<reco::PFCandidateCollection>(new reco::PFCandidateCollection);
22  debug_ = false;
23  bCorrect_ = false;
24  bCalibPrimary_ = false;
25 
26  fConst_.push_back(1), fConst_.push_back(0);
27  fNorm_.push_back(0), fNorm_.push_back(0);
28  fExp_.push_back(0);
29 
32  ptErrorSecondary_ = 0.;
33  }
std::vector< double > fConst_
std::vector< double > fNorm_
std::vector< double > fExp_
bool debug_
Parameters.
std::auto_ptr< reco::PFCandidateCollection > pfC_
Collection of primary PFCandidates to be transmitted to the Event.
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
double dptRel_PrimaryTrack_
bool bCalibPrimary_
Calibration parameters for the reconstructed nuclear interactions.
double dptRel_MergedTrack_

Member Function Documentation

void PFCandConnector::analyseNuclearWPrim ( std::auto_ptr< reco::PFCandidateCollection > &  ,
unsigned  int 
)
private

Analyse nuclear interactions where a primary or merged track is present.

Definition at line 157 of file PFCandConnector.cc.

void PFCandConnector::analyseNuclearWSec ( std::auto_ptr< reco::PFCandidateCollection > &  ,
unsigned  int 
)
private

Analyse nuclear interactions where a secondary track is present.

Definition at line 335 of file PFCandConnector.cc.

std::auto_ptr< reco::PFCandidateCollection > PFCandConnector::connect ( std::auto_ptr< reco::PFCandidateCollection > &  pfCand)
bool PFCandConnector::isPrimaryNucl ( const reco::PFCandidate pf) const
private

Definition at line 498 of file PFCandConnector.cc.

bool PFCandConnector::isSecondaryNucl ( const reco::PFCandidate pf) const
private

Definition at line 482 of file PFCandConnector.cc.

double PFCandConnector::rescaleFactor ( const double  pt,
const double  cFrac 
) const
private

Return a calibration factor for a reconstructed nuclear interaction.

Definition at line 517 of file PFCandConnector.cc.

void PFCandConnector::setDebug ( bool  debug)
inline

Definition at line 64 of file PFCandConnector.h.

References debug, and debug_.

64 {debug_ = debug;}
bool debug_
Parameters.
#define debug
Definition: HDRShower.cc:19
void PFCandConnector::setParameters ( const edm::ParameterSet iCfgCandConnector)
inline

Flag to apply the correction procedure for nuclear interactions

Flag to calibrate the reconstructed nuclear interactions with primary or merged tracks

Definition at line 35 of file PFCandConnector.h.

References edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().

35  {
36 
37  bool bCorrect, bCalibPrimary;
38  double dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary;
39  std::vector<double> nuclCalibFactors;
40 
42  bCorrect = iCfgCandConnector.getParameter<bool>("bCorrect");
44  bCalibPrimary = iCfgCandConnector.getParameter<bool>("bCalibPrimary");
45 
46  if(iCfgCandConnector.exists("dptRel_PrimaryTrack")) dptRel_PrimaryTrack = iCfgCandConnector.getParameter<double>("dptRel_PrimaryTrack");
47  else { edm::LogWarning("PFCandConnector") << "dptRel_PrimaryTrack doesn't exist. Setting a default safe value 0" << std::endl; dptRel_PrimaryTrack = 0;}
48 
49  if(iCfgCandConnector.exists("dptRel_MergedTrack")) dptRel_MergedTrack = iCfgCandConnector.getParameter<double>("dptRel_MergedTrack");
50  else { edm::LogWarning("PFCandConnector") << "dptRel_MergedTrack doesn't exist. Setting a default safe value 0" << std::endl; dptRel_MergedTrack = 0;}
51 
52  if(iCfgCandConnector.exists("ptErrorSecondary")) ptErrorSecondary = iCfgCandConnector.getParameter<double>("ptErrorSecondary");
53  else { edm::LogWarning("PFCandConnector") << "ptErrorSecondary doesn't exist. Setting a default safe value 0" << std::endl; ptErrorSecondary = 0;}
54 
55  if(iCfgCandConnector.exists("nuclCalibFactors")) nuclCalibFactors = iCfgCandConnector.getParameter<std::vector<double> >("nuclCalibFactors");
56  else { edm::LogWarning("PFCandConnector") << "nuclear calib factors doesn't exist the factor would not be applyed" << std::endl; }
57 
58  setParameters(bCorrect, bCalibPrimary, dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary, nuclCalibFactors);
59 
60  }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
void setParameters(const edm::ParameterSet &iCfgCandConnector)
void PFCandConnector::setParameters ( bool  bCorrect,
bool  bCalibPrimary,
double  dptRel_PrimaryTrack,
double  dptRel_MergedTrack,
double  ptErrorSecondary,
const std::vector< double > &  nuclCalibFactors 
)

Definition at line 16 of file PFCandConnector.cc.

Member Data Documentation

bool PFCandConnector::bCalibPrimary_
private

Calibration parameters for the reconstructed nuclear interactions.

Definition at line 97 of file PFCandConnector.h.

Referenced by PFCandConnector().

bool PFCandConnector::bCorrect_
private

Definition at line 94 of file PFCandConnector.h.

Referenced by PFCandConnector().

std::vector<bool> PFCandConnector::bMask_
private

A mask to define the candidates which shall not be transmitted.

Definition at line 90 of file PFCandConnector.h.

bool PFCandConnector::debug_
private

Parameters.

Definition at line 93 of file PFCandConnector.h.

Referenced by PFCandConnector(), and setDebug().

double PFCandConnector::dptRel_MergedTrack_
private

Definition at line 104 of file PFCandConnector.h.

Referenced by PFCandConnector().

double PFCandConnector::dptRel_PrimaryTrack_
private

Definition at line 103 of file PFCandConnector.h.

Referenced by PFCandConnector().

std::vector< double > PFCandConnector::fConst_
private

Definition at line 98 of file PFCandConnector.h.

Referenced by PFCandConnector().

std::vector< double > PFCandConnector::fExp_
private

Definition at line 100 of file PFCandConnector.h.

Referenced by PFCandConnector().

std::vector< double > PFCandConnector::fNorm_
private

Definition at line 99 of file PFCandConnector.h.

Referenced by PFCandConnector().

const reco::PFCandidate::Flags PFCandConnector::fT_FROM_DISP_ = PFCandidate::T_FROM_DISP
staticprivate

Definition at line 110 of file PFCandConnector.h.

const reco::PFCandidate::Flags PFCandConnector::fT_TO_DISP_ = PFCandidate::T_TO_DISP
staticprivate

Definition at line 109 of file PFCandConnector.h.

std::auto_ptr<reco::PFCandidateCollection> PFCandConnector::pfC_
private

Collection of primary PFCandidates to be transmitted to the Event.

Definition at line 88 of file PFCandConnector.h.

Referenced by PFCandConnector().

const double PFCandConnector::pion_mass2 = 0.0194
staticprivate

Useful constants.

Definition at line 108 of file PFCandConnector.h.

double PFCandConnector::ptErrorSecondary_
private

Definition at line 105 of file PFCandConnector.h.

Referenced by PFCandConnector().