Skip to content
Snippets Groups Projects
Commit acda1096 authored by matta's avatar matta
Browse files

* Fixing problem with the NPToolLogon

 - no the current directory stay the main directory
 - quiet mode can be call
 - a function is compiled in order to support cout on all platforme
parent 83a85496
No related branches found
No related tags found
No related merge requests found
...@@ -20,14 +20,27 @@ ...@@ -20,14 +20,27 @@
* * * *
* * * *
*****************************************************************************/ *****************************************************************************/
#include "TSystem.h"
#include "TList.h"
#include "TSystemDirectory.h"
#include "TString.h"
#include <iostream>
using namespace std;
void InitNPTool(bool quietmode = false)
{ {
TString currentpath = gSystem->Getenv("PWD");
TString path = gSystem->Getenv("NPLIB"); TString path = gSystem->Getenv("NPLIB");
// Add include path // Add include path
cout << "NPTool: adding include path ..." << endl; if(quietmode)
cout << "NPTool: adding include path ..." << endl;
gSystem->AddIncludePath(Form("%s/include", path.Data())); gSystem->AddIncludePath(Form("%s/include", path.Data()));
// Add shared libraries // Add shared libraries
if(quietmode)
cout << "NPTool: loading NPLib shared libraries ..." << endl; 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);
...@@ -37,7 +50,7 @@ ...@@ -37,7 +50,7 @@
// 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"); 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.
...@@ -51,4 +64,12 @@ ...@@ -51,4 +64,12 @@
gSystem->Load(lib); gSystem->Load(lib);
} }
} }
TSystemDirectory dir("dir",currentpath);
TList* listfile2 = dir.GetListOfFiles();
if(quietmode)
cout << "NPTool: Ready" << endl;
delete listfile2, listfile ;
} }
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