Skip to content
Closed
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: 4 additions & 0 deletions Framework/Core/include/Framework/ASoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,10 @@ O2ORIGIN("CONC");
O2HASH("CONC/0");
O2ORIGIN("TEST");
O2HASH("TEST/0");
O2HASH("ATT/0");
O2ORIGIN("ATT");
O2HASH("EXT/0");
O2ORIGIN("EXT");
} // namespace o2::aod

#define DECLARE_EQUIVALENT_FOR_INDEX(_Base_, _Equiv_) \
Expand Down
13 changes: 12 additions & 1 deletion Framework/Core/include/Framework/AnalysisHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -835,11 +835,22 @@ auto Extend(T const& table)
/// Template function to attach dynamic columns on-the-fly (e.g. inside
/// process() function). Dynamic columns need to be compatible with the table.
template <soa::is_table T, soa::is_dynamic_column... Cs>
requires(!soa::is_filtered_table<T>)
auto Attach(T const& table)
{
using output_t = Join<T, o2::soa::Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>;
using output_t = Join<T, o2::soa::Table<o2::aod::Hash<"ATT"_h>, o2::aod::Hash<"ATT/0"_h>, o2::aod::Hash<"ATT"_h>, Cs...>>;
return output_t{{table.asArrowTable()}, table.offset()};
}

template <soa::is_filtered_table T, soa::is_dynamic_column... Cs>
auto Attach(T const& table)
{
using output_t = soa::Filtered<soa::Join<typename T::table_t, o2::soa::Table<o2::aod::Hash<"ATT"_h>, o2::aod::Hash<"ATT/0"_h>, o2::aod::Hash<"ATT"_h>, Cs...>>>;
SelectionVector selection;
selection.reserve(table.getSelectedRows().size());
std::copy(table.getSelectedRows().begin(), table.getSelectedRows().end(), std::back_inserter(selection));
return output_t{{table.asArrowTable()}, std::move(selection), table.offset()};
}
} // namespace o2::soa

#endif // o2_framework_AnalysisHelpers_H_DEFINED