BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RunEventNumber Class Reference

#include <RunEventNumber.h>

+ Inheritance diagram for RunEventNumber:

Public Member Functions

 RunEventNumber (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Definition at line 11 of file RunEventNumber.h.

Constructor & Destructor Documentation

◆ RunEventNumber()

RunEventNumber::RunEventNumber ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 23 of file RunEventNumber.cxx.

23 :
24 Algorithm(name, pSvcLocator) {
25
26 //Declare the properties
27 declareProperty("Period", m_period = 0);
28
29}

Member Function Documentation

◆ 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)) {
65 time ( &rawtime );
66 std::cout << " RunEventNumberAlg: Run, event, time = "
67 << runNum << ", " << eventNum << ", " << asctime(localtime(&rawtime));
68 }
69
70 return StatusCode::SUCCESS;
71}
Double_t time
time_t rawtime
IMessageSvc * msgSvc()

◆ 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: