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
CorrectedMETProducerT< T > Class Template Reference

#include <CorrectedMETProducerT.h>

Inheritance diagram for CorrectedMETProducerT< T >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CorrectedMETProducerT (const edm::ParameterSet &cfg)
 
 ~CorrectedMETProducerT ()
 
- 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 std::vector< TMETCollection
 

Private Member Functions

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

Private Attributes

METCorrectionAlgorithmalgorithm_
 
std::string moduleLabel_
 
edm::EDGetTokenT< METCollectiontoken_
 

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

template<typename T>
class CorrectedMETProducerT< T >

Produce MET collections with Type 1 / Type 1 + 2 corrections applied

NOTE: This file defines the generic template. Concrete instances for CaloMET and PFMET are defined in JetMETCorrections/Type1MET/plugins/CorrectedCaloMETProducer.cc JetMETCorrections/Type1MET/plugins/CorrectedPFMETProducer.cc

Authors
Michael Schmitt, Richard Cavanaugh, The University of Florida Florent Lacroix, University of Illinois at Chicago Christian Veelken, LLR

Definition at line 64 of file CorrectedMETProducerT.h.

Member Typedef Documentation

template<typename T >
typedef std::vector<T> CorrectedMETProducerT< T >::METCollection
private

Definition at line 66 of file CorrectedMETProducerT.h.

Constructor & Destructor Documentation

template<typename T >
CorrectedMETProducerT< T >::CorrectedMETProducerT ( const edm::ParameterSet cfg)
inlineexplicit

Definition at line 70 of file CorrectedMETProducerT.h.

References CorrectedMETProducerT< T >::algorithm_, edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), and CorrectedMETProducerT< T >::token_.

71  : moduleLabel_(cfg.getParameter<std::string>("@module_label")),
72  algorithm_(0)
73  {
74  token_ = consumes<METCollection>(cfg.getParameter<edm::InputTag>("src"));
75 
77 
78  produces<METCollection>("");
79  }
T getParameter(std::string const &) const
edm::EDGetTokenT< METCollection > token_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
METCorrectionAlgorithm * algorithm_
template<typename T >
CorrectedMETProducerT< T >::~CorrectedMETProducerT ( )
inline

Definition at line 80 of file CorrectedMETProducerT.h.

References CorrectedMETProducerT< T >::algorithm_.

81  {
82  delete algorithm_;
83  }
METCorrectionAlgorithm * algorithm_

Member Function Documentation

template<typename T >
void CorrectedMETProducerT< T >::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineprivatevirtual

Implements edm::EDProducer.

Definition at line 87 of file CorrectedMETProducerT.h.

References CorrectedMETProducerT< T >::algorithm_, METCorrectionAlgorithm::compMETCorrection(), edm::Event::getByToken(), edm::Event::put(), and CorrectedMETProducerT< T >::token_.

88  {
89  std::auto_ptr<METCollection> correctedMEtCollection(new METCollection);
90 
91  edm::Handle<METCollection> rawMEtCollection;
92  evt.getByToken(token_, rawMEtCollection);
93 
94  for ( typename METCollection::const_iterator rawMEt = rawMEtCollection->begin();
95  rawMEt != rawMEtCollection->end(); ++rawMEt ) {
96  CorrMETData correction = algorithm_->compMETCorrection(evt, es);
97 
99  T correctedMEt = correctedMET_factory(*rawMEt, correction);
100 
101  correctedMEtCollection->push_back(correctedMEt);
102  }
103 
104 //--- add collection of MET objects with Type 1 / Type 1 + 2 corrections applied to the event
105  evt.put(correctedMEtCollection);
106  }
CorrMETData compMETCorrection(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< METCollection > token_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
Collection of MET.
a MET correction term
Definition: CorrMETData.h:14
long double T
METCorrectionAlgorithm * algorithm_

Member Data Documentation

template<typename T >
METCorrectionAlgorithm* CorrectedMETProducerT< T >::algorithm_
private
template<typename T >
std::string CorrectedMETProducerT< T >::moduleLabel_
private
template<typename T >
edm::EDGetTokenT<METCollection> CorrectedMETProducerT< T >::token_
private