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"
16 #include "AliHLTTPCCABaseTrackParam.h"
18 class AliHLTTPCCATrackLinearisation;
21 * @class AliHLTTPCCATrackParam
23 * AliHLTTPCCATrackParam class describes the track parametrisation
24 * which is used by the AliHLTTPCCATracker slice tracker.
27 MEM_CLASS_PRE() class AliHLTTPCCATrackParam
31 struct AliHLTTPCCATrackFitParam {
32 float fBethe, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters
35 GPUd() MakeType(const MEM_LG(AliHLTTPCCABaseTrackParam)&) GetParam() const { return fParam; }
36 GPUd() void SetParam(const MEM_LG(AliHLTTPCCABaseTrackParam)& v) { fParam = v; }
37 GPUd() void InitParam();
39 GPUd() float X() const { return fParam.X(); }
40 GPUd() float Y() const { return fParam.Y(); }
41 GPUd() float Z() const { return fParam.Z(); }
42 GPUd() float SinPhi() const { return fParam.SinPhi(); }
43 GPUd() float DzDs() const { return fParam.DzDs(); }
44 GPUd() float QPt() const { return fParam.QPt(); }
45 GPUd() float SignCosPhi() const { return fSignCosPhi; }
46 GPUd() float Chi2() const { return fChi2; }
47 GPUd() int NDF() const { return fNDF; }
49 GPUd() float Err2Y() const { return fC[0]; }
50 GPUd() float Err2Z() const { return fC[2]; }
51 GPUd() float Err2SinPhi() const { return fC[5]; }
52 GPUd() float Err2DzDs() const { return fC[9]; }
53 GPUd() float Err2QPt() const { return fC[14]; }
55 GPUd() float GetX() const { return fParam.GetX(); }
56 GPUd() float GetY() const { return fParam.GetY(); }
57 GPUd() float GetZ() const { return fParam.GetZ(); }
58 GPUd() float GetSinPhi() const { return fParam.GetSinPhi(); }
59 GPUd() float GetDzDs() const { return fParam.GetDzDs(); }
60 GPUd() float GetQPt() const { return fParam.GetQPt(); }
61 GPUd() float GetSignCosPhi() const { return fSignCosPhi; }
62 GPUd() float GetChi2() const { return fChi2; }
63 GPUd() int GetNDF() const { return fNDF; }
65 GPUd() float GetKappa( float Bz ) const { return fParam.GetKappa(Bz); }
66 GPUd() float GetCosPhi() const { return fSignCosPhi*CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
68 GPUd() float GetErr2Y() const { return fC[0]; }
69 GPUd() float GetErr2Z() const { return fC[2]; }
70 GPUd() float GetErr2SinPhi() const { return fC[5]; }
71 GPUd() float GetErr2DzDs() const { return fC[9]; }
72 GPUd() float GetErr2QPt() const { return fC[14]; }
74 GPUhd() MakeType(const float*) Par() const { return fParam.Par(); }
75 GPUhd() const float *Cov() const { return fC; }
77 GPUd() const float *GetPar() const { return fParam.GetPar(); }
78 GPUd() float GetPar(int i) const { return(fParam.GetPar(i)); }
79 GPUd() const float *GetCov() const { return fC; }
80 GPUd() float GetCov(int i) const {return fC[i]; }
82 GPUhd() void SetPar( int i, float v ) { fParam.SetPar(i, v); }
83 GPUhd() void SetCov( int i, float v ) { fC[i] = v; }
85 GPUd() void SetX( float v ) { fParam.SetX(v); }
86 GPUd() void SetY( float v ) { fParam.SetY(v); }
87 GPUd() void SetZ( float v ) { fParam.SetZ(v); }
88 GPUd() void SetSinPhi( float v ) { fParam.SetSinPhi(v); }
89 GPUd() void SetDzDs( float v ) { fParam.SetDzDs(v); }
90 GPUd() void SetQPt( float v ) { fParam.SetQPt(v); }
91 GPUd() void SetSignCosPhi( float v ) { fSignCosPhi = v >= 0 ? 1 : -1; }
92 GPUd() void SetChi2( float v ) { fChi2 = v; }
93 GPUd() void SetNDF( int v ) { fNDF = v; }
95 GPUd() float GetDist2( const AliHLTTPCCATrackParam &t ) const;
96 GPUd() float GetDistXZ2( const AliHLTTPCCATrackParam &t ) const;
98 GPUd() float GetS( float x, float y, float Bz ) const;
100 GPUd() void GetDCAPoint( float x, float y, float z,
101 float &px, float &py, float &pz, float Bz ) const;
103 GPUd() bool TransportToX( float x, float Bz, float maxSinPhi = .999 );
104 GPUd() bool TransportToXWithMaterial( float x, float Bz, float maxSinPhi = .999 );
106 GPUd() bool TransportToX( float x, AliHLTTPCCATrackLinearisation &t0,
107 float Bz, float maxSinPhi = .999, float *DL = 0 );
109 GPUd() bool TransportToX( float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi = .999 );
112 GPUd() bool TransportToXWithMaterial( float x, AliHLTTPCCATrackLinearisation &t0,
113 AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
115 GPUd() bool TransportToXWithMaterial( float x,
116 AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
118 GPUd() static float ApproximateBetheBloch( float beta2 );
119 GPUd() static float BetheBlochGeant( float bg,
126 GPUd() static float BetheBlochSolid( float bg );
127 GPUd() static float BetheBlochGas( float bg );
129 GPUd() void CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass = 0.13957 );
130 GPUd() bool CorrectForMeanMaterial( float xOverX0, float xTimesRho, const AliHLTTPCCATrackFitParam &par );
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 );
136 GPUd() bool CheckNumericalQuality() const;
138 GPUd() void Print() const;
140 #ifndef HLTCA_GPUCODE
142 #endif //!HLTCA_GPUCODE
143 MEM_LG(AliHLTTPCCABaseTrackParam) fParam; // Track Parameters
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
155 GPUd() MEM_CLASS_PRE() inline void MEM_LG(AliHLTTPCCATrackParam)::InitParam()
157 //Initialize Tracklet Parameters using default values
181 #endif //ALIHLTTPCCATRACKPARAM_H