Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:46

0001 #!/bin/bash
0002 
0003 # Please setup python 3 and ROOT into your environment first
0004 
0005 CWD=$PWD
0006 if [ ${BASH_SOURCE[0]:0:1} == "/" ]; then
0007     FULLPATH=${BASH_SOURCE[0]}
0008 else
0009     FULLPATH=$PWD/${BASH_SOURCE[0]}
0010 fi
0011 cd ${FULLPATH/%env_standalone.sh/}/..
0012 
0013 if [ -f standalone/env_standalone.sh ]; then
0014     if [ ! -d build ]; then
0015         if [ x${1} = 'xbuild' ]; then
0016             mkdir -p build/lib/python/PhysicsTools
0017             ln -s ../../../../python build/lib/python/PhysicsTools/NanoAODTools
0018             echo "Build directory created, please source again standalone/env_standalone.sh without the build argument."
0019         else
0020             echo "Build directory is not yet present, please source again standalone/env_standalone.sh with the build argument."
0021         fi
0022     else
0023         if [ x${1} = 'xbuild' ]; then
0024             echo "Build directory is already present, please source again standalone/env_standalone.sh without the build argument."
0025         else
0026             find build/lib/python python -type d -execdir touch '{}/__init__.py' \;
0027             export NANOAODTOOLS_BASE=${PWD}
0028             export PYTHONPATH=${NANOAODTOOLS_BASE}/build/lib/python:${PYTHONPATH}
0029             echo "NanoAODTools: Standalone environment set."
0030         fi
0031     fi
0032     cd $CWD
0033 else
0034     echo "Error in moving to the NanoAODTools directory to setup the standalone environment"
0035     cd $CWD
0036 fi
0037