]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCATrackParam.h
bug fixes:
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCATrackParam.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 // ************************************************************************
4 // This file is property of and copyright by the ALICE HLT Project        *
5 // ALICE Experiment at CERN, All rights reserved.                         *
6 // See cxx source for full Copyright notice                               *
7 //                                                                        *
8 //*************************************************************************
9
10
11 #ifndef ALIHLTTPCCATRACKPARAM_H
12 #define ALIHLTTPCCATRACKPARAM_H
13
14 #include "AliHLTTPCCADef.h"
15 #include "AliHLTTPCCAMath.h"
16
17 class AliHLTTPCCATrackLinearisation;
18
19 /**
20  * @class AliHLTTPCCATrackParam
21  *
22  * AliHLTTPCCATrackParam class describes the track parametrisation
23  * which is used by the AliHLTTPCCATracker slice tracker.
24  *
25  */
26 class AliHLTTPCCATrackParam
27 {
28   public:
29
30     struct AliHLTTPCCATrackFitParam {
31       float fBethe, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters
32     };
33
34     GPUd() float X()      const { return fX;    }
35     GPUd() float Y()      const { return fP[0]; }
36     GPUd() float Z()      const { return fP[1]; }
37     GPUd() float SinPhi() const { return fP[2]; }
38     GPUd() float DzDs()   const { return fP[3]; }
39     GPUd() float QPt()    const { return fP[4]; }
40     GPUd() float SignCosPhi() const { return fSignCosPhi; }
41     GPUd() float Chi2()  const { return fChi2; }
42     GPUd() int   NDF()   const { return fNDF; }
43
44     float Err2Y()      const { return fC[0]; }
45     float Err2Z()      const { return fC[2]; }
46     float Err2SinPhi() const { return fC[5]; }
47     float Err2DzDs()   const { return fC[9]; }
48     float Err2QPt()    const { return fC[14]; }
49
50     GPUd() float GetX()      const { return fX; }
51     GPUd() float GetY()      const { return fP[0]; }
52     GPUd() float GetZ()      const { return fP[1]; }
53     GPUd() float GetSinPhi() const { return fP[2]; }
54     GPUd() float GetDzDs()   const { return fP[3]; }
55     GPUd() float GetQPt()    const { return fP[4]; }
56     GPUd() float GetSignCosPhi() const { return fSignCosPhi; }
57     GPUd() float GetChi2()   const { return fChi2; }
58     GPUd() int   GetNDF()    const { return fNDF; }
59
60     GPUd() float GetKappa( float Bz ) const { return fP[4]*Bz; }
61     GPUd() float GetCosPhi() const { return fSignCosPhi*CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
62
63     GPUd() float GetErr2Y()      const { return fC[0]; }
64     GPUd() float GetErr2Z()      const { return fC[2]; }
65     GPUd() float GetErr2SinPhi() const { return fC[5]; }
66     GPUd() float GetErr2DzDs()   const { return fC[9]; }
67     GPUd() float GetErr2QPt()    const { return fC[14]; }
68
69     GPUhd() const float *Par() const { return fP; }
70     GPUhd() const float *Cov() const { return fC; }
71
72     const float *GetPar() const { return fP; }
73     const float *GetCov() const { return fC; }
74
75     GPUhd() void SetPar( int i, float v ) { fP[i] = v; }
76     GPUhd() void SetCov( int i, float v ) { fC[i] = v; }
77
78     GPUd() void SetX( float v )     {  fX = v;    }
79     GPUd() void SetY( float v )     {  fP[0] = v; }
80     GPUd() void SetZ( float v )     {  fP[1] = v; }
81     GPUd() void SetSinPhi( float v ) {  fP[2] = v; }
82     GPUd() void SetDzDs( float v )  {  fP[3] = v; }
83     GPUd() void SetQPt( float v )   {  fP[4] = v; }
84     GPUd() void SetSignCosPhi( float v ) {  fSignCosPhi = v>=0 ?1 :-1; }
85     GPUd() void SetChi2( float v )  {  fChi2 = v; }
86     GPUd() void SetNDF( int v )   { fNDF = v; }
87
88
89     GPUd() float GetDist2( const AliHLTTPCCATrackParam &t ) const;
90     GPUd() float GetDistXZ2( const AliHLTTPCCATrackParam &t ) const;
91
92
93     GPUd() float GetS( float x, float y, float Bz  ) const;
94
95     GPUd() void GetDCAPoint( float x, float y, float z,
96                              float &px, float &py, float &pz, float Bz  ) const;
97
98
99     GPUd() bool TransportToX( float x, float Bz, float maxSinPhi = .999 );
100     GPUd() bool TransportToXWithMaterial( float x, float Bz, float maxSinPhi = .999 );
101
102     GPUd() bool  TransportToX( float x, AliHLTTPCCATrackLinearisation &t0,
103                                float Bz,  float maxSinPhi = .999, float *DL = 0 );
104
105     GPUd() bool  TransportToX( float x, float sinPhi0, float cosPhi0,  float Bz, float maxSinPhi = .999 );
106
107
108     GPUd() bool  TransportToXWithMaterial( float x,  AliHLTTPCCATrackLinearisation &t0,
109                                            AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
110
111     GPUd() bool  TransportToXWithMaterial( float x,
112                                            AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
113
114
115
116     GPUd() static float ApproximateBetheBloch( float beta2 );
117     GPUd() static float BetheBlochGeant( float bg,
118                                          float kp0 = 2.33,
119                                          float kp1 = 0.20,
120                                          float kp2 = 3.00,
121                                          float kp3 = 173e-9,
122                                          float kp4 = 0.49848
123                                        );
124     GPUd() static float BetheBlochSolid( float bg );
125     GPUd() static float BetheBlochGas( float bg );
126
127
128     GPUd() void CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass = 0.13957 );
129     GPUd() bool CorrectForMeanMaterial( float xOverX0,  float xTimesRho, const AliHLTTPCCATrackFitParam &par );
130
131     GPUd() bool Rotate( float alpha, float maxSinPhi = .999 );
132     GPUd() bool Rotate( float alpha, AliHLTTPCCATrackLinearisation &t0, float maxSinPhi = .999 );
133     GPUd() bool Filter( float y, float z, float err2Y, float err2Z, float maxSinPhi = .999 );
134
135     GPUd() bool CheckNumericalQuality() const;
136
137     GPUd() void Print() const;
138
139   private:
140
141     float fX;      // x position
142     float fSignCosPhi; // sign of cosPhi
143     float fP[5];   // 'active' track parameters: Y, Z, SinPhi, DzDs, q/Pt
144     float fC[15];  // the covariance matrix for Y,Z,SinPhi,..
145     float fChi2;   // the chi^2 value
146     int   fNDF;    // the Number of Degrees of Freedom
147 };
148
149 #endif