From 86844587c9161b3d0b4b4b91ca6b2fae163225a1 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:51:34 +0100 Subject: [PATCH] DPL Analysis: drop aod-file-private This was a hack introduced to pass a workflow option to an AlgorithmSpec created by a plugin. Not needed anymore now that we properly pass the ConfigContext to plugins as well. --- .../src/AODJAlienReaderHelpers.cxx | 21 +++++++++---------- Framework/Core/src/WorkflowHelpers.cxx | 3 +-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx b/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx index 9c19de85739ce..ebd355da0ac47 100644 --- a/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx +++ b/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx @@ -131,10 +131,16 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const if (ctx.options().isSet("aod-parent-access-level")) { parentAccessLevel = ctx.options().get("aod-parent-access-level"); } - auto callback = AlgorithmSpec{adaptStateful([parentFileReplacement, parentAccessLevel](ConfigParamRegistry const& options, - DeviceSpec const& spec, - Monitoring& monitoring, - DataProcessingStats& stats) { + if (ctx.options().isSet("aod-file")) { + LOGP(fatal, "No input file defined!"); + throw std::runtime_error("Processing is stopped!"); + } + auto filename = ctx.options().get("aod-file"); + + auto callback = AlgorithmSpec{adaptStateful([parentFileReplacement, parentAccessLevel, filename](ConfigParamRegistry const& options, + DeviceSpec const& spec, + Monitoring& monitoring, + DataProcessingStats& stats) { // FIXME: not actually needed, since data processing stats can specify that we should // send the initial value. stats.updateStats({static_cast(ProcessingStatsId::ARROW_BYTES_CREATED), DataProcessingStats::Op::Set, 0}); @@ -143,13 +149,6 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const stats.updateStats({static_cast(ProcessingStatsId::ARROW_MESSAGES_DESTROYED), DataProcessingStats::Op::Set, 0}); stats.updateStats({static_cast(ProcessingStatsId::ARROW_BYTES_EXPIRED), DataProcessingStats::Op::Set, 0}); - if (!options.isSet("aod-file-private")) { - LOGP(fatal, "No input file defined!"); - throw std::runtime_error("Processing is stopped!"); - } - - auto filename = options.get("aod-file-private"); - auto maxRate = options.get("aod-max-io-rate"); // create a DataInputDirector diff --git a/Framework/Core/src/WorkflowHelpers.cxx b/Framework/Core/src/WorkflowHelpers.cxx index da9a135dc5eb8..49cbcac948eb2 100644 --- a/Framework/Core/src/WorkflowHelpers.cxx +++ b/Framework/Core/src/WorkflowHelpers.cxx @@ -213,8 +213,7 @@ void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext static_cast(compile_time_hash("internal-dpl-aod-reader")), aodLifetime}}, .algorithm = AlgorithmSpec::dummyAlgorithm(), - .options = {ConfigParamSpec{"aod-file-private", VariantType::String, ctx.options().get("aod-file"), {"AOD file"}}, - ConfigParamSpec{"aod-max-io-rate", VariantType::Float, 0.f, {"Maximum I/O rate in MB/s"}}, + .options = {ConfigParamSpec{"aod-max-io-rate", VariantType::Float, 0.f, {"Maximum I/O rate in MB/s"}}, ConfigParamSpec{"aod-reader-json", VariantType::String, {"json configuration file"}}, ConfigParamSpec{"time-limit", VariantType::Int64, 0ll, {"Maximum run time limit in seconds"}}, ConfigParamSpec{"orbit-offset-enumeration", VariantType::Int64, 0ll, {"initial value for the orbit"}},