CMS 3D CMS Logo

PatMuonHitFitTranslator.cc
Go to the documentation of this file.
1 //
2 //
19 
20 namespace hitfit {
21 
22  template <>
24  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
25  std::string resolution_filename =
26  CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
27  resolution_ = EtaDepResolution(resolution_filename);
28 
29  } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase()
30 
31  template <>
33  std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
34  std::string resolution_filename;
35 
36  if (ifile.empty()) {
37  resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt");
38  } else {
39  resolution_filename = ifile;
40  }
41 
42  resolution_ = EtaDepResolution(resolution_filename);
43 
44  } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase(const std::string& s)
45 
46  template <>
48  } // LeptonTranslatorBase<pat::Muon>::~LeptonTranslatorBase()
49 
50  template <>
52  int type /*= hitfit::lepton_label */,
53  bool useObjEmbRes /* = false */) {
54  Fourvec p(lepton.px(), lepton.py(), lepton.pz(), lepton.energy());
55 
56  double muon_eta = lepton.eta();
57  Vector_Resolution muon_resolution = resolution_.GetResolution(muon_eta);
58 
59  Lepjets_Event_Lep muon(p, muon_label, muon_resolution);
60  return muon;
61 
62  } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Muon>::operator()
63 
64  template <>
66  return resolution_;
67  }
68 
69  template <>
71  return resolution_.CheckEta(lepton.eta());
72  }
73 
74 } // 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
Muon.h
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.
pat::Muon
Analysis-level muon class.
Definition: Muon.h:51
reco::LeafCandidate::py
double py() const final
y coordinate of momentum vector
Definition: LeafCandidate.h:142
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11725
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_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
hitfit::LeptonTranslatorBase::CheckEta
bool CheckEta(const ALepton &lepton) const
Check if a lepton has value which is within the valid range of the resolution.
hitfit::LeptonTranslatorBase
Template class of function object to translate lepton physics object to HitFit's Lepjets_Event_Lep ob...
Definition: LeptonTranslatorBase.h:44
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hitfit::muon_label
Definition: Lepjets_Event_Lep.h:54
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
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