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
hitfit
Definition: Base_Constrainer.h:43
hitfit::Fourvec
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:55
hitfit::Vector_Resolution
Definition: Vector_Resolution.h:89
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
hitfit::EtaDepResolution
Hold on to -dependent resolution. This class acts as a function object and returns Vector_Resolution ...
Definition: EtaDepResolution.h:86
TkMap_script_phase1.CMSSW_BASE
CMSSW_BASE
Definition: TkMap_script_phase1.py:158
hitfit::LeptonTranslatorBase::LeptonTranslatorBase
LeptonTranslatorBase()
Default constructor.
reco::LeafCandidate::py
double py() const final
y coordinate of momentum vector
Definition: LeafCandidate.h:142
LeptonTranslatorBase.h
Template class of function object to translate lepton physics object to HitFit's Lepjets_Event_Lep ob...
compare_using_db.ifile
ifile
Definition: compare_using_db.py:251
L1TObjectsTimingClient_cff.resolution
resolution
Definition: L1TObjectsTimingClient_cff.py:52
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hitfit::LeptonTranslatorBase
Template class of function object to translate lepton physics object to HitFit's Lepjets_Event_Lep ob...
Definition: LeptonTranslatorBase.h:44
HPSPFTauProducerPuppi_cfi.electron
electron
Definition: HPSPFTauProducerPuppi_cfi.py:13
type
type
Definition: HCALResponse.h:21
hitfit::electron_label
Definition: Lepjets_Event_Lep.h:53
pat::Electron::superCluster
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
Electron.h
pat::Electron
Analysis-level electron class.
Definition: Electron.h:51
reco::LeafCandidate::px
double px() const final
x coordinate of momentum vector
Definition: LeafCandidate.h:140
reco::LeafCandidate::pz
double pz() const final
z coordinate of momentum vector
Definition: LeafCandidate.h:144
hitfit::Lepjets_Event_Lep
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information:
Definition: Lepjets_Event_Lep.h:64