![]() |
![]() |
Class for the storage of jet correction factors. More...
#include "DataFormats/PatCandidates/interface/JetCorrFactors.h"
Public Types | |
typedef std::pair< std::string, std::vector< float > > | CorrectionFactor |
enum | Flavor { GLUON, UDS, CHARM, BOTTOM, NONE } |
Public Member Functions | |
float | correction (unsigned int level, Flavor flavor=NONE) const |
std::string | correctionLabel (unsigned int level) const |
std::vector< std::string > | correctionLabels () const |
std::string | correctionLabelString () const |
bool | flavorDependent (unsigned int level) const |
void | insertFactor (const unsigned int &position, const CorrectionFactor &factor) |
std::string | jecFlavor (const Flavor &flavor) const |
Flavor | jecFlavor (std::string flavor) const |
std::string | jecLevel (const unsigned int &level) const |
int | jecLevel (const std::string &level) const |
std::string | jecSet () const |
JetCorrFactors () | |
JetCorrFactors (const std::string &label, const std::vector< CorrectionFactor > &jec) | |
unsigned int | numberOfCorrectionLevels () const |
void | print () const |
Static Public Attributes | |
static const unsigned int | MAX_FLAVORS = 4 |
Private Member Functions | |
bool | flavorDependent (const CorrectionFactor &jec) const |
bool | flavorIndependent (const CorrectionFactor &jec) const |
void | invalidFactor () const |
bool | isValid (const CorrectionFactor &jec) const |
Private Attributes | |
std::vector< CorrectionFactor > | jec_ |
std::string | label_ |
Class for the storage of jet correction factors.
Class for the storage of jet correction factors that have been calculated during pat tuple production. The class is created to deal with a flexible number and order of the JES correction factors, which are expected to be nested. I.e. each correction level implies that all previous correction have been applied in advance. This scheme corresponds to the jet energy correction scheme propagated by the JetMET PAG. In dividual levels of JEC are safed as CorrectionFactor, which is a
std::pair<std::string, std::vector<float> >.
The std::string contains a human readable label indicating the corection level, the std::vector<float> contains the JEC factors, which are expected to have a length of 1 or 5. In this scheme the vector of length 1 is reserved for flavor independent CorrectionFactors, while the vector of length 5 corresponds to flavor dependent CorrectionFactors. The individual positions within the vector are expected to be distributed according to the Flavor enumerator of the class as:
GLUON, UDS, CHARM, BOTTOM, NONE
The structure is checked in the constructor of the class. The function correction returns potentially flavor dependent correction factor of the JES relative to an uncorrected jet. To move from one correction level to another correction level the initial correction level of the jet need to be uncorrected before applying the final correction factor. The class is expected to be used from within the pat::Jet only, this is taken care of automatically.
Definition at line 37 of file JetCorrFactors.h.
typedef std::pair<std::string, std::vector<float> > pat::JetCorrFactors::CorrectionFactor |
Definition at line 45 of file JetCorrFactors.h.
Enumerator | |
---|---|
GLUON | |
UDS | |
CHARM | |
BOTTOM | |
NONE |
Definition at line 47 of file JetCorrFactors.h.
|
inline |
Definition at line 53 of file JetCorrFactors.h.
References insertFactor(), patTestJEC_cfi::jec, label, position, and AlCaHLTBitMon_QueryRunRegistry::string.
JetCorrFactors::JetCorrFactors | ( | const std::string & | label, |
const std::vector< CorrectionFactor > & | jec | ||
) |
Definition at line 14 of file JetCorrFactors.cc.
References invalidFactor(), and isValid().
Definition at line 59 of file JetCorrFactors.cc.
References correctionLabelString(), Exception, flavorDependent(), jec_, NONE, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by jecLevel(), and print().
|
inline |
Definition at line 77 of file JetCorrFactors.h.
References jec_, and AlCaHLTBitMon_QueryRunRegistry::string.
std::vector< std::string > JetCorrFactors::correctionLabels | ( | ) | const |
Definition at line 87 of file JetCorrFactors.cc.
References jec_, and tablePrinter::labels.
Referenced by jecLevel().
std::string JetCorrFactors::correctionLabelString | ( | ) | const |
Definition at line 76 of file JetCorrFactors.cc.
References mps_setup::append, training_settings::idx, jec_, tablePrinter::labels, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by correction(), and jecLevel().
|
inline |
Definition at line 79 of file JetCorrFactors.h.
References jec_.
Referenced by correction(), isValid(), and print().
|
inlineprivate |
Definition at line 87 of file JetCorrFactors.h.
References MAX_FLAVORS.
|
inlineprivate |
void JetCorrFactors::insertFactor | ( | const unsigned int & | position, |
const CorrectionFactor & | factor | ||
) |
Definition at line 22 of file JetCorrFactors.cc.
References invalidFactor(), isValid(), jec_, position, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by JetCorrFactors().
|
private |
Definition at line 116 of file JetCorrFactors.cc.
References Exception.
Referenced by insertFactor(), isValid(), and JetCorrFactors().
|
inlineprivate |
Definition at line 91 of file JetCorrFactors.h.
References flavorDependent(), flavorIndependent(), and invalidFactor().
Referenced by ntupleDataFormat._Object::_checkIsValid(), insertFactor(), JetCorrFactors(), and core.AutoHandle.AutoHandle::ReallyLoad().
std::string JetCorrFactors::jecFlavor | ( | const Flavor & | flavor | ) | const |
Definition at line 29 of file JetCorrFactors.cc.
References BOTTOM, CHARM, GLUON, NONE, and UDS.
Referenced by jecLevel().
JetCorrFactors::Flavor JetCorrFactors::jecFlavor | ( | std::string | flavor | ) | const |
Definition at line 37 of file JetCorrFactors.cc.
References BOTTOM, EnergyCorrector::c, CHARM, Exception, GLUON, NONE, create_public_lumi_plots::transform, and UDS.
|
inline |
Definition at line 62 of file JetCorrFactors.h.
References correction(), correctionLabels(), correctionLabelString(), jec_, jecFlavor(), hcalDigis_cfi::level, and AlCaHLTBitMon_QueryRunRegistry::string.
int JetCorrFactors::jecLevel | ( | const std::string & | level | ) | const |
Definition at line 50 of file JetCorrFactors.cc.
References jec_.
|
inline |
|
inline |
Definition at line 81 of file JetCorrFactors.h.
void JetCorrFactors::print | ( | void | ) | const |
Definition at line 97 of file JetCorrFactors.cc.
References correction(), flavorDependent(), jec_, and NONE.
Referenced by numberOfCorrectionLevels().
|
private |
Definition at line 104 of file JetCorrFactors.h.
Referenced by correction(), correctionLabel(), correctionLabels(), correctionLabelString(), flavorDependent(), insertFactor(), jecLevel(), numberOfCorrectionLevels(), and print().
|
private |
Definition at line 96 of file JetCorrFactors.h.
Referenced by SequenceTypes.DummyModule::__repr__(), Mixins._Labelable::_findDependencies(), jecSet(), and Mixins._Labelable::setLabel().
|
static |
Definition at line 49 of file JetCorrFactors.h.
Referenced by flavorDependent().