@@ -139,7 +139,7 @@ Quality CheckOfTrendings::check(std::map<std::string, std::shared_ptr<MonitorObj
139139 totalQuality.addMetadata (Quality::Null.getName (), " Canvas not found" );
140140 return totalQuality;
141141 }
142- getGraphs (canv, graphs);
142+ getGraphs (canv, graphs, mo-> getName () );
143143
144144 if (graphs.size () == 0 ) {
145145 ILOG (Error, Support) << " Could not retrieve any TGraph for CheckOfTrendings" << ENDM ;
@@ -390,7 +390,7 @@ void CheckOfTrendings::beautify(std::shared_ptr<MonitorObject> mo, Quality check
390390 }
391391
392392 std::vector<TGraph*> graphs;
393- getGraphs (canv, graphs);
393+ getGraphs (canv, graphs, mo-> getName () );
394394
395395 if (graphs.size () == 0 ) {
396396 ILOG (Error, Support) << " Could not retrieve any TGraph for CheckOfTrendings (beautify function)" << ENDM ;
@@ -597,15 +597,15 @@ void CheckOfTrendings::beautify(std::shared_ptr<MonitorObject> mo, Quality check
597597 } // for(size_t iGraph = 0; iGraph < graphs.size(); iGraph++)
598598}
599599
600- void CheckOfTrendings::getGraphs (TCanvas* canv, std::vector<TGraph*>& graphs)
600+ void CheckOfTrendings::getGraphs (TCanvas* canv, std::vector<TGraph*>& graphs, const std::string moName )
601601{
602602 if (mSliceTrend ) {
603603 TList* padList = (TList*)canv->GetListOfPrimitives ();
604604 padList->SetOwner (kTRUE );
605605 const int numberPads = padList->GetEntries ();
606606 for (int iPad = 0 ; iPad < numberPads; iPad++) {
607607 auto pad = static_cast <TPad*>(padList->At (iPad));
608- graphs.push_back (static_cast <TGraph*>(pad->GetPrimitive (" Graph" )));
608+ graphs.push_back (static_cast <TGraph*>(pad->GetPrimitive (" Graph" ))); // SliceTrendingTask saves things as Graph
609609 }
610610 } else {
611611 // 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<TGraph*>& graphs)
614614 TGraph* g;
615615 int jList = canv->GetListOfPrimitives ()->LastIndex ();
616616 for (; jList > 0 ; jList--) {
617- if (!strcmp (canv->GetListOfPrimitives ()->At (jList)->GetName (), " Graph" )) {
617+ if (!strcmp (canv->GetListOfPrimitives ()->At (jList)->GetName (), (moName + " _errors" ).c_str ())) { // Trending Task saves things under the MO name
618+ g = (TGraph*)canv->GetListOfPrimitives ()->At (jList);
619+ break ;
620+ } else if (!strcmp (canv->GetListOfPrimitives ()->At (jList)->GetName (), moName.c_str ())) { // Trending Task saves things under the MO name
618621 g = (TGraph*)canv->GetListOfPrimitives ()->At (jList);
619622 break ;
620623 }
0 commit comments