45 {
46
47 MsgStream log(
msgSvc(),
"RecCgemTrackCnv");
48 log << MSG::DEBUG << "RecCgemTrackCnv::TObjectToDataObject" << endreq;
49
50
52 refpObject = recCgemTrackCol;
53
54 if (!m_recCgemTrackCol) return StatusCode::SUCCESS;
55 TIter cgemTrackIter(m_recCgemTrackCol);
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 RecCgemTrackCnv" << endreq;
68 return( StatusCode::FAILURE);
69 }
70 SmartDataPtr<RecCgemHitCol> recCgemHitCol(dataSvc,"/Event/Recon/RecCgemHitCol");
71 if (!recCgemHitCol) {
72 log << MSG::FATAL << "Could not find RecCgemHitCol" << endreq;
73 return( StatusCode::FAILURE);
74 }
75
76
77
78
79
80
81
82 cgemTrackIter = m_recCgemTrackCol;
84 while ((recCgemTrackRoot = (
TRecCgemTrack*)cgemTrackIter.Next())) {
85 int trackId = recCgemTrackRoot->
trackId();
86 int charge = recCgemTrackRoot->
charge();
87 double cgemHelix[5];
88 for(int i=0;i<5; i++){
89 cgemHelix[i] = recCgemTrackRoot->
helix(i);
90 }
91 double pxy = recCgemTrackRoot->
pxy();
92 double px = recCgemTrackRoot->
px();
93 double py = recCgemTrackRoot->
py();
94 double pz = recCgemTrackRoot->
pz();
95 double p = recCgemTrackRoot->
p();
96 double theta = recCgemTrackRoot->
theta();
97 double phi = recCgemTrackRoot->
phi();
98 double x = recCgemTrackRoot->
x();
99 double y = recCgemTrackRoot->
y();
100 double z = recCgemTrackRoot->
z();
101 double r = recCgemTrackRoot->
r();
102 int stat = recCgemTrackRoot->
stat();
103 double chi = recCgemTrackRoot->
chi2();
104 int ndof = recCgemTrackRoot->
ndof();
105 double err[15];
106 for (int i=0; i<15; i++){
107 err[i] = recCgemTrackRoot->
err(i);
108 }
109 int nh = recCgemTrackRoot->
nhits();
110
111 double vx0 = recCgemTrackRoot->
vx0();
112 double vy0 = recCgemTrackRoot->
vy0();
113 double vz0 = recCgemTrackRoot->
vz0();
114 double fiterm = recCgemTrackRoot->
fiTerm();
117
120 recCgemTrack->
setHelix( cgemHelix );
121 recCgemTrack->
setPxy( pxy );
122 recCgemTrack->
setPx( px );
123 recCgemTrack->
setPy( py );
124 recCgemTrack->
setPz( pz );
125 recCgemTrack->
setP( p );
127 recCgemTrack->
setPhi( phi );
128 recCgemTrack->
setX( x );
129 recCgemTrack->
setY( y );
130 recCgemTrack->
setZ( z );
131 recCgemTrack->
setR( r );
137
138
139 recCgemTrack->
setVX0( vx0 );
140 recCgemTrack->
setVY0( vy0 );
141 recCgemTrack->
setVZ0( vz0 );
143
145
146 RecCgemHitCol::iterator
iter = recCgemHitCol->begin();
147 for (;
iter != recCgemHitCol->end();
iter++){
148
149
150 if((*iter)->getTrkId() == trackId){
151 SmartRef<RecCgemHit> refhit(*
iter);
152 theHitRefVec.push_back(refhit);
153 }
154 }
155
157
158 int nhits = recCgemTrack->
getVecHits().size();
159
160
161
162 for(int ii=0; ii <nhits ; ii++){
163
164
165
170
171 }
172 recCgemTrackCol->push_back(recCgemTrack);
173 }
174
175 delete m_recCgemTrackCol;
176 m_recCgemTrackCol = 0;
177 return StatusCode::SUCCESS;
178}
SmartRefVector< RecCgemHit > RecCgemHitRefVec
static int strip(const Identifier &id)
static int sheet(const Identifier &id)
static int layer(const Identifier &id)
void setStat(const int stat)
void setPx(const double px)
void setPhi(const double phi)
void setTheta(const double theta)
void setCharge(const int charge)
void setHelix(double helix[5])
void setZ(const double z)
void setP(const double p)
void setTrackId(const int trackId)
void setError(double err[15])
void setPxy(const double pxy)
void setPy(const double py)
void setY(const double y)
void setX(const double x)
void setNdof(const int ndof)
void setR(const double r)
void setPz(const double pz)
void setChi2(const double chi)
const RecCgemHitRefVec getVecHits(void) const
void setVecHits(RecCgemHitRefVec vechits)
void setFiTerm(double fiterm)
const Double_t phi() const
const Double_t chi2() const
const Int_t nhits() const
const Int_t trackId() const
const Double_t vy0(void) const
const Double_t pxy() const
const Double_t vx0(void) const
const Double_t helix(Int_t i) const
const Int_t charge() const
const Double_t vz0(void) const
const Double_t theta() const
const Double_t fiTerm(void) const
const Double_t err(Int_t i) const
static std::map< const TObject *, const RecCgemTrack * > m_rootRecCgemTrackMap