![]() |
![]() |
Produces a ValueMap between JetCorrFactors and the to the originating reco jets. More...
#include "PhysicsTools/PatAlgos/interface/JetCorrFactorsProducer.h"
Public Types | |
typedef std::map< JetCorrFactors::Flavor, std::vector< std::string > > | FlavorCorrLevelMap |
map of correction levels to different flavors More... | |
typedef edm::ValueMap< pat::JetCorrFactors > | JetCorrFactorsMap |
value map for JetCorrFactors (to be written into the event) More... | |
![]() | |
typedef CacheContexts< T... > | CacheTypes |
typedef CacheTypes::GlobalCache | GlobalCache |
typedef AbilityChecker< T... > | HasAbility |
typedef CacheTypes::LuminosityBlockCache | LuminosityBlockCache |
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache > | LuminosityBlockContext |
typedef CacheTypes::LuminosityBlockSummaryCache | LuminosityBlockSummaryCache |
typedef CacheTypes::RunCache | RunCache |
typedef RunContextT< RunCache, GlobalCache > | RunContext |
typedef CacheTypes::RunSummaryCache | RunSummaryCache |
Public Member Functions | |
JetCorrFactorsProducer (const edm::ParameterSet &cfg) | |
default constructor More... | |
void | produce (edm::Event &event, const edm::EventSetup &setup) override |
everything that needs to be done per event More... | |
~JetCorrFactorsProducer () override | |
default destructor More... | |
![]() | |
EDProducer ()=default | |
bool | hasAbilityToProduceInLumis () const final |
bool | hasAbilityToProduceInRuns () const final |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
description of configuration file parameters More... | |
Private Member Functions | |
float | evaluate (edm::View< reco::Jet >::const_iterator &jet, const JetCorrFactors::Flavor &flavor, int level) |
evaluate jet correction factor up to a given level More... | |
std::vector< std::string > | expand (const std::vector< std::string > &levels, const JetCorrFactors::Flavor &flavor) |
bool | flavorDependent () const |
return true if the jec levels contain at least one flavor dependent correction level More... | |
int | numberOf (const edm::Handle< std::vector< reco::Vertex > > &primaryVertices) |
determines the number of valid primary vertices for the standard L1Offset correction of JetMET More... | |
std::vector< JetCorrectorParameters > | params (const JetCorrectorParametersCollection ¶meters, const std::vector< std::string > &levels) const |
return the jec parameters as input to the FactorizedJetCorrector for different flavors More... | |
std::string | payload () |
map jet algorithm to payload in DB More... | |
Private Attributes | |
unsigned long long | cacheId_ |
cache identifier for JetCorrectionsRecord More... | |
std::map< JetCorrFactors::Flavor, std::unique_ptr< FactorizedJetCorrector > > | correctors_ |
cache container for jet corrections More... | |
bool | emf_ |
use electromagnetic fraction for jet energy corrections or not (will only have an effect for jets CaloJets) More... | |
std::vector< std::string > | extraJPTOffset_ |
std::unique_ptr< FactorizedJetCorrector > | extraJPTOffsetCorrector_ |
cache container for JPTOffset jet corrections More... | |
std::string | label_ |
label of jec factors More... | |
FlavorCorrLevelMap | levels_ |
std::string | payload_ |
label of payload More... | |
edm::InputTag | primaryVertices_ |
label for L1Offset primaryVertex collection More... | |
edm::EDGetTokenT< std::vector< reco::Vertex > > | primaryVerticesToken_ |
edm::InputTag | rho_ |
label for L1FastJet energy density parameter rho More... | |
edm::EDGetTokenT< double > | rhoToken_ |
edm::EDGetTokenT< edm::View< reco::Jet > > | srcToken_ |
input jet collection More... | |
std::string | type_ |
type of flavor dependent JEC factors (only 'J' and 'T' are allowed) More... | |
bool | useNPV_ |
use the NPV and rho with the JEC? (used for L1Offset/L1FastJet and L1FastJet, resp.) More... | |
bool | useRho_ |
Produces a ValueMap between JetCorrFactors and the to the originating reco jets.
The JetCorrFactorsProducer produces a set of correction factors, defined in the class pat::JetCorrFactors. This vector is linked to the originating reco jets through an edm::ValueMap. The initializing parameters of the module can be found in the recoLayer1/jetCorrFactors_cfi.py of the PatAlgos package. In the standard PAT workflow the module has to be run before the creation of the pat::Jet. The edm::ValueMap will then be embedded into the pat::Jet.
Jets corrected up to a given correction level can then be accessed via the pat::Jet member function correctedJet. For more details have a look into the class description of the pat::Jet.
ATTENTION: available options for flavor corrections are L5Flavor_gJ L7Parton_gJ gluon from dijets L5Flavor_qJ/_qT L7Parton_qJ/_qT quark from dijets/top L5Flavor_cJ/_cT L7Parton_cJ/_cT charm from dijets/top L5Flavor_bJ/_bT L7Parton_bJ/_bT beauty from dijets/top L7Parton_jJ/_tT mixture from dijets/top
where mixture refers to the flavor mixture as determined from the MC sample the flavor dependent corrections have been derived from. 'J' and 'T' stand for a typical dijet (ttbar) sample.
L1Offset corrections require the collection of offlinePrimaryVertices, which are supposed to be added as an additional optional parameter primaryVertices in the jetCorrFactors_cfi.py file.
L1FastJet corrections, which are an alternative to the standard L1Offset correction as recommended by the JetMET PAG the energy density parameter rho is supposed to be added as an additional optional parameter rho in the jetCorrFactors_cfi.py file.
NOTE: the mixed mode (mc input mixture from dijets/ttbar) only exists for parton level corrections. jJ and tT are not covered in this implementation of the JetCorrFactorsProducer there are no gluon corrections available from the top sample on the L7Parton level.
Definition at line 60 of file JetCorrFactorsProducer.h.
typedef std::map<JetCorrFactors::Flavor, std::vector<std::string> > pat::JetCorrFactorsProducer::FlavorCorrLevelMap |
map of correction levels to different flavors
Definition at line 65 of file JetCorrFactorsProducer.h.
value map for JetCorrFactors (to be written into the event)
Definition at line 63 of file JetCorrFactorsProducer.h.
|
explicit |
default constructor
Definition at line 21 of file JetCorrFactorsProducer.cc.
References pat::JetCorrFactors::BOTTOM, pat::JetCorrFactors::CHARM, Exception, edm::ParameterSet::existsAs(), expand(), extraJPTOffset_, spr::find(), edm::ParameterSet::getParameter(), pat::JetCorrFactors::GLUON, jets_cff::levels, levels_, pat::JetCorrFactors::NONE, primaryVertices_, primaryVerticesToken_, rho_, rhoToken_, AlCaHLTBitMon_QueryRunRegistry::string, pat::JetCorrFactors::UDS, useNPV_, and useRho_.
|
inlineoverride |
default destructor
Definition at line 71 of file JetCorrFactorsProducer.h.
References fillDescriptions(), produce(), and GeneralSetup::setup().
|
private |
evaluate jet correction factor up to a given level
Definition at line 143 of file JetCorrFactorsProducer.cc.
References pat::Jet::correctedP4(), mitigatedMETSequence_cff::corrector, correctors_, emf_, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), extraJPTOffsetCorrector_, reco::JPTJet::getCaloJetRef(), metsig::jet, hcalDigis_cfi::level, p4, reco::LeafCandidate::phi(), and reco::LeafCandidate::pt().
Referenced by flavorDependent(), and produce().
|
private |
return an expanded version of correction levels for different flavors; the result should be of type ['L2Relative', 'L3Absolute', 'L5FLavor_gJ', 'L7Parton_gJ']; L7Parton_gT will result in an empty string as this correction level is not available
Definition at line 106 of file JetCorrFactorsProducer.cc.
References pat::JetCorrFactors::BOTTOM, pat::JetCorrFactors::CHARM, pat::JetCorrFactors::GLUON, hcalDigis_cfi::level, AlCaHLTBitMon_QueryRunRegistry::string, type_, and pat::JetCorrFactors::UDS.
Referenced by flavorDependent(), and JetCorrFactorsProducer().
|
static |
description of configuration file parameters
Definition at line 294 of file JetCorrFactorsProducer.cc.
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, jets_cff::levels, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by ~JetCorrFactorsProducer().
|
inlineprivate |
return true if the jec levels contain at least one flavor dependent correction level
Definition at line 79 of file JetCorrFactorsProducer.h.
References evaluate(), expand(), metsig::jet, hcalDigis_cfi::level, jets_cff::levels, levels_, numberOf(), params(), payload(), jets_cff::primaryVertices, and AlCaHLTBitMon_QueryRunRegistry::string.
|
inlineprivate |
determines the number of valid primary vertices for the standard L1Offset correction of JetMET
Definition at line 136 of file JetCorrFactorsProducer.h.
References jets_cff::primaryVertices, and MetAnalyzer::pv().
Referenced by flavorDependent(), and produce().
|
private |
return the jec parameters as input to the FactorizedJetCorrector for different flavors
Definition at line 133 of file JetCorrFactorsProducer.cc.
References hcalDigis_cfi::level, and JetCorrectorParametersCollection::push_back().
Referenced by flavorDependent(), and produce().
|
private |
map jet algorithm to payload in DB
Definition at line 180 of file JetCorrFactorsProducer.cc.
References payload_.
Referenced by flavorDependent(), and produce().
|
override |
everything that needs to be done per event
Definition at line 182 of file JetCorrFactorsProducer.cc.
References cacheId_, correctors_, PatJetAnalyzer_cfi::corrLevel, evaluate(), Exception, extraJPTOffset_, extraJPTOffsetCorrector_, objects.autophobj::filler, edm::EventSetup::get(), edm::Event::getByToken(), training_settings::idx, patTestJEC_cfi::jec, metsig::jet, fwrapper::jets, edm::InputTag::label(), label_, levels_, eostools::move(), numberOf(), params(), payload(), jets_cff::primaryVertices, primaryVertices_, primaryVerticesToken_, rho_, rhoToken_, srcToken_, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by ~JetCorrFactorsProducer().
|
private |
cache identifier for JetCorrectionsRecord
Definition at line 128 of file JetCorrFactorsProducer.h.
Referenced by produce().
|
private |
cache container for jet corrections
Definition at line 130 of file JetCorrFactorsProducer.h.
Referenced by evaluate(), and produce().
|
private |
use electromagnetic fraction for jet energy corrections or not (will only have an effect for jets CaloJets)
Definition at line 95 of file JetCorrFactorsProducer.h.
Referenced by evaluate().
|
private |
label of additional L1Offset corrector for JPT jets; for format reasons this string is kept in a vector of strings
Definition at line 106 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
cache container for JPTOffset jet corrections
Definition at line 132 of file JetCorrFactorsProducer.h.
Referenced by evaluate(), and produce().
|
private |
label of jec factors
Definition at line 101 of file JetCorrFactorsProducer.h.
Referenced by SequenceTypes.DummyModule::__repr__(), Mixins._Labelable::_findDependencies(), produce(), and Mixins._Labelable::setLabel().
|
private |
jec levels for different flavors. In the default configuration this map would look like this: GLUON : 'L2Relative', 'L3Absolute', 'L5FLavor_jg', L7Parton_jg' UDS : 'L2Relative', 'L3Absolute', 'L5FLavor_jq', L7Parton_jq' CHARM : 'L2Relative', 'L3Absolute', 'L5FLavor_jc', L7Parton_jc' BOTTOM : 'L2Relative', 'L3Absolute', 'L5FLavor_jb', L7Parton_jb' or just like this: NONE : 'L2Relative', 'L3Absolute', 'L2L3Residual' per definition the vectors for all elements in this map should have the same size
Definition at line 126 of file JetCorrFactorsProducer.h.
Referenced by flavorDependent(), JetCorrFactorsProducer(), and produce().
|
private |
|
private |
label for L1Offset primaryVertex collection
Definition at line 108 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
Definition at line 109 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
label for L1FastJet energy density parameter rho
Definition at line 111 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
Definition at line 112 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
input jet collection
Definition at line 97 of file JetCorrFactorsProducer.h.
Referenced by produce().
|
private |
type of flavor dependent JEC factors (only 'J' and 'T' are allowed)
Definition at line 99 of file JetCorrFactorsProducer.h.
Referenced by Modules.Service::__str__(), Modules.Service::_placeImpl(), Modules.ESSource::_placeImpl(), Modules.ESProducer::_placeImpl(), Modules.ESPrefer::copy(), Mixins._TypedParameterizable::dumpPython(), Modules.ESPrefer::dumpPythonAs(), Modules.Service::dumpSequencePython(), expand(), RandomRunSource.RandomRunSource::insertInto(), Modules.Service::insertInto(), ExternalGeneratorFilter.ExternalGeneratorFilter::insertInto(), Mixins._TypedParameterizable::insertInto(), Modules.ESSource::moduleLabel_(), Modules.ESProducer::moduleLabel_(), Modules.ESSource::nameInProcessDesc_(), Modules.ESProducer::nameInProcessDesc_(), and Modules.ESPrefer::nameInProcessDesc_().
|
private |
use the NPV and rho with the JEC? (used for L1Offset/L1FastJet and L1FastJet, resp.)
Definition at line 114 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer().
|
private |
Definition at line 115 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer().