CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CorrectedCaloMETProducer Class Reference
Inheritance diagram for CorrectedCaloMETProducer:
edm::stream::EDProducer<>

Public Member Functions

 CorrectedCaloMETProducer (const edm::ParameterSet &cfg)
 
 ~CorrectedCaloMETProducer () override
 
- 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
 

Private Types

typedef std::vector< reco::CaloMETMETCollection
 

Private Member Functions

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

Private Attributes

AddCorrectionsToGenericMET corrector
 
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

Definition at line 21 of file CorrectedCaloMETProducer.cc.

Member Typedef Documentation

◆ METCollection

Definition at line 42 of file CorrectedCaloMETProducer.cc.

Constructor & Destructor Documentation

◆ CorrectedCaloMETProducer()

CorrectedCaloMETProducer::CorrectedCaloMETProducer ( const edm::ParameterSet cfg)
inlineexplicit

Definition at line 23 of file CorrectedCaloMETProducer.cc.

References looper::cfg, corrector, SimL1EmulatorRepack_Full_cff::inputTag, and AddCorrectionsToGenericMET::setCorTokens().

24  : corrector(), token_(consumes<METCollection>(cfg.getParameter<edm::InputTag>("src"))) {
25  std::vector<edm::InputTag> corrInputTags = cfg.getParameter<std::vector<edm::InputTag> >("srcCorrections");
26  std::vector<edm::EDGetTokenT<CorrMETData> > corrTokens;
27  for (std::vector<edm::InputTag>::const_iterator inputTag = corrInputTags.begin(); inputTag != corrInputTags.end();
28  ++inputTag) {
29  corrTokens.push_back(consumes<CorrMETData>(*inputTag));
30  }
31 
32  corrector.setCorTokens(corrTokens);
33 
34  produces<METCollection>("");
35  }
edm::EDGetTokenT< METCollection > token_
AddCorrectionsToGenericMET corrector
void setCorTokens(std::vector< edm::EDGetTokenT< CorrMETData > > const &corrTokens)

◆ ~CorrectedCaloMETProducer()

CorrectedCaloMETProducer::~CorrectedCaloMETProducer ( )
inlineoverride

Definition at line 37 of file CorrectedCaloMETProducer.cc.

37 {}

Member Function Documentation

◆ produce()

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

Definition at line 46 of file CorrectedCaloMETProducer.cc.

References corrector, edm::Event::getByToken(), AddCorrectionsToGenericMET::getCorrectedCaloMET(), eostools::move(), edm::Event::put(), correctionTermsCaloMet_cff::srcMET, and token_.

46  {
47  edm::Handle<METCollection> srcMETCollection;
48  evt.getByToken(token_, srcMETCollection);
49 
50  const reco::CaloMET& srcMET = (*srcMETCollection)[0];
51 
53 
54  std::unique_ptr<METCollection> product(new METCollection);
55  product->push_back(outMET);
56  evt.put(std::move(product));
57  }
edm::EDGetTokenT< METCollection > token_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
AddCorrectionsToGenericMET corrector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:536
Collection of MET.
reco::CaloMET getCorrectedCaloMET(const reco::CaloMET &srcMET, edm::Event &evt)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ corrector

AddCorrectionsToGenericMET CorrectedCaloMETProducer::corrector
private

Definition at line 40 of file CorrectedCaloMETProducer.cc.

Referenced by CorrectedCaloMETProducer(), and produce().

◆ token_

edm::EDGetTokenT<METCollection> CorrectedCaloMETProducer::token_
private

Definition at line 44 of file CorrectedCaloMETProducer.cc.

Referenced by produce().