97 MsgStream log(
msgSvc(), name());
98 log << MSG::INFO <<
"TofEnergyRec in execute()!!" << endreq;
100 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
102 log << MSG::FATAL <<
"TofEnergyRec could not find Event Header!" << endreq;
103 return StatusCode::FAILURE;
105 int run = eventHeader->runNumber();
106 int event = eventHeader->eventNumber();
107 if( m_eventNb!=0 && m_event%m_eventNb== 0 ) std::cout <<
"--------event: " << m_event
108 <<
", run= " << run <<
" event= " <<
event << std::endl;
109 log << MSG::INFO <<
"run= " << run <<
" event= " <<
event << endreq;
114 StatusCode sc = service(
"RawDataProviderSvc",
tofDigiSvc);
115 if(sc != StatusCode::SUCCESS) {
116 log << MSG::FATAL <<
"TofEnergyRec could not find RawDataProviderSvc!" << endreq;
117 return StatusCode::SUCCESS;
121 DataObject *aReconEvent;
122 eventSvc()->findObject(
"/Event/Recon",aReconEvent);
123 if(aReconEvent==
NULL) {
124 log << MSG::INFO <<
"Register ReconEvent" << endreq;
127 sc = eventSvc()->registerObject(
"/Event/Recon",aReconEvent);
128 if(sc!=StatusCode::SUCCESS) {
129 log << MSG::FATAL <<
"Could not register ReconEvent" <<endreq;
130 return StatusCode::FAILURE;
137 log << MSG::INFO <<
"Register RecTofTrackCol!" << endreq;
140 if(sc!=StatusCode::SUCCESS) {
141 log << MSG::FATAL <<
"Could not register RecTofTrackCol!" <<endreq;
148 SmartDataPtr<RecEsTimeCol> estimeCol(eventSvc(),
"/Event/Recon/RecEsTimeCol");
149 if( !estimeCol || ( estimeCol->size() == 0 ) ) {
150 log << MSG::WARNING <<
"TofRec Could not find RecEsTimeCol! Run = " << run <<
" Event = " <<
event << endreq;
151 return StatusCode::SUCCESS;
153 RecEsTimeCol::iterator iter_ESTime=estimeCol->begin();
155 t0 = (*iter_ESTime)->getTest();
156 int t0Stat = (*iter_ESTime)->getStat();
159 std::vector<TofData*> tofDataVec;
163 m_tofShower->
findShower(tofDataVec, tofTrackCol, t0);
165 return StatusCode::SUCCESS;