1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/AlgFactory.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/SmartDataPtr.h"
5#include "GaudiKernel/IDataManagerSvc.h"
6#include "GaudiKernel/Bootstrap.h"
7#include "GaudiKernel/StatusCode.h"
8#include "GaudiKernel/PropertyMgr.h"
20 Algorithm(name, pSvcLocator)
27 MsgStream log(
msgSvc(), name());
28 log << MSG::INFO <<
"in initialize()" << endreq;
30 return StatusCode::SUCCESS;
35 MsgStream log(
msgSvc(), name());
36 log << MSG::INFO <<
"in execute()" << endreq;
39 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
41 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
42 return StatusCode::FAILURE;
45 int eventNo=eventHeader->eventNumber();
46 int runNo=eventHeader->runNumber();
50 log<<MSG::FATAL<<
" Run No:"<<
runNo<<
" > 0"<<endreq;
51 return StatusCode::FAILURE;
54 SmartDataPtr<Event::McParticleCol> mcParticleCol(eventSvc(),
"/Event/MC/McParticleCol");
56 log<<MSG::FATAL<<
"Could not retrieve McParticelCol"<<endreq;
57 return StatusCode::FAILURE;
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();
69 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
70 DataObject *aRecEsTime;
71 eventSvc()->findObject(
"/Event/Recon/RecEsTimeCol",aRecEsTime);
73 dataManSvc->clearSubTree(
"/Event/Recon/RecEsTimeCol");
74 eventSvc()->unregisterObject(
"/Event/Recon/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;
90 aRecEsTimeCol->push_back(arecestime);
92 return StatusCode::SUCCESS;
97 MsgStream log(
msgSvc(), name());
98 log << MSG::INFO <<
"in finalize()" << endreq;
100 return StatusCode::SUCCESS;
ObjectVector< RecEsTime > RecEsTimeCol
void setTest(double Test)
T0Dummy(const std::string &name, ISvcLocator *pSvcLocator)