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

◆ METCollection

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

Definition at line 55 of file CorrectedPFMETProducer.cc.

Constructor & Destructor Documentation

◆ CorrectedPFMETProducer()

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

Definition at line 27 of file CorrectedPFMETProducer.cc.

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  }

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

◆ ~CorrectedPFMETProducer()

CorrectedPFMETProducer::~CorrectedPFMETProducer ( )
inlineoverride

Definition at line 41 of file CorrectedPFMETProducer.cc.

41 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 43 of file CorrectedPFMETProducer.cc.

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  }

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

◆ produce()

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

Definition at line 59 of file CorrectedPFMETProducer.cc.

59  {
60  edm::Handle<METCollection> srcMETCollection;
61  evt.getByToken(token_, srcMETCollection);
62 
63  const reco::PFMET& srcMET = (*srcMETCollection)[0];
64 
66 
67  std::unique_ptr<METCollection> product(new METCollection);
68  product->push_back(outMET);
69  evt.put(std::move(product));
70  }

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

Member Data Documentation

◆ corrector

AddCorrectionsToGenericMET CorrectedPFMETProducer::corrector
private

Definition at line 53 of file CorrectedPFMETProducer.cc.

Referenced by CorrectedPFMETProducer(), and produce().

◆ token_

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

Definition at line 57 of file CorrectedPFMETProducer.cc.

Referenced by produce().

CorrectedPFMETProducer::token_
edm::EDGetTokenT< METCollection > token_
Definition: CorrectedPFMETProducer.cc:57
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
AddCorrectionsToGenericMET::setCorTokens
void setCorTokens(std::vector< edm::EDGetTokenT< CorrMETData > > const &corrTokens)
Definition: AddCorrectionsToGenericMET.cc:3
edm::Handle
Definition: AssociativeIterator.h:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CorrectedPFMETProducer::corrector
AddCorrectionsToGenericMET corrector
Definition: CorrectedPFMETProducer.cc:53
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
reco::PFMET
Definition: PFMET.h:18
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
looper.cfg
cfg
Definition: looper.py:297
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
AddCorrectionsToGenericMET::getCorrectedPFMET
reco::PFMET getCorrectedPFMET(const reco::PFMET &srcMET, edm::Event &evt)
Definition: AddCorrectionsToGenericMET.cc:36
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