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::ProductRegistryHelper

Public Member Functions

 CorrectedMETProducerT (const edm::ParameterSet &cfg)
 
 ~CorrectedMETProducerT ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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::InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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
Version
Revision:
1.4
Id:
CorrectedMETProducerT.h,v 1.4 2011/09/16 08:05:48 veelken Exp

Definition at line 65 of file CorrectedMETProducerT.h.

Member Typedef Documentation

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

Definition at line 67 of file CorrectedMETProducerT.h.

Constructor & Destructor Documentation

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

Definition at line 71 of file CorrectedMETProducerT.h.

References CorrectedMETProducerT< T >::algorithm_, edm::ParameterSet::getParameter(), and CorrectedMETProducerT< T >::src_.

72  : moduleLabel_(cfg.getParameter<std::string>("@module_label")),
73  algorithm_(0)
74  {
75  src_ = cfg.getParameter<edm::InputTag>("src");
76 
78 
79  produces<METCollection>("");
80  }
T getParameter(std::string const &) const
METCorrectionAlgorithm * algorithm_
template<typename T >
CorrectedMETProducerT< T >::~CorrectedMETProducerT ( )
inline

Definition at line 81 of file CorrectedMETProducerT.h.

References CorrectedMETProducerT< T >::algorithm_.

82  {
83  delete algorithm_;
84  }
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 88 of file CorrectedMETProducerT.h.

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

89  {
90  std::auto_ptr<METCollection> correctedMEtCollection(new METCollection);
91 
92  edm::Handle<METCollection> rawMEtCollection;
93  evt.getByLabel(src_, rawMEtCollection);
94 
95  for ( typename METCollection::const_iterator rawMEt = rawMEtCollection->begin();
96  rawMEt != rawMEtCollection->end(); ++rawMEt ) {
97  CorrMETData correction = algorithm_->compMETCorrection(evt, es);
98 
100  T correctedMEt = correctedMET_factory(*rawMEt, correction);
101 
102  correctedMEtCollection->push_back(correctedMEt);
103  }
104 
105 //--- add collection of MET objects with Type 1 / Type 1 + 2 corrections applied to the event
106  evt.put(correctedMEtCollection);
107  }
CorrMETData compMETCorrection(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
Collection of MET.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
Structure containing data common to all types of MET.
Definition: CorrMETData.h:20
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::InputTag CorrectedMETProducerT< T >::src_
private