Line data Source code
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 :
14 : #include "AliHLTTPCCADef.h"
15 : #include "AliHLTTPCCAMath.h"
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 :
38 0 : GPUd() float& X() { return fX; }
39 0 : GPUd() float& Y() { return fP[0]; }
40 0 : GPUd() float& Z() { return fP[1]; }
41 0 : GPUd() float& SinPhi() { return fP[2]; }
42 0 : GPUd() float& DzDs() { return fP[3]; }
43 0 : GPUd() float& QPt() { return fP[4]; }
44 :
45 0 : GPUhd() float GetX() const { return fX; }
46 0 : GPUhd() float GetY() const { return fP[0]; }
47 0 : GPUhd() float GetZ() const { return fP[1]; }
48 0 : GPUd() float GetSinPhi() const { return fP[2]; }
49 0 : GPUd() float GetDzDs() const { return fP[3]; }
50 0 : GPUd() float GetQPt() const { return fP[4]; }
51 :
52 0 : GPUd() float GetKappa( float Bz ) const { return -fP[4]*Bz; }
53 :
54 0 : GPUd() void SetX( float v ){ fX = v; }
55 :
56 0 : GPUd() float *Par() { return fP; }
57 0 : GPUd() const float *GetPar() const { return fP; }
58 0 : GPUd() float GetPar( int i) const { return(fP[i]); }
59 0 : GPUd() void SetPar( int i, float v ) { fP[i] = v; }
60 :
61 0 : GPUd() float& Chi2() { return fChi2; }
62 0 : GPUd() int& NDF() { return fNDF; }
63 :
64 0 : GPUd() float Err2Y() const { return fC[0]; }
65 0 : GPUd() float Err2Z() const { return fC[2]; }
66 0 : GPUd() float Err2SinPhi() const { return fC[5]; }
67 0 : GPUd() float Err2DzDs() const { return fC[9]; }
68 0 : GPUd() float Err2QPt() const { return fC[14]; }
69 :
70 0 : GPUd() float GetChi2() const { return fChi2; }
71 0 : GPUd() int GetNDF() const { return fNDF; }
72 :
73 0 : GPUd() float GetCosPhi() const { return sqrt( float(1.) - GetSinPhi()*GetSinPhi() ); }
74 :
75 0 : GPUd() float GetErr2Y() const { return fC[0]; }
76 0 : GPUd() float GetErr2Z() const { return fC[2]; }
77 0 : GPUd() float GetErr2SinPhi() const { return fC[5]; }
78 0 : GPUd() float GetErr2DzDs() const { return fC[9]; }
79 0 : GPUd() float GetErr2QPt() const { return fC[14]; }
80 :
81 0 : GPUd() float *Cov() { return fC; }
82 :
83 0 : GPUd() const float *GetCov() const { return fC; }
84 0 : GPUd() float GetCov(int i) const {return fC[i]; }
85 :
86 :
87 0 : GPUd() void SetCov( int i, float v ) { fC[i] = v; }
88 0 : GPUd() void SetChi2( float v ) { fChi2 = v; }
89 0 : GPUd() void SetNDF( int v ) { fNDF = v; }
90 :
91 :
92 : GPUd() static float ApproximateBetheBloch( float beta2 );
93 :
94 : GPUd() void CalculateFitParameters( AliHLTTPCGMTrackFitParam &par,float RhoOverRadLen, float Rho, bool NoField=0, float mass = 0.13957 );
95 :
96 : GPUd() bool CheckNumericalQuality() const ;
97 :
98 : GPUd() void Fit
99 : (
100 : float* PolinomialFieldBz,
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 :
107 : GPUd() bool Rotate( float alpha, AliHLTTPCGMTrackLinearisation &t0, float maxSinPhi = .999 );
108 :
109 : GPUhd() static float GetBz( float x, float y, float z, float* PolinomialFieldBz );
110 0 : GPUhd() float GetBz(float* PolinomialFieldBz ) const{ return GetBz( fX, fP[0], fP[1], PolinomialFieldBz );}
111 :
112 0 : GPUd() static float Reciprocal( float x ){ return 1./x; }
113 : GPUd() static void Assign( float &x, bool mask, float v ){
114 0 : if( mask ) x = v;
115 0 : }
116 :
117 : GPUd() static void Assign( int &x, bool mask, int v ){
118 0 : if( mask ) x = v;
119 0 : }
120 :
121 : #if !defined(HLTCA_STANDALONE) & !defined(HLTCA_GPUCODE)
122 : bool GetExtParam( AliExternalTrackParam &T, double alpha ) const;
123 : void SetExtParam( const AliExternalTrackParam &T );
124 : #endif
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 :
135 : inline float AliHLTTPCGMTrackParam::GetBz( float x, float y, float z, float* PolinomialFieldBz )
136 : {
137 0 : float r2 = x * x + y * y;
138 0 : float r = sqrt( r2 );
139 : const float *c = PolinomialFieldBz;
140 0 : 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
|