CMS 3D CMS Logo

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

#include <CommonTools/UtilAlgos/plugins/EventCountProducer.cc>

Inheritance diagram for EventCountProducer:
edm::one::EDProducer< edm::one::WatchLuminosityBlocks, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EventCountProducer (const edm::ParameterSet &)
 
 ~EventCountProducer ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchLuminosityBlocks, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > 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

virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, const edm::EventSetup &) override
 
virtual void endLuminosityBlockProduce (edm::LuminosityBlock &, const edm::EventSetup &) override
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

unsigned int eventsProcessedInLumi_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase 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::one::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

Description: An event counter that can store the number of events in the lumi block

Definition at line 30 of file EventCountProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 55 of file EventCountProducer.cc.

55  {
56  produces<edm::MergeableCounter, edm::Transition::EndLuminosityBlock>();
57 }
EventCountProducer::~EventCountProducer ( )

Definition at line 60 of file EventCountProducer.cc.

60 {}

Member Function Documentation

void EventCountProducer::beginLuminosityBlock ( const edm::LuminosityBlock theLuminosityBlock,
const edm::EventSetup theSetup 
)
overrideprivatevirtual

Definition at line 71 of file EventCountProducer.cc.

References eventsProcessedInLumi_.

71  {
73  return;
74 }
unsigned int eventsProcessedInLumi_
void EventCountProducer::endLuminosityBlock ( edm::LuminosityBlock const &  theLuminosityBlock,
const edm::EventSetup theSetup 
)
overrideprivatevirtual

Definition at line 77 of file EventCountProducer.cc.

77  {
78 }
void EventCountProducer::endLuminosityBlockProduce ( edm::LuminosityBlock theLuminosityBlock,
const edm::EventSetup theSetup 
)
overrideprivatevirtual

Definition at line 81 of file EventCountProducer.cc.

References DEFINE_FWK_MODULE, eventsProcessedInLumi_, LogTrace, eostools::move(), and edm::LuminosityBlock::put().

81  {
82  LogTrace("EventCounting") << "endLumi: adding " << eventsProcessedInLumi_ << " events" << endl;
83 
84  unique_ptr<edm::MergeableCounter> numEventsPtr(new edm::MergeableCounter);
85  numEventsPtr->value = eventsProcessedInLumi_;
86  theLuminosityBlock.put(std::move(numEventsPtr));
87 
88  return;
89 }
unsigned int eventsProcessedInLumi_
void put(std::unique_ptr< PROD > product)
Put a new product.
#define LogTrace(id)
def move(src, dest)
Definition: eostools.py:510
void EventCountProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Member Data Documentation

unsigned int EventCountProducer::eventsProcessedInLumi_
private

Definition at line 44 of file EventCountProducer.cc.

Referenced by beginLuminosityBlock(), endLuminosityBlockProduce(), and produce().