diff --git a/core/qa/checker/CbmQaCheckerFileHandler.cxx b/core/qa/checker/CbmQaCheckerFileHandler.cxx index 592c91c100da2f883dde1d28b572eb84c29cb0a7..140c24f711ae143d7c493b33db1a22d0b1a0c658 100644 --- a/core/qa/checker/CbmQaCheckerFileHandler.cxx +++ b/core/qa/checker/CbmQaCheckerFileHandler.cxx @@ -101,7 +101,7 @@ void FileHandler::Process(Option_t* opt) bool skipObj = false; for (int iVer = 0; iVer < nVersions; ++iVer) { auto* pInputFile = static_cast<TFile*>(fpInputFiles->At(iVer)); - vpObjects[iVer] = ReadObjectFromFile(pInputFile, fpObjDB->GetObject(fFileID, iObj)); + vpObjects[iVer] = pInputFile->Get<TNamed>(fpObjDB->GetObject(fFileID, iObj).c_str()); if (!vpObjects[iVer]) { LOG(warn) << "FileHandler: object " << fpObjDB->GetObject(fFileID, iObj) << " is undefined for version " << fpObjDB->GetVersionLabel(iVer) << ". This object will be skipped"; @@ -180,16 +180,3 @@ void FileHandler::Process(Option_t* opt) } // iObj } - -// --------------------------------------------------------------------------------------------------------------------- -// -TNamed* FileHandler::ReadObjectFromFile(TFile* pFile, const std::string& path) const -{ - int iPosSlash = path.find_last_of('/') + 1; - std::string baseName = path.substr(iPosSlash, path.size()); - std::string pathName = path.substr(0, iPosSlash); - if (pathName.size() > 0) { - pFile->cd(pathName.c_str()); - } - return dynamic_cast<TNamed*>(pFile->FindObjectAny(baseName.c_str())); -} diff --git a/core/qa/checker/CbmQaCheckerFileHandler.h b/core/qa/checker/CbmQaCheckerFileHandler.h index aa3235202d2feb779c890455b32a163fa4216746..580fae408f8a6ea57c1dd490e5632645719b67b4 100644 --- a/core/qa/checker/CbmQaCheckerFileHandler.h +++ b/core/qa/checker/CbmQaCheckerFileHandler.h @@ -71,13 +71,6 @@ namespace cbm::qa::checker /// @return Pointer to created TDirectory object TDirectory* CreateNestedDirectory(const std::string& path); - /// @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 - TNamed* ReadObjectFromFile(TFile* pFile, const std::string& path) const; - - int fFileID = -1; ///< Index of file int fDatasetID = -1; ///< Index of dataset