From 9f3e7bf8a16619efb683881d3056cbd2cbdf52bf Mon Sep 17 00:00:00 2001 From: "s.zharko@gsi.de" <s.zharko@gsi.de> Date: Thu, 13 Feb 2025 20:12:02 +0100 Subject: [PATCH] fixing the Setup QA --- macro/beamtime/mcbm2024/reco_mcbm.sh | 62 ++++++++++++++++++---------- macro/mcbm/mcbm_qa.C | 2 +- reco/L1/qa/CbmCaInputQaSetup.cxx | 19 +++++++++ reco/L1/qa/CbmCaInputQaSetup.h | 3 ++ 4 files changed, 63 insertions(+), 23 deletions(-) diff --git a/macro/beamtime/mcbm2024/reco_mcbm.sh b/macro/beamtime/mcbm2024/reco_mcbm.sh index c3053f4cd7..f004b131b9 100755 --- a/macro/beamtime/mcbm2024/reco_mcbm.sh +++ b/macro/beamtime/mcbm2024/reco_mcbm.sh @@ -61,6 +61,7 @@ # Options for running on the batch farm: # -j [--job] <jobId> Index of the job (default == 1) # +# --disable-logs Disables storing output in the temporary log files # # 3. File names involved: # <geo>: Input geometry file: <top_dir>/<setup>.geo.root @@ -101,6 +102,7 @@ # Data directory DATA_TOP_DIR='./data' +DISABLE_LOGS=0 # Subsystem flags RECO_MVD=0 @@ -223,6 +225,9 @@ while [[ $# -gt 0 ]]; do --run ) RUN_IF_ONLY_SETUP_NEEDED=${2} ;; + --disable-logs ) + DISABLE_LOGS=1 + ;; esac shift done @@ -485,16 +490,20 @@ if [[ ${DO_RECO} -eq 1 ]]; then if [[ ${MACRO_RECO} == "*.mcbm2024*" ]]; then PARS="${PARS},${RECO_PV}" fi - root -b -l -q ${MACRO_RECO}"(${PARS})" &> ${RECO_LOG} - cat ${RECO_LOG} - if [[ (1 -ne $(grep -c " Test passed" "${RECO_LOG}")) || (1 -ne $(grep -c " All ok " "${RECO_LOG}")) ]]; then - printf "\nReconstruction of %s failed, stopping there\n" "${TSA_INP}" + if [[ ${DISABLE_LOGS} -eq 1 ]]; then + root -b -l -q ${MACRO_RECO}"(${PARS})" + else + root -b -l -q ${MACRO_RECO}"(${PARS})" &> ${RECO_LOG} + cat ${RECO_LOG} + + if [[ (1 -ne $(grep -c " Test passed" "${RECO_LOG}")) || (1 -ne $(grep -c " All ok " "${RECO_LOG}")) ]]; then + printf "\nReconstruction of %s failed, stopping there\n" "${TSA_INP}" + rm ${RECO_LOG} + exit 7 + fi rm ${RECO_LOG} - exit 7 fi - rm ${RECO_LOG} - # ln -s -f "${FILE_LABEL}.digi.root" "${DATA_TOP_DIR}/${FILE_LABEL}.raw.root" # TMP for QA # Commented out as the output of mcbm_event_reco_L1.C is already [...].rec.root # ln -s -f "${FILE_LABEL}.reco.root" "${DATA_TOP_DIR}/${FILE_LABEL}.rec.root" # TMP for QA @@ -526,15 +535,19 @@ if [[ ${DO_QA_MODULE} -eq 1 ]]; then ln -s ${SETUP_GEO_FILE} $(basename ${QA_GEO}) PARS="-1,\"${QA_REC}\",\"${SETUP_NAME}\",kFALSE,${RECO_ALI}" - root -b -l -q ${MACRO_QA_MODULE}"(${PARS})" &> ${RECO_QA_LOG} - cat ${RECO_QA_LOG} - - if [[ (1 -ne $(grep -c " Test passed" "${RECO_QA_LOG}")) || (1 -ne $(grep -c " All ok " "${RECO_QA_LOG}")) ]]; then - printf "\nReco Modules QA for %s failed, stopping there\n" "${TSA_INP}" + if [[ ${DISABLE_LOGS} -eq 1 ]]; then + root -b -l -q ${MACRO_QA_MODULE}"(${PARS})" + else + root -b -l -q ${MACRO_QA_MODULE}"(${PARS})" &> ${RECO_QA_LOG} + cat ${RECO_QA_LOG} + + if [[ (1 -ne $(grep -c " Test passed" "${RECO_QA_LOG}")) || (1 -ne $(grep -c " All ok " "${RECO_QA_LOG}")) ]]; then + printf "\nReco Modules QA for %s failed, stopping there\n" "${TSA_INP}" + rm ${RECO_QA_LOG} + exit 8 + fi rm ${RECO_QA_LOG} - exit 8 fi - rm ${RECO_QA_LOG} fi # ----- Run QA @@ -551,16 +564,21 @@ if [[ ${DO_QA} -eq 1 ]]; then PARS="0,\"\",\"${QA_RAW}\",\"${QA_REC}\",\"${QA_PAR}\",\"${QA_GEO}\",\"${QA_OUT}\",\"${SETUP_NAME}\"" PARS="${PARS},${USE_MC},\"${CONFIG}\",\"${BENCHMARK}\",${RECO_ALI}" - root -b -l -q ${MACRO_QA}"(${PARS})" &> ${QA_LOG} - cat ${QA_LOG} - - if [[ (1 -eq $(grep -c " QA checks failed" "${QA_LOG}")) || (1 -ne $(grep -c " Test passed" "${QA_LOG}")) - || (1 -ne $(grep -c " All ok " "${QA_LOG}")) ]]; then - printf "\nFull QA for %s failed, stopping there\n" "${TSA_INP}" + + if [[ ${DISABLE_LOGS} -eq 1 ]]; then + root -b -l -q ${MACRO_QA}"(${PARS})" + else + root -b -l -q ${MACRO_QA}"(${PARS})" &> ${QA_LOG} + cat ${QA_LOG} + + if [[ (1 -eq $(grep -c " QA checks failed" "${QA_LOG}")) || (1 -ne $(grep -c " Test passed" "${QA_LOG}")) + || (1 -ne $(grep -c " All ok " "${QA_LOG}")) ]]; then + printf "\nFull QA for %s failed, stopping there\n" "${TSA_INP}" + rm ${QA_LOG} + exit 9 + fi rm ${QA_LOG} - exit 9 fi - rm ${QA_LOG} fi # ----- Run Lambda reconstuction using the KFParticleFinder diff --git a/macro/mcbm/mcbm_qa.C b/macro/mcbm/mcbm_qa.C index 5310cba1e0..3025d5783c 100644 --- a/macro/mcbm/mcbm_qa.C +++ b/macro/mcbm/mcbm_qa.C @@ -227,7 +227,7 @@ void mcbm_qa(Int_t nEvents = 0, run->SetSink(sink); TString monitorFile{sinkFile}; - monitorFile.ReplaceAll("qa", "qa.monitor"); + monitorFile.ReplaceAll(".qa.root", ".qa.monitor.root"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ diff --git a/reco/L1/qa/CbmCaInputQaSetup.cxx b/reco/L1/qa/CbmCaInputQaSetup.cxx index 5ef74c3bb8..ceaa683a71 100644 --- a/reco/L1/qa/CbmCaInputQaSetup.cxx +++ b/reco/L1/qa/CbmCaInputQaSetup.cxx @@ -13,6 +13,7 @@ #include "CbmL1DetectorID.h" #include "CbmMCDataManager.h" #include "FairRootManager.h" +#include "CbmSetup.h" #include "TAxis.h" #include <Logger.h> @@ -49,6 +50,23 @@ void InputQaSetup::CheckInit() const } } +// --------------------------------------------------------------------------------------------------------------------- +// +void InputQaSetup::CheckoutDetectors() +{ + auto CheckDetector = [&] (ca::EDetectorID detID) { + if (CbmSetup::Instance()->IsActive(ToCbmModuleId(detID))) { + fvbUseDet[detID] = true; + } + L_(info) << fName << ": " << ToString(ToCbmModuleId(detID)) << " " << fvbUseDet[detID]; + }; + CheckDetector(ca::EDetectorID::kMvd); + CheckDetector(ca::EDetectorID::kSts); + CheckDetector(ca::EDetectorID::kMuch); + CheckDetector(ca::EDetectorID::kTrd); + CheckDetector(ca::EDetectorID::kTof); +} + // --------------------------------------------------------------------------------------------------------------------- // void InputQaSetup::CreateSummary() @@ -252,6 +270,7 @@ void InputQaSetup::ExecQa() InitStatus InputQaSetup::InitQa() try { LOG(info) << fName << ": initializing... "; + CheckoutDetectors(); // Tracking parameters fpParameters = cbm::ca::ParametersHandler::Instance()->Get(fsParametersFilename); diff --git a/reco/L1/qa/CbmCaInputQaSetup.h b/reco/L1/qa/CbmCaInputQaSetup.h index 3cf3ad887a..2196339f45 100644 --- a/reco/L1/qa/CbmCaInputQaSetup.h +++ b/reco/L1/qa/CbmCaInputQaSetup.h @@ -64,6 +64,9 @@ namespace cbm::ca private: + /// \brief Check out initialized detectors + void CheckoutDetectors(); + /// \brief Checks branches initialization void CheckInit() const; -- GitLab