CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ShiftedParticleMETcorrInputProducer Class Reference

#include <ShiftedParticleMETcorrInputProducer.h>

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

Public Member Functions

 ShiftedParticleMETcorrInputProducer (const edm::ParameterSet &)
 
 ~ShiftedParticleMETcorrInputProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef edm::View
< reco::Candidate
CandidateView
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

std::string moduleLabel_
 
edm::EDGetTokenT< CandidateViewsrcOriginalToken_
 
edm::EDGetTokenT< CandidateViewsrcShiftedToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

Author
Christian Veelken, LLR

Definition at line 27 of file ShiftedParticleMETcorrInputProducer.h.

Member Typedef Documentation

Definition at line 35 of file ShiftedParticleMETcorrInputProducer.h.

Constructor & Destructor Documentation

ShiftedParticleMETcorrInputProducer::ShiftedParticleMETcorrInputProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 3 of file ShiftedParticleMETcorrInputProducer.cc.

4  : moduleLabel_(cfg.getParameter<std::string>("@module_label"))
5  , srcOriginalToken_(consumes<CandidateView>(cfg.getParameter<edm::InputTag>("srcOriginal")))
6  , srcShiftedToken_(consumes<CandidateView>(cfg.getParameter<edm::InputTag>("srcShifted")))
7 {
8  produces<CorrMETData>();
9 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CandidateView > srcOriginalToken_
edm::EDGetTokenT< CandidateView > srcShiftedToken_
ShiftedParticleMETcorrInputProducer::~ShiftedParticleMETcorrInputProducer ( )

Definition at line 11 of file ShiftedParticleMETcorrInputProducer.cc.

12 {
13 // nothing to be done yet...
14 }

Member Function Documentation

void ShiftedParticleMETcorrInputProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 16 of file ShiftedParticleMETcorrInputProducer.cc.

References edm::Event::getByToken(), edm::Event::put(), srcOriginalToken_, and srcShiftedToken_.

17 {
18  edm::Handle<CandidateView> originalParticles;
19  evt.getByToken(srcOriginalToken_, originalParticles);
20 
21  edm::Handle<CandidateView> shiftedParticles;
22  evt.getByToken(srcShiftedToken_, shiftedParticles);
23 
24  std::auto_ptr<CorrMETData> metCorrection(new CorrMETData());
25 
26  for ( CandidateView::const_iterator originalParticle = originalParticles->begin();
27  originalParticle != originalParticles->end(); ++originalParticle ) {
28  metCorrection->mex += originalParticle->px();
29  metCorrection->mey += originalParticle->py();
30  metCorrection->sumet += originalParticle->et();
31  }
32 
33  for ( CandidateView::const_iterator shiftedParticle = shiftedParticles->begin();
34  shiftedParticle != shiftedParticles->end(); ++shiftedParticle ) {
35  metCorrection->mex -= shiftedParticle->px();
36  metCorrection->mey -= shiftedParticle->py();
37  metCorrection->sumet -= shiftedParticle->et();
38  }
39 
40  evt.put(metCorrection);
41 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< CandidateView > srcOriginalToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
a MET correction term
Definition: CorrMETData.h:14
edm::EDGetTokenT< CandidateView > srcShiftedToken_

Member Data Documentation

std::string ShiftedParticleMETcorrInputProducer::moduleLabel_
private
edm::EDGetTokenT<CandidateView> ShiftedParticleMETcorrInputProducer::srcOriginalToken_
private

Definition at line 41 of file ShiftedParticleMETcorrInputProducer.h.

Referenced by produce().

edm::EDGetTokenT<CandidateView> ShiftedParticleMETcorrInputProducer::srcShiftedToken_
private

Definition at line 42 of file ShiftedParticleMETcorrInputProducer.h.

Referenced by produce().