Gaudi Framework, version v23r6
Home
Generated: Wed Jan 30 2013
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiAlg
src
lib
EventCounter.cpp
Go to the documentation of this file.
1
//$Id: EventCounter.cpp,v 1.1 2004/07/12 13:39:20 mato Exp $
2
#include "
GaudiAlg/EventCounter.h
"
3
#include "
GaudiKernel/MsgStream.h
"
4
#include "
GaudiKernel/AlgFactory.h
"
5
9
EventCounter::EventCounter
(
const
std::string
& name,
ISvcLocator
* pSvcLocator) :
10
Algorithm
(name, pSvcLocator),
11
m_skip ( 0 ),
12
m_total( 0 )
13
{
14
declareProperty
(
"Frequency"
,
m_frequency
=1 );
15
m_frequency
.
verifier
().setBounds( 0, 1000 );
16
}
17
21
EventCounter::~EventCounter
( )
22
{
23
}
24
25
StatusCode
26
EventCounter::initialize
()
27
{
28
MsgStream
log
(
msgSvc
(),
name
());
29
log <<
MSG::INFO
<<
name
( ) <<
":EventCounter::initialize - Frequency: "
<<
m_frequency
<<
endmsg
;
30
return
StatusCode::SUCCESS
;
31
}
32
33
StatusCode
34
EventCounter::execute
()
35
{
36
MsgStream
log
(
msgSvc
(),
name
());
37
m_total
++;
38
int
freq =
m_frequency
;
39
if
( freq > 0 ) {
40
m_skip
++;
41
if
(
m_skip
>= freq ) {
42
log <<
MSG::INFO
<<
name
( ) <<
":EventCounter::execute - seen events: "
<<
m_total
<<
endmsg
;
43
m_skip
= 0;
44
}
45
}
46
return
StatusCode::SUCCESS
;
47
}
48
49
StatusCode
50
EventCounter::finalize
()
51
{
52
MsgStream
log
(
msgSvc
(),
name
());
53
log <<
MSG::INFO
<<
name
( ) <<
":EventCounter::finalize - total events: "
<<
m_total
<<
endmsg
;
54
return
StatusCode::SUCCESS
;
55
}
Generated at Wed Jan 30 2013 17:13:37 for Gaudi Framework, version v23r6 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004