00001
00002
00003
00004
00005
00006
00007
00008 #include <stdio.h>
00009 #include <math.h>
00010 #include "Stl3Util/foreign/daqFormats.h"
00011 #include "Stl3Util/ftf/FtfBaseTrack.h"
00012 #include "Stl3Util/gl3/gl3Hit.h"
00013
00014 #ifndef GL3TRACK
00015 #define GL3TRACK
00016
00017
00018 class gl3Track: public FtfBaseTrack {
00019 private:
00020 gl3Track* getNextTrack ( ) { return (gl3Track *)nextTrack ; } ;
00021 public:
00022 void* nextTrack ;
00023 int sector ;
00024 inline virtual void nextHit (){ currentHit = ((gl3Hit *)currentHit)->nextHit ; } ;
00025
00026 int addTrack ( gl3Track* ) ;
00027 void dropHits ( int rest, int rowMin, int rowMax ) ;
00028 gl3Track* merge ( FtfContainer *trackArea ) ;
00029 void Print ( int level ) ;
00030
00032
00033
00034 float getRealEta ( ) {
00035 float theta = atan2(1.,(double)tanl);
00036 float rEta = -1. * log (tan(theta/2.)) ;
00037 return rEta ;
00038 }
00040
00041
00042 void print ( ) {
00043 float gl3ToDeg = 180./acos(-1.);
00044 printf ( "pt %f tanl %f psi %f r0 %f z0 %f phi0 %f nHits %d\n",
00045 pt, tanl, psi, r0, z0, phi0*gl3ToDeg, nHits ) ;
00046 }
00048
00049
00050 void set ( short sectorIn, local_track* trk ) {
00051
00052 nHits = trk->nHits ;
00053 nDedx = trk->ndedx ;
00054 chi2[0] = float(trk->xy_chisq)/10. ;
00055 chi2[1] = float(trk->sz_chisq)/10. ;
00056 dedx = trk->dedx ;
00057 pt = fabs(trk->pt) ;
00058 psi = trk->psi ;
00059 tanl = trk->tanl ;
00060 eta = getRealEta();
00061 z0 = trk->z0 ;
00062 length = trk->trackLength ;
00063 innerMostRow= trk->innerMostRow ;
00064 outerMostRow= trk->outerMostRow ;
00065 r0 = trk->r0 ;
00066 q = (short )(trk->pt/fabs(trk->pt)) ;
00067 phi0 = trk->phi0 ;
00068 dpt = float(trk->dpt)/32768. * pt ;
00069 dpsi = DecompressOver1(trk->dpsi,psi);
00070 dtanl = DecompressOver1(trk->dtanl,tanl)/64.;
00071 dz0 = float(trk->dz0)/1024. ;
00072 nextTrack = 0 ;
00073 firstHit = 0 ;
00074 lastHit = 0 ;
00075
00076
00077
00078 if ( dpt == 0 ) dpt = 1.e-5 * pt ;
00079 if ( dpsi == 0 ) dpsi = 1.e-5 ;
00080 if ( dtanl == 0 ) dtanl = 1.e-5 ;
00081 if ( dz0 == 0 ) dz0 = 1.e-3 ;
00082
00083 }
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 };
00105
00106 #endif