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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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

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.

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  }

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

◆ ~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.

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  }

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

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().

CorrectedCaloMETProducer::corrector
AddCorrectionsToGenericMET corrector
Definition: CorrectedCaloMETProducer.cc:40
CorrectedCaloMETProducer::token_
edm::EDGetTokenT< METCollection > token_
Definition: CorrectedCaloMETProducer.cc:44
AddCorrectionsToGenericMET::getCorrectedCaloMET
reco::CaloMET getCorrectedCaloMET(const reco::CaloMET &srcMET, edm::Event &evt, const edm::EventSetup &es)
Definition: AddCorrectionsToGenericMET.cc:53
AddCorrectionsToGenericMET::setCorTokens
void setCorTokens(std::vector< edm::EDGetTokenT< CorrMETData > > const &corrTokens)
Definition: AddCorrectionsToGenericMET.cc:3
edm::Handle
Definition: AssociativeIterator.h:50
reco::CaloMET
Definition: CaloMET.h:21
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
looper.cfg
cfg
Definition: looper.py:297
eostools.move
def move(src, dest)
Definition: eostools.py:511
correctionTermsCaloMet_cff.srcMET
srcMET
Definition: correctionTermsCaloMet_cff.py:14
METCollection
Collection of MET.
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
edm::InputTag
Definition: InputTag.h:15