CMS 3D CMS Logo

PFCandConnector.h
Go to the documentation of this file.
1 #ifndef PFProducer_PFCandConnector_H_
2 #define PFProducer_PFCandConnector_H_
3 
9 
10 // \author : M. Gouzevitch
11 // \date : May 2010
12 
14 
16 public:
18  bCorrect_ = false;
19  bCalibPrimary_ = false;
20 
21  fConst_.push_back(1), fConst_.push_back(0);
22  fNorm_.push_back(0), fNorm_.push_back(0);
23  fExp_.push_back(0);
24 
27  ptErrorSecondary_ = 0.;
28  }
29 
31  bool bCorrect, bCalibPrimary;
32  double dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary;
33  std::vector<double> nuclCalibFactors;
34 
36  bCorrect = iCfgCandConnector.getParameter<bool>("bCorrect");
38  bCalibPrimary = iCfgCandConnector.getParameter<bool>("bCalibPrimary");
39 
40  if (iCfgCandConnector.exists("dptRel_PrimaryTrack"))
41  dptRel_PrimaryTrack = iCfgCandConnector.getParameter<double>("dptRel_PrimaryTrack");
42  else {
43  edm::LogWarning("PFCandConnector") << "dptRel_PrimaryTrack doesn't exist. Setting a default safe value 0"
44  << std::endl;
45  dptRel_PrimaryTrack = 0;
46  }
47 
48  if (iCfgCandConnector.exists("dptRel_MergedTrack"))
49  dptRel_MergedTrack = iCfgCandConnector.getParameter<double>("dptRel_MergedTrack");
50  else {
51  edm::LogWarning("PFCandConnector") << "dptRel_MergedTrack doesn't exist. Setting a default safe value 0"
52  << std::endl;
53  dptRel_MergedTrack = 0;
54  }
55 
56  if (iCfgCandConnector.exists("ptErrorSecondary"))
57  ptErrorSecondary = iCfgCandConnector.getParameter<double>("ptErrorSecondary");
58  else {
59  edm::LogWarning("PFCandConnector") << "ptErrorSecondary doesn't exist. Setting a default safe value 0"
60  << std::endl;
61  ptErrorSecondary = 0;
62  }
63 
64  if (iCfgCandConnector.exists("nuclCalibFactors"))
65  nuclCalibFactors = iCfgCandConnector.getParameter<std::vector<double> >("nuclCalibFactors");
66  else {
67  edm::LogWarning("PFCandConnector") << "nuclear calib factors doesn't exist the factor would not be applyed"
68  << std::endl;
69  }
70 
71  setParameters(bCorrect, bCalibPrimary, dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary, nuclCalibFactors);
72  }
73 
74  void setParameters(bool bCorrect,
75  bool bCalibPrimary,
76  double dptRel_PrimaryTrack,
77  double dptRel_MergedTrack,
78  double ptErrorSecondary,
79  const std::vector<double>& nuclCalibFactors);
80 
82 
84 
85 private:
87  void analyseNuclearWPrim(reco::PFCandidateCollection&, std::vector<bool>&, unsigned int) const;
88 
90  void analyseNuclearWSec(reco::PFCandidateCollection&, std::vector<bool>&, unsigned int) const;
91 
92  bool isPrimaryNucl(const reco::PFCandidate& pf) const;
93 
94  bool isSecondaryNucl(const reco::PFCandidate& pf) const;
95 
97  double rescaleFactor(const double pt, const double cFrac) const;
98 
100  bool bCorrect_;
101 
104  std::vector<double> fConst_;
105  std::vector<double> fNorm_;
106  std::vector<double> fExp_;
107 
108  // Maximal accepatble uncertainty on primary tracks to usem them as MC truth for calibration
112 
114  static const double pion_mass2;
117 };
118 
119 #endif
T getParameter(std::string const &) const
bool isPrimaryNucl(const reco::PFCandidate &pf) const
bool isSecondaryNucl(const reco::PFCandidate &pf) const
void analyseNuclearWSec(reco::PFCandidateCollection &, std::vector< bool > &, unsigned int) const
Analyse nuclear interactions where a secondary track is present.
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_
static const reco::PFCandidate::Flags fT_TO_DISP_
std::vector< double > fExp_
Based on a class from : V. Roberfroid, February 2008.
std::vector< double > fNorm_
reco::PFCandidateCollection connect(reco::PFCandidateCollection &pfCand) const
void analyseNuclearWPrim(reco::PFCandidateCollection &, std::vector< bool > &, unsigned int) const
Analyse nuclear interactions where a primary or merged track is present.
static const double pion_mass2
Useful constants.
std::vector< double > fConst_
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
double dptRel_PrimaryTrack_
bool bCalibPrimary_
Calibration parameters for the reconstructed nuclear interactions.
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
bool bCorrect_
Parameters.
void setParameters(const edm::ParameterSet &iCfgCandConnector)
double dptRel_MergedTrack_