Skip to content

[PWGDQ] fix MFT momentum rescaling - #17461

Open
aferrero2707 wants to merge 1 commit into
AliceO2Group:masterfrom
aferrero2707:PWGDQ-fix-mft-momentum-rescaling
Open

[PWGDQ] fix MFT momentum rescaling#17461
aferrero2707 wants to merge 1 commit into
AliceO2Group:masterfrom
aferrero2707:PWGDQ-fix-mft-momentum-rescaling

Conversation

@aferrero2707

@aferrero2707 aferrero2707 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The MCH tracks are extrapolated to the first measured MFT point using TrackExtrap::extrapToVertex() instead of TrackExtrap::extrapToVertexWithoutBranson(), which cures large inaccuracies in the MCH momentum estimation at the MFT front for some tracks.
Those inaccuracies were contributing to high-mass tails in the di-muon invariant mass forward tracks with rescaled momentum.

Below is a comparison of the J/psi invariant mass before and after the fix, estimated from the same AO2Ds of LHC25i4 (OO MC simulation with injected J/psi and psi(2S)).

Before:
image

After:
image

@github-actions

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 61 warnings, 🔕 12 disabled

@mcoquet642

Copy link
Copy Markdown
Collaborator

why not use the common tool for rescaling introduced in fwdtrackUtilities.h ?

@aferrero2707

Copy link
Copy Markdown
Contributor Author

why not use the common tool for rescaling introduced in fwdtrackUtilities.h ?

Mostly to have the freedom of experimenting without affecting the common tools used in analysis.
For this specific case, if I understand correctly one could use refitGlobalMuonCov() for the momentum rescaling, right? However, the issue is in the determination of the MCH momentum to be used for the rescaling, so the common function would not help.

Once the fix is confirmed we can see how to properly propagate it to the common code. What do you think?

@mcoquet642

Copy link
Copy Markdown
Collaborator

why not use the common tool for rescaling introduced in fwdtrackUtilities.h ?

Mostly to have the freedom of experimenting without affecting the common tools used in analysis. For this specific case, if I understand correctly one could use refitGlobalMuonCov() for the momentum rescaling, right? However, the issue is in the determination of the MCH momentum to be used for the rescaling, so the common function would not help.

Once the fix is confirmed we can see how to properly propagate it to the common code. What do you think?

Indeed refitGlobalMuonCov does not fix the choice of the rescaling momentum (which indeed should be computed with Branson correction as you point out). But I think it would be good to be consistent with how the parameters are computed from the provided inputs. The one implemented in refitGlobalMuonCov has been extensively tested and is used by both EM and DQ (btw they also already use Branson correction to compute the rescaling of the momentum)

@aferrero2707
aferrero2707 force-pushed the PWGDQ-fix-mft-momentum-rescaling branch 2 times, most recently from 3c6fe8c to e458622 Compare August 19, 2026 08:31
@aferrero2707
aferrero2707 marked this pull request as ready for review August 19, 2026 16:09
@aferrero2707
aferrero2707 marked this pull request as draft August 19, 2026 16:09
The MCH tracks are extrapolated to the first measured MFT point using
TrackExtrap::extrapToVertex() instead of TrackExtrap::extrapToVertexWithoutBranson(),
which cures large inaccuracies in the MCH momentum estimation at the MFT
front for some tracks. Those inaccuracies were contributing to high-mass
tails in the di-muon invariant mass distribution reconstructed from global
forward tracks with rescaled momentum.
@aferrero2707
aferrero2707 force-pushed the PWGDQ-fix-mft-momentum-rescaling branch from e458622 to 617c499 Compare August 19, 2026 16:12
@aferrero2707
aferrero2707 marked this pull request as ready for review August 19, 2026 20:13
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 617c499 at 2026-08-19 22:38:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 56 errors and 55 warnings.'
Found 56 errors and 55 warnings.
++ [[ 56 -gt 0 ]]
++ cat /sw/BUILD/eecbd6f466b6e04e5412bc78be2f62532a9d78eb/O2Physics-code-check/errors.txt
PWGDQ/Tasks/muonGlobalAlignment.cxx:44:1: error: included header MatchGlobalFwd.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Tasks/muonGlobalAlignment.cxx:60:1: error: included header Vector3D.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Tasks/muonGlobalAlignment.cxx:61:1: error: included header Vector4D.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Tasks/muonGlobalAlignment.cxx:351:16: error: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast,-warnings-as-errors]
PWGDQ/Tasks/muonGlobalAlignment.cxx:1409:79: error: the parameter 'mftTrackPar' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGDQ/Tasks/muonGlobalAlignment.cxx:1485:15: error: no header providing "ROOT::Math::PxPyPzMVector" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Tasks/muonGlobalAlignment.cxx:1504:17: error: no header providing "ROOT::Math::XYZVector" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:88:10: error: inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead [modernize-deprecated-headers,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:240:8: error: constructor does not initialize these fields: ccdbManager [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:245:3: error: initial values in enum 'QaMatching::MuonMatchType' are not consistent, consider explicit initialization of all, none or only the first enumerator [readability-enum-initial-value,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:718:37: error: the parameter 'path' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:758:36: error: the parameter 'histName' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:758:58: error: the parameter 'histTitle' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:763:33: error: redundant explicit casting to the same type 'int' as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:764:37: error: redundant explicit casting to the same type 'int' as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:846:7: error: 'registry' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:992:20: error: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:994:7: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:995:38: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1114:16: error: the variable 'globalMuonTrackParameters' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1115:20: error: the variable 'globalMuonTrackCovariances' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1149:16: error: the variable 'globalMuonTrackParameters' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1150:20: error: the variable 'globalMuonTrackCovariances' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1180:16: error: the variable 'globalMuonTrackParameters' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1181:20: error: the variable 'globalMuonTrackCovariances' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1225:11: error: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1225:26: error: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1253:11: error: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1253:26: error: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1253:70: error: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1269:31: error: redundant explicit casting to the same type 'int' as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1313:14: error: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:1654:17: error: redundant explicit casting to the same type 'float' as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2163:15: error: slicing object from type 'GlobalFwdTrack' to 'TrackParCovFwd' discards 40 bytes of state [cppcoreguidelines-slicing,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2164:15: error: slicing object from type 'GlobalFwdTrack' to 'TrackParCovFwd' discards 40 bytes of state [cppcoreguidelines-slicing,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2179:15: error: slicing object from type 'GlobalFwdTrack' to 'TrackParCovFwd' discards 40 bytes of state [cppcoreguidelines-slicing,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2180:15: error: slicing object from type 'GlobalFwdTrack' to 'TrackParCovFwd' discards 40 bytes of state [cppcoreguidelines-slicing,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2231:11: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2281:11: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2499:11: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2530:11: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]
PWGDQ/Tasks/qaMatching.cxx:2559:11: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]
[0 more errors; see full log]

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants