diff --git a/Modules/TPC/include/TPC/CheckOfTrendings.h b/Modules/TPC/include/TPC/CheckOfTrendings.h index bf73680437..c38d4427ad 100644 --- a/Modules/TPC/include/TPC/CheckOfTrendings.h +++ b/Modules/TPC/include/TPC/CheckOfTrendings.h @@ -46,7 +46,7 @@ class CheckOfTrendings : public o2::quality_control::checker::CheckInterface private: ClassDefOverride(CheckOfTrendings, 2); - void getGraphs(TCanvas* canv, std::vector& graphs); + void getGraphs(TCanvas* canv, std::vector& graphs, const std::string moName); std::string createMetaData(const std::vector& pointMetaData); std::string mCheckChoice; float mExpectedPhysicsValue; diff --git a/Modules/TPC/src/CheckOfTrendings.cxx b/Modules/TPC/src/CheckOfTrendings.cxx index a74d015a4d..6cb6e4c6f2 100644 --- a/Modules/TPC/src/CheckOfTrendings.cxx +++ b/Modules/TPC/src/CheckOfTrendings.cxx @@ -139,7 +139,7 @@ Quality CheckOfTrendings::check(std::mapgetName()); if (graphs.size() == 0) { ILOG(Error, Support) << "Could not retrieve any TGraph for CheckOfTrendings" << ENDM; @@ -390,7 +390,7 @@ void CheckOfTrendings::beautify(std::shared_ptr mo, Quality check } std::vector graphs; - getGraphs(canv, graphs); + getGraphs(canv, graphs, mo->getName()); if (graphs.size() == 0) { ILOG(Error, Support) << "Could not retrieve any TGraph for CheckOfTrendings (beautify function)" << ENDM; @@ -597,7 +597,7 @@ void CheckOfTrendings::beautify(std::shared_ptr mo, Quality check } // for(size_t iGraph = 0; iGraph < graphs.size(); iGraph++) } -void CheckOfTrendings::getGraphs(TCanvas* canv, std::vector& graphs) +void CheckOfTrendings::getGraphs(TCanvas* canv, std::vector& graphs, const std::string moName) { if (mSliceTrend) { TList* padList = (TList*)canv->GetListOfPrimitives(); @@ -605,7 +605,7 @@ void CheckOfTrendings::getGraphs(TCanvas* canv, std::vector& graphs) const int numberPads = padList->GetEntries(); for (int iPad = 0; iPad < numberPads; iPad++) { auto pad = static_cast(padList->At(iPad)); - graphs.push_back(static_cast(pad->GetPrimitive("Graph"))); + graphs.push_back(static_cast(pad->GetPrimitive("Graph"))); // SliceTrendingTask saves things as Graph } } else { // If we have a standard trending with a TGraphErrors, then there will be a TGraph and a TGraphErrors with the same name ("Graph") @@ -614,7 +614,10 @@ void CheckOfTrendings::getGraphs(TCanvas* canv, std::vector& graphs) TGraph* g; int jList = canv->GetListOfPrimitives()->LastIndex(); for (; jList > 0; jList--) { - if (!strcmp(canv->GetListOfPrimitives()->At(jList)->GetName(), "Graph")) { + if (!strcmp(canv->GetListOfPrimitives()->At(jList)->GetName(), (moName + "_errors").c_str())) { // Trending Task saves things under the MO name + g = (TGraph*)canv->GetListOfPrimitives()->At(jList); + break; + } else if (!strcmp(canv->GetListOfPrimitives()->At(jList)->GetName(), moName.c_str())) { // Trending Task saves things under the MO name g = (TGraph*)canv->GetListOfPrimitives()->At(jList); break; }