Skip to content

Commit 5f598f9

Browse files
committed
fix bug in FillHistClass
1 parent 9d3961f commit 5f598f9

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

PWGDQ/Core/HistogramManager.cxx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,6 @@ void HistogramManager::FillHistClass(const char* className, float* values)
812812
bool isProfile = false;
813813
bool isTHn = false;
814814
int dimension = 0;
815-
bool isSparse = kFALSE;
816815
bool isFillLabelx = kFALSE;
817816
// TODO: At the moment, maximum 20 dimensions are foreseen for the THn histograms. We should make this more dynamic
818817
// 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)
950949
// end if(!isTHn)
951950
} else {
952951
if (varW > kNothing) {
953-
if (isSparse) {
954-
if (auto* hn = dynamic_cast<THnSparse*>(h)) {
955-
hn->Fill(fillValues.data(), values[varW]);
956-
}
952+
if (auto* hn = dynamic_cast<THnSparse*>(h)) {
953+
hn->Fill(fillValues.data(), values[varW]);
957954
} else if (auto* hn = dynamic_cast<THn*>(h)) {
958955
hn->Fill(fillValues.data(), values[varW]);
959956
}
960957
} else {
961-
if (isSparse) {
962-
if (auto* hn = dynamic_cast<THnSparse*>(h)) {
963-
hn->Fill(fillValues.data());
964-
}
958+
if (auto* hn = dynamic_cast<THnSparse*>(h)) {
959+
hn->Fill(fillValues.data());
965960
} else if (auto* hn = dynamic_cast<THn*>(h)) {
966961
hn->Fill(fillValues.data());
967962
}

0 commit comments

Comments
 (0)