[Common] Fix stale Q/Pt values in TrackTuner graph-based smearing#15174
Open
joonsukbae wants to merge 1 commit intoAliceO2Group:masterfrom
Open
[Common] Fix stale Q/Pt values in TrackTuner graph-based smearing#15174joonsukbae wants to merge 1 commit intoAliceO2Group:masterfrom
joonsukbae wants to merge 1 commit intoAliceO2Group:masterfrom
Conversation
When qOverPtMC and qOverPtData are configured as negative sentinels (requesting graph-based evaluation), the original code overwrites the member variables on the first track call. All subsequent tracks then skip graph evaluation and reuse stale values from the first track's pT, applying incorrect smearing. Fix: use local variables (currentQOverPtMC, currentQOverPtData) so each track evaluates the graphs at its own pT. The member variable sentinels remain negative, ensuring graph evaluation on every call.
mfaggin
requested changes
Feb 26, 2026
Collaborator
mfaggin
left a comment
There was a problem hiding this comment.
Many thanks @joonsukbae , indeed as in the code now the usage of the graph is not ok for the issue you said. Apologize, this option was just tested locally one time, and it is not really used, so you are the first real deep user.
Your solution looks ok to me, I just ask you to change the variable names since "current" is a word that internally we use for the MC, i.e. the "current" values to be "upgraded".
Comment on lines
+739
to
741
| double currentQOverPtMC = qOverPtMC; | ||
| double currentQOverPtData = qOverPtData; | ||
| if (updateCurvature || updateCurvatureIU) { |
Collaborator
There was a problem hiding this comment.
Suggested change
| double currentQOverPtMC = qOverPtMC; | |
| double currentQOverPtData = qOverPtData; | |
| if (updateCurvature || updateCurvatureIU) { | |
| double smearQOverPtMC = qOverPtMC; | |
| double smearQOverPtData = qOverPtData; | |
| if (updateCurvature || updateCurvatureIU) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@mfaggin,
When qOverPtMC and qOverPtData are configured as negative sentinels (requesting graph-based evaluation), the original code overwrites the member variables on the first track call. All subsequent tracks then skip graph evaluation and reuse stale values from the first track's pT, applying incorrect smearing.
Fix: use local variables (currentQOverPtMC, currentQOverPtData) so each track evaluates the graphs at its own pT. The member variable sentinels remain negative, ensuring graph evaluation on every call.