Template class of function object to translate lepton physics object to HitFit's Lepjets_Event_Lep object. Users need to write an implementation of a template specialization of this class for their lepton physics object class. Then users combine this header file and their implementation for their analysis code. With this approach, it is possible to use HitFit for different lepton physics object class in different experiments. More...
#include <LeptonTranslatorBase.h>
Public Member Functions | |
bool | CheckEta (const ALepton &lepton) const |
Check if a lepton has value which is within the valid range of the resolution. | |
template<> | |
bool | CheckEta (const pat::Electron &lepton) const |
template<> | |
bool | CheckEta (const CLHEP::HepLorentzVector &lepton) const |
template<> | |
bool | CheckEta (const pat::Muon &lepton) const |
LeptonTranslatorBase (const std::string &ifile) | |
Constructor, instantiate a LeptonTranslatorBase object using the name of and input file in std::string format. | |
template<> | |
LeptonTranslatorBase (const std::string &ifile) | |
template<> | |
LeptonTranslatorBase () | |
template<> | |
LeptonTranslatorBase (const std::string &ifile) | |
LeptonTranslatorBase () | |
Default constructor. | |
template<> | |
LeptonTranslatorBase () | |
template<> | |
LeptonTranslatorBase () | |
template<> | |
LeptonTranslatorBase (const std::string &ifile) | |
Lepjets_Event_Lep | operator() (const ALepton &lepton, int type=hitfit::lepton_label, bool useObjEmbRes=false) |
Convert a lepton physics object of type ALepton into HitFit lepton physics object of type Lepjets_Event_Lep. | |
template<> | |
Lepjets_Event_Lep | operator() (const pat::Electron &lepton, int type, bool useObjEmbRes) |
template<> | |
Lepjets_Event_Lep | operator() (const CLHEP::HepLorentzVector &lepton, int type, bool useObjEmbRes) |
template<> | |
Lepjets_Event_Lep | operator() (const pat::Muon &lepton, int type, bool useObjEmbRes) |
template<> | |
const EtaDepResolution & | resolution () const |
const EtaDepResolution & | resolution () const |
Return the dependent resolution of the lepton. | |
template<> | |
const EtaDepResolution & | resolution () const |
template<> | |
const EtaDepResolution & | resolution () const |
template<> | |
~LeptonTranslatorBase () | |
template<> | |
~LeptonTranslatorBase () | |
template<> | |
~LeptonTranslatorBase () | |
~LeptonTranslatorBase () | |
Destructor. | |
Private Attributes | |
EtaDepResolution | resolution_ |
The dependent resolution. |
Template class of function object to translate lepton physics object to HitFit's Lepjets_Event_Lep object. Users need to write an implementation of a template specialization of this class for their lepton physics object class. Then users combine this header file and their implementation for their analysis code. With this approach, it is possible to use HitFit for different lepton physics object class in different experiments.
ALepton | The typename of the lepton physics object class to be translated into HitFit's Lepjets_Event_Lep. |
Definition at line 46 of file LeptonTranslatorBase.h.
hitfit::LeptonTranslatorBase< ALepton >::LeptonTranslatorBase | ( | ) |
Default constructor.
hitfit::LeptonTranslatorBase< ALepton >::LeptonTranslatorBase | ( | const std::string & | ifile | ) |
Constructor, instantiate a LeptonTranslatorBase object using the name of and input file in std::string format.
ifile | The path of the input file. |
hitfit::LeptonTranslatorBase< ALepton >::~LeptonTranslatorBase | ( | ) |
Destructor.
hitfit::LeptonTranslatorBase< CLHEP::HepLorentzVector >::LeptonTranslatorBase | ( | ) |
Definition at line 31 of file CLHEPHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/TopHitFit/data/exampleElectronResolution.txt"); resolution_ = EtaDepResolution(resolution_filename); } // LeptonTranslatorBase<CLHEP::HepLorentzVector>::LeptonTranslatorBase()
hitfit::LeptonTranslatorBase< CLHEP::HepLorentzVector >::LeptonTranslatorBase | ( | const std::string & | ifile | ) |
Definition at line 43 of file CLHEPHitFitTranslator.cc.
References compare_using_db::ifile, and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string resolution_filename; if (ifile.empty()) { resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/TopHitFit/data/exampleElectronResolution.txt"); } else { resolution_filename = ifile ; } resolution_ = EtaDepResolution(resolution_filename); } // LeptonTranslatorBase<CLHEP::HepLorentzVector>::LeptonTranslatorBase(const std::string& ifile)
hitfit::LeptonTranslatorBase< CLHEP::HepLorentzVector >::~LeptonTranslatorBase | ( | ) |
Definition at line 62 of file CLHEPHitFitTranslator.cc.
{ }
hitfit::LeptonTranslatorBase< pat::Electron >::LeptonTranslatorBase | ( | ) |
Definition at line 26 of file PatElectronHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt"); resolution_ = EtaDepResolution(resolution_filename); } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase()
hitfit::LeptonTranslatorBase< pat::Electron >::LeptonTranslatorBase | ( | const std::string & | ifile | ) |
Definition at line 38 of file PatElectronHitFitTranslator.cc.
References compare_using_db::ifile, and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string resolution_filename; if (ifile.empty()) { resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleElectronResolution.txt"); } else { resolution_filename = ifile ; } resolution_ = EtaDepResolution(resolution_filename); } // LeptonTranslatorBase<pat::Electron>::LeptonTranslatorBase(const std::string& ifile)
hitfit::LeptonTranslatorBase< pat::Electron >::~LeptonTranslatorBase | ( | ) |
Definition at line 57 of file PatElectronHitFitTranslator.cc.
{ }
hitfit::LeptonTranslatorBase< pat::Muon >::LeptonTranslatorBase | ( | ) |
Definition at line 26 of file PatMuonHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt"); resolution_ = EtaDepResolution(resolution_filename); } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase()
hitfit::LeptonTranslatorBase< pat::Muon >::LeptonTranslatorBase | ( | const std::string & | ifile | ) |
Definition at line 38 of file PatMuonHitFitTranslator.cc.
References compare_using_db::ifile, and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string resolution_filename; if (ifile.empty()) { resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleMuonResolution.txt"); } else { resolution_filename = ifile ; } resolution_ = EtaDepResolution(resolution_filename); } // LeptonTranslatorBase<pat::Muon>::LeptonTranslatorBase(const std::string& s)
hitfit::LeptonTranslatorBase< pat::Muon >::~LeptonTranslatorBase | ( | ) |
Definition at line 57 of file PatMuonHitFitTranslator.cc.
{
} // LeptonTranslatorBase<pat::Muon>::~LeptonTranslatorBase()
bool hitfit::LeptonTranslatorBase< ALepton >::CheckEta | ( | const ALepton & | lepton | ) | const |
Check if a lepton has value which is within the valid range of the resolution.
lepton | The lepton whose value is to be checked. |
Referenced by hitfit::LeptonTranslatorBase< ALepton >::CheckEta().
bool hitfit::LeptonTranslatorBase< pat::Electron >::CheckEta | ( | const pat::Electron & | lepton | ) | const |
Definition at line 92 of file PatElectronHitFitTranslator.cc.
References pat::Electron::superCluster().
{ double electron_eta = lepton.superCluster()->eta(); return resolution_.CheckEta(electron_eta); }
bool hitfit::LeptonTranslatorBase< CLHEP::HepLorentzVector >::CheckEta | ( | const CLHEP::HepLorentzVector & | lepton | ) | const |
Definition at line 96 of file CLHEPHitFitTranslator.cc.
{ return resolution_.CheckEta(lepton.eta()); }
bool hitfit::LeptonTranslatorBase< pat::Muon >::CheckEta | ( | const pat::Muon & | lepton | ) | const |
Definition at line 92 of file PatMuonHitFitTranslator.cc.
References hitfit::LeptonTranslatorBase< ALepton >::CheckEta(), and reco::LeafCandidate::eta().
{ return resolution_.CheckEta(lepton.eta()); }
Lepjets_Event_Lep hitfit::LeptonTranslatorBase< ALepton >::operator() | ( | const ALepton & | lepton, |
int | type = hitfit::lepton_label , |
||
bool | useObjEmbRes = false |
||
) |
Convert a lepton physics object of type ALepton into HitFit lepton physics object of type Lepjets_Event_Lep.
lepton | The lepton physics object to be translated. |
type | The typecode of the lepton to be translated. |
useObjEmbRes | Boolean parameter to indicate if the user would like to use the resolution embedded in the object, and not the resolution read when instantiating the class. |
Lepjets_Event_Lep hitfit::LeptonTranslatorBase< CLHEP::HepLorentzVector >::operator() | ( | const CLHEP::HepLorentzVector & | lepton, |
int | type, | ||
bool | useObjEmbRes | ||
) |
Definition at line 69 of file CLHEPHitFitTranslator.cc.
References AlCaHLTBitMon_ParallelJobs::p.
{ Fourvec p(lepton.px(),lepton.py(),lepton.pz(),lepton.e()); double lepton_eta(lepton.eta()); Vector_Resolution lepton_resolution = resolution_.GetResolution(lepton_eta); Lepjets_Event_Lep retlep(p, type, lepton_resolution); return retlep; } // Lepjets_Event_Lep LeptonTranslatorBase<CLHEP::HepLorentzVector>::operator()(const CLHEP::HepLorentzVector& lepton)
Plane * RodPlaneBuilderFromDet::operator() | ( | const pat::Muon & | lepton, |
int | type, | ||
bool | useObjEmbRes | ||
) |
Definition at line 64 of file PatMuonHitFitTranslator.cc.
References reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), metsig::muon, hitfit::muon_label, AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::LeafCandidate::pz().
{ Fourvec p(lepton.px(),lepton.py(),lepton.pz(),lepton.energy()); double muon_eta = lepton.eta(); Vector_Resolution muon_resolution = resolution_.GetResolution(muon_eta); Lepjets_Event_Lep muon(p, muon_label, muon_resolution); return muon; } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Muon>::operator()
Lepjets_Event_Lep hitfit::LeptonTranslatorBase< pat::Electron >::operator() | ( | const pat::Electron & | lepton, |
int | type, | ||
bool | useObjEmbRes | ||
) |
Definition at line 64 of file PatElectronHitFitTranslator.cc.
References metsig::electron, hitfit::electron_label, reco::LeafCandidate::energy(), AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), and pat::Electron::superCluster().
{ Fourvec p(lepton.px(),lepton.py(),lepton.pz(),lepton.energy()); double electron_eta = lepton.superCluster()->eta(); Vector_Resolution electron_resolution = resolution_.GetResolution(electron_eta); Lepjets_Event_Lep electron(p, electron_label, electron_resolution); return electron; } // Lepjets_Event_Lep LeptonTranslatorBase<pat::Electron>::operator()
const EtaDepResolution & hitfit::LeptonTranslatorBase< pat::Electron >::resolution | ( | ) | const |
Definition at line 84 of file PatElectronHitFitTranslator.cc.
{ return resolution_; }
const EtaDepResolution& hitfit::LeptonTranslatorBase< ALepton >::resolution | ( | ) | const |
Return the dependent resolution of the lepton.
const EtaDepResolution & hitfit::LeptonTranslatorBase< pat::Muon >::resolution | ( | ) | const |
Definition at line 84 of file PatMuonHitFitTranslator.cc.
{ return resolution_; }
const EtaDepResolution & hitfit::LeptonTranslatorBase< CLHEP::HepLorentzVector >::resolution | ( | ) | const |
Definition at line 88 of file CLHEPHitFitTranslator.cc.
{ return resolution_; }
EtaDepResolution hitfit::LeptonTranslatorBase< ALepton >::resolution_ [private] |
The dependent resolution.
Definition at line 104 of file LeptonTranslatorBase.h.