BOSS 8.0.0
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 ()

Detailed Description

Definition at line 6 of file T0Dummy.h.

Constructor & Destructor Documentation

◆ T0Dummy()

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

Definition at line 18 of file T0Dummy.cxx.

19 : Algorithm( name, pSvcLocator ) {}

Referenced by T0Dummy().

Member Function Documentation

◆ execute()

StatusCode T0Dummy::execute ( )

Definition at line 29 of file T0Dummy.cxx.

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

◆ finalize()

StatusCode T0Dummy::finalize ( )

Definition at line 94 of file T0Dummy.cxx.

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

◆ initialize()

StatusCode T0Dummy::initialize ( )

Definition at line 21 of file T0Dummy.cxx.

21 {
22
23 MsgStream log( msgSvc(), name() );
24 log << MSG::INFO << "in initialize()" << endmsg;
25
26 return StatusCode::SUCCESS;
27}

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