CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CorrectedPFMETProducer (const edm::ParameterSet &cfg)
 
 ~CorrectedPFMETProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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(), beam_dqm_sourceclient-live_cfg::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 ( )
inline

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(), edm::ParameterSetDescription::add(), and HLT_25ns10e33_v2_cff::InputTag.

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 
)
inlineoverrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 65 of file CorrectedPFMETProducer.cc.

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

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::auto_ptr<METCollection> product(new METCollection);
75  product->push_back(outMET);
76  evt.put(product);
77  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
AddCorrectionsToGenericMET corrector
reco::PFMET getCorrectedPFMET(const reco::PFMET &srcMET, edm::Event &evt, const edm::EventSetup &es)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
Collection of MET.
edm::EDGetTokenT< METCollection > token_

Member Data Documentation

AddCorrectionsToGenericMET CorrectedPFMETProducer::corrector
private

Definition at line 58 of file CorrectedPFMETProducer.cc.

Referenced by CorrectedPFMETProducer(), and produce().

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

Definition at line 62 of file CorrectedPFMETProducer.cc.

Referenced by produce().