17#if !defined(GPUCA_STANDALONE)
25#if !defined(GPUCA_STANDALONE)
41template <
typename DataT,
class FlatBase>
48 mParameters =
nullptr;
49 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
54template <
typename DataT,
class FlatBase>
58 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
59 FlatBase::setActualBufferAddress(actualFlatBufferPtr);
61 const size_t u2Offset = this->
alignSize(mGridX1.getFlatBufferSize(), mGridX2.getBufferAlignmentBytes());
62 mParameters =
nullptr;
64 const int32_t parametersOffset = this->
alignSize(u2Offset + mGridX2.getFlatBufferSize(), getParameterAlignmentBytes());
65 mParameters =
reinterpret_cast<DataT*
>(this->mFlatBufferPtr + parametersOffset);
67 mGridX1.setActualBufferAddress(this->mFlatBufferPtr);
68 mGridX2.setActualBufferAddress(this->mFlatBufferPtr + u2Offset);
72template <
typename DataT,
class FlatBase>
76 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
77 char* bufferU = FlatBase::relocatePointer(this->mFlatBufferPtr, futureFlatBufferPtr, mGridX1.getFlatBufferPtr());
78 char* bufferV = FlatBase::relocatePointer(this->mFlatBufferPtr, futureFlatBufferPtr, mGridX2.getFlatBufferPtr());
79 mGridX1.setFutureBufferAddress(bufferU);
80 mGridX2.setFutureBufferAddress(bufferV);
81 mParameters = FlatBase::relocatePointer(this->mFlatBufferPtr, futureFlatBufferPtr, mParameters);
82 FlatBase::setFutureBufferAddress(futureFlatBufferPtr);
86template <
typename DataT,
class FlatBase>
89 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
90 printf(
" Irregular Spline 2D: \n");
91 printf(
" grid U1: \n");
93 printf(
" grid U2: \n");
98template <
typename DataT,
class FlatBase>
102 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
105 FlatBase::cloneFromObject(obj, newFlatBufferPtr);
108 char* bufferU = FlatBase::relocatePointer(oldFlatBufferPtr, this->mFlatBufferPtr, obj.
mGridX1.getFlatBufferPtr());
109 char* bufferV = FlatBase::relocatePointer(oldFlatBufferPtr, this->mFlatBufferPtr, obj.
mGridX2.getFlatBufferPtr());
111 mGridX1.cloneFromObject(obj.
mGridX1, bufferU);
112 mGridX2.cloneFromObject(obj.
mGridX2, bufferV);
113 mParameters = FlatBase::relocatePointer(oldFlatBufferPtr, this->mFlatBufferPtr, obj.
mParameters);
117template <
typename DataT,
class FlatBase>
121 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
122 char* oldFlatBufferPtr = this->mFlatBufferPtr;
123 FlatBase::moveBufferTo(newFlatBufferPtr);
124 char* currFlatBufferPtr = this->mFlatBufferPtr;
125 this->mFlatBufferPtr = oldFlatBufferPtr;
126 setActualBufferAddress(currFlatBufferPtr);
130template <
typename DataT,
class FlatBase>
131template <
class OtherFlatBase>
136 mYdim =
src.getYdimensions();
137 this->mFlatBufferSize =
src.getFlatBufferSize();
138 mGridX1.importFrom(
src.getGridX1());
139 mGridX2.importFrom(
src.getGridX2());
140 mParameters =
nullptr;
143template <
typename DataT,
class FlatBase>
146 int32_t numberOfKnotsU1,
const int32_t knotsU1[], int32_t numberOfKnotsU2,
const int32_t knotsU2[])
149 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
151 FlatBase::startConstruction();
153 mGridX1.recreate(0, numberOfKnotsU1, knotsU1);
154 mGridX2.recreate(0, numberOfKnotsU2, knotsU2);
156 const size_t u2Offset = this->
alignSize(mGridX1.getFlatBufferSize(), mGridX2.getBufferAlignmentBytes());
157 int32_t parametersOffset = u2Offset + mGridX2.getFlatBufferSize();
158 int32_t bufferSize = parametersOffset;
159 mParameters =
nullptr;
161 parametersOffset = this->
alignSize(bufferSize, getParameterAlignmentBytes());
162 bufferSize = parametersOffset + getSizeOfParameters();
164 FlatBase::finishConstruction(bufferSize);
166 mGridX1.moveBufferTo(this->mFlatBufferPtr);
167 mGridX2.moveBufferTo(this->mFlatBufferPtr + u2Offset);
169 mParameters =
reinterpret_cast<DataT*
>(this->mFlatBufferPtr + parametersOffset);
170 for (int32_t
i = 0;
i < getNumberOfParameters();
i++) {
176template <
typename DataT,
class FlatBase>
178 int32_t numberOfKnotsU1, int32_t numberOfKnotsU2)
181 if constexpr (!std::is_same_v<FlatBase, NoFlatObject>) {
183 FlatBase::startConstruction();
185 mGridX1.recreate(0, numberOfKnotsU1);
186 mGridX2.recreate(0, numberOfKnotsU2);
188 const size_t u2Offset = this->
alignSize(mGridX1.getFlatBufferSize(), mGridX2.getBufferAlignmentBytes());
189 int32_t parametersOffset = u2Offset + mGridX2.getFlatBufferSize();
190 int32_t bufferSize = parametersOffset;
191 mParameters =
nullptr;
193 parametersOffset = this->
alignSize(bufferSize, getParameterAlignmentBytes());
194 bufferSize = parametersOffset + getSizeOfParameters();
196 FlatBase::finishConstruction(bufferSize);
198 mGridX1.moveBufferTo(this->mFlatBufferPtr);
199 mGridX2.moveBufferTo(this->mFlatBufferPtr + u2Offset);
201 mParameters =
reinterpret_cast<DataT*
>(this->mFlatBufferPtr + parametersOffset);
202 for (int32_t
i = 0;
i < getNumberOfParameters();
i++) {
208#if !defined(GPUCA_STANDALONE)
210template <
typename DataT,
class FlatBase>
212 double x1Min,
double x1Max,
double x2Min,
double x2Max,
213 std::function<
void(
double x1,
double x2,
double f[])> F,
214 int32_t nAuxiliaryDataPointsX1, int32_t nAuxiliaryDataPointsX2)
221template <
typename DataT,
class FlatBase>
223 double x1Min,
double x1Max,
double x2Min,
double x2Max,
224 std::function<
void(
double x1,
double x2,
double f[])> F,
225 int32_t nAuxiliaryDataPointsX1, int32_t nAuxiliaryDataPointsX2)
232template <
typename DataT,
class FlatBase>
236 if constexpr (std::is_same_v<FlatBase, FlatObject>) {
243template <
typename DataT,
class FlatBase>
247 if constexpr (std::is_same_v<FlatBase, FlatObject>) {
248 return FlatObject::readFromFile<Spline2DContainerBase<DataT, FlatBase>>(inpf,
name);
254template <
typename DataT,
class FlatBase>
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 Spline2DHelper class.
templateClassImp(o2::gpu::Spline2DContainerBase)
Definition of Spline2DSpec class.
static int32_t writeToFile(T &obj, TFile &outf, const char *name)
write a child class object to the file
void importFrom(const Spline2DContainerBase< DataT, OtherFlatBase > &src)
void approximateFunctionViaDataPoints(double x1Min, double x1Max, double x2Min, double x2Max, std::function< void(double x1, double x2, double f[])> F, int32_t nAuxiliaryDataPointsX1, int32_t nAuxiliaryDataPointsX2)
int32_t mYdim
_____________ Data members ____________
void setFutureBufferAddress(char *futureFlatBufferPtr)
void moveBufferTo(char *newBufferPtr)
void recreate(int32_t nYdim, int32_t nKnotsX1, int32_t nKnotsX2)
Constructor for a regular spline.
static int32_t test(const bool draw=0, const bool drawDataPoints=1)
_______________ Test tools _______________
void setActualBufferAddress(char *actualFlatBufferPtr)
static Spline2DContainerBase * readFromFile(TFile &inpf, const char *name)
read a class object from the file
void approximateFunction(double x1Min, double x1Max, double x2Min, double x2Max, std::function< void(double x1, double x2, double f[])> F, int32_t nAuxiliaryDataPointsU1=4, int32_t nAuxiliaryDataPointsU2=4)
_______________ Construction interface ________________________
int32_t writeToFile(TFile &outf, const char *name)
_______________ IO ________________________
void cloneFromObject(const Spline2DContainerBase &obj, char *newFlatBufferPtr)
_____________ FlatObject functionality, see FlatObject class for description ____________
Spline1D< DataT, 0, FlatBase > mGridX1
grid for U axis
Spline1D< DataT, 0, FlatBase > mGridX2
grid for V axis
void approximateFunctionViaDataPoints(Spline2DContainerBase< DataT, FlatObject > &spline, double x1Min, double x1Max, double x2Min, double x2Max, std::function< void(double x1, double x2, double f[])> F, int32_t nAuxiliaryDataPointsU1=4, int32_t nAuxiliaryDataPointsU2=4)
void approximateFunction(Spline2DContainerBase< DataT, FlatObject > &spline, double x1Min, double x1Max, double x2Min, double x2Max, std::function< void(double x1, double x2, double f[])> F, int32_t nAuxiliaryDataPointsU1=4, int32_t nAuxiliaryDataPointsU2=4)
_______________ Main functionality ________________________
static int32_t test(const bool draw=0, const bool drawDataPoints=1)
Test the Spline2D class functionality.
Forward declaration — specializations below select ClassDefNV based on FlatBase.
GLuint GLfloat GLfloat GLfloat x1
GLuint const GLchar * name
size_t alignSize(size_t sizeBytes)
align size to given diven number of bytes
TCanvas * drawDataPoints(TMultiGraph *mg, double min, double max)