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::EDProducer | |
typedef EDProducer | ModuleType |
typedef WorkerT< EDProducer > | WorkerType |
Public Types inherited from edm::ProducerBase | |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Public Member Functions | |
JetCorrFactorsProducer (const edm::ParameterSet &cfg) | |
default constructor More... | |
virtual void | produce (edm::Event &event, const edm::EventSetup &setup) |
everything that needs to be done per event More... | |
~JetCorrFactorsProducer () | |
default destructor More... | |
Public Member Functions inherited from edm::EDProducer | |
EDProducer () | |
virtual | ~EDProducer () |
Public Member Functions inherited from edm::ProducerBase | |
ProducerBase () | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
boost::function< void(const BranchDescription &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
virtual | ~ProducerBase () |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
description of configuration file parameters More... | |
Static Public Member Functions inherited from edm::EDProducer | |
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, boost::shared_ptr< FactorizedJetCorrector > &corrector, 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 | |
bool | emf_ |
use electromagnetic fraction for jet energy corrections or not (will only have an effect for jets CaloJets) 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::InputTag | rho_ |
label for L1FastJet energy density parameter rho More... | |
edm::InputTag | src_ |
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::EDProducer | |
CurrentProcessingContext const * | currentContext () const |
Protected Member Functions inherited from edm::ProducerBase | |
template<class TProducer , class TMethod > | |
void | callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod) |
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, edm::hlt::Exception, edm::ParameterSet::existsAs(), expand(), spr::find(), edm::ParameterSet::getParameter(), pat::JetCorrFactors::GLUON, levels_, python.rootplot.argparse::message, pat::JetCorrFactors::NONE, primaryVertices_, rho_, pat::JetCorrFactors::UDS, useNPV_, and useRho_.
|
inline |
|
private |
evaluate jet correction factor up to a given level
Definition at line 130 of file JetCorrFactorsProducer.cc.
References emf_, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), 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 93 of file JetCorrFactorsProducer.cc.
References pat::JetCorrFactors::BOTTOM, pat::JetCorrFactors::CHARM, pat::JetCorrFactors::GLUON, testEve_cfg::level, python.rootplot.argparse::message, type_, and pat::JetCorrFactors::UDS.
Referenced by JetCorrFactorsProducer().
|
static |
description of configuration file parameters
Definition at line 262 of file JetCorrFactorsProducer.cc.
References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().
|
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 124 of file JetCorrFactorsProducer.h.
Referenced by produce().
|
private |
return the jec parameters as input to the FactorizedJetCorrector for different flavors
Definition at line 119 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 146 of file JetCorrFactorsProducer.cc.
References payload_.
Referenced by produce().
|
virtual |
everything that needs to be done per event
Implements edm::EDProducer.
Definition at line 152 of file JetCorrFactorsProducer.cc.
References evaluate(), edm::hlt::Exception, edm::helper::Filler< Map >::fill(), flavorDependent(), edm::EventSetup::get(), edm::Event::getByLabel(), edm::helper::Filler< Map >::insert(), patTestJEC_cfi::jec, metsig::jet, fwrapper::jets, edm::InputTag::label(), label_, levels_, numberOf(), Parameters::parameters, params(), payload(), primaryVertices_, rho, rho_, and src_.
|
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 jec factors
Definition at line 100 of file JetCorrFactorsProducer.h.
Referenced by Mixins._Labelable::_findDependencies(), Mixins._TypedParameterizable::dumpPython(), and produce().
|
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 120 of file JetCorrFactorsProducer.h.
Referenced by flavorDependent(), JetCorrFactorsProducer(), and produce().
|
private |
|
private |
label for L1Offset primaryVertex collection
Definition at line 104 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer(), and produce().
|
private |
label for L1FastJet energy density parameter rho
Definition at line 106 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 108 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer().
|
private |
Definition at line 109 of file JetCorrFactorsProducer.h.
Referenced by JetCorrFactorsProducer().