222 {
223
224
225
226 MsgStream log(
msgSvc(),
"RecExtTrackCnv");
227 log << MSG::DEBUG << "RecExtTrackCnv::DataObjectToTObject" << endreq;
228 StatusCode sc=StatusCode::SUCCESS;
229
231 if (!extTrackColTds) {
232 log << MSG::ERROR << "Could not downcast to RecExtTrackCol" << endreq;
233 return StatusCode::FAILURE;
234 }
235
236 DataObject *evt;
239 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
240 return StatusCode::FAILURE;
241 }
242
244 if (!devtTds) {
245 log << MSG::ERROR << "RecExtTrackCnv:Could not downcast to TDS Rec Event" << endreq;
246 }
247 IOpaqueAddress *addr;
248
251
253
254 if (!m_extTrackCol) return sc;
255
257 RecExtTrackCol::const_iterator extTrackTds;
258
259 for (extTrackTds = extTrackColTds->begin(); extTrackTds != extTrackColTds->end(); extTrackTds++) {
260
261 Int_t trackId = (*extTrackTds)->GetTrackId();
263
265 for(int iPart=0; iPart<5; iPart++) {
266
267 Double_t p1x = (*extTrackTds)->tof1Position(iPart).x();
268 Double_t p1y = (*extTrackTds)->tof1Position(iPart).y();
269 Double_t p1z = (*extTrackTds)->tof1Position(iPart).z();
270 Double_t m1x = (*extTrackTds)->tof1Momentum(iPart).x();
271 Double_t m1y = (*extTrackTds)->tof1Momentum(iPart).y();
272 Double_t m1z = (*extTrackTds)->tof1Momentum(iPart).z();
273
274 TString v1s = (*extTrackTds)->tof1VolumeName(iPart) ;
275 Int_t v1n = (*extTrackTds)->tof1VolumeNumber(iPart) ;
276 Double_t tof1= (*extTrackTds)->tof1(iPart);
277 Double_t tof1p = (*extTrackTds)->tof1Path(iPart);
278 Double_t z1 = (*extTrackTds)->tof1PosSigmaAlongZ(iPart);
279 Double_t t1 = (*extTrackTds)->tof1PosSigmaAlongT(iPart);
280 Double_t x1 = (*extTrackTds)->tof1PosSigmaAlongX(iPart);
281 Double_t y1 = (*extTrackTds)->tof1PosSigmaAlongY(iPart);
282 Double_t e1m[6][6];
283 HepSymMatrix e1mTds = (*extTrackTds)->tof1ErrorMatrix(iPart);
284 for (int i = 0;i<6 ;i++ )
285 for (int j= 0;j<6 ;j++ )
286 e1m[i][j] = e1mTds[i][j];
287
288
289 Double_t p2x = (*extTrackTds)->tof2Position(iPart).x();
290 Double_t p2y = (*extTrackTds)->tof2Position(iPart).y();
291 Double_t p2z = (*extTrackTds)->tof2Position(iPart).z();
292 Double_t m2x = (*extTrackTds)->tof2Momentum(iPart).x();
293 Double_t m2y = (*extTrackTds)->tof2Momentum(iPart).y();
294 Double_t m2z = (*extTrackTds)->tof2Momentum(iPart).z();
295
296 TString v2s = (*extTrackTds)->tof2VolumeName(iPart) ;
297 Int_t v2n = (*extTrackTds)->tof2VolumeNumber(iPart) ;
298 Double_t tof2= (*extTrackTds)->tof2(iPart);
299 Double_t tof2p = (*extTrackTds)->tof2Path(iPart);
300 Double_t z2 = (*extTrackTds)->tof2PosSigmaAlongZ(iPart);
301 Double_t t2 = (*extTrackTds)->tof2PosSigmaAlongT(iPart);
302 Double_t x2 = (*extTrackTds)->tof2PosSigmaAlongX(iPart);
303 Double_t y2 = (*extTrackTds)->tof2PosSigmaAlongY(iPart);
304 Double_t e2m[6][6];
305 HepSymMatrix e2mTds = (*extTrackTds)->tof2ErrorMatrix(iPart);
306 for (int i = 0;i<6 ;i++ )
307 for (int j= 0;j<6 ;j++ )
308 e2m[i][j] = e2mTds[i][j];
309
310 Double_t pEx = (*extTrackTds)->emcPosition(iPart).x();
311 Double_t pEy = (*extTrackTds)->emcPosition(iPart).y();
312 Double_t pEz = (*extTrackTds)->emcPosition(iPart).z();
313 Double_t mEx = (*extTrackTds)->emcMomentum(iPart).x();
314 Double_t mEy = (*extTrackTds)->emcMomentum(iPart).y();
315 Double_t mEz = (*extTrackTds)->emcMomentum(iPart).z();
316
317 TString vEs = (*extTrackTds)->emcVolumeName(iPart) ;
318 Int_t vEn = (*extTrackTds)->emcVolumeNumber(iPart) ;
319
320 Double_t theta = (*extTrackTds)->emcPosSigmaAlongTheta(iPart);
321 Double_t phi = (*extTrackTds)->emcPosSigmaAlongPhi(iPart);
322
323 Double_t eEm[6][6];
324 HepSymMatrix eEmTds = (*extTrackTds)->emcErrorMatrix(iPart);
325 for (int i = 0;i<6 ;i++ )
326 for (int j= 0;j<6 ;j++ )
327 eEm[i][j] = eEmTds[i][j];
328 Double_t emcPath=(*extTrackTds)->emcPath(iPart);
329
330
331 Double_t pMx = (*extTrackTds)->mucPosition(iPart).x();
332 Double_t pMy = (*extTrackTds)->mucPosition(iPart).y();
333 Double_t pMz = (*extTrackTds)->mucPosition(iPart).z();
334 Double_t mMx = (*extTrackTds)->mucMomentum(iPart).x();
335 Double_t mMy = (*extTrackTds)->mucMomentum(iPart).y();
336 Double_t mMz = (*extTrackTds)->mucMomentum(iPart).z();
337
338 TString vMs = (*extTrackTds)->mucVolumeName(iPart) ;
339 Int_t vMn = (*extTrackTds)->mucVolumeNumber(iPart) ;
340
341 Double_t zM = (*extTrackTds)->mucPosSigmaAlongZ(iPart);
342 Double_t tM = (*extTrackTds)->mucPosSigmaAlongT(iPart);
343 Double_t xM = (*extTrackTds)->mucPosSigmaAlongX(iPart);
344 Double_t yM = (*extTrackTds)->mucPosSigmaAlongY(iPart);
345
346 Double_t eMm[6][6];
347 HepSymMatrix eMmTds = (*extTrackTds)->mucErrorMatrix(iPart);
348 for (int i = 0;i<6 ;i++ )
349 for (int j= 0;j<6 ;j++ )
350 eMm[i][j]= eMmTds[i][j];
351
352
353 ExtMucHitVec vecHit = (*extTrackTds)->GetExtMucHitVec(iPart);
354 Int_t size = vecHit.size();
355
356
357
358
359
360
361 extTrackRoot->
SetSize(size,iPart);
362 for(int i=0;i<size;i++){
363 Double_t px = vecHit[i].GetPosition().x();
364 Double_t py = vecHit[i].GetPosition().y();
365 Double_t pz = vecHit[i].GetPosition().z();
366 Double_t mx = vecHit[i].GetMomentum().x();
367 Double_t my = vecHit[i].GetMomentum().y();
368 Double_t mz = vecHit[i].GetMomentum().z();
369 TString vs = vecHit[i].GetVolumeName();
370 Int_t vn = vecHit[i].GetVolumeNumber();
371 Double_t z = vecHit[i].GetPosSigmaAlongZ();
372 Double_t
t = vecHit[i].GetPosSigmaAlongT();
373 Double_t
x = vecHit[i].GetPosSigmaAlongX();
374 Double_t
y = vecHit[i].GetPosSigmaAlongY();
375 Double_t m[6][6];
376 HepSymMatrix mTds = vecHit[i].GetErrorMatrix();
377 for (int j = 0;j<6;j++)
378 for(int k=0;k<6;k++)
379 m[j][k] = mTds[j][k];
380
381 extTrackRoot->
SetExtMucHit(px,py,pz,mx,my,mz,vs,vn,z,
t,x,
y,m,iPart);
382 }
383
384
391
394
395 extTrackRoot->
SetTof1(tof1,iPart);
397
402
404
411
414
415 extTrackRoot->
SetTof2(tof2,iPart);
417
422
424
431
434
437
440
447
450
455
457
458 }
460 }
461
462 return StatusCode::SUCCESS;
463}
vector< ExtMucHit > ExtMucHitVec
ObjectVector< RecExtTrack > RecExtTrackCol
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 SetTof2VolumeName(const TString Tof2VolumeName, const Int_t i=2)
void SetTof1VolumeNumber(const Int_t Tof1VolumeNumber, const Int_t i=2)
void SetTof2PosSigmaAlongZ(const Double_t Tof2PosSigmaAlongZ, const Int_t i=2)
void SetTof1MomentumZ(const Double_t Tof1MomentumZ, const Int_t i=2)
void SetExtMucHit(Double_t PositionX, Double_t PositionY, Double_t PositionZ, Double_t MomentumX, Double_t MomentumY, Double_t MomentumZ, TString VolumeName, Int_t VolumeNumber, Double_t PosSigmaAlongZ, Double_t PosSigmaAlongT, Double_t PosSigmaAlongX, Double_t PosSigmaAlongY, Double_t ErrorMatrix[6][6], const Int_t k=2)
void SetTof2(const Double_t Tof2, const Int_t i=2)
void SetSize(Int_t size, const Int_t i=2)
void SetEmcVolumeNumber(const Int_t EmcVolumeNumber, const Int_t i=2)
void SetTof1Path(const Double_t Tof1Path, const Int_t i=2)
void SetTof2PosSigmaAlongX(const Double_t Tof2PosSigmaAlongX, const Int_t i=2)
void SetTof1PosSigmaAlongY(const Double_t Tof1PosSigmaAlongY, const Int_t i=2)
void SetEmcMomentumX(const Double_t EmcMomentumX, const Int_t i=2)
void SetTof2MomentumY(const Double_t Tof2MomentumY, const Int_t i=2)
void SetMucPositionZ(const Double_t MucPositionZ, const Int_t i=2)
void SetTof2MomentumX(const Double_t Tof2MomentumX, const Int_t i=2)
void SetMucPositionX(const Double_t MucPositionX, const Int_t i=2)
void SetMucPosSigmaAlongX(const Double_t MucPosSigmaAlongX, const Int_t i=2)
void SetMucVolumeName(const TString MucVolumeName, const Int_t i=2)
void SetTof2PosSigmaAlongY(const Double_t Tof2PosSigmaAlongY, const Int_t i=2)
void SetTof1MomentumX(const Double_t Tof1MomentumX, const Int_t i=2)
void SetTof1PositionZ(const Double_t Tof1PositionZ, const Int_t i=2)
void SetMucPosSigmaAlongY(const Double_t MucPosSigmaAlongY, const Int_t i=2)
void SetEmcMomentumY(const Double_t EmcMomentumY, const Int_t i=2)
void SetTof2ErrorMatrix(const Double_t Tof2ErrorMatrix[6][6], const Int_t k=2)
void SetTof2Path(const Double_t Tof2Path, const Int_t i=2)
void SetMucMomentumY(const Double_t MucMomentumY, const Int_t i=2)
void SetMucPosSigmaAlongT(const Double_t MucPosSigmaAlongT, const Int_t i=2)
void SetTof1(const Double_t Tof1, const Int_t i=2)
void SetMucMomentumZ(const Double_t MucMomentumZ, const Int_t i=2)
void SetEmcErrorMatrix(const Double_t EmcErrorMatrix[6][6], const Int_t k=2)
void SetEmcMomentumZ(const Double_t EmcMomentumZ, const Int_t i=2)
void SetTof1ErrorMatrix(const Double_t Tof1ErrorMatrix[6][6], const Int_t k=2)
void SetTof1PosSigmaAlongX(const Double_t Tof1PosSigmaAlongX, const Int_t i=2)
void SetEmcPosSigmaAlongTheta(const Double_t EmcPosSigmaAlongTheta, const Int_t i=2)
void SetTrackId(const Int_t trackId)
void SetTof2PosSigmaAlongT(const Double_t Tof2PosSigmaAlongT, const Int_t i=2)
void SetTof1PosSigmaAlongT(const Double_t Tof1PosSigmaAlongT, const Int_t i=2)
void SetTof1MomentumY(const Double_t Tof1MomentumY, const Int_t i=2)
void SetEmcPositionX(const Double_t EmcPositionX, const Int_t i=2)
void SetEmcPositionZ(const Double_t EmcPositionZ, const Int_t i=2)
void SetMucPositionY(const Double_t MucPositionY, const Int_t i=2)
void SetTof2MomentumZ(const Double_t Tof2MomentumZ, const Int_t i=2)
void SetMucErrorMatrix(const Double_t MucErrorMatrix[6][6], const Int_t k=2)
void SetEmcVolumeName(const TString EmcVolumeName, const Int_t i=2)
void SetTof2PositionY(const Double_t Tof2PositionY, const Int_t i=2)
void SetTof1PosSigmaAlongZ(const Double_t Tof1PosSigmaAlongZ, const Int_t i=2)
void SetMucPosSigmaAlongZ(const Double_t MucPosSigmaAlongZ, const Int_t i=2)
void SetTof1VolumeName(const TString Tof1VolumeName, const Int_t i=2)
void SetMucMomentumX(const Double_t MucMomentumX, const Int_t i=2)
void SetTof1PositionX(const Double_t Tof1PositionX, const Int_t i=2)
void SetTof2PositionZ(const Double_t Tof2PositionZ, const Int_t i=2)
void SetEmcPosSigmaAlongPhi(const Double_t EmcPosSigmaAlongPhi, const Int_t i=2)
void SetTof2PositionX(const Double_t Tof2PositionX, const Int_t i=2)
void SetEmcPath(Double_t path, const Int_t i=2)
void SetEmcPositionY(const Double_t EmcPositionY, const Int_t i=2)
void SetTof2VolumeNumber(const Int_t Tof2VolumeNumber, const Int_t i=2)
void SetMucVolumeNumber(const Int_t MucVolumeNumber, const Int_t i=2)
void SetTof1PositionY(const Double_t Tof1PositionY, const Int_t i=2)
const TObjArray * getExtTrackCol() const
void addExtTrack(TRecExtTrack *Track)
Add a ExtTrack into the Ext Data collection.
_EXTERN_ std::string Event