From a4761647cd398a63b52effe1f138dbc00bb5dc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20L=C3=BCke?= Date: Thu, 2 Jan 2025 18:31:30 +0100 Subject: [PATCH] adapt the root plugins to newer interfaces --- src/mana_plugin_root_histogram.cc | 8 ++++++++ src/mana_plugin_root_rntuple_writer.cc | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/mana_plugin_root_histogram.cc b/src/mana_plugin_root_histogram.cc index cb920b9..606950b 100644 --- a/src/mana_plugin_root_histogram.cc +++ b/src/mana_plugin_root_histogram.cc @@ -140,6 +140,10 @@ MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run) log_info("hitCount histograms: %s", histo_info(ctx->hitCounts).c_str()); log_info("raw histograms: %s", histo_info(ctx->rawHistograms).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) @@ -150,6 +154,10 @@ MANA_DEFINE_PLUGIN_END_RUN(end_run) auto ctx = reinterpret_cast(context); ctx->outputFile->Write(); *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) diff --git a/src/mana_plugin_root_rntuple_writer.cc b/src/mana_plugin_root_rntuple_writer.cc index 69125f9..d3a737a 100644 --- a/src/mana_plugin_root_rntuple_writer.cc +++ b/src/mana_plugin_root_rntuple_writer.cc @@ -66,7 +66,12 @@ MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run) if (jRun["events"].size() > 1) { 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); @@ -90,6 +95,10 @@ MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run) ctx->writer = RNTupleWriter::Recreate(std::move(model), jEvent["name"].get(), 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) @@ -99,6 +108,10 @@ MANA_DEFINE_PLUGIN_END_RUN(end_run) log_debug("end: context=%p, descriptor_json=%s", context, descriptor_json); auto ctx = reinterpret_cast(context); *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)