CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFCandConnector.h
Go to the documentation of this file.
1 #ifndef PFProducer_PFCandConnector_H_
2 #define PFProducer_PFCandConnector_H_
3 
5 
7 
9 
11 // \author : M. Gouzevitch
12 // \date : May 2010
13 
15 
17 
18  public :
19 
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  }
34 
35  void setParameters(const edm::ParameterSet& iCfgCandConnector){
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  }
61 
62 
63  void setParameters(bool bCorrect, bool bCalibPrimary, double dptRel_PrimaryTrack, double dptRel_MergedTrack, double ptErrorSecondary, std::vector<double> nuclCalibFactors);
64  void setDebug( bool debug ) {debug_ = debug;}
65 
66 
67 
68  std::auto_ptr<reco::PFCandidateCollection> connect(std::auto_ptr<reco::PFCandidateCollection>& pfCand);
69 
70 
71 
72  private :
73 
75  void analyseNuclearWPrim(std::auto_ptr<reco::PFCandidateCollection>&, unsigned int);
76 
78  void analyseNuclearWSec(std::auto_ptr<reco::PFCandidateCollection>&, unsigned int);
79 
80  bool isPrimaryNucl( const reco::PFCandidate& pf ) const;
81 
82  bool isSecondaryNucl( const reco::PFCandidate& pf ) const;
83 
85  double rescaleFactor( const double pt, const double cFrac ) const;
86 
88  std::auto_ptr<reco::PFCandidateCollection> pfC_;
90  std::vector<bool> bMask_;
91 
93  bool debug_;
94  bool bCorrect_;
95 
98  std::vector< double > fConst_;
99  std::vector< double > fNorm_;
100  std::vector< double > fExp_;
101 
102  // Maximal accepatble uncertainty on primary tracks to usem them as MC truth for calibration
106 
108  static const double pion_mass2;
111 };
112 
113 #endif
std::vector< double > fConst_
T getParameter(std::string const &) const
std::auto_ptr< reco::PFCandidateCollection > connect(std::auto_ptr< reco::PFCandidateCollection > &pfCand)
bool isPrimaryNucl(const reco::PFCandidate &pf) const
std::vector< bool > bMask_
A mask to define the candidates which shall not be transmitted.
void analyseNuclearWSec(std::auto_ptr< reco::PFCandidateCollection > &, unsigned int)
Analyse nuclear interactions where a secondary track is present.
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.
bool exists(std::string const &parameterName) const
checks if a parameter exists
static const reco::PFCandidate::Flags fT_FROM_DISP_
std::vector< double > fNorm_
static const reco::PFCandidate::Flags fT_TO_DISP_
std::vector< double > fExp_
Based on a class from : V. Roberfroid, February 2008.
bool debug_
Parameters.
static const double pion_mass2
Useful constants.
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.
void analyseNuclearWPrim(std::auto_ptr< reco::PFCandidateCollection > &, unsigned int)
Analyse nuclear interactions where a primary or merged track is present.
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:33
void setParameters(const edm::ParameterSet &iCfgCandConnector)
#define debug
Definition: MEtoEDMFormat.h:34
void setDebug(bool debug)
double dptRel_MergedTrack_