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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 47 of file CorrectedCaloMETProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 26 of file CorrectedCaloMETProducer.cc.

References corrector, edm::ParameterSet::getParameter(), HiClusterCompatibility_cfi::inputTag, and AddCorrectionsToGenericMET::setCorTokens().

27  : corrector(),
28  token_(consumes<METCollection>(cfg.getParameter<edm::InputTag>("src")))
29  {
30  std::vector<edm::InputTag> corrInputTags = cfg.getParameter<std::vector<edm::InputTag> >("srcCorrections");
31  std::vector<edm::EDGetTokenT<CorrMETData> > corrTokens;
32  for (std::vector<edm::InputTag>::const_iterator inputTag = corrInputTags.begin(); inputTag != corrInputTags.end(); ++inputTag) {
33  corrTokens.push_back(consumes<CorrMETData>(*inputTag));
34  }
35 
36  corrector.setCorTokens(corrTokens);
37 
38  produces<METCollection>("");
39  }
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 41 of file CorrectedCaloMETProducer.cc.

41 { }

Member Function Documentation

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

Definition at line 52 of file CorrectedCaloMETProducer.cc.

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

53  {
54  edm::Handle<METCollection> srcMETCollection;
55  evt.getByToken(token_, srcMETCollection);
56 
57  const reco::CaloMET& srcMET = (*srcMETCollection)[0];
58 
59  reco::CaloMET outMET = corrector.getCorrectedCaloMET(srcMET, evt, es);
60 
61  std::unique_ptr<METCollection> product(new METCollection);
62  product->push_back(outMET);
63  evt.put(std::move(product));
64  }
edm::EDGetTokenT< METCollection > token_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
AddCorrectionsToGenericMET corrector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
Collection of MET.
reco::CaloMET getCorrectedCaloMET(const reco::CaloMET &srcMET, edm::Event &evt, const edm::EventSetup &es)
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

AddCorrectionsToGenericMET CorrectedCaloMETProducer::corrector
private

Definition at line 45 of file CorrectedCaloMETProducer.cc.

Referenced by CorrectedCaloMETProducer().

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

Definition at line 49 of file CorrectedCaloMETProducer.cc.