Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
58e08b7
TPC Splines: fix initialization of the track residuals in the test macro
sgorbuno Mar 15, 2024
3e64840
TPC Splines: fix propagation of the track residual data to the TPC ro…
sgorbuno Mar 15, 2024
2fdd5ca
TPC Splines: non-uniform grid that corresponds to the track residual …
sgorbuno Apr 15, 2024
b3f1bd3
TPC Splines: multithreaded reading of the residual tree
sgorbuno Apr 18, 2024
c9b28a0
TPC Splines: add limits for SP correction values per TPC row
sgorbuno Jun 20, 2024
0ca40df
TPC Splines: disable smoothing
sgorbuno Jul 4, 2024
a5c079e
TPC Splines: smooth to linear edges, crop at grid borders, use mean p…
Jul 18, 2024
d0430b8
TPC Splines: fix the inverse correction
sgorbuno Jan 16, 2025
9420dde
TPC Splines: fix reading track residuals
sgorbuno Jan 27, 2025
da16c83
TPC Splines: fix scaling splines outside of the measured area
sgorbuno Jan 27, 2025
43ebbf6
TPC Splines: rename Slice -> Roc in geometry
sgorbuno Jan 27, 2025
7736046
TPC Splines: minimise the amount of transformations
sgorbuno Feb 5, 2025
36b0e43
TPC Splines: init inverse from the inverse voxel map; rebase
sgorbuno Mar 6, 2025
d062bad
TPC Splines: cleanup
sgorbuno Apr 6, 2025
d26dcc4
TPC Splines: fast merge of SC corrections
sgorbuno Apr 11, 2025
372bc80
TPC Splines: get rid of internal UV coordinates
sgorbuno Apr 12, 2025
f8e6591
TPC Splines: completely switch to local TPC coordinates in the grid
sgorbuno Apr 14, 2025
2f44979
TPC Splines: correct biased voxels; features for debugging
cbmsw Aug 20, 2025
adc2a89
TPC Splines: replace std::tuple by std::array
cbmsw Aug 27, 2025
e865f34
TPC Splines: better smoothing between the voxels
cbmsw Aug 27, 2025
0820e37
TPCFastTransform: fix compilation on GPU with the new splines
davidrohr Sep 1, 2025
3648d14
TPC Splines: bugfixes in spline merging
cbmsw Sep 17, 2025
ec45e8c
TPC Splines: add backward compatibility
cbmsw Oct 6, 2025
7eb63e3
Fix compiler-warnings, codechecker violations and compilation
cbmsw Oct 15, 2025
d6ac2c7
TPC Splines: keep old cropping scheme
cbmsw Feb 5, 2026
287d018
GPU TPC FastTransformation: Do not use std::array
davidrohr Mar 29, 2026
a8ab4b0
GPU TPCFastTransformation: Do not use double
davidrohr Mar 31, 2026
33cf955
GPU TPCFastTransfomration: Add missing inline keywords
davidrohr Apr 1, 2026
adf6dfb
Add POD version of TPCFastTransform
shahor02 Feb 22, 2026
800b3b6
fixup
davidrohr Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,14 @@ class TrackResiduals
void getVoxelCoordinates(int isec, int ix, int ip, int iz, float& x, float& p, float& z) const;

/// Calculates the x-coordinate for given x bin.
/// \param i Bin index
/// \param ix Bin index in x
/// \return Coordinate in X
float getX(int i) const;
float getX(int ix) const;

/// Calculates the max y/x-coordinate for given x bin taking the dead zone into account.
/// \param ix Bin index in x
/// \return Max coordinate in Y/X
float getMaxY2X(int ix) const;

/// Calculates the y/x-coordinate.
/// \param ix Bin index in X
Expand Down Expand Up @@ -560,9 +565,15 @@ inline float TrackResiduals::getDXI(int ix) const
}

//_____________________________________________________
inline float TrackResiduals::getX(int i) const
inline float TrackResiduals::getX(int ix) const
{
return mUniformBins[VoxX] ? param::MinX + (ix + 0.5) * mDX : param::RowX[ix];
}

//_____________________________________________________
inline float TrackResiduals::getMaxY2X(int ix) const
{
return mUniformBins[VoxX] ? param::MinX + (i + 0.5) * mDX : param::RowX[i];
return mMaxY2X[ix];
}

//_____________________________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,28 @@ class TPCFastSpaceChargeCorrectionHelper
const int nKnotsY = 10, const int nKnotsZ = 20);

/// Create SpaceCharge correction out of the voxel tree
/// \param trackResiduals TrackResiduals object
/// \param voxResTree TTree with voxel residuals
/// \param voxResTreeInverse TTree with inverse voxel residuals
/// \param useSmoothed if true, use smoothed residuals
/// \param invertSigns if true, invert the signs of the residuals
/// \param fitPointsDirect debug: pointer to the data used for the direct correction
/// \param fitPointsInverse debug: pointer to the data used for the inverse correction
/// \return pointer to the created TPCFastSpaceChargeCorrection object
/// \note voxel trees wont be changed. They are read as non-const because of the ROOT::TTreeProcessorMT interface
///
std::unique_ptr<o2::gpu::TPCFastSpaceChargeCorrection> createFromTrackResiduals(
const o2::tpc::TrackResiduals& trackResiduals, TTree* voxResTree, bool useSmoothed = false, bool invertSigns = false);
const o2::tpc::TrackResiduals& trackResiduals, TTree* voxResTree, TTree* voxResTreeInverse, //
bool useSmoothed, bool invertSigns, //
TPCFastSpaceChargeCorrectionMap* fitPointsDirect = nullptr,
TPCFastSpaceChargeCorrectionMap* fitPointsInverse = nullptr);

/// _______________ Utilities ________________________

const TPCFastTransformGeo& getGeometry() { return mGeo; }

TPCFastSpaceChargeCorrectionMap& getCorrectionMap() { return mCorrectionMap; }

void fillSpaceChargeCorrectionFromMap(TPCFastSpaceChargeCorrection& correction);

void testGeometry(const TPCFastTransformGeo& geo) const;

/// initialise inverse transformation
Expand All @@ -103,15 +115,39 @@ class TPCFastSpaceChargeCorrectionHelper
/// initialise inverse transformation from linear combination of several input corrections
void initInverse(std::vector<o2::gpu::TPCFastSpaceChargeCorrection*>& corrections, const std::vector<float>& scaling, bool prn);

/// merge several corrections
/// \param mainCorrection main correction
/// \param scale scaling factor for the main correction
/// \param additionalCorrections vector of pairs of additional corrections and their scaling factors
/// \param prn printout flag
/// \return main correction merged with additional corrections
void mergeCorrections(
o2::gpu::TPCFastSpaceChargeCorrection& mainCorrection, float scale,
const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, float>>& additionalCorrections, bool prn);

/// how far the voxel mean is allowed to be outside of the voxel (1.1 means 10%)
void setVoxelMeanValidityRange(double range)
{
mVoxelMeanValidityRange = range;
}

double getVoxelMeanValidityRange() const { return mVoxelMeanValidityRange; }

/// debug: if true, use voxel centers instead of the fitted positions for correction
void setDebugUseVoxelCenters();

bool isDebugUseVoxelCenters() const { return mDebugUseVoxelCenters; }

/// debug: if true, mirror the data from the A side to the C side of the TPC
void setDebugMirrorAdata2C();

bool isDebugMirrorAdata2C() const { return mDebugMirrorAdata2C; }

private:
/// geometry initialization
void initGeometry();

/// get space charge correction in internal TPCFastTransform coordinates u,v->dx,du,dv
void getSpaceChargeCorrection(const TPCFastSpaceChargeCorrection& correction, int slice, int row, o2::gpu::TPCFastSpaceChargeCorrectionMap::CorrectionPoint p, double& su, double& sv, double& dx, double& du, double& dv);

/// initialise max drift length
void initMaxDriftLength(o2::gpu::TPCFastSpaceChargeCorrection& correction, bool prn);
void fillSpaceChargeCorrectionFromMap(TPCFastSpaceChargeCorrection& correction, bool processingInverseCorrection);

static TPCFastSpaceChargeCorrectionHelper* sInstance; ///< singleton instance
bool mIsInitialized = 0; ///< initialization flag
Expand All @@ -120,6 +156,11 @@ class TPCFastSpaceChargeCorrectionHelper

TPCFastSpaceChargeCorrectionMap mCorrectionMap{0, 0};

double mVoxelMeanValidityRange{1.1}; ///< debug: how far the voxel mean is allowed to be outside of the voxel (1.1 means 10%)

bool mDebugUseVoxelCenters{false}; ///< debug: if true, use voxel centers instead of the fitted positions for correction
bool mDebugMirrorAdata2C{false}; ///< debug: if true, mirror the data from the A side to the C side of the TPC

ClassDefNV(TPCFastSpaceChargeCorrectionHelper, 0);
};

Expand Down
Loading