Skip to content
Snippets Groups Projects
Commit 33de1fed authored by deserevi's avatar deserevi
Browse files

* Fix bug in NPToolLogon.C file

   + if NPLib was not compiled, error concerning libVDetector.so loading
     was obtained when starting ROOT (now fixed).
parent a82c3ab6
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
gROOT->ProcessLine(Form(".L %s/scripts/NPToolLogon.C+", path.Data())); gROOT->ProcessLine(Form(".L %s/scripts/NPToolLogon.C+", path.Data()));
// No Init Display // No Init Display
// NPToolLogon(false)
NPToolLogon(); NPToolLogon();
// With Init Display // With Init Display
......
...@@ -33,17 +33,17 @@ using namespace std; ...@@ -33,17 +33,17 @@ using namespace std;
#include "TSystemDirectory.h" #include "TSystemDirectory.h"
#include "TString.h" #include "TString.h"
void NPToolLogon(bool quietmode = false) void NPToolLogon(bool verbosemode = false)
{ {
TString currentpath = gSystem->Getenv("PWD"); TString currentpath = gSystem->Getenv("PWD");
TString path = gSystem->Getenv("NPLIB"); TString path = gSystem->Getenv("NPLIB");
// Add include path // 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())); gROOT->ProcessLine(Form(".include %s/include", path.Data()));
// Add shared libraries // 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()); TString libpath = Form("%s/lib", path.Data());
TSystemDirectory libdir("libdir", libpath); TSystemDirectory libdir("libdir", libpath);
TList* listfile = libdir.GetListOfFiles(); TList* listfile = libdir.GetListOfFiles();
...@@ -52,7 +52,8 @@ void NPToolLogon(bool quietmode = false) ...@@ -52,7 +52,8 @@ void NPToolLogon(bool quietmode = false)
// libVDetector.so library should be loaded before the // libVDetector.so library should be loaded before the
// lib*Physics.so libraries, it is then loaded manually // lib*Physics.so libraries, it is then loaded manually
// first. // 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 // Since the libMust2Physics.so library uses TVector2
// objects, the libPhysics.so ROOT library is loaded. // objects, the libPhysics.so ROOT library is loaded.
...@@ -73,5 +74,5 @@ void NPToolLogon(bool quietmode = false) ...@@ -73,5 +74,5 @@ void NPToolLogon(bool quietmode = false)
// directory // directory
gSystem->cd(currentpath); gSystem->cd(currentpath);
if (quietmode) cout << "NPTool: Ready" << endl; if (verbosemode) cout << "NPTool: Ready" << endl;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment