diff --git a/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx b/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx index c6ceaaa0f5..41a2808b51 100644 --- a/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx +++ b/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx @@ -825,12 +825,12 @@ public: SumHelper(SumHelper &&) = default; SumHelper(const SumHelper &) = delete; SumHelper(const std::shared_ptr &sumVPtr, const unsigned int nSlots) - : fResultSum(sumVPtr), fSums(nSlots, NeutralElement(*sumVPtr, -1)) + : fResultSum(sumVPtr), fSums(nSlots * 1024, NeutralElement(*sumVPtr, -1)) { } void InitTask(TTreeReader *, unsigned int) {} - void Exec(unsigned int slot, ResultType v) { fSums[slot] += v; } + void Exec(unsigned int slot, ResultType v) { fSums[slot * 1024] += v; } template ::value, int>::type = 0> void Exec(unsigned int slot, const T &vs) diff --git a/tree/dataframe/inc/ROOT/RDF/RCustomColumn.hxx b/tree/dataframe/inc/ROOT/RDF/RCustomColumn.hxx index f59087a023..8eb1dc9091 100644 --- a/tree/dataframe/inc/ROOT/RDF/RCustomColumn.hxx +++ b/tree/dataframe/inc/ROOT/RDF/RCustomColumn.hxx @@ -70,7 +70,7 @@ class RCustomColumn final : public RCustomColumnBase { template void UpdateHelper(unsigned int slot, Long64_t entry, std::index_sequence, TypeList, NoneTag) { - fLastResults[slot] = fExpression(std::get(fValues[slot]).Get(entry)...); + fLastResults[slot * 1024] = fExpression(std::get(fValues[slot]).Get(entry)...); // silence "unused parameter" warnings in gcc (void)slot; (void)entry; @@ -79,7 +79,7 @@ class RCustomColumn final : public RCustomColumnBase { template void UpdateHelper(unsigned int slot, Long64_t entry, std::index_sequence, TypeList, SlotTag) { - fLastResults[slot] = fExpression(slot, std::get(fValues[slot]).Get(entry)...); + fLastResults[slot * 1024] = fExpression(slot, std::get(fValues[slot]).Get(entry)...); // silence "unused parameter" warnings in gcc (void)slot; (void)entry; @@ -89,7 +89,7 @@ class RCustomColumn final : public RCustomColumnBase { void UpdateHelper(unsigned int slot, Long64_t entry, std::index_sequence, TypeList, SlotAndEntryTag) { - fLastResults[slot] = fExpression(slot, entry, std::get(fValues[slot]).Get(entry)...); + fLastResults[slot * 1024] = fExpression(slot, entry, std::get(fValues[slot]).Get(entry)...); // silence "unused parameter" warnings in gcc (void)slot; (void)entry; @@ -99,7 +99,7 @@ public: RCustomColumn(RLoopManager *lm, std::string_view name, F &&expression, const ColumnNames_t &columns, unsigned int nSlots, const RDFInternal::RBookedCustomColumns &customColumns, bool isDSColumn = false) : RCustomColumnBase(lm, name, nSlots, isDSColumn, customColumns), fExpression(std::forward(expression)), - fColumnNames(columns), fLastResults(fNSlots), fValues(fNSlots), fIsCustomColumn() + fColumnNames(columns), fLastResults(fNSlots * 1024), fValues(fNSlots), fIsCustomColumn() { const auto nColumns = fColumnNames.size(); for (auto i = 0u; i < nColumns; ++i) @@ -117,14 +117,14 @@ public: } } - void *GetValuePtr(unsigned int slot) final { return static_cast(&fLastResults[slot]); } + void *GetValuePtr(unsigned int slot) final { return static_cast(&fLastResults[slot * 1024]); } void Update(unsigned int slot, Long64_t entry) final { - if (entry != fLastCheckedEntry[slot]) { + if (entry != fLastCheckedEntry[slot * 1024]) { // evaluate this filter, cache the result UpdateHelper(slot, entry, TypeInd_t(), ColumnTypes_t(), ExtraArgsTag{}); - fLastCheckedEntry[slot] = entry; + fLastCheckedEntry[slot * 1024] = entry; } } diff --git a/tree/dataframe/src/RCustomColumnBase.cxx b/tree/dataframe/src/RCustomColumnBase.cxx index 3a123899c5..f770dca442 100644 --- a/tree/dataframe/src/RCustomColumnBase.cxx +++ b/tree/dataframe/src/RCustomColumnBase.cxx @@ -48,5 +48,5 @@ std::string RCustomColumnBase::GetName() const void RCustomColumnBase::InitNode() { - fLastCheckedEntry = std::vector(fNSlots, -1); + fLastCheckedEntry = std::vector(fNSlots * 1024, -1); }