24 #include "Stl3Util/ftf/FtfBaseTrack.h"
28 void ftfMatrixDiagonal (
double *h,
double &h11,
double &h22,
double &h33 ) ;
33 FtfBaseTrack::FtfBaseTrack ( ){
40 int FtfBaseTrack::fitHelix ( )
43 ftfLog (
" Problem in Fit_Circle " ) ;
50 ftfLog (
" Problem fitting a line " ) ;
67 int FtfBaseTrack::fitCircle ( )
75 for ( startLoop() ; done() ; nextHit() ) {
78 cHit->wxy = 1.0F/ (double)(cHit->dx*cHit->dx + cHit->dy*cHit->dy) ;
80 xav += cHit->wxy * cHit->x ;
81 yav += cHit->wxy * cHit->y ;
83 if ( getPara()->vertexConstrainedFit ) {
84 wsum += getPara()->xyWeightVertex ;
85 xav += getPara()->xVertex ;
86 yav += getPara()->yVertex ;
98 for ( startLoop() ; done() ; nextHit() ) {
102 xxav += xi * xi * cHit->wxy ;
103 xyav += xi * yi * cHit->wxy ;
104 yyav += yi * yi * cHit->wxy ;
106 if ( getPara()->vertexConstrainedFit ) {
107 xi = getPara()->xVertex - xav ;
108 yi = getPara()->yVertex - yav ;
109 xxav += xi * xi * getPara()->xyWeightVertex ;
110 xyav += xi * yi * getPara()->xyWeightVertex ;
111 yyav += yi * yi * getPara()->xyWeightVertex ;
123 double a = fabs( xxav - yyav ) ;
124 double b = 4.0 * xyav * xyav ;
126 double asqpb = a * a + b ;
127 double rasqpb = sqrt ( asqpb) ;
129 double splus = 1.0 + a / rasqpb ;
130 double sminus = b / (asqpb * splus) ;
132 splus = sqrt (0.5 * splus ) ;
133 sminus = sqrt (0.5 * sminus) ;
137 double sinrot, cosrot ;
138 if ( xxav <= yyav ) {
149 if ( xyav < 0.0 ) sinrot = - sinrot ;
158 if ( cosrot*xav+sinrot*yav < 0.0 ) {
165 double rrav = xxav + yyav ;
166 double rscale = ::sqrt(rrav) ;
173 double rrrrav = 0.0 ;
175 double xixi, yiyi, riri, wiriri, xold, yold ;
176 for ( startLoop() ; done() ; nextHit() ) {
178 xold = cHit->x - xav ;
179 yold = cHit->y - yav ;
183 xi = ( cosrot * xold + sinrot * yold ) / rscale ;
184 yi = ( -sinrot * xold + cosrot * yold ) / rscale ;
189 wiriri = cHit->wxy * riri ;
191 xyav += cHit->wxy * xi * yi ;
192 xxav += cHit->wxy * xixi ;
193 yyav += cHit->wxy * yiyi ;
195 xrrav += wiriri * xi ;
196 yrrav += wiriri * yi ;
197 rrrrav += wiriri * riri ;
202 if ( getPara()->vertexConstrainedFit ) {
203 xold = getPara()->xVertex - xav ;
204 yold = getPara()->yVertex - yav ;
208 xi = ( cosrot * xold + sinrot * yold ) / rscale ;
209 yi = ( -sinrot * xold + cosrot * yold ) / rscale ;
214 wiriri = getPara()->xyWeightVertex * riri ;
216 xyav += getPara()->xyWeightVertex * xi * yi ;
217 xxav += getPara()->xyWeightVertex * xixi ;
218 yyav += getPara()->xyWeightVertex * yiyi ;
220 xrrav += wiriri * xi ;
221 yrrav += wiriri * yi ;
222 rrrrav += wiriri * riri ;
231 xrrav = xrrav / wsum ;
232 yrrav = yrrav / wsum ;
233 rrrrav = rrrrav / wsum ;
241 double xrrxrr = xrrav * xrrav ;
242 double yrryrr = yrrav * yrrav ;
243 double rrrrm1 = rrrrav - 1.0 ;
244 double xxyy = xxav * yyav ;
246 double c0 = rrrrm1*xxyy - xrrxrr*yyav - yrryrr*xxav ;
247 double c1 = - rrrrm1 + xrrxrr + yrryrr - 4.0*xxyy ;
248 double c2 = 4.0 + rrrrm1 - 4.0*xxyy ;
253 double c2d = 2.0 * c2 ;
254 double c4d = 4.0 * c4 ;
260 double dlamda = 0.0 ;
262 double chiscl = wsum * rscale * rscale ;
263 double dlamax = 0.001 / chiscl ;
266 for (
int itry = 1 ; itry <= ntry ; itry++ ) {
267 p = c0 + lamda * (c1 + lamda * (c2 + lamda * lamda * c4 )) ;
268 pd = (c1 + lamda * (c2d + lamda * lamda * c4d)) ;
270 lamda = lamda + dlamda ;
271 if (fabs(dlamda)< dlamax)
break ;
274 chi2[0] = (double)(chiscl * lamda) ;
279 double h11 = xxav - lamda ;
281 double h22 = yyav - lamda ;
283 double h34 = 1.0 + 2.0*lamda ;
284 if ( h11 == 0.0 || h22 == 0.0 ){
285 ftfLog (
" Problems fitting a circle " ) ;
288 double rootsq = (h14*h14)/(h11*h11) + 4.0*h34 ;
290 double ratio, kappa, beta ;
291 if ( fabs(h22) > fabs(h24) ) {
293 rootsq = ratio * ratio + rootsq ;
294 kappa = 1.0 / ::sqrt(rootsq) ;
295 beta = - ratio * kappa ;
299 rootsq = 1.0 + ratio * ratio * rootsq ;
300 beta = 1.0 / ::sqrt(rootsq) ;
301 if ( h24 > 0 ) beta = - beta ;
302 kappa = -ratio * beta ;
304 double alpha = - (h14/h11) * kappa ;
309 double kappa1 = kappa / rscale ;
310 double dbro = 0.5 / kappa1 ;
314 double alphar = (cosrot * alpha - sinrot * beta)* dbro ;
315 double betar = (sinrot * alpha + cosrot * beta)* dbro ;
319 double acent = (double)(xav - alphar) ;
320 double bcent = (double)(yav - betar ) ;
321 double radius = (double)dbro ;
325 q = ( ( yrrav < 0 ) ? 1 : -1 ) ;
326 pt = (double)(2.9979e-3 * getPara()->bField * radius ) ;
331 if ( getPara()->vertexConstrainedFit ) {
333 x0 = getPara()->xVertex ;
334 y0 = getPara()->yVertex ;
335 phi0 = getPara()->phiVertex ;
336 r0 = getPara()->rVertex ;
337 psi = (double)atan2(bcent-y0,acent-x0) ;
338 psi = psi + q * 0.5F * pi ;
339 if ( psi < 0 ) psi = psi + twoPi ;
344 psi = (double)atan2(bcent-(lHit->y),acent-(lHit->x)) ;
345 x0 = acent - radius * cos(psi);
346 y0 = bcent - radius * sin(psi);
347 psi = psi + q * 0.5F * pi ;
349 if ( phi0 < 0 ) phi0 += twoPi ;
350 r0 = sqrt ( x0 * x0 + y0 * y0 ) ;
356 if ( getPara()->getErrors ) getErrorsCircleFit ( acent, bcent, radius ) ;
366 int FtfBaseTrack::fitLine ( )
380 double radius = (double)(pt / ( 2.9979e-3 * getPara()->bField ) ) ;
381 if ( getPara()->vertexConstrainedFit ) {
382 dx = ((
FtfBaseHit *)firstHit)->x - getPara()->xVertex ;
383 dy = ((
FtfBaseHit *)firstHit)->y - getPara()->yVertex ;
389 double localPsi = 0.5F * sqrt ( dx*dx + dy*dy ) / radius ;
391 if ( fabs(localPsi) < 1. ) {
392 total_s = 2.0F * radius * asin ( localPsi ) ;
396 total_s = 2.0F * radius * M_PI ;
402 for ( startLoop() ; done() ; nextHit() ) {
404 if ( currentHit != firstHit ) {
405 dx = cHit->x - previousHit->x ;
406 dy = cHit->y - previousHit->y ;
407 dpsi = 0.5F * (double)sqrt ( dx*dx + dy*dy ) / radius ;
412 cHit->s = previousHit->s - 2.0F * radius * (double)asin ( dpsi ) ;
418 ss += cHit->wz * cHit->s ;
419 sz += cHit->wz * cHit->z ;
420 sss += cHit->wz * cHit->s * cHit->s ;
421 ssz += cHit->wz * cHit->s * cHit->z ;
425 double det = sum * sss - ss * ss;
426 if ( fabs(det) < 1e-20){
433 tanl = (double)((sum * ssz - ss * sz ) / det );
434 z0 = (double)((sz * sss - ssz * ss ) / det );
440 for ( startLoop() ; done() ; nextHit() ) {
442 r1 = cHit->z - tanl * cHit->s - z0 ;
443 chi2[1] += (double) ( (
double)cHit->wz * (r1 * r1) );
452 dtanl = (double) ( sum / det );
453 dz0 = (double) ( sss / det );
476 int FtfBaseTrack::getErrorsCircleFit (
double a,
double b,
double r ) {
478 double h[9] = { 0. };
480 double h11, h22, h33 ;
482 static double ratio, c1, s1;
486 for (j = 0; j < 9; j++ ) {
494 if ( pt < getPara()->ptMinHelixFit ) {
495 for ( startLoop() ; done() ; nextHit() ) {
498 cHit->wxy = 1.0F/ (double)(cHit->dx*cHit->dx + cHit->dy*cHit->dy) ;
504 for ( startLoop() ; done() ; nextHit() ) {
508 hyp = (double)::sqrt( dx * dx + dy * dy );
512 h[0] += cHit->wxy * (ratio * (s1 * s1 - 1) + 1);
513 h[1] += cHit->wxy * ratio * s1 * c1;
514 h[2] += cHit->wxy * s1;
515 h[4] += cHit->wxy * (ratio * (c1 * c1 - 1) + 1);
516 h[5] += cHit->wxy * c1;
523 ftfMatrixDiagonal ( h, h11, h22, h33 ) ;
527 dpt = (double)(2.9979e-3 * getPara()->bField * h33 );
531 if ( getPara()->vertexConstrainedFit ) {
540 dpsi = (double)(( 1. / ( 1. + w*w ) ) * ( h22 / dx - dy * h11 / ( dx*dx ) )) ;
548 void FtfBaseTrack::Print (
int level )
556 pmom = (double)sqrt ( pz * pz + pt * pt ) ;
557 ftfLog (
" \n =======> Track %d <======== ",
id ) ;
558 ftfLog (
" \n p, pt, q %7.2f %7.2f %2d ", pmom, pt, q ) ;
561 ftfLog (
" \n r0, z0, nHits %7.2f %7.2f %d ", r0, z0, nHits ) ;
562 ftfLog (
" \n phi0, psi, tanl %7.2f %7.2f %7.2f ", phi0, psi, tanl ) ;
564 else ftfLog (
"\n " ) ;
567 ftfLog (
" \n chi2 (s,z) %6.2e %6.2e ", chi2[0],
570 else ftfLog (
"\n " ) ;
573 if ( fmod((
double)level,10.) > 0 ) {
574 ftfLog (
" \n *** Clusters in this track *** " ) ;
576 for ( startLoop() ; done() ; nextHit() ) {
592 Ftf3DHit FtfBaseTrack::closestApproach (
double xBeam,
double yBeam ) {
594 return getClosest ( xBeam, yBeam, rc, xc, yc ) ;
608 Ftf3DHit FtfBaseTrack::getClosest (
double xBeam,
double yBeam,
609 double &rc,
double &xc,
double &yc ) {
615 double tPhi0 = psi + double(q) * 0.5 * M_PI / fabs((
double)q) ;
617 double x0 = r0 * cos(phi0) ;
618 double y0 = r0 * sin(phi0) ;
619 rc = pt / ( bFactor * getPara()->bField ) ;
620 xc = x0 - rc * cos(tPhi0) ;
621 yc = y0 - rc * sin(tPhi0) ;
623 getClosest ( xBeam, yBeam, rc, xc, yc, xp, yp ) ;
628 double angle = atan2 ( (yp-yc), (xp-xc) ) ;
629 if ( angle < 0. ) angle = angle + 2.0 * M_PI ;
631 double dangle = angle - tPhi0 ;
633 if ( fabs(dangle) < 1.e-4 ) dangle = 0 ;
634 dangle = fmod ( dangle, 2.0 * M_PI ) ;
635 if ( (
float(q) * dangle) < 0 )
636 dangle = dangle + float(q) * 2. * M_PI ;
638 double stot = fabs(dangle) * rc ;
639 zp = z0 - stot * tanl ;
656 int FtfBaseTrack::getClosest (
double xBeam,
double yBeam,
657 double rc,
double xc,
double yc,
658 double& xClosest,
double& yClosest ) {
662 double dx = xc - xBeam ;
663 double dy = yc - yBeam ;
667 double fact = rc / sqrt ( dx * dx + dy * dy ) ;
668 double f1 = 1. + fact ;
669 double f2 = 1. - fact ;
671 double dx1 = dx * f1 ;
672 double dy1 = dy * f1 ;
673 double d1 = sqrt ( dx1 * dx1 + dy1 * dy1 ) ;
675 double dx2 = dx * f2 ;
676 double dy2 = dy * f2 ;
677 double d2 = sqrt ( dx2 * dx2 + dy2 * dy2 ) ;
682 xClosest = dx1 + xBeam ;
683 yClosest = dy1 + yBeam ;
686 xClosest = dx2 + xBeam ;
687 yClosest = dy2 + yBeam ;
706 Ftf3DHit FtfBaseTrack::extraRadius (
double r ) {
711 double x, y, z, rc, xc, yc ;
717 if ( extraRCyl ( r, phi, z, rc, xc, yc ) )
return tHit ;
743 int FtfBaseTrack::extraRCyl (
double &r,
double &phi,
double &z,
744 double &rc,
double &xc,
double &yc ) {
747 double fac1,sfac, fac2 ;
751 double tPhi0 = psi + double(q) * 0.5 * M_PI / fabs((
double)q) ;
752 double x0 = r0 * cos(phi0) ;
753 double y0 = r0 * sin(phi0) ;
754 rc = fabs(pt) / ( bFactor * getPara()->bField ) ;
755 xc = x0 - rc * cos(tPhi0) ;
756 yc = y0 - rc * sin(tPhi0) ;
760 fac1 = xc*xc + yc*yc ;
761 sfac = ::sqrt( fac1 ) ;
768 if ( fabs(sfac-rc) > r || fabs(sfac+rc) < r ) {
775 fac2 = ( r*r + fac1 - rc*rc) / (2.00 * r * sfac ) ;
776 phi = atan2(yc,xc) + float(q)*acos(fac2) ;
777 td = atan2(r*sin(phi) - yc,r*cos(phi) - xc) ;
780 if ( td < 0 ) td = td + 2. * M_PI ;
781 double dangle = tPhi0 - td ;
782 dangle = fmod ( dangle, 2.0 * M_PI ) ;
783 if ( r < r0 ) dangle *= -1 ;
785 if ( (
float(q) * dangle) < 0 ) dangle = dangle + float(q) * 2. * M_PI ;
787 double stot = fabs(dangle) * rc ;
789 if ( r > r0 ) z = z0 + stot * tanl ;
790 else z = z0 - stot * tanl ;
817 int FtfBaseTrack::intersectorZLine (
double a,
double b,
Ftf3DHit& cross ) {
820 if (0 != intersectorZLine(a, b, cross1, cross2))
823 double r1sq = cross1.x*cross1.x + cross1.y*cross1.y;
824 double r2sq = cross2.x*cross2.x + cross2.y*cross2.y;
835 int FtfBaseTrack::intersectorZLine (
double a,
double b,
840 double x0 = r0 * cos(phi0) ;
841 double y0 = r0 * sin(phi0) ;
842 double trackPhi0 = psi + q * 0.5 * M_PI / fabs((
double)q) ;
843 double rc = pt / ( bFactor * getPara()->bField ) ;
844 double xc = x0 - rc * cos(trackPhi0) ;
845 double yc = y0 - rc * sin(trackPhi0) ;
847 double ycPrime = yc - b ;
848 double aa = ( 1. + a * a ) ;
849 double bb = -2. * ( xc + a * ycPrime ) ;
850 double cc = ( xc * xc + ycPrime * ycPrime - rc * rc ) ;
852 double racine = bb * bb - 4. * aa * cc ;
858 double rootRacine = ::sqrt(racine) ;
860 double oneOverA = 1./aa;
864 double x1 = 0.5 * oneOverA * ( -1. * bb + rootRacine ) ;
865 double y1 = a * x1 + b ;
869 double x2 = 0.5 * oneOverA * ( -1. * bb - rootRacine ) ;
870 double y2 = a * x2 + b ;
876 double angle, dangle, stot;
878 angle = atan2 ( (y1-yc), (x1-xc) ) ;
879 if ( angle < 0. ) angle = angle + 2.0 * M_PI ;
881 dangle = angle - trackPhi0 ;
882 dangle = fmod ( dangle, 2.0 * M_PI ) ;
884 if ( (q * dangle) > 0 ) dangle = dangle - q * 2. * M_PI ;
886 stot = fabs(dangle) * rc ;
887 double z1 = z0 + stot * tanl ;
889 cross1.set ( x1, y1, z1 ) ;
895 angle = atan2 ( (y2-yc), (x2-xc) ) ;
896 if ( angle < 0. ) angle = angle + 2.0 * M_PI ;
898 dangle = angle - trackPhi0 ;
899 dangle = fmod ( dangle, 2.0 * M_PI ) ;
901 if ( (q * dangle) > 0 ) dangle = dangle - q * 2. * M_PI ;
903 stot = fabs(dangle) * rc ;
904 double z2 = z0 + stot * tanl ;
906 cross2.set ( x2, y2, z2 ) ;
926 int FtfBaseTrack::intersectorYCteLine (
double a,
Ftf3DHit& cross ) {
930 double x0 = r0*cos(phi0);
931 double y0 = r0*sin(phi0);
932 double trackPhi0= psi + q*0.5*M_PI/fabs(q);
933 double rcoc = pt / ( bFactor * getPara()->bField ) ;
934 double xcoc = x0 - (rcoc*cos(trackPhi0));
935 double ycoc = y0 - (rcoc*sin(trackPhi0));
941 double f1 = (xHit-xcoc)*(xHit-xcoc);
942 double r2 = rcoc*rcoc;
947 double sf2 = ::sqrt(r2-f1);
948 double y1 = ycoc + sf2;
949 double y2 = ycoc - sf2;
951 if ( fabs(y2) < fabs(y1) ) yHit=y2;
954 double angle = atan2 ( (yHit-ycoc), (xHit-xcoc) ) ;
955 if ( angle < 0. ) angle = angle + 2.0 * M_PI ;
957 double dangle = angle - trackPhi0 ;
958 dangle = fmod ( dangle, 2.0 * M_PI ) ;
959 if ( (q * dangle) > 0 ) dangle = dangle - q * 2. * M_PI ;
961 double stot = fabs(dangle) * rcoc ;
962 double zHit = z0 + stot * tanl;
964 cross.set(xHit,yHit,zHit);
982 double FtfBaseTrack::arcLength (
double x1,
double y1,
double x2,
double y2 )
984 double x0, y0, xc, yc, rc ;
985 double angle_1, angle_2, d_angle, sleng_xy, sleng ;
990 x0 = r0 * cos(phi0) ;
991 y0 = r0 * sin(phi0) ;
992 rc = pt / ( bFactor * getPara()->bField ) ;
993 double tPhi0 = psi + double(q) * 0.5 * M_PI / fabs((
double)q) ;
994 xc = x0 - rc * cos(tPhi0) ;
995 yc = y0 - rc * sin(tPhi0) ;
999 angle_1 = atan2 ( (y1-yc), (x1-xc) ) ;
1000 if ( angle_1 < 0 ) angle_1 = angle_1 + 2. * M_PI ;
1001 angle_2 = atan2 ( (y2-yc), (x2-xc) ) ;
1002 if ( angle_2 < 0 ) angle_2 = angle_2 + 2. * M_PI ;
1003 d_angle = double(q) * ( angle_1 - angle_2 ) ;
1004 d_angle = fmod ( d_angle, 2. * M_PI ) ;
1005 if ( d_angle < 0 ) d_angle = d_angle + 2. * M_PI ;
1009 sleng_xy = fabs ( rc ) * d_angle ;
1010 sleng = sleng_xy * sqrt ( 1.0 + tanl * tanl ) ;
1024 int FtfBaseTrack::phiRotate (
double deltaPhi ) {
1026 if ( phi0 > 2. * M_PI ) phi0 -= 2. * M_PI ;
1027 if ( phi0 < 0 ) phi0 += 2. * M_PI ;
1029 if ( psi > 2. * M_PI ) psi -= 2. * M_PI ;
1030 if ( psi < 0 ) psi += 2. * M_PI ;
1037 int FtfBaseTrack::refitHelix (
int mod,
int modEqual,
int rowMin,
int rowMax ) {
1040 if ( nHits < 1 || nHits > 500 ) {
1041 ftfLog (
"FtfBaseTrack:refitHelix: nHits %d out of range \n", nHits ) ;
1045 hitPointer* hitP =
new hitPointer[nHits];
1046 int nHitsOrig = nHits ;
1049 for ( startLoop() ; done() ; nextHit() ) {
1058 for (
int i = 0 ; i < nHitsOrig ; i++ ) {
1059 row = hitP[i]->row ;
1060 hitP[i]->nextTrackHit = 0 ;
1061 if ( row%mod != modEqual ) continue ;
1062 if ( row < rowMin || row > rowMax ) continue ;
1064 if ( firstHit == 0 ) firstHit = hitP[i] ;
1066 ((
FtfBaseHit *)lastHit)->nextTrackHit = (
void *)hitP[i] ;
1067 lastHit = (
void *)hitP[i] ;
1073 if ( nHits > 5 ) fitHelix ( ) ;
1079 for (
int i = 0 ; i < nHitsOrig ; i++ ) {
1080 row = hitP[i]->row ;
1081 if ( firstHit == 0 ) firstHit = hitP[i] ;
1083 ((
FtfBaseHit *)lastHit)->nextTrackHit = (
void *)hitP[i] ;
1084 lastHit = (
void *)hitP[i] ;
1104 void FtfBaseTrack::updateToRadius (
double radius ) {
1106 double phiExtra, zExtra, rCircle, xCircleCenter, yCircleCenter ;
1108 int ok = extraRCyl ( radius, phiExtra, zExtra, rCircle, xCircleCenter, yCircleCenter ) ;
1121 double xExtra = radius * cos(phiExtra) ;
1122 double yExtra = radius * sin(phiExtra) ;
1124 double tPhi = atan2(yExtra-yCircleCenter,xExtra-xCircleCenter);
1128 double tPsi = tPhi - double(q) * 0.5 * M_PI / fabs((
double)q) ;
1129 if ( tPsi > 2. * M_PI ) tPsi -= 2. * M_PI ;
1130 if ( tPsi < 0. ) tPsi += 2. * M_PI ;
1151 void FtfBaseTrack::updateToClosestApproach (
double xBeam,
double yBeam,
double rMax) {
1153 Ftf3DHit closest = getClosest ( xBeam, yBeam, rc, xc, yc ) ;
1157 double radius = ::sqrt(closest.x*closest.x+closest.y*closest.y);
1158 if ( radius > rMax ) return ;
1160 double tPhi = atan2(closest.y-yc,closest.x-xc);
1164 double tPsi = tPhi - double(q) * 0.5 * M_PI / fabs((
double)q) ;
1165 if ( tPsi > 2. * M_PI ) tPsi -= 2. * M_PI ;
1166 if ( tPsi < 0. ) tPsi += 2. * M_PI ;
1171 phi0 = atan2(closest.y,closest.x) ;
1172 if ( phi0 < 0 ) phi0 += 2. * M_PI ;
1191 Ftf3DHit FtfBaseTrack::extrapolate2PathLength(
double pathlength)
1196 double Bfield=getPara()->bField * 0.01;
1198 double lambda=atan(tanl);
1199 double kapa=(c*q*Bfield)/pt;
1200 double heli=-((q*Bfield)/fabs(q*Bfield));
1201 double phi=psi-heli*M_PI/2;
1203 double x0=r0*cos(phi0);
1204 double y0=r0*sin(phi0);
1207 CoordOfExtrapol.x = x0 + (1/kapa)*(cos(phi+heli*pathlength*kapa*cos(lambda))-cos(phi));
1208 CoordOfExtrapol.y = y0 + (1/kapa)*(sin(phi+heli*pathlength*kapa*cos(lambda))-sin(phi));
1209 CoordOfExtrapol.z = z0 + pathlength*sin(lambda);
1217 return CoordOfExtrapol;
1233 double FtfBaseTrack::getRadius()
1235 double radius=pt / ( bFactor * getPara()->bField );
1253 double FtfBaseTrack::getXCenter()
1255 double tPhi0 = psi + double(q) * 0.5 * M_PI / fabs((
double)q) ;
1257 double x0=r0*cos(phi0);
1259 return ( x0- getRadius() * cos(tPhi0) );
1274 double FtfBaseTrack::getYCenter()
1276 double tPhi0 = psi + double(q) * 0.5 * M_PI / fabs((
double)q) ;
1278 double y0=r0*sin(phi0);
1280 return ( y0 - getRadius() * sin(tPhi0) );
1283 void FtfBaseTrack::startLoop( ){ currentHit = firstHit ; } ;
1284 int FtfBaseTrack::done ( ) {
return currentHit != 0 ; } ;