Project
Loading...
Searching...
No Matches
GPUTPCGMPhysicalTrackModel.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 GPUTPCGMPHYSICALTRACKMODEL_H
16#define GPUTPCGMPHYSICALTRACKMODEL_H
17
18#include "GPUTPCGMTrackParam.h"
19
30namespace o2::gpu
31{
33{
34 public:
37
38 GPUd() void Set(const GPUTPCGMTrackParam& t);
39 GPUd() void Set(float X, float Y, float Z, float Px, float Py, float Pz, float Q);
40
41 GPUd() float& X()
42 {
43 return mX;
44 }
46 {
47 return mY;
48 }
50 {
51 return mZ;
52 }
54 {
55 return mPx;
56 }
58 {
59 return mPy;
60 }
62 {
63 return mPz;
64 }
66 {
67 return mQ;
68 }
69
70 GPUd() float& SinPhi()
71 {
72 return mSinPhi;
73 }
74 GPUd() float& CosPhi()
75 {
76 return mCosPhi;
77 }
78 GPUd() float& SecPhi()
79 {
80 return mSecPhi;
81 }
82 GPUd() float& DzDs()
83 {
84 return mDzDs;
85 }
86 GPUd() float& DlDs()
87 {
88 return mDlDs;
89 }
90 GPUd() float& QPt()
91 {
92 return mQPt;
93 }
95 {
96 return mP;
97 }
98 GPUd() float& Pt()
99 {
100 return mPt;
101 }
102
103 GPUd() const float& SinPhi() const { return mSinPhi; }
104 GPUd() const float& DzDs() const { return mDzDs; }
105
106 GPUd() float GetX() const { return mX; }
107 GPUd() float GetY() const { return mY; }
108 GPUd() float GetZ() const { return mZ; }
109 GPUd() float GetPx() const { return mPx; }
110 GPUd() float GetPy() const { return mPy; }
111 GPUd() float GetPz() const { return mPz; }
112 GPUd() float GetQ() const { return mQ; }
113
114 GPUd() float GetSinPhi() const { return mSinPhi; }
115 GPUd() float GetCosPhi() const { return mCosPhi; }
116 GPUd() float GetSecPhi() const { return mSecPhi; }
117 GPUd() float GetDzDs() const { return mDzDs; }
118 GPUd() float GetDlDs() const { return mDlDs; }
119 GPUd() float GetQPt() const { return mQPt; }
120 GPUd() float GetP() const { return mP; }
121 GPUd() float GetPt() const { return mPt; }
122
123 GPUd() int32_t PropagateToXBzLightNoUpdate(float x, float Bz, float& dLp);
124 GPUd() int32_t PropagateToXBzLight(float x, float Bz, float& dLp);
125
126 GPUd() int32_t PropagateToXBxByBz(float x, float Bx, float By, float Bz, float& dLp);
127
128 GPUd() int32_t PropagateToLpBz(float Lp, float Bz);
129
130 GPUd() bool SetDirectionAlongX();
131
132 GPUd() void UpdateValues();
133
134 GPUd() void Print() const;
135
136 GPUd() float GetMirroredY(float Bz) const;
137
138 GPUd() void Rotate(float alpha);
139 GPUd() void RotateLight(float alpha);
140
141 private:
142 // physical parameters of the trajectory
143
144 float mX = 0.f; // X
145 float mY = 0.f; // Y
146 float mZ = 0.f; // Z
147 float mPx = 1.e4f; // Px, >0
148 float mPy = 0.f; // Py
149 float mPz = 0.f; // Pz
150 float mQ = 1.f; // charge, +-1
151
152 // some additional variables needed for GMTrackParam transport
153
154 float mSinPhi = 0.f; // SinPhi = Py/Pt
155 float mCosPhi = 1.f; // CosPhi = abs(Px)/Pt
156 float mSecPhi = 1.f; // 1/cos(phi) = Pt/abs(Px)
157 float mDzDs = 0.f; // DzDs = Pz/Pt
158 float mDlDs = 0.f; // DlDs = P/Pt
159 float mQPt = 0.f; // QPt = q/Pt
160 float mP = 1.e4f; // momentum
161 float mPt = 1.e4f; // Pt momentum
162};
163
165
167{
168 float pti = CAMath::Abs(t.GetQPt());
169 if (pti < 1.e-4f) {
170 pti = 1.e-4f; // set 10000 GeV momentum for straight track
171 }
172 mQ = (t.GetQPt() >= 0) ? 1.f : -1.f; // only charged tracks are considered
173 mX = t.GetX();
174 mY = t.GetY();
175 mZ = t.GetZ();
176
177 mPt = 1.f / pti;
178 mSinPhi = t.GetSinPhi();
179 if (mSinPhi > constants::MAX_SIN_PHI) {
180 mSinPhi = constants::MAX_SIN_PHI;
181 }
182 if (mSinPhi < -constants::MAX_SIN_PHI) {
183 mSinPhi = -constants::MAX_SIN_PHI;
184 }
185 mCosPhi = CAMath::Sqrt((1.f - mSinPhi) * (1.f + mSinPhi));
186 mSecPhi = 1.f / mCosPhi;
187 mDzDs = t.GetDzDs();
188 mDlDs = CAMath::Sqrt(1.f + mDzDs * mDzDs);
189 mP = mPt * mDlDs;
190
191 mPy = mPt * mSinPhi;
192 mPx = mPt * mCosPhi;
193 mPz = mPt * mDzDs;
194 mQPt = mQ * pti;
195}
196
197GPUdi() void GPUTPCGMPhysicalTrackModel::Set(float X, float Y, float Z, float Px, float Py, float Pz, float Q)
198{
199 mX = X;
200 mY = Y;
201 mZ = Z;
202 mPx = Px;
203 mPy = Py;
204 mPz = Pz;
205 mQ = (Q >= 0) ? 1 : -1;
206 UpdateValues();
207}
208
209GPUdi() void GPUTPCGMPhysicalTrackModel::UpdateValues()
210{
211 float px = mPx;
212 if (CAMath::Abs(px) < 1.e-4f) {
213 px = copysign(1.e-4f, px);
214 }
215
216 mPt = CAMath::Sqrt(px * px + mPy * mPy);
217 float pti = 1.f / mPt;
218 mP = CAMath::Sqrt(px * px + mPy * mPy + mPz * mPz);
219 mSinPhi = mPy * pti;
220 mCosPhi = px * pti;
221 mSecPhi = mPt / px;
222 mDzDs = mPz * pti;
223 mDlDs = mP * pti;
224 mQPt = mQ * pti;
225}
226
227GPUdi() bool GPUTPCGMPhysicalTrackModel::SetDirectionAlongX()
228{
229 //
230 // set direction of movenment collinear to X axis
231 // return value is true when direction has been changed
232 //
233 if (mPx >= 0) {
234 return 0;
235 }
236
237 mPx = -mPx;
238 mPy = -mPy;
239 mPz = -mPz;
240 mQ = -mQ;
241 UpdateValues();
242 return 1;
243}
244
245GPUdi() float GPUTPCGMPhysicalTrackModel::GetMirroredY(float Bz) const
246{
247 // get Y of the point which has the same X, but located on the other side of trajectory
248 if (CAMath::Abs(Bz) < 1.e-8f) {
249 Bz = 1.e-8f;
250 }
251 return mY - 2.f * mQ * mPx / Bz;
252}
253
254GPUdi() void GPUTPCGMPhysicalTrackModel::RotateLight(float alpha)
255{
256 //* Rotate the coordinate system in XY on the angle alpha
257
258 float cA = CAMath::Cos(alpha);
259 float sA = CAMath::Sin(alpha);
260 float x = mX, y = mY, px = mPx, py = mPy;
261 mX = x * cA + y * sA;
262 mY = -x * sA + y * cA;
263 mPx = px * cA + py * sA;
264 mPy = -px * sA + py * cA;
265}
266
268{
269 //* Rotate the coordinate system in XY on the angle alpha
270 RotateLight(alpha);
271 UpdateValues();
272}
273} // namespace o2::gpu
274
275#endif
#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 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 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 bool
configStandalone Reconstruction rec_tpc float
GPUdDefault() GPUTPCGMPhysicalTrackModel()=default
float float float float float float Q
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble f
Definition glcorearb.h:310
GLint y
Definition glcorearb.h:270
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GPUdi() o2
Definition TrackTRD.h:39