BOSS 6.6.4.p01
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 22 of file RunEventNumber.cxx.

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

Member Function Documentation

◆ execute()

StatusCode RunEventNumber::execute ( )

Definition at line 47 of file RunEventNumber.cxx.

47 {
48
49 MsgStream log(msgSvc(), name());
50 log << MSG::INFO << "in execute()" << endreq;
51
52 numEvents++;
53
54 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
55 int runNum=eventHeader->runNumber();
56 int eventNum=eventHeader->eventNumber();
57
58 if(runNum != prevRun) {
59 numRuns++;
60 prevRun = runNum;
61 }
62
63 if((m_period != 0)&&(numEvents % m_period == 0)) {
64 time ( &rawtime );
65 std::cout << " RunEventNumberAlg: Run, event, time = "
66 << runNum << ", " << eventNum << ", " << asctime(localtime(&rawtime));
67 }
68
69 return StatusCode::SUCCESS;
70}
Double_t time
time_t rawtime
IMessageSvc * msgSvc()

◆ finalize()

StatusCode RunEventNumber::finalize ( )

Definition at line 74 of file RunEventNumber.cxx.

74 {
75
76 MsgStream log(msgSvc(), name());
77 log << MSG::INFO << "in finalize()" << endmsg;
78
79 std::cout << std::endl;
80 std::cout << " RunEventNumberAlg: Number of processed runs = " << numRuns << std::endl;
81 std::cout << " RunEventNumberAlg: Number of processed events = " << numEvents << std::endl;
82 std::cout << std::endl;
83
84 return StatusCode::SUCCESS;
85}

◆ initialize()

StatusCode RunEventNumber::initialize ( )

Definition at line 31 of file RunEventNumber.cxx.

31 {
32 MsgStream log(msgSvc(), name());
33
34 log << MSG::INFO << "in initialize()" << endmsg;
35 StatusCode sc;
36
37 numEvents = 0;
38 numRuns = 0;
39 prevRun = 0;
40
41 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
42 return StatusCode::SUCCESS;
43
44}

The documentation for this class was generated from the following files: