Skip to content

Regularization fixes + switch for the pre-PR-15610 compatibility mode - #15784

Open
shahor02 wants to merge 2 commits into
AliceO2Group:devfrom
shahor02:pr_dcaFClaude
Open

Regularization fixes + switch for the pre-PR-15610 compatibility mode#15784
shahor02 wants to merge 2 commits into
AliceO2Group:devfrom
shahor02:pr_dcaFClaude

Conversation

@shahor02

Copy link
Copy Markdown
Collaborator

Do not squash, the compatibility mode (2nd commit) might be temporary.

… duplications

DCAFitter: apply X-error regularization only where it is needed, drop duplications

Follow-up to PR15610. The fitted PCA and chi2 are unchanged; the vertex covariance
returned by calcPCACovMatrix() (and hence by createParentTrackParCov()) becomes larger
along weakly constrained directions.

1. TrackCovI::set() takes the regularization strength as an argument (XRegErrFactor
by default, XRegNone to disable). The weak dummy X error added to sxx is needed
only to keep the Newton Hessian invertible for (nearly) collinear prongs, so
calcPCACovMatrix() now rebuilds the information matrices with XRegNone: there
only their sum is inverted (and an ill-conditioned sum is already replaced by a
loose dummy), hence the prior would only make the longitudinal vertex error
follow the dummy XRegErrFactor*Cyy instead of the track slopes. Documented in
DCAFitterN_derivation.md.

2. createParentTrackParCov() uses getCovXYZPxPyPzGlo() again instead of the
hand-written momentum Jacobian, which was algebraically identical to it (same
J for the native snp,tgl,q/pt parameters, same |q/pt|/|snp| guard). Also
replaced the literal 21 by o2::track::kLabCovMatSize.

3. The M*E*M^T rotate-and-sum block, identical in calcInverseWeight() and
calcPCACovMatrix(), is factored into addRotatedTrackInfo(). This replaces the
now unused getTrackRotMatrix().

4. calcCollinearInflation() uses o2::gpu::GPUCommonMath instead of host-only
std::sqrt/clamp/max/min, so it stays device-compilable although currently not
called; its commented-out call site becomes an explicit TODO and the unused
InflateRelDet/MaxInflation constants are removed.

5. correctTracks() sets mPropFailed and logs via mLoggerBadProp on a failed
propagation, as propagate{Param}ToX() do; the commented-out Taylor block is
replaced by a comment on why mCandTr must be moved and why the analytic
constant-Bz transport is used for the small Newton steps.

6. Added the missing newline to the mLoggerBadPCACov message.

Verified by a full explicit instantiation of DCAFitterN<2>/<3>, which type-checks
all members including the otherwise uninstantiated calcCollinearInflation().

Co-Authored-By: Claude Opus 5
If setOldMode(true) is set, the behavior of the DCAFitter will reproduce the pre-PR-15610
version.
@shahor02
shahor02 requested a review from a team as a code owner September 10, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant