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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Member Functions

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

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 53 of file EventCountProducer.cc.

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

Definition at line 58 of file EventCountProducer.cc.

{}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 69 of file EventCountProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 76 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 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 62 of file EventCountProducer.cc.

                                                                        {
  eventsProcessedInLumi_++;
  return;
}

Member Data Documentation

Definition at line 42 of file EventCountProducer.cc.