You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Common] Fix stale Q/Pt values in TrackTuner graph-based smearing
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.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
// For Q/Pt corrections, files on CCDB will be used if both qOverPtMC and qOverPtData are null
738
+
// Use local copies so that graph-based Q/Pt correction is evaluated
739
+
// per-track at the correct pT. Writing directly to qOverPtMC/qOverPtData
740
+
// would overwrite the negative sentinel on the first call, causing all
741
+
// subsequent tracks to skip graph evaluation and reuse stale values.
742
+
double currentQOverPtMC = qOverPtMC;
743
+
double currentQOverPtData = qOverPtData;
739
744
if (updateCurvature || updateCurvatureIU) {
740
-
if ((qOverPtMC < 0) || (qOverPtData < 0)) {
741
-
if (debugInfo) {
742
-
LOG(info) << "### q/pt smearing: qOverPtMC=" << qOverPtMC << ", qOverPtData=" << qOverPtData << ". One of them is negative. Retrieving then values from graphs from input .root file";
743
-
}
745
+
if ((currentQOverPtMC < 0) || (currentQOverPtData < 0)) {
744
746
/// check that input graphs for q/pt smearing are correctly retrieved
745
747
if (!grOneOverPtPionData.get() || !grOneOverPtPionMC.get()) {
0 commit comments