Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:50:28

0001 #!/bin/bash
0002 usage(){ cat << EOU
0003 
0004 ~/o/u4/tests/U4SolidMakerTest.sh
0005 
0006 WaterDistributer
0007    multiunion of multiple-multiunions is untranslatable to Opticks listnode
0008    and anyhow the multiunions contain sn::CutCylinder which has no
0009    intersection impl .. so need to devise some placeholder nodes
0010    which when detected force triangulation
0011 
0012 AltWaterDistributer
0013    everything in one MultiUnion is simpler,
0014    but it takes forever to polgonize, so unworkable
0015 
0016 
0017 To see this solid within container universe box
0018 converted into CSGFoundry geometry use::
0019 
0020    ~/o/g4cx/tests/G4CX_U4TreeCreateCSGFoundryTest.sh
0021 
0022 
0023 EOU
0024 }
0025 
0026 name=U4SolidMakerTest
0027 
0028 cd $(dirname $(realpath $BASH_SOURCE))
0029 
0030 
0031 #solid=WaterDistributer
0032 #solid=AltWaterDistributer
0033 #solid=WaterDistributorPartIIIUnion
0034 #solid=OuterReflectorOrbSubtraction
0035 
0036 #solid=R12860_PMTSolid
0037 #solid=R12860_PMTSolidU   # Union with torus, instead of Subtraction, to see the position
0038 #solid=R12860_PMTSolidK    # KLUDGE : dont subtract torus to see the tube "scarf"
0039 #solid=R12860_PMTSolidP    # polycone neck
0040 
0041 #solid=LProfileSectorPolycone
0042 #solid=PolyconeWithPhiCut
0043 solid=PolyconeWithPhiCutHalf
0044 
0045 
0046 export U4Polycone__ENABLE_PHICUT=1
0047 export U4Mesh__NumberOfRotationSteps_entityType_G4Polycone=480
0048 
0049 
0050 export SOLID=${SOLID:-$solid}
0051 export FOLD=/tmp/$USER/opticks/$name
0052 mkdir -p $FOLD
0053 
0054 
0055 if [ "$SOLID" == "OuterReflectorOrbSubtraction" ]; then
0056    export U4SolidMaker__OuterReflectorOrbSubtraction_radOuterReflector=20722.1
0057 fi
0058 
0059 bin=$name
0060 script=$name.py
0061 
0062 vv="BASH_SOURCE name PWD bin script FOLD SOLID arg defarg"
0063 
0064 defarg="info_run_pdb"
0065 arg=${1:-$defarg}
0066 
0067 
0068 if [ "${arg/info}" != "$arg" ]; then
0069     for v in $vv ; do printf "%30s : %s\n" "$v" "${!v}" ; done
0070 fi
0071 
0072 if [ "${arg/run}" != "$arg" ]; then\
0073     $bin
0074     [ $? -ne 0 ] && echo $BASH_SOURCE - run error && exit 1
0075 fi
0076 
0077 if [ "${arg/dbg}" != "$arg" ]; then\
0078     source dbg__.sh
0079     dbg__ $bin
0080     [ $? -ne 0 ] && echo $BASH_SOURCE - dbg error && exit 1
0081 fi
0082 
0083 if [ "${arg/ana}" != "$arg" ]; then\
0084     ${PYTHON:-python} $script
0085     [ $? -ne 0 ] && echo $BASH_SOURCE - ana error && exit 2
0086 fi
0087 
0088 if [ "${arg/pdb}" != "$arg" ]; then\
0089     ${IPYTHON:-ipython} -i --pdb $script
0090     [ $? -ne 0 ] && echo $BASH_SOURCE - pdb error && exit 3
0091 fi
0092 
0093 exit 0
0094