45 {
46
47 MsgStream log(
msgSvc(),
"RecMdcTrackCnv");
48 log << MSG::DEBUG << "RecMdcTrackCnv::TObjectToDataObject" << endreq;
49
50
52 refpObject = recMdcTrackCol;
53
54 if (!m_recMdcTrackCol) return StatusCode::SUCCESS;
55 TIter mdcTrackIter(m_recMdcTrackCol);
56
57
58
59
60
61
62
63 IDataProviderSvc* dataSvc = 0;
64 StatusCode sc = serviceLocator()->getService ("EventDataSvc",
65 IDataProviderSvc::interfaceID(), (IInterface*&)dataSvc);
66 if (!sc.isSuccess()) {
67 log << MSG::FATAL << "Could not get EventDataSvc in RecMdcTrackCnv" << endreq;
68 return( StatusCode::FAILURE);
69 }
70 SmartDataPtr<RecMdcHitCol> recMdcHitCol(dataSvc,"/Event/Recon/RecMdcHitCol");
71 if (!recMdcHitCol) {
72 log << MSG::FATAL << "Could not find RecMdcHitCol" << endreq;
73 return( StatusCode::FAILURE);
74 }
75
76
77
78
79
80
81
82 mdcTrackIter = m_recMdcTrackCol;
84 while ((recMdcTrackRoot = (
TRecMdcTrack*)mdcTrackIter.Next())) {
85 int trackId = recMdcTrackRoot->
trackId();
86 int charge = recMdcTrackRoot->
charge();
87 double helix[5];
88 for(int i=0;i<5; i++){
89 helix[i] = recMdcTrackRoot->
helix(i);
90 }
91 double pxy = recMdcTrackRoot->
pxy();
92 double px = recMdcTrackRoot->
px();
93 double py = recMdcTrackRoot->
py();
94 double pz = recMdcTrackRoot->
pz();
95 double p = recMdcTrackRoot->
p();
96 double theta = recMdcTrackRoot->
theta();
97 double phi = recMdcTrackRoot->
phi();
98 double x = recMdcTrackRoot->
x();
99 double y = recMdcTrackRoot->
y();
100 double z = recMdcTrackRoot->
z();
101 double r = recMdcTrackRoot->
r();
102 int stat = recMdcTrackRoot->
stat();
103 double chi = recMdcTrackRoot->
chi2();
104 int ndof = recMdcTrackRoot->
ndof();
105 int nlayer= recMdcTrackRoot->
nlayer();
106 double err[15];
107 for (int i=0; i<15; i++){
108 err[i] = recMdcTrackRoot->
err(i);
109 }
110 int nh = recMdcTrackRoot->
nhits();
111 int ns = recMdcTrackRoot->
nster();
112
113 double vx0 = recMdcTrackRoot->
vx0();
114 double vy0 = recMdcTrackRoot->
vy0();
115 double vz0 = recMdcTrackRoot->
vz0();
116 double fiterm = recMdcTrackRoot->
fiTerm();
119
123 recMdcTrack->
setPxy( pxy );
124 recMdcTrack->
setPx( px );
125 recMdcTrack->
setPy( py );
126 recMdcTrack->
setPz( pz );
127 recMdcTrack->
setP( p );
129 recMdcTrack->
setPhi( phi );
130 recMdcTrack->
setX( x );
131 recMdcTrack->
setY( y );
132 recMdcTrack->
setZ( z );
133 recMdcTrack->
setR( r );
141
142
143 recMdcTrack->
setVX0( vx0 );
144 recMdcTrack->
setVY0( vy0 );
145 recMdcTrack->
setVZ0( vz0 );
147
149
150 RecMdcHitCol::iterator
iter = recMdcHitCol->begin();
151 for (;
iter != recMdcHitCol->end();
iter++){
152
153
154 if((*iter)->getTrkId() == trackId){
155 SmartRef<RecMdcHit> refhit(*
iter);
156 theHitRefVec.push_back(refhit);
157 }
158 }
159
161
163
164
165
166 for(int ii=0; ii <nhits ; ii++){
167
168
169
173
174 }
175 recMdcTrackCol->push_back(recMdcTrack);
176 }
177
178 delete m_recMdcTrackCol;
179 m_recMdcTrackCol = 0;
180 return StatusCode::SUCCESS;
181}
SmartRefVector< RecMdcHit > HitRefVec
void setPxy(const double pxy)
void setTrackId(const int trackId)
void setPy(const double py)
void setZ(const double z)
void setNster(const int ns)
void setX(const double x)
void setError(double err[15])
void setNdof(const int ndof)
void setTheta(const double theta)
void setStat(const int stat)
void setNlayer(const int nlayer)
void setP(const double p)
void setHelix(double helix[5])
void setR(const double r)
void setCharge(const int charge)
void setY(const double y)
void setChi2(const double chi)
void setPhi(const double phi)
void setPz(const double pz)
void setPx(const double px)
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
const HitRefVec getVecHits(void) const
void setVecHits(HitRefVec vechits)
void setFiTerm(double fiterm)
const Double_t phi() const
const Int_t nster() const
const Double_t vz0(void) const
const Int_t nhits() const
const Double_t chi2() const
const Int_t trackId() const
const Double_t vy0(void) const
const Double_t fiTerm(void) const
const Double_t pxy() const
const Double_t err(Int_t i) const
const Double_t theta() const
const Int_t nlayer() const
const Int_t charge() const
const Double_t vx0(void) const
const Double_t helix(Int_t i) const
static std::map< const TObject *, const RecMdcTrack * > m_rootRecMdcTrackMap