Template class of function object to translate jet physics object to HitFit's Lepjets_Event_Jet object. Users need to write an implementation of a template specialization of this class for their jet 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 jet physics object class in different experiments. More...
#include <JetTranslatorBase.h>
Public Member Functions | |
const EtaDepResolution & | bResolution () const |
Return the dependent resolution for jets. | |
template<> | |
const EtaDepResolution & | bResolution () const |
template<> | |
const EtaDepResolution & | bResolution () const |
bool | CheckEta (const AJet &jet) const |
Check if a jet has value which is within the valid range of the resolution. | |
template<> | |
bool | CheckEta (const pat::Jet &jet) const |
template<> | |
bool | CheckEta (const CLHEP::HepLorentzVector &jet) const |
template<> | |
JetTranslatorBase (const std::string &udscFile, const std::string &bFile, const std::string &jetCorrectionLevel, double jes, double jesB) | |
JetTranslatorBase (const std::string &udscFile, const std::string &bFile) | |
Constructor, instantiate a JetTranslatorBase object using the names of input files in std::string format. | |
template<> | |
JetTranslatorBase () | |
template<> | |
JetTranslatorBase (const std::string &udscFile, const std::string &bFile) | |
template<> | |
JetTranslatorBase () | |
template<> | |
JetTranslatorBase (const std::string &udscFile, const std::string &bFile) | |
JetTranslatorBase (const std::string &udscFile, const std::string &bFile, const std::string &jetCorrectionLevel, double jes, double jesB) | |
Constructor, instantiate a JetTranslatorBase object using the names of input files in std::string format. | |
JetTranslatorBase () | |
Default constructor. | |
template<> | |
Lepjets_Event_Jet | operator() (const pat::Jet &jet, int type, bool useObjEmbRes) |
Lepjets_Event_Jet | operator() (const AJet &jet, int type=hitfit::unknown_label, bool useObjEmbRes=false) |
Convert a jet physics object of type AJet into HitFit jet physics object of type Lepjets_Event_Jet. This operator must be able to apply the appropriate jet energy correction in accord with the type of the jet. | |
template<> | |
Lepjets_Event_Jet | operator() (const CLHEP::HepLorentzVector &jet, int type, bool useObjEmbRes) |
const EtaDepResolution & | udscResolution () const |
Return the dependent resolution for jets. | |
template<> | |
const EtaDepResolution & | udscResolution () const |
template<> | |
const EtaDepResolution & | udscResolution () const |
~JetTranslatorBase () | |
Destructor. | |
template<> | |
~JetTranslatorBase () | |
template<> | |
~JetTranslatorBase () | |
Private Attributes | |
EtaDepResolution | bResolution_ |
The dependent resolution for $b$ jets. | |
double | jes_ |
The jet energy scale. | |
double | jesB_ |
The b-jet energy scale. | |
std::string | jetCorrectionLevel_ |
The jet correction level. | |
EtaDepResolution | udscResolution_ |
The dependent resolution for $udsc$ jets. |
Template class of function object to translate jet physics object to HitFit's Lepjets_Event_Jet object. Users need to write an implementation of a template specialization of this class for their jet 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 jet physics object class in different experiments.
AJet | The typename of the jet physics object class to be translated into HitFit's Lepjets_Event_Jet. |
Definition at line 46 of file JetTranslatorBase.h.
hitfit::JetTranslatorBase< AJet >::JetTranslatorBase | ( | ) |
Default constructor.
hitfit::JetTranslatorBase< AJet >::JetTranslatorBase | ( | const std::string & | udscFile, |
const std::string & | bFile | ||
) |
Constructor, instantiate a JetTranslatorBase object using the names of input files in std::string format.
udscFile | The path of the input file containing resolution for jets. |
bFile | The path of the input file containing resolution for jets. |
hitfit::JetTranslatorBase< AJet >::JetTranslatorBase | ( | const std::string & | udscFile, |
const std::string & | bFile, | ||
const std::string & | jetCorrectionLevel, | ||
double | jes, | ||
double | jesB | ||
) |
Constructor, instantiate a JetTranslatorBase object using the names of input files in std::string format.
udscFile | The path of the input file containing resolution for jets. |
bFile | The path of the input file containing resolution for jets. |
jetCorrectionLevel | The jet correction level. |
jes | The jet energy scale. |
jesB | The b-jet energy scale. |
hitfit::JetTranslatorBase< AJet >::~JetTranslatorBase | ( | ) |
Destructor.
hitfit::JetTranslatorBase< CLHEP::HepLorentzVector >::JetTranslatorBase | ( | ) |
Definition at line 103 of file CLHEPHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string udsc_resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/TopHitFit/data/exampleJetResolution.txt"); std::string b_resolution_filename = udsc_resolution_filename; udscResolution_ = EtaDepResolution(udsc_resolution_filename); bResolution_ = EtaDepResolution(b_resolution_filename); } // JetTranslatorBase<CLHEP::HepLorentzVector>::JetTranslatorBase()
hitfit::JetTranslatorBase< CLHEP::HepLorentzVector >::JetTranslatorBase | ( | const std::string & | udscFile, |
const std::string & | bFile | ||
) |
Definition at line 118 of file CLHEPHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string udsc_resolution_filename; std::string b_resolution_filename; if (udscFile.empty()) { udsc_resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/TopHitFit/data/exampleJetResolution.txt"); } else { udsc_resolution_filename = udscFile; } if (bFile.empty()) { b_resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/TopHitFit/data/exampleJetResolution.txt"); } else { b_resolution_filename = bFile; } udscResolution_ = EtaDepResolution(udsc_resolution_filename); bResolution_ = EtaDepResolution(b_resolution_filename); } // JetTranslatorBase<CLHEP::HepLorentzVector>::JetTranslatorBase(const std::string& udscFile,const std::string& bFile)
hitfit::JetTranslatorBase< CLHEP::HepLorentzVector >::~JetTranslatorBase | ( | ) |
Definition at line 147 of file CLHEPHitFitTranslator.cc.
{
} // JetTranslatorBase<CLHEP::HepLorentzVector>::~JetTranslatorBase()
hitfit::JetTranslatorBase< pat::Jet >::JetTranslatorBase | ( | ) |
Definition at line 23 of file PatJetHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string resolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleJetResolution.txt"); udscResolution_ = EtaDepResolution(resolution_filename); bResolution_ = EtaDepResolution(resolution_filename); jetCorrectionLevel_ = "L7Parton"; jes_ = 1.0; jesB_ = 1.0; } // JetTranslatorBase<pat::Jet>::JetTranslatorBase()
hitfit::JetTranslatorBase< pat::Jet >::JetTranslatorBase | ( | const std::string & | udscFile, |
const std::string & | bFile | ||
) |
Definition at line 39 of file PatJetHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string udscResolution_filename; std::string bResolution_filename; if (udscFile.empty()) { udscResolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleJetResolution.txt"); } else { udscResolution_filename = udscFile; } if (bFile.empty()) { bResolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/PatHitFit/data/exampleJetResolution.txt"); } else { bResolution_filename = bFile; } udscResolution_ = EtaDepResolution(udscResolution_filename); bResolution_ = EtaDepResolution(bResolution_filename); jetCorrectionLevel_ = "L7Parton"; jes_ = 1.0; jesB_ = 1.0; } // JetTranslatorBase<pat::Jet>::JetTranslatorBase(const std::string& ifile)
hitfit::JetTranslatorBase< pat::Jet >::JetTranslatorBase | ( | const std::string & | udscFile, |
const std::string & | bFile, | ||
const std::string & | jetCorrectionLevel, | ||
double | jes, | ||
double | jesB | ||
) |
Definition at line 71 of file PatJetHitFitTranslator.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string CMSSW_BASE(getenv("CMSSW_BASE")); std::string udscResolution_filename; std::string bResolution_filename; if (udscFile.empty()) { udscResolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/TopHitFit/data/resolution/tqafUdscJetResolution.txt"); } else { udscResolution_filename = udscFile; } if (bFile.empty()) { bResolution_filename = CMSSW_BASE + std::string("/src/TopQuarkAnalysis/TopHitFit/data/resolution/tqafBJetResolution.txt"); } else { bResolution_filename = bFile; } udscResolution_ = EtaDepResolution(udscResolution_filename); bResolution_ = EtaDepResolution(bResolution_filename); jetCorrectionLevel_ = jetCorrectionLevel; jes_ = jes; jesB_ = jesB; } // JetTranslatorBase<pat::Jet>::JetTranslatorBase(const std::string& ifile)
hitfit::JetTranslatorBase< pat::Jet >::~JetTranslatorBase | ( | ) |
Definition at line 106 of file PatJetHitFitTranslator.cc.
{
} // JetTranslatorBase<pat::Jet>::~JetTranslatorBase()
const EtaDepResolution& hitfit::JetTranslatorBase< AJet >::bResolution | ( | ) | const |
Return the dependent resolution for jets.
const EtaDepResolution & hitfit::JetTranslatorBase< pat::Jet >::bResolution | ( | ) | const |
Definition at line 164 of file PatJetHitFitTranslator.cc.
{ return bResolution_; }
const EtaDepResolution & hitfit::JetTranslatorBase< CLHEP::HepLorentzVector >::bResolution | ( | ) | const |
Definition at line 188 of file CLHEPHitFitTranslator.cc.
{ return bResolution_; }
bool hitfit::JetTranslatorBase< CLHEP::HepLorentzVector >::CheckEta | ( | const CLHEP::HepLorentzVector & | jet | ) | const |
Definition at line 196 of file CLHEPHitFitTranslator.cc.
{ return udscResolution_.CheckEta(jet.eta()) && bResolution_.CheckEta(jet.eta()); }
bool hitfit::JetTranslatorBase< AJet >::CheckEta | ( | const AJet & | jet | ) | const |
Check if a jet has value which is within the valid range of the resolution.
jet | The jet whose value is to be checked. |
bool hitfit::JetTranslatorBase< pat::Jet >::CheckEta | ( | const pat::Jet & | jet | ) | const |
Definition at line 172 of file PatJetHitFitTranslator.cc.
References reco::LeafCandidate::eta(), pat::Jet::isCaloJet(), pat::Jet::isPFJet(), and pat::PATObject< ObjectType >::originalObject().
{ double jet_eta = jet.eta(); if (jet.isCaloJet()) { jet_eta = ((reco::CaloJet*) jet.originalObject())->detectorP4().eta(); } if (jet.isPFJet()) { // do nothing at the moment! } return bResolution_.CheckEta(jet_eta) && udscResolution_.CheckEta(jet_eta); }
Lepjets_Event_Jet hitfit::JetTranslatorBase< AJet >::operator() | ( | const AJet & | jet, |
int | type = hitfit::unknown_label , |
||
bool | useObjEmbRes = false |
||
) |
Convert a jet physics object of type AJet into HitFit jet physics object of type Lepjets_Event_Jet. This operator must be able to apply the appropriate jet energy correction in accord with the type of the jet.
jet | The jet physics object to be translated. |
type | The typecode of the jet to be translated (leptonic b, hadronic b, or hadronic W). |
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_Jet hitfit::JetTranslatorBase< pat::Jet >::operator() | ( | const pat::Jet & | jet, |
int | type, | ||
bool | useObjEmbRes | ||
) |
Definition at line 113 of file PatJetHitFitTranslator.cc.
References pat::Jet::correctedJet(), reco::LeafCandidate::eta(), hitfit::hadb_label, hitfit::higgs_label, pat::Jet::isCaloJet(), pat::Jet::isPFJet(), hitfit::lepb_label, pat::PATObject< ObjectType >::originalObject(), AlCaHLTBitMon_ParallelJobs::p, and reco::Jet::scaleEnergy().
{ Fourvec p; double jet_eta = jet.eta(); if (jet.isCaloJet()) { jet_eta = ((reco::CaloJet*) jet.originalObject())->detectorP4().eta(); } if (jet.isPFJet()) { // do nothing at the moment! } Vector_Resolution jet_resolution; if (type == hitfit::hadb_label || type == hitfit::lepb_label || type == hitfit::higgs_label) { jet_resolution = bResolution_.GetResolution(jet_eta); pat::Jet bPartonCorrJet(jet.correctedJet(jetCorrectionLevel_,"BOTTOM")); bPartonCorrJet.scaleEnergy(jesB_); p = Fourvec(bPartonCorrJet.px(),bPartonCorrJet.py(),bPartonCorrJet.pz(),bPartonCorrJet.energy()); } else { jet_resolution = udscResolution_.GetResolution(jet_eta); pat::Jet udsPartonCorrJet(jet.correctedJet(jetCorrectionLevel_,"UDS")); udsPartonCorrJet.scaleEnergy(jes_); p = Fourvec(udsPartonCorrJet.px(),udsPartonCorrJet.py(),udsPartonCorrJet.pz(),udsPartonCorrJet.energy()); } Lepjets_Event_Jet retjet(p, type, jet_resolution); return retjet; } // Lepjets_Event_Jet JetTranslatorBase<pat::Jet>::operator()(const pat::Jet& j,int type)
Lepjets_Event_Jet hitfit::JetTranslatorBase< CLHEP::HepLorentzVector >::operator() | ( | const CLHEP::HepLorentzVector & | jet, |
int | type, | ||
bool | useObjEmbRes | ||
) |
Definition at line 154 of file CLHEPHitFitTranslator.cc.
References hitfit::hadb_label, hitfit::higgs_label, hitfit::lepb_label, and AlCaHLTBitMon_ParallelJobs::p.
{ Fourvec p(jet.px(),jet.py(),jet.pz(),jet.e()); double jet_eta = jet.eta(); Vector_Resolution jet_resolution; if (type == hitfit::lepb_label||type == hitfit::hadb_label||type== hitfit::higgs_label) { jet_resolution = bResolution_.GetResolution(jet_eta); } else { jet_resolution = udscResolution_.GetResolution(jet_eta); } Lepjets_Event_Jet retjet(p, type, jet_resolution); return retjet; } // Lepjets_Event_Jet JetTranslatorBase<CLHEP::HepLorentzVector>::operator()(const CLHEP::HepLorentzVector& j,int type)
const EtaDepResolution & hitfit::JetTranslatorBase< CLHEP::HepLorentzVector >::udscResolution | ( | ) | const |
Definition at line 180 of file CLHEPHitFitTranslator.cc.
{ return udscResolution_; }
const EtaDepResolution & hitfit::JetTranslatorBase< pat::Jet >::udscResolution | ( | ) | const |
Definition at line 156 of file PatJetHitFitTranslator.cc.
{ return udscResolution_; }
const EtaDepResolution& hitfit::JetTranslatorBase< AJet >::udscResolution | ( | ) | const |
Return the dependent resolution for jets.
EtaDepResolution hitfit::JetTranslatorBase< AJet >::bResolution_ [private] |
The dependent resolution for $b$ jets.
Definition at line 147 of file JetTranslatorBase.h.
double hitfit::JetTranslatorBase< AJet >::jes_ [private] |
The jet energy scale.
Definition at line 157 of file JetTranslatorBase.h.
double hitfit::JetTranslatorBase< AJet >::jesB_ [private] |
The b-jet energy scale.
Definition at line 162 of file JetTranslatorBase.h.
std::string hitfit::JetTranslatorBase< AJet >::jetCorrectionLevel_ [private] |
The jet correction level.
Definition at line 152 of file JetTranslatorBase.h.
EtaDepResolution hitfit::JetTranslatorBase< AJet >::udscResolution_ [private] |
The dependent resolution for $udsc$ jets.
Definition at line 142 of file JetTranslatorBase.h.