From acda10969157f7ce30f3fa8fbdf8e8d7c05864c0 Mon Sep 17 00:00:00 2001
From: matta <matta@npt>
Date: Fri, 7 Jan 2011 19:56:31 +0000
Subject: [PATCH] * 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

---
 NPLib/scripts/NPToolLogon.C | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/NPLib/scripts/NPToolLogon.C b/NPLib/scripts/NPToolLogon.C
index e3283729a..cb759fdea 100644
--- a/NPLib/scripts/NPToolLogon.C
+++ b/NPLib/scripts/NPToolLogon.C
@@ -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");
-
+   
    // Add include path
-   cout << "NPTool: adding include path ..." << endl;
+   if(quietmode)
+    cout << "NPTool: adding include path ..." << endl;
    gSystem->AddIncludePath(Form("%s/include", path.Data()));
 
    // Add shared libraries
+   if(quietmode)
    cout << "NPTool: loading NPLib shared libraries ..." << endl;
    TString libpath = Form("%s/lib", path.Data());
    TSystemDirectory libdir("libdir", libpath);
@@ -37,7 +50,7 @@
    // libVDetector.so library should be loaded before the 
    // lib*Physics.so libraries, it is then loaded manually 
    // first.
-   gSystem->Load(libpath+"/libVdetector.so");
+   gSystem->Load(libpath+"/libVDetector.so");
 
    // Since the libMust2Physics.so library uses TVector2
    // objects, the libPhysics.so ROOT library is loaded.
@@ -51,4 +64,12 @@
          gSystem->Load(lib);
       }
    }
+   
+   TSystemDirectory dir("dir",currentpath);
+   TList* listfile2 = dir.GetListOfFiles();
+   
+   if(quietmode)
+   cout << "NPTool: Ready" << endl;
+   
+   delete listfile2, listfile ;
 }
-- 
GitLab