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 // $Id: PatMuonHitFitTranslator.cc,v 1.1 2011/05/26 09:47:00 mseidel Exp $
3 //
21 
22 namespace hitfit {
23 
24 
25 template<>
27 {
28 
29  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
30  std::string resolution_filename = CMSSW_BASE +
31  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
32  resolution_ = EtaDepResolution(resolution_filename);
33 
34 } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase()
35 
36 
37 template<>
39 {
40 
41  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
42  std::string resolution_filename;
43 
44  if (ifile.empty()) {
45  resolution_filename = CMSSW_BASE +
46  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
47  } else {
48  resolution_filename = ifile ;
49  }
50 
51  resolution_ = EtaDepResolution(resolution_filename);
52 
53 } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase(const std::string& s)
54 
55 
56 template<>
58 {
59 } // LeptonTranslatorBase<pat::Muon>::~LeptonTranslatorBase()
60 
61 
62 template<>
65  int type /*= hitfit::lepton_label */,
66  bool useObjEmbRes /* = false */)
67 {
68 
69  Fourvec p(lepton.px(),lepton.py(),lepton.pz(),lepton.energy());
70 
71  double muon_eta = lepton.eta();
72  Vector_Resolution muon_resolution = resolution_.GetResolution(muon_eta);
73 
75  muon_label,
76  muon_resolution);
77  return muon;
78 
79 } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Muon>::operator()
80 
81 
82 template<>
83 const EtaDepResolution&
85 {
86  return resolution_;
87 }
88 
89 
90 template<>
91 bool
93 {
94  return resolution_.CheckEta(lepton.eta());
95 }
96 
97 
98 } // namespace hitfit
type
Definition: HCALResponse.h:22
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: ...
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 ...
virtual double eta() const
momentum pseudorapidity
virtual double energy() const
energy
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:58
virtual double px() const
x coordinate of momentum vector
Template class of function object to translate lepton physics object to HitFit&#39;s Lepjets_Event_Lep ob...
virtual double pz() const
z coordinate of momentum vector
LeptonTranslatorBase()
Default constructor.
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:51
virtual double py() const
y coordinate of momentum vector