17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTSPACECHARGECORRECTION_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTSPACECHARGECORRECTION_H
25#ifndef GPUCA_GPUCODE_DEVICE
57 float splineScalingWithZ{0.f};
60 void set(
float y0_,
float yScale_,
float z0_,
float zScale_,
float zOut_,
float zReadout_)
63 this->yScale = yScale_;
65 this->zScale = zScale_;
68 this->splineScalingWithZ = fabs(zReadout_ - zOut_) > 1.f ? 1.f / (zReadout_ - zOut_) : 0.f;
73 float getZ0()
const {
return z0; }
78 return 1.f - GPUCommonMath::Clamp((
z - zOut) * splineScalingWithZ, 0.f, 1.f);
87 u = (
y -
y0) * yScale;
88 v = (
z - z0) * zScale;
89 s = getSpineScaleForZ(
z);
267 return mRowInfos[
row];
273 return mRowInfos[
row];
276#if !defined(GPUCA_GPUCODE)
279 GPUh() double testInverse(
bool prn = 0);
284 void relocateBufferPointers(
const char* oldBuffer,
char* newBuffer);
286 void releaseConstructionMemory();
288 static GPUglobalconstexpr()
float kMaxCorrection = 100.
f;
308 char* mCorrectionData[3];
310 size_t mSectorDataSizeBytes[3];
326GPUdi() const TPCFastSpaceChargeCorrection::SplineType& TPCFastSpaceChargeCorrection::getSplineForRow(
int32_t row)
const
329 return mScenarioPtr[getRowInfo(
row).splineScenarioID];
332GPUdi() TPCFastSpaceChargeCorrection::SplineType& TPCFastSpaceChargeCorrection::getSplineForRow(
int32_t row)
335 return mScenarioPtr[getRowInfo(
row).splineScenarioID];
341 size_t offset =
sector * mSectorDataSizeBytes[iSpline] + getRowInfo(
row).dataOffsetBytes[iSpline];
342 return reinterpret_cast<float*
>(mCorrectionData[iSpline] +
offset);
348 size_t offset =
sector * mSectorDataSizeBytes[iSpline] + getRowInfo(
row).dataOffsetBytes[iSpline];
349 return reinterpret_cast<const float*
>(mCorrectionData[iSpline] +
offset);
352GPUdi() TPCFastSpaceChargeCorrection::SplineTypeInvX& TPCFastSpaceChargeCorrection::getSplineInvXforRow(
int32_t row)
355 return reinterpret_cast<SplineTypeInvX&
>(getSplineForRow(
row));
358GPUdi() const TPCFastSpaceChargeCorrection::SplineTypeInvX& TPCFastSpaceChargeCorrection::getSplineInvXforRow(
int32_t row)
const
361 return reinterpret_cast<const SplineTypeInvX&
>(getSplineForRow(
row));
367 return getCorrectionData(
sector,
row, 1);
373 return getCorrectionData(
sector,
row, 1);
376GPUdi() TPCFastSpaceChargeCorrection::SplineTypeInvYZ& TPCFastSpaceChargeCorrection::getSplineInvYZforRow(
int32_t row)
379 return reinterpret_cast<SplineTypeInvYZ&
>(getSplineForRow(
row));
382GPUdi() const TPCFastSpaceChargeCorrection::SplineTypeInvYZ& TPCFastSpaceChargeCorrection::getSplineInvYZforRow(
int32_t row)
const
385 return reinterpret_cast<const SplineTypeInvYZ&
>(getSplineForRow(
row));
391 return getCorrectionData(
sector,
row, 2);
397 return getCorrectionData(
sector,
row, 2);
404 const SplineType& spline = getSplineForRow(
row);
405 getRowInfo(
row).gridMeasured.convLocalToGridUntruncated(
sector,
y,
z, u,
v,
s);
407 u = GPUCommonMath::Clamp(u, 0.f, (
float)spline.getGridX1().getUmax());
408 v = GPUCommonMath::Clamp(
v, 0.f, (
float)spline.getGridX2().getUmax());
415 getRowInfo(
row).gridMeasured.convLocalToGridUntruncated(
sector,
y,
z, u,
v,
s);
416 const auto& spline = getSplineForRow(
row);
418 if (u < 0.f || u > (
float)spline.getGridX1().getUmax() ||
419 v < 0.f || v > (
float)spline.getGridX2().getUmax()) {
429 getRowInfo(
row).gridReal.convLocalToGridUntruncated(
sector,
y,
z, u,
v,
s);
430 const auto& spline = getSplineForRow(
row);
432 if (u < 0.f || u > (
float)spline.getGridX1().getUmax() ||
433 v < 0.f || v > (
float)spline.getGridX2().getUmax()) {
442 getRowInfo(
row).gridMeasured.convGridToLocal(
sector, gridU, gridV,
y,
z);
448 const SplineType& spline = getSplineForRow(
row);
449 getRowInfo(
row).gridReal.convLocalToGridUntruncated(
sector,
y,
z, u,
v,
s);
451 u = GPUCommonMath::Clamp(u, 0.f, (
float)spline.getGridX1().getUmax());
452 v = GPUCommonMath::Clamp(
v, 0.f, (
float)spline.getGridX2().getUmax());
458 getRowInfo(
row).gridReal.convGridToLocal(
sector, gridU, gridV,
y,
z);
463 const SplineType& spline = getSplineForRow(
row);
464 const float* splineData = getCorrectionData(
sector,
row);
470 spline.interpolateAtU(splineData, u,
v, dxyz);
472 if (CAMath::Abs(dxyz[0]) > kMaxCorrection || CAMath::Abs(dxyz[1]) > kMaxCorrection || CAMath::Abs(dxyz[2]) > kMaxCorrection) {
484 convRealLocalToGrid(
sector,
row, realY, realZ, u,
v,
s);
486 getSplineInvXforRow(
row).interpolateAtU(getCorrectionDataInvX(
sector,
row), u,
v, &dx);
487 if (CAMath::Abs(dx) > kMaxCorrection) {
496 convRealLocalToGrid(
sector,
row, realY, realZ, u,
v,
s);
498 getSplineInvYZforRow(
row).interpolateAtU(getCorrectionDataInvYZ(
sector,
row), u,
v, dyz);
499 if (CAMath::Abs(dyz[0]) > kMaxCorrection || CAMath::Abs(dyz[1]) > kMaxCorrection) {
Definition of FlatObject class.
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
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
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
Definition of Spline2D class.
char * releaseInternalBuffer()
_____________ Methods for making the data buffer external __________________________
static constexpr size_t getBufferAlignmentBytes()
Gives minimal alignment in bytes required for the flat buffer.
void startConstruction()
_____________ Construction _________
static constexpr size_t getClassAlignmentBytes()
GPUCA_GPUCODE.
Forward declaration — specializations below select ClassDefNV based on FlatBase.
Spline2D< float, 2 > SplineTypeInvYZ
Spline2D< float, 3 > SplineTypeXYZ
void moveBufferTo(char *newBufferPtr)
GPUd() const SplineType &getSplineForRow(int32_t row) const
Gives const pointer to a spline.
GPUd() void setNoCorrection()
_______________ Initialization interface ________________________
TPCFastSpaceChargeCorrection()
_____________ Constructors / destructors __________________________
void setSplineScenario(int32_t scenarioIndex, const SplineType &spline)
Sets approximation scenario.
TPCFastSpaceChargeCorrection & operator=(const TPCFastSpaceChargeCorrection &)=delete
Assignment operator: disabled to avoid ambiguity. Use cloneTo[In/Ex]ternalBuffer() instead.
int32_t float float realZ
GPUdi() const RowInfo &getRowInfo(int32_t row) const
Gives TPC row info.
void setRowScenarioID(int32_t iRow, int32_t iScenario)
Initializes a TPC row.
void print() const
Print method.
~TPCFastSpaceChargeCorrection()
Destructor.
GPUdi() void setTimeStamp(int64_t v)
Sets the time stamp of the current calibaration.
void finishConstruction()
Finishes construction: puts everything to the flat buffer, releases temporary memory.
Spline2D< float, 3, NoFlatObject > SlimSplineTypeXYZ
Slim variants (NoFlatObject base) for use in TPCFastTransformPOD.
GPUh() double testInverse(bool prn=0)
int32_t float float float & dx
int32_t float float float float & v
int32_t float float float float & dy
int32_t float float float & u
void setFutureBufferAddress(char *futureFlatBufferPtr)
TPCFastSpaceChargeCorrection(const TPCFastSpaceChargeCorrection &)=delete
Copy constructor: disabled to avoid ambiguity. Use cloneTo[In/Ex]ternalBuffer() instead.
void constructWithNoCorrection(const TPCFastTransformGeo &geo)
Spline2D< float, 1 > SplineTypeInvX
int64_t getTimeStamp() const
Gives the time stamp of the current calibaration parameters.
void setActualBufferAddress(char *actualFlatBufferPtr)
Moving the class with its external buffer to another location.
void cloneFromObject(const TPCFastSpaceChargeCorrection &obj, char *newFlatBufferPtr)
Construction interface.
GPUdi() RowInfo &getRowInfo(int32_t row)
Gives TPC row info.
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint GLfloat GLfloat y0
GLdouble GLdouble GLdouble z
void set(float y0_, float yScale_, float z0_, float zScale_, float zOut_, float zReadout_)
GPUdi() float getSpineScaleForZ(float z) const
GridInfo gridReal
grid info for the real coordinates
GridInfo gridMeasured
grid info for the measured coordinates
int32_t splineScenarioID
scenario index (which of Spline2D splines to use)
size_t dataOffsetBytes[3]
offset for the spline data withing a TPC sector