Skip to content

Commit e59797d

Browse files
mvishiu11andreasmolander
authored andcommitted
feat: change custom param config
1 parent 17c381b commit e59797d

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

Modules/FIT/FT0/etc/ft0-aging-laser-postproc.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@
3838
"className": "o2::quality_control_modules::ft0::AgingLaserPostProcTask",
3939
"moduleName": "QcFT0",
4040
"detectorName": "FT0",
41-
"custom": {
42-
"agingTaskSourcePath": "FT0/MO/AgingLaser",
43-
"refPeakWindowMin": "150",
44-
"refPeakWindowMax": "600",
45-
"fracWindowLow": "0.25",
46-
"fracWindowHigh": "0.25",
47-
"ignoreDetectorChannels": "",
48-
"ignoreRefChannels": "209"
41+
"extendedTaskParameters": {
42+
"default": {
43+
"default": {
44+
"agingTaskSourcePath": "FT0/MO/AgingLaser",
45+
"refPeakWindowMin": "150",
46+
"refPeakWindowMax": "600",
47+
"fracWindowLow": "0.30",
48+
"fracWindowHigh": "0.30",
49+
"ignoreDetectorChannels": "",
50+
"ignoreRefChannels": "209"
51+
}
52+
}
4953
},
5054
"initTrigger": [ "userorcontrol" ],
5155
"updateTrigger": [ "newobject:qcdb:FT0/MO/AgingLaser/AmpPerChannel" ],

Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include <vector>
2727
#include <string>
2828

29+
using namespace o2::quality_control::core;
30+
2931
namespace o2::quality_control_modules::ft0
3032
{
3133

Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,12 @@ AgingLaserPostProcTask::~AgingLaserPostProcTask() = default;
3737

3838
void AgingLaserPostProcTask::configure(const boost::property_tree::ptree& cfg)
3939
{
40-
const char* cfgPath = Form("qc.postprocessing.%s", getID().c_str());
41-
const char* cfgCustom = Form("%s.custom", cfgPath);
42-
43-
mPostProcHelper.configure(cfg, cfgPath, "FT0");
44-
45-
auto key = [&cfgCustom](const std::string& e) { return Form("%s.%s", cfgCustom, e.c_str()); };
46-
47-
mAmpMoPath = helper::getConfigFromPropertyTree<std::string>(cfg, key("agingTaskSourcePath"), mAmpMoPath);
40+
mAmpMoPath = o2::quality_control_modules::common::getFromConfig<std::string>(mCustomParameters, "agingTaskSourcePath", mAmpMoPath);
4841

4942
mDetectorChIDs.resize(208);
5043
std::iota(mDetectorChIDs.begin(), mDetectorChIDs.end(), 0);
5144
const std::string detSkip =
52-
helper::getConfigFromPropertyTree<std::string>(cfg, key("ignoreDetectorChannels"), "");
45+
o2::quality_control_modules::common::getFromConfig<std::string>(mCustomParameters, "ignoreDetectorChannels", "");
5346
if (!detSkip.empty()) {
5447
auto toSkip = fit::helper::parseParameters<uint8_t>(detSkip, ",");
5548
for (auto s : toSkip) {
@@ -64,7 +57,7 @@ void AgingLaserPostProcTask::configure(const boost::property_tree::ptree& cfg)
6457
mReferenceChIDs.push_back(ch);
6558
}
6659
const std::string refSkip =
67-
helper::getConfigFromPropertyTree<std::string>(cfg, key("ignoreRefChannels"), "");
60+
o2::quality_control_modules::common::getFromConfig<std::string>(mCustomParameters, "ignoreRefChannels", "");
6861
if (!refSkip.empty()) {
6962
auto toSkip = fit::helper::parseParameters<uint8_t>(refSkip, ",");
7063
for (auto s : toSkip) {
@@ -73,10 +66,10 @@ void AgingLaserPostProcTask::configure(const boost::property_tree::ptree& cfg)
7366
}
7467
}
7568

76-
mADCSearchMin = helper::getConfigFromPropertyTree<double>(cfg, key("refPeakWindowMin"), mADCSearchMin);
77-
mADCSearchMax = helper::getConfigFromPropertyTree<double>(cfg, key("refPeakWindowMax"), mADCSearchMax);
78-
mFracWindowA = helper::getConfigFromPropertyTree<double>(cfg, key("fracWindowLow"), mFracWindowA);
79-
mFracWindowB = helper::getConfigFromPropertyTree<double>(cfg, key("fracWindowHigh"), mFracWindowB);
69+
mADCSearchMin = o2::quality_control_modules::common::getFromConfig<double>(mCustomParameters, "refPeakWindowMin", mADCSearchMin);
70+
mADCSearchMax = o2::quality_control_modules::common::getFromConfig<double>(mCustomParameters, "refPeakWindowMax", mADCSearchMax);
71+
mFracWindowA = o2::quality_control_modules::common::getFromConfig<double>(mCustomParameters, "fracWindowLow", mFracWindowA);
72+
mFracWindowB = o2::quality_control_modules::common::getFromConfig<double>(mCustomParameters, "fracWindowHigh", mFracWindowB);
8073
}
8174

8275
void AgingLaserPostProcTask::initialize(Trigger, framework::ServiceRegistryRef)

0 commit comments

Comments
 (0)