From 0472dbf9a7f7978829177aeff3472bf779698576 Mon Sep 17 00:00:00 2001
From: Danilo Piparo <danilo.piparo@cern.ch>
Date: Wed, 14 Mar 2018 14:59:27 +0100
Subject: [PATCH] Revert "[Math] Reduce to the minimum the usage of
 R__LOAD_LIBRARY in tutorials"

This reverts commit 21d726ba31188a041f89c23b371e250e17c57b80.
This change is platform dependent! Everything works on ubuntu16, but fails
on other platform. The change is reverted for 6.13, waiting to understand more
about this difference.
---
 tutorials/math/Bessel.C         | 2 ++
 tutorials/math/FeldmanCousins.C | 3 +++
 tutorials/math/Legendre.C       | 2 ++
 tutorials/math/Legendre.py      | 1 +
 tutorials/math/LegendreAssoc.C  | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/tutorials/math/Bessel.C b/tutorials/math/Bessel.C
index 725b024457d..57d7b1bb55b 100644
--- a/tutorials/math/Bessel.C
+++ b/tutorials/math/Bessel.C
@@ -33,6 +33,8 @@
 
 void Bessel()
 {
+   R__LOAD_LIBRARY(libMathMore);
+
    TCanvas *DistCanvas = new TCanvas("DistCanvas", "Bessel functions example", 10, 10, 800, 600);
    DistCanvas->SetFillColor(17);
    DistCanvas->Divide(2, 2);
diff --git a/tutorials/math/FeldmanCousins.C b/tutorials/math/FeldmanCousins.C
index 161ed79f376..c5ae6f5e272 100644
--- a/tutorials/math/FeldmanCousins.C
+++ b/tutorials/math/FeldmanCousins.C
@@ -14,6 +14,9 @@
 
 void FeldmanCousins()
 {
+   if (!gROOT->GetClass("TFeldmanCousins"))
+      R__LOAD_LIBRARY(libPhysics);
+
    TFeldmanCousins f;
 
    // calculate either the upper or lower limit for 10 observed
diff --git a/tutorials/math/Legendre.C b/tutorials/math/Legendre.C
index ab8e9d6a62c..eb4c2e3abea 100644
--- a/tutorials/math/Legendre.C
+++ b/tutorials/math/Legendre.C
@@ -26,6 +26,8 @@
 
 void Legendre()
 {
+   R__LOAD_LIBRARY(libMathMore);
+
    TCanvas *Canvas = new TCanvas("DistCanvas", "Legendre polynomials example", 10, 10, 750, 600);
    Canvas->SetGrid();
    TLegend *leg = new TLegend(0.5, 0.7, 0.4, 0.89);
diff --git a/tutorials/math/Legendre.py b/tutorials/math/Legendre.py
index 3c04661e029..20506d5f369 100644
--- a/tutorials/math/Legendre.py
+++ b/tutorials/math/Legendre.py
@@ -11,6 +11,7 @@
 
 import ROOT
 
+ROOT.gSystem.Load("libMathMore")
 Canvas = ROOT.TCanvas("DistCanvas", "Legendre polynomials example", 10, 10, 750, 600)
 Canvas.SetGrid()
 leg = ROOT.TLegend(0.5, 0.7, 0.4, 0.89)
diff --git a/tutorials/math/LegendreAssoc.C b/tutorials/math/LegendreAssoc.C
index 919b2e38138..4ea75d926f1 100644
--- a/tutorials/math/LegendreAssoc.C
+++ b/tutorials/math/LegendreAssoc.C
@@ -34,6 +34,8 @@
 
 void LegendreAssoc()
 {
+   R__LOAD_LIBRARY(libMathMore);
+
    std::cout <<"Drawing associate Legendre Polynomials.." << std::endl;
    TCanvas *Canvas = new TCanvas("DistCanvas", "Associate Legendre polynomials", 10, 10, 800, 500);
    Canvas->Divide(2,1);
-- 
GitLab