diff --git a/core/qa/CbmQaIO.cxx b/core/qa/CbmQaIO.cxx index 12ed180c2264582266c29f0b733d2b024f96820f..8c3b84699a6d5b79cfd8f09cb96c2bdd6adcb568 100644 --- a/core/qa/CbmQaIO.cxx +++ b/core/qa/CbmQaIO.cxx @@ -113,6 +113,7 @@ void CbmQaIO::WriteToFile(TFile* pOutFile) const { pOutFile->cd(); for (auto& [pObject, sPath] : (*fpvObjList)) { + //LOG(info) << "Writing object " << pObject->GetName() << " -- " << sPath; if (!pOutFile->GetDirectory(sPath)) { pOutFile->mkdir(sPath); } diff --git a/core/qa/CbmQaManager.h b/core/qa/CbmQaManager.h index 96c0ac0ca58e0a7c5572e1f91189eda189b6779b..7919ad76db08233a8bfb69c863f7b15b946b1420 100644 --- a/core/qa/CbmQaManager.h +++ b/core/qa/CbmQaManager.h @@ -12,6 +12,8 @@ #include "FairTask.h" #include "TString.h" +#include <TFile.h> + #include <map> #include <string> @@ -62,7 +64,15 @@ class CbmQaManager : public FairTask { /// \brief Sets YAML config name void SetConfigName(const TString& name) { fsConfigName = name; } + /// \brief Open cross-check file + /// \param path Path to the cross-check file + /// + /// Opens the cross-check ROOT-file with the QA-chain output, obtained under the default code base. + //void OpenCrossCheckFile(const TString& path); + private: 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) + + //std::shared_ptr<TFile> fpCrossCheckFile = nullptr; ///< A file with default histograms to carry out a cross-check }; diff --git a/core/qa/CbmQaTask.cxx b/core/qa/CbmQaTask.cxx index f545fc93e9908a2db9b193ec481f081658131469..df38af48b2fea93a5c2cac62f2e32423720d1c9c 100644 --- a/core/qa/CbmQaTask.cxx +++ b/core/qa/CbmQaTask.cxx @@ -193,7 +193,7 @@ void CbmQaTask::ReadCheckListFromConfig() 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*])")); + 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)) { diff --git a/macro/mcbm/CMakeLists.txt b/macro/mcbm/CMakeLists.txt index 041afb1adcec104749cc80ea4e06742a1c1ed949..c44bc0fe3c991cac8317352b418fa5dfa70f18f0 100644 --- a/macro/mcbm/CMakeLists.txt +++ b/macro/mcbm/CMakeLists.txt @@ -111,9 +111,10 @@ ForEach(setup IN LISTS cbm_setup) Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/mcbm/mcbm_qa.sh ${NumEvents} \"data/${setup}_test\" \"${setup}\") Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "300" - PASS_REGULAR_EXPRESSION "Test Passed;All ok" + PASS_REGULAR_EXPRESSION "QA checks passed;Test Passed;All ok" FAIL_REGULAR_EXPRESSION "ERROR" FAIL_REGULAR_EXPRESSION "FATAL" + FAIL_REGULAR_EXPRESSION "QA checks failed" FIXTURES_REQUIRED ${fixture_mcbm_digi_tb} FIXTURES_SETUP ${fixture_mcbm_qa_event_mc} ) diff --git a/macro/mcbm/mcbm_qa.C b/macro/mcbm/mcbm_qa.C index 7601e16f3f6ba4105ab26ae1025146623b908c8b..1a4723b9f03163274c47368b36d76c1e6b56c066 100644 --- a/macro/mcbm/mcbm_qa.C +++ b/macro/mcbm/mcbm_qa.C @@ -52,7 +52,7 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", int verbose = 6; // verbose level TString myName = "mcbm_qa"; // this macro's name for screen output TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory - TString qaConfig = (config.Length() ? config : srcDir + "/macro/qa/configs/qa_tasks_config_mcbm.yaml"); + TString qaConfig = (config.Length() ? config : srcDir + "/macro/qa/configs/qa_tasks_config_" + setupName + ".yaml"); // NOTE: SZh 28.07.2024: config can depend from the setup // ------------------------------------------------------------------------ @@ -309,7 +309,7 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", std::cout << "Parameter file is " << parFile << std::endl; std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; std::cout << std::endl; - std::cout << " QA checks " << (qaManager->GetStatus() ? "\e[1;32mpassed" : "\e[1;31mfailed") << "\e[0m\n"; + std::cout << " QA checks " << (qaManager->GetStatus() ? "passed" : "failed") << std::endl; std::cout << " Test passed" << std::endl; std::cout << " All ok " << std::endl; // ------------------------------------------------------------------------ diff --git a/macro/qa/configs/CMakeLists.txt b/macro/qa/configs/CMakeLists.txt index bb215f639a320e6f4bf06492fc0f30d35660f4ab..32d6e46c09cba9ceb372674b70cc0b2276fabfcb 100644 --- a/macro/qa/configs/CMakeLists.txt +++ b/macro/qa/configs/CMakeLists.txt @@ -1,4 +1,6 @@ Install(FILES objects.yaml qa_tasks_config_mcbm.yaml + qa_tasks_config_mcbm_beam_2021_07_surveyed.yaml + qa_tasks_config_mcbm_beam_2022_05_23_nickel.yaml DESTINATION share/cbmroot/macro/qa/configs ) diff --git a/macro/qa/configs/qa_tasks_config_mcbm_beam_2021_07_surveyed.yaml b/macro/qa/configs/qa_tasks_config_mcbm_beam_2021_07_surveyed.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e12dd8c0e4a1d8cb1f6ab871bcc206409e89d3ae --- /dev/null +++ b/macro/qa/configs/qa_tasks_config_mcbm_beam_2021_07_surveyed.yaml @@ -0,0 +1,49 @@ +# Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt +# SPDX-License-Identifier: GPL-3.0-only +# Authors: Sergei Zharko [committer] +# +## @file qa_task_config_mcbm.yaml +## @brief Configuration file for QA-tasks in mCBM +## @since 27.07.2023 +## @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: true + hit_efficiency_station_%d: true + pull_x_station_%d: true + pull_y_station_%d: true + pull_t_station_%d: true + pull_u_%d_digis: false + pull_v_%d_digis: false + CbmCaInputQaTrd: + check_list: + station_position_ordering: true + station_position_hit_delta_z: false + hit_efficiency_station_%d: true + hit_efficiency_station_0: false + hit_efficiency_station_1: false + pull_x_station_%d: true + pull_y_station_%d: true + pull_t_station_%d: false + CbmCaInputQaTof: + check_list: + station_position_ordering: false + 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/macro/qa/configs/qa_tasks_config_mcbm_beam_2022_05_23_nickel.yaml b/macro/qa/configs/qa_tasks_config_mcbm_beam_2022_05_23_nickel.yaml new file mode 100644 index 0000000000000000000000000000000000000000..50f9dc7093e7313b1fbf8aecbbc973eeadfb5d1a --- /dev/null +++ b/macro/qa/configs/qa_tasks_config_mcbm_beam_2022_05_23_nickel.yaml @@ -0,0 +1,72 @@ +# Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt +# SPDX-License-Identifier: GPL-3.0-only +# Authors: Sergei Zharko [committer] +# +## @file qa_task_config_mcbm.yaml +## @brief Configuration file for QA-tasks in mCBM +## @since 27.07.2023 +## @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: + # x: { nbins: 500, min: -20., max: 20. } + # y: { nbins: 500, min: -20., max: 20. } + #xy_station1: + # x: { nbins: 500, min: -100., max: 100. } + # y: { nbins: 500, min: -100., max: 100. } + #xy_station2: + # x: { nbins: 500, min: -100., max: 100. } + # y: { nbins: 500, min: -100., max: 100. } + 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: false + pull_t_station_3: false + +...