Gaudi Framework, version v25r2

Home   Generated: Wed Jun 4 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EventCounter.cpp
Go to the documentation of this file.
3 
7 EventCounter::EventCounter(const std::string& name, ISvcLocator* pSvcLocator) :
8  Algorithm(name, pSvcLocator),
9  m_skip ( 0 ),
10  m_total( 0 )
11 {
12  declareProperty( "Frequency", m_frequency=1 );
13  m_frequency.verifier().setBounds( 0, 1000 );
14 }
15 
20 {
21 }
22 
25 {
26  MsgStream log(msgSvc(), name());
27  log << MSG::INFO << name( ) << ":EventCounter::initialize - Frequency: " << m_frequency << endmsg;
28  return StatusCode::SUCCESS;
29 }
30 
33 {
34  MsgStream log(msgSvc(), name());
35  m_total++;
36  int freq = m_frequency;
37  if ( freq > 0 ) {
38  m_skip++;
39  if ( m_skip >= freq ) {
40  log << MSG::INFO << name( ) << ":EventCounter::execute - seen events: " << m_total << endmsg;
41  m_skip = 0;
42  }
43  }
44  return StatusCode::SUCCESS;
45 }
46 
49 {
50  MsgStream log(msgSvc(), name());
51  log << MSG::INFO << name( ) << ":EventCounter::finalize - total events: " << m_total << endmsg;
52  return StatusCode::SUCCESS;
53 }

Generated at Wed Jun 4 2014 14:48:55 for Gaudi Framework, version v25r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004