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 <math.h>
10 #include "Stl3Util/foreign/daqFormats.h"
11 #include "Stl3Util/ftf/FtfBaseTrack.h"
12 #include "Stl3Util/gl3/gl3Hit.h"
13 
14 #ifndef GL3TRACK
15 #define GL3TRACK
16 
17 
18 class gl3Track: public FtfBaseTrack {
19 private:
20  gl3Track* getNextTrack ( ) { return (gl3Track *)nextTrack ; } ;
21 public:
22  void* nextTrack ;
23  int sector ;
24  inline virtual void nextHit (){ currentHit = ((gl3Hit *)currentHit)->nextHit ; } ;
25 
26  int addTrack ( gl3Track* ) ;
27  void dropHits ( int rest, int rowMin, int rowMax ) ;
28  gl3Track* merge ( FtfContainer *trackArea ) ;
29  void Print ( int level ) ;
30 
32 //
33 //############################################################################
34  float getRealEta ( ) {
35  float theta = atan2(1.,(double)tanl);
36  float rEta = -1. * log (tan(theta/2.)) ;
37  return rEta ;
38  }
40 //
41 //############################################################################
42  void print ( ) {
43  float gl3ToDeg = 180./acos(-1.);
44  printf ( "pt %f tanl %f psi %f r0 %f z0 %f phi0 %f nHits %d\n",
45  pt, tanl, psi, r0, z0, phi0*gl3ToDeg, nHits ) ;
46  }
48 //
49 //############################################################################
50  void set ( short sectorIn, local_track* trk ) {
51 // id = sectorIn * 10000 + abs(trk->id) ;
52  nHits = trk->nHits ;
53  nDedx = trk->ndedx ;
54  chi2[0] = float(trk->xy_chisq)/10. ;
55  chi2[1] = float(trk->sz_chisq)/10. ;
56  dedx = trk->dedx ;
57  pt = fabs(trk->pt) ;
58  psi = trk->psi ;
59  tanl = trk->tanl ;
60  eta = getRealEta();
61  z0 = trk->z0 ;
62  length = trk->trackLength ;
63  innerMostRow= trk->innerMostRow ;
64  outerMostRow= trk->outerMostRow ;
65  r0 = trk->r0 ;
66  q = (short )(trk->pt/fabs(trk->pt)) ;
67  phi0 = trk->phi0 ;
68  dpt = float(trk->dpt)/32768. * pt ;
69  dpsi = DecompressOver1(trk->dpsi,psi);
70  dtanl = DecompressOver1(trk->dtanl,tanl)/64.;
71  dz0 = float(trk->dz0)/1024. ;
72  nextTrack = 0 ;
73  firstHit = 0 ;
74  lastHit = 0 ;
75  //
76  // Check errors are not zero
77  //
78  if ( dpt == 0 ) dpt = 1.e-5 * pt ;
79  if ( dpsi == 0 ) dpsi = 1.e-5 ;
80  if ( dtanl == 0 ) dtanl = 1.e-5 ;
81  if ( dz0 == 0 ) dz0 = 1.e-3 ;
82 
83  }
85 //
86 //############################################################################
87 /* void set ( FtfTrack* trk ) { */
88 /* id = abs(trk->id) ; */
89 /* printf ( "set %d\n", id ) ; */
90 /* nHits = trk->nHits; */
91 /* chi2[0] = trk->chi2[0] ; */
92 /* chi2[1] = trk->chi2[1] ; */
93 /* dedx = trk->dedx ; */
94 /* pt = fabs(trk->pt) ; */
95 /* psi = trk->psi ; */
96 /* tanl = trk->tanl ; */
97 /* z0 = trk->z0 ; */
98 /* length = trk->length ; */
99 /* r0 = trk->r0 ; */
100 /* phi0 = trk->phi0 ; */
101 /* q = trk->q ; */
102 /* dtanl = dpsi = dpt = 0. ; */
103 /* } */
104 };
105 
106 #endif
void print()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition: gl3Track.h:42
void set(short sectorIn, local_track *trk)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition: gl3Track.h:50
float getRealEta()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition: gl3Track.h:34
Definition: gl3Hit.h:24