CMS 3D CMS Logo

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 > Type edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 EventCountProducer (const edm::ParameterSet &)
 ~EventCountProducer ()

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_

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.

                                                                    {
  produces<edm::MergeableCounter, edm::InLumi>();
}
EventCountProducer::~EventCountProducer ( )

Definition at line 60 of file EventCountProducer.cc.

{}

Member Function Documentation

void EventCountProducer::beginLuminosityBlock ( const edm::LuminosityBlock theLuminosityBlock,
const edm::EventSetup theSetup 
) [override, private, virtual]

Definition at line 71 of file EventCountProducer.cc.

                                                                                                                {
  eventsProcessedInLumi_ = 0;
  return;
}
void EventCountProducer::endLuminosityBlock ( edm::LuminosityBlock const &  theLuminosityBlock,
const edm::EventSetup theSetup 
) [override, private, virtual]

Definition at line 77 of file EventCountProducer.cc.

                                                                                                             {
}
void EventCountProducer::endLuminosityBlockProduce ( edm::LuminosityBlock theLuminosityBlock,
const edm::EventSetup theSetup 
) [override, private, virtual]

Definition at line 81 of file EventCountProducer.cc.

References LogTrace, and edm::LuminosityBlock::put().

                                                                                                               {
  LogTrace("EventCounting") << "endLumi: adding " << eventsProcessedInLumi_ << " events" << endl;

  auto_ptr<edm::MergeableCounter> numEventsPtr(new edm::MergeableCounter);
  numEventsPtr->value = eventsProcessedInLumi_;
  theLuminosityBlock.put(numEventsPtr);

  return;
}
void EventCountProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [override, private, virtual]

Implements edm::one::EDProducerBase.

Definition at line 64 of file EventCountProducer.cc.

                                                                        {
  eventsProcessedInLumi_++;
  return;
}

Member Data Documentation

Definition at line 44 of file EventCountProducer.cc.