You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c42426b
Browse filesBrowse the repository at this point in the historyBrowse files
TPC: Digitizer recalculates the distortions with the derivative corrections without inverting the average map (new default)
Digitizer::recalculateDistortions() (distortion type 2) inverted the average
distortions to corrections, added the scaled corrections of the derivative
map and inverted the sum back to distortions. The first inversion is the
slowest and the least precise step.
SpaceCharge::scaleGlobalDistWithDerivativeCorr() applies the scaled
derivative corrections directly to the average distortions. With
T(x) = x + D(x) the new distortion at the vertex p is D_new(p) = T(x) - p,
where x is the fixed point of x = p - scale * C_der(T(x)) (at most 20
iterations, stop at a change of the start point < 2 um). The distorted point
y = T(x) then fulfils y + C(y) + scale * C_der(y) = p for the inverse C of
D, i.e. the distortions are consistent with the scaled corrections at the
distorted point as they are applied in the reconstruction (C_avg + s * C_der
at the measured point). Only the derivative distortions are inverted.
The r-phi distortion is calculated from the cross and dot product of the
vertex and the distorted point: the difference of two angles wrapped with
the single precision 2 pi gave an offset of 0.4 um for phi > pi.
The function returns false if the global distortions of the object or the
global corrections of the derivative map are not set (distortions
unchanged); the Digitizer then stops with a fatal instead of continuing with
the unscaled distortions.
- Digitizer::setRecalcDistortionsMethod() and option
--recalculate-distortions-method of the TPC digitizer: 0 = inversion of
the scaled corrections (previous method), 1 = new method (default). Other
values are a fatal error. The distortions of a digitisation with lumi
scaling (distortion type 2) change.
- ClassDefNV of the Digitizer 3 -> 4 (new member)
Validation with run 559917 (distortion maps and correction splines of the
same MC map production): closure with the correction splines of the
reconstruction, |c + D(c) - q| for the measured point q and the corrected
point c = q + C_avg(q) + s * C_der(q), 99% quantile in local X / Y / Z
(5 < |z| < 245 cm, pad rows >= 10):
scale s new method previous method no scaling
-0.32 0.62/0.94/2.00 mm 1.02/1.39/2.73 mm 0.58/0.96/1.98 mm
-2 0.83/1.01/2.17 mm 1.07/1.39/2.74 mm
The new method closes as well as the unscaled average map with its own
correction splines. The previous method has larger tails (99.9% in r-phi at
s = -2: 4.4 mm vs 2.0 mm) and 10x more points with a closure > 1 cm at
s = -2 (2396 vs 239). The remaining large residuals of the new method are at
the innermost pad rows (IFC).
Time of the recalculation (CCDB maps of run 559917, 65x257x720, both
sides): 85.9 s -> 27.1 s with 1 thread, 22.9 s -> 7.3 s with 4 threads
(default of n-threads-distortions).
Tests: SpaceCharge_scaleWithDerivative_test (analytical fields, scale -3, -1
and 2: closure with the scaled corrections, agreement with the inversion of
the scaled corrections, return value without distortions or derivative
corrections), SpaceCharge_scaleWithDerivativeFloat_test (single precision:
r-phi distortion of radial distortions and radial derivative corrections for
phi <= pi and phi > pi).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/// \param method 0: invert the average and the derivative distortions to corrections and invert the scaled corrections C_avg + s * C_der to distortions,
143
+
/// 1: invert only the derivative distortions and apply the scaled derivative corrections directly to the average distortions (SpaceCharge::scaleGlobalDistWithDerivativeCorr).
/// in case of scaled distortions, the distortions can be recalculated to ensure consistent distortions and corrections
142
149
voidrecalculateDistortions();
143
150
@@ -155,7 +162,8 @@ class Digitizer
155
162
intmDistortionScaleType = 0; ///< type=0: no scaling of distortions, type=1 distortions without any scaling, type=2 distortions scaling with lumi
156
163
floatmLumiScaleFactor = 0; ///< value used to scale the derivative map
157
164
boolmUseScaledDistortions = false; ///< whether the distortions are already scaled
158
-
ClassDefNV(Digitizer, 3);
165
+
intmRecalcDistortionsMethod = 1; ///< method of recalculateDistortions(): 0 = inversion of the scaled corrections, 1 = derivative corrections applied to the distortions
LOGP(fatal, "Unknown method {} for the recalculation of the distortions (0: inversion of the scaled corrections, 1: scaled derivative corrections applied to the distortions)", method);
/// Scale the global distortions with the global corrections of a derivative map, consistent with the scaled corrections C(y) + scale * C_der(y) at the
413
+
/// distorted point y (as done in the tracking), without inverting the global distortions of this object.
414
+
/// With T(x) = x + D(x) (the global distortions of this object), the new distortion at the vertex p is D_new(p) = T(x) - p, where x is the fixed point of
415
+
/// x = p - scale * C_der(T(x)) (iterated starting at x = p). Then y = T(x) fulfils y + C(y) = x for the inverse C of D, and y + C(y) + scale * C_der(y) = p.
416
+
/// The iteration converges fast since C_der is small and smooth (each step reduces the error by about |scale| * |dC_der/dy|).
417
+
/// \param side side of the TPC
418
+
/// \param scDer derivative map: its global corrections must be set (e.g. with calcGlobalCorrWithGlobalDistIterative())
419
+
/// \param scale scaling factor of the derivative map
420
+
/// \param maxIter maximum number of fixed-point iterations per vertex
421
+
/// \param diffCorr the iteration stops when the start point x changes by less than this value (cm) in x, y and z. The default (2 um) is above the
422
+
/// rounding noise of the cartesian corrections in single precision (O(0.5 um) at the outer radius) times the scaling factor
423
+
/// \return true if the distortions were scaled, false if the global distortions of this object or the global corrections of the derivative map are not set (the distortions are not changed)
/// Calculate global corrections using the global distortions by scaling with second distortion object, which will be consistent with scaled corrections in cartesian coordinates
LOGP(warning, "Scaling of the global distortions with the derivative map (scale {}): {} of {} vertices on side {} not converged after {} iterations", scale, nNotConverged, mGlobalDistdR[side].getNDataPoints(), static_cast<int>(side), maxIter);
1028
+
}
1029
+
warnNonFinite(mGlobalDistdR[side], mGlobalDistdRPhi[side], mGlobalDistdZ[side], "global distortions scaled with the derivative map", side);
0 commit comments