diff --git a/core/qa/CbmQaIO.cxx b/core/qa/CbmQaIO.cxx index d440cb301102affb20d97a13940eac65e9c9e533..12ed180c2264582266c29f0b733d2b024f96820f 100644 --- a/core/qa/CbmQaIO.cxx +++ b/core/qa/CbmQaIO.cxx @@ -19,7 +19,7 @@ CbmQaIO::CbmQaIO(TString prefixName, std::shared_ptr<ObjList_t> pObjList) : fsPrefix(prefixName), fpvObjList(pObjList) { if (!fsPrefix.IsNull()) { - fsPrefix += "_"; + //fsPrefix += "_"; } if (!fpvObjList.get()) { fpvObjList = std::make_shared<ObjList_t>(); @@ -104,6 +104,7 @@ void CbmQaIO::SetConfigName(const char* path) msg << "configuration file for QA \"" << path << "\" is improperly formatted"; throw std::runtime_error(msg.str()); } + LOG(info) << fsPrefix << ": configuration file is set to " << path; } // --------------------------------------------------------------------------------------------------------------------- diff --git a/core/qa/CbmQaIO.h b/core/qa/CbmQaIO.h index 2964cdac4d88f104104b2bfa4a86d9982e8305f7..7cb64f07ab5c0cae3ba406e281c6d3681b7aad09 100644 --- a/core/qa/CbmQaIO.h +++ b/core/qa/CbmQaIO.h @@ -136,7 +136,6 @@ class CbmQaIO { /// @param pOutFile Pointer to output ROOT file void WriteToFile(TFile* pOutFile) const; - TString fsRootFolderName = ""; ///< Name of root folder TString fsConfigName = ""; ///< Name of configuration file TString fsPrefix = ""; ///< Unique prefix for all writeable root diff --git a/core/qa/CbmQaManager.cxx b/core/qa/CbmQaManager.cxx index ce4852f2e16c404c905d9444ef2d4469db9453b3..aac24f8084e3b4d0cffa1e1e41881063605e03bc 100644 --- a/core/qa/CbmQaManager.cxx +++ b/core/qa/CbmQaManager.cxx @@ -27,22 +27,30 @@ void CbmQaManager::Finish() using std::right; using std::setw; - std::map<std::string, std::map<std::string, bool>> qaResults; for (auto* task : *(this->GetListOfTasks())) { auto* pQaTask = dynamic_cast<CbmQaTask*>(task); if (pQaTask) { - qaResults[std::string(task->GetName())] = pQaTask->Check(); + LOG(info) << "Checking the task " << pQaTask->GetName(); + pQaTask->Check(); + pQaTask->ReadCheckListFromConfig(); } } - fStatus = true; LOG(info) << fName << ": monitorable status:"; - for (auto& [name, resMap] : qaResults) { - LOG(info) << name; - for (auto& [quantity, flag] : resMap) { - LOG(info) << '\t' << left << setw(40) << quantity << right - << (flag ? "\e[1;32mpassed\e[0m" : "\e[1;31mfailed\e[0m"); - fStatus &= flag; + fStatus = true; + for (auto* task : *(this->GetListOfTasks())) { + auto* pQaTask = dynamic_cast<CbmQaTask*>(task); + if (pQaTask) { + LOG(info) << "Check list for the task " << pQaTask->GetName(); + const auto& mCheckList = pQaTask->GetCheckList(); + for (const auto& [entryName, flags] : mCheckList) { + LOG(info) << '\t' << left << setw(40) << entryName << right << setw(10) + << (flags.fResult ? "\e[1;32mpassed\e[0m" : "\e[1;31mfailed\e[0m") + << (flags.fStatus ? "" : " IGNORED"); + if (flags.fStatus) { + fStatus &= flags.fResult; + } + } } } } @@ -51,9 +59,15 @@ void CbmQaManager::Finish() // InitStatus CbmQaManager::Init() { - for (auto* task : *(this->GetListOfTasks())) { - LOG(info) << "\t- " << task->GetName(); + // Apply configuration file to all underlying tasks + if (fsConfigName.Length()) { + LOG(info) << "CbmQaManager: using configuration file " << fsConfigName; + for (auto* task : *(this->GetListOfTasks())) { + auto* pQaTask = dynamic_cast<CbmQaTask*>(task); + if (pQaTask) { + pQaTask->SetConfigName(fsConfigName.Data()); + } + } } - return kSUCCESS; } diff --git a/core/qa/CbmQaManager.h b/core/qa/CbmQaManager.h index 2c818769650606316f4e4b7cf730d6754b026b49..96c0ac0ca58e0a7c5572e1f91189eda189b6779b 100644 --- a/core/qa/CbmQaManager.h +++ b/core/qa/CbmQaManager.h @@ -10,6 +10,7 @@ #pragma once #include "FairTask.h" +#include "TString.h" #include <map> #include <string> @@ -52,9 +53,16 @@ class CbmQaManager : public FairTask { ClassDef(CbmQaManager, 0); + /// \brief Gets YAML config name + const TString& GetConfigName() const { return fsConfigName; } + /// \brief Gets status flag bool GetStatus() const { return fStatus; } + /// \brief Sets YAML config name + void SetConfigName(const TString& name) { fsConfigName = name; } + private: - bool fStatus = true; ///< Status of QA: true - all tasks passed, false - at least one of the task failed + bool fStatus = true; ///< Status of QA: true - all tasks passed, false - at least one of the task failed + TString fsConfigName = ""; ///< Name of the configuration YAML file (passed to underlying QA tasks) }; diff --git a/core/qa/CbmQaTask.cxx b/core/qa/CbmQaTask.cxx index 4dbd7da02c90741763cd16f01d9f3c6d3813ce71..f545fc93e9908a2db9b193ec481f081658131469 100644 --- a/core/qa/CbmQaTask.cxx +++ b/core/qa/CbmQaTask.cxx @@ -22,6 +22,7 @@ #include "TString.h" #include <array> +#include <regex> ClassImp(CbmQaTask); @@ -175,3 +176,55 @@ void CbmQaTask::PutSetupNameOnPad(double xMin, double yMin, double xMax, double paveText->Draw("same"); } } + +// --------------------------------------------------------------------------------------------------------------------- +// +void CbmQaTask::ReadCheckListFromConfig() +{ + YAML::Node tagNode = fConfigNode["check_list"]; + if (tagNode) { + std::vector<char> vbConfigKeyUsed; + std::vector<char> vbCheckKeyProcessed(fmCheckList.size(), false); // Flag to avoid checking the check entry twice + vbConfigKeyUsed.reserve(tagNode.size()); + std::regex rexInt("%d"); + // First loop: read all the entries, containing special characters ("%d") + for (auto it = tagNode.begin(); it != tagNode.end(); ++it) { + std::string configEntry = it->first.as<std::string>(); + if (static_cast<int>(configEntry.find_last_of("%d")) != -1) { + vbConfigKeyUsed.push_back(true); + bool bCheckStatus = it->second.as<bool>(); // use-flag, stored in the configuration + std::regex keyRex = std::regex(std::regex_replace(configEntry, rexInt, "([0-9*])")); + int iCheckEntry = 0; + for (auto& [checkEntry, checkFlags] : fmCheckList) { + if (!vbCheckKeyProcessed[iCheckEntry] && std::regex_match(checkEntry, keyRex)) { + vbCheckKeyProcessed[iCheckEntry] = true; + checkFlags.fStatus = bCheckStatus; + } + ++iCheckEntry; + } + } + else { + vbConfigKeyUsed.push_back(false); + } + } + // Second loop: read all other entries + int iConfigEntry = 0; + for (auto it = tagNode.begin(); it != tagNode.end(); ++it) { + if (!vbConfigKeyUsed[iConfigEntry]) { + std::string configEntry = it->first.as<std::string>(); + auto checkListIt = fmCheckList.find(configEntry); + if (checkListIt != fmCheckList.end()) { + checkListIt->second.fStatus = it->second.as<bool>(); + } + else { + LOG(warn) << fName << "::ReadCheckListFromConfig: config contains unknown entry " << configEntry; + } + } + ++iConfigEntry; + } + } +} + +// --------------------------------------------------------------------------------------------------------------------- +// +void CbmQaTask::StoreCheckResult(const std::string& tag, bool result) { fmCheckList[tag] = CheckFlags{result, false}; } diff --git a/core/qa/CbmQaTask.h b/core/qa/CbmQaTask.h index 1c04db3f8194138551433f38efce1455f0d4ae2c..27d023aa5e7a1f13541b6c047f9e533c7b7a8d1b 100644 --- a/core/qa/CbmQaTask.h +++ b/core/qa/CbmQaTask.h @@ -42,94 +42,110 @@ class TClonesArray; /// Class CbmQaTask is to be inherited with a particular QA-task. It provides mechanisms for storage and management /// of QA canvases and histograms management class CbmQaTask : public FairTask, public CbmQaIO { + /// \struct CheckFlags + /// \brief Contains a check result and its activeness status of the check-list entry + /// + /// If the status is set to false, the check result is ignored in the QA verdict. + struct CheckFlags { + bool fResult = false; ///< Check result storage + bool fStatus = false; ///< Status of the check + }; + public: - /// Constructor from parameters + /// \brief Constructor from parameters /// \param name Name of the task /// \param verbose Verbose level /// \param isMCUsed Flag: true - MC information is used, false - only reconstructed data QA is processed CbmQaTask(const char* name, int verbose, bool isMCUsed); - /// @brief Default constructor + /// \brief Default constructor CbmQaTask() = delete; // TODO: Let's see, what can happen, if one deletes default constructor - /// @brief Destructor + /// \brief Destructor virtual ~CbmQaTask() = default; - /// @brief Copy constructor + /// \brief Copy constructor CbmQaTask(const CbmQaTask&) = delete; - /// @brief Move constructor + /// \brief Move constructor CbmQaTask(CbmQaTask&&) = delete; - /// @brief Copy assignment operator + /// \brief Copy assignment operator CbmQaTask& operator=(const CbmQaTask&) = delete; - /// @brief Move assignment operator + /// \brief Move assignment operator CbmQaTask& operator=(CbmQaTask&&) = delete; - /// @brief Gets name of the setup + /// \brief Gets name of the setup const std::string& GetSetupName() const { return fsSetupName; } - /// @brief Returns flag, whether MC information is used or not in the task + /// \brief Returns flag, whether MC information is used or not in the task bool IsMCUsed() const { return fbUseMC; } - /// @brief Sets events suppression flag + /// \brief Sets events suppression flag /// /// By default the QA task runs on the reconstructed events (CbmEvent objects), if the tree of the objects is /// presented in the input. This flag disables the events-based routine, so the QA is executed over the whole /// Time-slice. void SetProcessFullTs(bool bProcessFullTs) { fbProcessFullTs = bProcessFullTs; } - /// FairTask: Task initialization in the beginning of the run + /// \brief FairTask: Task initialization in the beginning of the run InitStatus Init() override; - /// FairTask: Task reinitialization + /// \brief FairTask: Task reinitialization InitStatus ReInit() override; - /// FairTask: Defines action of the task in the event/TS + /// \brief FairTask: Defines action of the task in the event/TS void Exec(Option_t* /*option*/) override; - /// FairTask: Defines action of the task in the end of run + /// \brief FairTask: Defines action of the task in the end of run void Finish() override; - /// @brief Sets name of the setup + /// \brief Sets name of the setup void SetSetupName(const char* setup) { fsSetupName = setup; } // ***************************************************** // ** Functions accessible inside the derived classes ** // ***************************************************** - /// \brief Method to check, if the QA results are acceptable - /// \return Map of checks: key - name of the check, value - result of the check - virtual std::map<std::string, bool> Check() = 0; + /// \brief Function to check, if the QA results are acceptable + /// + /// In the function one should provide the check flags with the function StoreCheckResult. + virtual void Check() = 0; + + /// \brief Reads check-list from the configuration file + void ReadCheckListFromConfig(); + + /// \brief Gets check-list + const std::map<std::string, CheckFlags>& GetCheckList() const { return fmCheckList; } protected: - /// De-initialize the task + /// \brief De-initialize the task virtual void DeInit() {} - /// Initializes data branches + /// \brief Initializes data branches virtual InitStatus InitDataBranches() { return kSUCCESS; } - /// Initializes histograms + /// \brief Initializes histograms virtual InitStatus InitHistograms() { return kSUCCESS; } - /// Initializes canvases + /// \brief Initializes canvases virtual InitStatus InitCanvases() { return kSUCCESS; } - /// Initializes event / time-slice + /// \brief Initializes event / time-slice virtual InitStatus InitTimeSlice() { return kSUCCESS; } - /// Method to fill histograms per event or time-slice + /// \brief Method to fill histograms per event or time-slice virtual void FillHistograms() {} - /// Get current event number + /// \brief Get current event number int GetEventNumber() const { return fNofEvents.GetVal(); } // *********************** // ** Utility functions ** // *********************** - /// Checks range of variable + /// \brief Checks range of variable /// \param name Name of the variable /// \param var Variable to check /// \param lo Lower limit of the variable @@ -138,7 +154,7 @@ class CbmQaTask : public FairTask, public CbmQaIO { template<typename T> bool CheckRange(std::string_view name, T var, T lo, T hi) const; - /// Checks range of variable + /// \brief Checks range of variable /// \param name Name of the variable /// \param var Variable to check /// \param varErr Standard Error of the variable @@ -148,20 +164,34 @@ class CbmQaTask : public FairTask, public CbmQaIO { template<typename T> bool CheckRange(std::string_view name, T var, T varErr, T lo, T hi) const; - /// Checks ranges for mean and standard deviation + /// \brief Checks ranges for mean and standard deviation /// \return False, if variable exits the range bool CheckRange(TH1* h, double meanMax, double rmsMin, double rmsMax); - /// @brief Puts setup title on the canvas + /// \brief Puts setup title on the canvas void PutSetupNameOnPad(double xMin, double yMin, double xMax, double yMax); - /// @brief Gets pointer to current event + /// \brief Gets pointer to current event CbmEvent* GetCurrentEvent() { return fpCurrentEvent; } + /// \brief Stores check flag to the check-list + /// \param tag The flag name + /// \param result Check result + void StoreCheckResult(const std::string& tag, bool result); + private: - /// @brief De-initializes this task + /// \brief De-initializes this task void DeInitBase(); + /// \brief A QA check-list map + /// + /// The check list is updated with new entries with the StoreCheckResult(tag, result) function, which is to be called + /// from the Check() function. The result is stored to CheckFlags::fResult field, while the CheckFlags::fStatus stays + /// uninitialized. Than, when the ReadCheckListFromConfig() function is called, the fStatus is updated according to + /// the check list entries in the qa_tasks_config_mcbm.yaml/qa_tasks_config_cbm.yaml. If the fStatus is false + /// (default), the check is ignored in the final verdict making. + std::map<std::string, CheckFlags> fmCheckList; + TClonesArray* fpBrEvents = nullptr; ///< Pointer to CbmEvent branch CbmEvent* fpCurrentEvent = nullptr; ///< Pointer to the current event std::string fsSetupName = ""; ///< Name of the setup (to draw on the canvases) @@ -169,7 +199,6 @@ class CbmQaTask : public FairTask, public CbmQaIO { bool fbUseMC = false; ///< Flag, if MC is used bool fbProcessFullTs = false; ///< If true, routine runs on the full TS even if the CbmEvent branch is in - ClassDefOverride(CbmQaTask, 0); }; diff --git a/macro/mcbm/mcbm_qa.C b/macro/mcbm/mcbm_qa.C index 2253208c42ccfabc77d1f57e2af4737b27089666..7601e16f3f6ba4105ab26ae1025146623b908c8b 100644 --- a/macro/mcbm/mcbm_qa.C +++ b/macro/mcbm/mcbm_qa.C @@ -167,6 +167,7 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", // ------------------------------------------------------------------------ auto* qaManager = new CbmQaManager(3); + qaManager->SetConfigName(qaConfig); run->AddTask(qaManager); // ----- MCDataManager (legacy mode) ----------------------------------- diff --git a/macro/qa/configs/qa_tasks_config_mcbm.yaml b/macro/qa/configs/qa_tasks_config_mcbm.yaml index 2bc8bb254f44fc83cc8b8a78fb6d897fef8b8665..351fbcb6e7e39e0c5cd4ef99b084537c788471da 100644 --- a/macro/qa/configs/qa_tasks_config_mcbm.yaml +++ b/macro/qa/configs/qa_tasks_config_mcbm.yaml @@ -8,6 +8,37 @@ ## @author Sergei Zharko <s.zharko@gsi.de> qa: + CbmCaInputQaMvd: + check_list: + station_position_ordering: true + station_position_hit_delta_z: false + hit_efficiency_station_%d: true + pull_x_station_%d: true + pull_y_station_%d: true + pull_t_station_%d: true + pull_station_%_pull_x: false + CbmCaInputQaSts: + check_list: + station_position_ordering: true + station_position_hit_delta_z: false + hit_efficiency_station_%d: true + pull_x_station_%d: true + pull_y_station_%d: true + pull_t_station_%d: true + pull_u_%d_digis: true + pull_v_%d_digis: true + CbmCaInputQaMuch: + check_list: + station_position_ordering: true + station_position_hit_delta_z: true + hit_efficiency_station_%d: true + pull_x_station_2: false + pull_x_station_3: false + pull_x_station_%d: true + pull_y_station_%d: true + pull_t_station_%d: true + pull_t_station_1: false + pull_t_station_3: false CbmCaInputQaTrd: histograms: #xy_station0: @@ -19,6 +50,22 @@ qa: #xy_station2: # x: { nbins: 500, min: -100., max: 100. } # y: { nbins: 500, min: -100., max: 100. } - profiles: none + profiles: none + check_list: + station_position_ordering: true + station_position_hit_delta_z: true + hit_efficiency_station_%d: true + pull_t_station_0: false + pull_x_station_%d: true + pull_y_station_%d: true + pull_t_station_%d: true + CbmCaInputQaTof: + check_list: + station_position_ordering: true + station_position_hit_delta_z: false + hit_efficiency_station_%d: true + pull_x_station_%d: true + pull_y_station_%d: true + pull_t_station_%d: true ... diff --git a/reco/L1/qa/CbmCaInputQaBase.cxx b/reco/L1/qa/CbmCaInputQaBase.cxx index 2864e30369d7fad78a75f7854e1f3e1e0a9f57cc..470172749c3066dc4f20c9a9641af3af984b597a 100644 --- a/reco/L1/qa/CbmCaInputQaBase.cxx +++ b/reco/L1/qa/CbmCaInputQaBase.cxx @@ -73,13 +73,10 @@ CbmCaInputQaBase<DetID>::CbmCaInputQaBase(const char* name, int verbose, bool is // --------------------------------------------------------------------------------------------------------------------- // template<ca::EDetectorID DetID> -std::map<std::string, bool> CbmCaInputQaBase<DetID>::Check() +void CbmCaInputQaBase<DetID>::Check() { - std::map<std::string, bool> resMap; - int nSt = fpDetInterface->GetNtrackingStations(); - // ************************************************************** // ** Basic checks, available both for real and simulated data ** // ************************************************************** @@ -118,7 +115,7 @@ std::map<std::string, bool> CbmCaInputQaBase<DetID>::Check() } res = false; } - resMap["station_position_ordering"] = res; + StoreCheckResult("station_position_ordering", res); } // ----- Checks for mismatch between station and hit z positions // The purpose of this block is to be ensured, that hits belong to the correct tracking station. For each tracking @@ -149,7 +146,7 @@ std::map<std::string, bool> CbmCaInputQaBase<DetID>::Check() res = false; } } - resMap["station_position_hit_delta_z"] = res; + StoreCheckResult("station_position_hit_delta_z", res); } // ******************************************************* @@ -174,8 +171,8 @@ std::map<std::string, bool> CbmCaInputQaBase<DetID>::Check() auto eff = fvph_reco_eff[iSt]->GetMean(); pEffTable->SetCell(iSt, 0, iSt); pEffTable->SetCell(iSt, 1, eff); - resMap[Form("hit_efficiency_station_%d", iSt)] = - CheckRange("Hit finder efficiency in station " + std::to_string(iSt), eff, fEffThrsh, 1.000); + bool res = CheckRange("Hit finder efficiency in station " + std::to_string(iSt), eff, fEffThrsh, 1.000); + StoreCheckResult(Form("hit_efficiency_station_%d", iSt), res); } LOG(info) << '\n' << pEffTable->ToString(3); } @@ -224,9 +221,9 @@ std::map<std::string, bool> CbmCaInputQaBase<DetID>::Check() cbm::qa::util::SetLargeStats(fvph_pull_t[iSt]); // Check the pull quality - resMap[Form("pull_station_%d_pull_x", iSt)] = CheckRangePull(fvph_pull_x[iSt]); - resMap[Form("pull_station_%d_pull_y", iSt)] = CheckRangePull(fvph_pull_y[iSt]); - resMap[Form("pull_station_%d_pull_t", iSt)] = CheckRangePull(fvph_pull_t[iSt]); + StoreCheckResult(Form("pull_x_station_%d", iSt), CheckRangePull(fvph_pull_x[iSt])); + StoreCheckResult(Form("pull_y_station_%d", iSt), CheckRangePull(fvph_pull_y[iSt])); + StoreCheckResult(Form("pull_t_station_%d", iSt), CheckRangePull(fvph_pull_t[iSt])); pPullsTable->SetCell(iSt, 0, iSt); pPullsTable->SetCell(iSt, 1, fvph_pull_x[iSt]->GetStdDev()); @@ -237,8 +234,6 @@ std::map<std::string, bool> CbmCaInputQaBase<DetID>::Check() LOG(info) << '\n' << pPullsTable->ToString(3); } } // McUsed - - return resMap; } // --------------------------------------------------------------------------------------------------------------------- diff --git a/reco/L1/qa/CbmCaInputQaBase.h b/reco/L1/qa/CbmCaInputQaBase.h index 5f71e64dc29c1f478a9ceb6e9e5758a44e1de654..c91a030e32a7ab6867f8768ac464a7f4bc36a364 100644 --- a/reco/L1/qa/CbmCaInputQaBase.h +++ b/reco/L1/qa/CbmCaInputQaBase.h @@ -100,7 +100,7 @@ class CbmCaInputQaBase : public CbmQaTask { /// \brief Method to check, if the QA results are acceptable /// \return Map of checks: key - name of the check, value - result of the check - std::map<std::string, bool> Check() override; + void Check() override; /// @brief Initializes data branches InitStatus InitDataBranches() override; diff --git a/reco/L1/qa/CbmCaInputQaMuch.h b/reco/L1/qa/CbmCaInputQaMuch.h index 414001d5a71a83ccdc6197eba7a850e8c7687f8d..adbf58508a596cd7a384ab7a28256bb2a76ddfef 100644 --- a/reco/L1/qa/CbmCaInputQaMuch.h +++ b/reco/L1/qa/CbmCaInputQaMuch.h @@ -23,8 +23,7 @@ class CbmCaInputQaMuch : public CbmCaInputQaBase<cbm::algo::ca::EDetectorID::kMu protected: /// \brief Method to check, if the QA results are acceptable - /// \return Map of checks: key - name of the check, value - result of the check - std::map<std::string, bool> Check() override { return CbmCaInputQaBase::Check(); } + void Check() override { return CbmCaInputQaBase::Check(); } /// @brief Initializes data branches InitStatus InitDataBranches() override; diff --git a/reco/L1/qa/CbmCaInputQaMvd.h b/reco/L1/qa/CbmCaInputQaMvd.h index 6748e11c1fb05dcec158f7020a65742905362eef..0a92507d62e5ab8ad01af34db7933e4deb21f6c9 100644 --- a/reco/L1/qa/CbmCaInputQaMvd.h +++ b/reco/L1/qa/CbmCaInputQaMvd.h @@ -23,8 +23,7 @@ class CbmCaInputQaMvd : public CbmCaInputQaBase<cbm::algo::ca::EDetectorID::kMvd protected: /// \brief Method to check, if the QA results are acceptable - /// \return Map of checks: key - name of the check, value - result of the check - std::map<std::string, bool> Check() override { return CbmCaInputQaBase::Check(); } + void Check() override { return CbmCaInputQaBase::Check(); } /// @brief Initializes data branches InitStatus InitDataBranches() override; diff --git a/reco/L1/qa/CbmCaInputQaSetup.cxx b/reco/L1/qa/CbmCaInputQaSetup.cxx index d56e079c58bb46e121072c28dd83ca4dc965abb5..4ff128997c7106fecc312ad8acf01b0e85d7a966 100644 --- a/reco/L1/qa/CbmCaInputQaSetup.cxx +++ b/reco/L1/qa/CbmCaInputQaSetup.cxx @@ -25,7 +25,7 @@ InputQaSetup::InputQaSetup(int verbose, bool isMCUsed) : CbmQaTask("CbmCaInputQa // --------------------------------------------------------------------------------------------------------------------- // -std::map<std::string, bool> InputQaSetup::Check() { return std::map<std::string, bool>(); } +void InputQaSetup::Check() {} // --------------------------------------------------------------------------------------------------------------------- diff --git a/reco/L1/qa/CbmCaInputQaSetup.h b/reco/L1/qa/CbmCaInputQaSetup.h index fa484fe22084c17282d79693ccc3a4f7de509dbe..c378e356412010cd746ae2f66a2aeb5eb9788662 100644 --- a/reco/L1/qa/CbmCaInputQaSetup.h +++ b/reco/L1/qa/CbmCaInputQaSetup.h @@ -53,7 +53,7 @@ namespace cbm::ca void SetDetectorFlag(ca::EDetectorID detID, bool flag = true) { fvbUseDet[detID] = flag; } /// @brief Checks results of the QA and returns a success flag - std::map<std::string, bool> Check() override; + void Check() override; /// @brief Initializes canvases InitStatus InitCanvases() override; diff --git a/reco/L1/qa/CbmCaInputQaSts.cxx b/reco/L1/qa/CbmCaInputQaSts.cxx index b67a942cdbec4fe9822e34ad3b7761ddb19009f4..4083bba43fc31bb3653e081f56f54a5291e6002b 100644 --- a/reco/L1/qa/CbmCaInputQaSts.cxx +++ b/reco/L1/qa/CbmCaInputQaSts.cxx @@ -55,21 +55,18 @@ CbmCaInputQaSts::CbmCaInputQaSts(int verbose, bool isMCUsed) : CbmCaInputQaBase( // --------------------------------------------------------------------------------------------------------------------- // -std::map<std::string, bool> CbmCaInputQaSts::Check() +void CbmCaInputQaSts::Check() { - std::map<std::string, bool> res = CbmCaInputQaBase::Check(); - + CbmCaInputQaBase::Check(); if (IsMCUsed()) { for (int idig = 0; idig <= fkMaxDigisInClusterForPulls; idig++) { cbm::qa::util::SetLargeStats(fvph_pull_u_Ndig[idig]); - res[Form("pull_pull_u_%d_digis", idig)] = CheckRangePull(fvph_pull_u_Ndig[idig]); + StoreCheckResult(Form("pull_u_%d_digis", idig), CheckRangePull(fvph_pull_u_Ndig[idig])); cbm::qa::util::SetLargeStats(fvph_pull_v_Ndig[idig]); - res[Form("pull_pull_v_%d_digis", idig)] = CheckRangePull(fvph_pull_v_Ndig[idig]); + StoreCheckResult(Form("pull_v_%d_digis", idig), CheckRangePull(fvph_pull_v_Ndig[idig])); } } // McUsed - - return res; } // --------------------------------------------------------------------------------------------------------------------- diff --git a/reco/L1/qa/CbmCaInputQaSts.h b/reco/L1/qa/CbmCaInputQaSts.h index 36e3478fbd580bef1e3ea455a4ed39190da7db79..383f3c1062579431e5e8943a7c216196beba712c 100644 --- a/reco/L1/qa/CbmCaInputQaSts.h +++ b/reco/L1/qa/CbmCaInputQaSts.h @@ -44,8 +44,7 @@ class CbmCaInputQaSts : public CbmCaInputQaBase<cbm::algo::ca::EDetectorID::kSts protected: /// \brief Method to check, if the QA results are acceptable - /// \return Map of checks: key - name of the check, value - result of the check - std::map<std::string, bool> Check() override; + void Check() override; /// Initializes data branches InitStatus InitDataBranches() override; diff --git a/reco/L1/qa/CbmCaInputQaTof.h b/reco/L1/qa/CbmCaInputQaTof.h index 96357c8063e5139dfcd2e61866d510e08bf85311..b586fcf451e5ca624a22d2f0a8f65dfc7637be5e 100644 --- a/reco/L1/qa/CbmCaInputQaTof.h +++ b/reco/L1/qa/CbmCaInputQaTof.h @@ -49,8 +49,7 @@ class CbmCaInputQaTof : public CbmCaInputQaBase<cbm::algo::ca::EDetectorID::kTof protected: /// \brief Method to check, if the QA results are acceptable - /// \return Map of checks: key - name of the check, value - result of the check - std::map<std::string, bool> Check() override { return CbmCaInputQaBase::Check(); } + void Check() override { CbmCaInputQaBase::Check(); } /// @brief Initializes data branches InitStatus InitDataBranches() override; diff --git a/reco/L1/qa/CbmCaInputQaTrd.h b/reco/L1/qa/CbmCaInputQaTrd.h index db103ee5d821571baf01c86074596921df7bb91b..3eac8d211930880745b82d7d4b2d2e7b245855fe 100644 --- a/reco/L1/qa/CbmCaInputQaTrd.h +++ b/reco/L1/qa/CbmCaInputQaTrd.h @@ -23,8 +23,7 @@ class CbmCaInputQaTrd : public CbmCaInputQaBase<cbm::algo::ca::EDetectorID::kTrd protected: /// \brief Method to check, if the QA results are acceptable - /// \return Map of checks: key - name of the check, value - result of the check - std::map<std::string, bool> Check() override { return CbmCaInputQaBase::Check(); } + void Check() override { CbmCaInputQaBase::Check(); } /// @brief Initializes data branches InitStatus InitDataBranches() override; diff --git a/reco/L1/qa/CbmCaOutputQa.cxx b/reco/L1/qa/CbmCaOutputQa.cxx index ea25ca2d1eba1a6980f7ed4def14e642050aeefb..88c055165799c47a84b51b54805a3dee27666593 100644 --- a/reco/L1/qa/CbmCaOutputQa.cxx +++ b/reco/L1/qa/CbmCaOutputQa.cxx @@ -597,7 +597,7 @@ InitStatus OutputQa::InitHistograms() // --------------------------------------------------------------------------------------------------------------------- // -std::map<std::string, bool> OutputQa::Check() +void OutputQa::Check() { // Create summary table if (IsMCUsed()) { @@ -645,8 +645,6 @@ std::map<std::string, bool> OutputQa::Check() } LOG(info) << '\n' << fMonitor.ToString(); - - return std::map<std::string, bool>(); } // --------------------------------------------------------------------------------------------------------------------- diff --git a/reco/L1/qa/CbmCaOutputQa.h b/reco/L1/qa/CbmCaOutputQa.h index 9a90689d9d058e6eb87b0b509014101b5ee71fdb..79cf1921c3470c3533c210159a2fb7c313bc666d 100644 --- a/reco/L1/qa/CbmCaOutputQa.h +++ b/reco/L1/qa/CbmCaOutputQa.h @@ -193,8 +193,7 @@ namespace cbm::ca protected: /// \brief Method to check, if the QA results are acceptable - /// \return Map of checks: key - name of the check, value - result of the check - std::map<std::string, bool> Check() override; + void Check() override; /// @brief Initializes canvases InitStatus InitCanvases() override;