File indexing completed on 2026-04-09 07:48:52
0001
0002 usage(){ cat << EOU
0003 CSGFoundry_getFrame_Test.sh
0004 =============================
0005
0006
0007
0008
0009 Loads a CSGFoundry geometry specified by GEOM envvar and
0010 accesses the frame specified by OPTICKS_INPUT_PHOTON_FRAME envvar.
0011 The frame is used to transform some input photons and comparisons
0012 are made between different transformation approaches.
0013
0014 Examples::
0015
0016 OPTICKS_INPUT_PHOTON_FRAME=PMT_20inch_veto:0:1000 ~/opticks/csg/tests/CSGFoundry_getFrame_Test.sh
0017
0018
0019 EOU
0020 }
0021
0022
0023 SDIR=$(dirname $(realpath $BASH_SOURCE))
0024
0025 name=CSGFoundry_getFrame_Test
0026 script=$SDIR/$name.py
0027
0028
0029 source $SDIR/../../bin/OPTICKS_INPUT_PHOTON.sh
0030
0031 source ~/.opticks/GEOM/GEOM.sh
0032
0033
0034 ipf=Hama:0:1000
0035 export OPTICKS_INPUT_PHOTON_FRAME=${OPTICKS_INPUT_PHOTON_FRAME:-$ipf}
0036
0037
0038 defarg="run_ana"
0039 arg=${1:-$defarg}
0040
0041 tmp=/tmp/$USER/opticks
0042 TMP=${TMP:-$tmp}
0043 export FOLD=$TMP/$name
0044
0045
0046 if [ "${arg/run}" != "$arg" ]; then
0047 $name
0048 [ $? -ne 0 ] && echo $BASH_SOURCE run $name error && exit 1
0049 fi
0050
0051 if [ "${arg/ana}" != "$arg" ]; then
0052 ${IPYTHON:-ipython} --pdb -i $script
0053 [ $? -ne 0 ] && echo $BASH_SOURCE ana $script error && exit 2
0054 fi
0055
0056 exit 0
0057