Project
Loading...
Searching...
No Matches
GPUTPCGMTrackParam.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 GPUTPCGMTRACKPARAM_H
16#define GPUTPCGMTRACKPARAM_H
17
18#include "GPUTPCDef.h"
20#include "GPUTPCGMMergerTypes.h"
21#include "GPUCommonMath.h"
22#include "GPUdEdxInfo.h"
23
24#ifndef GPUCA_GPUCODE_DEVICE
25#include <cstddef>
26#endif
27
28class AliExternalTrackParam;
29
30namespace o2::gpu
31{
32class GPUTPCGMMerger;
33class GPUTPCGMBorderTrack;
34struct GPUParam;
36class GPUTPCGMPolynomialField;
37class GPUTPCGMMergedTrack;
38class GPUTPCGMPropagator;
39
48{
49 public:
50 GPUd() float& X()
51 {
52 return mX;
53 }
55 {
56 return mP[0];
57 }
59 {
60 return mP[1];
61 }
62 GPUd() float& SinPhi()
63 {
64 return mP[2];
65 }
66 GPUd() float& DzDs()
67 {
68 return mP[3];
69 }
70 GPUd() float& QPt()
71 {
72 return mP[4];
73 }
74 GPUd() float& TOffset()
75 {
76 return mTOffset;
77 }
78
79 GPUhd() float GetX() const { return mX; }
80 GPUhd() float GetY() const { return mP[0]; }
81 GPUhd() float GetZ() const { return mP[1]; }
82 GPUd() float GetSinPhi() const { return mP[2]; }
83 GPUd() float GetDzDs() const { return mP[3]; }
84 GPUd() float GetQPt() const { return mP[4]; }
85 GPUd() float GetTOffset() const { return mTOffset; }
86
87 GPUd() float GetKappa(float Bz) const { return -mP[4] * Bz; }
88
89 GPUd() void SetX(float v) { mX = v; }
90
91 GPUd() float* Par()
92 {
93 return mP;
94 }
95 GPUd() const float* GetPar() const { return mP; }
96 GPUd() float GetPar(int32_t i) const { return (mP[i]); }
97 GPUd() void SetPar(int32_t i, float v) { mP[i] = v; }
98
99 GPUd() float& Chi2()
100 {
101 return mChi2;
102 }
103 GPUd() int32_t& NDF()
104 {
105 return mNDF;
106 }
107
108 GPUd() float Err2Y() const { return mC[0]; }
109 GPUd() float Err2Z() const { return mC[2]; }
110 GPUd() float Err2SinPhi() const { return mC[5]; }
111 GPUd() float Err2DzDs() const { return mC[9]; }
112 GPUd() float Err2QPt() const { return mC[14]; }
113
114 GPUd() float GetChi2() const { return mChi2; }
115 GPUd() int32_t GetNDF() const { return mNDF; }
116
117 GPUd() float GetCosPhi() const { return CAMath::Sqrt(float(1.f) - GetSinPhi() * GetSinPhi()); }
118
119 GPUd() float GetErr2Y() const { return mC[0]; }
120 GPUd() float GetErr2Z() const { return mC[2]; }
121 GPUd() float GetErr2SinPhi() const { return mC[5]; }
122 GPUd() float GetErr2DzDs() const { return mC[9]; }
123 GPUd() float GetErr2QPt() const { return mC[14]; }
124
125 GPUd() float* Cov()
126 {
127 return mC;
128 }
129
130 GPUd() const float* GetCov() const { return mC; }
131 GPUd() float GetCov(int32_t i) const { return mC[i]; }
132
133 GPUd() void SetCov(int32_t i, float v) { mC[i] = v; }
134 GPUd() void SetChi2(float v) { mChi2 = v; }
135 GPUd() void SetNDF(int32_t v) { mNDF = v; }
136
137 GPUd() float GetMirroredY(float Bz) const;
138
139 GPUd() void ResetCovariance();
140
141 GPUd() bool CheckNumericalQuality(float overrideCovYY = -1.f) const;
142 GPUd() bool CheckCov() const;
143
145 GPUd() void MoveToReference(GPUTPCGMPropagator& prop, const GPUParam& param, float& alpha);
148
149 GPUd() bool AttachClustersPropagate(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t lastRow, int32_t toRow, int32_t iTrack, bool goodLeg, GPUTPCGMPropagator& prop, bool inFlyDirection, float maxSinPhi = constants::MAX_SIN_PHI, bool checkdEdx = false);
150 GPUd() float AttachClusters(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool goodLeg, GPUTPCGMPropagator& prop); // Returns uncorrectedY for later use
151 GPUd() float AttachClusters(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool goodLeg, float Y, float Z);
152 GPUd() void AttachClustersLooper(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool outwards, GPUTPCGMPropagator& prop);
153 GPUd() void AttachClustersLooperFollow(const GPUTPCGMMerger* GPUrestrict() Merger, GPUTPCGMPropagator& prop, int32_t sector, int32_t iTrack, bool outwards);
154 GPUd() void StoreLoopPropagation(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool outwards, float alpha);
155 GPUd() void StoreOuter(gputpcgmmergertypes::GPUTPCOuterParam* outerParam, float alpha);
156 GPUd() static void PropagateLooper(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t loopIdx);
157
158 GPUd() void AddCovDiagErrors(const float* GPUrestrict() errors2);
159 GPUd() void AddCovDiagErrorsWithCorrelations(const float* GPUrestrict() errors2);
160
162 {
167 }
169 {
170 clusters[ihitFirst].state &= ~state;
171 while (ihitFirst != ihitLast) {
172 clusters[ihitFirst += wayDirection].state &= ~state;
173 }
174 }
175 GPUdi() static void NormalizeAlpha(float& alpha)
176 {
177 if (alpha > CAMath::Pi()) {
178 alpha -= CAMath::TwoPi();
179 } else if (alpha <= -CAMath::Pi()) {
180 alpha += CAMath::TwoPi();
181 }
182 }
183
184 GPUd() void Rotate(float alpha);
185 GPUd() float ShiftZ(const GPUTPCGMMerger* merger, uint32_t sector, float cltmax, float cltmin, float clx);
187
188 GPUd() static float Reciprocal(float x) { return 1.f / x; }
189 GPUdi() static void Assign(float& x, bool mask, float v)
190 {
191 if (mask) {
192 x = v;
193 }
194 }
195
196 GPUdi() static void Assign(int32_t& x, bool mask, int32_t v)
197 {
198 if (mask) {
199 x = v;
200 }
201 }
202
203 GPUd() static void RefitTrack(GPUTPCGMMergedTrack& track, int32_t iTrk, GPUTPCGMMerger* merger, int32_t attempt);
204
205 GPUdi() void ConstrainSinPhi(float limit = constants::MAX_SIN_PHI)
206 {
207 if (mP[2] > limit) {
208 mP[2] = limit;
209 } else if (mP[2] < -limit) {
210 mP[2] = -limit;
211 }
212 }
213
214 private:
215 GPUd() int32_t initResetT0();
216
217 float mX; // x position
218 float mTOffset; // Z offset with early transform, T offset otherwise
219 float mP[5]; // 'active' track parameters: Y, Z, SinPhi, DzDs, q/Pt
220 float mC[15]; // the covariance matrix for Y,Z,SinPhi,..
221 float mChi2; // the chi^2 value
222 int32_t mNDF; // the Number of Degrees of Freedom
223};
224
233
234GPUdi() int32_t GPUTPCGMTrackParam::initResetT0()
235{
236 const float absQPt = CAMath::Abs(mP[4]);
237 if (absQPt < (150.f / 40.f)) {
238 return 150.f / 40.f;
239 }
240 return CAMath::Max(10.f, 150.f / mP[4]);
241}
242
243GPUdi() void GPUTPCGMTrackParam::ResetCovariance()
244{
245 mC[0] = 100.f;
246 mC[1] = 0.f;
247 mC[2] = 100.f;
248 mC[3] = 0.f;
249 mC[4] = 0.f;
250 mC[5] = 1.f;
251 mC[6] = 0.f;
252 mC[7] = 0.f;
253 mC[8] = 0.f;
254 mC[9] = 10.f;
255 mC[10] = 0.f;
256 mC[11] = 0.f;
257 mC[12] = 0.f;
258 mC[13] = 0.f;
259 mC[14] = 10.f;
260 mChi2 = 0;
261 mNDF = -5;
262}
263
264GPUdi() float GPUTPCGMTrackParam::GetMirroredY(float Bz) const
265{
266 // get Y of the point which has the same X, but located on the other side of trajectory
267 float qptBz = GetQPt() * Bz;
268 float cosPhi2 = 1.f - GetSinPhi() * GetSinPhi();
269 if (CAMath::Abs(qptBz) < 1.e-8f) {
270 qptBz = 1.e-8f;
271 }
272 if (cosPhi2 < 0.f) {
273 cosPhi2 = 0.f;
274 }
275 return GetY() - 2.f * CAMath::Sqrt(cosPhi2) / qptBz;
276}
277} // namespace o2::gpu
278
279#endif
int32_t i
#define GPUrestrict()
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions false
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
configStandalone Reconstruction rec_tpc float
GPUdi() void UnmarkClusters(GPUTPCGMMergedTrackHit *GPUrestrict() clusters
int32_t GPUTPCGMMergedTrackHit int32_t int32_t & NTolerated
GPUd() void Rotate(float alpha)
GPUd() void SetCov(int32_t i
GPUd() float GetPar(int32_t i) const
GPUd() float GetKappa(float Bz) const
GPUd() void StoreOuter(gputpcgmmergertypes int32_t loopIdx
GPUd() float GetErr2Y() const
GPUd() float GetErr2QPt() const
GPUd() float GetQPt() const
GPUd() void SetPar(int32_t i
GPUd() void SetNDF(int32_t v)
GPUd() float GetErr2Z() const
int32_t int32_t int32_t toRow
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger GPUTPCGMPropagator float float & yy
int32_t int32_t int32_t int32_t bool goodLeg
float float bool const GPUParam uint8_t uint8_t bool mirrorParameters
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger GPUTPCGMPropagator float float float int32_t maxN
int32_t GPUTPCGMMergedTrackHit int32_t int32_t float & Alpha
GPUd() float Err2SinPhi() const
int32_t GPUTPCGMMergedTrackHit int32_t int32_t float int32_t float GPUTPCGMMergedTrack & track
GPUd() void SetChi2(float v)
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger GPUTPCGMPropagator float float float & zz
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger GPUTPCGMPropagator & prop
GPUd() float GetChi2() const
GPUd() int32_t GetNDF() const
float float bool const GPUParam uint8_t row
GPUd() float GetTOffset() const
float float bool const GPUParam uint8_t uint8_t bool int8_t sector
float float bool const GPUParam uint8_t uint8_t clusterState
GPUd() float GetErr2SinPhi() const
GPUd() float GetMirroredY(float Bz) const
GPUd() const float *GetPar() const
int32_t GPUTPCGMMergedTrackHit * clusters
GPUd() float GetCov(int32_t i) const
GPUdi() static void NormalizeAlpha(float &alpha)
int32_t int32_t int32_t bool float float Z
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger * merger
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger GPUTPCGMPropagator float & xx
GPUd() float GetDzDs() const
int32_t int32_t int32_t uint8_t state
int32_t GPUTPCGMMergedTrackHit int32_t int32_t float int32_t attempt
int32_t int32_t int32_t bool float Y
GPUd() float Err2DzDs() const
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger GPUTPCGMPropagator float float float int32_t float uint8_t bool rejectChi2
int32_t GPUTPCGMMergedTrackHit int32_t & N
GPUd() float GetSinPhi() const
GPUd() float GetErr2DzDs() const
GPUdi() void MarkClusters(GPUTPCGMMergedTrackHit *GPUrestrict() clusters
int32_t GPUTPCGMMergedTrackHit const GPUTPCGMMerger GPUTPCGMPropagator float float float int32_t float clAlpha
int32_t int32_t int32_t int32_t iTrack
GPUd() const float *GetCov() const
GPUd() float Err2QPt() const
int32_t int32_t int32_t bool outwards
int32_t GPUTPCGMMergedTrackHit int32_t int32_t float int32_t float maxSinPhi
GPUdi() static void Assign(float &x
uint32_t float float float clx
GPUd() float GetCosPhi() const
int32_t int32_t int32_t int32_t bool GPUTPCGMPropagator bool float bool checkdEdx
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLdouble f
Definition glcorearb.h:310
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLfloat param
Definition glcorearb.h:271
GLint GLuint mask
Definition glcorearb.h:291