BOSS 7.0.1
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 ()
 
 RunEventNumber (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Constructor & Destructor Documentation

◆ RunEventNumber() [1/2]

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}

◆ RunEventNumber() [2/2]

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

Member Function Documentation

◆ execute() [1/2]

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

◆ execute() [2/2]

StatusCode RunEventNumber::execute ( )

◆ finalize() [1/2]

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}

◆ finalize() [2/2]

StatusCode RunEventNumber::finalize ( )

◆ initialize() [1/2]

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}

◆ initialize() [2/2]

StatusCode RunEventNumber::initialize ( )

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