#include <ShiftedParticleMETcorrInputProducer.h>
Public Member Functions | |
ShiftedParticleMETcorrInputProducer (const edm::ParameterSet &) | |
~ShiftedParticleMETcorrInputProducer () | |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::string | moduleLabel_ |
edm::InputTag | srcOriginal_ |
edm::InputTag | srcShifted_ |
Propagate energy variations of electrons/muons/tau-jets to MET
Definition at line 27 of file ShiftedParticleMETcorrInputProducer.h.
ShiftedParticleMETcorrInputProducer::ShiftedParticleMETcorrInputProducer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 6 of file ShiftedParticleMETcorrInputProducer.cc.
References edm::ParameterSet::getParameter(), srcOriginal_, and srcShifted_.
: moduleLabel_(cfg.getParameter<std::string>("@module_label")) { srcOriginal_ = cfg.getParameter<edm::InputTag>("srcOriginal"); srcShifted_ = cfg.getParameter<edm::InputTag>("srcShifted"); produces<CorrMETData>(); }
ShiftedParticleMETcorrInputProducer::~ShiftedParticleMETcorrInputProducer | ( | ) |
Definition at line 15 of file ShiftedParticleMETcorrInputProducer.cc.
{
// nothing to be done yet...
}
void ShiftedParticleMETcorrInputProducer::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 20 of file ShiftedParticleMETcorrInputProducer.cc.
References edm::Event::getByLabel(), edm::Event::put(), srcOriginal_, and srcShifted_.
{ typedef edm::View<reco::Candidate> CandidateView; edm::Handle<CandidateView> originalParticles; evt.getByLabel(srcOriginal_, originalParticles); edm::Handle<CandidateView> shiftedParticles; evt.getByLabel(srcShifted_, shiftedParticles); std::auto_ptr<CorrMETData> metCorrection(new CorrMETData()); for ( CandidateView::const_iterator originalParticle = originalParticles->begin(); originalParticle != originalParticles->end(); ++originalParticle ) { metCorrection->mex += originalParticle->px(); metCorrection->mey += originalParticle->py(); metCorrection->sumet += originalParticle->et(); } for ( CandidateView::const_iterator shiftedParticle = shiftedParticles->begin(); shiftedParticle != shiftedParticles->end(); ++shiftedParticle ) { metCorrection->mex -= shiftedParticle->px(); metCorrection->mey -= shiftedParticle->py(); metCorrection->sumet -= shiftedParticle->et(); } evt.put(metCorrection); }
std::string ShiftedParticleMETcorrInputProducer::moduleLabel_ [private] |
Definition at line 38 of file ShiftedParticleMETcorrInputProducer.h.
Definition at line 40 of file ShiftedParticleMETcorrInputProducer.h.
Referenced by produce(), and ShiftedParticleMETcorrInputProducer().
Definition at line 41 of file ShiftedParticleMETcorrInputProducer.h.
Referenced by produce(), and ShiftedParticleMETcorrInputProducer().