CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
CorrectedMETProducerT< T > Class Template Reference

#include <CorrectedMETProducerT.h>

Inheritance diagram for CorrectedMETProducerT< T >:
edm::stream::EDProducer<>

Public Member Functions

 CorrectedMETProducerT (const edm::ParameterSet &cfg)
 
 ~CorrectedMETProducerT ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

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::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

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 68 of file CorrectedMETProducerT.h.

Member Typedef Documentation

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

Definition at line 70 of file CorrectedMETProducerT.h.

Constructor & Destructor Documentation

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

Definition at line 74 of file CorrectedMETProducerT.h.

References edm::ParameterSet::getParameter().

75  : moduleLabel_(cfg.getParameter<std::string>("@module_label")),
76  algorithm_(0)
77  {
78  token_ = consumes<METCollection>(cfg.getParameter<edm::InputTag>("src"));
79 
80  algorithm_ = new METCorrectionAlgorithm(cfg, consumesCollector());
81 
82  produces<METCollection>("");
83  }
T getParameter(std::string const &) const
edm::EDGetTokenT< METCollection > token_
METCorrectionAlgorithm * algorithm_
template<typename T >
CorrectedMETProducerT< T >::~CorrectedMETProducerT ( )
inline

Definition at line 84 of file CorrectedMETProducerT.h.

85  {
86  delete algorithm_;
87  }
METCorrectionAlgorithm * algorithm_

Member Function Documentation

template<typename T >
static void CorrectedMETProducerT< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 89 of file CorrectedMETProducerT.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and defaultModuleLabel().

89  {
91  desc.add<edm::InputTag>("src",edm::InputTag("corrPfMetType1", "type1"));
92  descriptions.add(defaultModuleLabel<CorrectedMETProducerT<T> >(),desc);
93  }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
void CorrectedMETProducerT< T >::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineprivate

Definition at line 97 of file CorrectedMETProducerT.h.

References edm::Event::getByToken(), eostools::move(), and edm::Event::put().

98  {
99  std::unique_ptr<METCollection> correctedMEtCollection(new METCollection);
100 
101  edm::Handle<METCollection> rawMEtCollection;
102  evt.getByToken(token_, rawMEtCollection);
103 
104  for ( typename METCollection::const_iterator rawMEt = rawMEtCollection->begin();
105  rawMEt != rawMEtCollection->end(); ++rawMEt ) {
106  CorrMETData correction = algorithm_->compMETCorrection(evt, es);
107 
108  static const CorrectedMETProducer_namespace::CorrectedMETFactoryT<T> correctedMET_factory {};
109  T correctedMEt = correctedMET_factory(*rawMEt, correction);
110 
111  correctedMEtCollection->push_back(correctedMEt);
112  }
113 
114 //--- add collection of MET objects with Type 1 / Type 1 + 2 corrections applied to the event
115  evt.put(std::move(correctedMEtCollection));
116  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
CorrMETData compMETCorrection(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< METCollection > token_
Collection of MET.
a MET correction term
Definition: CorrMETData.h:14
long double T
METCorrectionAlgorithm * algorithm_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<typename T >
METCorrectionAlgorithm* CorrectedMETProducerT< T >::algorithm_
private

Definition at line 122 of file CorrectedMETProducerT.h.

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

Definition at line 120 of file CorrectedMETProducerT.h.