93 {
94
95 MsgStream log(
msgSvc(), name());
96 log << MSG::INFO << "TofEnergyRec in execute()!!" << endreq;
97
98 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
99 if( !eventHeader ) {
100 log << MSG::FATAL << "TofEnergyRec could not find Event Header!" << endreq;
101 return StatusCode::FAILURE;
102 }
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;
108 m_event++;
109
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;
115 }
116
117
118 DataObject *aReconEvent;
119 eventSvc()->findObject("/Event/Recon",aReconEvent);
120 if(aReconEvent==NULL) {
121 log << MSG::INFO << "Register ReconEvent" << endreq;
122
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;
128 }
129 }
130
131
133 if (!tofTrackCol) {
134 log << MSG::INFO << "Register RecTofTrackCol!" << endreq;
137 if(sc!=StatusCode::SUCCESS) {
138 log << MSG::FATAL << "Could not register RecTofTrackCol!" <<endreq;
139 }
140 }
141
142
143
144
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;
149 }
150 RecEsTimeCol::iterator iter_ESTime=estimeCol->begin();
151 double t0=0;
152 t0 = (*iter_ESTime)->getTest();
153 int t0Stat = (*iter_ESTime)->getStat();
154
155
156 std::vector<TofData*> tofDataVec;
158
159
160 m_tofShower->
findShower(tofDataVec, tofTrackCol, t0);
161
162 return StatusCode::SUCCESS;
163
164}
ObjectVector< RecTofTrack > RecTofTrackCol
IRawDataProviderSvc * tofDigiSvc
virtual TofDataVector & tofDataVectorTof(double estime=0)=0
void findShower(vector< TofData * > &tofDataVec, RecTofTrackCol *recTofTrackCol, double)
_EXTERN_ std::string RecTofTrackCol