diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 085b80aa8489a..0ecc05df8e8ec 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -46,7 +46,7 @@ void accessingInvalidIndexFor(const char* getter); void dereferenceWithWrongType(); void missingFilterDeclaration(int hash, int ai); void notBoundTable(const char* tableName); -} +} // namespace o2::soa namespace o2::soa { @@ -1228,7 +1228,7 @@ static constexpr std::string getLabelForTable() } template - requires (!(soa::is_index_table || soa::with_base_table)) + requires(!(soa::is_index_table || soa::with_base_table)) static constexpr std::string getLabelFromType() { return getLabelForTable(); @@ -2129,10 +2129,10 @@ O2HASH("TEST/0"); constexpr static bool value = true; \ } -#define DECLARE_EQUIVALENT_FOR_INDEX_NG(_Base_, _Equiv_) \ - template <> \ - struct EquivalentIndexNG, o2::aod::Hash<_Equiv_ ""_h>> { \ - constexpr static bool value = true; \ +#define DECLARE_EQUIVALENT_FOR_INDEX_NG(_Base_, _Equiv_) \ + template <> \ + struct EquivalentIndexNG, o2::aod::Hash<_Equiv_ ""_h>> { \ + constexpr static bool value = true; \ } #define DECLARE_SOA_COLUMN_FULL(_Name_, _Getter_, _Type_, _Label_) \ @@ -2599,7 +2599,7 @@ consteval auto getIndexTargets() using type = _Type_; \ using column_t = _Name_##Id; \ using self_index_t = std::true_type; \ - using compatible_signature = std::conditional, _IndexTarget_, void>; \ + using compatible_signature = std::conditional, _IndexTarget_, void>; \ _Name_##Id(arrow::ChunkedArray const* column) \ : o2::soa::Column<_Type_, _Name_##Id>(o2::soa::ColumnIterator(column)) \ { \ @@ -2650,140 +2650,140 @@ consteval auto getIndexTargets() #define DECLARE_SOA_SELF_INDEX_COLUMN_FULL(_Name_, _Getter_, _Type_, _Label_) DECLARE_SOA_SELF_INDEX_COLUMN_COMPLETE(_Name_, _Getter_, _Type_, _Label_, void) #define DECLARE_SOA_SELF_INDEX_COLUMN(_Name_, _Getter_) DECLARE_SOA_SELF_INDEX_COLUMN_FULL(_Name_, _Getter_, int32_t, #_Name_) /// SELF SLICE -#define DECLARE_SOA_SELF_SLICE_INDEX_COLUMN_COMPLETE(_Name_, _Getter_, _Type_, _Label_, _IndexTarget_) \ - struct _Name_##IdSlice : o2::soa::Column<_Type_[2], _Name_##IdSlice> { \ - static_assert(std::is_integral_v<_Type_>, "Index type must be integral"); \ - static constexpr const char* mLabel = "fIndexSlice" _Label_; \ - using base = o2::soa::Column<_Type_[2], _Name_##IdSlice>; \ - using type = _Type_[2]; \ - using column_t = _Name_##IdSlice; \ - using self_index_t = std::true_type; \ - using compatible_signature = std::conditional, _IndexTarget_, void>; \ - _Name_##IdSlice(arrow::ChunkedArray const* column) \ - : o2::soa::Column<_Type_[2], _Name_##IdSlice>(o2::soa::ColumnIterator(column)) \ - { \ - } \ - \ - _Name_##IdSlice() = default; \ - _Name_##IdSlice(_Name_##IdSlice const& other) = default; \ - _Name_##IdSlice& operator=(_Name_##IdSlice const& other) = default; \ - std::array<_Type_, 2> inline getIds() const \ - { \ - return _Getter_##Ids(); \ - } \ - \ - bool has_##_Getter_() const \ - { \ - auto a = *mColumnIterator; \ - return a[0] >= 0 && a[1] >= 0; \ - } \ - \ - std::array<_Type_, 2> _Getter_##Ids() const \ - { \ - auto a = *mColumnIterator; \ - return std::array{a[0], a[1]}; \ - } \ - \ - template \ - auto _Getter_##_as() const \ - { \ - auto t = mBinding.get(); \ - if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ - } \ - if (O2_BUILTIN_UNLIKELY(!has_##_Getter_())) { \ - return t->emptySlice(); \ - } \ - auto a = *mColumnIterator; \ - auto r = t->rawSlice(a[0], a[1]); \ - t->copyIndexBindings(r); \ - r.bindInternalIndicesTo(t); \ - return r; \ - } \ - \ - bool setCurrentRaw(o2::soa::Binding current) \ - { \ - this->mBinding = current; \ - return true; \ - } \ - o2::soa::Binding getCurrentRaw() const { return mBinding; } \ - o2::soa::Binding mBinding; \ +#define DECLARE_SOA_SELF_SLICE_INDEX_COLUMN_COMPLETE(_Name_, _Getter_, _Type_, _Label_, _IndexTarget_) \ + struct _Name_##IdSlice : o2::soa::Column<_Type_[2], _Name_##IdSlice> { \ + static_assert(std::is_integral_v<_Type_>, "Index type must be integral"); \ + static constexpr const char* mLabel = "fIndexSlice" _Label_; \ + using base = o2::soa::Column<_Type_[2], _Name_##IdSlice>; \ + using type = _Type_[2]; \ + using column_t = _Name_##IdSlice; \ + using self_index_t = std::true_type; \ + using compatible_signature = std::conditional, _IndexTarget_, void>; \ + _Name_##IdSlice(arrow::ChunkedArray const* column) \ + : o2::soa::Column<_Type_[2], _Name_##IdSlice>(o2::soa::ColumnIterator(column)) \ + { \ + } \ + \ + _Name_##IdSlice() = default; \ + _Name_##IdSlice(_Name_##IdSlice const& other) = default; \ + _Name_##IdSlice& operator=(_Name_##IdSlice const& other) = default; \ + std::array<_Type_, 2> inline getIds() const \ + { \ + return _Getter_##Ids(); \ + } \ + \ + bool has_##_Getter_() const \ + { \ + auto a = *mColumnIterator; \ + return a[0] >= 0 && a[1] >= 0; \ + } \ + \ + std::array<_Type_, 2> _Getter_##Ids() const \ + { \ + auto a = *mColumnIterator; \ + return std::array{a[0], a[1]}; \ + } \ + \ + template \ + auto _Getter_##_as() const \ + { \ + auto t = mBinding.get(); \ + if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ + o2::soa::dereferenceWithWrongType(); \ + } \ + if (O2_BUILTIN_UNLIKELY(!has_##_Getter_())) { \ + return t->emptySlice(); \ + } \ + auto a = *mColumnIterator; \ + auto r = t->rawSlice(a[0], a[1]); \ + t->copyIndexBindings(r); \ + r.bindInternalIndicesTo(t); \ + return r; \ + } \ + \ + bool setCurrentRaw(o2::soa::Binding current) \ + { \ + this->mBinding = current; \ + return true; \ + } \ + o2::soa::Binding getCurrentRaw() const { return mBinding; } \ + o2::soa::Binding mBinding; \ }; #define DECLARE_SOA_SELF_SLICE_INDEX_COLUMN_FULL(_Name_, _Getter_, _Type_, _Label_) DECLARE_SOA_SELF_SLICE_INDEX_COLUMN_COMPLETE(_Name_, _Getter_, _Type_, _Label_, void) #define DECLARE_SOA_SELF_SLICE_INDEX_COLUMN(_Name_, _Getter_) DECLARE_SOA_SELF_SLICE_INDEX_COLUMN_FULL(_Name_, _Getter_, int32_t, "_" #_Name_) /// SELF ARRAY -#define DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN_COMPLETE(_Name_, _Getter_, _Type_, _Label_, _IndexTarget_) \ - struct _Name_##Ids : o2::soa::Column, _Name_##Ids> { \ - static_assert(std::is_integral_v<_Type_>, "Index type must be integral"); \ - static constexpr const char* mLabel = "fIndexArray" _Label_; \ - using base = o2::soa::Column, _Name_##Ids>; \ - using type = std::vector<_Type_>; \ - using column_t = _Name_##Ids; \ - using self_index_t = std::true_type; \ - using compatible_signature = std::conditional, _IndexTarget_, void>; \ - _Name_##Ids(arrow::ChunkedArray const* column) \ - : o2::soa::Column, _Name_##Ids>(o2::soa::ColumnIterator(column)) \ - { \ - } \ - \ - _Name_##Ids() = default; \ - _Name_##Ids(_Name_##Ids const& other) = default; \ - _Name_##Ids& operator=(_Name_##Ids const& other) = default; \ - gsl::span inline getIds() const \ - { \ - return _Getter_##Ids(); \ - } \ - \ - gsl::span _Getter_##Ids() const \ - { \ - return *mColumnIterator; \ - } \ - \ - bool has_##_Getter_() const \ - { \ - return !(*mColumnIterator).empty(); \ - } \ - \ - template \ - auto _Getter_##_as() const \ - { \ - auto t = mBinding.get(); \ - if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ - } \ - return getIterators(); \ - } \ - \ - template \ - auto getIterators() const \ - { \ - auto result = std::vector(); \ - for (auto& i : *mColumnIterator) { \ - result.push_back(mBinding.get()->rawIteratorAt(i)); \ - } \ - return result; \ - } \ - \ - template \ - auto _Getter_##_first_as() const \ - { \ - return mBinding.get()->rawIteratorAt((*mColumnIterator)[0]); \ - } \ - \ - template \ - auto _Getter_##_last_as() const \ - { \ - return mBinding.get()->rawIteratorAt((*mColumnIterator).back()); \ - } \ - \ - bool setCurrentRaw(o2::soa::Binding current) \ - { \ - this->mBinding = current; \ - return true; \ - } \ - o2::soa::Binding getCurrentRaw() const { return mBinding; } \ - o2::soa::Binding mBinding; \ +#define DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN_COMPLETE(_Name_, _Getter_, _Type_, _Label_, _IndexTarget_) \ + struct _Name_##Ids : o2::soa::Column, _Name_##Ids> { \ + static_assert(std::is_integral_v<_Type_>, "Index type must be integral"); \ + static constexpr const char* mLabel = "fIndexArray" _Label_; \ + using base = o2::soa::Column, _Name_##Ids>; \ + using type = std::vector<_Type_>; \ + using column_t = _Name_##Ids; \ + using self_index_t = std::true_type; \ + using compatible_signature = std::conditional, _IndexTarget_, void>; \ + _Name_##Ids(arrow::ChunkedArray const* column) \ + : o2::soa::Column, _Name_##Ids>(o2::soa::ColumnIterator(column)) \ + { \ + } \ + \ + _Name_##Ids() = default; \ + _Name_##Ids(_Name_##Ids const& other) = default; \ + _Name_##Ids& operator=(_Name_##Ids const& other) = default; \ + gsl::span inline getIds() const \ + { \ + return _Getter_##Ids(); \ + } \ + \ + gsl::span _Getter_##Ids() const \ + { \ + return *mColumnIterator; \ + } \ + \ + bool has_##_Getter_() const \ + { \ + return !(*mColumnIterator).empty(); \ + } \ + \ + template \ + auto _Getter_##_as() const \ + { \ + auto t = mBinding.get(); \ + if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ + o2::soa::dereferenceWithWrongType(); \ + } \ + return getIterators(); \ + } \ + \ + template \ + auto getIterators() const \ + { \ + auto result = std::vector(); \ + for (auto& i : *mColumnIterator) { \ + result.push_back(mBinding.get()->rawIteratorAt(i)); \ + } \ + return result; \ + } \ + \ + template \ + auto _Getter_##_first_as() const \ + { \ + return mBinding.get()->rawIteratorAt((*mColumnIterator)[0]); \ + } \ + \ + template \ + auto _Getter_##_last_as() const \ + { \ + return mBinding.get()->rawIteratorAt((*mColumnIterator).back()); \ + } \ + \ + bool setCurrentRaw(o2::soa::Binding current) \ + { \ + this->mBinding = current; \ + return true; \ + } \ + o2::soa::Binding getCurrentRaw() const { return mBinding; } \ + o2::soa::Binding mBinding; \ }; #define DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN_FULL(_Name_, _Getter_, _Type_, _Label_) DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN_COMPLETE(_Name_, _Getter_, _Type_, _Label_, void) @@ -2870,31 +2870,31 @@ consteval auto getIndexTargets() } #define DECLARE_SOA_TABLE_METADATA(_Name_, _Desc_, _Version_, ...) \ - using _Name_##Metadata = TableMetadata, __VA_ARGS__>; \ + using _Name_##Metadata = TableMetadata, __VA_ARGS__>; -#define DECLARE_SOA_TABLE_METADATA_TRAIT(_Name_, _Desc_, _Version_)\ - template <> \ - struct MetadataTrait> { \ - using metadata = _Name_##Metadata; \ +#define DECLARE_SOA_TABLE_METADATA_TRAIT(_Name_, _Desc_, _Version_) \ + template <> \ + struct MetadataTrait> { \ + using metadata = _Name_##Metadata; \ }; -#define DECLARE_SOA_TABLE_FULL_VERSIONED_(_Name_, _Label_, _Origin_, _Desc_, _Version_) \ - O2HASH(_Desc_ "/" #_Version_); \ - template \ - using _Name_##From = o2::soa::Table, Hash<_Desc_ "/" #_Version_ ""_h>, O>; \ - using _Name_ = _Name_##From>; \ - template <> \ - struct MetadataTrait> { \ - using metadata = _Name_##Metadata; \ +#define DECLARE_SOA_TABLE_FULL_VERSIONED_(_Name_, _Label_, _Origin_, _Desc_, _Version_) \ + O2HASH(_Desc_ "/" #_Version_); \ + template \ + using _Name_##From = o2::soa::Table, Hash<_Desc_ "/" #_Version_ ""_h>, O>; \ + using _Name_ = _Name_##From>; \ + template <> \ + struct MetadataTrait> { \ + using metadata = _Name_##Metadata; \ }; -#define DECLARE_SOA_STAGE(_Name_, _Origin_, _Desc_, _Version_) \ - template \ - using _Name_##From = o2::soa::Table, Hash<_Desc_ "/" #_Version_ ""_h>, O>; \ +#define DECLARE_SOA_STAGE(_Name_, _Origin_, _Desc_, _Version_) \ + template \ + using _Name_##From = o2::soa::Table, Hash<_Desc_ "/" #_Version_ ""_h>, O>; \ using _Name_ = _Name_##From>; -#define DECLARE_SOA_TABLE_FULL_VERSIONED(_Name_, _Label_, _Origin_, _Desc_, _Version_, ...) \ - DECLARE_SOA_TABLE_METADATA(_Name_, _Desc_, _Version_, __VA_ARGS__); \ +#define DECLARE_SOA_TABLE_FULL_VERSIONED(_Name_, _Label_, _Origin_, _Desc_, _Version_, ...) \ + DECLARE_SOA_TABLE_METADATA(_Name_, _Desc_, _Version_, __VA_ARGS__); \ DECLARE_SOA_TABLE_FULL_VERSIONED_(_Name_, _Label_, _Origin_, _Desc_, _Version_); #define DECLARE_SOA_TABLE_FULL(_Name_, _Label_, _Origin_, _Desc_, ...) \ @@ -2907,17 +2907,17 @@ consteval auto getIndexTargets() #define DECLARE_SOA_TABLE_VERSIONED(_Name_, _Origin_, _Desc_, _Version_, ...) \ O2HASH(#_Name_); \ - DECLARE_SOA_TABLE_METADATA(_Name_, _Desc_, _Version_, __VA_ARGS__); \ + DECLARE_SOA_TABLE_METADATA(_Name_, _Desc_, _Version_, __VA_ARGS__); \ DECLARE_SOA_TABLE_FULL_VERSIONED_(_Name_, #_Name_, _Origin_, _Desc_, _Version_) -#define DECLARE_SOA_TABLE_STAGED_VERSIONED(_BaseName_, _Desc_, _Version_, ...) \ - O2HASH(_Desc_ "/" #_Version_); \ - O2HASH(#_BaseName_); \ - O2HASH("Stored" #_BaseName_); \ - DECLARE_SOA_TABLE_METADATA(_BaseName_, _Desc_, _Version_, __VA_ARGS__); \ - using Stored##_BaseName_##Metadata = _BaseName_##Metadata; \ - DECLARE_SOA_TABLE_METADATA_TRAIT(_BaseName_, _Desc_, _Version_); \ - DECLARE_SOA_STAGE(_BaseName_, "AOD", _Desc_, _Version_); \ +#define DECLARE_SOA_TABLE_STAGED_VERSIONED(_BaseName_, _Desc_, _Version_, ...) \ + O2HASH(_Desc_ "/" #_Version_); \ + O2HASH(#_BaseName_); \ + O2HASH("Stored" #_BaseName_); \ + DECLARE_SOA_TABLE_METADATA(_BaseName_, _Desc_, _Version_, __VA_ARGS__); \ + using Stored##_BaseName_##Metadata = _BaseName_##Metadata; \ + DECLARE_SOA_TABLE_METADATA_TRAIT(_BaseName_, _Desc_, _Version_); \ + DECLARE_SOA_STAGE(_BaseName_, "AOD", _Desc_, _Version_); \ DECLARE_SOA_STAGE(Stored##_BaseName_, "AOD1", _Desc_, _Version_); #define DECLARE_SOA_TABLE_STAGED(_BaseName_, _Desc_, ...) \ @@ -2926,10 +2926,10 @@ consteval auto getIndexTargets() #define DECLARE_SOA_EXTENDED_TABLE_FULL(_Name_, _Label_, _OriginalTable_, _Origin_, _Desc_, _Version_, ...) \ O2HASH(_Desc_ "/" #_Version_); \ template \ - using _Name_##ExtensionFrom = soa::Table, o2::aod::Hash<_Desc_ "/" #_Version_ ""_h>, O>; \ + using _Name_##ExtensionFrom = soa::Table, o2::aod::Hash<_Desc_ "/" #_Version_ ""_h>, O>; \ using _Name_##Extension = _Name_##ExtensionFrom>; \ template > \ - struct _Name_##ExtensionMetadataFrom : TableMetadata, __VA_ARGS__> { \ + struct _Name_##ExtensionMetadataFrom : TableMetadata, __VA_ARGS__> { \ using base_table_t = _OriginalTable_; \ using extension_table_t = _Name_##ExtensionFrom; \ using expression_pack_t = framework::pack<__VA_ARGS__>; \ @@ -2937,7 +2937,7 @@ consteval auto getIndexTargets() }; \ using _Name_##ExtensionMetadata = _Name_##ExtensionMetadataFrom>; \ template <> \ - struct MetadataTrait> { \ + struct MetadataTrait> { \ using metadata = _Name_##ExtensionMetadata; \ }; \ template \ @@ -2956,7 +2956,7 @@ consteval auto getIndexTargets() O2HASH(#_Name_); \ O2HASH(_Desc_ "/" #_Version_); \ template > \ - struct _Name_##MetadataFrom : o2::aod::TableMetadata, soa::Index<>, __VA_ARGS__> { \ + struct _Name_##MetadataFrom : o2::aod::TableMetadata, soa::Index<>, __VA_ARGS__> { \ static constexpr bool exclusive = _Exclusive_; \ using Key = _Key_; \ using index_pack_t = framework::pack<__VA_ARGS__>; \ @@ -2972,7 +2972,7 @@ consteval auto getIndexTargets() using _Name_ = _Name_##From>; \ \ template <> \ - struct MetadataTrait> { \ + struct MetadataTrait> { \ using metadata = _Name_##Metadata; \ }; diff --git a/Framework/Core/include/Framework/AnalysisHelpers.h b/Framework/Core/include/Framework/AnalysisHelpers.h index 8915523cde3c2..52c92de736e20 100644 --- a/Framework/Core/include/Framework/AnalysisHelpers.h +++ b/Framework/Core/include/Framework/AnalysisHelpers.h @@ -89,7 +89,7 @@ concept producable = soa::has_metadata || soa::has_metadata struct WritingCursor { public: - using persistent_table_t = decltype([](){ if constexpr (soa::is_iterator) { return typename T::parent_t{nullptr}; } else { return T{nullptr}; } }());//std::conditional, typename T::parent_t, T>; + using persistent_table_t = decltype([]() { if constexpr (soa::is_iterator) { return typename T::parent_t{nullptr}; } else { return T{nullptr}; } }()); // std::conditional, typename T::parent_t, T>; using cursor_t = decltype(std::declval().cursor()); template @@ -133,7 +133,7 @@ struct WritingCursor { decltype(FFL(std::declval())) cursor; - private: + private: template static decltype(auto) extract(A const& arg) { diff --git a/Framework/Core/include/Framework/AnalysisManagers.h b/Framework/Core/include/Framework/AnalysisManagers.h index ae0e1c3aa659a..15b89a063cfdc 100644 --- a/Framework/Core/include/Framework/AnalysisManagers.h +++ b/Framework/Core/include/Framework/AnalysisManagers.h @@ -466,7 +466,7 @@ struct ServiceManager> { { // FIXME: for the moment we only need endOfStream to be // stateless. In the future we might want to pass it EndOfStreamContext - if constexpr (requires (T t) { t.endOfStream(); }) { + if constexpr (requires(T t) { t.endOfStream(); }) { service.service->endOfStream(); return true; } diff --git a/Framework/Core/include/Framework/AnalysisTask.h b/Framework/Core/include/Framework/AnalysisTask.h index bdeb46076c398..bf6806f0f5f44 100644 --- a/Framework/Core/include/Framework/AnalysisTask.h +++ b/Framework/Core/include/Framework/AnalysisTask.h @@ -85,8 +85,8 @@ struct AnalysisDataProcessorBuilder { template static inline auto getSources() { - return [] refs>(){ - return [](std::index_sequence){ + return [] refs>() { + return [](std::index_sequence) { return std::vector{soa::tableRef2ConfigParamSpec()...}; }(std::make_index_sequence()); }.template operator()(); @@ -195,20 +195,20 @@ struct AnalysisDataProcessorBuilder { template static auto extractFromRecord(InputRecord& record) { - return T{[&record] refs, size_t... Is>(std::index_sequence){ return std::vector{extractTableFromRecord(record)...}; }.template operator()(std::make_index_sequence())}; + return T { [&record] refs, size_t... Is>(std::index_sequence) { return std::vector{extractTableFromRecord(record)...}; }.template operator()(std::make_index_sequence()) }; } template static auto extractFromRecord(InputRecord& record) { - return typename T::parent_t{[&record] refs, size_t... Is>(std::index_sequence){ return std::vector{extractTableFromRecord(record)...}; }.template operator()(std::make_index_sequence())}; + return typename T::parent_t { [&record] refs, size_t... Is>(std::index_sequence) { return std::vector{extractTableFromRecord(record)...}; }.template operator()(std::make_index_sequence()) }; } template static auto extractFilteredFromRecord(InputRecord& record, ExpressionInfo& info) { std::shared_ptr table = nullptr; - auto joiner = [&record] refs, size_t... Is>(std::index_sequence){ return std::vector{extractTableFromRecord(record)...}; }; + auto joiner = [&record] refs, size_t... Is>(std::index_sequence) { return std::vector{extractTableFromRecord(record)...}; }; if constexpr (soa::is_iterator) { table = o2::soa::ArrowHelpers::joinTables(joiner.template operator()(std::make_index_sequence())); } else { diff --git a/Framework/Core/include/Framework/TableBuilder.h b/Framework/Core/include/Framework/TableBuilder.h index 9ce607eb3a2ac..14762cba54798 100644 --- a/Framework/Core/include/Framework/TableBuilder.h +++ b/Framework/Core/include/Framework/TableBuilder.h @@ -901,7 +901,8 @@ auto spawner(std::vector>&& tables, const char* na auto projectors = [](framework::pack) -> std::array { return {{std::move(C::Projector())...}}; - }(expression_pack_t{}); + } + (expression_pack_t{}); return spawnerHelper(fullTable, new_schema, framework::pack_size(expression_pack_t{}), projectors.data(), fields, name); } @@ -911,14 +912,15 @@ auto spawner(std::shared_ptr const& fullTable, const char* name) { using expression_pack_t = typename o2::aod::MetadataTrait::metadata::expression_pack_t; if (fullTable->num_rows() == 0) { - return makeEmptyTable(name,expression_pack_t{}); + return makeEmptyTable(name, expression_pack_t{}); } static auto fields = o2::soa::createFieldsFromColumns(expression_pack_t{}); static auto new_schema = std::make_shared(fields); auto projectors = [](framework::pack) -> std::array { return {{std::move(C::Projector())...}}; - }(expression_pack_t{}); + } + (expression_pack_t{}); return spawnerHelper(fullTable, new_schema, framework::pack_size(expression_pack_t{}), projectors.data(), fields, name); } diff --git a/Framework/Core/src/ASoA.cxx b/Framework/Core/src/ASoA.cxx index 1ae491557cd0d..bb4cfbbe28dc0 100644 --- a/Framework/Core/src/ASoA.cxx +++ b/Framework/Core/src/ASoA.cxx @@ -115,7 +115,7 @@ std::shared_ptr ArrowHelpers::concatTables(std::vectorschema()->fields().begin(), table->schema()->fields().end(), [&](std::shared_ptr const& f){ + auto field = std::find_if(table->schema()->fields().begin(), table->schema()->fields().end(), [&](std::shared_ptr const& f) { return o2::framework::strToUpper(label) == o2::framework::strToUpper(std::string{f->name()}); }); if (field == table->schema()->fields().end()) { @@ -155,7 +155,7 @@ std::string cutString(std::string&& str) std::string strToUpper(std::string&& str) { - std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){ return std::toupper(c); }); + std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c) { return std::toupper(c); }); return str; } } // namespace o2::framework diff --git a/Framework/Core/test/test_AnalysisDataModel.cxx b/Framework/Core/test/test_AnalysisDataModel.cxx index d97b4d425a37e..cda09d56fc253 100644 --- a/Framework/Core/test/test_AnalysisDataModel.cxx +++ b/Framework/Core/test/test_AnalysisDataModel.cxx @@ -31,7 +31,7 @@ DECLARE_SOA_COLUMN(D, d, float); DECLARE_SOA_TABLE(XY, "AOD", "XY", col::X, col::Y); DECLARE_SOA_TABLE(ZD, "AOD", "ZD", col::Z, col::D); -} +} // namespace o2::aod TEST_CASE("TestJoinedTablesContains") { diff --git a/Framework/Core/test/test_TableSpawner.cxx b/Framework/Core/test/test_TableSpawner.cxx index df111b84e677a..3d8879d115213 100644 --- a/Framework/Core/test/test_TableSpawner.cxx +++ b/Framework/Core/test/test_TableSpawner.cxx @@ -26,13 +26,13 @@ namespace test DECLARE_SOA_COLUMN(X, x, float); DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(Z, z, float); -DECLARE_SOA_EXPRESSION_COLUMN(Rsq, rsq, float, test::x * test::x + test::y * test::y + test::z * test::z); -DECLARE_SOA_EXPRESSION_COLUMN(Sin, sin, float, test::x / nsqrt (test::x * test::x + test::y * test::y)); -} +DECLARE_SOA_EXPRESSION_COLUMN(Rsq, rsq, float, test::x* test::x + test::y * test::y + test::z * test::z); +DECLARE_SOA_EXPRESSION_COLUMN(Sin, sin, float, test::x / nsqrt(test::x * test::x + test::y * test::y)); +} // namespace test DECLARE_SOA_TABLE(Points, "AOD", "PTSNG", test::X, test::Y, test::Z); DECLARE_SOA_EXTENDED_TABLE(ExPoints, Points, "EXPTSNG", 0, test::Rsq, test::Sin); -} +} // namespace o2::aod TEST_CASE("TestTableSpawner") { diff --git a/Framework/Foundation/include/Framework/Pack.h b/Framework/Foundation/include/Framework/Pack.h index 6211234591ffb..0f59f12bed5e1 100644 --- a/Framework/Foundation/include/Framework/Pack.h +++ b/Framework/Foundation/include/Framework/Pack.h @@ -226,21 +226,21 @@ inline constexpr bool has_type_conditional_v = has_type_conditional consteval size_t has_type_at_v(pack) { - constexpr size_t size = sizeof...(Ts); - constexpr bool found[size] = { std::same_as ... }; - for (size_t i = 0; i < size; ++i) { - if (found[i]) { - return i; - } + constexpr size_t size = sizeof...(Ts); + constexpr bool found[size] = {std::same_as...}; + for (size_t i = 0; i < size; ++i) { + if (found[i]) { + return i; } - return size + 1; + } + return size + 1; } template