From 5f598f90036659ea30ec10c74ee898e2b7583a77 Mon Sep 17 00:00:00 2001 From: ypwangg Date: Thu, 23 Jul 2026 21:59:29 +0800 Subject: [PATCH] fix bug in FillHistClass --- PWGDQ/Core/HistogramManager.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/PWGDQ/Core/HistogramManager.cxx b/PWGDQ/Core/HistogramManager.cxx index a933ef354fd..74fa3d21b8c 100644 --- a/PWGDQ/Core/HistogramManager.cxx +++ b/PWGDQ/Core/HistogramManager.cxx @@ -812,7 +812,6 @@ void HistogramManager::FillHistClass(const char* className, float* values) bool isProfile = false; bool isTHn = false; int dimension = 0; - bool isSparse = kFALSE; bool isFillLabelx = kFALSE; // TODO: At the moment, maximum 20 dimensions are foreseen for the THn histograms. We should make this more dynamic // But maybe its better to have it like to avoid dynamically allocating this array in the histogram loop @@ -950,18 +949,14 @@ void HistogramManager::FillHistClass(const char* className, float* values) // end if(!isTHn) } else { if (varW > kNothing) { - if (isSparse) { - if (auto* hn = dynamic_cast(h)) { - hn->Fill(fillValues.data(), values[varW]); - } + if (auto* hn = dynamic_cast(h)) { + hn->Fill(fillValues.data(), values[varW]); } else if (auto* hn = dynamic_cast(h)) { hn->Fill(fillValues.data(), values[varW]); } } else { - if (isSparse) { - if (auto* hn = dynamic_cast(h)) { - hn->Fill(fillValues.data()); - } + if (auto* hn = dynamic_cast(h)) { + hn->Fill(fillValues.data()); } else if (auto* hn = dynamic_cast(h)) { hn->Fill(fillValues.data()); }