CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcKalTrackCnv Class Reference

#include <MdcKalTrackCnv.h>

+ Inheritance diagram for MdcKalTrackCnv:

Public Member Functions

virtual ~MdcKalTrackCnv ()
 
virtual ~MdcKalTrackCnv ()
 
virtual ~MdcKalTrackCnv ()
 
- 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
 
 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
 
 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
 
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.
 

Protected Member Functions

 MdcKalTrackCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 MdcKalTrackCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 MdcKalTrackCnv (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
 
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< MdcKalTrackCnv >
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ~MdcKalTrackCnv() [1/3]

virtual MdcKalTrackCnv::~MdcKalTrackCnv ( )
inlinevirtual

◆ MdcKalTrackCnv() [1/3]

MdcKalTrackCnv::MdcKalTrackCnv ( ISvcLocator *  svc)
protected

Definition at line 33 of file bak_RootCnvSvc-04-01-14/src/Dst/MdcKalTrackCnv.cxx.

35{
36 // Here we associate this converter with the /Event path on the TDS.
37 MsgStream log(msgSvc(), "MdcKalTrackCnv");
38 m_rootBranchname ="m_mdcKalTrackCol";
39 m_adresses.push_back(&m_mdcKalTrackCol);
40 m_mdcKalTrackCol=0;
41}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~MdcKalTrackCnv() [2/3]

virtual MdcKalTrackCnv::~MdcKalTrackCnv ( )
inlinevirtual

◆ MdcKalTrackCnv() [2/3]

MdcKalTrackCnv::MdcKalTrackCnv ( ISvcLocator *  svc)
protected

◆ ~MdcKalTrackCnv() [3/3]

virtual MdcKalTrackCnv::~MdcKalTrackCnv ( )
inlinevirtual

◆ MdcKalTrackCnv() [3/3]

MdcKalTrackCnv::MdcKalTrackCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & MdcKalTrackCnv::classID ( )
inlinestatic

Definition at line 20 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Dst/MdcKalTrackCnv.h.

21 {
23 }
const CLID & CLID_DstMdcKalTrackCol
Definition: EventModel.cxx:287

◆ classID() [2/3]

static const CLID & MdcKalTrackCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & MdcKalTrackCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 306 of file bak_RootCnvSvc-04-01-14/src/Dst/MdcKalTrackCnv.cxx.

306 {
307
308 MsgStream log(msgSvc(), "MdcKalTrackCnv");
309 log << MSG::DEBUG << "MdcKalTrackCnv::DataObjectToTObject" << endreq;
310 StatusCode sc=StatusCode::SUCCESS;
311
312 DstMdcKalTrackCol * mdcKalTrackColTds=dynamic_cast<DstMdcKalTrackCol *> (obj);
313 //RecMdcKalTrackCol * mdcKalTrackColTds=dynamic_cast<RecMdcKalTrackCol *> (obj);
314 if (!mdcKalTrackColTds) {
315 log << MSG::ERROR << "Could not downcast to DstMdcKalTrackCol" << endreq;
316 return StatusCode::FAILURE;
317 }
318
319 DataObject *evt;
320 m_eds->findObject(EventModel::Dst::Event,evt);
321 if (evt==NULL) {
322 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
323 return StatusCode::FAILURE;
324 }
325
326 DstEvent * devtTds=dynamic_cast<DstEvent *> (evt);
327 if (!devtTds) {
328 log << MSG::ERROR << "MdcKalTrackCnv:Could not downcast to TDS Dst Event" << endreq;
329 }
330 IOpaqueAddress *addr;
331
332 m_cnvSvc->getDstCnv()->createRep(evt,addr);
334
335 const TObjArray *m_mdcKalTrackCol = recEvt->getMdcKalTrackCol();
336
337 if (!m_mdcKalTrackCol) return sc;
338
339 recEvt->clearMdcKalTrackCol(); //necessary in case there is I/O at the same time since array is static
340 DstMdcKalTrackCol::const_iterator mdcKalTrackTds;
341
342 for (mdcKalTrackTds = mdcKalTrackColTds->begin(); mdcKalTrackTds != mdcKalTrackColTds->end(); mdcKalTrackTds++) {
343
344 // Get Data from DST
345
346 //Double_t poca[3];
347 Double_t zhelix[5];
348 Double_t zerror[5][5];
349
350 //Double_t poca_e[3];
351 Double_t zhelix_e[5];
352 Double_t zerror_e[5][5];
353
354 //Double_t poca_mu[3];
355 Double_t zhelix_mu[5];
356 Double_t zerror_mu[5][5];
357
358 //Double_t poca_k[3];
359 Double_t zhelix_k[5];
360 Double_t zerror_k[5][5];
361
362 //Double_t poca_p[3];
363 Double_t zhelix_p[5];
364 Double_t zerror_p[5][5];
365
366 Double_t fhelix[5];
367 Double_t ferror[5][5];
368 Double_t fhelix_e[5];
369 Double_t ferror_e[5][5];
370 Double_t fhelix_mu[5];
371 Double_t ferror_mu[5][5];
372 Double_t fhelix_k[5];
373 Double_t ferror_k[5][5];
374 Double_t fhelix_p[5];
375 Double_t ferror_p[5][5];
376
377 TMdcKalTrack *mdcKalTrackRoot = new TMdcKalTrack();
378 //m_common.m_mdcKalTrackMap[(*mdcKalTrackTds)] = mdcKalTrackRoot;
379 RecMdcKalTrack* recMdcKalTrackTds=(RecMdcKalTrack*) (*mdcKalTrackTds);
380
381 for(int k=0; k<5; k++){
382 mdcKalTrackRoot->setStat((*mdcKalTrackTds)->getStat(k),k);
383 mdcKalTrackRoot->setStat2(recMdcKalTrackTds->getStat(1,k),k);
384 mdcKalTrackRoot->setChisq((*mdcKalTrackTds)->getChisq(k),k);
385 mdcKalTrackRoot->setNdf((*mdcKalTrackTds)->getNdf(k),k);
386 mdcKalTrackRoot->setNlayer((*mdcKalTrackTds)->getNlayer(k),k);
387 //o mdcKalTrackRoot->setNster((*mdcKalTrackTds)->getNster(k),k);
388 //o mdcKalTrackRoot->setFirstLayer((*mdcKalTrackTds)->getFirstLayer(k),k);
389 //o mdcKalTrackRoot->setLastLayer((*mdcKalTrackTds)->getLastLayer(k),k);
390 }
391
392 //HepPoint3D h_poca = (*mdcKalTrackTds)->getPoca(2);
393 HepVector h_zhelix = (*mdcKalTrackTds)->getZHelix(2);
394 HepSymMatrix h_zerror = (*mdcKalTrackTds)->getZError(2);
395
396 //HepPoint3D h_poca_e = (*mdcKalTrackTds)->getPoca(0);
397 HepVector h_zhelix_e = (*mdcKalTrackTds)->getZHelix(0);
398 HepSymMatrix h_zerror_e = (*mdcKalTrackTds)->getZError(0);
399
400 //HepPoint3D h_poca_mu = (*mdcKalTrackTds)->getPoca(1);
401 HepVector h_zhelix_mu = (*mdcKalTrackTds)->getZHelix(1);
402 HepSymMatrix h_zerror_mu = (*mdcKalTrackTds)->getZError(1);
403
404 //HepPoint3D h_poca_k = (*mdcKalTrackTds)->getPoca(3);
405 HepVector h_zhelix_k = (*mdcKalTrackTds)->getZHelix(3);
406 HepSymMatrix h_zerror_k = (*mdcKalTrackTds)->getZError(3);
407
408 //HepPoint3D h_poca_p = (*mdcKalTrackTds)->getPoca(4);
409 HepVector h_zhelix_p = (*mdcKalTrackTds)->getZHelix(4);
410 HepSymMatrix h_zerror_p = (*mdcKalTrackTds)->getZError(4);
411
412 HepVector h_fhelix = (*mdcKalTrackTds)->getFHelix(2);
413 HepSymMatrix h_ferror = (*mdcKalTrackTds)->getFError(2);
414 HepVector h_fhelix_e = (*mdcKalTrackTds)->getFHelix(0);
415 HepSymMatrix h_ferror_e = (*mdcKalTrackTds)->getFError(0);
416 HepVector h_fhelix_mu = (*mdcKalTrackTds)->getFHelix(1);
417 HepSymMatrix h_ferror_mu = (*mdcKalTrackTds)->getFError(1);
418 HepVector h_fhelix_k = (*mdcKalTrackTds)->getFHelix(3);
419 HepSymMatrix h_ferror_k = (*mdcKalTrackTds)->getFError(3);
420 HepVector h_fhelix_p = (*mdcKalTrackTds)->getFHelix(4);
421 HepSymMatrix h_ferror_p = (*mdcKalTrackTds)->getFError(4);
422
423 mdcKalTrackRoot->setTrackId((*mdcKalTrackTds)->getTrackId());
424
425 /*
426 for(int k=0; k<3; k++){
427 poca[k] = h_poca[k];
428 poca_e[k] = h_poca_e[k];
429 poca_mu[k] = h_poca_mu[k];
430 poca_k[k] = h_poca_k[k];
431 poca_p[k] = h_poca_p[k];
432 }
433 */
434
435 for (int i=0; i<5; i++){
436 zhelix[i] = h_zhelix[i];
437 zhelix_e[i] = h_zhelix_e[i];
438 zhelix_mu[i] = h_zhelix_mu[i];
439 zhelix_p[i] = h_zhelix_p[i];
440 zhelix_k[i] = h_zhelix_k[i];
441 fhelix[i] = h_fhelix[i];
442 fhelix_e[i] = h_fhelix_e[i];
443 fhelix_mu[i] = h_fhelix_mu[i];
444 fhelix_p[i] = h_fhelix_p[i];
445 fhelix_k[i] = h_fhelix_k[i];
446 for (int j=0; j<=i; j++){
447 zerror[i][j] = h_zerror[i][j];
448 zerror_e[i][j] = h_zerror_e[i][j];
449 zerror_mu[i][j] = h_zerror_mu[i][j];
450 zerror_p[i][j] = h_zerror_p[i][j];
451 zerror_k[i][j] = h_zerror_k[i][j];
452 zerror[j][i] = h_zerror[i][j];
453 zerror_e[j][i] = h_zerror_e[i][j];
454 zerror_mu[j][i] = h_zerror_mu[i][j];
455 zerror_p[j][i] = h_zerror_p[i][j];
456 zerror_k[j][i] = h_zerror_k[i][j];
457 ferror[i][j] = h_ferror[i][j];
458 ferror_e[i][j] = h_ferror_e[i][j];
459 ferror_mu[i][j] = h_ferror_mu[i][j];
460 ferror_p[i][j] = h_ferror_p[i][j];
461 ferror_k[i][j] = h_ferror_k[i][j];
462 ferror[j][i] = h_ferror[i][j];
463 ferror_e[j][i] = h_ferror_e[i][j];
464 ferror_mu[j][i] = h_ferror_mu[i][j];
465 ferror_p[j][i] = h_ferror_p[i][j];
466 ferror_k[j][i] = h_ferror_k[i][j];
467 }
468 }
469
470 //mdcKalTrackRoot->setPoca(poca);
471 mdcKalTrackRoot->setZHelix(zhelix);
472 mdcKalTrackRoot->setZError(zerror);
473
474 //mdcKalTrackRoot->setPocaE(poca_e);
475 mdcKalTrackRoot->setZHelixE(zhelix_e);
476 mdcKalTrackRoot->setZErrorE(zerror_e);
477
478 //mdcKalTrackRoot->setPocaMu(poca_mu);
479 mdcKalTrackRoot->setZHelixMu(zhelix_mu);
480 mdcKalTrackRoot->setZErrorMu(zerror_mu);
481
482 //mdcKalTrackRoot->setPocaK(poca_k);
483 mdcKalTrackRoot->setZHelixK(zhelix_k);
484 mdcKalTrackRoot->setZErrorK(zerror_k);
485
486 //mdcKalTrackRoot->setPocaP(poca_p);
487 mdcKalTrackRoot->setZHelixP(zhelix_p);
488 mdcKalTrackRoot->setZErrorP(zerror_p);
489
490 mdcKalTrackRoot->setFHelix(fhelix);
491 mdcKalTrackRoot->setFError(ferror);
492
493 mdcKalTrackRoot->setFHelixE(fhelix_e);
494 mdcKalTrackRoot->setFErrorE(ferror_e);
495
496 mdcKalTrackRoot->setFHelixMu(fhelix_mu);
497 mdcKalTrackRoot->setFErrorMu(ferror_mu);
498
499 mdcKalTrackRoot->setFHelixK(fhelix_k);
500 mdcKalTrackRoot->setFErrorK(ferror_k);
501
502 mdcKalTrackRoot->setFHelixP(fhelix_p);
503 mdcKalTrackRoot->setFErrorP(ferror_p);
504
505 recEvt->addMdcKalTrack(mdcKalTrackRoot);
506 }
507
508 return StatusCode::SUCCESS;
509}
ObjectVector< DstMdcKalTrack > DstMdcKalTrackCol
static TDstEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void addMdcKalTrack(TMdcKalTrack *Track)

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 43 of file bak_RootCnvSvc-04-01-14/src/Dst/MdcKalTrackCnv.cxx.

43 {
44 // creation of TDS object from root object
45
46 MsgStream log(msgSvc(), "MdcKalTrackCnv");
47 log << MSG::DEBUG << "MdcKalTrackCnv::TObjectToDataObject" << endreq;
48 StatusCode sc=StatusCode::SUCCESS;
49
50 // create the TDS location for the MdcKalTrack Collection
51 DstMdcKalTrackCol* mdcKalTrackTdsCol = new DstMdcKalTrackCol;
52 refpObject=mdcKalTrackTdsCol;
53
54 // now convert
55 if (!m_mdcKalTrackCol) return sc;
56 TIter mdcKalTrackIter(m_mdcKalTrackCol);
57 TMdcKalTrack *mdcKalTrackRoot = 0;
58 while ((mdcKalTrackRoot = (TMdcKalTrack*)mdcKalTrackIter.Next())) {
59 std::vector<HepVector> zhelixs;
60 std::vector<HepSymMatrix> zerrors;
61 std::vector<HepPoint3D> pocas;
62 std::vector<HepVector> fhelixs;
63 std::vector<HepSymMatrix> ferrors;
64
65 HepVector zhelix(5);
66 HepSymMatrix zerror(5);
67 HepPoint3D poca(0,0,0);
68
69 HepVector zhelix_e(5);
70 HepSymMatrix zerror_e(5);
71 HepPoint3D poca_e(0,0,0);
72
73 HepVector zhelix_mu(5);
74 HepSymMatrix zerror_mu(5);
75 HepPoint3D poca_mu(0,0,0);
76
77 HepVector zhelix_k(5);
78 HepSymMatrix zerror_k(5);
79 HepPoint3D poca_k(0,0,0);
80
81 HepVector zhelix_p(5);
82 HepSymMatrix zerror_p(5);
83 HepPoint3D poca_p(0,0,0);
84
85 HepVector fhelix(5);
86 HepSymMatrix ferror(5);
87
88 HepVector fhelix_e(5);
89 HepSymMatrix ferror_e(5);
90
91 HepVector fhelix_mu(5);
92 HepSymMatrix ferror_mu(5);
93
94 HepVector fhelix_k(5);
95 HepSymMatrix ferror_k(5);
96
97 HepVector fhelix_p(5);
98 HepSymMatrix ferror_p(5);
99
100
101 DstMdcKalTrack *mdcKalTrackTds = new DstMdcKalTrack();
102 m_common.m_rootMdcKalTrackMap[mdcKalTrackRoot] = mdcKalTrackTds;
103
104 /*
105 for(int ii=0; ii<3; ii++){
106 poca_e[ii] = mdcKalTrackRoot->getPocaE(ii);
107 poca_mu[ii] = mdcKalTrackRoot->getPocaMu(ii);
108 poca[ii] = mdcKalTrackRoot->getPoca(ii);
109 poca_k[ii] = mdcKalTrackRoot->getPocaK(ii);
110 poca_p[ii] = mdcKalTrackRoot->getPocaP(ii);
111 }
112 */
113
114 log<<MSG::DEBUG<<"T to DST, poca: "<<poca<<endreq;
115
116 for (int i=0; i<5; i++){
117 zhelix[i] = mdcKalTrackRoot->getZHelix(i);
118 zhelix_e[i] = mdcKalTrackRoot->getZHelixE(i);
119 zhelix_mu[i] = mdcKalTrackRoot->getZHelixMu(i);
120 zhelix_k[i] = mdcKalTrackRoot->getZHelixK(i);
121 zhelix_p[i] = mdcKalTrackRoot->getZHelixP(i);
122
123 fhelix[i] = mdcKalTrackRoot->getFHelix(i);
124 fhelix_e[i] = mdcKalTrackRoot->getFHelixE(i);
125 fhelix_mu[i] = mdcKalTrackRoot->getFHelixMu(i);
126 fhelix_k[i] = mdcKalTrackRoot->getFHelixK(i);
127 fhelix_p[i] = mdcKalTrackRoot->getFHelixP(i);
128
129 for (int j=0; j<=i; j++){
130 zerror[i][j] = mdcKalTrackRoot->getZError(i,j);
131 zerror_e[i][j] = mdcKalTrackRoot->getZErrorE(i,j);
132 zerror_mu[i][j] = mdcKalTrackRoot->getZErrorMu(i,j);
133 zerror_k[i][j] = mdcKalTrackRoot->getZErrorK(i,j);
134 zerror_p[i][j] = mdcKalTrackRoot->getZErrorP(i,j);
135
136 zerror[j][i] = zerror[i][j];
137 zerror_e[j][i] = zerror_e[i][j];
138 zerror_mu[j][i] = zerror_mu[i][j];
139 zerror_k[j][i] = zerror_k[i][j];
140 zerror_p[j][i] = zerror_p[i][j];
141
142 ferror[i][j] = mdcKalTrackRoot->getFError(i,j);
143 ferror_e[i][j] = mdcKalTrackRoot->getFErrorE(i,j);
144 ferror_mu[i][j] = mdcKalTrackRoot->getFErrorMu(i,j);
145 ferror_k[i][j] = mdcKalTrackRoot->getFErrorK(i,j);
146 ferror_p[i][j] = mdcKalTrackRoot->getFErrorP(i,j);
147
148 ferror[j][i] = ferror[i][j];
149 ferror_e[j][i] = ferror_e[i][j];
150 ferror_mu[j][i] = ferror_mu[i][j];
151 ferror_k[j][i] = ferror_k[i][j];
152 ferror_p[j][i] = ferror_p[i][j];
153 }
154 }
155
156
157 double dr = zhelix[0];
158 double phi0 = zhelix[1];
159 double kappa = zhelix[2];
160 double dz = zhelix[3];
161 double tanl = zhelix[4];
162 poca[0]=dr*cos(phi0);
163 poca[1]=dr*sin(phi0);
164 poca[2]=dz;
165
166 dr = zhelix_e[0];
167 phi0 = zhelix_e[1];
168 kappa = zhelix_e[2];
169 dz = zhelix_e[3];
170 tanl = zhelix_e[4];
171 poca_e[0]=dr*cos(phi0);
172 poca_e[1]=dr*sin(phi0);
173 poca_e[2]=dz;
174
175 dr = zhelix_mu[0];
176 phi0 = zhelix_mu[1];
177 kappa = zhelix_mu[2];
178 dz = zhelix_mu[3];
179 tanl = zhelix_mu[4];
180 poca_mu[0]=dr*cos(phi0);
181 poca_mu[1]=dr*sin(phi0);
182 poca_mu[2]=dz;
183
184 dr = zhelix_k[0];
185 phi0 = zhelix_k[1];
186 kappa = zhelix_k[2];
187 dz = zhelix_k[3];
188 tanl = zhelix_k[4];
189 poca_k[0]=dr*cos(phi0);
190 poca_k[1]=dr*sin(phi0);
191 poca_k[2]=dz;
192
193 dr = zhelix_p[0];
194 phi0 = zhelix_p[1];
195 kappa = zhelix_p[2];
196 dz = zhelix_p[3];
197 tanl = zhelix_p[4];
198 poca_p[0]=dr*cos(phi0);
199 poca_p[1]=dr*sin(phi0);
200 poca_p[2]=dz;
201
202
203 log<<MSG::DEBUG<<"T to DST, zhelix: "<<zhelix<<endreq;
204 log<<MSG::DEBUG<<"T to DST, zerror: "<<zerror<<endreq;
205
206 zhelixs.push_back(zhelix_e);
207 zhelixs.push_back(zhelix_mu);
208 zhelixs.push_back(zhelix);
209 zhelixs.push_back(zhelix_k);
210 zhelixs.push_back(zhelix_p);
211 zerrors.push_back(zerror_e);
212 zerrors.push_back(zerror_mu);
213 zerrors.push_back(zerror);
214 zerrors.push_back(zerror_k);
215 zerrors.push_back(zerror_p);
216
217 fhelixs.push_back(fhelix_e);
218 fhelixs.push_back(fhelix_mu);
219 fhelixs.push_back(fhelix);
220 fhelixs.push_back(fhelix_k);
221 fhelixs.push_back(fhelix_p);
222 ferrors.push_back(ferror_e);
223 ferrors.push_back(ferror_mu);
224 ferrors.push_back(ferror);
225 ferrors.push_back(ferror_k);
226 ferrors.push_back(ferror_p);
227
228 pocas.push_back(poca_e);
229 pocas.push_back(poca_mu);
230 pocas.push_back(poca);
231 pocas.push_back(poca_k);
232 pocas.push_back(poca_p);
233
234 for(int m=0; m<5; m++){
235 int charge;
236 double pxy(0.),px(0.),py(0.),pz(0.),ptot(0.),dr(0.),phi0(0.),kappa(0.),dz(0.),tanl(0.),x(0.),y(0.),z(0.),vx0(0.),vy0(0.),vz0(0.);
237 dr = zhelixs[m][0];
238 phi0 = zhelixs[m][1];
239 kappa = zhelixs[m][2];
240 dz = zhelixs[m][3];
241 tanl = zhelixs[m][4];
242
243// x = pocas[m][0];
244// y = pocas[m][1];
245// z = pocas[m][2];
246
247 x = dr * cos(phi0);
248 y = dr * sin(phi0);
249 z = dz;
250
251 // std::cout<<"x: "<<x<<"y: "<<y<<"z: "<<z<<std::endl;
252
253 if (kappa > 0.0000000001)
254 charge = 1;
255 else if (kappa < -0.0000000001)
256 charge = -1;
257 else
258 charge = 0;
259
260 if(kappa!=0) pxy = 1.0/fabs(kappa);
261 else pxy = 0;
262
263 px = pxy * (-sin(phi0));
264 py = pxy * cos(phi0);
265 pz = pxy * tanl;
266 ptot = sqrt(px*px+py*py+pz*pz);
267
268 mdcKalTrackTds->setCharge(charge,m);
269 mdcKalTrackTds->setPxy(pxy,m);
270 mdcKalTrackTds->setPx(px,m);
271 mdcKalTrackTds->setPy(py,m);
272 mdcKalTrackTds->setPz(pz,m);
273 mdcKalTrackTds->setP(ptot,m);
274 mdcKalTrackTds->setTheta(acos(pz/ptot),m);
275 mdcKalTrackTds->setPhi(atan2(py,px),m);
276 mdcKalTrackTds->setX(x,m);
277 mdcKalTrackTds->setY(y,m);
278 mdcKalTrackTds->setZ(z,m);
279 mdcKalTrackTds->setR(sqrt(x*x+y*y),m);
280
281 mdcKalTrackTds->setStat(mdcKalTrackRoot->getStat(m),0,m);
282 mdcKalTrackTds->setStat(mdcKalTrackRoot->getStat2(m),1,m);
283 mdcKalTrackTds->setChisq(mdcKalTrackRoot->getChisq(m),0,m);
284 mdcKalTrackTds->setNdf(mdcKalTrackRoot->getNdf(m),0,m);
285 mdcKalTrackTds->setNlayer(mdcKalTrackRoot->getNlayer(m),m);
286 }
287
288 mdcKalTrackTds->setTrackId(mdcKalTrackRoot->getTrackId());
289
290 for(int jj=0; jj<5; jj++){
291 mdcKalTrackTds->setZHelix(zhelixs[jj],jj);
292 mdcKalTrackTds->setZError(zerrors[jj],jj);
293 mdcKalTrackTds->setFHelix(fhelixs[jj],jj);
294 mdcKalTrackTds->setFError(ferrors[jj],jj);
295 mdcKalTrackTds->setPoca(pocas[jj],jj);
296 }
297
298 mdcKalTrackTdsCol->push_back(mdcKalTrackTds);
299 }
300 // m_mdcKalTrackCol->Delete(); // wensp add 2005/12/30
301 delete m_mdcKalTrackCol;
302 m_mdcKalTrackCol = 0;
303 return StatusCode::SUCCESS;
304}
Double_t x[10]
double sin(const BesAngle a)
double cos(const BesAngle a)
void setFHelix(const HepVector &fhelix, const int pid)
void setPhi(const double phi, const int pid)
void setZError(const HepSymMatrix &error, const int pid)
void setPoca(const HepPoint3D &poca, const int pid)
void setTheta(const double theta, const int pid)
void setPxy(const double pxy, const int pid)
void setFError(const HepSymMatrix &ferror, const int pid)
void setZHelix(const HepVector &helix, const int pid)
void setCharge(const int charge, const int pid)
static std::map< const TObject *, const DstMdcKalTrack * > m_rootMdcKalTrackMap

◆ TObjectToDataObject() [2/3]

virtual StatusCode MdcKalTrackCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode MdcKalTrackCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< MdcKalTrackCnv >


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