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
MessageLogger.h
PFCandidate.h
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
PFCandConnector::analyseNuclearWSec
void analyseNuclearWSec(reco::PFCandidateCollection &, std::vector< bool > &, unsigned int) const
Analyse nuclear interactions where a secondary track is present.
Definition: PFCandConnector.cc:323
HLT_FULL_cff.nuclCalibFactors
nuclCalibFactors
Definition: HLT_FULL_cff.py:13646
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PFCandConnector::bCorrect_
bool bCorrect_
Parameters.
Definition: PFCandConnector.h:100
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
PFCandConnector::dptRel_PrimaryTrack_
double dptRel_PrimaryTrack_
Definition: PFCandConnector.h:109
PFCandConnector::isPrimaryNucl
bool isPrimaryNucl(const reco::PFCandidate &pf) const
Definition: PFCandConnector.cc:496
PFCandConnector::analyseNuclearWPrim
void analyseNuclearWPrim(reco::PFCandidateCollection &, std::vector< bool > &, unsigned int) const
Analyse nuclear interactions where a primary or merged track is present.
Definition: PFCandConnector.cc:148
PFCandConnector::fConst_
std::vector< double > fConst_
Definition: PFCandConnector.h:104
PFCandConnector::fExp_
std::vector< double > fExp_
Definition: PFCandConnector.h:106
ParameterSetDescription.h
PFCandConnector::dptRel_MergedTrack_
double dptRel_MergedTrack_
Definition: PFCandConnector.h:110
edm::ParameterSet
Definition: ParameterSet.h:47
PFCandConnector::setParameters
void setParameters(const edm::ParameterSet &iCfgCandConnector)
Definition: PFCandConnector.h:30
PFCandConnector::ptErrorSecondary_
double ptErrorSecondary_
Definition: PFCandConnector.h:111
PFCandConnector
Based on a class from : V. Roberfroid, February 2008.
Definition: PFCandConnector.h:15
HLT_FULL_cff.iCfgCandConnector
iCfgCandConnector
Definition: HLT_FULL_cff.py:13645
PFCandConnector::bCalibPrimary_
bool bCalibPrimary_
Calibration parameters for the reconstructed nuclear interactions.
Definition: PFCandConnector.h:103
packedPFCandidateRefMixer_cfi.pf
pf
Definition: packedPFCandidateRefMixer_cfi.py:4
reco::PFCandidateCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Definition: PFCandidateFwd.h:12
PFCandConnector::isSecondaryNucl
bool isSecondaryNucl(const reco::PFCandidate &pf) const
Definition: PFCandConnector.cc:481
PFCandConnector::fT_TO_DISP_
static const reco::PFCandidate::Flags fT_TO_DISP_
Definition: PFCandConnector.h:115
PFCandConnector::fNorm_
std::vector< double > fNorm_
Definition: PFCandConnector.h:105
PFCandConnector::fT_FROM_DISP_
static const reco::PFCandidate::Flags fT_FROM_DISP_
Definition: PFCandConnector.h:116
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
ParameterSet.h
PFCandConnector::connect
reco::PFCandidateCollection connect(reco::PFCandidateCollection &pfCand) const
Definition: PFCandConnector.cc:63
HLT_FULL_cff.bCorrect
bCorrect
Definition: HLT_FULL_cff.py:13647
PFCandConnector::rescaleFactor
double rescaleFactor(const double pt, const double cFrac) const
Return a calibration factor for a reconstructed nuclear interaction.
Definition: PFCandConnector.cc:513
PFCandConnector::PFCandConnector
PFCandConnector()
Definition: PFCandConnector.h:17
reco::PFCandidate::Flags
Flags
Definition: PFCandidate.h:55
PFCandidateFwd.h
PFCandConnector::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
Definition: PFCandConnector.cc:554
PFCandConnector::pion_mass2
static const double pion_mass2
Useful constants.
Definition: PFCandConnector.h:114
HLT_FULL_cff.bCalibPrimary
bCalibPrimary
Definition: HLT_FULL_cff.py:13648