CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 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
 

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

Member Typedef Documentation

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

Definition at line 55 of file CorrectedPFMETProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 27 of file CorrectedPFMETProducer.cc.

References corrector, edm::ParameterSet::getParameter(), beam_dqm_sourceclient-live_cfg::inputTag, and AddCorrectionsToGenericMET::setCorTokens().

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

Definition at line 41 of file CorrectedPFMETProducer.cc.

41 {}

Member Function Documentation

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

Definition at line 43 of file CorrectedPFMETProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

43  {
45  desc.add<edm::InputTag>("src", edm::InputTag("pfMet", ""));
46  std::vector<edm::InputTag> tmpv;
47  tmpv.push_back(edm::InputTag("corrPfMetType1", "type1"));
48  desc.add<std::vector<edm::InputTag> >("srcCorrections", tmpv);
49  descriptions.add(defaultModuleLabel<CorrectedPFMETProducer>(), desc);
50  }
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 59 of file CorrectedPFMETProducer.cc.

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

59  {
60  edm::Handle<METCollection> srcMETCollection;
61  evt.getByToken(token_, srcMETCollection);
62 
63  const reco::PFMET& srcMET = (*srcMETCollection)[0];
64 
65  reco::PFMET outMET = corrector.getCorrectedPFMET(srcMET, evt);
66 
67  std::unique_ptr<METCollection> product(new METCollection);
68  product->push_back(outMET);
69  evt.put(std::move(product));
70  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
AddCorrectionsToGenericMET corrector
def move
Definition: eostools.py:511
Collection of MET.
reco::PFMET getCorrectedPFMET(const reco::PFMET &srcMET, edm::Event &evt)
edm::EDGetTokenT< METCollection > token_

Member Data Documentation

AddCorrectionsToGenericMET CorrectedPFMETProducer::corrector
private

Definition at line 53 of file CorrectedPFMETProducer.cc.

Referenced by CorrectedPFMETProducer(), and produce().

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

Definition at line 57 of file CorrectedPFMETProducer.cc.

Referenced by produce().