Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Framework/Core/include/Framework/AnalysisManagers.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,16 +495,14 @@ bool initializeCache(ProcessingContext& context, T& cache)

/// Combinations handling
template <typename C, typename TG, typename... Ts>
requires(!is_combinations_generator<C>)
void setGroupedCombination(C&, TG&, Ts&...)
{
}

template <is_combinations_generator C, typename TG, typename... Ts>
requires((sizeof...(Ts) > 0) && (C::compatible(framework::pack<Ts...>{})))
static void setGroupedCombination(C& comb, TG& grouping, std::tuple<Ts...>& associated)
{
if constexpr (std::same_as<typename C::g_t, TG>) {
if constexpr (std::same_as<typename C::g_t, std::decay_t<TG>>) {
comb.setTables(grouping, associated);
}
}
Expand Down
14 changes: 5 additions & 9 deletions Framework/Core/include/Framework/GroupedCombinations.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,12 @@ expressions::BindingNode getMatchingIndexNode()
}

template <typename T1, typename GroupingPolicy, typename BP, typename G, typename... As>
requires(sizeof...(As) > 0)
struct GroupedCombinationsGenerator {
using grouping_policy_t = GroupingPolicy;
using g_t = G;
using associated_pack_t = framework::pack<As...>;

template <typename... Ts>
static consteval bool compatible(framework::pack<Ts...> p)
{
return (framework::has_type<As>(p) && ...);
}

using GroupedIteratorType = pack_to_tuple_t<interleaved_pack_t<repeated_type_pack_t<typename G::iterator, sizeof...(As)>, pack<As...>>>;

struct GroupedIterator : public GroupingPolicy {
Expand Down Expand Up @@ -241,10 +236,11 @@ struct GroupedCombinationsGenerator {
};

template <typename T>
concept is_combinations_generator = requires(T t) {
concept is_combinations_generator = requires(T t, typename T::g_t const& g, pack_to_tuple_t<typename T::associated_pack_t>& a) {
typename T::GroupedIterator;
&T::begin;
&T::end;
t.setTables(g, a);
{ t.begin() } -> std::same_as<typename T::iterator>;
{ t.end() } -> std::same_as<typename T::iterator>;
};

// Aliases for 2-particle correlations
Expand Down
3 changes: 3 additions & 0 deletions Framework/Core/test/test_Concepts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,7 @@ TEST_CASE("IdentificationConcepts")
// Expressions
expressions::Filter f = o2::aod::track::pt > 1.0f;
REQUIRE(expressions::is_filter<decltype(f)>);

using C = SameKindPair<aod::Collisions, aod::Tracks, ColumnBinningPolicy<aod::collision::PosZ>>;
REQUIRE(is_combinations_generator<C>);
}