CMS 3D CMS Logo

PatMuonHitFitTranslator.cc
Go to the documentation of this file.
1 //
2 //
19 
20 namespace hitfit {
21 
22  template <>
24  [[clang::suppress]]
25  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
26  std::string resolution_filename =
27  CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
28  resolution_ = EtaDepResolution(resolution_filename);
29 
30  } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase()
31 
32  template <>
34  [[clang::suppress]]
35  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
36  std::string resolution_filename;
37 
38  if (ifile.empty()) {
39  resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
40  } else {
41  resolution_filename = ifile;
42  }
43 
44  resolution_ = EtaDepResolution(resolution_filename);
45 
46  } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase(const std::string& s)
47 
48  template <>
50  } // LeptonTranslatorBase<pat::Muon>::~LeptonTranslatorBase()
51 
52  template <>
54  int type /*= hitfit::lepton_label */,
55  bool useObjEmbRes /* = false */) {
56  Fourvec p(lepton.px(), lepton.py(), lepton.pz(), lepton.energy());
57 
58  double muon_eta = lepton.eta();
59  Vector_Resolution muon_resolution = resolution_.GetResolution(muon_eta);
60 
61  Lepjets_Event_Lep muon(p, muon_label, muon_resolution);
62  return muon;
63 
64  } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Muon>::operator()
65 
66  template <>
68  return resolution_;
69  }
70 
71  template <>
73  return resolution_.CheckEta(lepton.eta());
74  }
75 
76 } // namespace hitfit
double pz() const final
z coordinate of momentum vector
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: ...
Hold on to -dependent resolution. This class acts as a function object and returns Vector_Resolution ...
double px() const final
x coordinate of momentum vector
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:55
double py() const final
y coordinate of momentum vector
bool CheckEta(const ALepton &lepton) const
Check if a lepton has value which is within the valid range of the resolution.
Template class of function object to translate lepton physics object to HitFit&#39;s Lepjets_Event_Lep ob...
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
double energy() const final
energy
double eta() const final
momentum pseudorapidity