|
25 | 25 | #include <Rtypes.h> |
26 | 26 | #include <RtypesCore.h> |
27 | 27 |
|
| 28 | +#include <array> |
28 | 29 | #include <cstdint> |
29 | 30 | #include <iostream> |
30 | 31 | #include <list> |
@@ -806,7 +807,7 @@ void HistogramManager::FillHistClass(const char* className, Float_t* values) |
806 | 807 | bool isFillLabelx = kFALSE; |
807 | 808 | // TODO: At the moment, maximum 20 dimensions are foreseen for the THn histograms. We should make this more dynamic |
808 | 809 | // But maybe its better to have it like to avoid dynamically allocating this array in the histogram loop |
809 | | - double fillValues[20] = {0.0}; |
| 810 | + std::array<double, 20> fillValues{}; |
810 | 811 | int varX = -1, varY = -1, varZ = -1, varT = -1, varW = -1; |
811 | 812 |
|
812 | 813 | // loop over the histogram and std::list |
@@ -942,18 +943,18 @@ void HistogramManager::FillHistClass(const char* className, Float_t* values) |
942 | 943 | if (varW > kNothing) { |
943 | 944 | if (isSparse) { |
944 | 945 | if (auto* hn = dynamic_cast<THnSparse*>(h)) { |
945 | | - hn->Fill(fillValues, values[varW]); |
| 946 | + hn->Fill(fillValues.data(), values[varW]); |
946 | 947 | } |
947 | 948 | } else if (auto* hn = dynamic_cast<THn*>(h)) { |
948 | | - hn->Fill(fillValues, values[varW]); |
| 949 | + hn->Fill(fillValues.data(), values[varW]); |
949 | 950 | } |
950 | 951 | } else { |
951 | 952 | if (isSparse) { |
952 | 953 | if (auto* hn = dynamic_cast<THnSparse*>(h)) { |
953 | | - hn->Fill(fillValues); |
| 954 | + hn->Fill(fillValues.data()); |
954 | 955 | } |
955 | 956 | } else if (auto* hn = dynamic_cast<THn*>(h)) { |
956 | | - hn->Fill(fillValues); |
| 957 | + hn->Fill(fillValues.data()); |
957 | 958 | } |
958 | 959 | } |
959 | 960 | } // end else |
|
0 commit comments