From 33de1fedda92abdfd90e152adc95d38b3e99ab10 Mon Sep 17 00:00:00 2001
From: deserevi <deserevi@nptool>
Date: Thu, 20 Jan 2011 19:23:24 +0000
Subject: [PATCH] * Fix bug in NPToolLogon.C file    + if NPLib was not
 compiled, error concerning libVDetector.so loading      was obtained when
 starting ROOT (now fixed).

---
 Misc/rootlogon.C            |  1 -
 NPLib/scripts/NPToolLogon.C | 11 ++++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Misc/rootlogon.C b/Misc/rootlogon.C
index 154d6056e..be6b2ad7b 100644
--- a/Misc/rootlogon.C
+++ b/Misc/rootlogon.C
@@ -26,7 +26,6 @@
    gROOT->ProcessLine(Form(".L %s/scripts/NPToolLogon.C+", path.Data()));
    
    // No Init Display
-   // NPToolLogon(false)
    NPToolLogon();
    
    // With Init Display
diff --git a/NPLib/scripts/NPToolLogon.C b/NPLib/scripts/NPToolLogon.C
index 15e82b573..12379ba71 100644
--- a/NPLib/scripts/NPToolLogon.C
+++ b/NPLib/scripts/NPToolLogon.C
@@ -33,17 +33,17 @@ using namespace std;
 #include "TSystemDirectory.h"
 #include "TString.h"
 
-void NPToolLogon(bool quietmode = false)
+void NPToolLogon(bool verbosemode = false)
 {
    TString currentpath = gSystem->Getenv("PWD");
    TString path = gSystem->Getenv("NPLIB");
    
    // Add include path
-   if (quietmode) cout << "NPTool: adding include path : " << path << "/include" << endl;
+   if (verbosemode) cout << "NPTool: adding include path : " << path << "/include" << endl;
    gROOT->ProcessLine(Form(".include %s/include", path.Data()));
 
    // Add shared libraries
-   if (quietmode) cout << "NPTool: loading NPLib shared libraries ..." << endl;
+   if (verbosemode) cout << "NPTool: loading NPLib shared libraries ..." << endl;
    TString libpath = Form("%s/lib", path.Data());
    TSystemDirectory libdir("libdir", libpath);
    TList* listfile = libdir.GetListOfFiles();
@@ -52,7 +52,8 @@ void NPToolLogon(bool quietmode = false)
    // libVDetector.so library should be loaded before the 
    // lib*Physics.so libraries, it is then loaded manually 
    // first.
-   gSystem->Load(libpath+"/libVDetector.so");
+   // Test if the lib directory is empty or not
+   if (listfile->GetEntries() > 2) gSystem->Load(libpath+"/libVDetector.so");
 
    // Since the libMust2Physics.so library uses TVector2
    // objects, the libPhysics.so ROOT library is loaded.
@@ -73,5 +74,5 @@ void NPToolLogon(bool quietmode = false)
    // directory
    gSystem->cd(currentpath);
    
-   if (quietmode) cout << "NPTool: Ready" << endl;
+   if (verbosemode) cout << "NPTool: Ready" << endl;
 }
-- 
GitLab