95 MsgStream log(
msgSvc(), name());
96 log << MSG::INFO <<
"TofEnergyRec in execute()!!" << endreq;
98 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
100 log << MSG::FATAL <<
"TofEnergyRec could not find Event Header!" << endreq;
101 return StatusCode::FAILURE;
103 int run = eventHeader->runNumber();
104 int event = eventHeader->eventNumber();
105 if( m_eventNb!=0 && m_event%m_eventNb== 0 ) std::cout <<
"--------event: " << m_event
106 <<
", run= " << run <<
" event= " <<
event << std::endl;
107 log << MSG::INFO <<
"run= " << run <<
" event= " <<
event << endreq;
111 StatusCode sc = service(
"RawDataProviderSvc",
tofDigiSvc);
112 if(sc != StatusCode::SUCCESS) {
113 log << MSG::FATAL <<
"TofEnergyRec could not find RawDataProviderSvc!" << endreq;
114 return StatusCode::SUCCESS;
118 DataObject *aReconEvent;
119 eventSvc()->findObject(
"/Event/Recon",aReconEvent);
120 if(aReconEvent==NULL) {
121 log << MSG::INFO <<
"Register ReconEvent" << endreq;
124 sc = eventSvc()->registerObject(
"/Event/Recon",aReconEvent);
125 if(sc!=StatusCode::SUCCESS) {
126 log << MSG::FATAL <<
"Could not register ReconEvent" <<endreq;
127 return StatusCode::FAILURE;
134 log << MSG::INFO <<
"Register RecTofTrackCol!" << endreq;
137 if(sc!=StatusCode::SUCCESS) {
138 log << MSG::FATAL <<
"Could not register RecTofTrackCol!" <<endreq;
145 SmartDataPtr<RecEsTimeCol> estimeCol(eventSvc(),
"/Event/Recon/RecEsTimeCol");
146 if( !estimeCol || ( estimeCol->size() == 0 ) ) {
147 log << MSG::WARNING <<
"TofRec Could not find RecEsTimeCol! Run = " << run <<
" Event = " <<
event << endreq;
148 return StatusCode::SUCCESS;
150 RecEsTimeCol::iterator iter_ESTime=estimeCol->begin();
152 t0 = (*iter_ESTime)->getTest();
153 int t0Stat = (*iter_ESTime)->getStat();
156 std::vector<TofData*> tofDataVec;
160 m_tofShower->
findShower(tofDataVec, tofTrackCol, t0);
162 return StatusCode::SUCCESS;