diff --git a/NPLib/Makefile b/NPLib/Makefile index 4a530248935088509bbfa973ba9d6ace8fded96b..9845b444b11768803ccb2e646ffb8b1ece488a11 100644 --- a/NPLib/Makefile +++ b/NPLib/Makefile @@ -32,6 +32,11 @@ liblistfile: $(FILLLIB) $(SHARELIB) $(FILLIB) # where the wanted detector are defined include $(NPTOOL)/NPLib/Makefile.detector +######## rootlogon modification ######## +rootlogon: + ./scripts/RootLogon.sh + + ############# Clean and More ########## clean: rm -f ./*/*.o diff --git a/NPLib/scripts/RootLogon.sh b/NPLib/scripts/RootLogon.sh new file mode 100755 index 0000000000000000000000000000000000000000..f406333edc669c995c33c1a20b4c246b1682e91e --- /dev/null +++ b/NPLib/scripts/RootLogon.sh @@ -0,0 +1,51 @@ +# ***************************************************************************** +# * Copyright (C) 2014 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: A. Matta contact address: a.matta@surrey.ac.uk * +# * * +# * Creation Date : 23/4/2014 * +# * Last update : * +# *---------------------------------------------------------------------------* +# * Decription: This script edit the user .rootlogon.C file to load NPTool * +# * Libraries. * +# * * +# *---------------------------------------------------------------------------* +# * Comment: * +# * * +# * * +# ***************************************************************************** + +#! /bin/bash + +# test if the ~/.rootlogon.C file exist, if no create it +if [ -f ~/.rootlogon.C ]; +then + echo 'File .rootlogon.C already exist: attempt to modified it' + # Check if NPTOOL stuff is already in + SEARCH=$(grep NPTOOL ~/test.C) + echo $SEARCH + if [ ! -n "$SEARCH" ]; + then + echo 'Appending missing line to the file' + sed -i -e 's#{#{\ + TString NPLPath = gSystem->Getenv(\"NPTOOL\");\ + gROOT->ProcessLine(Form(\".x %s/NPLib/scripts/NPToolLogon.C+\", NPLPath.Data()));\ +#g' ~/.rootlogon.C + else + echo 'Some NPTool Lib already loading in .rootlogon.C : please check the file' + fi + +else + echo 'File .rootlogon.C was created' + cp rootlogon_basic.C ~/.rootlogon.C +fi + + + + + diff --git a/NPLib/scripts/rootlogon_basic.C b/NPLib/scripts/rootlogon_basic.C new file mode 100644 index 0000000000000000000000000000000000000000..eb15e958e1b6da90f53e92da57d2efb168f97e07 --- /dev/null +++ b/NPLib/scripts/rootlogon_basic.C @@ -0,0 +1,4 @@ +{ + TString NPLPath = gSystem->Getenv("NPTOOL"); + gROOT->ProcessLine(Form(".x %s/NPLib/scripts/NPToolLogon.C+", NPLPath.Data())); +}