CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
T0Dummy Class Reference

#include <T0Dummy.h>

+ Inheritance diagram for T0Dummy:

Public Member Functions

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

Detailed Description

Definition at line 7 of file InstallArea/include/T0Dummy/T0Dummy/T0Dummy.h.

Constructor & Destructor Documentation

◆ T0Dummy() [1/2]

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

Definition at line 19 of file T0Dummy.cxx.

19 :
20 Algorithm(name, pSvcLocator)
21{
22
23}

◆ T0Dummy() [2/2]

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

Member Function Documentation

◆ execute() [1/2]

StatusCode T0Dummy::execute ( )

Definition at line 33 of file T0Dummy.cxx.

33 {
34
35 MsgStream log(msgSvc(), name());
36 log << MSG::INFO << "in execute()" << endreq;
37
38 // Part 1: Get the event header, print out event and run number
39 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
40 if (!eventHeader) {
41 log << MSG::FATAL << "Could not find Event Header" << endreq;
42 return StatusCode::FAILURE;
43 }
44
45 int eventNo=eventHeader->eventNumber();
46 int runNo=eventHeader->runNumber();
47
48
49 if(runNo>0){
50 log<<MSG::FATAL<<" Run No:"<<runNo<<" > 0"<<endreq;
51 return StatusCode::FAILURE;
52 }
53
54 SmartDataPtr<Event::McParticleCol> mcParticleCol(eventSvc(),"/Event/MC/McParticleCol");
55 if(!mcParticleCol){
56 log<<MSG::FATAL<<"Could not retrieve McParticelCol"<<endreq;
57 return StatusCode::FAILURE;
58 }
59
60 double mcTestime=-999.;
61 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
62 for (;iter_mc != mcParticleCol->end(); iter_mc++){
63 if((*iter_mc)->primaryParticle()){
64 mcTestime=(*iter_mc)->initialPosition().t();
65 }
66 }
67
68 //clear RecEsTimeCol
69 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
70 DataObject *aRecEsTime;
71 eventSvc()->findObject("/Event/Recon/RecEsTimeCol",aRecEsTime);
72 if(aRecEsTime!=NULL){
73 dataManSvc->clearSubTree("/Event/Recon/RecEsTimeCol");
74 eventSvc()->unregisterObject("/Event/Recon/RecEsTimeCol");
75 }
76
77 // register event start time to TDS
78 RecEsTimeCol *aRecEsTimeCol = new RecEsTimeCol;
79 StatusCode sc = eventSvc()->registerObject("/Event/Recon/RecEsTimeCol", aRecEsTimeCol);
80 if(sc!=StatusCode::SUCCESS) {
81 log << MSG::ERROR << "Could not register RecEsTimeCol" << endreq;
82 return StatusCode::FAILURE;
83 }
84
85 RecEsTime *arecestime = new RecEsTime;
86 arecestime->setTest(mcTestime);
87 arecestime->setStat(-999);
88
89 //std::cout<< " T0Dummy: "<< mcTestime<< std::endl;
90 aRecEsTimeCol->push_back(arecestime);
91
92 return StatusCode::SUCCESS;
93}
int runNo
int eventNo

◆ execute() [2/2]

StatusCode T0Dummy::execute ( )

◆ finalize() [1/2]

StatusCode T0Dummy::finalize ( )

Definition at line 95 of file T0Dummy.cxx.

95 {
96
97 MsgStream log(msgSvc(), name());
98 log << MSG::INFO << "in finalize()" << endreq;
99
100 return StatusCode::SUCCESS;
101
102}

◆ finalize() [2/2]

StatusCode T0Dummy::finalize ( )

◆ initialize() [1/2]

StatusCode T0Dummy::initialize ( )

Definition at line 25 of file T0Dummy.cxx.

25 {
26
27 MsgStream log(msgSvc(), name());
28 log << MSG::INFO << "in initialize()" << endreq;
29
30 return StatusCode::SUCCESS;
31}

◆ initialize() [2/2]

StatusCode T0Dummy::initialize ( )

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