#include <ShiftedMETcorrInputProducer.h>
Classes | |
struct | binningEntryType |
Public Member Functions | |
ShiftedMETcorrInputProducer (const edm::ParameterSet &) | |
~ShiftedMETcorrInputProducer () | |
Private Types | |
typedef std::vector < edm::InputTag > | vInputTag |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::vector< binningEntryType * > | binning_ |
std::string | moduleLabel_ |
double | shiftBy_ |
vInputTag | src_ |
Vary px, py and sumEt of "unclustered energy" (PFJets of Pt < 10 GeV plus PFCandidates not within jets) by +/- 1 standard deviation, in order to estimate resulting uncertainty on MET
Definition at line 25 of file ShiftedMETcorrInputProducer.h.
typedef std::vector<edm::InputTag> ShiftedMETcorrInputProducer::vInputTag [private] |
Definition at line 38 of file ShiftedMETcorrInputProducer.h.
ShiftedMETcorrInputProducer::ShiftedMETcorrInputProducer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 7 of file ShiftedMETcorrInputProducer.cc.
References binning_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), shiftBy_, and src_.
: moduleLabel_(cfg.getParameter<std::string>("@module_label")) { src_ = cfg.getParameter<vInputTag>("src"); //--- check that all InputTags refer to the same module label // (i.e. differ by instance label only) for ( vInputTag::const_iterator src_ref = src_.begin(); src_ref != src_.end(); ++src_ref ) { for ( vInputTag::const_iterator src_test = src_ref; src_test != src_.end(); ++src_test ) { if ( src_test->label() != src_ref->label() ) throw cms::Exception("ShiftedMETcorrInputProducer") << "InputTags specified by 'src' Configuration parameter must not refer to different module labels !!\n"; } } shiftBy_ = cfg.getParameter<double>("shiftBy"); if ( cfg.exists("binning") ) { typedef std::vector<edm::ParameterSet> vParameterSet; vParameterSet cfgBinning = cfg.getParameter<vParameterSet>("binning"); for ( vParameterSet::const_iterator cfgBinningEntry = cfgBinning.begin(); cfgBinningEntry != cfgBinning.end(); ++cfgBinningEntry ) { binning_.push_back(new binningEntryType(*cfgBinningEntry)); } } else { double uncertainty = cfg.getParameter<double>("uncertainty"); binning_.push_back(new binningEntryType(uncertainty)); } for ( vInputTag::const_iterator src_i = src_.begin(); src_i != src_.end(); ++src_i ) { for ( std::vector<binningEntryType*>::const_iterator binningEntry = binning_.begin(); binningEntry != binning_.end(); ++binningEntry ) { produces<CorrMETData>((*binningEntry)->getInstanceLabel_full(src_i->instance())); } } }
ShiftedMETcorrInputProducer::~ShiftedMETcorrInputProducer | ( | ) |
Definition at line 47 of file ShiftedMETcorrInputProducer.cc.
References binning_.
void ShiftedMETcorrInputProducer::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 55 of file ShiftedMETcorrInputProducer.cc.
References binning_, edm::Event::getByLabel(), edm::Event::put(), edm::shift, shiftBy_, and src_.
{ for ( vInputTag::const_iterator src_i = src_.begin(); src_i != src_.end(); ++src_i ) { for ( std::vector<binningEntryType*>::iterator binningEntry = binning_.begin(); binningEntry != binning_.end(); ++binningEntry ) { edm::Handle<CorrMETData> originalObject; evt.getByLabel(edm::InputTag(src_i->label(), (*binningEntry)->getInstanceLabel_full(src_i->instance())), originalObject); double shift = shiftBy_*(*binningEntry)->binUncertainty_; std::auto_ptr<CorrMETData> shiftedObject(new CorrMETData(*originalObject)); //--- MET balances momentum of reconstructed particles, // hence variations of "unclustered energy" and MET are opposite in sign shiftedObject->mex = -shift*originalObject->mex; shiftedObject->mey = -shift*originalObject->mey; shiftedObject->sumet = shift*originalObject->sumet; evt.put(shiftedObject, (*binningEntry)->getInstanceLabel_full(src_i->instance())); } } }
std::vector<binningEntryType*> ShiftedMETcorrInputProducer::binning_ [private] |
Definition at line 62 of file ShiftedMETcorrInputProducer.h.
Referenced by produce(), ShiftedMETcorrInputProducer(), and ~ShiftedMETcorrInputProducer().
std::string ShiftedMETcorrInputProducer::moduleLabel_ [private] |
Definition at line 36 of file ShiftedMETcorrInputProducer.h.
double ShiftedMETcorrInputProducer::shiftBy_ [private] |
Definition at line 64 of file ShiftedMETcorrInputProducer.h.
Referenced by produce(), and ShiftedMETcorrInputProducer().
vInputTag ShiftedMETcorrInputProducer::src_ [private] |
Definition at line 39 of file ShiftedMETcorrInputProducer.h.
Referenced by produce(), and ShiftedMETcorrInputProducer().