From 8a68b29932fcdabb3af71ab0bccbb638e22ebae9 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Thu, 5 Dec 2024 12:16:50 +0100 Subject: [PATCH 1/3] DPL Analysis: fix for iterator not setting the originals correctly --- Framework/Core/include/Framework/ASoA.h | 29 +++++++++++++----------- Framework/Core/test/test_GroupSlicer.cxx | 9 ++++++++ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 25e64daefeba7..1576936f1ca0d 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -1728,7 +1728,8 @@ class Table using columns_t = typename Parent::columns_t; using external_index_columns_t = typename Parent::external_index_columns_t; using bindings_pack_t = decltype([](framework::pack) -> framework::pack {}(external_index_columns_t{})); - static constexpr const std::array originals{T::ref...}; + // static constexpr const std::array originals{T::ref...}; + static constexpr auto originals = Parent::originals; using policy_t = IP; using parent_t = Parent; @@ -1741,7 +1742,7 @@ class Table template TableIteratorBase& operator=(TableIteratorBase other) - requires(P::ref::signature == Parent::ref::signature) + requires(P::ref.desc_hash == Parent::ref.desc_hash) { static_cast&>(*this) = static_cast>(other); return *this; @@ -1762,16 +1763,16 @@ class Table return *this; } - template - TableIteratorBase(TableIteratorBase const& other) - requires(P::ref::signature == Parent::ref::signature) + template + TableIteratorBase(TableIteratorBase const& other) + requires(P::ref.desc_hash == Parent::ref.desc_hash) { *this = other; } - template - TableIteratorBase(TableIteratorBase&& other) noexcept - requires(P::ref::signature == Parent::ref::signature) + template + TableIteratorBase(TableIteratorBase&& other) noexcept + requires(P::ref.desc_hash == Parent::ref.desc_hash) { *this = other; } @@ -2503,7 +2504,7 @@ consteval auto getIndexTargets() for (auto const& i : *mColumnIterator) { \ auto pos = mBinding.get()->isInSelectedRows(i); \ if (pos > 0) { \ - result.push_back(mBinding.get()->iteratorAt(pos)); \ + result.emplace_back(mBinding.get()->iteratorAt(pos)); \ } \ } \ return result; \ @@ -3471,9 +3472,10 @@ template class Filtered : public FilteredBase { public: - using base_t = T; + using base_t = FilteredBase; using self_t = Filtered; - using table_t = typename FilteredBase::table_t; + using table_t = typename T::table_t; + using columns_t = typename T::columns_t; using iterator = T::template iterator_template_o; using unfiltered_iterator = T::template iterator_template_o; @@ -3633,9 +3635,10 @@ class Filtered> : public FilteredBase using self_t = Filtered>; using base_t = T; using table_t = typename FilteredBase::table_t; + using columns_t = typename T::columns_t; - using iterator = FilteredBase::iterator; - using unfiltered_iterator = FilteredBase::unfiltered_iterator; + using iterator = typename T::template iterator_template_o ;//FilteredBase::iterator; + using unfiltered_iterator = typename T::template iterator_template_o ;//FilteredBase::unfiltered_iterator; using const_iterator = iterator; iterator begin() diff --git a/Framework/Core/test/test_GroupSlicer.cxx b/Framework/Core/test/test_GroupSlicer.cxx index 8ce5170e89cb7..161939141e790 100644 --- a/Framework/Core/test/test_GroupSlicer.cxx +++ b/Framework/Core/test/test_GroupSlicer.cxx @@ -10,10 +10,12 @@ // or submit itself to any jurisdiction. #include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" #include "Framework/TableBuilder.h" #include "Framework/GroupSlicer.h" #include "Framework/ArrowTableSlicingCache.h" #include +#include #include @@ -85,6 +87,13 @@ DECLARE_SOA_COLUMN(Lst, lst, std::vector); DECLARE_SOA_TABLE(EventExtra, "AOD", "EVTSXTRA", test::Arr, test::Boo, test::Lst); } // namespace o2::aod +TEST_CASE("RelatedByIndex") +{ + using Trks = soa::Join; + CHECK(soa::relatedByIndex() == true); + CHECK(soa::relatedByIndex() == true); +} + TEST_CASE("GroupSlicerOneAssociated") { TableBuilder builderE; From 89799fa75a4c4f34e7741abe1101535f470b566e Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Thu, 5 Dec 2024 12:19:40 +0100 Subject: [PATCH 2/3] fixup! DPL Analysis: fix for iterator not setting the originals correctly --- Framework/Core/include/Framework/ASoA.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 1576936f1ca0d..b7054c69ded8a 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -3637,8 +3637,8 @@ class Filtered> : public FilteredBase using table_t = typename FilteredBase::table_t; using columns_t = typename T::columns_t; - using iterator = typename T::template iterator_template_o ;//FilteredBase::iterator; - using unfiltered_iterator = typename T::template iterator_template_o ;//FilteredBase::unfiltered_iterator; + using iterator = typename T::template iterator_template_o; + using unfiltered_iterator = typename T::template iterator_template_o; using const_iterator = iterator; iterator begin() From 0c608cf7aada997c040f4fb26e6cf84854cd9757 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Thu, 5 Dec 2024 13:38:12 +0100 Subject: [PATCH 3/3] fixup! DPL Analysis: fix for iterator not setting the originals correctly --- Framework/Core/include/Framework/ASoA.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index b7054c69ded8a..84c6e3ae705fb 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -1451,12 +1451,7 @@ using PresliceOptional = PresliceBase; namespace o2::soa { -template -class FilteredBase; -template -class Filtered; - -template +template class FilteredBase; template class Filtered; @@ -3062,9 +3057,6 @@ consteval auto getIndexTargets() namespace o2::soa { -// template -// class FilteredBase; - template struct JoinFull : Table, D, o2::aod::Hash<"JOIN"_h>, Ts...> { using base = Table, D, o2::aod::Hash<"JOIN"_h>, Ts...>; @@ -3202,7 +3194,7 @@ constexpr auto concat(Ts const&... t) return Concat{t...}; } -template +template class FilteredBase : public T { public: @@ -3472,7 +3464,7 @@ template class Filtered : public FilteredBase { public: - using base_t = FilteredBase; + using base_t = T; using self_t = Filtered; using table_t = typename T::table_t; using columns_t = typename T::columns_t;