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 *
8 //*************************************************************************
11 #ifndef ALIHLTTPCCATRACKPARAM_H
12 #define ALIHLTTPCCATRACKPARAM_H
14 #include "AliHLTTPCCADef.h"
15 #include "AliHLTTPCCAMath.h"
17 class AliHLTTPCCATrackLinearisation;
20 * @class AliHLTTPCCATrackParam
22 * AliHLTTPCCATrackParam class describes the track parametrisation
23 * which is used by the AliHLTTPCCATracker slice tracker.
26 class AliHLTTPCCATrackParam
30 struct AliHLTTPCCATrackFitParam {
31 float fBethe, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters
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; }
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]; }
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; }
60 GPUd() float GetKappa( float Bz ) const { return fP[4]*Bz; }
61 GPUd() float GetCosPhi() const { return fSignCosPhi*CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
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]; }
69 GPUhd() const float *Par() const { return fP; }
70 GPUhd() const float *Cov() const { return fC; }
72 const float *GetPar() const { return fP; }
73 const float *GetCov() const { return fC; }
75 GPUhd() void SetPar( int i, float v ) { fP[i] = v; }
76 GPUhd() void SetCov( int i, float v ) { fC[i] = v; }
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; }
89 GPUd() float GetDist2( const AliHLTTPCCATrackParam &t ) const;
90 GPUd() float GetDistXZ2( const AliHLTTPCCATrackParam &t ) const;
93 GPUd() float GetS( float x, float y, float Bz ) const;
95 GPUd() void GetDCAPoint( float x, float y, float z,
96 float &px, float &py, float &pz, float Bz ) const;
99 GPUd() bool TransportToX( float x, float Bz, float maxSinPhi = .999 );
100 GPUd() bool TransportToXWithMaterial( float x, float Bz, float maxSinPhi = .999 );
102 GPUd() bool TransportToX( float x, AliHLTTPCCATrackLinearisation &t0,
103 float Bz, float maxSinPhi = .999, float *DL = 0 );
105 GPUd() bool TransportToX( float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi = .999 );
108 GPUd() bool TransportToXWithMaterial( float x, AliHLTTPCCATrackLinearisation &t0,
109 AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
111 GPUd() bool TransportToXWithMaterial( float x,
112 AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
116 GPUd() static float ApproximateBetheBloch( float beta2 );
117 GPUd() static float BetheBlochGeant( float bg,
124 GPUd() static float BetheBlochSolid( float bg );
125 GPUd() static float BetheBlochGas( float bg );
128 GPUd() void CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass = 0.13957 );
129 GPUd() bool CorrectForMeanMaterial( float xOverX0, float xTimesRho, const AliHLTTPCCATrackFitParam &par );
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 );
135 GPUd() bool CheckNumericalQuality() const;
137 GPUd() void Print() const;
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