186 {
187
188 MsgStream log(
msgSvc(),
"RecMdcTrackCnv");
189 log << MSG::DEBUG << "RecMdcTrackCnv::DataObjectToTObject" << endreq;
190
192 if (!mdcTrackColTds) {
193 log << MSG::ERROR << "Could not downcast to MdcTrackCol" << endreq;
194 return StatusCode::FAILURE;
195 }
196 DataObject *evt;
198 if (!sc.isSuccess()) {
199 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
200 return StatusCode::FAILURE;
201 }
203 if (!devtTds) {
204 log << MSG::ERROR << "RecMdcTrackCnv:Could not downcast to TDS ReconEvent" << endreq;
205 }
206
207 IOpaqueAddress *addr;
208
211
213 if (!m_recMdcTrackCol) return StatusCode::SUCCESS;
214
216
217 RecMdcTrackCol::const_iterator recMdcTrack;
218 for (recMdcTrack = mdcTrackColTds->begin(); recMdcTrack != mdcTrackColTds->end(); recMdcTrack++) {
219 Int_t trackId =(*recMdcTrack)->trackId();
220 Double_t helix[5];
221 for(int i=0;i<5;i++){
222 log<<MSG::INFO<<" recMdcTrack.helix("<<i<<"): "<<(*recMdcTrack)->helix(i)<<endreq;
223 helix[i] = (*recMdcTrack)->helix(i);
224 }
225
226 Int_t stat = (*recMdcTrack)->stat();
227 Double_t chi = (*recMdcTrack)->chi2();
228 Int_t ndof = (*recMdcTrack)->ndof();
229 Int_t
ns = (*recMdcTrack)->nster();
230 Int_t nlayer =(*recMdcTrack)->nlayer();
231
232 Double_t er[15];
233 for (Int_t i=0; i<15; i++){
234 er[i] = (*recMdcTrack)->err(i);
235 }
236 Int_t nh = (*recMdcTrack)->getNhits();
237
238 Double_t vx0 = (*recMdcTrack)->getVX0();
239 Double_t vy0 = (*recMdcTrack)->getVY0();
240 Double_t vz0 = (*recMdcTrack)->getVZ0();
241 Double_t fiterm =(*recMdcTrack)->getFiTerm();
242
244
245
248 log<<MSG::INFO<<
" test,recMdcTrackRoot.px: "<<recMdcTrackRoot->
px()
249 <<
" recMdcTrackRoot.py: "<<recMdcTrackRoot->
py()
250 <<
" recMdcTrackRoot.pz: "<<recMdcTrackRoot->
pz()
251 <<endreq;
252
253 recMdcTrackRoot->
setStat( stat );
254 recMdcTrackRoot->
setChi2( chi );
255 recMdcTrackRoot->
setNdof( ndof );
257 recMdcTrackRoot->
setErr( er );
260
261 recMdcTrackRoot->
setVX0( vx0 );
262 recMdcTrackRoot->
setVY0( vy0 );
263 recMdcTrackRoot->
setVZ0( vz0 );
265
267 }
268
269
270 return StatusCode::SUCCESS;
271}
ObjectVector< RecMdcTrack > RecMdcTrackCol
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
RecTrackCnv * getRecTrackCnv()
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void setVZ0(Double_t vz0)
void setStat(const Int_t stat)
void setVX0(Double_t vx0)
void setNdof(const Int_t ndof)
void setErr(const Double_t er[15])
void setHelix(const Double_t helix[5])
void setNhits(const Int_t nh)
void setNster(const Int_t ns)
void setNlayer(const Int_t nlayer)
void setChi2(const Double_t chi)
void setTrackId(const Int_t trackId)
void setFiTerm(Double_t fiterm)
void setVY0(Double_t vy0)
void addRecMdcTrack(TRecMdcTrack *Track)
Add a TkrTrack into the Mdc data collection.
void clearRecMdcTrackCol()
clear the whole array (necessary because of the consts-s)
const TObjArray * getRecMdcTrackCol() const
retrieve the whole TObjArray of RecMdcTrack Data
_EXTERN_ std::string Event