CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CorrectedPATMETProducer Class Reference
Inheritance diagram for CorrectedPATMETProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CorrectedPATMETProducer (const edm::ParameterSet &cfg)
 
 ~CorrectedPATMETProducer ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

Private Types

typedef std::vector< pat::METMETCollection
 

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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 22 of file CorrectedPATMETProducer.cc.

Member Typedef Documentation

typedef std::vector<pat::MET> CorrectedPATMETProducer::METCollection
private

Definition at line 48 of file CorrectedPATMETProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 27 of file CorrectedPATMETProducer.cc.

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

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

Definition at line 42 of file CorrectedPATMETProducer.cc.

42 { }

Member Function Documentation

void CorrectedPATMETProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 53 of file CorrectedPATMETProducer.cc.

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

54  {
55  edm::Handle<METCollection> srcMETCollection;
56  evt.getByToken(token_, srcMETCollection);
57 
58  const pat::MET& srcMET = (*srcMETCollection)[0];
59 
60  //dispatching to be sure we retrieve all the informations
61  reco::MET corrMET = corrector.getCorrectedMET(srcMET, evt, es);
62  pat::MET outMET(corrMET, srcMET);
63 
64  std::auto_ptr<METCollection> product(new METCollection);
65  product->push_back(outMET);
66  evt.put(product);
67  }
Analysis-level MET class.
Definition: MET.h:43
reco::MET getCorrectedMET(const reco::MET &srcMET, edm::Event &evt, const edm::EventSetup &es)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< METCollection > token_
AddCorrectionsToGenericMET corrector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
Definition: MET.h:42
Collection of MET.

Member Data Documentation

AddCorrectionsToGenericMET CorrectedPATMETProducer::corrector
private

Definition at line 46 of file CorrectedPATMETProducer.cc.

Referenced by CorrectedPATMETProducer(), and produce().

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

Definition at line 50 of file CorrectedPATMETProducer.cc.

Referenced by produce().