From 371a1a6341924c444989eba4941ce8000b93cf9c Mon Sep 17 00:00:00 2001 From: Barthelemy Date: Fri, 5 Jul 2024 09:16:34 +0200 Subject: [PATCH] Use extended parameters. --- .../include/Common/ReferenceComparatorCheck.h | 1 + .../Common/src/ReferenceComparatorCheck.cxx | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Modules/Common/include/Common/ReferenceComparatorCheck.h b/Modules/Common/include/Common/ReferenceComparatorCheck.h index 200a358d1d..78c6f953b6 100644 --- a/Modules/Common/include/Common/ReferenceComparatorCheck.h +++ b/Modules/Common/include/Common/ReferenceComparatorCheck.h @@ -55,6 +55,7 @@ class ReferenceComparatorCheck : public o2::quality_control::checker::CheckInter std::map mQualityFlags; std::map> mQualityLabels; quality_control::core::Activity mActivity; + size_t mReferenceRun; }; } // namespace o2::quality_control_modules::common diff --git a/Modules/Common/src/ReferenceComparatorCheck.cxx b/Modules/Common/src/ReferenceComparatorCheck.cxx index 4f651fa890..c239855ef4 100644 --- a/Modules/Common/src/ReferenceComparatorCheck.cxx +++ b/Modules/Common/src/ReferenceComparatorCheck.cxx @@ -46,9 +46,10 @@ void ReferenceComparatorCheck::configure() void ReferenceComparatorCheck::startOfActivity(const Activity& activity) { - auto moduleName = mCustomParameters.atOptional("moduleName").value_or(""); - auto comparatorName = mCustomParameters.atOptional("comparatorName").value_or(""); - double threshold = std::stof(mCustomParameters.atOptional("threshold").value_or("0")); + auto moduleName = mCustomParameters.atOptional("moduleName", activity).value_or(""); + auto comparatorName = mCustomParameters.atOptional("comparatorName", activity).value_or(""); + double threshold = std::stof(mCustomParameters.atOptional("threshold", activity).value_or("0")); + mReferenceRun = std::stoi(mCustomParameters.atOptional("referenceRun", activity).value_or("0")); mComparator.reset(); if (!moduleName.empty() && !comparatorName.empty()) { @@ -143,16 +144,11 @@ Quality ReferenceComparatorCheck::getSinglePlotQuality(std::shared_ptr>* moMap) { - Quality result = Quality::Good; + Quality result = Quality::Null; + + if (mReferenceRun == 0) { + result.addFlag(FlagTypeFactory::Unknown(), "No reference run provided"); + return result; + } + for (auto& [key, mo] : *moMap) { auto moName = mo->getName(); Quality quality;