From bd48c98ac7611e475c732e0906eed9fe0fcdf36c Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 31 Jul 2026 15:08:43 +0200 Subject: [PATCH] Adding function in fwdtrackUtilities for 3D shifts --- Common/Core/fwdtrackUtilities.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Common/Core/fwdtrackUtilities.h b/Common/Core/fwdtrackUtilities.h index 7265f1fe581..29a9db2c194 100644 --- a/Common/Core/fwdtrackUtilities.h +++ b/Common/Core/fwdtrackUtilities.h @@ -60,9 +60,9 @@ concept is_fwd_cov = requires(T t) { { t.sigmaX() } -> std::same_as; }; -/// Produce TrackParCovFwds for MFT and FwdTracks, w/ or w/o cov, with z shift +/// Produce TrackParCovFwds for MFT and FwdTracks, w/ or w/o cov, with x, y and z shifts template -o2::track::TrackParCovFwd getTrackParCovFwdShift(TFwdTrack const& track, float zshift, TCovariance const&... covOpt) +o2::track::TrackParCovFwd getTrackParCovFwd3DShift(TFwdTrack const& track, float xshift, float yshift, float zshift, TCovariance const&... covOpt) { double chi2 = track.chi2(); if constexpr (sizeof...(covOpt) == 0) { @@ -82,7 +82,7 @@ o2::track::TrackParCovFwd getTrackParCovFwdShift(TFwdTrack const& track, float z } } - SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); + SMatrix5 tpars(track.x() + xshift, track.y() + yshift, track.phi(), track.tgl(), track.signed1Pt()); SMatrix55 tcovs; if constexpr (sizeof...(covOpt) == 1) { @@ -101,6 +101,13 @@ o2::track::TrackParCovFwd getTrackParCovFwdShift(TFwdTrack const& track, float z return o2::track::TrackParCovFwd(track.z() + zshift, tpars, tcovs, chi2); } +/// Produce TrackParCovFwds for MFT and FwdTracks, w/ or w/o cov, with z shift +template +o2::track::TrackParCovFwd getTrackParCovFwdShift(TFwdTrack const& track, float zshift, TCovariance const&... covOpt) +{ + return getTrackParCovFwd3DShift(track, 0.f, 0.f, zshift, covOpt...); +} + inline o2::track::TrackParCovFwd getTrackParCovFwdShiftManual( const double x, const double y, const double phi, const double tgl, const double signed1Pt, const double cXX,