ATLAS Offline Software
Loading...
Searching...
No Matches
AthEventCounter.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// AthEventCounter.cxx
8// Implementation file for class AthEventCounter
9// Author: S.Binet<binet@cern.ch>
11
12#include "AthEventCounter.h"
13#include <cstdlib>
14
15StatusCode
17{
18 ATH_MSG_INFO ("initialize ==> Frequency: " << m_frequency);
19 return StatusCode::SUCCESS;
20}
21
22StatusCode
23AthEventCounter::execute(const EventContext& ) const
24{
25 int currTotal=(m_total++);
26 if (m_frequency==0) {
27 return StatusCode::SUCCESS;
28 }
29
30 int rem=std::div(currTotal,m_frequency).rem;
31
32 if (rem==0) {
33 ATH_MSG_INFO ("execute ==> seen events: " << currTotal);
34 }
35 return StatusCode::SUCCESS;
36}
37
38StatusCode
40{
41 ATH_MSG_INFO ("finalize ==> total events: " << m_total);
42 return StatusCode::SUCCESS;
43}
#define ATH_MSG_INFO(x)
Gaudi::Property< int > m_frequency
The frequency with which the number of events should be reported.
StatusCode initialize()
StatusCode finalize()
StatusCode execute(const EventContext &ctx) const
std::atomic< int > m_total
The total events seen.