From 1ad7dd2f3197cd7687493e37c4cb795ecf7042bf Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Fri, 2 Aug 2024 16:41:40 +0200 Subject: [PATCH] fix trending and set a default value to thresholds (#2377) Co-authored-by: Lucia Anna Tarasovicova --- Modules/CTP/include/CTP/RawDataReaderCheck.h | 10 +++++----- Modules/CTP/src/CTPTrendingTask.cxx | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Modules/CTP/include/CTP/RawDataReaderCheck.h b/Modules/CTP/include/CTP/RawDataReaderCheck.h index 6223ccc519..ae1d17fd45 100644 --- a/Modules/CTP/include/CTP/RawDataReaderCheck.h +++ b/Modules/CTP/include/CTP/RawDataReaderCheck.h @@ -54,10 +54,10 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface void clearIndexVectors(); long int mTimestamp; float mThreshold = -1; // threshold for BCs - float mThresholdRateBad; // threshold for the relative change in ctp input and class rates - float mThresholdRateMedium; // threshold for the relative change in ctp input and class rates - float mThresholdRateRatioBad; // threshold for the relative change in ctp input and class ratios - float mThresholdRateRatioMedium; // threshold for the relative change in ctp input and class ratios + float mThresholdRateBad = -1; // threshold for the relative change in ctp input and class rates + float mThresholdRateMedium = -1; // threshold for the relative change in ctp input and class rates + float mThresholdRateRatioBad = -1; // threshold for the relative change in ctp input and class ratios + float mThresholdRateRatioMedium = -1; // threshold for the relative change in ctp input and class ratios bool mFlagRatio = false; // flag that a ratio plot is checked bool mFlagInput = false; // flag that an input plot is checked TH1D* mHistInputPrevious = nullptr; // histogram storing ctp input rates from previous cycle @@ -73,7 +73,7 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface std::bitset mLHCBCs; // LHC filling scheme const char* ctpinputs[49] = { " T0A", " T0C", " TVX", " TSC", " TCE", " VBA", " VOR", " VIR", " VNC", " VCH", "11", "12", " UCE", "DMC", " USC", " UVX", " U0C", " U0A", "COS", "LAS", "EMC", " PH0", "23", "24", "ZED", "ZNC", "PHL", "PHH", "PHM", "30", "31", "32", "33", "34", "35", "36", "EJ1", "EJ2", "EG1", "EG2", "DJ1", "DG1", "DJ2", "DG2", "45", "46", "47", "48", "49" }; // ctp input names - ClassDefOverride(RawDataReaderCheck, 6); + ClassDefOverride(RawDataReaderCheck, 7); }; } // namespace o2::quality_control_modules::ctp diff --git a/Modules/CTP/src/CTPTrendingTask.cxx b/Modules/CTP/src/CTPTrendingTask.cxx index 342d336d7e..bf0fe31690 100644 --- a/Modules/CTP/src/CTPTrendingTask.cxx +++ b/Modules/CTP/src/CTPTrendingTask.cxx @@ -45,7 +45,7 @@ void CTPTrendingTask::initCTP(Trigger& t) std::string run = std::to_string(t.activity.mId); std::string CCDBHost; try { - CCDBHost = std::stof(mCustomParameters.at("ccdbName", "default")); + CCDBHost = mCustomParameters.at("ccdbName", "default"); } catch (const std::exception& e) { CCDBHost = "https://alice-ccdb.cern.ch"; } @@ -180,11 +180,11 @@ void CTPTrendingTask::initialize(Trigger t, framework::ServiceRegistryRef servic void CTPTrendingTask::update(Trigger t, framework::ServiceRegistryRef services) { auto& qcdb = services.get(); - if (mCTPconfigFound) { + if (!mCTPconfigFound) { initCTP(t); - if (mCTPconfigFound) { - return; - } + } + if (!mCTPconfigFound) { + return; } trendValues(t, qcdb); generatePlots();