Project
Loading...
Searching...
No Matches
GPUTPCTrackParam.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUTPCTRACKPARAM_H
16#define GPUTPCTRACKPARAM_H
17
19#include "GPUTPCDef.h"
20#include "GPUCommonMath.h"
21
22namespace o2::gpu
23{
24class GPUTPCTrackLinearisation;
25
34{
35 public:
37 float bethe, e, theta2, EP2, sigmadE2, k22, k33, k43, k44; // parameters
38 };
39
40 GPUd() const GPUTPCBaseTrackParam& GetParam() const { return mParam; }
41 GPUd() void SetParam(const GPUTPCBaseTrackParam& v) { mParam = v; }
42 GPUd() void InitParam();
43
44 GPUd() float X() const { return mParam.X(); }
45 GPUd() float Y() const { return mParam.Y(); }
46 GPUd() float Z() const { return mParam.Z(); }
47 GPUd() float SinPhi() const { return mParam.SinPhi(); }
48 GPUd() float DzDs() const { return mParam.DzDs(); }
49 GPUd() float QPt() const { return mParam.QPt(); }
50 GPUd() float ZOffset() const { return mParam.ZOffset(); }
51 GPUd() float SignCosPhi() const { return mSignCosPhi; }
52 GPUd() float Chi2() const { return mChi2; }
53 GPUd() int32_t NDF() const { return mNDF; }
54
55 GPUd() float Err2Y() const { return mParam.Err2Y(); }
56 GPUd() float Err2Z() const { return mParam.Err2Z(); }
57 GPUd() float Err2SinPhi() const { return mParam.Err2SinPhi(); }
58 GPUd() float Err2DzDs() const { return mParam.Err2DzDs(); }
59 GPUd() float Err2QPt() const { return mParam.Err2QPt(); }
60
61 GPUd() float GetX() const { return mParam.GetX(); }
62 GPUd() float GetY() const { return mParam.GetY(); }
63 GPUd() float GetZ() const { return mParam.GetZ(); }
64 GPUd() float GetSinPhi() const { return mParam.GetSinPhi(); }
65 GPUd() float GetDzDs() const { return mParam.GetDzDs(); }
66 GPUd() float GetQPt() const { return mParam.GetQPt(); }
67 GPUd() float GetSignCosPhi() const { return mSignCosPhi; }
68 GPUd() float GetChi2() const { return mChi2; }
69 GPUd() int32_t GetNDF() const { return mNDF; }
70
71 GPUd() float GetKappa(float Bz) const { return mParam.GetKappa(Bz); }
72 GPUd() float GetCosPhi() const { return mSignCosPhi * CAMath::Sqrt(1 - SinPhi() * SinPhi()); }
73
74 GPUhd() const float* Par() const { return mParam.Par(); }
75 GPUhd() const float* Cov() const { return mParam.Cov(); }
76
77 GPUd() const float* GetPar() const { return mParam.GetPar(); }
78 GPUd() float GetPar(int32_t i) const { return (mParam.GetPar(i)); }
79 GPUd() float GetCov(int32_t i) const { return mParam.GetCov(i); }
80
81 GPUhd() void SetPar(int32_t i, float v) { mParam.SetPar(i, v); }
82 GPUhd() void SetCov(int32_t i, float v) { mParam.SetCov(i, v); }
83
84 GPUd() void SetX(float v) { mParam.SetX(v); }
85 GPUd() void SetY(float v) { mParam.SetY(v); }
86 GPUd() void SetZ(float v) { mParam.SetZ(v); }
87 GPUd() void SetSinPhi(float v) { mParam.SetSinPhi(v); }
88 GPUd() void SetDzDs(float v) { mParam.SetDzDs(v); }
89 GPUd() void SetQPt(float v) { mParam.SetQPt(v); }
90 GPUd() void SetZOffset(float v) { mParam.SetZOffset(v); }
91 GPUd() void SetSignCosPhi(float v) { mSignCosPhi = v >= 0 ? 1 : -1; }
92 GPUd() void SetChi2(float v) { mChi2 = v; }
93 GPUd() void SetNDF(int32_t v) { mNDF = v; }
94
95 GPUd() float GetDist2(const GPUTPCTrackParam& t) const;
96 GPUd() float GetDistXZ2(const GPUTPCTrackParam& t) const;
97
98 GPUd() float GetS(float x, float y, float Bz) const;
99
100 GPUd() void GetDCAPoint(float x, float y, float z, float& px, float& py, float& pz, float Bz) const;
101
102 GPUd() bool TransportToX(float x, float Bz, float maxSinPhi = GPUCA_MAX_SIN_PHI);
103 GPUd() bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi = GPUCA_MAX_SIN_PHI);
104
105 GPUd() bool TransportToX(float x, GPUTPCTrackLinearisation& t0, float Bz, float maxSinPhi = GPUCA_MAX_SIN_PHI, float* DL = nullptr);
106
107 GPUd() bool TransportToX(float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi = GPUCA_MAX_SIN_PHI);
108
109 GPUd() bool TransportToXWithMaterial(float x, GPUTPCTrackLinearisation& t0, GPUTPCTrackFitParam& par, float Bz, float maxSinPhi = GPUCA_MAX_SIN_PHI);
110
111 GPUd() bool TransportToXWithMaterial(float x, GPUTPCTrackFitParam& par, float Bz, float maxSinPhi = GPUCA_MAX_SIN_PHI);
112
113 GPUd() static float ApproximateBetheBloch(float beta2);
114 GPUd() static float BetheBlochGeant(float bg, float kp0 = 2.33f, float kp1 = 0.20f, float kp2 = 3.00f, float kp3 = 173e-9f, float kp4 = 0.49848f);
115 GPUd() static float BetheBlochSolid(float bg);
116 GPUd() static float BetheBlochGas(float bg);
117
118 GPUd() void CalculateFitParameters(GPUTPCTrackFitParam& par, float mass = 0.13957f);
119 GPUd() bool CorrectForMeanMaterial(float xOverX0, float xTimesRho, const GPUTPCTrackFitParam& par);
120
121 GPUd() bool Rotate(float alpha, float maxSinPhi = GPUCA_MAX_SIN_PHI);
123 GPUd() bool Filter(float y, float z, float err2Y, float err2Z, float maxSinPhi = GPUCA_MAX_SIN_PHI, bool paramOnly = false);
124
125 GPUd() bool CheckNumericalQuality() const;
126
127 GPUd() void ShiftZ(float z1, float z2, float x1, float x2, float bz, float defaultZOffsetOverR);
128 GPUd() void ConstrainZ(float& z, int32_t sector, float& z0, float& lastZ);
129 GPUd() int32_t GetPropagatedYZ(float bz, float x, float& projY, float& projZ) const;
130
131 GPUdi() void ConstrainSinPhi(float limit = GPUCA_MAX_SIN_PHI)
132 {
133 if (GetSinPhi() > limit) {
134 SetSinPhi(limit);
135 } else if (GetSinPhi() < -limit) {
136 SetSinPhi(-limit);
137 }
138 }
139
140 GPUd() void Print() const;
141
142#ifndef GPUCA_GPUCODE
143 private:
144#endif
145 GPUTPCBaseTrackParam mParam; // Track Parameters
146
147 private:
148 // WARNING, Track Param Data is copied in the GPU Tracklet Constructor element by element instead of using copy constructor!!!
149 // This is neccessary for performance reasons!!!
150 // Changes to Elements of this class therefore must also be applied to TrackletConstructor!!!
151 float mSignCosPhi; // sign of cosPhi
152 float mChi2; // the chi^2 value
153 int32_t mNDF; // the Number of Degrees of Freedom
154};
155
156GPUdi() void GPUTPCTrackParam::InitParam()
157{
158 // Initialize Tracklet Parameters using default values
159 SetSinPhi(0);
160 SetDzDs(0);
161 SetQPt(0);
162 SetSignCosPhi(1);
163 SetChi2(0);
164 SetNDF(-3);
165 SetCov(0, 1);
166 SetCov(1, 0);
167 SetCov(2, 1);
168 SetCov(3, 0);
169 SetCov(4, 0);
170 SetCov(5, 1);
171 SetCov(6, 0);
172 SetCov(7, 0);
173 SetCov(8, 0);
174 SetCov(9, 1);
175 SetCov(10, 0);
176 SetCov(11, 0);
177 SetCov(12, 0);
178 SetCov(13, 0);
179 SetCov(14, 1000.f);
180 SetZOffset(0);
181}
182} // namespace o2::gpu
183
184#endif // GPUTPCTRACKPARAM_H
int32_t i
#define GPUCA_MAX_SIN_PHI
float float float float & py
GPUhd() const float *Cov() const
float float float float float & pz
GPUd() const GPUTPCBaseTrackParam &GetParam() const
GPUd() float GetCov(int32_t i) const
GPUd() float Err2DzDs() const
GPUhd() const float *Par() const
float float float float kp3
GPUd() float Err2Y() const
GPUd() float GetZ() const
GPUd() float Chi2() const
GPUd() void SetParam(const GPUTPCBaseTrackParam &v)
float float float float bz
GPUd() void SetZOffset(float v)
GPUd() void SetX(float v)
GPUhd() void SetCov(int32_t i
float float float float float kp4
GPUd() float GetY() const
GPUd() void SetSinPhi(float v)
GPUd() float DzDs() const
GPUd() int32_t NDF() const
GPUd() void SetChi2(float v)
GPUdi() void ConstrainSinPhi(float limit
GPUd() void InitParam()
GPUd() float GetKappa(float Bz) const
float float float float float defaultZOffsetOverR
GPUd() void SetQPt(float v)
GPUd() float SignCosPhi() const
GPUd() const float *GetPar() const
GPUd() float GetX() const
GPUTPCTrackLinearisation float float float * DL
GPUd() float GetCosPhi() const
GPUd() float GetDist2(const GPUTPCTrackParam &t) const
GPUd() void SetDzDs(float v)
GPUd() float Err2Z() const
GPUd() int32_t GetNDF() const
GPUd() void SetZ(float v)
GPUd() float Err2SinPhi() const
GPUhd() void SetPar(int32_t i
GPUd() void SetY(float v)
GPUd() float GetDzDs() const
float float float float bool paramOnly
GPUd() float GetChi2() const
GPUd() void SetSignCosPhi(float v)
GPUd() float SinPhi() const
int32_t float float & lastZ
GPUTPCTrackLinearisation GPUTPCTrackFitParam & par
GPUd() float GetSignCosPhi() const
GPUd() float GetPar(int32_t i) const
GPUd() float GetSinPhi() const
GPUd() float ZOffset() const
GPUd() float GetQPt() const
GPUd() float QPt() const
GPUd() float Err2QPt() const
GPUd() void SetNDF(int32_t v)
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLuint GLfloat GLfloat GLfloat x1
Definition glcorearb.h:5034
GLdouble f
Definition glcorearb.h:310
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition glcorearb.h:5034
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GPUdi() o2
Definition TrackTRD.h:38