CMS 3D CMS Logo

PatElectronHitFitTranslator.cc
Go to the documentation of this file.
1 //
2 //
3 
20 
21 namespace hitfit {
22 
23  template <>
25  [[clang::suppress]]
26  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
27  std::string resolution_filename =
28  CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
29  resolution_ = EtaDepResolution(resolution_filename);
30 
31  } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase()
32 
33  template <>
35  [[clang::suppress]]
36  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
37  std::string resolution_filename;
38 
39  if (ifile.empty()) {
40  resolution_filename =
41  CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
42  } else {
43  resolution_filename = ifile;
44  }
45 
46  resolution_ = EtaDepResolution(resolution_filename);
47 
48  } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase(const std::string& ifile)
49 
50  template <>
52 
53  template <>
55  int type /* = hitfit::lepton_label */,
56  bool useObjEmbRes /* = false */) {
57  Fourvec p(lepton.px(), lepton.py(), lepton.pz(), lepton.energy());
58 
59  double electron_eta = lepton.superCluster()->eta();
60  Vector_Resolution electron_resolution = resolution_.GetResolution(electron_eta);
61 
62  Lepjets_Event_Lep electron(p, electron_label, electron_resolution);
63  return electron;
64 
65  } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Electron>::operator()
66 
67  template <>
69  return resolution_;
70  }
71 
72  template <>
74  double electron_eta = lepton.superCluster()->eta();
75  return resolution_.CheckEta(electron_eta);
76  }
77 
78 } // 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: ...
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
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
Template class of function object to translate lepton physics object to HitFit&#39;s Lepjets_Event_Lep ob...
Analysis-level electron class.
Definition: Electron.h:51
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...
double energy() const final
energy