#include <ShiftedParticleProducerT.h>
Classes | |
struct | binningEntryType |
Public Member Functions | |
ShiftedParticleProducerT (const edm::ParameterSet &cfg) | |
~ShiftedParticleProducerT () | |
Private Types | |
typedef std::vector< T > | ParticleCollection |
Private Member Functions | |
void | produce (edm::Event &evt, const edm::EventSetup &es) |
Private Attributes | |
std::vector< binningEntryType * > | binning_ |
std::string | moduleLabel_ |
double | shiftBy_ |
edm::InputTag | src_ |
Vary energy of electrons/muons/tau-jets by +/- 1 standard deviation, in order to estimate resulting uncertainty on MET
NOTE: energy scale uncertainties need to be specified in python config
Definition at line 32 of file ShiftedParticleProducerT.h.
typedef std::vector<T> ShiftedParticleProducerT< T >::ParticleCollection [private] |
Definition at line 34 of file ShiftedParticleProducerT.h.
ShiftedParticleProducerT< T >::ShiftedParticleProducerT | ( | const edm::ParameterSet & | cfg | ) | [inline, explicit] |
Definition at line 38 of file ShiftedParticleProducerT.h.
References ShiftedParticleProducerT< T >::binning_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), ShiftedParticleProducerT< T >::shiftBy_, and ShiftedParticleProducerT< T >::src_.
: moduleLabel_(cfg.getParameter<std::string>("@module_label")) { src_ = cfg.getParameter<edm::InputTag>("src"); 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)); } produces<ParticleCollection>(); }
ShiftedParticleProducerT< T >::~ShiftedParticleProducerT | ( | ) | [inline] |
Definition at line 59 of file ShiftedParticleProducerT.h.
References ShiftedParticleProducerT< T >::binning_.
void ShiftedParticleProducerT< T >::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [inline, private, virtual] |
Implements edm::EDProducer.
Definition at line 69 of file ShiftedParticleProducerT.h.
References ShiftedParticleProducerT< T >::binning_, edm::Event::getByLabel(), edm::Event::put(), edm::shift, ShiftedParticleProducerT< T >::shiftBy_, and ShiftedParticleProducerT< T >::src_.
{ edm::Handle<ParticleCollection> originalParticles; evt.getByLabel(src_, originalParticles); std::auto_ptr<ParticleCollection> shiftedParticles(new ParticleCollection); for ( typename ParticleCollection::const_iterator originalParticle = originalParticles->begin(); originalParticle != originalParticles->end(); ++originalParticle ) { double uncertainty = 0.; for ( typename std::vector<binningEntryType*>::iterator binningEntry = binning_.begin(); binningEntry != binning_.end(); ++binningEntry ) { if ( (!(*binningEntry)->binSelection_) || (*(*binningEntry)->binSelection_)(*originalParticle) ) { uncertainty = (*binningEntry)->binUncertainty_; break; } } double shift = shiftBy_*uncertainty; reco::Candidate::LorentzVector shiftedParticleP4 = originalParticle->p4(); shiftedParticleP4 *= (1. + shift); T shiftedParticle(*originalParticle); shiftedParticle.setP4(shiftedParticleP4); shiftedParticles->push_back(shiftedParticle); } evt.put(shiftedParticles); }
std::vector<binningEntryType*> ShiftedParticleProducerT< T >::binning_ [private] |
Definition at line 123 of file ShiftedParticleProducerT.h.
Referenced by ShiftedParticleProducerT< T >::produce(), ShiftedParticleProducerT< T >::ShiftedParticleProducerT(), and ShiftedParticleProducerT< T >::~ShiftedParticleProducerT().
std::string ShiftedParticleProducerT< T >::moduleLabel_ [private] |
Definition at line 102 of file ShiftedParticleProducerT.h.
double ShiftedParticleProducerT< T >::shiftBy_ [private] |
Definition at line 125 of file ShiftedParticleProducerT.h.
Referenced by ShiftedParticleProducerT< T >::produce(), and ShiftedParticleProducerT< T >::ShiftedParticleProducerT().
edm::InputTag ShiftedParticleProducerT< T >::src_ [private] |
Definition at line 104 of file ShiftedParticleProducerT.h.
Referenced by ShiftedParticleProducerT< T >::produce(), and ShiftedParticleProducerT< T >::ShiftedParticleProducerT().