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;