Skip to content

Commit d72798d

Browse files
committed
DPL Analysis: fix combinations generator parsing in analysis task
1 parent 1102011 commit d72798d

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

Framework/Core/include/Framework/AnalysisManagers.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,16 +495,14 @@ bool initializeCache(ProcessingContext& context, T& cache)
495495

496496
/// Combinations handling
497497
template <typename C, typename TG, typename... Ts>
498-
requires(!is_combinations_generator<C>)
499498
void setGroupedCombination(C&, TG&, Ts&...)
500499
{
501500
}
502501

503502
template <is_combinations_generator C, typename TG, typename... Ts>
504-
requires((sizeof...(Ts) > 0) && (C::compatible(framework::pack<Ts...>{})))
505503
static void setGroupedCombination(C& comb, TG& grouping, std::tuple<Ts...>& associated)
506504
{
507-
if constexpr (std::same_as<typename C::g_t, TG>) {
505+
if constexpr (std::same_as<typename C::g_t, std::decay_t<TG>>) {
508506
comb.setTables(grouping, associated);
509507
}
510508
}

Framework/Core/include/Framework/GroupedCombinations.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,12 @@ expressions::BindingNode getMatchingIndexNode()
4848
}
4949

5050
template <typename T1, typename GroupingPolicy, typename BP, typename G, typename... As>
51+
requires(sizeof...(As) > 0)
5152
struct GroupedCombinationsGenerator {
5253
using grouping_policy_t = GroupingPolicy;
5354
using g_t = G;
5455
using associated_pack_t = framework::pack<As...>;
5556

56-
template <typename... Ts>
57-
static consteval bool compatible(framework::pack<Ts...> p)
58-
{
59-
return (framework::has_type<As>(p) && ...);
60-
}
61-
6257
using GroupedIteratorType = pack_to_tuple_t<interleaved_pack_t<repeated_type_pack_t<typename G::iterator, sizeof...(As)>, pack<As...>>>;
6358

6459
struct GroupedIterator : public GroupingPolicy {
@@ -241,10 +236,11 @@ struct GroupedCombinationsGenerator {
241236
};
242237

243238
template <typename T>
244-
concept is_combinations_generator = requires(T t) {
239+
concept is_combinations_generator = requires(T t, typename T::g_t const& g, pack_to_tuple_t<typename T::associated_pack_t>& a) {
245240
typename T::GroupedIterator;
246-
&T::begin;
247-
&T::end;
241+
t.setTables(g, a);
242+
{ t.begin() } -> std::same_as<typename T::iterator>;
243+
{ t.end() } -> std::same_as<typename T::iterator>;
248244
};
249245

250246
// Aliases for 2-particle correlations

Framework/Core/test/test_Concepts.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,7 @@ TEST_CASE("IdentificationConcepts")
161161
// Expressions
162162
expressions::Filter f = o2::aod::track::pt > 1.0f;
163163
REQUIRE(expressions::is_filter<decltype(f)>);
164+
165+
using C = SameKindPair<aod::Collisions, aod::Tracks, ColumnBinningPolicy<aod::collision::PosZ>>;
166+
REQUIRE(is_combinations_generator<C>);
164167
}

0 commit comments

Comments
 (0)