diff --git a/core/qa/checker/CbmQaCheckerCore.cxx b/core/qa/checker/CbmQaCheckerCore.cxx index 7164d12ad61c606f673e491448d2ed9c56cd53b4..7af9029e32e207fe5b7609cf1d5fe09f46d3bb02 100644 --- a/core/qa/checker/CbmQaCheckerCore.cxx +++ b/core/qa/checker/CbmQaCheckerCore.cxx @@ -60,6 +60,7 @@ void Core::Process(Option_t* opt) int nDatasets = fpObjDB->GetNofDatasets(); std::vector<TFolder*> vDSFolders(nDatasets, nullptr); + for (int iDS = 0; iDS < nDatasets; ++iDS) { // Create a new folder for dataset (/dataset) auto* pDSDir = fpOutFile->mkdir(fpObjDB->GetDataset(iDS).data()); @@ -105,4 +106,4 @@ bool Core::Scan() const LOG(info) << "Core: Scanning comparison result ... done"; return res; -} \ No newline at end of file +} diff --git a/core/qa/checker/CbmQaCheckerCore.h b/core/qa/checker/CbmQaCheckerCore.h index e096eb610475808df194e406d1932a543de723f3..e44233d276d7e6326da4e3656ee7cabb8fc73220 100644 --- a/core/qa/checker/CbmQaCheckerCore.h +++ b/core/qa/checker/CbmQaCheckerCore.h @@ -84,8 +84,7 @@ namespace cbm::qa::checker /// @brief Sets default version label /// @param defaultLabel Name of default label /// - /// If the default version is not provided as well as the provided, the first version will be used as the - /// default one. + /// If the default version is not provided, the first version will be used as the default one. void SetDefaultVersion(const char* defaultLabel) { fpObjDB->SetDefaultLabel(defaultLabel); } /// @brief Sets checker configuration from YAML file @@ -104,4 +103,4 @@ namespace cbm::qa::checker }; } // namespace cbm::qa::checker -#endif // CbmQaCheckerCore_h \ No newline at end of file +#endif // CbmQaCheckerCore_h diff --git a/core/qa/checker/CbmQaCheckerObjectDB.cxx b/core/qa/checker/CbmQaCheckerObjectDB.cxx index 8625f2b7915efd2e1bbfd9298307ccdf8449dc07..99e03d9430e7337a2769ed3e5f23ab1615082e40 100644 --- a/core/qa/checker/CbmQaCheckerObjectDB.cxx +++ b/core/qa/checker/CbmQaCheckerObjectDB.cxx @@ -73,7 +73,7 @@ void ObjectDB::Init() { // ----- Check consistency of input values LOG_IF(fatal, !GetNofObjects()) << "ObjectDB: No objects were passed to the checker"; - LOG_IF(fatal, GetNofDatasets() < 1) << "ObjectDB: No datasets were founde, at least one dataset should be provided"; + LOG_IF(fatal, GetNofDatasets() < 1) << "ObjectDB: No datasets were found, at least one dataset should be provided"; LOG_IF(fatal, GetNofVersions() < 2) << "ObjectDB: File handler should have at least two versions to compare (" << GetNofVersions() << " were provided)"; @@ -96,6 +96,7 @@ void ObjectDB::Init() LOG(warn) << "ObjectDB: default version was not registered. Using the first version as the default one (\"" << fvVersionLabels[fDefVersionID] << "\")"; } + LOG(info) << this->ToString(); // ----- Reserve space for object comparison results fvCmpResults.resize(fvVersionLabels.size() * fvObjects.size() * fvDatasets.size()); @@ -117,7 +118,7 @@ void ObjectDB::ReadFromYAML(const char* configName) try { config = YAML::LoadFile(configName)["checker"]; } - catch (const YAML::BadFile* exc) { + catch (const YAML::BadFile& exc) { LOG(fatal) << "ObjectDB: configuration file " << configName << " does not exist"; } catch (const YAML::ParserException& exc) { @@ -168,10 +169,9 @@ void ObjectDB::ReadFromYAML(const char* configName) // ----- Define dataset names if (config["datasets"]) { - if (fvDatasets.size()) { - LOG(warn) << "ObjectDB: dataset names were defined before. Redefining them from the config " << configName; - fvDatasets.clear(); - } + LOG_IF(fatal, fvDatasets.size()) + << "ObjectDB: dataset names were defined before. Please, use only one initialisation method:" + << " either configuration file, either setters from macro"; try { const auto& rootNode = config["datasets"]; fvDatasets.reserve(rootNode.size()); @@ -184,16 +184,13 @@ void ObjectDB::ReadFromYAML(const char* configName) } } else { - LOG(warn) << "ObjectDB: node checker/inputformat is not defined in the config " << configName; + LOG(warn) << "ObjectDB: node checker/datasets is not defined in the config " << configName; } // ----- Define version names if (config["versions"]) { - if (fvVersionLabels.size()) { - LOG(warn) << "ObjectDB: dataset names were defined before. Redefining them from the config " << configName; - fvVersionLabels.clear(); - fvVersionPaths.clear(); - } + LOG_IF(fatal, fvVersionLabels.size()) + << "ObjectDB: dataset names were defined before. Attempt to redefine dataset names from config " << configName; try { const auto& rootNode = config["versions"]; fvVersionLabels.reserve(rootNode.size()); diff --git a/core/qa/checker/CbmQaCheckerObjectHandler.cxx b/core/qa/checker/CbmQaCheckerObjectHandler.cxx index 7ed93e87b9fe342c4f88bf5e2504aa17200b2f3b..ae1f545e411db3af79e846d1eccf0ae8be2094e9 100644 --- a/core/qa/checker/CbmQaCheckerObjectHandler.cxx +++ b/core/qa/checker/CbmQaCheckerObjectHandler.cxx @@ -85,4 +85,4 @@ void ObjectHandler::Write() pObj->Write(); } if (fpCanvas.get()) { fpCanvas->Write(); } -} \ No newline at end of file +} diff --git a/core/qa/checker/CbmQaCheckerObjectHandler.h b/core/qa/checker/CbmQaCheckerObjectHandler.h index 1ad5fd824caf2aa42db1deb3f40eb6a27c66eb54..991ce354ff2e81c5f2f3283ced6ed5dc135484cd 100644 --- a/core/qa/checker/CbmQaCheckerObjectHandler.h +++ b/core/qa/checker/CbmQaCheckerObjectHandler.h @@ -99,4 +99,4 @@ namespace cbm::qa::checker }; } // namespace cbm::qa::checker -#endif // CbmQaCheckerObjectHandler_h \ No newline at end of file +#endif // CbmQaCheckerObjectHandler_h diff --git a/core/qa/checker/CbmQaCheckerTypedefs.h b/core/qa/checker/CbmQaCheckerTypedefs.h index a74da874ca66f511b1ab9019a3f9ffce58aae4a9..97b7e879d62b9a3aa51f38c490cd14f59b8455ba 100644 --- a/core/qa/checker/CbmQaCheckerTypedefs.h +++ b/core/qa/checker/CbmQaCheckerTypedefs.h @@ -41,4 +41,4 @@ namespace cbm::qa::checker } // namespace cbm::qa::checker -#endif // CbmQaCheckerTypedefs_h \ No newline at end of file +#endif // CbmQaCheckerTypedefs_h diff --git a/macro/CMakeLists.txt b/macro/CMakeLists.txt index 7896b53ef7c42933b351ebfcc35c1d2d4ddd71f1..4cb8c24a7306bf427b6bb110ffab94b4e4a49d8f 100644 --- a/macro/CMakeLists.txt +++ b/macro/CMakeLists.txt @@ -1,5 +1,6 @@ #--- Tests for continuous builds add_subdirectory(run) +add_subdirectory(qa) add_subdirectory(mcbm) add_subdirectory(mvd) add_subdirectory(much) diff --git a/macro/qa/CMakeLists.txt b/macro/qa/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..ae6a55dd28fde42aab6dd3127473db54fe55d665 --- /dev/null +++ b/macro/qa/CMakeLists.txt @@ -0,0 +1,98 @@ +# ===== Generate the needed shell scripts ================================ +GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/qa/qa_compare.C) + +Set(MACRO_DIR ${CMAKE_CURRENT_BINARY_DIR}) +# ============================================================================ + + +# ===== Copy the .rootrc file into the directory from which root is executed +# --- Otherwise the rootalias file is not loade +file(COPY ${CBMROOT_SOURCE_DIR}/macro/include/.rootrc + DESTINATION ${CBMROOT_BINARY_DIR}/macro/qa) +# ============================================================================ + +# Copy file-object map +file(COPY ${CBMROOT_SOURCE_DIR}/macro/qa/objects.yaml + DESTINATION ${CBMROOT_BINARY_DIR}/macro/qa) + +# ===== Define variables for tests ======================================= +if(${CBM_TEST_MODEL} MATCHES Weekly) + Set(nEvents 100) + Set(uploadHistJPG 1) + Set(pullDevAllowed .2) + Set(randomSeed 1) +else() + Set(nEvents 3) + Set(uploadHistJPG 0) + Set(pullDevAllowed .5) + Set(randomSeed 1) +endIf() + +math(EXPR timeOutTime "10000") +math(EXPR nBeam "${nEvents} * 3") +# ============================================================================ + + +# ===== Define the different setups to be tested with ==================== +if(NOT ${CBM_TEST_MODEL} MATCHES Experimental ) + List(APPEND cbm_setup + sis100_hadron + sis100_electron + sis100_muon_lmvm + sis100_muon_jpsi + sis300_electron + ) +else() + List(APPEND cbm_setup sis100_electron sis100_muon_jpsi) +endif() +# ============================================================================ + + +# ===== Cleanup the data directory ======================================= +add_test(run_cleanup ${CMAKE_COMMAND} + -P ${CMAKE_SOURCE_DIR}/cmake/scripts/cleanmacrodir.cmake) +set_tests_properties(run_cleanup PROPERTIES + TIMEOUT ${timeOutTime} + FIXTURES_SETUP run_cleanup +) +# ============================================================================ + + +# ===== Define tests for each setup ====================================== +foreach(setup IN LISTS cbm_setup) + + # --- Short name for setup + if(setup MATCHES sis100_hadron) + set(sname s100h) + elseif(setup MATCHES sis100_electron) + set(sname s100e) + elseif(setup MATCHES sis100_muon_lmvm) + set(sname s100m2) + elseif(setup MATCHES sis100_muon_jpsi) + set(sname s100m3) + elseif(setup MATCHES sis300_electron) + set(sname s300e) + else() + set(sname test) + endif() + + # --- Test run_qa + # --- Run QA tasks with Event-by-event reconstruction from time-based simulation + # --- Real raw event builder + set(testname qa_${sname}_compare) + add_test(${testname} ${MACRODIR}/qa_compare.sh \"objects.yaml\" \"${sname}\" \"../run/data\" \"../run/data/\" \"data/QACheckerOutput.${sname}.root\" ) + set_tests_properties(${testname} PROPERTIES + TIMEOUT ${timeOutTime} + FAIL_REGULAR_EXPRESSION "segmentation violation" + PASS_REGULAR_EXPRESSION "Macro finished successfully" + FIXTURES_REQUIRED "fixt_qa_${setup}" + FIXTURES_SETUP fixt_qa_compare_${setup} + ) + +endforeach(setup IN LISTS cbm_setup) +# ============================================================================ + +Install(FILES ../run/.rootrc qa_compare.C objects.yaml + DESTINATION share/cbmroot/macro/qa + ) +#Install(CODE "FILE(MAKE_DIRECTORY \${CMAKE_INSTALL_PREFIX}/share/cbmroot/macro/run/data)") diff --git a/macro/qa/objects.yaml b/macro/qa/objects.yaml index 90aa199fe5d66395bedb8a15e88446c057047d9d..fe4d1e6aa700dcea692a74f56a5449503e5ad6fb 100644 --- a/macro/qa/objects.yaml +++ b/macro/qa/objects.yaml @@ -1,19 +1,16 @@ -# List of objects from QA output to be checked +################################################## +# # +# File-object map for the QA-Checker framework # +# # +################################################## + checker: - # Format of the input file. In the format the next indicators can be used: - # - %v : Path to directory for this version - # - %f : File type - # - %d : Dataset name - inputformat: "%v/%f_%d.root" - # Datasets (at the moment all the datasets should contain the same sets of files and objects to compare) - datasets: - - auau.10gev.mbias.mu.eb.100ev.reco - - auau.10gev.mbias.el.eb.100ev.reco - # Section defines a list of files and stored objects to be compared. If object list is empty, - # all of the histograms will be compared files: - - name: L1_histo + - name: "%v/%d_qa.qa.root" + label: qa objects: - - L1/p_eff_all_vs_mom - - L1/h_ghost_Rmom + - CbmCaInputQaSts/efficiencies/casts_reco_eff_vs_r_st0 + - CbmCaInputQaSts/efficiencies/casts_reco_eff_vs_xy_st0 + - CbmCaInputQaSts/histograms/casts_pull_t_st2 + - CbmCaInputQaSts/histograms/casts_res_x_vs_x_st2 diff --git a/macro/qa/qa_compare.C b/macro/qa/qa_compare.C index 434681ada84c1240025e9da028971d9cbd6d3162..80065154957743e430b4f763247dcff6a801b23b 100644 --- a/macro/qa/qa_compare.C +++ b/macro/qa/qa_compare.C @@ -5,34 +5,55 @@ /// @file qa_compare.C /// @author Sergei Zharko <s.zharko@gsi.de> /// @since 06.02.2023 -/// @brief ROOT macro to run QA-Checker framework +/// @brief ROOT macro to run QA-Checker framework comparison of the old and new ROOT-file versions. -/// @brief Function to compare QA results -/// @param configName Name of configuration file with object list, datasets and versions -/// @param inputRootDir Root directory with input data -/// @param outputName Name of the output (default is "QaCheckerResult.root") +/// @brief Function to compare two different versions of ROOT-files +/// @param configName Name of config containing file-object map +/// @param datasetName Name of the dataset, represented with a particular setup +/// @param oldVersionInputDir Input directory for old version of files +/// @param newVersionInputDir Input directory for new version of files +/// @param outputName Name of the QA-Checker output (default is "QaCheckerResult.root") /// @return Result flag: -/// - 0: all objects are the same within defined comparison procedure -/// - 1: some of the objects differ within versions -int qa_compare(const char* configName, const char* inputRootDir = ".", const char* outputName = "QaCheckerResult.root") +/// - 0: all objects are the same within defined comparison procedure (point-by-point for now) +/// - 1: some of the objects differ + + +/// NOTE: Disable clang formatting to keep easy parameters overview +/* clang-format off */ +int qa_compare( + const char* configName = "objects.yaml", + const char* datasetName = "s100e", + const char* oldVersionInputDir = "../run/data", // NOTE: Files from external repository + const char* newVersionInputDir = "../run/data", // NOTE: Files from preceding fixture + const char* outputName = "QACheckerOutput.h" // TODO: Add tag of a merge request or commit + ) +/* clang-format on */ { // ----- Logger settings FairLogger::GetLogger()->SetLogScreenLevel("INFO"); FairLogger::GetLogger()->SetColoredLog(true); - // ----- Style settings + //// ----- Style settings gStyle->SetPalette(kSolar); - // ----- Configure QA-Checker + //// ----- Configure QA-Checker auto pQaChecker = std::make_unique<cbm::qa::checker::Core>(); pQaChecker->RegisterOutFile(outputName); // Set name of the output file pQaChecker->SetFromYAML(configName); // Read file-object map - pQaChecker->SetInputRootPath(inputRootDir); - // ----- Run comparision routine + // Add dataset + pQaChecker->AddDataset(datasetName); + + // Add versions + pQaChecker->AddVersion("old", oldVersionInputDir); + pQaChecker->AddVersion("new", newVersionInputDir); + pQaChecker->SetDefaultVersion("old"); + + //// ----- Run comparision routine pQaChecker->Process("P"); - // ----- Scan results - bool res = pQaChecker->Scan(); + //// ----- Scan results + bool res = pQaChecker->Scan(); // true - objects are the same, false - objects differ + std::cout << "Macro finished successfully." << std::endl; return !res; } diff --git a/macro/qa/test_qa.C b/macro/qa/test_qa.C deleted file mode 100644 index ec44c73965903abc68d302e922580128acd48b9b..0000000000000000000000000000000000000000 --- a/macro/qa/test_qa.C +++ /dev/null @@ -1,306 +0,0 @@ -/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt - SPDX-License-Identifier: GPL-3.0-only - Authors: Sergey Gorbunov, Denis Bertini [committer], Florian Uhlig */ - -// -------------------------------------------------------------------------- -// -// Macro for simulation & reconstruction QA -// -// The following naming conventions are assumed: -// Raw data file: [dataset].event.raw.root -// Transport file: [dataset].tra.root -// Parameter file: [dataset].par.root -// Reconstruction file: [dataset].rec.root -// -// S. Gorbunov 28/09/2020 -// -// -------------------------------------------------------------------------- - -// Includes needed for IDE -#if !defined(__CLING__) -#include "CbmDefs.h" -#include "CbmMCDataManager.h" -#include "CbmMuchDigitizerQa.h" -#include "CbmMuchHitFinderQa.h" -#include "CbmMuchTransportQa.h" -#include "CbmSetup.h" - -#include <FairFileSource.h> -#include <FairMonitor.h> -#include <FairParAsciiFileIo.h> -#include <FairParRootFileIo.h> -#include <FairRootFileSink.h> -#include <FairRunAna.h> -#include <FairRuntimeDb.h> -#include <FairSystemInfo.h> - -#include <TStopwatch.h> -#endif - -// TODO: split into functions for reco, digitization and transport QAs -void test_qa(TString dataTra = "data/sis100_muon_jpsi_test", TString dataRaw = "data/sis100_muon_jpsi_test", - TString dataReco = "data/sis100_muon_jpsi_test", TString dataPar = "data/sis100_muon_jpsi_test", - TString dataSink = "data/sis100_muon_jpsi_test", TString setup = "sis100_muon_jpsi", Int_t nEvents = -1, - TString dataTra2 = "", TString dataTra3 = "") -{ - - gROOT->SetBatch(kTRUE); - - // ======================================================================== - // Adjust this part according to your requirements - - // ----- Logger settings ---------------------------------------------- - FairLogger::GetLogger()->SetLogScreenLevel("INFO"); - fair::Logger::DefineVerbosity( - "user1", fair::VerbositySpec::Make(fair::VerbositySpec::Info::severity, fair::VerbositySpec::Info::file_line)); - FairLogger::GetLogger()->SetLogVerbosityLevel("user1"); - FairLogger::GetLogger()->SetColoredLog(true); - // ------------------------------------------------------------------------ - - // ----- Environment -------------------------------------------------- - int verbose = 100; - bool bUseMC = true; - TString myName = "run_qa"; // this macro's name for screen output - TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory - // ------------------------------------------------------------------------ - - // ----- In- and output file names ------------------------------------ - TString traFile = dataTra + ".tra.root"; - TString tra2File = dataTra2 + ".tra.root"; - TString tra3File = dataTra3 + ".tra.root"; - TString rawFile = dataRaw + ".raw.root"; - TString parFile = dataPar + ".par.root"; - TString recFile = dataReco + ".reco.root"; - TString sinkFile = dataSink + ".qa.root"; - // ------------------------------------------------------------------------ - - // ----- Load the geometry setup ------------------------------------- - std::cout << std::endl; - std::cout << "-I- " << myName << ": Loading setup " << setup << std::endl; - CbmSetup::Instance()->LoadSetup(setup); - // You can modify the pre-defined setup by using - // CbmSetup::Instance()->RemoveModule(ESystemId) or - // CbmSetup::Instance()->SetModule(ESystemId, const char*, Bool_t) or - // CbmSetup::Instance()->SetActive(ESystemId, Bool_t) - // See the class documentation of CbmSetup. - // ------------------------------------------------------------------------ - - // ----- Parameter files as input to the runtime database ------------- - std::cout << std::endl; - std::cout << "-I- " << myName << ": Defining parameter files " << std::endl; - TList* parFileList = new TList(); - TString geoTag; - - // - MUCH digitisation parameters - TString muchParFile {}; - if (CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kMuch, geoTag)) { - bool mcbmFlag = geoTag.Contains("mcbm", TString::kIgnoreCase); - muchParFile = srcDir + "/parameters/much/much_"; - muchParFile += (mcbmFlag) ? geoTag : geoTag(0, 4); - muchParFile += "_digi_sector.root"; - { // init geometry from the file - TFile* f = new TFile(muchParFile, "R"); - TObjArray* stations = (TObjArray*) f->Get("stations"); - CbmMuchGeoScheme::Instance()->Init(stations, mcbmFlag); - } - } - - // - TRD digitisation parameters - if (CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kTrd, geoTag)) { - const Char_t* npar[4] = {"asic", "digi", "gas", "gain"}; - TObjString* trdParFile(NULL); - for (Int_t i(0); i < 4; i++) { - trdParFile = new TObjString(srcDir + "/parameters/trd/trd_" + geoTag + "." + npar[i] + ".par"); - parFileList->Add(trdParFile); - std::cout << "-I- " << myName << ": Using parameter file " << trdParFile->GetString() << std::endl; - } - } - - // - TOF digitisation parameters - if (CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kTof, geoTag)) { - TObjString* tofBdfFile = new TObjString(srcDir + "/parameters/tof/tof_" + geoTag + ".digibdf.par"); - parFileList->Add(tofBdfFile); - std::cout << "-I- " << myName << ": Using parameter file " << tofBdfFile->GetString() << std::endl; - } - // ------------------------------------------------------------------------ - - // In general, the following parts need not be touched - // ======================================================================== - - // ----- Timer -------------------------------------------------------- - TStopwatch timer; - timer.Start(); - // ------------------------------------------------------------------------ - - // ---- Debug option ------------------------------------------------- - gDebug = 0; - // ------------------------------------------------------------------------ - - // ----- FairRunAna --------------------------------------------------- - FairFileSource* inputSource = new FairFileSource(rawFile); - inputSource->AddFriend(traFile); - inputSource->AddFriend(recFile); - if (!dataTra2.IsNull()) inputSource->AddFriend(tra2File); - if (!dataTra3.IsNull()) inputSource->AddFriend(tra3File); - - FairRunAna* run = new FairRunAna(); - run->SetSource(inputSource); - run->SetGenerateRunInfo(kFALSE); - - FairRootFileSink* sink = new FairRootFileSink(sinkFile); - run->SetSink(sink); - - TString monitorFile {sinkFile}; - monitorFile.ReplaceAll("qa", "qa.monitor"); - FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); - // ------------------------------------------------------------------------ - - // ----- MCDataManager ----------------------------------- - if (bUseMC) { - CbmMCDataManager* mcManager = new CbmMCDataManager("MCDataManager", 0); - mcManager->AddFile(traFile); - if (!dataTra2.IsNull()) mcManager->AddFile(tra2File); - if (!dataTra3.IsNull()) mcManager->AddFile(tra3File); - - run->AddTask(mcManager); - } - // ------------------------------------------------------------------------ - - - // ----- Match reco to MC ------ - if (bUseMC) { - CbmMatchRecoToMC* matchTask = new CbmMatchRecoToMC(); - run->AddTask(matchTask); - } - - // ----- Geometry interface initializer for tracking - run->AddTask(new CbmTrackingDetectorInterfaceInit()); - - - // ******************************* - // ** Detector QA tasks ** - // ******************************* - - // ----- MUCH QA --------------------------------- - if (CbmSetup::Instance()->IsActive(ECbmModuleId::kMuch)) { - run->AddTask(new CbmMuchTransportQa()); - run->AddTask(new CbmMuchDigitizerQa()); - CbmMuchHitFinderQa* muchHitFinderQa = new CbmMuchHitFinderQa(); - muchHitFinderQa->SetGeoFileName(muchParFile); - run->AddTask(muchHitFinderQa); - - auto* pInputQaMuch = new CbmCaInputQaMuch(verbose, bUseMC); - pInputQaMuch->SetEfficiencyThrsh(0.5, 0, 100); - run->AddTask(new CbmCaInputQaMuch(verbose, bUseMC)); - } - - // ----- TRD QA --------------------------------- - if (CbmSetup::Instance()->IsActive(ECbmModuleId::kTrd)) { - run->AddTask(new CbmTrdMCQa()); - //run->AddTask(new CbmTrdHitRateQa()); //opens lots of windows - //run->AddTask(new CbmTrdDigitizerPRFQa()); //works put currently doesn't do anything - //run->AddTask(new CbmTrdHitRateFastQa()); //opens lots of windows - run->AddTask(new CbmTrdHitProducerQa()); - run->AddTask(new CbmTrdCalibTracker()); - run->AddTask(new CbmTrackerInputQaTrd()); // Tracker requirements to TRD - - auto* pInputQaTrd = new CbmCaInputQaTrd(verbose, bUseMC); - pInputQaTrd->SetEfficiencyThrsh(0.5, 0, 100); // Integration over the whole range - run->AddTask(new CbmCaInputQaTrd(verbose, bUseMC)); // Tracker requirements to TRD - } - // ------------------------------------------------------------------------ - - // ----- TOF QA --------------------------------- - if (CbmSetup::Instance()->IsActive(ECbmModuleId::kTof)) { - // TODO: SZh 19.10.2022: - // After the proper TOF digi parameters initialization it is appeared, - // that CbmTrackerInputQaTof causes segmentation violation in - // CbmTrackerInputQaTof::ResolutionQa() for the event-based running - // (before the branch with the related code inside the task was never - // executed). Temporarily commented that task, till the bug would not be - // resolved. - - //run->AddTask(new CbmTrackerInputQaTof()); // Tracker requirements to TRD - - auto* pInputQaTof = new CbmCaInputQaTof(verbose, bUseMC); - pInputQaTof->SetEfficiencyThrsh(0.5, 0, 100); - run->AddTask(new CbmCaInputQaTof(verbose, bUseMC)); - } - // ------------------------------------------------------------------------ - - // ----- STS QA --------------------------------- - if (CbmSetup::Instance()->IsActive(ECbmModuleId::kSts)) { - //run->AddTask(new CbmStsDigitizeQa()); //opens lots of windows - run->AddTask(new CbmStsFindTracksQa()); - - auto* pInputQaSts = new CbmCaInputQaSts(verbose, bUseMC); - run->AddTask(pInputQaSts); - } - // ------------------------------------------------------------------------ - - // ----- Event builder QA --------------------------------- - CbmBuildEventsQa* evBuildQA = new CbmBuildEventsQa(); - run->AddTask(evBuildQA); - // ------------------------------------------------------------------------ - - // ----- Parameter database -------------------------------------------- - std::cout << std::endl << std::endl; - std::cout << "-I- " << myName << ": Set runtime DB" << std::endl; - FairRuntimeDb* rtdb = run->GetRuntimeDb(); - FairParRootFileIo* parIo1 = new FairParRootFileIo(); - parIo1->open(parFile.Data(), "in"); - rtdb->setFirstInput(parIo1); - if (!parFileList->IsEmpty()) { - FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); - parIo2->open(parFileList, "in"); - rtdb->setSecondInput(parIo2); - } - rtdb->print(); - // ------------------------------------------------------------------------ - - // ----- Run initialisation ------------------------------------------- - std::cout << std::endl; - std::cout << "-I- " << myName << ": Initialise run" << std::endl; - run->Init(); - - // ----- Start run ---------------------------------------------------- - std::cout << std::endl << std::endl; - std::cout << "-I- " << myName << ": Starting run" << std::endl; - run->Run(0, nEvents); - // ------------------------------------------------------------------------ - - // ----- Finish ------------------------------------------------------- - timer.Stop(); - - FairMonitor::GetMonitor()->Print(); - Double_t rtime = timer.RealTime(); - Double_t ctime = timer.CpuTime(); - std::cout << std::endl << std::endl; - std::cout << "Macro finished successfully." << std::endl; - std::cout << "Output file is " << sinkFile << std::endl; - 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 << " Test passed" << std::endl; - std::cout << " All ok " << std::endl; - // ------------------------------------------------------------------------ - - // ----- Resource monitoring ------------------------------------------ - // Extract the maximal used memory an add is as Dart measurement - // This line is filtered by CTest and the value send to CDash - FairSystemInfo sysInfo; - Float_t maxMemory = sysInfo.GetMaxMemory(); - std::cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; - std::cout << maxMemory; - std::cout << "</DartMeasurement>" << std::endl; - - Float_t cpuUsage = ctime / rtime; - std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; - std::cout << cpuUsage; - std::cout << "</DartMeasurement>" << std::endl; - // ------------------------------------------------------------------------ - - // ----- Function needed for CTest runtime dependency ----------------- - RemoveGeoManager(); - // ------------------------------------------------------------------------ -}