Skip to content

Commit 587d1c9

Browse files
committed
DPL Analysis: use label+origin as an input binding for tables
1 parent 4804b1c commit 587d1c9

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,12 @@ consteval const char* signature()
375375
return o2::aod::Hash<R.desc_hash>::str;
376376
}
377377

378+
template <soa::TableRef R>
379+
constexpr std::string binding()
380+
{
381+
return std::string{label<R>()} + "/" + origin_str<R>();
382+
}
383+
378384
/// hash identification concepts
379385
template <typename T>
380386
concept is_aod_hash = requires(T t) { t.hash; t.str; };

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ template <TableRef R>
185185
constexpr auto tableRef2Schema()
186186
{
187187
return o2::framework::ConfigParamSpec{
188-
std::string{"input-schema:"} + o2::aod::label<R>(),
188+
std::string{"input-schema:"} + o2::aod::binding<R>(),
189189
framework::VariantType::String,
190190
framework::serializeSchema(o2::aod::MetadataTrait<o2::aod::Hash<R.desc_hash>>::metadata::getSchema()),
191191
{"\"\""}};
@@ -258,9 +258,9 @@ inline constexpr auto getIndexMapping()
258258
([&idx]<TableRef ref, typename C>() mutable {
259259
constexpr auto pos = o2::aod::MetadataTrait<o2::aod::Hash<ref.desc_hash>>::metadata::template getIndexPosToKey<Key>();
260260
if constexpr (pos == -1) {
261-
idx.emplace_back(o2::aod::label<ref>(), C::columnLabel(), IndexKind::IdxSelf, pos);
261+
idx.emplace_back(o2::aod::binding<ref>(), C::columnLabel(), IndexKind::IdxSelf, pos);
262262
} else {
263-
idx.emplace_back(o2::aod::label<ref>(), C::columnLabel(), getIndexKind<typename C::type>(), pos);
263+
idx.emplace_back(o2::aod::binding<ref>(), C::columnLabel(), getIndexKind<typename C::type>(), pos);
264264
}
265265
}.template operator()<refs[Is], typename framework::pack_element_t<Is, indices>>(),
266266
...);
@@ -368,7 +368,7 @@ constexpr auto tableRef2InputSpec()
368368
}
369369

370370
return framework::InputSpec{
371-
o2::aod::label<R>(),
371+
o2::aod::binding<R>(),
372372
o2::aod::origin<R>(),
373373
o2::aod::description(o2::aod::signature<R>()),
374374
R.version,

Framework/Core/include/Framework/AnalysisManagers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ template <size_t N, std::array<soa::TableRef, N> refs>
3838
static inline auto extractOriginals(ProcessingContext& pc)
3939
{
4040
return [&]<size_t... Is>(std::index_sequence<Is...>) -> std::vector<std::shared_ptr<arrow::Table>> {
41-
return {pc.inputs().get<TableConsumer>(o2::aod::label<refs[Is]>())->asArrowTable()...};
41+
return {pc.inputs().get<TableConsumer>(o2::aod::binding<refs[Is]>())->asArrowTable()...};
4242
}(std::make_index_sequence<refs.size()>());
4343
}
4444
} // namespace

Framework/Core/include/Framework/AnalysisTask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ struct AnalysisDataProcessorBuilder {
214214
template <soa::TableRef R>
215215
static auto extractTableFromRecord(InputRecord& record)
216216
{
217-
auto table = record.get<TableConsumer>(o2::aod::label<R>())->asArrowTable();
217+
auto table = record.get<TableConsumer>(o2::aod::binding<R>())->asArrowTable();
218218
if (table->num_rows() == 0) {
219219
table = makeEmptyTable<R>();
220220
}

0 commit comments

Comments
 (0)