From d519e13e872e614d335e8804f26810101e61e582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9l=C3=A9my=20von=20Haller?= Date: Thu, 18 Oct 2018 14:24:52 +0200 Subject: [PATCH] Use recursive get in configuration (#79) (QC-106) --- Modules/Example/include/Example/BenchmarkTask.h | 4 ++-- Modules/Example/src/BenchmarkTask.cxx | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Modules/Example/include/Example/BenchmarkTask.h b/Modules/Example/include/Example/BenchmarkTask.h index 05f756a456..9ffaaf141a 100644 --- a/Modules/Example/include/Example/BenchmarkTask.h +++ b/Modules/Example/include/Example/BenchmarkTask.h @@ -47,8 +47,8 @@ class BenchmarkTask : public TaskInterface private: std::vector mHistos; std::unique_ptr mConfigFile; - size_t mNumberHistos; - size_t mNumberChecks; + int mNumberHistos; + int mNumberChecks; std::string mTypeOfChecks; std::string mModuleOfChecks; diff --git a/Modules/Example/src/BenchmarkTask.cxx b/Modules/Example/src/BenchmarkTask.cxx index 9620ed3b0d..48de2e34ba 100644 --- a/Modules/Example/src/BenchmarkTask.cxx +++ b/Modules/Example/src/BenchmarkTask.cxx @@ -29,12 +29,13 @@ void BenchmarkTask::initialize(o2::framework::InitContext& ctx) << AliceO2::InfoLogger::InfoLogger::endm; mConfigFile = ConfigurationFactory::getConfiguration("file:./example.ini"); - string prefix = "/qc/tasks_config/" + getName(); + string prefix = "qc.tasks_config." + getName(); string taskDefinitionName = mConfigFile->get(prefix + ".taskDefinition"); - mNumberHistos = mConfigFile->get(taskDefinitionName + ".numberHistos"); - mNumberChecks = mConfigFile->get(taskDefinitionName + ".numberChecks"); - mTypeOfChecks = mConfigFile->get(taskDefinitionName + ".typeOfChecks"); - mModuleOfChecks = mConfigFile->get(taskDefinitionName + ".moduleOfChecks"); + auto taskConfigTree = mConfigFile->getRecursive(taskDefinitionName); + mNumberHistos = taskConfigTree.get(taskDefinitionName + ".numberHistos"); + mNumberChecks = taskConfigTree.get(taskDefinitionName + ".numberChecks"); + mTypeOfChecks = taskConfigTree.get(taskDefinitionName + ".typeOfChecks"); + mModuleOfChecks = taskConfigTree.get(taskDefinitionName + ".moduleOfChecks"); mHistos.reserve(mNumberHistos);