diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 76e1edae9fcca..9cc7e0c71f939 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -67,6 +67,7 @@ struct Binding { void accessingInvalidIndexFor(const char* getter); void dereferenceWithWrongType(); +void missingFilterDeclaration(int hash, int ai); template auto createFieldsFromColumns(framework::pack) @@ -1006,7 +1007,7 @@ struct is_binding_compatible : std::conditional_t -static std::string getLabelFromType() +static constexpr std::string getLabelFromType() { if constexpr (soa::is_index_table_v>) { using TT = typename std::decay_t::first_t; @@ -1039,19 +1040,19 @@ static std::string getLabelFromType() } template -static auto hasColumnForKey(framework::pack, std::string const& key) +static constexpr auto hasColumnForKey(framework::pack, std::string const& key) { return ((C::inherited_t::mLabel == key) || ...); } template -static std::pair hasKey(std::string const& key) +static constexpr std::pair hasKey(std::string const& key) { return {hasColumnForKey(typename T::persistent_columns_t{}, key), getLabelFromType()}; } template -static auto haveKey(framework::pack, std::string const& key) +static constexpr auto haveKey(framework::pack, std::string const& key) { return std::vector{hasKey(key)...}; } @@ -1060,7 +1061,7 @@ void notFoundColumn(const char* label, const char* key); void missingOptionalPreslice(const char* label, const char* key); template -static std::string getLabelFromTypeForKey(std::string const& key) +static constexpr std::string getLabelFromTypeForKey(std::string const& key) { if constexpr (soa::is_type_with_originals_v>) { using Os = typename std::decay_t::originals; @@ -1189,6 +1190,20 @@ namespace o2::soa template inline constexpr bool is_soa_iterator_v = framework::is_base_of_template_v || framework::is_specialization_v; +template +inline constexpr bool is_soa_filtered_iterator_v() +{ + if constexpr (!is_soa_iterator_v) { + return false; + } else { + if constexpr (std::is_same_v) { + return true; + } else { + return false; + } + } +} + template using is_soa_table_t = typename framework::is_specialization; diff --git a/Framework/Core/include/Framework/AnalysisHelpers.h b/Framework/Core/include/Framework/AnalysisHelpers.h index 6597046330fd8..65543bd067f1e 100644 --- a/Framework/Core/include/Framework/AnalysisHelpers.h +++ b/Framework/Core/include/Framework/AnalysisHelpers.h @@ -14,7 +14,7 @@ #include "Framework/DataAllocator.h" #include "Framework/Traits.h" #include "Framework/TableBuilder.h" -#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoA.h" #include "Framework/OutputSpec.h" #include "Framework/OutputRef.h" #include "Framework/InputSpec.h" diff --git a/Framework/Core/include/Framework/AnalysisTask.h b/Framework/Core/include/Framework/AnalysisTask.h index 6560bc646986e..7aac9e953e70e 100644 --- a/Framework/Core/include/Framework/AnalysisTask.h +++ b/Framework/Core/include/Framework/AnalysisTask.h @@ -16,21 +16,16 @@ #include "Framework/AlgorithmSpec.h" #include "Framework/CallbackService.h" #include "Framework/ConfigContext.h" -#include "Framework/Condition.h" #include "Framework/ControlService.h" #include "Framework/DataProcessorSpec.h" #include "Framework/Expressions.h" -#include "Framework/ExpressionHelpers.h" #include "Framework/EndOfStreamContext.h" #include "Framework/GroupSlicer.h" -#include "Framework/Logger.h" #include "Framework/StructToTuple.h" -#include "Framework/FunctionalHelpers.h" #include "Framework/Traits.h" -#include "Framework/VariantHelpers.h" -#include "Framework/RuntimeError.h" #include "Framework/TypeIdHelpers.h" #include "Framework/ArrowTableSlicingCache.h" +#include "Framework/AnalysisDataModel.h" #include #include @@ -47,9 +42,6 @@ namespace o2::framework /// /// adaptAnalysisTask(constructor args, ...); /// -// FIXME: for the moment this needs to stay outside AnalysisTask -// because we cannot inherit from it due to a C++17 bug -// in GCC 7.3. We need to move to 7.4+ struct AnalysisTask { }; @@ -87,15 +79,15 @@ struct AnalysisDataProcessorBuilder { } template - static inline auto getSources() + static inline auto getSources() requires soa::is_soa_index_table_v> { - if constexpr (soa::is_soa_index_table_v) { - return getInputSpecs(typename T::sources_t{}); - } else if constexpr (soa::is_soa_extension_table_v>) { - return getInputSpecs(typename aod::MetadataTrait::metadata::sources{}); - } else { - always_static_assert("Can be only used with index or extension table"); - } + return getInputSpecs(typename T::sources_t{}); + } + + template + static inline auto getSources() requires soa::is_soa_extension_table_v> + { + return getInputSpecs(typename aod::MetadataTrait::metadata::sources{}); } template @@ -110,125 +102,89 @@ struct AnalysisDataProcessorBuilder { return inputMetadata; } - template - static void doAppendInputWithMetadata(const char* name, bool value, std::vector& inputs) + template + static void addGroupingCandidates(std::vector& bk, std::vector& bku) { - using metadata = typename aod::MetadataTrait>::metadata; - static_assert(std::is_same_v == false, - "Could not find metadata. Did you register your type?"); - std::vector inputMetadata; - inputMetadata.emplace_back(ConfigParamSpec{std::string{"control:"} + name, VariantType::Bool, value, {"\"\""}}); - if constexpr (soa::is_soa_index_table_v> || soa::is_soa_extension_table_v>) { - auto inputSources = getInputMetadata>(); - inputMetadata.insert(inputMetadata.end(), inputSources.begin(), inputSources.end()); - } - auto newInput = InputSpec{metadata::tableLabel(), metadata::origin(), metadata::description(), metadata::version(), Lifetime::Timeframe, inputMetadata}; - DataSpecUtils::updateInputList(inputs, std::move(newInput)); + [&bk, &bku](framework::pack) mutable { + auto key = std::string{"fIndex"} + o2::framework::cutString(soa::getLabelFromType>()); + ([&bk, &bku, &key]() mutable { + if constexpr (soa::relatedByIndex, std::decay_t>()) { + auto binding = soa::getLabelFromTypeForKey>(key); + if constexpr (o2::soa::is_smallgroups_v>) { + framework::updatePairList(bku, binding, key); + } else { + framework::updatePairList(bk, binding, key); + } + } + }(), + ...); + }(framework::pack{}); } - static void doAppendEnumeration(const char*, int64_t, int64_t, int64_t, std::vector& inputs) + template + static void addOriginal(const char* name, bool value, std::vector& inputs) requires soa::is_type_with_metadata_v>> { + using metadata = typename aod::MetadataTrait>::metadata; std::vector inputMetadata; - // FIXME: for the moment we do not support begin, end and step. - auto newInput = InputSpec{"enumeration", "DPL", "ENUM", 0, Lifetime::Enumeration, inputMetadata}; - DataSpecUtils::updateInputList(inputs, std::move(newInput)); - } - - template - static void doAppendInputWithMetadata(framework::pack, const char* name, bool value, std::vector& inputs) - { - (doAppendInputWithMetadata(name, value, inputs), ...); + inputMetadata.emplace_back(ConfigParamSpec{std::string{"control:"} + name, VariantType::Bool, value, {"\"\""}}); + if constexpr (soa::is_soa_index_table_v> || soa::is_soa_extension_table_v>) { + auto inputSources = getInputMetadata>(); + inputMetadata.insert(inputMetadata.end(), inputSources.begin(), inputSources.end()); + } + DataSpecUtils::updateInputList(inputs, InputSpec{metadata::tableLabel(), metadata::origin(), metadata::description(), metadata::version(), Lifetime::Timeframe, inputMetadata}); } - template - static void appendSomethingWithMetadata(int ai, const char* name, bool value, std::vector& inputs, std::vector& eInfos, size_t hash) + template + static void inputsFromArgs(R (C::*)(Args...), const char* name, bool value, std::vector& inputs, std::vector& eInfos, std::vector& bk, std::vector& bku) requires(std::is_lvalue_reference_v&&...) { - static_assert(std::is_lvalue_reference_v, "Argument to process needs to be a reference (&)."); - using dT = std::decay_t; - if constexpr (is_enumeration_v
== false) { - if constexpr (soa::is_soa_filtered_v
) { - auto fields = createFieldsFromColumns(typename dT::table_t::persistent_columns_t{}); - eInfos.emplace_back(ai, hash, dT::hashes(), std::make_shared(fields)); - } else if constexpr (soa::is_soa_iterator_v
) { - auto fields = createFieldsFromColumns(typename dT::parent_t::persistent_columns_t{}); - if constexpr (std::is_same_v) { - eInfos.emplace_back(ai, hash, dT::parent_t::hashes(), std::make_shared(fields)); - } - } - doAppendInputWithMetadata(soa::make_originals_from_type
(), name, value, inputs); - } else { - doAppendEnumeration(name, dT::begin, dT::end, dT::step, inputs); + // update grouping cache + if constexpr (soa::is_soa_iterator_v>>>) { + addGroupingCandidates(bk, bku); } - } - template - static void appendGroupingCandidate(std::vector& bk, std::vector& bku, std::string& key) - { - if constexpr (soa::relatedByIndex, std::decay_t>()) { - auto binding = soa::getLabelFromTypeForKey>(key); - if constexpr (!o2::soa::is_smallgroups_v>) { - if (std::find_if(bk.begin(), bk.end(), [&binding, &key](auto const& entry) { return (entry.first == binding) && (entry.second == key); }) == bk.end()) { - bk.emplace_back(binding, key); - } + // populate input list and expression infos + int ai = 0; + constexpr auto hash = o2::framework::TypeIdHelpers::uniqueId(); + ([&name, &value, &eInfos, &inputs, &hash, &ai]() mutable { + ++ai; + using T = std::decay_t; + if constexpr (is_enumeration_v) { + std::vector inputMetadata; + // FIXME: for the moment we do not support begin, end and step. + DataSpecUtils::updateInputList(inputs, InputSpec{"enumeration", "DPL", "ENUM", 0, Lifetime::Enumeration, inputMetadata}); } else { - if (std::find_if(bku.begin(), bku.end(), [&binding, &key](auto const& entry) { return (entry.first == binding) && (entry.second == key); }) == bku.end()) { - bku.emplace_back(binding, key); + // populate expression infos + if constexpr (soa::is_soa_filtered_v) { + auto fields = soa::createFieldsFromColumns(typename T::persistent_columns_t{}); + eInfos.emplace_back(ai, hash, T::hashes(), std::make_shared(fields)); + } else if constexpr (soa::is_soa_filtered_iterator_v()) { + auto fields = soa::createFieldsFromColumns(typename T::parent_t::persistent_columns_t{}); + eInfos.emplace_back(ai, hash, T::parent_t::hashes(), std::make_shared(fields)); } + // add inputs from the originals + [&name, &value, &inputs](framework::pack) mutable { + (addOriginal(name, value, inputs), ...); + }(soa::make_originals_from_type()); } - } - } - - template - static void appendGroupingCandidates(std::vector& bk, std::vector& bku, framework::pack) - { - auto key = std::string{"fIndex"} + o2::framework::cutString(soa::getLabelFromType>()); - (appendGroupingCandidate(bk, bku, key), ...); + return true; + }() && + ...); } - template - static void inputsFromArgs(R (C::*)(Args...), const char* name, bool value, std::vector& inputs, std::vector& eInfos, std::vector& bk, std::vector& bku) + template + static auto extractTableFromRecord(InputRecord& record) requires soa::is_type_with_metadata_v> { - int ai = 0; - auto hash = o2::framework::TypeIdHelpers::uniqueId(); - if constexpr (soa::is_soa_iterator_v>>>) { - appendGroupingCandidates(bk, bku, framework::pack{}); + auto table = record.get(aod::MetadataTrait::metadata::tableLabel())->asArrowTable(); + if (table->num_rows() == 0) { + table = makeEmptyTable(aod::MetadataTrait::metadata::tableLabel()); } - (appendSomethingWithMetadata(ai++, name, value, inputs, eInfos, hash), ...); - } - - template - static auto signatures(InputRecord&, R (C::*)(Grouping, Args...)) - { - return std::declval>(); - } - - template - static auto bindGroupingTable(InputRecord& record, R (C::*)(Grouping, Args...), std::vector& infos) - { - auto hash = o2::framework::TypeIdHelpers::uniqueId(); - return extractSomethingFromRecord(record, infos, hash); - } - - template - static auto bindGroupingTable(InputRecord&, R (C::*)(), std::vector&) - { - static_assert(always_static_assert_v, "Your task process method needs at least one argument"); - return o2::soa::Table<>{nullptr}; + return table; } template - static auto extractTableFromRecord(InputRecord& record) + static auto extractTableFromRecord(InputRecord& record) requires soa::is_type_with_originals_v { - if constexpr (soa::is_type_with_metadata_v>) { - auto table = record.get(aod::MetadataTrait::metadata::tableLabel())->asArrowTable(); - if (table->num_rows() == 0) { - table = makeEmptyTable(aod::MetadataTrait::metadata::tableLabel()); - } - return table; - } else if constexpr (soa::is_type_with_originals_v) { - return extractFromRecord(record, typename T::originals{}); - } - O2_BUILTIN_UNREACHABLE(); + return extractFromRecord(record, typename T::originals{}); } template @@ -245,16 +201,10 @@ struct AnalysisDataProcessorBuilder { static auto extractFilteredFromRecord(InputRecord& record, ExpressionInfo& info, pack const&) { auto table = o2::soa::ArrowHelpers::joinTables(std::vector>{extractTableFromRecord(record)...}); - if (info.tree != nullptr && info.filter == nullptr) { - info.filter = framework::expressions::createFilter(table->schema(), framework::expressions::makeCondition(info.tree)); - } - if (info.tree != nullptr && info.filter != nullptr && info.resetSelection == true) { - info.selection = framework::expressions::createSelection(table, info.filter); - info.resetSelection = false; - } + expressions::updateFilterInfo(info, table); if constexpr (!o2::soa::is_smallgroups_v>) { if (info.selection == nullptr) { - throw runtime_error_f("Null selection for %d (arg %d), missing Filter declaration?", info.processHash, info.argumentIndex); + soa::missingFilterDeclaration(info.processHash, info.argumentIndex); } } if constexpr (soa::is_soa_iterator_v) { @@ -265,45 +215,45 @@ struct AnalysisDataProcessorBuilder { } template - static auto extractSomethingFromRecord(InputRecord& record, std::vector& infos, size_t phash) + static auto extract(InputRecord&, std::vector&, size_t) requires is_enumeration_v { - using decayed = std::decay_t; - - if constexpr (is_enumeration_v == false) { - if constexpr (soa::is_soa_filtered_v) { - return extractFilteredFromRecord(record, *std::find_if(infos.begin(), infos.end(), [&phash](ExpressionInfo const& i) { return (i.processHash == phash && i.argumentIndex == AI); }), soa::make_originals_from_type()); - } else if constexpr (soa::is_soa_iterator_v) { - if constexpr (std::is_same_v) { - return extractFilteredFromRecord(record, *std::find_if(infos.begin(), infos.end(), [&phash](ExpressionInfo const& i) { return (i.processHash == phash && i.argumentIndex == AI); }), soa::make_originals_from_type()); - } else { - return extractFromRecord(record, soa::make_originals_from_type()); - } - } else { - return extractFromRecord(record, soa::make_originals_from_type()); - } - O2_BUILTIN_UNREACHABLE(); + return T{}; + } + + template + static auto extract(InputRecord& record, std::vector& infos, size_t phash) requires soa::is_soa_iterator_v + { + if constexpr (std::is_same_v) { + return extractFilteredFromRecord(record, *std::find_if(infos.begin(), infos.end(), [&phash](ExpressionInfo const& i) { return (i.processHash == phash && i.argumentIndex == AI); }), soa::make_originals_from_type()); } else { - return decayed{}; + return extractFromRecord(record, soa::make_originals_from_type()); } } - template - static auto bindAssociatedTables(InputRecord& record, R (C::*)(Grouping, Args...), std::vector& infos) + template + static auto extract(InputRecord& record, std::vector& infos, size_t phash) requires soa::is_soa_table_like_v { - constexpr auto p = pack{}; - auto hash = o2::framework::TypeIdHelpers::uniqueId(); - return std::make_tuple(extractSomethingFromRecord(p) + 1>(record, infos, hash)...); + if constexpr (soa::is_soa_filtered_v) { + return extractFilteredFromRecord(record, *std::find_if(infos.begin(), infos.end(), [&phash](ExpressionInfo const& i) { return (i.processHash == phash && i.argumentIndex == AI); }), soa::make_originals_from_type()); + } else { + return extractFromRecord(record, soa::make_originals_from_type()); + } } - template - static auto bindAssociatedTables(InputRecord&, R (C::*)(), std::vector&) + template + static auto bindGroupingTable(InputRecord& record, R (C::*)(Grouping, Args...), std::vector& infos) requires(!std::is_same_v || sizeof...(Args) > 0) { - static_assert(always_static_assert_v, "Your task process method needs at least one argument"); - return std::tuple<>{}; + constexpr auto hash = o2::framework::TypeIdHelpers::uniqueId(); + return extract, 0>(record, infos, hash); } - template - using is_external_index_to_t = std::is_same; + template + static auto bindAssociatedTables(InputRecord& record, R (C::*)(Grouping, Args...), std::vector& infos) requires(!std::is_same_v || sizeof...(Args) > 0) + { + constexpr auto p = pack{}; + constexpr auto hash = o2::framework::TypeIdHelpers::uniqueId(); + return std::make_tuple(extract, has_type_at_v(p) + 1>(record, infos, hash)...); + } template static void overwriteInternalIndices(std::tuple& dest, std::tuple const& src) @@ -403,7 +353,7 @@ struct AnalysisDataProcessorBuilder { }, task); - invokeProcessWithArgsGeneric(task, processingFunction, slice.groupingElement(), associatedSlices); + invokeProcessWithArgs(task, processingFunction, slice.groupingElement(), associatedSlices); } } else { // bind partitions and grouping table @@ -413,72 +363,18 @@ struct AnalysisDataProcessorBuilder { }, task); - invokeProcessWithArgsGeneric(task, processingFunction, groupingTable, associatedTables); + invokeProcessWithArgs(task, processingFunction, groupingTable, associatedTables); } } } template - static void invokeProcessWithArgsGeneric(C& task, T processingFunction, G g, std::tuple& at) + static void invokeProcessWithArgs(C& task, T processingFunction, G g, std::tuple& at) { std::invoke(processingFunction, task, g, std::get(at)...); } - - template - static void invokeProcessWithArgs(T& task, G g, std::tuple& at) - { - task.process(g, std::get(at)...); - } -}; - -namespace -{ -template -class has_process -{ - template - static std::true_type test(decltype(&C::process)); - template - static std::false_type test(...); - - public: - static constexpr bool value = decltype(test(nullptr))::value; }; -template -inline constexpr bool has_process_v = has_process::value; - -template -class has_run -{ - template - static std::true_type test(decltype(&C::run)); - template - static std::false_type test(...); - - public: - static constexpr bool value = decltype(test(nullptr))::value; -}; - -template -inline constexpr bool has_run_v = has_run::value; - -template -class has_init -{ - template - static std::true_type test(decltype(&C::init)); - template - static std::false_type test(...); - - public: - static constexpr bool value = decltype(test(nullptr))::value; -}; - -template -inline constexpr bool has_init_v = has_init::value; -} // namespace - struct SetDefaultProcesses { std::vector> map; }; @@ -595,7 +491,7 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args) homogeneous_apply_refs([&inputs](auto& x) { return ConditionManager>::appendCondition(inputs, x); }, *task.get()); /// parse process functions defined by corresponding configurables - if constexpr (has_process_v) { + if constexpr (requires { AnalysisDataProcessorBuilder::inputsFromArgs(&T::process, "default", true, inputs, expressionInfos, bindingsKeys, bindingsKeysUnsorted); }) { AnalysisDataProcessorBuilder::inputsFromArgs(&T::process, "default", true, inputs, expressionInfos, bindingsKeys, bindingsKeysUnsorted); } homogeneous_apply_refs( @@ -668,7 +564,7 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args) }, *task.get()); - if constexpr (has_init_v) { + if constexpr (requires { task->init(ic); }) { task->init(ic); } @@ -703,11 +599,11 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args) // prepare outputs homogeneous_apply_refs([&pc](auto&& x) { return OutputManager>::prepare(pc, x); }, *task.get()); // execute run() - if constexpr (has_run_v) { + if constexpr (requires { task->run(pc); }) { task->run(pc); } // execute process() - if constexpr (has_process_v) { + if constexpr (requires { AnalysisDataProcessorBuilder::invokeProcess(*(task.get()), pc.inputs(), &T::process, expressionInfos, slices); }) { AnalysisDataProcessorBuilder::invokeProcess(*(task.get()), pc.inputs(), &T::process, expressionInfos, slices); } // execute optional process() diff --git a/Framework/Core/include/Framework/ArrowTableSlicingCache.h b/Framework/Core/include/Framework/ArrowTableSlicingCache.h index e1649f54810cc..2edc23a63ce76 100644 --- a/Framework/Core/include/Framework/ArrowTableSlicingCache.h +++ b/Framework/Core/include/Framework/ArrowTableSlicingCache.h @@ -14,7 +14,6 @@ #include "Framework/ServiceHandle.h" #include -#include #include namespace o2::framework @@ -37,6 +36,8 @@ struct SliceInfoUnsortedPtr { using StringPair = std::pair; +void updatePairList(std::vector& list, std::string const& binding, std::string const& key); + struct ArrowTableSlicingCacheDef { constexpr static ServiceKind service_kind = ServiceKind::Global; std::vector bindingsKeys; diff --git a/Framework/Core/include/Framework/Expressions.h b/Framework/Core/include/Framework/Expressions.h index b2705a6680836..9843457550b99 100644 --- a/Framework/Core/include/Framework/Expressions.h +++ b/Framework/Core/include/Framework/Expressions.h @@ -495,6 +495,8 @@ std::shared_ptr createProjectors(framework::pack, std: return createProjectorHelper(sizeof...(C), projectors.data(), schema, fields); } + +void updateFilterInfo(ExpressionInfo& info, std::shared_ptr& table); } // namespace o2::framework::expressions #endif // O2_FRAMEWORK_EXPRESSIONS_H_ diff --git a/Framework/Core/src/ASoA.cxx b/Framework/Core/src/ASoA.cxx index 043183d67478d..f04a0027ee498 100644 --- a/Framework/Core/src/ASoA.cxx +++ b/Framework/Core/src/ASoA.cxx @@ -25,6 +25,10 @@ void dereferenceWithWrongType() { throw o2::framework::runtime_error_f("Trying to dereference index with a wrong type in _as<>. Note that if you have several compatible index targets in your process() signature, the last one will be the one actually bound to the getter."); } +void missingFilterDeclaration(int hash, int ai) +{ + throw o2::framework::runtime_error_f("Null selection for %d (arg %d), missing Filter declaration?", hash, ai); +} SelectionVector selectionToVector(gandiva::Selection const& sel) { diff --git a/Framework/Core/src/ArrowTableSlicingCache.cxx b/Framework/Core/src/ArrowTableSlicingCache.cxx index 871dfc300f8bb..4b31f96e32fba 100644 --- a/Framework/Core/src/ArrowTableSlicingCache.cxx +++ b/Framework/Core/src/ArrowTableSlicingCache.cxx @@ -19,6 +19,13 @@ namespace o2::framework { +void updatePairList(std::vector& list, std::string const& binding, std::string const& key) +{ + if (std::find_if(list.begin(), list.end(), [&binding, &key](auto const& entry) { return (entry.first == binding) && (entry.second == key); }) == list.end()) { + list.emplace_back(binding, key); + } +} + std::pair SliceInfoPtr::getSliceFor(int value) const { int64_t offset = 0; diff --git a/Framework/Core/src/Expressions.cxx b/Framework/Core/src/Expressions.cxx index 69df45726a87e..b3301e2cf4040 100644 --- a/Framework/Core/src/Expressions.cxx +++ b/Framework/Core/src/Expressions.cxx @@ -735,4 +735,15 @@ void updateExpressionInfos(expressions::Filter const& filter, std::vector& table) +{ + if (info.tree != nullptr && info.filter == nullptr) { + info.filter = framework::expressions::createFilter(table->schema(), framework::expressions::makeCondition(info.tree)); + } + if (info.tree != nullptr && info.filter != nullptr && info.resetSelection == true) { + info.selection = framework::expressions::createSelection(table, info.filter); + info.resetSelection = false; + } +} + } // namespace o2::framework::expressions diff --git a/Framework/Core/test/test_ASoA.cxx b/Framework/Core/test/test_ASoA.cxx index d38c8183dc459..a2bce16e970fe 100644 --- a/Framework/Core/test/test_ASoA.cxx +++ b/Framework/Core/test/test_ASoA.cxx @@ -12,6 +12,7 @@ #include "Framework/ASoA.h" #include "Framework/Expressions.h" #include "Framework/AnalysisHelpers.h" +#include "CommonConstants/MathConstants.h" #include "gandiva/tree_expr_builder.h" #include "arrow/status.h" #include "gandiva/filter.h" diff --git a/Framework/TestWorkflows/src/o2AnalysisTaskExample.cxx b/Framework/TestWorkflows/src/o2AnalysisTaskExample.cxx index 9913b0e7c560e..24cb592c445c9 100644 --- a/Framework/TestWorkflows/src/o2AnalysisTaskExample.cxx +++ b/Framework/TestWorkflows/src/o2AnalysisTaskExample.cxx @@ -8,6 +8,7 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Framework/AnalysisDataModel.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" diff --git a/Framework/TestWorkflows/src/o2AnalysisWorkflow.cxx b/Framework/TestWorkflows/src/o2AnalysisWorkflow.cxx index c0da7a24c1a90..05bf3aabaceab 100644 --- a/Framework/TestWorkflows/src/o2AnalysisWorkflow.cxx +++ b/Framework/TestWorkflows/src/o2AnalysisWorkflow.cxx @@ -15,8 +15,8 @@ #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" #include -#include using namespace o2; using namespace o2::framework;