33 {
34
35 MsgStream log(
msgSvc(), name());
36 log << MSG::INFO << "in execute()" << endreq;
37
38
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
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
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
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
88
89
90 aRecEsTimeCol->push_back(arecestime);
91
92 return StatusCode::SUCCESS;
93}
ObjectVector< RecEsTime > RecEsTimeCol
void setTest(double Test)