CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FixedGridRhoProducer Class Reference

#include <FixedGridRhoProducer.h>

Inheritance diagram for FixedGridRhoProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 FixedGridRhoProducer (const edm::ParameterSet &iConfig)
 
 ~FixedGridRhoProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

FixedGridEnergyDensityalgo
 
edm::EDGetTokenT< reco::PFCandidateCollectioninput_pfcoll_token_
 
FixedGridEnergyDensity::EtaRegion myEtaRegion
 
edm::InputTag pfCandidatesTag_
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 9 of file FixedGridRhoProducer.h.

Constructor & Destructor Documentation

FixedGridRhoProducer::FixedGridRhoProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 7 of file FixedGridRhoProducer.cc.

References FixedGridEnergyDensity::All, FixedGridEnergyDensity::Central, FixedGridEnergyDensity::Forward, and edm::ParameterSet::getParameter().

7  {
8  pfCandidatesTag_ = iConfig.getParameter<edm::InputTag>("pfCandidatesTag");
9  string etaRegion = iConfig.getParameter<string>("EtaRegion");
10  if (etaRegion=="Central") myEtaRegion = FixedGridEnergyDensity::Central;
11  else if (etaRegion=="Forward") myEtaRegion = FixedGridEnergyDensity::Forward;
12  else if (etaRegion=="All") myEtaRegion = FixedGridEnergyDensity::All;
13  else {
14  edm::LogWarning("FixedGridRhoProducer") << "Wrong EtaRegion parameter: " << etaRegion << ". Using EtaRegion = Central";
16  }
17  produces<double>();
18 
19  input_pfcoll_token_ = consumes<reco::PFCandidateCollection>(pfCandidatesTag_);
20 
21 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFCandidateCollection > input_pfcoll_token_
edm::InputTag pfCandidatesTag_
FixedGridEnergyDensity::EtaRegion myEtaRegion
FixedGridRhoProducer::~FixedGridRhoProducer ( )
override

Definition at line 23 of file FixedGridRhoProducer.cc.

23 {}

Member Function Documentation

void FixedGridRhoProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 25 of file FixedGridRhoProducer.cc.

References patPFMETCorrections_cff::algo, DEFINE_FWK_MODULE, edm::Event::getByToken(), edm::Handle< T >::product(), edm::Event::put(), and mps_fire::result.

25  {
26 
28  iEvent.getByToken(input_pfcoll_token_, pfColl);
29 
30  algo = new FixedGridEnergyDensity(pfColl.product());
31 
33  iEvent.put(std::make_unique<double>(result));
34 
35  delete algo;
36 
37 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
edm::EDGetTokenT< reco::PFCandidateCollection > input_pfcoll_token_
FixedGridEnergyDensity * algo
T const * product() const
Definition: Handle.h:81
float fixedGridRho(EtaRegion etaRegion=Central)
FixedGridEnergyDensity::EtaRegion myEtaRegion

Member Data Documentation

FixedGridEnergyDensity* FixedGridRhoProducer::algo
private

Definition at line 20 of file FixedGridRhoProducer.h.

edm::EDGetTokenT<reco::PFCandidateCollection> FixedGridRhoProducer::input_pfcoll_token_
private

Definition at line 22 of file FixedGridRhoProducer.h.

FixedGridEnergyDensity::EtaRegion FixedGridRhoProducer::myEtaRegion
private

Definition at line 19 of file FixedGridRhoProducer.h.

edm::InputTag FixedGridRhoProducer::pfCandidatesTag_
private

Definition at line 18 of file FixedGridRhoProducer.h.