Line data Source code
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 : #include "AliHLTTPCCABaseTrackParam.h"
17 :
18 : class AliHLTTPCCATrackLinearisation;
19 :
20 : /**
21 : * @class AliHLTTPCCATrackParam
22 : *
23 : * AliHLTTPCCATrackParam class describes the track parametrisation
24 : * which is used by the AliHLTTPCCATracker slice tracker.
25 : *
26 : */
27 : MEM_CLASS_PRE() class AliHLTTPCCATrackParam
28 : {
29 : public:
30 :
31 : struct AliHLTTPCCATrackFitParam {
32 : float fBethe, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters
33 : };
34 :
35 0 : GPUd() MakeType(const MEM_LG(AliHLTTPCCABaseTrackParam)&) GetParam() const { return fParam; }
36 0 : GPUd() void SetParam(const MEM_LG(AliHLTTPCCABaseTrackParam)& v) { fParam = v; }
37 : GPUd() void InitParam();
38 :
39 0 : GPUd() float X() const { return fParam.X(); }
40 0 : GPUd() float Y() const { return fParam.Y(); }
41 0 : GPUd() float Z() const { return fParam.Z(); }
42 0 : GPUd() float SinPhi() const { return fParam.SinPhi(); }
43 0 : GPUd() float DzDs() const { return fParam.DzDs(); }
44 0 : GPUd() float QPt() const { return fParam.QPt(); }
45 0 : GPUd() float SignCosPhi() const { return fSignCosPhi; }
46 0 : GPUd() float Chi2() const { return fChi2; }
47 0 : GPUd() int NDF() const { return fNDF; }
48 :
49 0 : GPUd() float Err2Y() const { return fC[0]; }
50 0 : GPUd() float Err2Z() const { return fC[2]; }
51 0 : GPUd() float Err2SinPhi() const { return fC[5]; }
52 0 : GPUd() float Err2DzDs() const { return fC[9]; }
53 0 : GPUd() float Err2QPt() const { return fC[14]; }
54 :
55 0 : GPUd() float GetX() const { return fParam.GetX(); }
56 0 : GPUd() float GetY() const { return fParam.GetY(); }
57 0 : GPUd() float GetZ() const { return fParam.GetZ(); }
58 0 : GPUd() float GetSinPhi() const { return fParam.GetSinPhi(); }
59 0 : GPUd() float GetDzDs() const { return fParam.GetDzDs(); }
60 0 : GPUd() float GetQPt() const { return fParam.GetQPt(); }
61 0 : GPUd() float GetSignCosPhi() const { return fSignCosPhi; }
62 0 : GPUd() float GetChi2() const { return fChi2; }
63 0 : GPUd() int GetNDF() const { return fNDF; }
64 :
65 0 : GPUd() float GetKappa( float Bz ) const { return fParam.GetKappa(Bz); }
66 0 : GPUd() float GetCosPhi() const { return fSignCosPhi*CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
67 :
68 0 : GPUd() float GetErr2Y() const { return fC[0]; }
69 0 : GPUd() float GetErr2Z() const { return fC[2]; }
70 0 : GPUd() float GetErr2SinPhi() const { return fC[5]; }
71 0 : GPUd() float GetErr2DzDs() const { return fC[9]; }
72 0 : GPUd() float GetErr2QPt() const { return fC[14]; }
73 :
74 0 : GPUhd() MakeType(const float*) Par() const { return fParam.Par(); }
75 0 : GPUhd() const float *Cov() const { return fC; }
76 :
77 0 : GPUd() const float *GetPar() const { return fParam.GetPar(); }
78 0 : GPUd() float GetPar(int i) const { return(fParam.GetPar(i)); }
79 0 : GPUd() const float *GetCov() const { return fC; }
80 0 : GPUd() float GetCov(int i) const {return fC[i]; }
81 :
82 0 : GPUhd() void SetPar( int i, float v ) { fParam.SetPar(i, v); }
83 0 : GPUhd() void SetCov( int i, float v ) { fC[i] = v; }
84 :
85 0 : GPUd() void SetX( float v ) { fParam.SetX(v); }
86 0 : GPUd() void SetY( float v ) { fParam.SetY(v); }
87 0 : GPUd() void SetZ( float v ) { fParam.SetZ(v); }
88 0 : GPUd() void SetSinPhi( float v ) { fParam.SetSinPhi(v); }
89 0 : GPUd() void SetDzDs( float v ) { fParam.SetDzDs(v); }
90 0 : GPUd() void SetQPt( float v ) { fParam.SetQPt(v); }
91 0 : GPUd() void SetSignCosPhi( float v ) { fSignCosPhi = v >= 0 ? 1 : -1; }
92 0 : GPUd() void SetChi2( float v ) { fChi2 = v; }
93 0 : GPUd() void SetNDF( int v ) { fNDF = v; }
94 :
95 : GPUd() float GetDist2( const AliHLTTPCCATrackParam &t ) const;
96 : GPUd() float GetDistXZ2( const AliHLTTPCCATrackParam &t ) const;
97 :
98 : GPUd() float GetS( float x, float y, float Bz ) const;
99 :
100 : GPUd() void GetDCAPoint( float x, float y, float z,
101 : float &px, float &py, float &pz, float Bz ) const;
102 :
103 : GPUd() bool TransportToX( float x, float Bz, float maxSinPhi = .999 );
104 : GPUd() bool TransportToXWithMaterial( float x, float Bz, float maxSinPhi = .999 );
105 :
106 : GPUd() bool TransportToX( float x, AliHLTTPCCATrackLinearisation &t0,
107 : float Bz, float maxSinPhi = .999, float *DL = 0 );
108 :
109 : GPUd() bool TransportToX( float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi = .999 );
110 :
111 :
112 : GPUd() bool TransportToXWithMaterial( float x, AliHLTTPCCATrackLinearisation &t0,
113 : AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
114 :
115 : GPUd() bool TransportToXWithMaterial( float x,
116 : AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
117 :
118 : GPUd() static float ApproximateBetheBloch( float beta2 );
119 : GPUd() static float BetheBlochGeant( float bg,
120 : float kp0 = 2.33,
121 : float kp1 = 0.20,
122 : float kp2 = 3.00,
123 : float kp3 = 173e-9,
124 : float kp4 = 0.49848
125 : );
126 : GPUd() static float BetheBlochSolid( float bg );
127 : GPUd() static float BetheBlochGas( float bg );
128 :
129 : GPUd() void CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass = 0.13957 );
130 : GPUd() bool CorrectForMeanMaterial( float xOverX0, float xTimesRho, const AliHLTTPCCATrackFitParam &par );
131 :
132 : GPUd() bool Rotate( float alpha, float maxSinPhi = .999 );
133 : GPUd() bool Rotate( float alpha, AliHLTTPCCATrackLinearisation &t0, float maxSinPhi = .999 );
134 : GPUd() bool Filter( float y, float z, float err2Y, float err2Z, float maxSinPhi = .999 );
135 :
136 : GPUd() bool CheckNumericalQuality() const;
137 :
138 : GPUd() void Print() const;
139 :
140 : #ifndef HLTCA_GPUCODE
141 : private:
142 : #endif //!HLTCA_GPUCODE
143 : MEM_LG(AliHLTTPCCABaseTrackParam) fParam; // Track Parameters
144 :
145 : private:
146 : //WARNING, Track Param Data is copied in the GPU Tracklet Constructor element by element instead of using copy constructor!!!
147 : //This is neccessary for performance reasons!!!
148 : //Changes to Elements of this class therefore must also be applied to TrackletConstructor!!!
149 : float fC[15]; // the covariance matrix for Y,Z,SinPhi,..
150 : float fSignCosPhi; // sign of cosPhi
151 : float fChi2; // the chi^2 value
152 : int fNDF; // the Number of Degrees of Freedom
153 : };
154 :
155 : GPUd() MEM_CLASS_PRE() inline void MEM_LG(AliHLTTPCCATrackParam)::InitParam()
156 : {
157 : //Initialize Tracklet Parameters using default values
158 0 : SetSinPhi( 0 );
159 0 : SetDzDs( 0 );
160 0 : SetQPt( 0 );
161 0 : SetSignCosPhi( 1 );
162 0 : SetChi2( 0 );
163 0 : SetNDF( -3 );
164 0 : SetCov( 0, 1 );
165 0 : SetCov( 1, 0 );
166 0 : SetCov( 2, 1 );
167 0 : SetCov( 3, 0 );
168 0 : SetCov( 4, 0 );
169 0 : SetCov( 5, 1 );
170 0 : SetCov( 6, 0 );
171 0 : SetCov( 7, 0 );
172 0 : SetCov( 8, 0 );
173 0 : SetCov( 9, 1 );
174 0 : SetCov( 10, 0 );
175 0 : SetCov( 11, 0 );
176 0 : SetCov( 12, 0 );
177 0 : SetCov( 13, 0 );
178 0 : SetCov( 14, 10. );
179 0 : }
180 :
181 : #endif //ALIHLTTPCCATRACKPARAM_H
|