diff --git a/Framework/include/QualityControl/CheckInterface.h b/Framework/include/QualityControl/CheckInterface.h index 394d9488c9..45d2884336 100644 --- a/Framework/include/QualityControl/CheckInterface.h +++ b/Framework/include/QualityControl/CheckInterface.h @@ -94,7 +94,12 @@ class CheckInterface : public core::UserCodeInterface /// \brief Retrieve a reference plot at the provided path, matching the give activity and for the provided run. /// the activity is the current one, while the run number is the reference run. - std::shared_ptr retrieveReference(std::string path, int referenceRun, Activity activity); + /// + /// \param path path to the object (no provenance) + /// \param referenceRun Run number of the reference data + /// \param activity Current activity (necessary for the provenance and the pass) + /// \return + std::shared_ptr retrieveReference(std::string path, size_t referenceRun, Activity activity); private: std::shared_ptr mDatabase; diff --git a/Framework/include/QualityControl/ReferenceUtils.h b/Framework/include/QualityControl/ReferenceUtils.h index 97fc86f0bd..155b077841 100644 --- a/Framework/include/QualityControl/ReferenceUtils.h +++ b/Framework/include/QualityControl/ReferenceUtils.h @@ -33,24 +33,13 @@ namespace o2::quality_control::checker // Get the reference plot for a given MonitorObject path static std::shared_ptr getReferencePlot(quality_control::repository::DatabaseInterface* qcdb, std::string& fullPath, - int referenceRun, quality_control::core::Activity activity) + size_t referenceRun, core::Activity activity) { - uint64_t timeStamp = 0; - activity.mId = referenceRun; - const auto filterMetadata = quality_control::core::activity_helpers::asDatabaseMetadata(activity, false); - const auto objectValidity = qcdb->getLatestObjectValidity(activity.mProvenance + "/" + fullPath, filterMetadata); - if (objectValidity.isValid()) { - timeStamp = objectValidity.getMax() - 1; - } else { - ILOG(Warning, Devel) << "Could not find the object '" << fullPath << "' for run " << activity.mId << ENDM; - return nullptr; - } - auto [success, path, name] = o2::quality_control::core::RepoPathUtils::splitObjectPath(fullPath); if (!success) { return nullptr; } - return qcdb->retrieveMO(path, name, timeStamp, activity); + return qcdb->retrieveMO(path, name, repository::DatabaseInterface::Timestamp::Latest, activity); } } // namespace o2::quality_control::checker diff --git a/Framework/src/CheckInterface.cxx b/Framework/src/CheckInterface.cxx index aa6b11eba7..a3b5d62e98 100644 --- a/Framework/src/CheckInterface.cxx +++ b/Framework/src/CheckInterface.cxx @@ -60,7 +60,7 @@ void CheckInterface::endOfActivity(const Activity& activity) // noop, override it if you want. } -shared_ptr CheckInterface::retrieveReference(std::string path, int referenceRun, Activity activity) +shared_ptr CheckInterface::retrieveReference(std::string path, size_t referenceRun, Activity activity) { return o2::quality_control::checker::getReferencePlot(mDatabase.get(), path, referenceRun, activity); }