]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/tracking-ca/AliHLTTPCCATrackParam.h
bug fix: reconstruction crash when the output buffer size exceed
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCATrackParam.h
CommitLineData
d54804bf 1//-*- Mode: C++ -*-
2// $Id$
ce565086 3// ************************************************************************
fbb9b71b 4// This file is property of and copyright by the ALICE HLT Project *
ce565086 5// ALICE Experiment at CERN, All rights reserved. *
6// See cxx source for full Copyright notice *
7// *
8//*************************************************************************
d54804bf 9
10
11#ifndef ALIHLTTPCCATRACKPARAM_H
12#define ALIHLTTPCCATRACKPARAM_H
13
00d07bcd 14#include "AliHLTTPCCADef.h"
15d2e9cf 15#include "AliHLTTPCCAMath.h"
73a33d2e 16#include "AliHLTTPCCATrackParam2.h"
d54804bf 17
15d2e9cf 18class AliHLTTPCCATrackLinearisation;
eb30eb49 19
d54804bf 20/**
21 * @class AliHLTTPCCATrackParam
22 *
23 * AliHLTTPCCATrackParam class describes the track parametrisation
24 * which is used by the AliHLTTPCCATracker slice tracker.
25 *
26 */
d54804bf 27class AliHLTTPCCATrackParam
28{
fbb9b71b 29 public:
d54804bf 30
fbb9b71b 31 struct AliHLTTPCCATrackFitParam {
32 float fBethe, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters
33 };
00d07bcd 34
73a33d2e 35 GPUd() const AliHLTTPCCATrackParam2& GetParam() const { return fParam; }
36 GPUd() void SetParam(const AliHLTTPCCATrackParam2& v) { fParam = v; }
37 GPUd() void InitParam();
38
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(); }
fbb9b71b 45 GPUd() float SignCosPhi() const { return fSignCosPhi; }
46 GPUd() float Chi2() const { return fChi2; }
47 GPUd() int NDF() const { return fNDF; }
693d2443 48
73a33d2e 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]; }
54
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(); }
fbb9b71b 61 GPUd() float GetSignCosPhi() const { return fSignCosPhi; }
62 GPUd() float GetChi2() const { return fChi2; }
63 GPUd() int GetNDF() const { return fNDF; }
00d07bcd 64
73a33d2e 65 GPUd() float GetKappa( float Bz ) const { return fParam.GetKappa(Bz); }
fbb9b71b 66 GPUd() float GetCosPhi() const { return fSignCosPhi*CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
15d2e9cf 67
fbb9b71b 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]; }
00d07bcd 73
73a33d2e 74 GPUhd() const float *Par() const { return fParam.Par(); }
fbb9b71b 75 GPUhd() const float *Cov() const { return fC; }
d54804bf 76
73a33d2e 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; }
444e5682 80 GPUd() float GetCov(int i) const {return fC[i]; }
eb30eb49 81
73a33d2e 82 GPUhd() void SetPar( int i, float v ) { fParam.SetPar(i, v); }
fbb9b71b 83 GPUhd() void SetCov( int i, float v ) { fC[i] = v; }
693d2443 84
73a33d2e 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); }
c26cae51 91 GPUd() void SetSignCosPhi( float v ) { fSignCosPhi = v >= 0 ? 1 : -1; }
fbb9b71b 92 GPUd() void SetChi2( float v ) { fChi2 = v; }
93 GPUd() void SetNDF( int v ) { fNDF = v; }
693d2443 94
fbb9b71b 95 GPUd() float GetDist2( const AliHLTTPCCATrackParam &t ) const;
96 GPUd() float GetDistXZ2( const AliHLTTPCCATrackParam &t ) const;
693d2443 97
fbb9b71b 98 GPUd() float GetS( float x, float y, float Bz ) const;
d54804bf 99
fbb9b71b 100 GPUd() void GetDCAPoint( float x, float y, float z,
101 float &px, float &py, float &pz, float Bz ) const;
15d2e9cf 102
fbb9b71b 103 GPUd() bool TransportToX( float x, float Bz, float maxSinPhi = .999 );
104 GPUd() bool TransportToXWithMaterial( float x, float Bz, float maxSinPhi = .999 );
15d2e9cf 105
fbb9b71b 106 GPUd() bool TransportToX( float x, AliHLTTPCCATrackLinearisation &t0,
4acc2401 107 float Bz, float maxSinPhi = .999, float *DL = 0 );
693d2443 108
fbb9b71b 109 GPUd() bool TransportToX( float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi = .999 );
d54804bf 110
4687b8fc 111
fbb9b71b 112 GPUd() bool TransportToXWithMaterial( float x, AliHLTTPCCATrackLinearisation &t0,
4acc2401 113 AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
4687b8fc 114
fbb9b71b 115 GPUd() bool TransportToXWithMaterial( float x,
4acc2401 116 AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
eb30eb49 117
fbb9b71b 118 GPUd() static float ApproximateBetheBloch( float beta2 );
119 GPUd() static float BetheBlochGeant( float bg,
4acc2401 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 );
fbb9b71b 126 GPUd() static float BetheBlochSolid( float bg );
127 GPUd() static float BetheBlochGas( float bg );
15d2e9cf 128
fbb9b71b 129 GPUd() void CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass = 0.13957 );
130 GPUd() bool CorrectForMeanMaterial( float xOverX0, float xTimesRho, const AliHLTTPCCATrackFitParam &par );
15d2e9cf 131
fbb9b71b 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 );
d54804bf 135
4acc2401 136 GPUd() bool CheckNumericalQuality() const;
d54804bf 137
fbb9b71b 138 GPUd() void Print() const;
139
444e5682 140#ifndef HLTCA_GPUCODE
141 private:
31649d4b 142#endif //!HLTCA_GPUCODE
73a33d2e 143 AliHLTTPCCATrackParam2 fParam; // Track Parameters
144
fbb9b71b 145 private:
b22af1bf 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!!!
fbb9b71b 149 float fC[15]; // the covariance matrix for Y,Z,SinPhi,..
73a33d2e 150 float fSignCosPhi; // sign of cosPhi
fbb9b71b 151 float fChi2; // the chi^2 value
152 int fNDF; // the Number of Degrees of Freedom
d54804bf 153};
154
73a33d2e 155GPUd() inline void AliHLTTPCCATrackParam::InitParam()
156{
157 //Initialize Tracklet Parameters using default values
158 SetSinPhi( 0 );
159 SetDzDs( 0 );
160 SetQPt( 0 );
161 SetSignCosPhi( 1 );
162 SetChi2( 0 );
163 SetNDF( -3 );
164 SetCov( 0, 1 );
165 SetCov( 1, 0 );
166 SetCov( 2, 1 );
167 SetCov( 3, 0 );
168 SetCov( 4, 0 );
169 SetCov( 5, 1 );
170 SetCov( 6, 0 );
171 SetCov( 7, 0 );
172 SetCov( 8, 0 );
173 SetCov( 9, 1 );
174 SetCov( 10, 0 );
175 SetCov( 11, 0 );
176 SetCov( 12, 0 );
177 SetCov( 13, 0 );
178 SetCov( 14, 10. );
179}
180
31649d4b 181#endif //ALIHLTTPCCATRACKPARAM_H