CMS 3D CMS Logo

PatElectronHitFitTranslator.cc
Go to the documentation of this file.
1 //
2 //
3 
20 
21 namespace hitfit {
22 
23  template <>
25  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
26  std::string resolution_filename =
27  CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
28  resolution_ = EtaDepResolution(resolution_filename);
29 
30  } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase()
31 
32  template <>
34  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
35  std::string resolution_filename;
36 
37  if (ifile.empty()) {
38  resolution_filename =
39  CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
40  } else {
41  resolution_filename = ifile;
42  }
43 
44  resolution_ = EtaDepResolution(resolution_filename);
45 
46  } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase(const std::string& ifile)
47 
48  template <>
50 
51  template <>
53  int type /* = hitfit::lepton_label */,
54  bool useObjEmbRes /* = false */) {
55  Fourvec p(lepton.px(), lepton.py(), lepton.pz(), lepton.energy());
56 
57  double electron_eta = lepton.superCluster()->eta();
58  Vector_Resolution electron_resolution = resolution_.GetResolution(electron_eta);
59 
60  Lepjets_Event_Lep electron(p, electron_label, electron_resolution);
61  return electron;
62 
63  } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Electron>::operator()
64 
65  template <>
67  return resolution_;
68  }
69 
70  template <>
72  double electron_eta = lepton.superCluster()->eta();
73  return resolution_.CheckEta(electron_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: ...
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