StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
gl3Track.h
1 //:>------------------------------------------------------------------
2 //: FILE: gl3Tracks.h
3 //: HISTORY:
4 //: 6dec1999 version 1.00
5 //: 2feb2000 add sector to add methods
6 //: 27jul2000 add methods to drop hits
7 //:<------------------------------------------------------------------
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <math.h>
11 
12 #ifndef TRG_VERSION
13 #define TRG_VERSION 0x32
14 #endif
15 
16 #include "daqFormats.h"
17 #include "FtfTrack.h"
18 //#include "l3List.h"
19 #include "gl3Hit.h"
20 
21 #ifndef GL3TRACK
22 #define GL3TRACK
23 
24 
25 class gl3Track: public FtfBaseTrack {
26 private:
27  gl3Track* getNextTrack ( ) { return (gl3Track *)nextTrack ; } ;
28 public:
29  void* nextTrack ;
30  int sector ;
31  float dca;
32 
33  inline virtual void nextHit ()
34  { currentHit = ((gl3Hit *)currentHit)->nextHit ; } ;
35 
36  int addTrack ( gl3Track* ) ;
37  void dropHits ( int rest, int rowMin, int rowMax ) ;
38  gl3Track* merge ( FtfContainer *trackArea ) ;
39  void Print ( int level ) ;
40 
41  void setDca(Ftf3DHit vertex);
42 
44  //
45  //#######################################################################
46  float getRealEta ( ) {
47  float theta = atan2(1.,(double)tanl);
48  float rEta = -1. * log (tan(theta/2.)) ;
49  return rEta ;
50  }
52  //
53  //#######################################################################
54  void print ( ) {
55  float gl3ToDeg = 180./acos(-1.);
56  printf ( "pt %f tanl %f psi %f r0 %f z0 %f phi0 %f nHits %d\n",
57  pt, tanl, psi, r0, z0, phi0*gl3ToDeg, nHits ) ;
58  }
60  //
61  //#######################################################################
62  void set ( short sectorIn, local_track* trk ) {
63  // id = sectorIn * 10000 + abs(trk->id) ;
64  nHits = trk->nHits ;
65  nDedx = trk->ndedx ;
66  chi2[0] = float(trk->xy_chisq)/10. ;
67  chi2[1] = float(trk->sz_chisq)/10. ;
68  dedx = trk->dedx ;
69  pt = fabs(trk->pt) ;
70  psi = trk->psi ;
71  tanl = trk->tanl ;
72  eta = getRealEta();
73  z0 = trk->z0 ;
74  length = trk->trackLength ;
75  innerMostRow= trk->innerMostRow ;
76  outerMostRow= trk->outerMostRow ;
77  r0 = trk->r0 ;
78  q = (short )(trk->pt/fabs(trk->pt)) ;
79  phi0 = trk->phi0 ;
80  dpt = float(trk->dpt)/32768. * pt ;
81  dpsi = DecompressOver1(trk->dpsi,psi);
82  dtanl = DecompressOver1(trk->dtanl,tanl)/64.;
83  dz0 = float(trk->dz0)/1024. ;
84  nextTrack = 0 ;
85  firstHit = 0 ;
86  lastHit = 0 ;
87 
88  dca = -1;
89  //
90  // Check errors are not zero
91  //
92  if ( dpt == 0 ) dpt = 1.e-5 * pt ;
93  if ( dpsi == 0 ) dpsi = 1.e-5 ;
94  if ( dtanl == 0 ) dtanl = 1.e-5 ;
95  if ( dz0 == 0 ) dz0 = 1.e-3 ;
96 
97  }
99  //
100  //#######################################################################
101  void set ( FtfTrack* trk ) {
102  id = abs(trk->id) ;
103  printf ( "set %d\n", id ) ;
104  nHits = trk->nHits;
105  chi2[0] = trk->chi2[0] ;
106  chi2[1] = trk->chi2[1] ;
107  dedx = trk->dedx ;
108  pt = fabs(trk->pt) ;
109  psi = trk->psi ;
110  tanl = trk->tanl ;
111  z0 = trk->z0 ;
112  length = trk->length ;
113  r0 = trk->r0 ;
114  phi0 = trk->phi0 ;
115  q = trk->q ;
116  dtanl = dpsi = dpt = 0. ;
117 
118  dca = -1;
119  }
120 };
121 
122 #endif
void print()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition: gl3Track.h:54
void set(short sectorIn, local_track *trk)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition: gl3Track.h:62
float getRealEta()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition: gl3Track.h:46
Definition: gl3Hit.h:24
void set(FtfTrack *trk)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition: gl3Track.h:101