CMS 3D CMS Logo

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
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef edm::View< reco::CandidateCandidateView
 

Private Member Functions

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

Private Attributes

const edm::EDGetTokenT< CandidateViewsrcOriginalToken_
 
const edm::EDGetTokenT< CandidateViewsrcShiftedToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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
private

Definition at line 15 of file ShiftedParticleMETcorrInputProducer.cc.

References edm::View< T >::begin(), DEFINE_FWK_MODULE, edm::View< T >::end(), edm::Event::getByToken(), eostools::move(), 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  auto metCorrection = std::make_unique<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(std::move(metCorrection));
40 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
const_iterator begin() const
const edm::EDGetTokenT< CandidateView > srcShiftedToken_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
const edm::EDGetTokenT< CandidateView > srcOriginalToken_
const_iterator end() const
def move(src, dest)
Definition: eostools.py:510

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().