test
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::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ShiftedParticleMETcorrInputProducer (const edm::ParameterSet &)
 
 ~ShiftedParticleMETcorrInputProducer ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::StreamID, edm::Event &, const edm::EventSetup &) const
 

Private Attributes

const edm::EDGetTokenT
< CandidateView
srcOriginalToken_
 
const edm::EDGetTokenT
< CandidateView
srcShiftedToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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  : srcOriginalToken_(consumes<CandidateView>(cfg.getParameter<edm::InputTag>("srcOriginal")))
5  , srcShiftedToken_(consumes<CandidateView>(cfg.getParameter<edm::InputTag>("srcShifted")))
6 {
7  produces<CorrMETData>();
8 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< CandidateView > srcShiftedToken_
const edm::EDGetTokenT< CandidateView > srcOriginalToken_
ShiftedParticleMETcorrInputProducer::~ShiftedParticleMETcorrInputProducer ( )

Definition at line 10 of file ShiftedParticleMETcorrInputProducer.cc.

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

Member Function Documentation

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

Implements edm::global::EDProducerBase.

Definition at line 15 of file ShiftedParticleMETcorrInputProducer.cc.

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

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

Member Data Documentation

const edm::EDGetTokenT<CandidateView> ShiftedParticleMETcorrInputProducer::srcOriginalToken_
private

Definition at line 39 of file ShiftedParticleMETcorrInputProducer.h.

Referenced by produce().

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

Definition at line 40 of file ShiftedParticleMETcorrInputProducer.h.

Referenced by produce().