CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

ShiftedParticleMETcorrInputProducer Class Reference

#include <ShiftedParticleMETcorrInputProducer.h>

Inheritance diagram for ShiftedParticleMETcorrInputProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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_

Detailed Description

Propagate energy variations of electrons/muons/tau-jets to MET

Author:
Christian Veelken, LLR
Version:
Revision:
1.1
Id:
ShiftedParticleMETcorrInputProducer.h,v 1.1 2011/10/14 11:18:24 veelken Exp

Definition at line 27 of file ShiftedParticleMETcorrInputProducer.h.


Constructor & Destructor Documentation

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...
}

Member Function Documentation

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);
}

Member Data Documentation

Definition at line 38 of file ShiftedParticleMETcorrInputProducer.h.