#include <EventCounter.h>
Inheritance diagram for EventCounter:
Public Types | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
Public Member Functions | |
EventCounter (const std::string &name, ISvcLocator *pSvcLocator) | |
Constructor(s). | |
~EventCounter () | |
Destructor. | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
virtual StatusCode | sysStart () |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart () |
virtual StatusCode | sysExecute () |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysBeginRun () |
virtual StatusCode | sysEndRun () |
virtual const std::string & | name () const |
virtual const std::string & | version () const |
virtual StatusCode | configure () |
virtual StatusCode | terminate () |
virtual StatusCode | start () |
virtual StatusCode | stop () |
virtual StatusCode | reinitialize () |
virtual StatusCode | restart () |
virtual bool | isExecuted () const |
virtual void | setExecuted (bool state) |
virtual void | resetExecuted () |
virtual StatusCode | beginRun () |
virtual StatusCode | endRun () |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual bool | isEnabled () const |
virtual bool | filterPassed () const |
virtual void | setFilterPassed (bool state) |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const |
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const |
void | setOutputLevel (int level) |
IAuditorSvc * | auditorSvc () const |
IChronoStatSvc * | chronoSvc () const |
IChronoStatSvc * | chronoStatService () const |
IDataProviderSvc * | detSvc () const |
IDataProviderSvc * | detDataService () const |
IConversionSvc * | detCnvSvc () const |
IConversionSvc * | detDataCnvService () const |
IDataProviderSvc * | eventSvc () const |
IDataProviderSvc * | evtSvc () const |
IDataProviderSvc * | eventDataService () const |
IConversionSvc * | eventCnvSvc () const |
IConversionSvc * | eventDataCnvService () const |
IHistogramSvc * | histoSvc () const |
IHistogramSvc * | histogramDataService () const |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () const |
INTupleSvc * | ntupleSvc () const |
INTupleSvc * | ntupleService () const |
IRndmGenSvc * | randSvc () const |
IToolSvc * | toolSvc () const |
IExceptionSvc * | exceptionSvc () const |
ISvcLocator * | serviceLocator () const |
ISvcLocator * | svcLoc () const |
StatusCode | createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg) |
std::vector< Algorithm * > * | subAlgorithms () const |
virtual StatusCode | setProperty (const Property &p) |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
virtual const std::vector< Property * > & | getProperties () const |
StatusCode | setProperties () |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
IMonitorSvc * | monitorSvc () const |
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
unsigned long | addRef () |
unsigned long | release () |
StatusCode | queryInterface (const InterfaceID &riid, void **) |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Member Functions | |
bool | isInitialized () const |
bool | isFinalized () const |
int | outputLevel () const |
IntegerProperty & | outputLevelProperty () |
void | initOutputLevel (Property &prop) |
Private Attributes | |
IntegerProperty | m_frequency |
The frequency with which the number of events should be reported. | |
int | m_skip |
The number of events skipped since the last time the count was reported. | |
int | m_total |
The total events seen. |
Definition at line 4 of file EventCounter.h.
EventCounter::EventCounter | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Constructor(s).
Definition at line 9 of file EventCounter.cpp.
00009 : 00010 Algorithm(name, pSvcLocator), 00011 m_skip ( 0 ), 00012 m_total( 0 ) 00013 { 00014 declareProperty( "Frequency", m_frequency=1 ); 00015 m_frequency.verifier().setBounds( 0, 1000 ); 00016 }
EventCounter::~EventCounter | ( | ) |
StatusCode EventCounter::initialize | ( | ) | [virtual] |
Reimplemented from Algorithm.
Definition at line 26 of file EventCounter.cpp.
00027 { 00028 MsgStream log(msgSvc(), name()); 00029 log << MSG::INFO << name( ) << ":EventCounter::initialize - Frequency: " << m_frequency << endreq; 00030 return StatusCode::SUCCESS; 00031 }
StatusCode EventCounter::execute | ( | ) | [virtual] |
Implements Algorithm.
Definition at line 34 of file EventCounter.cpp.
00035 { 00036 MsgStream log(msgSvc(), name()); 00037 m_total++; 00038 int freq = m_frequency; 00039 if ( freq > 0 ) { 00040 m_skip++; 00041 if ( m_skip >= freq ) { 00042 log << MSG::INFO << name( ) << ":EventCounter::execute - seen events: " << m_total << endreq; 00043 m_skip = 0; 00044 } 00045 } 00046 return StatusCode::SUCCESS; 00047 }
StatusCode EventCounter::finalize | ( | ) | [virtual] |
IntegerProperty EventCounter::m_frequency [private] |
The frequency with which the number of events should be reported.
The default is 1, corresponding to every event.
Definition at line 36 of file EventCounter.h.
int EventCounter::m_skip [private] |
The number of events skipped since the last time the count was reported.
Definition at line 42 of file EventCounter.h.
int EventCounter::m_total [private] |