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 // $Id: PatElectronHitFitTranslator.cc,v 1.1 2011/05/26 09:47:00 mseidel Exp $
3 //
4 
22 
23 namespace hitfit {
24 
25 template<>
27 {
28 
29  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
30  std::string resolution_filename = CMSSW_BASE +
31  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
32  resolution_ = EtaDepResolution(resolution_filename);
33 
34 } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase()
35 
36 
37 template<>
39 {
40 
41  std::string CMSSW_BASE(getenv("CMSSW_BASE"));
42  std::string resolution_filename;
43 
44  if (ifile.empty()) {
45  resolution_filename = CMSSW_BASE +
46  std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt");
47  } else {
48  resolution_filename = ifile ;
49  }
50 
51  resolution_ = EtaDepResolution(resolution_filename);
52 
53 } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase(const std::string& ifile)
54 
55 
56 template<>
58 {
59 }
60 
61 
62 template<>
65  int type /* = hitfit::lepton_label */,
66  bool useObjEmbRes /* = false */)
67 {
68 
69  Fourvec p(lepton.px(),lepton.py(),lepton.pz(),lepton.energy());
70 
71  double electron_eta = lepton.superCluster()->eta();
72  Vector_Resolution electron_resolution = resolution_.GetResolution(electron_eta);
73 
76  electron_resolution);
77  return electron;
78 
79 } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Electron>::operator()
80 
81 
82 template<>
83 const EtaDepResolution&
85 {
86  return resolution_;
87 }
88 
89 
90 template<>
91 bool
93 {
94  double electron_eta = lepton.superCluster()->eta();
95  return resolution_.CheckEta(electron_eta);
96 }
97 
98 
99 } // namespace hitfit
type
Definition: HCALResponse.h:22
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:150
Hold on to -dependent resolution. This class acts as a function object and returns Vector_Resolution ...
virtual double energy() const
energy
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:58
virtual double px() const
x 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:52
virtual double pz() const
z coordinate of momentum vector
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...
virtual double py() const
y coordinate of momentum vector