95 {
96
97 MsgStream log(
msgSvc(), name());
98 log << MSG::INFO << "TofEnergyRec in execute()!!" << endreq;
99
100 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
101 if( !eventHeader ) {
102 log << MSG::FATAL << "TofEnergyRec could not find Event Header!" << endreq;
103 return StatusCode::FAILURE;
104 }
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;
110 m_event++;
111
112
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;
118 }
119
120
121 DataObject *aReconEvent;
122 eventSvc()->findObject("/Event/Recon",aReconEvent);
123 if(aReconEvent==
NULL) {
124 log << MSG::INFO << "Register ReconEvent" << endreq;
125
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;
131 }
132 }
133
134
136 if (!tofTrackCol) {
137 log << MSG::INFO << "Register RecTofTrackCol!" << endreq;
140 if(sc!=StatusCode::SUCCESS) {
141 log << MSG::FATAL << "Could not register RecTofTrackCol!" <<endreq;
142 }
143 }
144
145
146
147
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;
152 }
153 RecEsTimeCol::iterator iter_ESTime=estimeCol->begin();
154 double t0=0;
155 t0 = (*iter_ESTime)->getTest();
156 int t0Stat = (*iter_ESTime)->getStat();
157
158
159 std::vector<TofData*> tofDataVec;
161
162
163 m_tofShower->
findShower(tofDataVec, tofTrackCol, t0);
164
165 return StatusCode::SUCCESS;
166
167}
ObjectVector< RecTofTrack > RecTofTrackCol
IRawDataProviderSvc * tofDigiSvc
virtual TofDataVector & tofDataVectorTof(double estime=0)=0
void findShower(vector< TofData * > &tofDataVec, RecTofTrackCol *recTofTrackCol, double)
_EXTERN_ std::string RecTofTrackCol