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

Definition at line 42 of file CorrectedCaloMETProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 23 of file CorrectedCaloMETProducer.cc.

References corrector, edm::ParameterSet::getParameter(), 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  }
T getParameter(std::string const &) const
edm::EDGetTokenT< METCollection > token_
AddCorrectionsToGenericMET corrector
void setCorTokens(std::vector< edm::EDGetTokenT< CorrMETData > > const &corrTokens)
CorrectedCaloMETProducer::~CorrectedCaloMETProducer ( )
inlineoverride

Definition at line 37 of file CorrectedCaloMETProducer.cc.

37 {}

Member Function Documentation

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

Definition at line 46 of file CorrectedCaloMETProducer.cc.

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

46  {
47  edm::Handle<METCollection> srcMETCollection;
48  evt.getByToken(token_, srcMETCollection);
49 
50  const reco::CaloMET& srcMET = (*srcMETCollection)[0];
51 
52  reco::CaloMET outMET = corrector.getCorrectedCaloMET(srcMET, evt, es);
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:131
AddCorrectionsToGenericMET corrector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
Collection of MET.
reco::CaloMET getCorrectedCaloMET(const reco::CaloMET &srcMET, edm::Event &evt, const edm::EventSetup &es)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

AddCorrectionsToGenericMET CorrectedCaloMETProducer::corrector
private

Definition at line 40 of file CorrectedCaloMETProducer.cc.

Referenced by CorrectedCaloMETProducer().

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

Definition at line 44 of file CorrectedCaloMETProducer.cc.