17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_IRREGULARSPLINE2D3D_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_IRREGULARSPLINE2D3D_H
24#if !defined(__CLING__) && !defined(G__ROOT) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC)
26#include <Vc/SimdArray>
137 template <
typename T>
141 template <typename T>
146 GPUd()
void getSplineVec(
const float* correctedData,
float u,
float v,
float&
x,
float&
y,
float&
z)
const;
149 GPUd()
int32_t getNumberOfKnots()
const {
return mGridU.getNumberOfKnots() * mGridV.getNumberOfKnots(); }
204GPUdi()
void IrregularSpline2D3D::getKnotUV(
int32_t iKnot,
float& u,
float&
v)
const
207 const IrregularSpline1D& gridU = getGridU();
208 const IrregularSpline1D& gridV = getGridV();
209 int32_t nu = gridU.getNumberOfKnots();
212 u = gridU.getKnot(iu).u;
213 v = gridV.getKnot(iv).u;
217GPUd()
void IrregularSpline2D3D::correctEdges(T*
data)
const
219 const IrregularSpline1D& gridU = getGridU();
220 const IrregularSpline1D& gridV = getGridV();
221 int32_t nu = gridU.getNumberOfKnots();
222 int32_t nv = gridV.getNumberOfKnots();
226 const IrregularSpline1D::Knot*
s = gridU.getKnots() + iu;
227 double c0, c1, c2, c3;
228 gridU.getEdgeCorrectionCoefficients(
s[0].u,
s[1].u,
s[2].u,
s[3].u, c0, c1, c2, c3);
229 for (
int32_t iv = 0; iv < nv; iv++) {
230 T* f0 =
data + (nu * (iv) + iu) * 3;
234 for (
int32_t idim = 0; idim < 3; idim++) {
235 f0[idim] = (T)(c0 * f0[idim] + c1 * f1[idim] + c2 * f2[idim] + c3 * f3[idim]);
242 const IrregularSpline1D::Knot*
s = gridU.getKnots() + iu;
243 double c0, c1, c2, c3;
244 gridU.getEdgeCorrectionCoefficients(
s[3].u,
s[2].u,
s[1].u,
s[0].u, c3, c2, c1, c0);
245 for (
int32_t iv = 0; iv < nv; iv++) {
246 T* f0 =
data + (nu * (iv) + iu) * 3;
250 for (
int32_t idim = 0; idim < 3; idim++) {
251 f3[idim] = (
T)(c0 * f0[idim] + c1 * f1[idim] + c2 * f2[idim] + c3 * f3[idim]);
258 const IrregularSpline1D::Knot*
s = gridV.getKnots() + iv;
259 double c0, c1, c2, c3;
260 gridV.getEdgeCorrectionCoefficients(
s[0].u,
s[1].u,
s[2].u,
s[3].u, c0, c1, c2, c3);
261 for (
int32_t iu = 0; iu < nu; iu++) {
262 T* f0 =
data + (nu * iv + iu) * 3;
266 for (
int32_t idim = 0; idim < 3; idim++) {
267 f0[idim] = (
T)(c0 * f0[idim] + c1 * f1[idim] + c2 * f2[idim] + c3 * f3[idim]);
274 const IrregularSpline1D::Knot*
s = gridV.getKnots() + iv;
275 double c0, c1, c2, c3;
276 gridV.getEdgeCorrectionCoefficients(
s[3].u,
s[2].u,
s[1].u,
s[0].u, c3, c2, c1, c0);
277 for (
int32_t iu = 0; iu < nu; iu++) {
278 T* f0 =
data + (nu * iv + iu) * 3;
282 for (
int32_t idim = 0; idim < 3; idim++) {
283 f3[idim] = (
T)(c0 * f0[idim] + c1 * f1[idim] + c2 * f2[idim] + c3 * f3[idim]);
294 const IrregularSpline1D& gridU = getGridU();
295 const IrregularSpline1D& gridV = getGridV();
296 int32_t nu = gridU.getNumberOfKnots();
297 int32_t iu = gridU.getKnotIndex(u);
300 const IrregularSpline1D::Knot& knotU = gridU.getKnot(iu);
301 const IrregularSpline1D::Knot& knotV = gridV.getKnot(iv);
303 const T* dataV0 = correctedData + (nu * (iv - 1) + iu - 1) * 3;
304 const T* dataV1 = dataV0 + 3 * nu;
305 const T* dataV2 = dataV0 + 6 * nu;
306 const T* dataV3 = dataV0 + 9 * nu;
310 dataV[
i] = gridV.getSpline(knotV, dataV0[
i], dataV1[
i], dataV2[
i], dataV3[
i],
v);
313 T* dataU0 = dataV + 0;
314 T* dataU1 = dataV + 3;
315 T* dataU2 = dataV + 6;
316 T* dataU3 = dataV + 9;
320 res[
i] = gridU.getSpline(knotU, dataU0[
i], dataU1[
i], dataU2[
i], dataU3[
i], u);
327GPUdi()
void IrregularSpline2D3D::getSplineVec(const
float* correctedData,
float u,
float v,
float&
x,
float&
y,
float&
z)
const
332#if !defined(__CLING__) && !defined(G__ROOT) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC)
333 const IrregularSpline1D& gridU = getGridU();
334 const IrregularSpline1D& gridV = getGridV();
335 int32_t nu = gridU.getNumberOfKnots();
336 int32_t iu = gridU.getKnotIndex(u);
338 const IrregularSpline1D::Knot& knotU = gridU.getKnot(iu);
339 const IrregularSpline1D::Knot& knotV = gridV.getKnot(iv);
341 const float* dataV0 = correctedData + (nu * (iv - 1) + iu - 1) * 3;
342 const float* dataV1 = dataV0 + 3 * nu;
343 const float* dataV2 = dataV0 + 6 * nu;
344 const float* dataV3 = dataV0 + 9 * nu;
348 Vc::SimdArray<float, 12> dataV0vec(dataV0), dataV1vec(dataV1), dataV2vec(dataV2), dataV3vec(dataV3), dataVvec = gridV.getSpline(knotV, dataV0vec, dataV1vec, dataV2vec, dataV3vec,
v);
350 using V = std::conditional_t<(Vc::float_v::size() >= 4),
352 Vc::SimdArray<float, 3>>;
354 float dataV[9 + V::size()];
357 dataVvec.store(dataV, Vc::Unaligned);
363 V dataU0vec(dataV), dataU1vec(dataV + 3), dataU2vec(dataV + 6), dataU3vec(dataV + 9);
365 V dataUVvec = gridU.getSpline(knotU, dataU0vec, dataU1vec, dataU2vec, dataU3vec, u);
371 getSpline(correctedData, u,
v,
x,
y,
z);
Definition of FlatObject class.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
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
Definition of IrregularSpline1D class.
char * releaseInternalBuffer()
_____________ Methods for making the data buffer external __________________________
int32_t mFlatBufferSize
size of the flat buffer
static constexpr size_t getBufferAlignmentBytes()
Gives minimal alignment in bytes required for the flat buffer.
static constexpr size_t getClassAlignmentBytes()
GPUCA_GPUCODE.
void construct(int32_t numberOfKnotsU, const float knotsU[], int32_t numberOfAxisBinsU, int32_t numberOfKnotsV, const float knotsV[], int32_t numberOfAxisBinsV)
_______________ Construction interface ________________________
IrregularSpline2D3D & operator=(const IrregularSpline2D3D &)=delete
Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead.
IrregularSpline2D3D(const IrregularSpline2D3D &)=delete
Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead.
GPUd() const IrregularSpline1D &getGridU() const
Get 1-D grid for U coordinate.
static constexpr size_t getDataAlignmentBytes()
Get minimal required alignment for the spline data.
IrregularSpline2D3D()
_____________ Constructors / destructors __________________________
static constexpr size_t getClassAlignmentBytes()
Get minimal required alignment for the class.
void cloneFromObject(const IrregularSpline2D3D &obj, char *newFlatBufferPtr)
Construction interface.
~IrregularSpline2D3D()=default
Destructor.
GPUd() void correctEdges(T *data) const
_______________ Main functionality ________________________
void setFutureBufferAddress(char *futureFlatBufferPtr)
float float float float float &z const
void moveBufferTo(char *newBufferPtr)
size_t getGridVOffset() const
Get offset of GridV flat data in the flat buffer.
GPUd() const IrregularSpline1D &getGrid(int32_t uv) const
Get 1-D grid for U or V coordinate.
size_t getFlatBufferSize() const
Get size of the mFlatBuffer data.
GPUd() const IrregularSpline1D &getGridV() const
Get 1-D grid for V coordinate.
void setActualBufferAddress(char *actualFlatBufferPtr)
Moving the class with its external buffer to another location.
static constexpr size_t getBufferAlignmentBytes()
Get minimal required alignment for the flat buffer.
void print() const
Print method.
size_t getGridUOffset() const
technical stuff
void constructRegular(int32_t numberOfKnotsU, int32_t numberOfKnotsV)
Constructor for a regular spline.
const char * getFlatBufferPtr() const
Get pointer to the flat buffer.
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
GPUd() const expr uint32_t MultivariatePolynomialHelper< Dim
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...