@@ -698,18 +698,29 @@ namespace o2::soa
698698template <soa::is_table T, soa::is_spawnable_column... Cs>
699699auto Extend (T const & table)
700700{
701- using output_t = Join<T, soa::Table<o2::aod::Hash<" JOIN " _h>, o2::aod::Hash<" JOIN /0" _h>, o2::aod::Hash<" JOIN " _h>, Cs...>>;
701+ using output_t = Join<T, soa::Table<o2::aod::Hash<" EXT " _h>, o2::aod::Hash<" EXT /0" _h>, o2::aod::Hash<" EXT " _h>, Cs...>>;
702702 return output_t {{o2::framework::spawner (framework::pack<Cs...>{}, {table.asArrowTable ()}, " dynamicExtension" ), table.asArrowTable ()}, 0 };
703703}
704704
705705// / Template function to attach dynamic columns on-the-fly (e.g. inside
706706// / process() function). Dynamic columns need to be compatible with the table.
707707template <soa::is_table T, soa::is_dynamic_column... Cs>
708+ requires (!soa::is_filtered_table<T>)
708709auto Attach (T const & table)
709710{
710- 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...>>;
711+ 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...>>;
711712 return output_t {{table.asArrowTable ()}, table.offset ()};
712713}
714+
715+ template <soa::is_filtered_table T, soa::is_dynamic_column... Cs>
716+ auto Attach (T const & table)
717+ {
718+ 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...>>>;
719+ SelectionVector selection;
720+ selection.reserve (table->getSelectedRows ().size ());
721+ std::copy (table->getSelectedRows ().begin (), table->getSelectedRows ().end (), std::back_inserter (selection));
722+ return output_t {{table.asArrowTable ()}, std::move (selection), table.offset ()};
723+ }
713724} // namespace o2::soa
714725
715726#endif // o2_framework_AnalysisHelpers_H_DEFINED
0 commit comments