CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PatElectronHitFitTranslator.cc
Go to the documentation of this file.
1  //
2 //
3 
21 
22 namespace hitfit {
23 
24 template<>
26 {
27 
28  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
29  std::string resolution_filename = CMSSW_BASE +
30  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
31  resolution_ = EtaDepResolution(resolution_filename);
32 
33 } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase()
34 
35 
36 template<>
38 {
39 
40  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
41  std::string resolution_filename;
42 
43  if (ifile.empty()) {
44  resolution_filename = CMSSW_BASE +
45  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
46  } else {
47  resolution_filename = ifile ;
48  }
49 
50  resolution_ = EtaDepResolution(resolution_filename);
51 
52 } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase(const std::string& ifile)
53 
54 
55 template<>
57 {
58 }
59 
60 
61 template<>
64  int type /* = hitfit::lepton_label */,
65  bool useObjEmbRes /* = false */)
66 {
67 
68  Fourvec p(lepton.px(),lepton.py(),lepton.pz(),lepton.energy());
69 
70  double electron_eta = lepton.superCluster()->eta();
71  Vector_Resolution electron_resolution = resolution_.GetResolution(electron_eta);
72 
75  electron_resolution);
76  return electron;
77 
78 } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Electron>::operator()
79 
80 
81 template<>
82 const EtaDepResolution&
84 {
85  return resolution_;
86 }
87 
88 
89 template<>
90 bool
92 {
93  double electron_eta = lepton.superCluster()->eta();
94  return resolution_.CheckEta(electron_eta);
95 }
96 
97 
98 } // namespace hitfit
type
Definition: HCALResponse.h:21
virtual double energy() const GCC11_FINAL
energy
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: ...
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
Definition: Electron.cc:149
virtual double pz() const GCC11_FINAL
z coordinate of momentum vector
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
Hold on to -dependent resolution. This class acts as a function object and returns Vector_Resolution ...
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:57
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:50
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...