Project
Loading...
Searching...
No Matches
GPUTPCGMPolynomialField.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 GPUTPCGMPOLYNOMIALFIELD_H
16#define GPUTPCGMPOLYNOMIALFIELD_H
17
18#include "GPUCommonDef.h"
19
20namespace o2::gpu
21{
28{
29 public:
30 GPUTPCGMPolynomialField() : mNominalBz(0.f)
31 {
32 Reset();
33 }
34
35 void Reset();
36
37 void SetFieldNominal(float nominalBz);
38
39 void SetFieldTpc(const float* Bx, const float* By, const float* Bz);
40 void SetFieldTrd(const float* Bx, const float* By, const float* Bz);
41 void SetFieldIts(const float* Bx, const float* By, const float* Bz);
42
43 GPUdi() float GetNominalBz() const { return mNominalBz; }
44
45 GPUd() void GetField(float x, float y, float z, float* B) const;
46 GPUd() float GetFieldBz(float x, float y, float z) const;
47
48 GPUd() void GetFieldTrd(float x, float y, float z, float* B) const;
49 GPUd() float GetFieldTrdBz(float x, float y, float z) const;
50
51 GPUd() void GetFieldIts(float x, float y, float z, float* B) const;
52 GPUd() float GetFieldItsBz(float x, float y, float z) const;
53
54 void Print() const;
55
56 static GPUglobalconstexpr() const int32_t NTPCM = 10; // number of coefficients
57 static GPUglobalconstexpr() const int32_t NTRDM = 20; // number of coefficients for the TRD field
58 static GPUglobalconstexpr() const int32_t NITSM = 10; // number of coefficients for the ITS field
59
60 GPUd() static void GetPolynomsTpc(float x, float y, float z, float f[NTPCM]);
61 GPUd() static void GetPolynomsTrd(float x, float y, float z, float f[NTRDM]);
62 GPUd() static void GetPolynomsIts(float x, float y, float z, float f[NITSM]);
63
64 const float* GetCoefmTpcBx() const { return mTpcBx; }
65 const float* GetCoefmTpcBy() const { return mTpcBy; }
66 const float* GetCoefmTpcBz() const { return mTpcBz; }
67
68 const float* GetCoefmTrdBx() const { return mTrdBx; }
69 const float* GetCoefmTrdBy() const { return mTrdBy; }
70 const float* GetCoefmTrdBz() const { return mTrdBz; }
71
72 const float* GetCoefmItsBx() const { return mItsBx; }
73 const float* GetCoefmItsBy() const { return mItsBy; }
74 const float* GetCoefmItsBz() const { return mItsBz; }
75
76 private:
77 float mNominalBz; // nominal constant field value in [kG * 2.99792458E-4 GeV/c/cm]
78 float mTpcBx[NTPCM]; // polynomial coefficients
79 float mTpcBy[NTPCM];
80 float mTpcBz[NTPCM];
81 float mTrdBx[NTRDM]; // polynomial coefficients
82 float mTrdBy[NTRDM];
83 float mTrdBz[NTRDM];
84 float mItsBx[NITSM]; // polynomial coefficients
85 float mItsBy[NITSM];
86 float mItsBz[NITSM];
87};
88
90{
91 mNominalBz = 0.f;
92 for (int32_t i = 0; i < NTPCM; i++) {
93 mTpcBx[i] = 0.f;
94 mTpcBy[i] = 0.f;
95 mTpcBz[i] = 0.f;
96 }
97 for (int32_t i = 0; i < NTRDM; i++) {
98 mTrdBx[i] = 0.f;
99 mTrdBy[i] = 0.f;
100 mTrdBz[i] = 0.f;
101 }
102 for (int32_t i = 0; i < NITSM; i++) {
103 mItsBx[i] = 0.f;
104 mItsBy[i] = 0.f;
105 mItsBz[i] = 0.f;
106 }
107}
108
109inline void GPUTPCGMPolynomialField::SetFieldNominal(float nominalBz) { mNominalBz = nominalBz; }
110
111inline void GPUTPCGMPolynomialField::SetFieldTpc(const float* Bx, const float* By, const float* Bz)
112{
113 if (Bx && By && Bz) {
114 for (int32_t i = 0; i < NTPCM; i++) {
115 mTpcBx[i] = Bx[i];
116 mTpcBy[i] = By[i];
117 mTpcBz[i] = Bz[i];
118 }
119 }
120}
121
122inline void GPUTPCGMPolynomialField::SetFieldTrd(const float* Bx, const float* By, const float* Bz)
123{
124 if (Bx && By && Bz) {
125 for (int32_t i = 0; i < NTRDM; i++) {
126 mTrdBx[i] = Bx[i];
127 mTrdBy[i] = By[i];
128 mTrdBz[i] = Bz[i];
129 }
130 }
131}
132
133inline void GPUTPCGMPolynomialField::SetFieldIts(const float* Bx, const float* By, const float* Bz)
134{
135 if (Bx && By && Bz) {
136 for (int32_t i = 0; i < NITSM; i++) {
137 mItsBx[i] = Bx[i];
138 mItsBy[i] = By[i];
139 mItsBz[i] = Bz[i];
140 }
141 }
142}
143
144GPUdi() void GPUTPCGMPolynomialField::GetPolynomsTpc(float x, float y, float z, float f[NTPCM])
145{
146 f[0] = 1.f;
147 f[1] = x;
148 f[2] = y;
149 f[3] = z;
150 f[4] = x * x;
151 f[5] = x * y;
152 f[6] = x * z;
153 f[7] = y * y;
154 f[8] = y * z;
155 f[9] = z * z;
156}
157
158GPUdi() void GPUTPCGMPolynomialField::GetField(float x, float y, float z, float* B) const
159{
160 const float* fBxS = &mTpcBx[1];
161 const float* fByS = &mTpcBy[1];
162 const float* fBzS = &mTpcBz[1];
163
164 const float f[NTPCM - 1] = {x, y, z, x * x, x * y, x * z, y * y, y * z, z * z};
165 float bx = mTpcBx[0], by = mTpcBy[0], bz = mTpcBz[0];
166 for (int32_t i = NTPCM - 1; i--;) {
167 // for (int32_t i=0;i<NTPCM-1; i++){
168 bx += fBxS[i] * f[i];
169 by += fByS[i] * f[i];
170 bz += fBzS[i] * f[i];
171 }
172 B[0] = bx;
173 B[1] = by;
174 B[2] = bz;
175}
176
177GPUdi() float GPUTPCGMPolynomialField::GetFieldBz(float x, float y, float z) const
178{
179 const float* fBzS = &mTpcBz[1];
180
181 const float f[NTPCM - 1] = {x, y, z, x * x, x * y, x * z, y * y, y * z, z * z};
182 float bz = mTpcBz[0];
183 for (int32_t i = NTPCM - 1; i--;) {
184 bz += fBzS[i] * f[i];
185 }
186 return bz;
187}
188
189GPUdi() void GPUTPCGMPolynomialField::GetPolynomsTrd(float x, float y, float z, float f[NTRDM])
190{
191 float xx = x * x, xy = x * y, xz = x * z, yy = y * y, yz = y * z, zz = z * z;
192 f[0] = 1.f;
193 f[1] = x;
194 f[2] = y;
195 f[3] = z;
196 f[4] = xx;
197 f[5] = xy;
198 f[6] = xz;
199 f[7] = yy;
200 f[8] = yz;
201 f[9] = zz;
202 f[10] = x * xx;
203 f[11] = x * xy;
204 f[12] = x * xz;
205 f[13] = x * yy;
206 f[14] = x * yz;
207 f[15] = x * zz;
208 f[16] = y * yy;
209 f[17] = y * yz;
210 f[18] = y * zz;
211 f[19] = z * zz;
212}
213
214GPUdi() void GPUTPCGMPolynomialField::GetFieldTrd(float x, float y, float z, float* B) const
215{
216 float f[NTRDM];
217 GetPolynomsTrd(x, y, z, f);
218 float bx = 0.f, by = 0.f, bz = 0.f;
219 for (int32_t i = 0; i < NTRDM; i++) {
220 bx += mTrdBx[i] * f[i];
221 by += mTrdBy[i] * f[i];
222 bz += mTrdBz[i] * f[i];
223 }
224 B[0] = bx;
225 B[1] = by;
226 B[2] = bz;
227}
228
229GPUdi() float GPUTPCGMPolynomialField::GetFieldTrdBz(float x, float y, float z) const
230{
231 float f[NTRDM];
232 GetPolynomsTrd(x, y, z, f);
233 float bz = 0.f;
234 for (int32_t i = 0; i < NTRDM; i++) {
235 bz += mTrdBz[i] * f[i];
236 }
237 return bz;
238}
239
240GPUdi() void GPUTPCGMPolynomialField::GetPolynomsIts(float x, float y, float z, float f[NITSM])
241{
242 float xx = x * x, xy = x * y, xz = x * z, yy = y * y, yz = y * z, zz = z * z;
243 f[0] = 1.f;
244 f[1] = x;
245 f[2] = y;
246 f[3] = z;
247 f[4] = xx;
248 f[5] = xy;
249 f[6] = xz;
250 f[7] = yy;
251 f[8] = yz;
252 f[9] = zz;
253 /*
254 f[10]=x*xx; f[11]=x*xy; f[12]=x*xz; f[13]=x*yy; f[14]=x*yz; f[15]=x*zz;
255 f[16]=y*yy; f[17]=y*yz; f[18]=y*zz;
256 f[19]=z*zz;
257 */
258}
259
260GPUdi() void GPUTPCGMPolynomialField::GetFieldIts(float x, float y, float z, float* B) const
261{
262 const float* fBxS = &mItsBx[1];
263 const float* fByS = &mItsBy[1];
264 const float* fBzS = &mItsBz[1];
265
266 const float f[NITSM - 1] = {x, y, z, x * x, x * y, x * z, y * y, y * z, z * z};
267 float bx = mItsBx[0], by = mItsBy[0], bz = mItsBz[0];
268 for (int32_t i = NITSM - 1; i--;) {
269 bx += fBxS[i] * f[i];
270 by += fByS[i] * f[i];
271 bz += fBzS[i] * f[i];
272 }
273 B[0] = bx;
274 B[1] = by;
275 B[2] = bz;
276}
277
278GPUdi() float GPUTPCGMPolynomialField::GetFieldItsBz(float x, float y, float z) const
279{
280 const float* fBzS = &mItsBz[1];
281
282 const float f[NITSM - 1] = {x, y, z, x * x, x * y, x * z, y * y, y * z, z * z};
283 float bz = mItsBz[0];
284 for (int32_t i = NITSM - 1; i--;) {
285 bz += fBzS[i] * f[i];
286 }
287 return bz;
288}
289
290} // namespace o2::gpu
291
292#endif
int32_t i
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
Definition B.h:16
void SetFieldTpc(const float *Bx, const float *By, const float *Bz)
void SetFieldTrd(const float *Bx, const float *By, const float *Bz)
void SetFieldIts(const float *Bx, const float *By, const float *Bz)
GPUdi() float GetNominalBz() const
GPUd() void GetField(float x
static GPUglobalconstexpr() const int32_t NTPCM
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)
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GPUdi() o2
Definition TrackTRD.h:39
const float const float const float bz