Skip to content

[Common] Fix stale Q/Pt values in TrackTuner graph-based smearing#15174

Open
joonsukbae wants to merge 2 commits intoAliceO2Group:masterfrom
joonsukbae:fix/tracktuner-qoverpt-stale-values
Open

[Common] Fix stale Q/Pt values in TrackTuner graph-based smearing#15174
joonsukbae wants to merge 2 commits intoAliceO2Group:masterfrom
joonsukbae:fix/tracktuner-qoverpt-stale-values

Conversation

@joonsukbae
Copy link
Contributor

@joonsukbae joonsukbae commented Feb 25, 2026

@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.

Copy link
Collaborator

@mfaggin mfaggin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
double currentQOverPtMC = qOverPtMC;
double currentQOverPtData = qOverPtData;
if (updateCurvature || updateCurvatureIU) {
double smearQOverPtMC = qOverPtMC;
double smearQOverPtData = qOverPtData;
if (updateCurvature || updateCurvatureIU) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @mfaggin, thanks a lot for your confirmation and suggestion. I updated PR, rebasing your recent merged PR (#15169).

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.
@joonsukbae joonsukbae force-pushed the fix/tracktuner-qoverpt-stale-values branch from d8daecc to 43abedd Compare February 26, 2026 09:59
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.

2 participants