Project
Loading...
Searching...
No Matches
TPCFastTransformGeo.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
16
17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTTRANSFORMGEO_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTTRANSFORMGEO_H
19
20#include "GPUCommonDef.h"
21#include "GPUCommonMath.h"
23#ifndef GPUCA_GPUCODE_DEVICE
24#include <memory>
25#include "GPUCommonRtypes.h"
26#include "GPUCommonArray.h" // Would work on GPU, but yields performance regressions
27#endif
28
29namespace o2::gpu
30{
31
36{
37
38 public:
40 struct SectorInfo {
41 float sinAlpha{0.f};
42 float cosAlpha{0.f};
44 };
45
47 struct RowInfo {
48 float x{0.f};
50 float padWidth{0.f};
51 float yMin{0.f};
52
54 GPUdi() float getYmin() const { return yMin; }
55
57 GPUdi() float getYmax() const { return -yMin; }
58
60#ifndef GPUCA_GPUCODE_DEVICE
61 GPUd() std::array<float, 2> getYrange() const { return {getYmin(), getYmax()}; }
62#endif
63
65 GPUdi() float getYwidth() const { return -2.f * yMin; }
66
67 ClassDefNV(RowInfo, 2);
68 };
69
71
74
77
80
83
85
87 inline static constexpr size_t getClassAlignmentBytes() { return 8; }
88
90
92 void startConstruction(int32_t numberOfRows);
93
95 void setTPCrow(int32_t iRow, float x, int32_t nPads, float padWidth);
96
100 void setTPCzLength(float tpcZlength);
101
103 void finishConstruction();
104
106 bool isConstructed() const { return (mConstructionMask == (uint32_t)ConstructionState::Constructed); }
107
109
111 inline static constexpr int32_t getNumberOfSectors() { return NumberOfSectors; }
112
114 inline static constexpr int32_t getNumberOfSectorsA() { return NumberOfSectorsA; }
115
117 GPUdi() int32_t getNumberOfRows() const { return mNumberOfRows; }
118
120 inline static constexpr int getMaxNumberOfRows() { return MaxNumberOfRows; }
121
124
127
129 GPUdi() float getTPCzLength() const { return mTPCzLength; }
130
132#ifndef GPUCA_GPUCODE_DEVICE
133 GPUdi() std::array<float, 2> getZrange(int32_t sector) const
134 {
136 if (sector < NumberOfSectorsA) { // TPC side A
137 return {0.f, mTPCzLength};
138 } else { // TPC side C
139 return {-mTPCzLength, 0.f};
140 }
141 }
142#endif
143 GPUd() float getZmin(int32_t sector) const;
144 GPUd() float getZmax(int32_t sector) const;
145
147
149 GPUd() void convLocalToGlobal(int32_t sector, float lx, float ly, float lz, float& gx, float& gy, float& gz) const;
150
152 GPUd() void convGlobalToLocal(int32_t sector, float gx, float gy, float gz, float& lx, float& ly, float& lz) const;
153
155 GPUd() void convPadDriftLengthToLocal(int32_t sector, int32_t row, float pad, float driftLength, float& y, float& z) const;
156
158 GPUd() float convDriftLengthToZ(int32_t sector, float driftLength) const;
159
161 GPUd() float convZtoDriftLength(int32_t sector, float z) const;
162
164 GPUd() void convLocalToPadDriftLength(int32_t sector, int32_t row, float y, float z, float& pad, float& l) const;
165
167 void print() const;
168
170 int32_t test(int32_t sector, int32_t row, float ly, float lz) const;
171
174
175 private:
177
178 static GPUglobalconstexpr() int32_t NumberOfSectors = o2::tpc::constants::MAXSECTOR;
179 static GPUglobalconstexpr() int32_t NumberOfSectorsA = NumberOfSectors / 2;
180 static GPUglobalconstexpr() int32_t MaxNumberOfRows = 160;
181
183
185 enum ConstructionState : uint32_t {
186 NotConstructed = 0x0,
187 Constructed = 0x1,
188 InProgress = 0x2,
189 GeometryIsSet = 0x4,
190 };
191
192 uint32_t mConstructionMask = ConstructionState::NotConstructed;
193
195
196 int32_t mNumberOfRows = 0;
197 float mTPCzLength = 0.f;
198
199 SectorInfo mSectorInfos[NumberOfSectors + 1];
200 RowInfo mRowInfos[MaxNumberOfRows + 1];
201
202 public:
203 struct SliceInfo { // legacy, needed only for schema evolution
205 };
206
208};
209
210// =======================================================================
211// Inline implementations of some methods
212// =======================================================================
213
214GPUdi() const TPCFastTransformGeo::SectorInfo& TPCFastTransformGeo::getSectorInfo(int32_t sector) const
215{
217 if (sector < 0 || sector >= NumberOfSectors) { // return zero object
218 sector = NumberOfSectors;
219 }
220 return mSectorInfos[sector];
221}
222
223GPUdi() const TPCFastTransformGeo::RowInfo& TPCFastTransformGeo::getRowInfo(int32_t row) const
224{
226 if (row < 0 || row >= mNumberOfRows) { // return zero object
227 row = MaxNumberOfRows;
228 }
229 return mRowInfos[row];
230}
231
232GPUdi() void TPCFastTransformGeo::convLocalToGlobal(int32_t sector, float lx, float ly, float lz, float& gx, float& gy, float& gz) const
233{
235 const SectorInfo& sectorInfo = getSectorInfo(sector);
236 gx = lx * sectorInfo.cosAlpha - ly * sectorInfo.sinAlpha;
237 gy = lx * sectorInfo.sinAlpha + ly * sectorInfo.cosAlpha;
238 gz = lz;
239}
240
241GPUdi() void TPCFastTransformGeo::convGlobalToLocal(int32_t sector, float gx, float gy, float gz, float& lx, float& ly, float& lz) const
242{
244 const SectorInfo& sectorInfo = getSectorInfo(sector);
245 lx = gx * sectorInfo.cosAlpha + gy * sectorInfo.sinAlpha;
246 ly = -gx * sectorInfo.sinAlpha + gy * sectorInfo.cosAlpha;
247 lz = gz;
248}
249
250GPUdi() void TPCFastTransformGeo::convPadDriftLengthToLocal(int32_t sector, int32_t row, float pad, float driftLength, float& y, float& z) const
251{
253 const RowInfo& rowInfo = getRowInfo(row);
254 float u = (pad - 0.5f * rowInfo.maxPad) * rowInfo.padWidth;
255 if (sector < NumberOfSectorsA) { // TPC side A
256 y = u;
257 z = mTPCzLength - driftLength;
258 } else { // TPC side C
259 y = -u; // pads are mirrorred on C-side
260 z = driftLength - mTPCzLength; // drift direction is mirrored on C-side
261 }
262}
263
264GPUdi() float TPCFastTransformGeo::convDriftLengthToZ(int32_t sector, float driftLength) const
265{
267 return (sector < NumberOfSectorsA) ? (mTPCzLength - driftLength) : (driftLength - mTPCzLength);
268}
269
270GPUdi() float TPCFastTransformGeo::convZtoDriftLength(int32_t sector, float z) const
271{
273 return (sector < NumberOfSectorsA) ? (mTPCzLength - z) : (z + mTPCzLength);
274}
275
276GPUdi() float TPCFastTransformGeo::getZmin(int32_t sector) const
277{
279 if (sector < NumberOfSectorsA) { // TPC side A
280 return 0.f;
281 } else { // TPC side C
282 return -mTPCzLength;
283 }
284}
285
286GPUdi() float TPCFastTransformGeo::getZmax(int32_t sector) const
287{
289 if (sector < NumberOfSectorsA) { // TPC side A
290 return mTPCzLength;
291 } else { // TPC side C
292 return 0.f;
293 }
294}
295
296GPUdi() void TPCFastTransformGeo::convLocalToPadDriftLength(int32_t sector, int32_t row, float y, float z, float& pad, float& l) const
297{
299 float u;
300 if (sector < NumberOfSectorsA) { // TPC side A
301 u = y;
302 l = mTPCzLength - z;
303 } else { // TPC side C
304 u = -y; // pads are mirrorred on C-side
305 l = z + mTPCzLength; // drift direction is mirrored on C-side
306 }
307 const TPCFastTransformGeo::RowInfo& rowInfo = getRowInfo(row);
308 pad = u / rowInfo.padWidth + 0.5f * rowInfo.maxPad;
309}
310
311} // namespace o2::gpu
312
313#endif
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
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
void finishConstruction()
Finishes initialization: puts everything to the flat buffer, releases temporary memory.
void setTPCzLength(float tpcZlength)
~TPCFastTransformGeo()=default
Destructor.
static constexpr int getMaxNumberOfRows()
Gives number of TPC rows.
GPUdi() std GPUd() float getZmax(int32_t sector) const
Gives Z range for the corresponding TPC side.
float float float float float float &gz const
static constexpr size_t getClassAlignmentBytes()
_____________ FlatObject functionality, see FlatObject class for description ____________
float float float float float & gy
TPCFastTransformGeo()
_____________ Constructors / destructors __________________________
GPUd() const SectorInfo &getSectorInfo(int32_t sector) const
Gives sector info.
void startConstruction(int32_t numberOfRows)
_______________ Construction interface ________________________
void setTPCrow(int32_t iRow, float x, int32_t nPads, float padWidth)
Initializes a TPC row.
TPCFastTransformGeo(const TPCFastTransformGeo &)=default
Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead.
static constexpr int32_t getNumberOfSectorsA()
Gives number of TPC sectors on the A side.
bool isConstructed() const
Is the object constructed.
void print() const
Print method.
static constexpr int32_t getNumberOfSectors()
_______________ Getters _________________________________
GPUdi() int32_t getNumberOfRows() const
Gives number of TPC rows.
TPCFastTransformGeo & operator=(const TPCFastTransformGeo &)=default
Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead.
float float float float & gx
ClassDefNV(TPCFastTransformGeo, 3)
GLint GLenum GLint x
Definition glcorearb.h:403
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
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.
The struct contains necessary info about TPC padrow.
GPUdi() float getYmax() const
get Y max
GPUdi() float getYmin() const
get Y min
int32_t maxPad
maximal pad number = n pads - 1
The struct contains necessary info for TPC sector.
float cosAlpha
cos of the angle between the local x and the global x
float sinAlpha
sin of the angle between the local x and the global x
std::vector< int > row