]>
Commit | Line | Data |
---|---|---|
6d869045 | 1 | //-*- Mode: C++ -*- |
2 | // $Id: AliHLTTPCGMTrackParam.h 39008 2010-02-18 17:33:32Z sgorbuno $ | |
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 ALIHLTTPCGMTRACKPARAM_H | |
12 | #define ALIHLTTPCGMTRACKPARAM_H | |
13 | ||
2fba026d | 14 | #include "AliHLTTPCCADef.h" |
15 | #include "AliHLTTPCCAMath.h" | |
6d869045 | 16 | |
17 | class AliHLTTPCGMTrackLinearisation; | |
18 | class AliHLTTPCGMBorderTrack; | |
19 | class AliExternalTrackParam; | |
20 | class AliHLTTPCCAParam; | |
21 | ||
22 | /** | |
23 | * @class AliHLTTPCGMTrackParam | |
24 | * | |
25 | * AliHLTTPCGMTrackParam class describes the track parametrisation | |
26 | * which is used by the AliHLTTPCGMTracker slice tracker. | |
27 | * | |
28 | */ | |
29 | class AliHLTTPCGMTrackParam | |
30 | { | |
31 | public: | |
32 | ||
33 | struct AliHLTTPCGMTrackFitParam { | |
34 | //float fBethe, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters | |
35 | float fDLMax, fBetheRho, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters | |
36 | }; | |
37 | ||
2fba026d | 38 | GPUd() float& X() { return fX; } |
39 | GPUd() float& Y() { return fP[0]; } | |
40 | GPUd() float& Z() { return fP[1]; } | |
41 | GPUd() float& SinPhi() { return fP[2]; } | |
42 | GPUd() float& DzDs() { return fP[3]; } | |
43 | GPUd() float& QPt() { return fP[4]; } | |
6d869045 | 44 | |
2fba026d | 45 | GPUhd() float GetX() const { return fX; } |
46 | GPUhd() float GetY() const { return fP[0]; } | |
47 | GPUhd() float GetZ() const { return fP[1]; } | |
48 | GPUd() float GetSinPhi() const { return fP[2]; } | |
49 | GPUd() float GetDzDs() const { return fP[3]; } | |
50 | GPUd() float GetQPt() const { return fP[4]; } | |
6d869045 | 51 | |
2fba026d | 52 | GPUd() float GetKappa( float Bz ) const { return -fP[4]*Bz; } |
6d869045 | 53 | |
2fba026d | 54 | GPUd() void SetX( float v ){ fX = v; } |
6d869045 | 55 | |
2fba026d | 56 | GPUd() float *Par() { return fP; } |
57 | GPUd() const float *GetPar() const { return fP; } | |
58 | GPUd() float GetPar( int i) const { return(fP[i]); } | |
59 | GPUd() void SetPar( int i, float v ) { fP[i] = v; } | |
6d869045 | 60 | |
2fba026d | 61 | GPUd() float& Chi2() { return fChi2; } |
62 | GPUd() int& NDF() { return fNDF; } | |
6d869045 | 63 | |
2fba026d | 64 | GPUd() float Err2Y() const { return fC[0]; } |
65 | GPUd() float Err2Z() const { return fC[2]; } | |
66 | GPUd() float Err2SinPhi() const { return fC[5]; } | |
67 | GPUd() float Err2DzDs() const { return fC[9]; } | |
68 | GPUd() float Err2QPt() const { return fC[14]; } | |
6d869045 | 69 | |
2fba026d | 70 | GPUd() float GetChi2() const { return fChi2; } |
71 | GPUd() int GetNDF() const { return fNDF; } | |
6d869045 | 72 | |
2fba026d | 73 | GPUd() float GetCosPhi() const { return sqrt( float(1.) - GetSinPhi()*GetSinPhi() ); } |
6d869045 | 74 | |
2fba026d | 75 | GPUd() float GetErr2Y() const { return fC[0]; } |
76 | GPUd() float GetErr2Z() const { return fC[2]; } | |
77 | GPUd() float GetErr2SinPhi() const { return fC[5]; } | |
78 | GPUd() float GetErr2DzDs() const { return fC[9]; } | |
79 | GPUd() float GetErr2QPt() const { return fC[14]; } | |
6d869045 | 80 | |
2fba026d | 81 | GPUd() float *Cov() { return fC; } |
6d869045 | 82 | |
2fba026d | 83 | GPUd() const float *GetCov() const { return fC; } |
84 | GPUd() float GetCov(int i) const {return fC[i]; } | |
6d869045 | 85 | |
86 | ||
2fba026d | 87 | GPUd() void SetCov( int i, float v ) { fC[i] = v; } |
88 | GPUd() void SetChi2( float v ) { fChi2 = v; } | |
89 | GPUd() void SetNDF( int v ) { fNDF = v; } | |
6d869045 | 90 | |
91 | ||
2fba026d | 92 | GPUd() static float ApproximateBetheBloch( float beta2 ); |
6d869045 | 93 | |
2fba026d | 94 | GPUd() void CalculateFitParameters( AliHLTTPCGMTrackFitParam &par,float RhoOverRadLen, float Rho, bool NoField=0, float mass = 0.13957 ); |
6d869045 | 95 | |
2fba026d | 96 | GPUd() bool CheckNumericalQuality() const ; |
6d869045 | 97 | |
2fba026d | 98 | GPUd() void Fit |
6d869045 | 99 | ( |
2fba026d | 100 | float* PolinomialFieldBz, |
6d869045 | 101 | float x[], float y[], float z[], unsigned int rowType[], float alpha[], AliHLTTPCCAParam ¶m, |
102 | int &N, float &Alpha, | |
103 | bool UseMeanPt = 0, | |
104 | float maxSinPhi = .999 | |
105 | ); | |
106 | ||
2fba026d | 107 | GPUd() bool Rotate( float alpha, AliHLTTPCGMTrackLinearisation &t0, float maxSinPhi = .999 ); |
6d869045 | 108 | |
2fba026d | 109 | GPUd() static float GetBz( float x, float y, float z, float* PolinomialFieldBz ); |
110 | GPUd() float GetBz(float* PolinomialFieldBz ) const{ return GetBz( fX, fP[0], fP[1], PolinomialFieldBz );} | |
6d869045 | 111 | |
2fba026d | 112 | GPUd() static float Reciprocal( float x ){ return 1./x; } |
113 | GPUd() static void Assign( float &x, bool mask, float v ){ | |
6d869045 | 114 | if( mask ) x = v; |
115 | } | |
116 | ||
2fba026d | 117 | GPUd() static void Assign( int &x, bool mask, int v ){ |
6d869045 | 118 | if( mask ) x = v; |
119 | } | |
120 | ||
2fba026d | 121 | #if !defined(HLTCA_STANDALONE) & !defined(HLTCA_GPUCODE) |
6d869045 | 122 | bool GetExtParam( AliExternalTrackParam &T, double alpha ) const; |
123 | void SetExtParam( const AliExternalTrackParam &T ); | |
2fba026d | 124 | #endif |
6d869045 | 125 | |
126 | private: | |
127 | ||
128 | float fX; // x position | |
129 | float fP[5]; // 'active' track parameters: Y, Z, SinPhi, DzDs, q/Pt | |
130 | float fC[15]; // the covariance matrix for Y,Z,SinPhi,.. | |
131 | float fChi2; // the chi^2 value | |
132 | int fNDF; // the Number of Degrees of Freedom | |
133 | }; | |
134 | ||
2fba026d | 135 | inline float AliHLTTPCGMTrackParam::GetBz( float x, float y, float z, float* PolinomialFieldBz ) |
6d869045 | 136 | { |
137 | float r2 = x * x + y * y; | |
138 | float r = sqrt( r2 ); | |
2fba026d | 139 | const float *c = PolinomialFieldBz; |
6d869045 | 140 | return ( c[0] + c[1]*z + c[2]*r + c[3]*z*z + c[4]*z*r + c[5]*r2 ); |
141 | } | |
142 | ||
143 | #endif //ALIHLTTPCCATRACKPARAM_H |