#include <RunEventNumber.h>
Definition at line 11 of file RunEventNumber.h.
◆ RunEventNumber()
RunEventNumber::RunEventNumber |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
Definition at line 23 of file RunEventNumber.cxx.
23 :
24 Algorithm(name, pSvcLocator) {
25
26
27 declareProperty("Period", m_period = 0);
28
29}
◆ execute()
StatusCode RunEventNumber::execute |
( |
| ) |
|
Definition at line 48 of file RunEventNumber.cxx.
48 {
49
50 MsgStream log(
msgSvc(), name());
51 log << MSG::INFO << "in execute()" << endreq;
52
53 numEvents++;
54
55 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
56 int runNum=eventHeader->runNumber();
57 int eventNum=eventHeader->eventNumber();
58
59 if(runNum != prevRun) {
60 numRuns++;
61 prevRun = runNum;
62 }
63
64 if((m_period != 0)&&(numEvents % m_period == 0)) {
66 std::cout << " RunEventNumberAlg: Run, event, time = "
67 << runNum <<
", " << eventNum <<
", " << asctime(localtime(&
rawtime));
68 }
69
70 return StatusCode::SUCCESS;
71}
◆ finalize()
StatusCode RunEventNumber::finalize |
( |
| ) |
|
Definition at line 75 of file RunEventNumber.cxx.
75 {
76
77 MsgStream log(
msgSvc(), name());
78 log << MSG::INFO << "in finalize()" << endmsg;
79
80 std::cout << std::endl;
81 std::cout << " RunEventNumberAlg: Number of processed runs = " << numRuns << std::endl;
82 std::cout << " RunEventNumberAlg: Number of processed events = " << numEvents << std::endl;
83 std::cout << std::endl;
84
85 return StatusCode::SUCCESS;
86}
◆ initialize()
StatusCode RunEventNumber::initialize |
( |
| ) |
|
Definition at line 32 of file RunEventNumber.cxx.
32 {
33 MsgStream log(
msgSvc(), name());
34
35 log << MSG::INFO << "in initialize()" << endmsg;
36 StatusCode sc;
37
38 numEvents = 0;
39 numRuns = 0;
40 prevRun = 0;
41
42 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
43 return StatusCode::SUCCESS;
44
45}
The documentation for this class was generated from the following files: