CMS 3D CMS Logo

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

Public Member Functions

 CorrectedPFMETProducer (const edm::ParameterSet &cfg)
 
 ~CorrectedPFMETProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::vector< reco::PFMETMETCollection
 

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 25 of file CorrectedPFMETProducer.cc.

Member Typedef Documentation

typedef std::vector<reco::PFMET> CorrectedPFMETProducer::METCollection
private

Definition at line 60 of file CorrectedPFMETProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 30 of file CorrectedPFMETProducer.cc.

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

31  : corrector(),
32  token_(consumes<METCollection>(cfg.getParameter<edm::InputTag>("src")))
33  {
34  std::vector<edm::InputTag> corrInputTags = cfg.getParameter<std::vector<edm::InputTag> >("srcCorrections");
35  std::vector<edm::EDGetTokenT<CorrMETData> > corrTokens;
36  for (std::vector<edm::InputTag>::const_iterator inputTag = corrInputTags.begin(); inputTag != corrInputTags.end(); ++inputTag) {
37  corrTokens.push_back(consumes<CorrMETData>(*inputTag));
38  }
39 
40  corrector.setCorTokens(corrTokens);
41 
42  produces<METCollection>("");
43  }
T getParameter(std::string const &) const
AddCorrectionsToGenericMET corrector
edm::EDGetTokenT< METCollection > token_
void setCorTokens(std::vector< edm::EDGetTokenT< CorrMETData > > const &corrTokens)
CorrectedPFMETProducer::~CorrectedPFMETProducer ( )
inlineoverride

Definition at line 45 of file CorrectedPFMETProducer.cc.

45 { }

Member Function Documentation

static void CorrectedPFMETProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 47 of file CorrectedPFMETProducer.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

47  {
49  desc.add<edm::InputTag>("src",edm::InputTag("pfMet", ""));
50  std::vector<edm::InputTag> tmpv;
51  tmpv.push_back( edm::InputTag("corrPfMetType1", "type1") );
52  desc.add<std::vector<edm::InputTag> >("srcCorrections",tmpv);
53  descriptions.add(defaultModuleLabel<CorrectedPFMETProducer>(),desc);
54  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CorrectedPFMETProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverrideprivate

Definition at line 65 of file CorrectedPFMETProducer.cc.

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

66  {
67  edm::Handle<METCollection> srcMETCollection;
68  evt.getByToken(token_, srcMETCollection);
69 
70  const reco::PFMET& srcMET = (*srcMETCollection)[0];
71 
72  reco::PFMET outMET= corrector.getCorrectedPFMET(srcMET, evt, es);
73 
74  std::unique_ptr<METCollection> product(new METCollection);
75  product->push_back(outMET);
76  evt.put(std::move(product));
77  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
AddCorrectionsToGenericMET corrector
reco::PFMET getCorrectedPFMET(const reco::PFMET &srcMET, edm::Event &evt, const edm::EventSetup &es)
Collection of MET.
edm::EDGetTokenT< METCollection > token_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

AddCorrectionsToGenericMET CorrectedPFMETProducer::corrector
private

Definition at line 58 of file CorrectedPFMETProducer.cc.

Referenced by CorrectedPFMETProducer().

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

Definition at line 62 of file CorrectedPFMETProducer.cc.