Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:02

0001 #!/bin/bash -l 
0002 usage(){ cat << EOU
0003 cxsim.sh : CSGOptiXSimTest : standard geometry and SSim inputs 
0004 ===============================================================
0005 
0006 Create the standard geometry::
0007 
0008     cg
0009     ./run.sh 
0010 
0011 Run the sim using CSGOptiXSimTest executable::
0012 
0013     cx
0014     ./cxsim.sh run   # remote, "run" is default on Linux, "ana" on Darwin 
0015     ./cxsim.sh dbg   # remote, run under gdb 
0016 
0017     ./cxsim.sh grab  # local, grabbing from remote
0018     ./cxsim.sh ana   # local "ana" is default on Darwin, analysis using CSGOptiXSimTest.py script
0019 
0020 
0021     PIDX=0 ./cxsim.sh  #  restrict photon level python output to a single photon index
0022 
0023   
0024 NB the cxs_debug.sh simtrace script also loads and presents cxsim 
0025 photons together with the simtrace geometry. 
0026 
0027 EOU
0028 }
0029 
0030 msg="=== $BASH_SOURCE :"
0031 case $(uname) in 
0032    Linux)  argdef=run  ;;
0033    Darwin) argdef=ana  ;;
0034 esac
0035 arg=${1:-$argdef}
0036 bin=CSGOptiXSimTest
0037 
0038 export OPTICKS_MAX_RECORD=10   # change from default of 0, see sysrap/SEventConfig.cc
0039 export OPTICKS_MAX_REC=10
0040 export OPTICKS_MAX_SEQ=10
0041 
0042 
0043 if [ "${arg/run}" != "$arg" -o "${arg/dbg}" != "$arg" ]; then 
0044     logdir=/tmp/$USER/opticks/$bin
0045     mkdir -p $logdir
0046     iwd=$PWD
0047     cd $logdir
0048 
0049     if [ "${arg/run}" != "$arg" ] ; then
0050         $bin
0051     elif [ "${arg/dbg}" != "$arg" ] ; then
0052         gdb $bin
0053     fi  
0054 
0055     [ $? -ne 0 ] && echo $msg RUN ERROR && exit 1 
0056     echo $msg logdir $logdir 
0057     cd $iwd
0058 fi 
0059 
0060 
0061 if [ "${arg/grab}" != "$arg" ]; then 
0062     EXECUTABLE=$bin       source cachegrab.sh grab
0063     EXECUTABLE=CSGFoundry source cachegrab.sh grab
0064 fi 
0065 
0066 
0067 if [ "${arg/ana}" != "$arg" ]; then 
0068     # HMM: this assumes remote running, local analysis 
0069     EXECUTABLE=$bin source cachegrab.sh env
0070     echo FOLD $FOLD 
0071     ${IPYTHON:-ipython} --pdb -i tests/$bin.py  
0072 fi 
0073 
0074 if [ "${arg/geo}" != "$arg" ]; then 
0075     EXECUTABLE=$bin source cachegrab.sh env
0076 
0077     echo CFBASE $CFBASE
0078 
0079     CSGTargetTest
0080 fi 
0081 
0082 
0083 
0084 
0085 
0086 
0087 exit 0