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
2 changes: 1 addition & 1 deletion Framework/Core/include/Framework/AnalysisManagers.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct GroupedCombinationManager<GroupedCombinationsGenerator<T1, GroupingPolicy
{
static_assert(sizeof...(T2s) > 0, "There must be associated tables in process() for a correct pair");
static_assert(!soa::is_soa_iterator_t<std::decay_t<H>>::value, "Only full tables can be in process(), no grouping");
if constexpr (std::conjunction_v<std::is_same<G, TG>, std::is_same<H, TH>>) {
if constexpr (std::is_same_v<G, TG> && std::is_same_v<H, TH>) {
// Take respective unique associated tables for grouping
auto associatedTuple = std::tuple<Us...>(std::get<Us>(associated)...);
comb.setTables(hashes, grouping, associatedTuple);
Expand Down
17 changes: 11 additions & 6 deletions Framework/Core/include/Framework/GroupedCombinations.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,18 @@ struct GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, pack<Us...>, As...
{
setTables(hashes, grouping, associated);
}
GroupedCombinationsGenerator(GroupedCombinationsGenerator const&) = default;
GroupedCombinationsGenerator& operator=(GroupedCombinationsGenerator const&) = default;
~GroupedCombinationsGenerator() = default;

void setTables(H& hashes, G& grouping, std::tuple<Us...>& associated)
{
std::shared_ptr slicer_ptr = std::make_shared<GroupSlicer<G, Us...>>(grouping, associated);
mBegin.setTables(hashes, grouping, slicer_ptr);
mEnd.setTables(hashes, grouping, slicer_ptr);
mEnd.moveToEnd();
if (mSlicer == nullptr) {
mSlicer = std::make_shared<GroupSlicer<G, Us...>>(grouping, associated);
mBegin.setTables(hashes, grouping, mSlicer);
mEnd.setTables(hashes, grouping, mSlicer);
mEnd.moveToEnd();
}
}

private:
Expand All @@ -247,20 +251,21 @@ struct GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, pack<Us...>, As...
const char* mCategory;
const int mCatNeighbours;
const T1 mOutsider;
std::shared_ptr<GroupSlicer<G, Us...>> mSlicer = nullptr;
};

// Aliases for 2-particle correlations
// 'Pair' and 'Triple' can be used for same kind pair/triple, too, just specify the same type twice
template <typename H, typename G>
using joinedCollisions = typename soa::Join<H, G>::table_t;
template <typename H, typename G, typename A1, typename A2, typename T1 = int, typename GroupingPolicy = o2::soa::CombinationsBlockStrictlyUpperSameIndexPolicy<T1, joinedCollisions<H, G>, joinedCollisions<H, G>>>
using Pair = GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, unique_pack_t<pack<A1, A2>>>;
using Pair = GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, unique_pack_t<pack<A1, A2>>, A1, A2>;
template <typename H, typename G, typename A, typename T1 = int, typename GroupingPolicy = o2::soa::CombinationsBlockStrictlyUpperSameIndexPolicy<T1, joinedCollisions<H, G>, joinedCollisions<H, G>>>
using SameKindPair = GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, pack<A>, A, A>;

// Aliases for 3-particle correlations
template <typename H, typename G, typename A1, typename A2, typename A3, typename T1 = int, typename GroupingPolicy = o2::soa::CombinationsBlockStrictlyUpperSameIndexPolicy<T1, joinedCollisions<H, G>, joinedCollisions<H, G>, joinedCollisions<H, G>>>
using Triple = GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, unique_pack_t<pack<A1, A2, A3>>>;
using Triple = GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, unique_pack_t<pack<A1, A2, A3>>, A1, A2, A3>;
template <typename H, typename G, typename A, typename T1 = int, typename GroupingPolicy = o2::soa::CombinationsBlockStrictlyUpperSameIndexPolicy<T1, joinedCollisions<H, G>, joinedCollisions<H, G>, joinedCollisions<H, G>>>
using SameKindTriple = GroupedCombinationsGenerator<T1, GroupingPolicy, H, G, pack<A>, A, A, A>;

Expand Down