BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ExtTrackCnv Class Reference

#include <ExtTrackCnv.h>

Inheritance diagram for ExtTrackCnv:

Public Member Functions

virtual ~ExtTrackCnv ()
 ExtTrackCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~ExtTrackCnv ()
 ExtTrackCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~ExtTrackCnv ()
 ExtTrackCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
Public Member Functions inherited from RootEventBaseCnv
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
TObject * getReadObject () const
 get the object to be read
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
TObject * getReadObject () const
 get the object to be read
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
TObject * getReadObject () const
 get the object to be read
Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
destinationoperator (const source &) const
destinationoperator (const source &) const

Static Public Member Functions

static const CLID & classID ()
static const CLID & classID ()
static const CLID & classID ()
Static Public Member Functions inherited from RootEventBaseCnv
static const unsigned char storageType ()
 Storage type and class ID.
static const unsigned char storageType ()
 Storage type and class ID.
static const unsigned char storageType ()
 Storage type and class ID.

Friends

class CnvFactory< ExtTrackCnv >

Additional Inherited Members

Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
Protected Attributes inherited from RootEventBaseCnv
IRootCnvSvcm_cnvSvc
std::vector< RootCnvSvc::Leafm_leaves
RootInterfacem_rootInterface
 pointer to the RootInterface
IDataProviderSvc * m_eds
 pointer to eventdataservice
int m_branchNr
 the branchNr of this converter for writing
int m_branchNrDst
int m_branchNrMc
int m_branchNrRecon
int m_branchNrEvtRec
int m_branchNrEvtHeader
int m_branchNrEvtNavigator
TObject * m_objRead
 the object that was read
CLID CLID_top
 the CLID of the upper converter if any
TArrayS * m_branchNumbers
 array with number of branches for reading
std::string m_rootBranchname
 root branchname (may be concatenated of severals)
std::string m_rootTreename
 each converter knows it's treename
std::string m_currentFileName
std::vector< void * > m_adresses
 each converter knows the corresponding adresses
RootEvtSelectorm_evtsel

Detailed Description

Constructor & Destructor Documentation

◆ ~ExtTrackCnv() [1/3]

virtual ExtTrackCnv::~ExtTrackCnv ( )
inlinevirtual

Definition at line 21 of file Event/RootCnvSvc/include/RootCnvSvc/Dst/ExtTrackCnv.h.

21{};

◆ ExtTrackCnv() [1/3]

ExtTrackCnv::ExtTrackCnv ( ISvcLocator * svc)

Definition at line 38 of file ExtTrackCnv.cxx.

38 : RootEventBaseCnv( classID(), svc ) {
39 // Here we associate this converter with the /Event path on the TDS.
40 MsgStream log( msgSvc(), "ExtTrackCnv" );
41 // log << MSG::DEBUG << "Constructor called for " << objType() << endmsg;
42 m_rootBranchname = "m_extTrackCol";
43 // declareObject(EventModel::Dst::DstExtTrackCol, objType(), m_rootTreename,
44 // m_rootBranchname);
45 m_adresses.push_back( &m_extTrackCol );
46 m_extTrackCol = 0;
47}
IMessageSvc * msgSvc()
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)

◆ ~ExtTrackCnv() [2/3]

virtual ExtTrackCnv::~ExtTrackCnv ( )
inlinevirtual

◆ ExtTrackCnv() [2/3]

ExtTrackCnv::ExtTrackCnv ( ISvcLocator * svc)

◆ ~ExtTrackCnv() [3/3]

virtual ExtTrackCnv::~ExtTrackCnv ( )
inlinevirtual

◆ ExtTrackCnv() [3/3]

ExtTrackCnv::ExtTrackCnv ( ISvcLocator * svc)

Member Function Documentation

◆ classID() [1/3]

const CLID & ExtTrackCnv::classID ( )
inlinestatic

Definition at line 19 of file Event/RootCnvSvc/include/RootCnvSvc/Dst/ExtTrackCnv.h.

19{ return CLID_DstExtTrackCol; }
const CLID & CLID_DstExtTrackCol

Referenced by RootCnvSvc::createConverter(), and ExtTrackCnv().

◆ classID() [2/3]

const CLID & ExtTrackCnv::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & ExtTrackCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

StatusCode ExtTrackCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 212 of file ExtTrackCnv.cxx.

212 {
213
214 MsgStream log( msgSvc(), "ExtTrackCnv" );
215 log << MSG::DEBUG << "ExtTrackCnv::DataObjectToTObject" << endmsg;
216 StatusCode sc = StatusCode::SUCCESS;
217
218 DstExtTrackCol* extTrackColTds = dynamic_cast<DstExtTrackCol*>( obj );
219 if ( !extTrackColTds )
220 {
221 log << MSG::ERROR << "Could not downcast to DstExtTrackCol" << endmsg;
222 return StatusCode::FAILURE;
223 }
224
225 DataObject* evt;
226 m_eds->findObject( EventModel::Dst::Event, evt );
227 if ( evt == NULL )
228 {
229 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endmsg;
230 return StatusCode::FAILURE;
231 }
232
233 DstEvent* devtTds = dynamic_cast<DstEvent*>( evt );
234 if ( !devtTds )
235 { log << MSG::ERROR << "ExtTrackCnv:Could not downcast to TDS Dst Event" << endmsg; }
236 IOpaqueAddress* addr;
237
238 m_cnvSvc->getDstCnv()->createRep( evt, addr );
239 TDstEvent* recEvt = m_cnvSvc->getDstCnv()->getWriteObject();
240
241 const TObjArray* m_extTrackCol = recEvt->getExtTrackCol();
242
243 if ( !m_extTrackCol ) return sc;
244
245 recEvt->clearExtTrackCol(); // necessary in case there is I/O at the same time since array is
246 // static
247 DstExtTrackCol::const_iterator extTrackTds;
248
249 for ( extTrackTds = extTrackColTds->begin(); extTrackTds != extTrackColTds->end();
250 extTrackTds++ )
251 {
252 // Get Data from TDS
253 Int_t trackId = ( *extTrackTds )->GetTrackId();
254 // Tof layer1
255 Double_t p1x = ( *extTrackTds )->tof1Position().x();
256 Double_t p1y = ( *extTrackTds )->tof1Position().y();
257 Double_t p1z = ( *extTrackTds )->tof1Position().z();
258 Double_t m1x = ( *extTrackTds )->tof1Momentum().x();
259 Double_t m1y = ( *extTrackTds )->tof1Momentum().y();
260 Double_t m1z = ( *extTrackTds )->tof1Momentum().z();
261
262 TString v1s = ( *extTrackTds )->tof1VolumeName();
263 Int_t v1n = ( *extTrackTds )->tof1VolumeNumber();
264 Double_t tof1 = ( *extTrackTds )->tof1();
265 Double_t tof1p = ( *extTrackTds )->tof1Path();
266 Double_t z1 = ( *extTrackTds )->tof1PosSigmaAlongZ();
267 Double_t t1 = ( *extTrackTds )->tof1PosSigmaAlongT();
268 Double_t x1 = ( *extTrackTds )->tof1PosSigmaAlongX();
269 Double_t y1 = ( *extTrackTds )->tof1PosSigmaAlongY();
270 Double_t e1m[6][6];
271 HepSymMatrix e1mTds = ( *extTrackTds )->tof1ErrorMatrix();
272 for ( int i = 0; i < 6; i++ )
273 for ( int j = 0; j < 6; j++ ) e1m[i][j] = e1mTds[i][j];
274
275 // Tof llayer2
276 Double_t p2x = ( *extTrackTds )->tof2Position().x();
277 Double_t p2y = ( *extTrackTds )->tof2Position().y();
278 Double_t p2z = ( *extTrackTds )->tof2Position().z();
279 Double_t m2x = ( *extTrackTds )->tof2Momentum().x();
280 Double_t m2y = ( *extTrackTds )->tof2Momentum().y();
281 Double_t m2z = ( *extTrackTds )->tof2Momentum().z();
282
283 TString v2s = ( *extTrackTds )->tof2VolumeName();
284 Int_t v2n = ( *extTrackTds )->tof2VolumeNumber();
285 Double_t tof2 = ( *extTrackTds )->tof2();
286 Double_t tof2p = ( *extTrackTds )->tof2Path();
287 Double_t z2 = ( *extTrackTds )->tof2PosSigmaAlongZ();
288 Double_t t2 = ( *extTrackTds )->tof2PosSigmaAlongT();
289 Double_t x2 = ( *extTrackTds )->tof2PosSigmaAlongX();
290 Double_t y2 = ( *extTrackTds )->tof2PosSigmaAlongY();
291 Double_t e2m[6][6];
292 HepSymMatrix e2mTds = ( *extTrackTds )->tof2ErrorMatrix();
293 for ( int i = 0; i < 6; i++ )
294 for ( int j = 0; j < 6; j++ ) e2m[i][j] = e2mTds[i][j];
295 // Emc
296 Double_t pEx = ( *extTrackTds )->emcPosition().x();
297 Double_t pEy = ( *extTrackTds )->emcPosition().y();
298 Double_t pEz = ( *extTrackTds )->emcPosition().z();
299 Double_t mEx = ( *extTrackTds )->emcMomentum().x();
300 Double_t mEy = ( *extTrackTds )->emcMomentum().y();
301 Double_t mEz = ( *extTrackTds )->emcMomentum().z();
302
303 TString vEs = ( *extTrackTds )->emcVolumeName();
304 Int_t vEn = ( *extTrackTds )->emcVolumeNumber();
305
306 Double_t theta = ( *extTrackTds )->emcPosSigmaAlongTheta();
307 Double_t phi = ( *extTrackTds )->emcPosSigmaAlongPhi();
308
309 Double_t eEm[6][6];
310 HepSymMatrix eEmTds = ( *extTrackTds )->emcErrorMatrix();
311 for ( int i = 0; i < 6; i++ )
312 for ( int j = 0; j < 6; j++ ) eEm[i][j] = eEmTds[i][j];
313 Double_t emcPath = ( *extTrackTds )->emcPath();
314
315 // Muc
316 Double_t pMx = ( *extTrackTds )->mucPosition().x();
317 Double_t pMy = ( *extTrackTds )->mucPosition().y();
318 Double_t pMz = ( *extTrackTds )->mucPosition().z();
319 Double_t mMx = ( *extTrackTds )->mucMomentum().x();
320 Double_t mMy = ( *extTrackTds )->mucMomentum().y();
321 Double_t mMz = ( *extTrackTds )->mucMomentum().z();
322
323 TString vMs = ( *extTrackTds )->mucVolumeName();
324 Int_t vMn = ( *extTrackTds )->mucVolumeNumber();
325
326 Double_t zM = ( *extTrackTds )->mucPosSigmaAlongZ();
327 Double_t tM = ( *extTrackTds )->mucPosSigmaAlongT();
328 Double_t xM = ( *extTrackTds )->mucPosSigmaAlongX();
329 Double_t yM = ( *extTrackTds )->mucPosSigmaAlongY();
330
331 Double_t eMm[6][6];
332 HepSymMatrix eMmTds = ( *extTrackTds )->mucErrorMatrix();
333 for ( int i = 0; i < 6; i++ )
334 for ( int j = 0; j < 6; j++ ) eMm[i][j] = eMmTds[i][j];
335
336 // ExtMucHitVec
337 /*ExtMucHitVec vecHit = (*extTrackTds)->GetExtMucHitVec();
338 Int_t size = vecHit.size();*/
339
340 TExtTrack* extTrackRoot = new TExtTrack();
341 // m_common.m_extTrackMap[(*extTrackTds)] = extTrackRoot;
342
343 // Set to Root
344
345 // ExtMucHitVec
346 /*extTrackRoot->SetSize(size);
347 for(int i=0;i<size;i++){
348 Double_t px = vecHit[i].GetPosition().x();
349 Double_t py = vecHit[i].GetPosition().y();
350 Double_t pz = vecHit[i].GetPosition().z();
351 Double_t mx = vecHit[i].GetMomentum().x();
352 Double_t my = vecHit[i].GetMomentum().y();
353 Double_t mz = vecHit[i].GetMomentum().z();
354 TString vs = vecHit[i].GetVolumeName();
355 Int_t vn = vecHit[i].GetVolumeNumber();
356 Double_t z = vecHit[i].GetPosSigmaAlongZ();
357 Double_t t = vecHit[i].GetPosSigmaAlongT();
358 Double_t x = vecHit[i].GetPosSigmaAlongX();
359 Double_t y = vecHit[i].GetPosSigmaAlongY();
360 Double_t m[6][6];
361 HepSymMatrix mTds = vecHit[i].GetErrorMatrix();
362 for (int j = 0;j<6;j++)
363 for(int k=0;k<6;k++)
364 m[i][j] = mTds[i][j];
365 extTrackRoot->SetExtMucHit(px,py,pz,mx,my,mz,vs,vn,z,t,y,x,m);
366 }*/
367
368 // Set to Root
369 extTrackRoot->SetTrackId( trackId );
370 // Tof layer1
371 extTrackRoot->SetTof1PositionX( p1x );
372 extTrackRoot->SetTof1PositionY( p1y );
373 extTrackRoot->SetTof1PositionZ( p1z );
374 extTrackRoot->SetTof1MomentumX( m1x );
375 extTrackRoot->SetTof1MomentumY( m1y );
376 extTrackRoot->SetTof1MomentumZ( m1z );
377
378 extTrackRoot->SetTof1VolumeName( v1s );
379 extTrackRoot->SetTof1VolumeNumber( v1n );
380
381 extTrackRoot->SetTof1( tof1 );
382 extTrackRoot->SetTof1Path( tof1p );
383
384 extTrackRoot->SetTof1PosSigmaAlongZ( z1 );
385 extTrackRoot->SetTof1PosSigmaAlongT( t1 );
386 extTrackRoot->SetTof1PosSigmaAlongX( x1 );
387 extTrackRoot->SetTof1PosSigmaAlongY( y1 );
388
389 extTrackRoot->SetTof1ErrorMatrix( e1m );
390 // Tof layer2
391 extTrackRoot->SetTof2PositionX( p2x );
392 extTrackRoot->SetTof2PositionY( p2y );
393 extTrackRoot->SetTof2PositionZ( p2z );
394 extTrackRoot->SetTof2MomentumX( m2x );
395 extTrackRoot->SetTof2MomentumY( m2y );
396 extTrackRoot->SetTof2MomentumZ( m2z );
397
398 extTrackRoot->SetTof2VolumeName( v2s );
399 extTrackRoot->SetTof2VolumeNumber( v2n );
400
401 extTrackRoot->SetTof2( tof2 );
402 extTrackRoot->SetTof2Path( tof2p );
403
404 extTrackRoot->SetTof2PosSigmaAlongZ( z2 );
405 extTrackRoot->SetTof2PosSigmaAlongT( t2 );
406 extTrackRoot->SetTof2PosSigmaAlongX( x2 );
407 extTrackRoot->SetTof2PosSigmaAlongY( y2 );
408
409 extTrackRoot->SetTof2ErrorMatrix( e2m );
410 // Emc
411 extTrackRoot->SetEmcPositionX( pEx );
412 extTrackRoot->SetEmcPositionY( pEy );
413 extTrackRoot->SetEmcPositionZ( pEz );
414 extTrackRoot->SetEmcMomentumX( mEx );
415 extTrackRoot->SetEmcMomentumY( mEy );
416 extTrackRoot->SetEmcMomentumZ( mEz );
417
418 extTrackRoot->SetEmcVolumeName( vEs );
419 extTrackRoot->SetEmcVolumeNumber( vEn );
420
421 extTrackRoot->SetEmcPosSigmaAlongTheta( theta );
422 extTrackRoot->SetEmcPosSigmaAlongPhi( phi );
423
424 extTrackRoot->SetEmcErrorMatrix( eEm );
425 extTrackRoot->SetEmcPath( emcPath );
426 // Muc
427 extTrackRoot->SetMucPositionX( pMx );
428 extTrackRoot->SetMucPositionY( pMy );
429 extTrackRoot->SetMucPositionZ( pMz );
430 extTrackRoot->SetMucMomentumX( mMx );
431 extTrackRoot->SetMucMomentumY( mMy );
432 extTrackRoot->SetMucMomentumZ( mMz );
433
434 extTrackRoot->SetMucVolumeName( vMs );
435 extTrackRoot->SetMucVolumeNumber( vMn );
436
437 extTrackRoot->SetMucPosSigmaAlongZ( zM );
438 extTrackRoot->SetMucPosSigmaAlongT( tM );
439 extTrackRoot->SetMucPosSigmaAlongX( xM );
440 extTrackRoot->SetMucPosSigmaAlongY( yM );
441
442 extTrackRoot->SetMucErrorMatrix( eMm );
443
444 recEvt->addExtTrack( extTrackRoot );
445 }
446
447 return StatusCode::SUCCESS;
448}
ObjectVector< DstExtTrack > DstExtTrackCol
IDataProviderSvc * m_eds
pointer to eventdataservice
void addExtTrack(TExtTrack *Track)
Add a ExtTrack into the Ext Data collection.
const TObjArray * getExtTrackCol() const
retrieve the whole TObjArray of Ext Data
void SetTof2MomentumY(const Double_t Tof2MomentumY)
void SetTof1PosSigmaAlongZ(const Double_t Tof1PosSigmaAlongZ)
void SetTof1PosSigmaAlongX(const Double_t Tof1PosSigmaAlongX)
void SetTof2MomentumX(const Double_t Tof2MomentumX)
void SetEmcMomentumY(const Double_t EmcMomentumY)
void SetMucMomentumY(const Double_t MucMomentumY)
void SetMucVolumeName(const TString MucVolumeName)
void SetTof1MomentumX(const Double_t Tof1MomentumX)
void SetEmcVolumeNumber(const Int_t EmcVolumeNumber)
void SetTof1VolumeNumber(const Int_t Tof1VolumeNumber)
void SetTof1PositionY(const Double_t Tof1PositionY)
void SetTof1PosSigmaAlongY(const Double_t Tof1PosSigmaAlongY)
void SetEmcErrorMatrix(const Double_t EmcErrorMatrix[6][6])
void SetEmcPositionX(const Double_t EmcPositionX)
void SetMucVolumeNumber(const Int_t MucVolumeNumber)
void SetMucErrorMatrix(const Double_t MucErrorMatrix[6][6])
void SetTof1PosSigmaAlongT(const Double_t Tof1PosSigmaAlongT)
void SetMucPosSigmaAlongX(const Double_t MucPosSigmaAlongX)
void SetEmcMomentumZ(const Double_t EmcMomentumZ)
void SetTof1Path(const Double_t Tof1Path)
void SetEmcMomentumX(const Double_t EmcMomentumX)
void SetTof2VolumeName(const TString Tof2VolumeName)
void SetTof2PosSigmaAlongY(const Double_t Tof2PosSigmaAlongY)
void SetMucPosSigmaAlongY(const Double_t MucPosSigmaAlongY)
void SetTof2ErrorMatrix(const Double_t Tof2ErrorMatrix[6][6])
void SetMucPositionX(const Double_t MucPositionX)
void SetTof2Path(const Double_t Tof2Path)
void SetTof2PosSigmaAlongZ(const Double_t Tof2PosSigmaAlongZ)
void SetMucPosSigmaAlongT(const Double_t MucPosSigmaAlongT)
void SetMucMomentumZ(const Double_t MucMomentumZ)
void SetTof1PositionZ(const Double_t Tof1PositionZ)
void SetMucPosSigmaAlongZ(const Double_t MucPosSigmaAlongZ)
void SetTof2PosSigmaAlongX(const Double_t Tof2PosSigmaAlongX)
void SetEmcPositionZ(const Double_t EmcPositionZ)
void SetTof2PositionZ(const Double_t Tof2PositionZ)
void SetTof1PositionX(const Double_t Tof1PositionX)
void SetTof2PosSigmaAlongT(const Double_t Tof2PosSigmaAlongT)
void SetTof2VolumeNumber(const Int_t Tof2VolumeNumber)
void SetEmcVolumeName(const TString EmcVolumeName)
void SetTof1MomentumY(const Double_t Tof1MomentumY)
void SetTof2PositionY(const Double_t Tof2PositionY)
void SetMucMomentumX(const Double_t MucMomentumX)
void SetMucPositionZ(const Double_t MucPositionZ)
void SetTof1ErrorMatrix(const Double_t Tof1ErrorMatrix[6][6])
void SetTof2MomentumZ(const Double_t Tof2MomentumZ)
void SetTof1MomentumZ(const Double_t Tof1MomentumZ)
void SetEmcPosSigmaAlongTheta(const Double_t EmcPosSigmaAlongTheta)
void SetTof2PositionX(const Double_t Tof2PositionX)
void SetTof1VolumeName(const TString Tof1VolumeName)
void SetEmcPositionY(const Double_t EmcPositionY)
void SetMucPositionY(const Double_t MucPositionY)
void SetEmcPosSigmaAlongPhi(const Double_t EmcPosSigmaAlongPhi)

◆ DataObjectToTObject() [2/3]

virtual StatusCode ExtTrackCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

virtual StatusCode ExtTrackCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode ExtTrackCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 49 of file ExtTrackCnv.cxx.

49 {
50 // creation of TDS object from root object
51
52 MsgStream log( msgSvc(), "ExtTrackCnv" );
53 log << MSG::DEBUG << "ExtTrackCnv::TObjectToDataObject" << endmsg;
54 StatusCode sc = StatusCode::SUCCESS;
55
56 // create the TDS location for the ExtTrack Collection
57 DstExtTrackCol* extTrackTdsCol = new DstExtTrackCol;
58 refpObject = extTrackTdsCol;
59
60 // now convert
61 if ( !m_extTrackCol ) return sc;
62 TIter extTrackIter( m_extTrackCol );
63 TExtTrack* extTrackRoot = 0;
64 while ( ( extTrackRoot = (TExtTrack*)extTrackIter.Next() ) )
65 {
66
67 int trackId = extTrackRoot->GetTrackId();
68 // Tof layer1:
69 double p1x = extTrackRoot->GetTof1PositionX();
70 double p1y = extTrackRoot->GetTof1PositionY();
71 double p1z = extTrackRoot->GetTof1PositionZ();
72 double m1x = extTrackRoot->GetTof1MomentumX();
73 double m1y = extTrackRoot->GetTof1MomentumY();
74 double m1z = extTrackRoot->GetTof1MomentumZ();
75 Hep3Vector tof1p( p1x, p1y, p1z );
76 Hep3Vector tof1m( m1x, m1y, m1z );
77
78 // char * pTof1 = extTrackRoot->GetTof1VolumeName().Data();
79 string v1s = extTrackRoot->GetTof1VolumeName().Data();
80 int v1n = extTrackRoot->GetTof1VolumeNumber();
81 double tof1 = extTrackRoot->GetTof1();
82 double tof1path = extTrackRoot->GetTof1Path();
83 double z1 = extTrackRoot->GetTof1PosSigmaAlongZ();
84 double t1 = extTrackRoot->GetTof1PosSigmaAlongT();
85 double x1 = extTrackRoot->GetTof1PosSigmaAlongX();
86 double y1 = extTrackRoot->GetTof1PosSigmaAlongY();
87 HepSymMatrix e1m( 6 );
88 for ( int i = 0; i < 6; i++ )
89 for ( int j = 0; j < 6; j++ ) e1m[i][j] = extTrackRoot->GetTof1ErrorMatrix( i, j );
90
91 // Tof layer2:
92 double p2x = extTrackRoot->GetTof2PositionX();
93 double p2y = extTrackRoot->GetTof2PositionY();
94 double p2z = extTrackRoot->GetTof2PositionZ();
95 double m2x = extTrackRoot->GetTof2MomentumX();
96 double m2y = extTrackRoot->GetTof2MomentumY();
97 double m2z = extTrackRoot->GetTof2MomentumZ();
98 Hep3Vector tof2p( p2x, p2y, p2z );
99 Hep3Vector tof2m( m2x, m2y, m2z );
100
101 string v2s = extTrackRoot->GetTof2VolumeName().Data();
102 int v2n = extTrackRoot->GetTof2VolumeNumber();
103 double tof2 = extTrackRoot->GetTof2();
104 double tof2path = extTrackRoot->GetTof2Path();
105 double z2 = extTrackRoot->GetTof2PosSigmaAlongZ();
106 double t2 = extTrackRoot->GetTof2PosSigmaAlongT();
107 double x2 = extTrackRoot->GetTof2PosSigmaAlongX();
108 double y2 = extTrackRoot->GetTof2PosSigmaAlongY();
109 HepSymMatrix e2m( 6 );
110 for ( int i = 0; i < 6; i++ )
111 for ( int j = 0; j < 6; j++ ) e2m[i][j] = extTrackRoot->GetTof2ErrorMatrix( i, j );
112
113 // Emc
114 double pEx = extTrackRoot->GetEmcPositionX();
115 double pEy = extTrackRoot->GetEmcPositionY();
116 double pEz = extTrackRoot->GetEmcPositionZ();
117 double mEx = extTrackRoot->GetEmcMomentumX();
118 double mEy = extTrackRoot->GetEmcMomentumY();
119 double mEz = extTrackRoot->GetEmcMomentumZ();
120 Hep3Vector Ep( pEx, pEy, pEz );
121 Hep3Vector Em( mEx, mEy, mEz );
122
123 string vEs = extTrackRoot->GetEmcVolumeName().Data();
124 int vEn = extTrackRoot->GetEmcVolumeNumber();
125 double theta = extTrackRoot->GetEmcPosSigmaAlongTheta();
126 double phi = extTrackRoot->GetEmcPosSigmaAlongPhi();
127 HepSymMatrix eEm( 6 );
128 for ( int i = 0; i < 6; i++ )
129 for ( int j = 0; j < 6; j++ ) eEm[i][j] = extTrackRoot->GetEmcErrorMatrix( i, j );
130 double emcPath = extTrackRoot->emcPath();
131
132 // Muc
133 double pMx = extTrackRoot->GetMucPositionX();
134 double pMy = extTrackRoot->GetMucPositionY();
135 double pMz = extTrackRoot->GetMucPositionZ();
136 double mMx = extTrackRoot->GetMucMomentumX();
137 double mMy = extTrackRoot->GetMucMomentumY();
138 double mMz = extTrackRoot->GetMucMomentumZ();
139 Hep3Vector Mp( pMx, pMy, pMz );
140 Hep3Vector Mm( mMx, mMy, mMz );
141
142 string vMs = extTrackRoot->GetMucVolumeName().Data();
143 int vMn = extTrackRoot->GetMucVolumeNumber();
144
145 double zM = extTrackRoot->GetMucPosSigmaAlongZ();
146 double tM = extTrackRoot->GetMucPosSigmaAlongT();
147 double xM = extTrackRoot->GetMucPosSigmaAlongX();
148 double yM = extTrackRoot->GetMucPosSigmaAlongY();
149 HepSymMatrix eMm( 6 );
150 for ( int i = 0; i < 6; i++ )
151 for ( int j = 0; j < 6; j++ ) eMm[i][j] = extTrackRoot->GetMucErrorMatrix( i, j );
152
153 DstExtTrack* extTrackTds = new DstExtTrack();
154 m_common.m_rootExtTrackMap[extTrackRoot] = extTrackTds;
155
156 // ExtMucHitVec
157 /*int size = extTrackRoot->GetSize();
158 ExtMucHit aExtMucHit;
159 // Hep3Vector p(0,0,0);
160 // Hep3Vector m(0,0,0);
161 string vs;
162 int vn;
163 double z;
164 double t;
165 double x;
166 double y;
167 HepSymMatrix matrix(6);
168 for(int i =0;i<size;i++){
169 double px = extTrackRoot->GetPositionX(i) ;
170 double py = extTrackRoot->GetPositionY(i) ;
171 double pz = extTrackRoot->GetPositionZ(i) ;
172 Hep3Vector p(px,py,pz);
173 double mx = extTrackRoot->GetMomentumX(i) ;
174 double my = extTrackRoot->GetMomentumY(i) ;
175 double mz = extTrackRoot->GetMomentumZ(i);
176 Hep3Vector m(mx,my,mz);
177 vs = extTrackRoot->GetVolumeName(i).Data();
178 vn = extTrackRoot->GetVolumeNumber(i) ;
179 z = extTrackRoot->GetPosSigmaAlongZ(i) ;
180 t = extTrackRoot->GetPosSigmaAlongT(i);
181 x = extTrackRoot->GetPosSigmaAlongX(i);
182 y = extTrackRoot->GetPosSigmaAlongY(i);
183 std::vector<double> vecError = extTrackRoot->GetErrorMatrix(i);
184 for(int k =0;i<6;k++){
185 for(int j =0; j<6;j++){
186 matrix[k][j] = vecError[k*6+j];
187 }
188 }
189 aExtMucHit.SetExtMucHit(p,m,vs,vn,matrix,z,t,x,y);
190 extTrackTds->AddExtMucHit(aExtMucHit);
191 }*/
192
193 // DstExtTrack *extTrackTds = new DstExtTrack();
194 extTrackTds->SetTrackId( trackId );
195 extTrackTds->SetTof1Data( tof1p, tof1m, v1s, v1n, tof1, tof1path, e1m, z1, t1, x1, y1 );
196 extTrackTds->SetTof2Data( tof2p, tof2m, v2s, v2n, tof2, tof2path, e2m, z2, t2, x2, y2 );
197 extTrackTds->SetEmcData( Ep, Em, vEs, vEn, theta, phi, eEm );
198 extTrackTds->SetEmcPath( emcPath );
199 extTrackTds->SetMucData( Mp, Mm, vMs, vMn, eMm, zM, tM, xM, yM );
200
201 extTrackTdsCol->push_back( extTrackTds );
202
203 // delete extTrackTds; // wensp add 2005/12/31
204 // extTrackTds = NULL;
205 }
206 // m_extTrackCol->Delete(); // wensp add 2005/12/30
207 delete m_extTrackCol;
208 m_extTrackCol = 0;
209 return StatusCode::SUCCESS;
210}
void SetTof1Data(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, double aTof, double aPath, HepSymMatrix aErrorMatrix, double aZSigma=0., double aTSigma=0., double aXSigma=0., double aYSigma=0.)
void SetEmcData(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, double aThetaSigma, double aPhiSigma, HepSymMatrix aErrorMatrix)
void SetTof2Data(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, double aTof, double aPath, HepSymMatrix aErrorMatrix, double aZSigma=0., double aTSigma=0., double aXSigma=0., double aYSigma=0.)
void SetMucData(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, HepSymMatrix aErrorMatrix, double aZSigma=0., double aTSigma=0., double aXSigma=0., double aYSigma=0.)
Double_t GetEmcErrorMatrix(Int_t i, Int_t j) const
Double_t GetTof1ErrorMatrix(Int_t i, Int_t j) const
Double_t GetTof2ErrorMatrix(Int_t i, Int_t j) const
Double_t GetMucErrorMatrix(Int_t i, Int_t j) const

◆ TObjectToDataObject() [2/3]

virtual StatusCode ExtTrackCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode ExtTrackCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ CnvFactory< ExtTrackCnv >

friend class CnvFactory< ExtTrackCnv >
friend

The documentation for this class was generated from the following files: