Skip to content

Commit

Permalink
Use recursive get in configuration (#79) (QC-106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barthelemy authored Oct 18, 2018
1 parent e7d1f49 commit d519e13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Modules/Example/include/Example/BenchmarkTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class BenchmarkTask : public TaskInterface
private:
std::vector<TH1F*> mHistos;
std::unique_ptr<o2::configuration::ConfigurationInterface> mConfigFile;
size_t mNumberHistos;
size_t mNumberChecks;
int mNumberHistos;
int mNumberChecks;
std::string mTypeOfChecks;
std::string mModuleOfChecks;

Expand Down
11 changes: 6 additions & 5 deletions Modules/Example/src/BenchmarkTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>(prefix + ".taskDefinition");
mNumberHistos = mConfigFile->get<int>(taskDefinitionName + ".numberHistos");
mNumberChecks = mConfigFile->get<int>(taskDefinitionName + ".numberChecks");
mTypeOfChecks = mConfigFile->get<std::string>(taskDefinitionName + ".typeOfChecks");
mModuleOfChecks = mConfigFile->get<std::string>(taskDefinitionName + ".moduleOfChecks");
auto taskConfigTree = mConfigFile->getRecursive(taskDefinitionName);
mNumberHistos = taskConfigTree.get<int>(taskDefinitionName + ".numberHistos");
mNumberChecks = taskConfigTree.get<int>(taskDefinitionName + ".numberChecks");
mTypeOfChecks = taskConfigTree.get<std::string>(taskDefinitionName + ".typeOfChecks");
mModuleOfChecks = taskConfigTree.get<std::string>(taskDefinitionName + ".moduleOfChecks");

mHistos.reserve(mNumberHistos);

Expand Down

0 comments on commit d519e13

Please sign in to comment.