diff --git a/core/qa/checker/CbmQaCheckerCore.cxx b/core/qa/checker/CbmQaCheckerCore.cxx index 7af9029e32e207fe5b7609cf1d5fe09f46d3bb02..17eff8f3a4b2adef80ae699fbcce3138e5fd075c 100644 --- a/core/qa/checker/CbmQaCheckerCore.cxx +++ b/core/qa/checker/CbmQaCheckerCore.cxx @@ -14,12 +14,11 @@ #include "Logger.h" #include "TClonesArray.h" +#include "TFile.h" #include "TFolder.h" //#include <boost/filesystem.hpp> #include <regex> -#include <yaml-cpp/yaml.h> - using cbm::qa::checker::Core; // --------------------------------------------------------------------------------------------------------------------- diff --git a/core/qa/checker/CbmQaCheckerCore.h b/core/qa/checker/CbmQaCheckerCore.h index e44233d276d7e6326da4e3656ee7cabb8fc73220..bb7c73981b96b3e3e0a217c568b5cef64e4b79d3 100644 --- a/core/qa/checker/CbmQaCheckerCore.h +++ b/core/qa/checker/CbmQaCheckerCore.h @@ -13,14 +13,14 @@ #include "CbmQaCheckerObjectDB.h" #include "CbmQaCheckerTypedefs.h" -#include "TFile.h" +#include "Rtypes.h" -#include <bitset> #include <memory> #include <string> -#include <unordered_map> #include <vector> +class TFile; + namespace cbm::qa::checker { /// @brief Core class for CBM QA checker framework (declaration) diff --git a/core/qa/checker/CbmQaCheckerFileHandler.cxx b/core/qa/checker/CbmQaCheckerFileHandler.cxx index a28a8c99f1b6011f6495b1303d5ba81e330077f9..75c8d0cd97d7f53b899f36399bf06970fb27f178 100644 --- a/core/qa/checker/CbmQaCheckerFileHandler.cxx +++ b/core/qa/checker/CbmQaCheckerFileHandler.cxx @@ -173,11 +173,12 @@ TNamed* FileHandler::ReadObjectFromFile(TFile* pFile, const std::string& path) c TObject* pObj = pFile; size_t iPos = 0; // Index of first symbol size_t iNext = 0; // Index of last symbol + // Read object iteratively, running throug directories or folders, provided by path while (iPos < path.size()) { // get name iNext = path.find_first_of('/', iPos); if (iNext > path.size()) { iNext = path.size(); } - std::string part = path.substr(iPos, iNext - iPos); + std::string part = path.substr(iPos, iNext - iPos); // short name of next object/directory/folder in the path iPos = iNext + 1; if (!part.size()) { continue; } diff --git a/core/qa/checker/CbmQaCheckerFileHandler.h b/core/qa/checker/CbmQaCheckerFileHandler.h index 0557ad3206d13231a301f98b83ab0753fc2e32bb..7f5e0ce862a371b2999131c11045f4903ddf40a5 100644 --- a/core/qa/checker/CbmQaCheckerFileHandler.h +++ b/core/qa/checker/CbmQaCheckerFileHandler.h @@ -19,7 +19,7 @@ #include <vector> class TNamed; -class TFolder; +class TDirectory; class TFile; namespace cbm::qa::checker @@ -72,7 +72,7 @@ namespace cbm::qa::checker /// @return Pointer to created TDirectory object TDirectory* CreateNestedDirectory(const std::string& path); - /// @brief Reads object from file by the provided full path to the object. + /// @brief Iteratively reads object from file by the provided full path to the object /// @param pFile Pointer to TFile instance /// @param path Full path to the object inside the file /// @return A pointer to TNamed object diff --git a/core/qa/checker/CbmQaCheckerObjectDB.cxx b/core/qa/checker/CbmQaCheckerObjectDB.cxx index 99e03d9430e7337a2769ed3e5f23ab1615082e40..582c06ab679ea66e3e592569573d6f20a38100a0 100644 --- a/core/qa/checker/CbmQaCheckerObjectDB.cxx +++ b/core/qa/checker/CbmQaCheckerObjectDB.cxx @@ -15,6 +15,8 @@ #include <regex> #include <sstream> +#include <yaml-cpp/yaml.h> + using cbm::qa::checker::ObjectDB; // --------------------------------------------------------------------------------------------------------------------- @@ -224,7 +226,7 @@ void ObjectDB::ReadFromYAML(const char* configName) std::string ObjectDB::ToString() const { std::stringstream msg; - msg << "*** CBM QA-Checker: defied files ****\n\n"; + msg << "*** CBM QA-Checker: defined files ****\n\n"; msg << "----- Versions:\n"; for (size_t iV = 0; iV < fvVersionLabels.size(); ++iV) { diff --git a/core/qa/checker/CbmQaCheckerObjectDB.h b/core/qa/checker/CbmQaCheckerObjectDB.h index 49eea504b998fe4fa7d89f94325cc7ca36b8351c..23619482c76382a45cbea5d178c1c36c836ca165 100644 --- a/core/qa/checker/CbmQaCheckerObjectDB.h +++ b/core/qa/checker/CbmQaCheckerObjectDB.h @@ -12,23 +12,10 @@ #include "CbmQaCheckerTypedefs.h" -#include "Logger.h" - #include <string> #include <utility> #include <vector> -#include <yaml-cpp/yaml.h> - -// TMP -#include <boost/core/demangle.hpp> - -#include <typeinfo> -template<typename T> -std::string type_str() -{ - return boost::core::demangle(typeid(T).name()); -} namespace cbm::qa::checker { @@ -70,27 +57,18 @@ namespace cbm::qa::checker /// @brief Gets name of dataset /// @param iDataset Index of dataset /// @return Name of dataset - const auto& GetDataset(int iDataset) const { return fvDatasets[iDataset]; } - - /// @brief Gets reference to dataset name array - const auto& GetDatasets() const { return fvDatasets; } + const std::string& GetDataset(int iDataset) const { return fvDatasets[iDataset]; } /// @brief Gets index of default version /// @return Index of default version int GetDefaultID() const { return fDefVersionID; } - /// @brief Gets label of the default version - const std::string& GetDefaultLabel() const - { - assert(fDefVersionID > -1); - return GetVersionLabel(fDefVersionID); - } - /// @brief Gets label of file /// @param iFile Index of file /// @return Label of file - const auto& GetFileLabel(int iFile) const { return fvFileLabels[iFile]; } + const std::string& GetFileLabel(int iFile) const { return fvFileLabels[iFile]; } + private: /// @brief Gets iterator range for object names stored in a file /// @note The iterator_range object behaves itself just like an ordinary STL container. /// @param iFile Index of file @@ -105,9 +83,11 @@ namespace cbm::qa::checker int iBegin = itBegin - fvGlobalToFileObject.begin(); int iEnd = itEnd - fvGlobalToFileObject.begin(); + return boost::make_iterator_range(fvObjects.begin() + iBegin, fvObjects.begin() + iEnd); } + public: /// @brief Gets comparison result /// @param iDS Index of dataset /// @param iFile Index of file @@ -154,16 +134,10 @@ namespace cbm::qa::checker /// @param iVersion Index of version const std::string& GetVersionLabel(int iVersion) const { return fvVersionLabels[iVersion]; } - /// @brief Gets reference to version label array - const auto& GetVersionLabels() const { return fvVersionLabels; } - /// @brief Gets version path /// @param iVersion Index of version const std::string& GetVersionPath(int iVersion) const { return fvVersionPaths[iVersion]; } - /// @brief Gets reference to version path array - const auto& GetVersionPaths() const { return fvVersionPaths; } - /// @brief Initializes the database void Init(); diff --git a/macro/qa/CMakeLists.txt b/macro/qa/CMakeLists.txt index ae6a55dd28fde42aab6dd3127473db54fe55d665..a08bf9ad7d5f989c981709737078f82f0ebb8eaf 100644 --- a/macro/qa/CMakeLists.txt +++ b/macro/qa/CMakeLists.txt @@ -49,11 +49,11 @@ endif() # ===== Cleanup the data directory ======================================= -add_test(run_cleanup ${CMAKE_COMMAND} +add_test(qa_cleanup ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/scripts/cleanmacrodir.cmake) -set_tests_properties(run_cleanup PROPERTIES +set_tests_properties(qa_cleanup PROPERTIES TIMEOUT ${timeOutTime} - FIXTURES_SETUP run_cleanup + FIXTURES_SETUP qa_cleanup ) # ============================================================================ diff --git a/macro/qa/qa_compare.C b/macro/qa/qa_compare.C index 80065154957743e430b4f763247dcff6a801b23b..ee32e588d9f1f54d901bbef1a9fa9bebf5a2ea30 100644 --- a/macro/qa/qa_compare.C +++ b/macro/qa/qa_compare.C @@ -23,9 +23,9 @@ 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 + const char* oldVersionInputDir = "../run/data", // NOTE: Files from external repository + const char* newVersionInputDir = "../run/data", // NOTE: Files from preceding fixture + const char* outputName = "QACheckerOutput.root" // TODO: Add tag of a merge request or commit ) /* clang-format on */ {