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 | Private Member Functions | Private Attributes
FixedGridRhoProducer Class Reference

#include <FixedGridRhoProducer.h>

Inheritance diagram for FixedGridRhoProducer:
edm::stream::EDProducer<>

Public Member Functions

 FixedGridRhoProducer (const edm::ParameterSet &iConfig)
 
 ~FixedGridRhoProducer () 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
 

Private Member Functions

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

Private Attributes

FixedGridEnergyDensityalgo
 
edm::EDGetTokenT
< reco::PFCandidateCollection
input_pfcoll_token_
 
FixedGridEnergyDensity::EtaRegion myEtaRegion
 
edm::InputTag pfCandidatesTag_
 

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 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")
12  else if (etaRegion == "Forward")
14  else if (etaRegion == "All")
16  else {
17  edm::LogWarning("FixedGridRhoProducer")
18  << "Wrong EtaRegion parameter: " << etaRegion << ". Using EtaRegion = Central";
20  }
21  produces<double>();
22 
23  input_pfcoll_token_ = consumes<reco::PFCandidateCollection>(pfCandidatesTag_);
24 }
edm::EDGetTokenT< reco::PFCandidateCollection > input_pfcoll_token_
edm::InputTag pfCandidatesTag_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Log< level::Warning, false > LogWarning
FixedGridEnergyDensity::EtaRegion myEtaRegion
FixedGridRhoProducer::~FixedGridRhoProducer ( )
override

Definition at line 26 of file FixedGridRhoProducer.cc.

26 {}

Member Function Documentation

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

Definition at line 28 of file FixedGridRhoProducer.cc.

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

28  {
30  iEvent.getByToken(input_pfcoll_token_, pfColl);
31 
32  algo = new FixedGridEnergyDensity(pfColl.product());
33 
35  iEvent.put(std::make_unique<double>(result));
36 
37  delete algo;
38 }
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
edm::EDGetTokenT< reco::PFCandidateCollection > input_pfcoll_token_
tuple result
Definition: mps_fire.py:311
FixedGridEnergyDensity * algo
T const * product() const
Definition: Handle.h:70
float fixedGridRho(EtaRegion etaRegion=Central)
FixedGridEnergyDensity::EtaRegion myEtaRegion

Member Data Documentation

FixedGridEnergyDensity* FixedGridRhoProducer::algo
private

Definition at line 19 of file FixedGridRhoProducer.h.

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

Definition at line 21 of file FixedGridRhoProducer.h.

FixedGridEnergyDensity::EtaRegion FixedGridRhoProducer::myEtaRegion
private

Definition at line 18 of file FixedGridRhoProducer.h.

edm::InputTag FixedGridRhoProducer::pfCandidatesTag_
private

Definition at line 17 of file FixedGridRhoProducer.h.