00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef FTFBASETRACK
00012 #define FTFBASETRACK
00013 #include "Stl3Util/ftf/FtfGeneral.h"
00014 #include "Stl3Util/ftf/FtfBaseHit.h"
00015 #include "Stl3Util/ftf/FtfPara.h"
00016
00017 class FtfBaseTrack
00018 {
00019
00020 public:
00021 FtfBaseTrack ( ) ;
00022 virtual ~FtfBaseTrack(){};
00023 void *firstHit;
00024 void *lastHit ;
00025 void *currentHit ;
00026 int fitHelix ( ) ;
00027 int refitHelix ( int mode, int modEqual, int rowMin, int rowMax ) ;
00028 int fitCircle ( ) ;
00029 int fitLine ( ) ;
00030 FtfBaseHit* getCurrentHit ( ) { return (FtfBaseHit *)currentHit ; } ;
00031 FtfPara* getPara() { return (FtfPara *)para ; } ;
00032 int getErrorsCircleFit ( double a, double b, double r ) ;
00033
00034
00035 double arcLength ( double x1, double y1, double x2, double y2 ) ;
00036 Ftf3DHit closestApproach ( double xBeam, double yBeam ) ;
00037 Ftf3DHit extraRadius ( double r ) ;
00038 int extraRCyl ( double &r, double &phi, double &z,
00039 double &rc, double &xc, double &yc ) ;
00040 int intersectorZLine ( double a, double b,
00041 Ftf3DHit& cross1, Ftf3DHit& cross2 ) ;
00042 int intersectorZLine ( double a, double b, Ftf3DHit& cross ) ;
00043 int intersectorYCteLine ( double a, Ftf3DHit& cross ) ;
00044 Ftf3DHit getClosest ( double xBeam, double yBeam,
00045 double &rc, double &xc, double &yc ) ;
00046 int getClosest ( double xBeam, double yBeam,
00047 double rc, double xc, double yc,
00048 double &xClosest, double &yClosest ) ;
00049
00050 void updateToRadius ( double r ) ;
00051 void updateToClosestApproach ( double xBeam, double yBeam, double rMax=10000 ) ;
00052 int phiRotate ( double deltaPhi ) ;
00053
00054 Ftf3DHit extrapolate2PathLength(double pathlength);
00055 double getRadius();
00056 double getXCenter();
00057 double getYCenter();
00058
00059 virtual void startLoop( );
00060 virtual void nextHit ( ) = 0 ;
00061 virtual int done ( );
00062 void Print ( int level ) ;
00063
00064
00065 int id ;
00066 short flag ;
00067 char innerMostRow ;
00068 char outerMostRow ;
00069 short nHits ;
00070 short nDedx ;
00071 short q ;
00072 double chi2[2];
00073 double dedx;
00074 double pt ;
00075 double phi0;
00076 double psi ;
00077 double r0 ;
00078 double tanl;
00079 double z0 ;
00080 double length ;
00081 double dpt ;
00082 double dpsi;
00083 double dz0 ;
00084 double eta ;
00085 double dtanl ;
00086
00087 void *para ;
00088
00089 unsigned short CompressOver1(double,double);
00090 double DecompressOver1(unsigned short,double);
00091
00092 } ;
00093
00094 inline unsigned short FtfBaseTrack::CompressOver1(double v1,double v2) {
00095
00096 double intermed = v1/fabs(v2);
00097 return (intermed < 1 ? (unsigned short) (intermed*32768.) :
00098 (intermed > 1024. ? 65535 :
00099 32768 + (unsigned short) ((intermed - 1.)*32.)));
00100 }
00101 inline double FtfBaseTrack::DecompressOver1(unsigned short v1,double v2) {
00102 return fabs(v2)*(v1 <= 32768 ? ((double) v1)/32768. :
00103 ((double) (v1 - 32768))/32. + 1.);
00104 }
00105
00106
00107 #endif
00108