diff --git a/Framework/include/QualityControl/Checker.h b/Framework/include/QualityControl/Checker.h index f02493f3ae..f9a72ffb8c 100644 --- a/Framework/include/QualityControl/Checker.h +++ b/Framework/include/QualityControl/Checker.h @@ -16,10 +16,8 @@ #include // O2 #include -#include #include -#include -#include +#include // QC #include "QualityControl/QcInfoLogger.h" #include "QualityControl/CheckInterface.h" diff --git a/Framework/include/QualityControl/TaskDevice.h b/Framework/include/QualityControl/TaskDevice.h index e59d6a0172..60dafa9cdd 100644 --- a/Framework/include/QualityControl/TaskDevice.h +++ b/Framework/include/QualityControl/TaskDevice.h @@ -14,9 +14,8 @@ #include // O2 #include -#include #include -#include +#include #include // QC #include "QualityControl/TaskConfig.h" diff --git a/Framework/src/Checker.cxx b/Framework/src/Checker.cxx index c60e237583..5e72c01788 100644 --- a/Framework/src/Checker.cxx +++ b/Framework/src/Checker.cxx @@ -37,6 +37,7 @@ using namespace std; using namespace AliceO2::InfoLogger; using namespace std::chrono; using namespace AliceO2::Configuration; +using namespace AliceO2::Monitoring; namespace o2 { namespace quality_control { @@ -66,7 +67,7 @@ Checker::Checker(std::string checkerName, std::string configurationSource) // monitoring try { - mCollector = std::make_shared(configurationSource); + mCollector = MonitoringFactory::Get("infologger://"); mCollector->addDerivedMetric("objects", AliceO2::Monitoring::DerivedMetricMode::RATE); } catch (...) { string diagnostic = boost::current_exception_diagnostic_information(); diff --git a/Framework/src/SpyMainFrame.cxx b/Framework/src/SpyMainFrame.cxx index 403353e9da..8aa9eb010d 100644 --- a/Framework/src/SpyMainFrame.cxx +++ b/Framework/src/SpyMainFrame.cxx @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/Framework/src/TaskDevice.cxx b/Framework/src/TaskDevice.cxx index 843d89dc38..b67e268bf3 100644 --- a/Framework/src/TaskDevice.cxx +++ b/Framework/src/TaskDevice.cxx @@ -57,7 +57,7 @@ TaskDevice::TaskDevice(std::string taskName, std::string configurationSource) : populateConfig(mTaskName); // setup monitoring - mCollector = make_unique(configurationSource); + mCollector = MonitoringFactory::Get("infologger://"); // setup publisher mObjectsManager = make_shared(mTaskConfig); diff --git a/Modules/Common/src/MeanIsAbove.cxx b/Modules/Common/src/MeanIsAbove.cxx index 964236619e..26ae0b65e6 100644 --- a/Modules/Common/src/MeanIsAbove.cxx +++ b/Modules/Common/src/MeanIsAbove.cxx @@ -11,11 +11,12 @@ #include #include // O2 -#include "Configuration/Configuration.h" +#include "Configuration/ConfigurationFactory.h" ClassImp(o2::quality_control_modules::common::MeanIsAbove) using namespace std; +using namespace AliceO2::Configuration; namespace o2 { namespace quality_control_modules { @@ -29,9 +30,8 @@ MeanIsAbove::MeanIsAbove() void MeanIsAbove::configure(std::string name) { // TODO use the configuration system to set the params - AliceO2::Configuration::ConfigFile configFile; try { - configFile.load("file:../example.ini"); // not ok... + auto configFile = ConfigurationFactory::getConfiguration("file:../example.ini"); // not ok... } catch (string &exception) { cout << "error getting config file in MeanIsAbove : " << exception << endl; mThreshold = 1.0f; diff --git a/Modules/Example/include/Example/BenchmarkTask.h b/Modules/Example/include/Example/BenchmarkTask.h index 12c66893b3..41f405588c 100644 --- a/Modules/Example/include/Example/BenchmarkTask.h +++ b/Modules/Example/include/Example/BenchmarkTask.h @@ -9,7 +9,7 @@ #include "QualityControl/TaskInterface.h" #include -#include "Configuration/Configuration.h" +#include "Configuration/ConfigurationFactory.h" class TH1F; @@ -44,7 +44,7 @@ class BenchmarkTask: public TaskInterface private: std::vector mHistos; - AliceO2::Configuration::ConfigFile mConfigFile; + std::unique_ptr mConfigFile; size_t mNumberHistos; size_t mNumberChecks; std::string mTypeOfChecks; diff --git a/Modules/Example/src/BenchmarkTask.cxx b/Modules/Example/src/BenchmarkTask.cxx index e3e39191ca..a4d2faec97 100644 --- a/Modules/Example/src/BenchmarkTask.cxx +++ b/Modules/Example/src/BenchmarkTask.cxx @@ -10,6 +10,7 @@ #include using namespace std; +using namespace AliceO2::Configuration; namespace o2 { namespace quality_control_modules { @@ -29,12 +30,12 @@ void BenchmarkTask::initialize() QcInfoLogger::GetInstance() << "initialize benchmarktask \"" << getName() << "\"" << AliceO2::InfoLogger::InfoLogger::endm; - mConfigFile.load("file:./example.ini"); - string taskDefinitionName = mConfigFile.getValue(getName() + ".taskDefinition"); - mNumberHistos = mConfigFile.getValue(taskDefinitionName + ".numberHistos"); - mNumberChecks = mConfigFile.getValue(taskDefinitionName + ".numberChecks"); - mTypeOfChecks = mConfigFile.getValue(taskDefinitionName + ".typeOfChecks"); - mModuleOfChecks = mConfigFile.getValue(taskDefinitionName + ".moduleOfChecks"); + mConfigFile = ConfigurationFactory::getConfiguration("file:./example.ini"); + string taskDefinitionName = mConfigFile->get(getName() + ".taskDefinition").value(); + mNumberHistos = mConfigFile->get(taskDefinitionName + ".numberHistos").value(); + mNumberChecks = mConfigFile->get(taskDefinitionName + ".numberChecks").value(); + mTypeOfChecks = mConfigFile->get(taskDefinitionName + ".typeOfChecks").value(); + mModuleOfChecks = mConfigFile->get(taskDefinitionName + ".moduleOfChecks").value(); mHistos.reserve(mNumberHistos); diff --git a/cmake/FindConfiguration.cmake b/cmake/FindConfiguration.cmake index b6cc5887ea..2748e23801 100644 --- a/cmake/FindConfiguration.cmake +++ b/cmake/FindConfiguration.cmake @@ -14,7 +14,7 @@ include(FindPackageHandleStandardArgs) # find includes -find_path(CONFIGURATION_INCLUDE_DIR Configuration.h +find_path(CONFIGURATION_INCLUDE_DIR ConfigurationInterface.h HINTS ${Configuration_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Configuration" "../../include/Configuration" ) # Remove the final "Configuration" get_filename_component(CONFIGURATION_INCLUDE_DIR ${CONFIGURATION_INCLUDE_DIR} DIRECTORY)