148 {
149
150
151 DifNumber xDF(pos.x(),1,6), yDF(pos.y(),2,6), zDF(pos.z(),3,6);
155
156 static DifNumber phip, cosphip, sinphip, gamma;
158
160 invpt *= pxDF;
161 invpt += pyDF*pyDF;
162 invpt = sqrt(invpt);
163
164 if (invpt < 1.e-7) invpt = 1.e-7;
165 if (fabs(pxDF) < 1.e-7) pxDF = pxDF<0?-1e-7:1e-7;
166 invpt = 1./invpt;
167
168
170
171
172
173
174
175 pars(3) = invpt;
176 pars(3) *= sign;
177 pars(3) *= Bval;
179
180
181 pars(5) = pzDF;
182 pars(5) *= invpt;
183
185 phip=atan2(pyDF,pxDF);
187
188
189 pars(1) = rho;
190 pars(1) += yDF*cosphip;
191 pars(1) -= xDF*sinphip;
192
193 gamma=atan((xDF*cosphip+yDF*sinphip)/ -pars(1));
194
195 pars(1) /=
cos(gamma);
196 pars(1) -= rho;
197
198
199 pars(2) = phip;
200 pars(2) += gamma;
201
202
203
204
205 pars(4) = pars[4];
206 pars(4) *= gamma;
207 pars(4) *= rho;
208 pars(4) += zDF;
209
210
211
212
213 static HepSymMatrix posandmomErr(6);
214 static HepVector parsVec(5);
215
216 int i;
217 for (i = 1; i <= 3; ++i) {
218 int j;
219 for (j = 1; j <= i; ++j) {
220
221 posandmomErr.fast(i,j) = pos.covMatrix().fast(i,j);
222 posandmomErr.fast(i+3,j+3) = pmom.covMatrix().fast(i,j);
223 }
224 for (j = 1; j <= 3; ++j) {
225 posandmomErr.fast(j+3,i) = cxp(i,j);
226 }
227 }
228 for (i = 1; i <= 5; ++i) {
229
230
231 parsVec(i) = pars(i).number();
232 }
233
234
235 return TrkExchangePar(parsVec,posandmomErr.similarity(pars.jacobian()) );
236}
void cosAndSin(DifNumber &c, DifNumber &s) const