adapt the root plugins to newer interfaces

This commit is contained in:
Florian Lüke 2025-01-02 18:31:30 +01:00
parent 2db28d40f5
commit a4761647cd
2 changed files with 22 additions and 1 deletions

View file

@ -140,6 +140,10 @@ MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run)
log_info("hitCount histograms: %s", histo_info(ctx->hitCounts).c_str()); log_info("hitCount histograms: %s", histo_info(ctx->hitCounts).c_str());
log_info("raw histograms: %s", histo_info(ctx->rawHistograms).c_str()); log_info("raw histograms: %s", histo_info(ctx->rawHistograms).c_str());
log_info("writing histograms into: %s", filename.c_str()); log_info("writing histograms into: %s", filename.c_str());
mana_status_t result;
result.code = mana_status_ok;
strncpy(result.message, "ok", sizeof(result.message));
return result;
} }
MANA_DEFINE_PLUGIN_END_RUN(end_run) MANA_DEFINE_PLUGIN_END_RUN(end_run)
@ -150,6 +154,10 @@ MANA_DEFINE_PLUGIN_END_RUN(end_run)
auto ctx = reinterpret_cast<Context *>(context); auto ctx = reinterpret_cast<Context *>(context);
ctx->outputFile->Write(); ctx->outputFile->Write();
*ctx = {}; *ctx = {};
mana_status_t result;
result.code = mana_status_ok;
strncpy(result.message, "ok", sizeof(result.message));
return result;
} }
MANA_DEFINE_PLUGIN_EVENT_DATA(process_event) MANA_DEFINE_PLUGIN_EVENT_DATA(process_event)

View file

@ -66,7 +66,12 @@ MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run)
if (jRun["events"].size() > 1) if (jRun["events"].size() > 1)
{ {
log_error("root-rntuple-writer: currently only supports a single event/trigger"); log_error("root-rntuple-writer: currently only supports a single event/trigger");
return; mana_status_t result;
result.code = mana_status_invalid_argument;
strncpy(result.message,
"root-rntuple-writer currently only supports a single event/trigger",
sizeof(result.message));
return result;
} }
auto ctx = reinterpret_cast<Context *>(context); auto ctx = reinterpret_cast<Context *>(context);
@ -90,6 +95,10 @@ MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run)
ctx->writer = ctx->writer =
RNTupleWriter::Recreate(std::move(model), jEvent["name"].get<std::string>(), filename); RNTupleWriter::Recreate(std::move(model), jEvent["name"].get<std::string>(), filename);
mana_status_t result;
result.code = mana_status_ok;
strncpy(result.message, "ok", sizeof(result.message));
return result;
} }
MANA_DEFINE_PLUGIN_END_RUN(end_run) MANA_DEFINE_PLUGIN_END_RUN(end_run)
@ -99,6 +108,10 @@ MANA_DEFINE_PLUGIN_END_RUN(end_run)
log_debug("end: context=%p, descriptor_json=%s", context, descriptor_json); log_debug("end: context=%p, descriptor_json=%s", context, descriptor_json);
auto ctx = reinterpret_cast<Context *>(context); auto ctx = reinterpret_cast<Context *>(context);
*ctx = {}; *ctx = {};
mana_status_t result;
result.code = mana_status_ok;
strncpy(result.message, "ok", sizeof(result.message));
return result;
} }
MANA_DEFINE_PLUGIN_EVENT_DATA(process_event) MANA_DEFINE_PLUGIN_EVENT_DATA(process_event)