Skip to content

Commit

Permalink
fixup! DPL Analysis: introduce concepts and improve pack
Browse files Browse the repository at this point in the history
  • Loading branch information
aalkin committed Nov 12, 2024
1 parent fa5d7a4 commit 2f62a21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Framework/Core/include/Framework/AnalysisHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ requires(!std::is_same_v<void, typename aod::MetadataTrait<T>::metadata>) struct

template <template <o2::framework::OriginEnc, typename...> class T, o2::framework::OriginEnc ORIGIN, typename... C>
struct Produces<T<ORIGIN, C...>> : WritingCursor<typename soa::PackToTable<ORIGIN, typename T<ORIGIN, C...>::table_t::persistent_columns_t>::table> {
using persistent_table_t = decltype([]() { if constexpr (soa::is_iterator<T<ORIGIN, C...>>) { return typename T<ORIGIN, C...>::parent_t{nullptr}; } else { return T<ORIGIN, C...>{nullptr}; } }());
};

/// Use this to group together produces. Useful to separate them logically
Expand Down
6 changes: 3 additions & 3 deletions Framework/Core/include/Framework/AnalysisManagers.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,17 @@ template <typename TABLE>
struct OutputManager<Produces<TABLE>> {
static bool appendOutput(std::vector<OutputSpec>& outputs, Produces<TABLE>& /*what*/, uint32_t)
{
outputs.emplace_back(OutputForTable<TABLE>::spec());
outputs.emplace_back(OutputForTable<typename Produces<TABLE>::persistent_table_t>::spec());
return true;
}
static bool prepare(ProcessingContext& context, Produces<TABLE>& what)
{
what.resetCursor(std::move(context.outputs().make<TableBuilder>(OutputForTable<TABLE>::ref())));
what.resetCursor(std::move(context.outputs().make<TableBuilder>(OutputForTable<typename Produces<TABLE>::persistent_table_t>::ref())));
return true;
}
static bool finalize(ProcessingContext&, Produces<TABLE>& what)
{
what.setLabel(o2::aod::MetadataTrait<TABLE>::metadata::tableLabel());
what.setLabel(o2::aod::MetadataTrait<typename Produces<TABLE>::persistent_table_t>::metadata::tableLabel());
what.release();
return true;
}
Expand Down

0 comments on commit 2f62a21

Please sign in to comment.