CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PatMuonHitFitTranslator.cc
Go to the documentation of this file.
1 //
2 //
20 
21 namespace hitfit {
22 
23 
24 template<>
26 {
27 
28  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
29  std::string resolution_filename = CMSSW_BASE +
30  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
31  resolution_ = EtaDepResolution(resolution_filename);
32 
33 } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase()
34 
35 
36 template<>
38 {
39 
40  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
41  std::string resolution_filename;
42 
43  if (ifile.empty()) {
44  resolution_filename = CMSSW_BASE +
45  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
46  } else {
47  resolution_filename = ifile ;
48  }
49 
50  resolution_ = EtaDepResolution(resolution_filename);
51 
52 } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase(const std::string& s)
53 
54 
55 template<>
57 {
58 } // LeptonTranslatorBase<pat::Muon>::~LeptonTranslatorBase()
59 
60 
61 template<>
64  int type /*= hitfit::lepton_label */,
65  bool useObjEmbRes /* = false */)
66 {
67 
68  Fourvec p(lepton.px(),lepton.py(),lepton.pz(),lepton.energy());
69 
70  double muon_eta = lepton.eta();
71  Vector_Resolution muon_resolution = resolution_.GetResolution(muon_eta);
72 
74  muon_label,
75  muon_resolution);
76  return muon;
77 
78 } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Muon>::operator()
79 
80 
81 template<>
82 const EtaDepResolution&
84 {
85  return resolution_;
86 }
87 
88 
89 template<>
90 bool
92 {
93  return resolution_.CheckEta(lepton.eta());
94 }
95 
96 
97 } // namespace hitfit
type
Definition: HCALResponse.h:21
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: ...
virtual double energy() const final
energy
bool CheckEta(const ALepton &lepton) const
Check if a lepton has value which is within the valid range of the resolution.
Hold on to -dependent resolution. This class acts as a function object and returns Vector_Resolution ...
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:57
virtual double py() const final
y coordinate of momentum vector
virtual double pz() const final
z coordinate of momentum vector
Template class of function object to translate lepton physics object to HitFit&#39;s Lepjets_Event_Lep ob...
LeptonTranslatorBase()
Default constructor.
virtual double px() const final
x coordinate of momentum vector
virtual double eta() const final
momentum pseudorapidity
Calculate and represent resolution for a vector of , pseudorapidity , and azimuthal angle ...
Template class of function object to translate lepton physics object to HitFit&#39;s Lepjets_Event_Lep ob...
Analysis-level muon class.
Definition: Muon.h:49