CMS 3D CMS Logo

PatMuonHitFitTranslator.cc
Go to the documentation of this file.
1 //
2 //
19 
20 namespace hitfit {
21 
22  template <>
24  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
25  std::string resolution_filename =
26  CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
27  resolution_ = EtaDepResolution(resolution_filename);
28 
29  } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase()
30 
31  template <>
33  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
34  std::string resolution_filename;
35 
36  if (ifile.empty()) {
37  resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
38  } else {
39  resolution_filename = ifile;
40  }
41 
42  resolution_ = EtaDepResolution(resolution_filename);
43 
44  } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase(const std::string& s)
45 
46  template <>
48  } // LeptonTranslatorBase<pat::Muon>::~LeptonTranslatorBase()
49 
50  template <>
52  int type /*= hitfit::lepton_label */,
53  bool useObjEmbRes /* = false */) {
54  Fourvec p(lepton.px(), lepton.py(), lepton.pz(), lepton.energy());
55 
56  double muon_eta = lepton.eta();
57  Vector_Resolution muon_resolution = resolution_.GetResolution(muon_eta);
58 
59  Lepjets_Event_Lep muon(p, muon_label, muon_resolution);
60  return muon;
61 
62  } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Muon>::operator()
63 
64  template <>
66  return resolution_;
67  }
68 
69  template <>
71  return resolution_.CheckEta(lepton.eta());
72  }
73 
74 } // 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