From 1bfc0421718d3326ff536d9121e421bfba18761a Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 14 Apr 2026 09:23:54 +0200 Subject: [PATCH 1/3] DPL Analysis: return span directly if the CCDB column is declared as a span --- Framework/Core/include/Framework/ASoA.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 7a3307ae1a58c..d7c4a2b1450e8 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -2470,6 +2470,7 @@ consteval static std::string_view namespace_prefix() _Name_& operator=(_Name_ const& other) = default; \ \ decltype(auto) _Getter_() const \ + requires(!std::same_as < _ConcreteType_, std::span) \ { \ static std::byte* payload = nullptr; \ static _ConcreteType_* deserialised = nullptr; \ @@ -2484,6 +2485,12 @@ consteval static std::string_view namespace_prefix() return *deserialised; \ } \ \ + decltype(auto) _Getter_() const \ + requires(std::same_as<_Concrete_Type_, std::span>) \ + { \ + return *mColumnIterator; \ + } \ + \ decltype(auto) \ get() const \ { \ From 845571c1c9a91e3ea45180fc784b1469a07047ea Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 14 Apr 2026 11:21:50 +0200 Subject: [PATCH 2/3] fixup! DPL Analysis: return span directly if the CCDB column is declared as a span --- 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 d7c4a2b1450e8..4b5edc168fc57 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -2470,7 +2470,7 @@ consteval static std::string_view namespace_prefix() _Name_& operator=(_Name_ const& other) = default; \ \ decltype(auto) _Getter_() const \ - requires(!std::same_as < _ConcreteType_, std::span) \ + requires(!std::same_as<_ConcreteType_, std::span>) \ { \ static std::byte* payload = nullptr; \ static _ConcreteType_* deserialised = nullptr; \ @@ -2486,7 +2486,7 @@ consteval static std::string_view namespace_prefix() } \ \ decltype(auto) _Getter_() const \ - requires(std::same_as<_Concrete_Type_, std::span>) \ + requires(std::same_as<_ConcreteType_, std::span>) \ { \ return *mColumnIterator; \ } \ From 7a3f3789bcf370c30632b6d742ec398b58c6d2d3 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 14 Apr 2026 12:12:40 +0200 Subject: [PATCH 3/3] fixup! DPL Analysis: return span directly if the CCDB column is declared as a span --- Framework/Core/include/Framework/ASoA.h | 85 ++++++++++++------------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 4b5edc168fc57..96a4fe08cdd61 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -2452,50 +2452,47 @@ consteval static std::string_view namespace_prefix() }; \ [[maybe_unused]] static constexpr o2::framework::expressions::BindingNode _Getter_ { _Label_, _Name_::hash, o2::framework::expressions::selectArrowType<_Type_>() } -#define DECLARE_SOA_CCDB_COLUMN_FULL(_Name_, _Label_, _Getter_, _ConcreteType_, _CCDBQuery_) \ - struct _Name_ : o2::soa::Column, _Name_> { \ - static constexpr const char* mLabel = _Label_; \ - static constexpr const char* query = _CCDBQuery_; \ - static constexpr const uint32_t hash = crc32(namespace_prefix<_Name_>(), std::string_view{#_Getter_}); \ - using base = o2::soa::Column, _Name_>; \ - using type = std::span; \ - using column_t = _Name_; \ - _Name_(arrow::ChunkedArray const* column) \ - : o2::soa::Column, _Name_>(o2::soa::ColumnIterator>(column)) \ - { \ - } \ - \ - _Name_() = default; \ - _Name_(_Name_ const& other) = default; \ - _Name_& operator=(_Name_ const& other) = default; \ - \ - decltype(auto) _Getter_() const \ - requires(!std::same_as<_ConcreteType_, std::span>) \ - { \ - static std::byte* payload = nullptr; \ - static _ConcreteType_* deserialised = nullptr; \ - static TClass* c = TClass::GetClass(#_ConcreteType_); \ - auto span = *mColumnIterator; \ - if (payload != (std::byte*)span.data()) { \ - payload = (std::byte*)span.data(); \ - delete deserialised; \ - TBufferFile f(TBufferFile::EMode::kRead, span.size(), (char*)span.data(), kFALSE); \ - deserialised = (_ConcreteType_*)soa::extractCCDBPayload((char*)payload, span.size(), c, "ccdb_object"); \ - } \ - return *deserialised; \ - } \ - \ - decltype(auto) _Getter_() const \ - requires(std::same_as<_ConcreteType_, std::span>) \ - { \ - return *mColumnIterator; \ - } \ - \ - decltype(auto) \ - get() const \ - { \ - return _Getter_(); \ - } \ +#define DECLARE_SOA_CCDB_COLUMN_FULL(_Name_, _Label_, _Getter_, _ConcreteType_, _CCDBQuery_) \ + struct _Name_ : o2::soa::Column, _Name_> { \ + static constexpr const char* mLabel = _Label_; \ + static constexpr const char* query = _CCDBQuery_; \ + static constexpr const uint32_t hash = crc32(namespace_prefix<_Name_>(), std::string_view{#_Getter_}); \ + using base = o2::soa::Column, _Name_>; \ + using type = std::span; \ + using column_t = _Name_; \ + _Name_(arrow::ChunkedArray const* column) \ + : o2::soa::Column, _Name_>(o2::soa::ColumnIterator>(column)) \ + { \ + } \ + \ + _Name_() = default; \ + _Name_(_Name_ const& other) = default; \ + _Name_& operator=(_Name_ const& other) = default; \ + \ + decltype(auto) _Getter_() const \ + { \ + if constexpr (std::same_as<_ConcreteType_, std::span>) { \ + return *mColumnIterator; \ + } else { \ + static std::byte* payload = nullptr; \ + static _ConcreteType_* deserialised = nullptr; \ + static TClass* c = TClass::GetClass(#_ConcreteType_); \ + auto span = *mColumnIterator; \ + if (payload != (std::byte*)span.data()) { \ + payload = (std::byte*)span.data(); \ + delete deserialised; \ + TBufferFile f(TBufferFile::EMode::kRead, span.size(), (char*)span.data(), kFALSE); \ + deserialised = (_ConcreteType_*)soa::extractCCDBPayload((char*)payload, span.size(), c, "ccdb_object"); \ + } \ + return *deserialised; \ + } \ + } \ + \ + decltype(auto) \ + get() const \ + { \ + return _Getter_(); \ + } \ }; #define DECLARE_SOA_CCDB_COLUMN(_Name_, _Getter_, _ConcreteType_, _CCDBQuery_) \