Skip to content

Commit

Permalink
TPC: Fixing inverse for M-Shape distortions
Browse files Browse the repository at this point in the history
- do no recalculate inverse as default
  • Loading branch information
matthias-kleiner authored and shahor02 committed Mar 2, 2024
1 parent c435d77 commit 47d4b66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 47d4b66

Please sign in to comment.