diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index e098cd89f6d5d..08792f084b187 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -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_) \ diff --git a/Framework/Core/include/Framework/AnalysisHelpers.h b/Framework/Core/include/Framework/AnalysisHelpers.h index 55d2490dff1bc..e295fec57a591 100644 --- a/Framework/Core/include/Framework/AnalysisHelpers.h +++ b/Framework/Core/include/Framework/AnalysisHelpers.h @@ -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 + requires(!soa::is_filtered_table) auto Attach(T const& table) { - using output_t = Join, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>; + using output_t = Join, o2::aod::Hash<"ATT/0"_h>, o2::aod::Hash<"ATT"_h>, Cs...>>; return output_t{{table.asArrowTable()}, table.offset()}; } + +template +auto Attach(T const& table) +{ + using output_t = soa::Filtered, 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