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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 62 of file CorrectedMETProducerT.h.

Member Typedef Documentation

◆ METCollection

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

Definition at line 63 of file CorrectedMETProducerT.h.

Constructor & Destructor Documentation

◆ CorrectedMETProducerT()

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

Definition at line 66 of file CorrectedMETProducerT.h.

67  : moduleLabel_(cfg.getParameter<std::string>("@module_label")), algorithm_(0) {
68  token_ = consumes<METCollection>(cfg.getParameter<edm::InputTag>("src"));
69 
70  algorithm_ = new METCorrectionAlgorithm(cfg, consumesCollector());
71 
72  produces<METCollection>("");
73  }

References CorrectedMETProducerT< T >::algorithm_, looper::cfg, and CorrectedMETProducerT< T >::token_.

◆ ~CorrectedMETProducerT()

template<typename T >
CorrectedMETProducerT< T >::~CorrectedMETProducerT ( )
inline

Definition at line 74 of file CorrectedMETProducerT.h.

74 { delete algorithm_; }

References CorrectedMETProducerT< T >::algorithm_.

Member Function Documentation

◆ fillDescriptions()

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

◆ produce()

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

Definition at line 83 of file CorrectedMETProducerT.h.

83  {
84  std::unique_ptr<METCollection> correctedMEtCollection(new METCollection);
85 
86  edm::Handle<METCollection> rawMEtCollection;
87  evt.getByToken(token_, rawMEtCollection);
88 
89  for (typename METCollection::const_iterator rawMEt = rawMEtCollection->begin(); rawMEt != rawMEtCollection->end();
90  ++rawMEt) {
92 
93  static const CorrectedMETProducer_namespace::CorrectedMETFactoryT<T> correctedMET_factory{};
94  T correctedMEt = correctedMET_factory(*rawMEt, correction);
95 
96  correctedMEtCollection->push_back(correctedMEt);
97  }
98 
99  //--- add collection of MET objects with Type 1 / Type 1 + 2 corrections applied to the event
100  evt.put(std::move(correctedMEtCollection));
101  }

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

Member Data Documentation

◆ algorithm_

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

◆ moduleLabel_

template<typename T >
std::string CorrectedMETProducerT< T >::moduleLabel_
private

◆ token_

template<typename T >
edm::EDGetTokenT<METCollection> CorrectedMETProducerT< T >::token_
private
CorrectedMETProducerT::moduleLabel_
std::string moduleLabel_
Definition: CorrectedMETProducerT.h:103
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
CorrectedMETProducerT::algorithm_
METCorrectionAlgorithm * algorithm_
Definition: CorrectedMETProducerT.h:107
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
CorrectedMETProducerT
Definition: CorrectedMETProducerT.h:62
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CorrMETData
a MET correction term
Definition: CorrMETData.h:14
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
pfMETCorrectionType0_cfi.correction
correction
Definition: pfMETCorrectionType0_cfi.py:39
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
T
long double T
Definition: Basic3DVectorLD.h:48
METCollection
Collection of MET.
CorrectedMETProducer_namespace::CorrectedMETFactoryT
Definition: CorrectedMETProducerT.h:53
METCorrectionAlgorithm::compMETCorrection
CorrMETData compMETCorrection(edm::Event &)
Definition: METCorrectionAlgorithm.cc:71
CorrectedMETProducerT::token_
edm::EDGetTokenT< METCollection > token_
Definition: CorrectedMETProducerT.h:105
METCorrectionAlgorithm
Definition: METCorrectionAlgorithm.h:32
edm::InputTag
Definition: InputTag.h:15