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 () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchLuminosityBlocks, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &, const edm::EventSetup &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, const edm::EventSetup &) override
 
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
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::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 28 of file EventCountProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 48 of file EventCountProducer.cc.

48  {
49  produces<edm::MergeableCounter, edm::Transition::EndLuminosityBlock>();
50 }
EventCountProducer::~EventCountProducer ( )
override

Definition at line 52 of file EventCountProducer.cc.

52 {}

Member Function Documentation

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

Definition at line 59 of file EventCountProducer.cc.

References eventsProcessedInLumi_.

59  {
61  return;
62 }
unsigned int eventsProcessedInLumi_
void EventCountProducer::endLuminosityBlock ( edm::LuminosityBlock const &  theLuminosityBlock,
const edm::EventSetup theSetup 
)
overrideprivate

Definition at line 64 of file EventCountProducer.cc.

64 {}
void EventCountProducer::endLuminosityBlockProduce ( edm::LuminosityBlock theLuminosityBlock,
const edm::EventSetup theSetup 
)
overrideprivate

Definition at line 66 of file EventCountProducer.cc.

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

66  {
67  LogTrace("EventCounting") << "endLumi: adding " << eventsProcessedInLumi_ << " events" << endl;
68 
69  unique_ptr<edm::MergeableCounter> numEventsPtr(new edm::MergeableCounter);
70  numEventsPtr->value = eventsProcessedInLumi_;
71  theLuminosityBlock.put(std::move(numEventsPtr));
72 
73  return;
74 }
unsigned int eventsProcessedInLumi_
void put(std::unique_ptr< PROD > product)
Put a new product.
#define LogTrace(id)
def move(src, dest)
Definition: eostools.py:511
void EventCountProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Member Data Documentation

unsigned int EventCountProducer::eventsProcessedInLumi_
private

Definition at line 42 of file EventCountProducer.cc.

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