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... | |
Public Types inherited from edm::stream::EDProducer<> | |
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 Types inherited from edm::stream::EDProducerBase | |
typedef EDProducerAdaptorBase | ModuleType |
Public Types inherited from edm::ProducerBase | |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
Public Member Functions | |
JetCorrFactorsProducer (const edm::ParameterSet &cfg) | |
default constructor More... | |
virtual void | produce (edm::Event &event, const edm::EventSetup &setup) override |
everything that needs to be done per event More... | |
~JetCorrFactorsProducer () | |
default destructor More... | |
Public Member Functions inherited from edm::stream::EDProducer<> | |
EDProducer ()=default | |
Public Member Functions inherited from edm::stream::EDProducerBase | |
EDProducerBase () | |
ModuleDescription const & | moduleDescription () const |
virtual | ~EDProducerBase () |
Public Member Functions inherited from edm::ProducerBase | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
ProducerBase () | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
std::function< void(BranchDescription const &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
virtual | ~ProducerBase () |
Public Member Functions inherited from edm::EDConsumerBase | |
std::vector< ConsumesInfo > | consumesInfo () const |
EDConsumerBase () | |
ProductHolderIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
void | itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
void | itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
std::vector < ProductHolderIndexAndSkipBit > const & | itemsToGetFromEvent () const |
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
void | modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const |
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
bool | registeredToConsume (ProductHolderIndex, bool, BranchType) const |
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
void | updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &) |
virtual | ~EDConsumerBase () |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
description of configuration file parameters More... | |
Static Public Member Functions inherited from edm::stream::EDProducerBase | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
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_ |
Additional Inherited Members | |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
ConsumesCollector | consumesCollector () |
Use a ConsumesCollector to gather consumes information from helper functions. More... | |
template<typename ProductType , BranchType B = InEvent> | |
void | consumesMany () |
void | consumesMany (const TypeToGet &id) |
template<BranchType B> | |
void | consumesMany (const TypeToGet &id) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
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 59 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 64 of file JetCorrFactorsProducer.h.
value map for JetCorrFactors (to be written into the event)
Definition at line 62 of file JetCorrFactorsProducer.h.
|
explicit |
default constructor
Definition at line 22 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, levels_, python.rootplot.argparse::message, pat::JetCorrFactors::NONE, primaryVertices_, primaryVerticesToken_, rho_, rhoToken_, AlCaHLTBitMon_QueryRunRegistry::string, pat::JetCorrFactors::UDS, useNPV_, and useRho_.
|
inline |
|
private |
evaluate jet correction factor up to a given level
Definition at line 149 of file JetCorrFactorsProducer.cc.
References pat::Jet::correctedP4(), mvaPFMET_cff::corrector, correctors_, emf_, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), extraJPTOffsetCorrector_, reco::JPTJet::getCaloJetRef(), metsig::jet, testEve_cfg::level, p4, reco::LeafCandidate::phi(), and reco::LeafCandidate::pt().
Referenced by 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 112 of file JetCorrFactorsProducer.cc.
References pat::JetCorrFactors::BOTTOM, pat::JetCorrFactors::CHARM, pat::JetCorrFactors::GLUON, testEve_cfg::level, python.rootplot.argparse::message, AlCaHLTBitMon_QueryRunRegistry::string, type_, and pat::JetCorrFactors::UDS.
Referenced by JetCorrFactorsProducer().
|
static |
description of configuration file parameters
Definition at line 297 of file JetCorrFactorsProducer.cc.
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_25ns14e33_v1_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.
|
inlineprivate |
return true if the jec levels contain at least one flavor dependent correction level
Definition at line 78 of file JetCorrFactorsProducer.h.
References levels_.
Referenced by produce().
|
inlineprivate |
determines the number of valid primary vertices for the standard L1Offset correction of JetMET
Definition at line 135 of file JetCorrFactorsProducer.h.
References HLT_25ns14e33_v1_cff::primaryVertices, and MetAnalyzer::pv().
Referenced by produce().
|
private |
return the jec parameters as input to the FactorizedJetCorrector for different flavors
Definition at line 138 of file JetCorrFactorsProducer.cc.
References testEve_cfg::level, and JetCorrectorParametersCollection::push_back().
Referenced by produce().
|
private |
map jet algorithm to payload in DB
Definition at line 176 of file JetCorrFactorsProducer.cc.
References payload_.
Referenced by produce().
|
overridevirtual |
everything that needs to be done per event
Implements edm::stream::EDProducerBase.
Definition at line 182 of file JetCorrFactorsProducer.cc.
References cacheId_, correctors_, evaluate(), Exception, extraJPTOffset_, extraJPTOffsetCorrector_, edm::helper::Filler< Map >::fill(), flavorDependent(), edm::EventSetup::get(), edm::Event::getByToken(), customizeTrackingMonitorSeedNumber::idx, edm::helper::Filler< Map >::insert(), patTestJEC_cfi::jec, metsig::jet, fwrapper::jets, edm::InputTag::label(), label_, levels_, numberOf(), Parameters::parameters, params(), payload(), HLT_25ns14e33_v1_cff::primaryVertices, primaryVertices_, primaryVerticesToken_, rho, rho_, rhoToken_, srcToken_, and AlCaHLTBitMon_QueryRunRegistry::string.
|
private |
cache identifier for JetCorrectionsRecord
Definition at line 127 of file JetCorrFactorsProducer.h.
Referenced by produce().
|
private |
cache container for jet corrections
Definition at line 129 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 94 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 105 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
cache container for JPTOffset jet corrections
Definition at line 131 of file JetCorrFactorsProducer.h.
Referenced by evaluate(), and produce().
|
private |
label of jec factors
Definition at line 100 of file JetCorrFactorsProducer.h.
Referenced by 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 125 of file JetCorrFactorsProducer.h.
Referenced by flavorDependent(), JetCorrFactorsProducer(), and produce().
|
private |
|
private |
label for L1Offset primaryVertex collection
Definition at line 107 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
Definition at line 108 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
label for L1FastJet energy density parameter rho
Definition at line 110 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
Definition at line 111 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
input jet collection
Definition at line 96 of file JetCorrFactorsProducer.h.
Referenced by produce().
|
private |
type of flavor dependent JEC factors (only 'J' and 'T' are allowed)
Definition at line 98 of file JetCorrFactorsProducer.h.
Referenced by Modules.Service::_placeImpl(), Modules.ESSource::_placeImpl(), Modules.ESProducer::_placeImpl(), Modules.ESPrefer::copy(), Mixins._TypedParameterizable::dumpPython(), Modules.ESPrefer::dumpPythonAs(), expand(), Modules.Service::insertInto(), RandomRunSource.RandomRunSource::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 113 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer().
|
private |
Definition at line 114 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer().