BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
RecExtTrackCnv Class Reference

#include <RecExtTrackCnv.h>

+ Inheritance diagram for RecExtTrackCnv:

Public Member Functions

virtual ~RecExtTrackCnv ()
 
- 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.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
TObject * getReadObject () const
 get the object to be read
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

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

Protected Member Functions

 RecExtTrackCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RecExtTrackCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RootEventBaseCnv
RootCnvSvcm_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

Definition at line 15 of file RecExtTrackCnv.h.

Constructor & Destructor Documentation

◆ ~RecExtTrackCnv()

virtual RecExtTrackCnv::~RecExtTrackCnv ( )
inlinevirtual

Definition at line 25 of file RecExtTrackCnv.h.

25{ };

◆ RecExtTrackCnv()

RecExtTrackCnv::RecExtTrackCnv ( ISvcLocator *  svc)
protected

Definition at line 33 of file RecExtTrackCnv.cxx.

35{
36
37 // Here we associate this converter with the /Event path on the TDS.
38 MsgStream log(msgSvc(), "RecExtTrackCnv");
39 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
40 //m_rootTreename ="Rec";
41 //m_rootBranchname ="m_RecExtTrackCol";
42 m_rootBranchname ="m_extTrackCol";
43 //declareObject(EventModel::Recon::ExtTrackCol, objType(), m_rootTreename, m_rootBranchname);
44 m_adresses.push_back(&m_extTrackCol);
45 m_extTrackCol=0;
46}
IMessageSvc * msgSvc()
static const CLID & classID()
Base class for all Root Converters.
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & RecExtTrackCnv::classID ( )
inlinestatic

Definition at line 20 of file RecExtTrackCnv.h.

21 {
22 return CLID_RecExtTrackCol;
23 }
const CLID & CLID_RecExtTrackCol
Definition: EventModel.cxx:362

◆ DataObjectToTObject()

StatusCode RecExtTrackCnv::DataObjectToTObject ( DataObject *  obj,
RootAddress addr 
)
protectedvirtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 222 of file RecExtTrackCnv.cxx.

222 {
223
224
225
226 MsgStream log(msgSvc(), "RecExtTrackCnv");
227 log << MSG::DEBUG << "RecExtTrackCnv::DataObjectToTObject" << endreq;
228 StatusCode sc=StatusCode::SUCCESS;
229
230 RecExtTrackCol * extTrackColTds=dynamic_cast<RecExtTrackCol *> (obj);
231 if (!extTrackColTds) {
232 log << MSG::ERROR << "Could not downcast to RecExtTrackCol" << endreq;
233 return StatusCode::FAILURE;
234 }
235
236 DataObject *evt;
237 m_eds->findObject(EventModel::Recon::Event,evt);
238 if (evt==NULL) {
239 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
240 return StatusCode::FAILURE;
241 }
242
243 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
244 if (!devtTds) {
245 log << MSG::ERROR << "RecExtTrackCnv:Could not downcast to TDS Rec Event" << endreq;
246 }
247 IOpaqueAddress *addr;
248
249 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
251
252 const TObjArray *m_extTrackCol = recEvt->getExtTrackCol();
253
254 if (!m_extTrackCol) return sc;
255
256 recEvt->clearExtTrackCol(); //necessary in case there is I/O at the same time since array is static
257 RecExtTrackCol::const_iterator extTrackTds;
258
259 for (extTrackTds = extTrackColTds->begin(); extTrackTds != extTrackColTds->end(); extTrackTds++) {
260 //Get Data from TDS
261 Int_t trackId = (*extTrackTds)->GetTrackId();
262 TRecExtTrack *extTrackRoot = new TRecExtTrack;
263 //Set to Root
264 extTrackRoot->SetTrackId(trackId);
265 for(int iPart=0; iPart<5; iPart++) {
266 //Tof layer1
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 //Tof llayer2
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 //Emc
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 //Muc
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 //ExtMucHitVec
353 ExtMucHitVec vecHit = (*extTrackTds)->GetExtMucHitVec(iPart);
354 Int_t size = vecHit.size();
355
356 //m_common.m_extTrackMap[(*extTrackTds)] = extTrackRoot;
357
358 //Set to Root
359
360 //ExtMucHitVec
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 //Tof layer1
385 extTrackRoot->SetTof1PositionX(p1x,iPart);
386 extTrackRoot->SetTof1PositionY(p1y,iPart);
387 extTrackRoot->SetTof1PositionZ(p1z,iPart);
388 extTrackRoot->SetTof1MomentumX(m1x,iPart);
389 extTrackRoot->SetTof1MomentumY(m1y,iPart);
390 extTrackRoot->SetTof1MomentumZ(m1z,iPart);
391
392 extTrackRoot->SetTof1VolumeName(v1s,iPart);
393 extTrackRoot->SetTof1VolumeNumber(v1n,iPart);
394
395 extTrackRoot->SetTof1(tof1,iPart);
396 extTrackRoot->SetTof1Path(tof1p,iPart);
397
398 extTrackRoot->SetTof1PosSigmaAlongZ(z1,iPart);
399 extTrackRoot->SetTof1PosSigmaAlongT(t1,iPart);
400 extTrackRoot->SetTof1PosSigmaAlongX(x1,iPart);
401 extTrackRoot->SetTof1PosSigmaAlongY(y1,iPart);
402
403 extTrackRoot->SetTof1ErrorMatrix(e1m,iPart);
404 //Tof layer2
405 extTrackRoot->SetTof2PositionX(p2x,iPart);
406 extTrackRoot->SetTof2PositionY(p2y,iPart);
407 extTrackRoot->SetTof2PositionZ(p2z,iPart);
408 extTrackRoot->SetTof2MomentumX(m2x,iPart);
409 extTrackRoot->SetTof2MomentumY(m2y,iPart);
410 extTrackRoot->SetTof2MomentumZ(m2z,iPart);
411
412 extTrackRoot->SetTof2VolumeName(v2s,iPart);
413 extTrackRoot->SetTof2VolumeNumber(v2n,iPart);
414
415 extTrackRoot->SetTof2(tof2,iPart);
416 extTrackRoot->SetTof2Path(tof2p,iPart);
417
418 extTrackRoot->SetTof2PosSigmaAlongZ(z2,iPart);
419 extTrackRoot->SetTof2PosSigmaAlongT(t2,iPart);
420 extTrackRoot->SetTof2PosSigmaAlongX(x2,iPart);
421 extTrackRoot->SetTof2PosSigmaAlongY(y2,iPart);
422
423 extTrackRoot->SetTof2ErrorMatrix(e2m,iPart);
424 //Emc
425 extTrackRoot->SetEmcPositionX(pEx,iPart);
426 extTrackRoot->SetEmcPositionY(pEy,iPart);
427 extTrackRoot->SetEmcPositionZ(pEz,iPart);
428 extTrackRoot->SetEmcMomentumX(mEx,iPart);
429 extTrackRoot->SetEmcMomentumY(mEy,iPart);
430 extTrackRoot->SetEmcMomentumZ(mEz,iPart);
431
432 extTrackRoot->SetEmcVolumeName(vEs,iPart);
433 extTrackRoot->SetEmcVolumeNumber(vEn,iPart);
434
435 extTrackRoot->SetEmcPosSigmaAlongTheta(theta,iPart);
436 extTrackRoot->SetEmcPosSigmaAlongPhi(phi,iPart);
437
438 extTrackRoot->SetEmcErrorMatrix(eEm,iPart);
439 extTrackRoot->SetEmcPath(emcPath,iPart);
440 //Muc
441 extTrackRoot->SetMucPositionX(pMx,iPart);
442 extTrackRoot->SetMucPositionY(pMy,iPart);
443 extTrackRoot->SetMucPositionZ(pMz,iPart);
444 extTrackRoot->SetMucMomentumX(mMx,iPart);
445 extTrackRoot->SetMucMomentumY(mMy,iPart);
446 extTrackRoot->SetMucMomentumZ(mMz,iPart);
447
448 extTrackRoot->SetMucVolumeName(vMs,iPart);
449 extTrackRoot->SetMucVolumeNumber(vMn,iPart);
450
451 extTrackRoot->SetMucPosSigmaAlongZ(zM,iPart);
452 extTrackRoot->SetMucPosSigmaAlongT(tM,iPart);
453 extTrackRoot->SetMucPosSigmaAlongX(xM,iPart);
454 extTrackRoot->SetMucPosSigmaAlongY(yM,iPart);
455
456 extTrackRoot->SetMucErrorMatrix(eMm,iPart);
457
458 }
459 recEvt->addExtTrack(extTrackRoot);
460 }
461
462 return StatusCode::SUCCESS;
463}
vector< ExtMucHit > ExtMucHitVec
Definition: ExtMucHit.h:50
ObjectVector< RecExtTrack > RecExtTrackCol
Definition: RecExtTrack.h:209
TTree * t
Definition: binning.cxx:23
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition: RecTrackCnv.h:36
RecTrackCnv * getRecTrackCnv()
Definition: RootCnvSvc.h:173
RootCnvSvc * m_cnvSvc
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)
Definition: TRecExtTrack.h:47
void SetTof1VolumeNumber(const Int_t Tof1VolumeNumber, const Int_t i=2)
Definition: TRecExtTrack.h:27
void SetTof2PosSigmaAlongZ(const Double_t Tof2PosSigmaAlongZ, const Int_t i=2)
Definition: TRecExtTrack.h:51
void SetTof1MomentumZ(const Double_t Tof1MomentumZ, const Int_t i=2)
Definition: TRecExtTrack.h:24
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)
Definition: TRecExtTrack.h:103
void SetTof2(const Double_t Tof2, const Int_t i=2)
Definition: TRecExtTrack.h:49
void SetSize(Int_t size, const Int_t i=2)
Definition: TRecExtTrack.h:102
void SetEmcVolumeNumber(const Int_t EmcVolumeNumber, const Int_t i=2)
Definition: TRecExtTrack.h:69
void SetTof1Path(const Double_t Tof1Path, const Int_t i=2)
Definition: TRecExtTrack.h:29
void SetTof2PosSigmaAlongX(const Double_t Tof2PosSigmaAlongX, const Int_t i=2)
Definition: TRecExtTrack.h:53
void SetTof1PosSigmaAlongY(const Double_t Tof1PosSigmaAlongY, const Int_t i=2)
Definition: TRecExtTrack.h:33
void SetEmcMomentumX(const Double_t EmcMomentumX, const Int_t i=2)
Definition: TRecExtTrack.h:64
void SetTof2MomentumY(const Double_t Tof2MomentumY, const Int_t i=2)
Definition: TRecExtTrack.h:44
void SetMucPositionZ(const Double_t MucPositionZ, const Int_t i=2)
Definition: TRecExtTrack.h:84
void SetTof2MomentumX(const Double_t Tof2MomentumX, const Int_t i=2)
Definition: TRecExtTrack.h:43
void SetMucPositionX(const Double_t MucPositionX, const Int_t i=2)
Definition: TRecExtTrack.h:82
void SetMucPosSigmaAlongX(const Double_t MucPosSigmaAlongX, const Int_t i=2)
Definition: TRecExtTrack.h:94
void SetMucVolumeName(const TString MucVolumeName, const Int_t i=2)
Definition: TRecExtTrack.h:89
void SetTof2PosSigmaAlongY(const Double_t Tof2PosSigmaAlongY, const Int_t i=2)
Definition: TRecExtTrack.h:54
void SetTof1MomentumX(const Double_t Tof1MomentumX, const Int_t i=2)
Definition: TRecExtTrack.h:22
void SetTof1PositionZ(const Double_t Tof1PositionZ, const Int_t i=2)
Definition: TRecExtTrack.h:21
void SetMucPosSigmaAlongY(const Double_t MucPosSigmaAlongY, const Int_t i=2)
Definition: TRecExtTrack.h:95
void SetEmcMomentumY(const Double_t EmcMomentumY, const Int_t i=2)
Definition: TRecExtTrack.h:65
void SetTof2ErrorMatrix(const Double_t Tof2ErrorMatrix[6][6], const Int_t k=2)
Definition: TRecExtTrack.h:55
void SetTof2Path(const Double_t Tof2Path, const Int_t i=2)
Definition: TRecExtTrack.h:50
void SetMucMomentumY(const Double_t MucMomentumY, const Int_t i=2)
Definition: TRecExtTrack.h:86
void SetMucPosSigmaAlongT(const Double_t MucPosSigmaAlongT, const Int_t i=2)
Definition: TRecExtTrack.h:93
void SetTof1(const Double_t Tof1, const Int_t i=2)
Definition: TRecExtTrack.h:28
void SetMucMomentumZ(const Double_t MucMomentumZ, const Int_t i=2)
Definition: TRecExtTrack.h:87
void SetEmcErrorMatrix(const Double_t EmcErrorMatrix[6][6], const Int_t k=2)
Definition: TRecExtTrack.h:74
void SetEmcMomentumZ(const Double_t EmcMomentumZ, const Int_t i=2)
Definition: TRecExtTrack.h:66
void SetTof1ErrorMatrix(const Double_t Tof1ErrorMatrix[6][6], const Int_t k=2)
Definition: TRecExtTrack.h:34
void SetTof1PosSigmaAlongX(const Double_t Tof1PosSigmaAlongX, const Int_t i=2)
Definition: TRecExtTrack.h:32
void SetEmcPosSigmaAlongTheta(const Double_t EmcPosSigmaAlongTheta, const Int_t i=2)
Definition: TRecExtTrack.h:71
void SetTrackId(const Int_t trackId)
Definition: TRecExtTrack.h:17
void SetTof2PosSigmaAlongT(const Double_t Tof2PosSigmaAlongT, const Int_t i=2)
Definition: TRecExtTrack.h:52
void SetTof1PosSigmaAlongT(const Double_t Tof1PosSigmaAlongT, const Int_t i=2)
Definition: TRecExtTrack.h:31
void SetTof1MomentumY(const Double_t Tof1MomentumY, const Int_t i=2)
Definition: TRecExtTrack.h:23
void SetEmcPositionX(const Double_t EmcPositionX, const Int_t i=2)
Definition: TRecExtTrack.h:61
void SetEmcPositionZ(const Double_t EmcPositionZ, const Int_t i=2)
Definition: TRecExtTrack.h:63
void SetMucPositionY(const Double_t MucPositionY, const Int_t i=2)
Definition: TRecExtTrack.h:83
void SetTof2MomentumZ(const Double_t Tof2MomentumZ, const Int_t i=2)
Definition: TRecExtTrack.h:45
void SetMucErrorMatrix(const Double_t MucErrorMatrix[6][6], const Int_t k=2)
Definition: TRecExtTrack.h:97
void SetEmcVolumeName(const TString EmcVolumeName, const Int_t i=2)
Definition: TRecExtTrack.h:68
void SetTof2PositionY(const Double_t Tof2PositionY, const Int_t i=2)
Definition: TRecExtTrack.h:41
void SetTof1PosSigmaAlongZ(const Double_t Tof1PosSigmaAlongZ, const Int_t i=2)
Definition: TRecExtTrack.h:30
void SetMucPosSigmaAlongZ(const Double_t MucPosSigmaAlongZ, const Int_t i=2)
Definition: TRecExtTrack.h:92
void SetTof1VolumeName(const TString Tof1VolumeName, const Int_t i=2)
Definition: TRecExtTrack.h:26
void SetMucMomentumX(const Double_t MucMomentumX, const Int_t i=2)
Definition: TRecExtTrack.h:85
void SetTof1PositionX(const Double_t Tof1PositionX, const Int_t i=2)
Definition: TRecExtTrack.h:19
void SetTof2PositionZ(const Double_t Tof2PositionZ, const Int_t i=2)
Definition: TRecExtTrack.h:42
void SetEmcPosSigmaAlongPhi(const Double_t EmcPosSigmaAlongPhi, const Int_t i=2)
Definition: TRecExtTrack.h:72
void SetTof2PositionX(const Double_t Tof2PositionX, const Int_t i=2)
Definition: TRecExtTrack.h:40
void SetEmcPath(Double_t path, const Int_t i=2)
Definition: TRecExtTrack.h:79
void SetEmcPositionY(const Double_t EmcPositionY, const Int_t i=2)
Definition: TRecExtTrack.h:62
void SetTof2VolumeNumber(const Int_t Tof2VolumeNumber, const Int_t i=2)
Definition: TRecExtTrack.h:48
void SetMucVolumeNumber(const Int_t MucVolumeNumber, const Int_t i=2)
Definition: TRecExtTrack.h:90
void SetTof1PositionY(const Double_t Tof1PositionY, const Int_t i=2)
Definition: TRecExtTrack.h:20
const TObjArray * getExtTrackCol() const
void clearExtTrackCol()
void addExtTrack(TRecExtTrack *Track)
Add a ExtTrack into the Ext Data collection.
double y[1000]
double x[1000]
_EXTERN_ std::string Event
Definition: EventModel.h:84

◆ TObjectToDataObject()

StatusCode RecExtTrackCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 48 of file RecExtTrackCnv.cxx.

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

Friends And Related Function Documentation

◆ CnvFactory< RecExtTrackCnv >

friend class CnvFactory< RecExtTrackCnv >
friend

Definition at line 9 of file RecExtTrackCnv.h.


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