Skip to content
Snippets Groups Projects
Commit 264d08ba authored by Sergei Zharko's avatar Sergei Zharko Committed by Sergey Gorbunov
Browse files

QA: mcbm_qa.C -> new regular expressions for the CI test

parent 8ba56b56
No related branches found
No related tags found
1 merge request!1567CI Test based on the QA check-list
Pipeline #26299 failed
......@@ -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);
}
......
......@@ -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
};
......@@ -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)) {
......
......@@ -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}
)
......
......@@ -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;
// ------------------------------------------------------------------------
......
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
)
# 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
...
# 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
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment