Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
798df8d
TPC Splines: fix initialization of the track residuals in the test macro
sgorbuno Mar 15, 2024
996c09d
TPC Splines: fix propagation of the track residual data to the TPC ro…
sgorbuno Mar 15, 2024
9874971
TPC Splines: non-uniform grid that corresponds to the track residual …
sgorbuno Apr 15, 2024
afb4e0e
TPC Splines: multithreaded reading of the residual tree
sgorbuno Apr 18, 2024
50a7557
TPC Splines: add limits for SP correction values per TPC row
sgorbuno Jun 20, 2024
18f34dd
TPC Splines: disable smoothing
sgorbuno Jul 4, 2024
2f00a48
TPC Splines: smooth to linear edges, crop at grid borders, use mean p…
Jul 18, 2024
c8da284
TPC Splines: fix the inverse correction
sgorbuno Jan 16, 2025
1d69139
TPC Splines: fix reading track residuals
sgorbuno Jan 27, 2025
2469531
TPC Splines: fix scaling splines outside of the measured area
sgorbuno Jan 27, 2025
00b913d
TPC Splines: rename Slice -> Roc in geometry
sgorbuno Jan 27, 2025
57bfa41
TPC Splines: minimise the amount of transformations
sgorbuno Feb 5, 2025
3ea668f
TPC Splines: init inverse from the inverse voxel map; rebase
sgorbuno Mar 6, 2025
956826e
TPC Splines: cleanup
sgorbuno Apr 6, 2025
967c35f
TPC Splines: fast merge of SC corrections
sgorbuno Apr 11, 2025
a0155d4
TPC Splines: get rid of internal UV coordinates
sgorbuno Apr 12, 2025
1029a37
TPC Splines: completely switch to local TPC coordinates in the grid
sgorbuno Apr 14, 2025
b4da791
TPC Splines: correct biased voxels; features for debugging
cbmsw Aug 20, 2025
9a64980
TPC Splines: replace std::tuple by std::array
cbmsw Aug 27, 2025
8c42bbe
TPC Splines: better smoothing between the voxels
cbmsw Aug 27, 2025
99171c3
TPCFastTransform: fix compilation on GPU with the new splines
davidrohr Sep 1, 2025
46a3efd
TPC Splines: bugfixes in spline merging
cbmsw Sep 17, 2025
093a834
TPC Splines: add backward compatibility
cbmsw Oct 6, 2025
4408af2
Fix compiler-warnings, codechecker violations and compilation
cbmsw Oct 15, 2025
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 @@ -552,9 +557,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