Skip to content
Snippets Groups Projects
Commit 18686e73 authored by deserevi's avatar deserevi
Browse files

* Add NPToolLogon.C script which loads all relevant NPTool information

  when a ROOT session starts.
     + header directory (NPLib/include) is declared
     + libraries in NPLib/lib are loaded

* new version of the rootlogon.C file calling the NPToolLogon.C script.
parent 40e90692
No related branches found
No related tags found
No related merge requests found
/*****************************************************************************
* Copyright (C) 2009-2010 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : 07/01/11 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: Example of rootlogon.C file which calls the NPToolLogon.C *
* located in NPLib/scripts and which loads all necessary NPTool *
* information needed by ROOT. *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
{
gROOT->ProcessLine(".include /YourPathToNPTool/NPTool/NPLib/include");
gSystem->Load("/YourPathToNPTool/NPTool/NPLib/lib/libInitialConditions.so");
gSystem->Load("/YourPathToNPTool/NPTool/NPLib/lib/libInteractionCoordinates.so");
// Load NPToolLogon.C macro dealing with all the NPLib shared libraries
TString path = gSystem->Getenv("NPLIB");
gROOT->ProcessLine(Form(".x %s/scripts/NPToolLogon.C", path.Data()));
}
/*****************************************************************************
* Copyright (C) 2009-2010 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : 07/01/11 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: This script loads automatically the NPLib include path and *
* shared. *
* *
*---------------------------------------------------------------------------*
* Comment: This script should be called in your rootlogon.C file *
* See example in NPTool/Misc/rootlogon.C *
* *
* *
*****************************************************************************/
{
TString path = gSystem->Getenv("NPLIB");
// Add include path
cout << "NPTool: adding include path ..." << endl;
gSystem->AddIncludePath(Form("%s/include", path.Data()));
// Add shared libraries
cout << "NPTool: loading NPLib shared libraries ..." << endl;
TString libpath = Form("%s/lib", path.Data());
TSystemDirectory libdir("libdir", libpath);
TList* listfile = libdir.GetListOfFiles();
// Since the list is ordered alphabetically and that the
// libVDetector.so library should be loaded before the
// lib*Physics.so libraries, it is then loaded manually
// first.
gSystem->Load(libpath+"/libVdetector.so");
// Since the libMust2Physics.so library uses TVector2
// objects, the libPhysics.so ROOT library is loaded.
gSystem->Load("libPhysics.so");
Int_t i = 0;
while (listfile->At(i)) {
TString libname = listfile->At(i++)->GetName();
if (libname.Contains("so") && !libname.Contains("libVDetector.so")) {
TString lib = libpath + "/" + libname;
gSystem->Load(lib);
}
}
}
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