Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPC: Fixing inverse for M-Shape distortions #12794

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void CorrectionMapsLoader::addOptions(std::vector<ConfigParamSpec>& options)
{
// these are options which should be added at the level of device using TPC corrections
// At the moment - nothing, all options are moved to configurable param CorrMapParam
addOption(options, ConfigParamSpec{"do-not-recalculate-inverse-correction", o2::framework::VariantType::Bool, false, {"Do NOT recalculate the inverse correction in case lumi mode 1 or 2 is used"}});
addOption(options, ConfigParamSpec{"recalculate-inverse-correction", o2::framework::VariantType::Bool, false, {"recalculate the inverse correction in case lumi mode 1 or 2 is used"}});
addOption(options, ConfigParamSpec{"nthreads-inverse-correction", o2::framework::VariantType::Int, 4, {"Number of threads used for calculating the inverse correction (-1=all threads)"}});
}

Expand Down Expand Up @@ -251,7 +251,7 @@ void CorrectionMapsLoader::init(o2::framework::InitContext& ic)
}

if ((getLumiScaleMode() == 1) || (getLumiScaleMode() == 2)) {
mScaleInverse = ic.options().get<bool>("do-not-recalculate-inverse-correction");
mScaleInverse = !(ic.options().get<bool>("recalculate-inverse-correction"));
} else {
mScaleInverse = true;
}
Expand Down
10 changes: 5 additions & 5 deletions GPU/TPCFastTransformation/TPCFastTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ GPUdi() void TPCFastTransform::TransformInternal(int slice, int row, float& u, f
dv = dvRef * scale + dv;
}
}
if (ref2) {
if (ref2 && (scale2 != 0)) {
float dxRef, duRef, dvRef;
ref2->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef);
dx = dxRef * scale2 + dx;
Expand Down Expand Up @@ -795,7 +795,7 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y
if (ref2 && (scale2 != 0)) {
float xr;
ref2->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr);
x = (xr - getGeometry().getRowInfo(row).x) * scale + x; // xr=mGeo.getRowInfo(row).x + dx;
x = (xr - getGeometry().getRowInfo(row).x) * scale2 + x; // xr=mGeo.getRowInfo(row).x + dx;
}
} else {
x = mCorrection.getGeometry().getRowInfo(row).x; // corrections are disabled
Expand Down Expand Up @@ -833,11 +833,11 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoNominalYZ(int slice, int row,
un = (unr - u) * scale + un; // unr = u - duv[0];
vn = (vnr - v) * scale + vn;
}
if (ref2 && (scale != 0)) {
if (ref2 && (scale2 != 0)) {
float unr = 0, vnr = 0;
ref2->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr);
un = (unr - u) * scale + un; // unr = u - duv[0];
vn = (vnr - v) * scale + vn;
un = (unr - u) * scale2 + un; // unr = u - duv[0];
vn = (vnr - v) * scale2 + vn;
}
}
} else {
Expand Down
Loading