File indexing completed on 2026-04-10 07:50:27
0001 storch_FillGenstep_usage(){ cat << EOU
0002 storch_FillGenstep.sh
0003 =======================
0004
0005 This is sourced from scripts to setup envvars
0006 that configure torch photon generation
0007
0008 Some of this config such as CHECK
0009 may be overridden by callers, for example:
0010
0011 * ~/opticks/g4cx/tests/G4CXTest.sh
0012
0013
0014 Control vars
0015 -------------
0016
0017 * LAYOUT : one_pmt/two_pmt
0018 * CHECK : many possibilites different within each LAYOUT
0019
0020 Output var exports
0021 --------------------
0022
0023 * CHECK
0024 * storch_FillGenstep_type
0025 * storch_FillGenstep_radius
0026 * storch_FillGenstep_pos
0027 * storch_FillGenstep_mom
0028
0029
0030 EOU
0031 }
0032
0033 layout=one_pmt
0034 export LAYOUT=${LAYOUT:-$layout}
0035
0036 if [ "$LAYOUT" == "one_pmt" ]; then
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 check=mask_tail_diagonal_line
0053
0054 export CHECK=${CHECK:-$check}
0055
0056 if [ "$CHECK" == "rain_disc" ]; then
0057
0058 ttype=disc
0059 pos=0,0,195
0060 mom=0,0,-1
0061 radius=250
0062
0063
0064 elif [ "$CHECK" == "rain_line" ]; then
0065
0066 ttype=line
0067 pos=0,0,195
0068 radius=260
0069 mom=0,0,-1
0070
0071 elif [ "$CHECK" == "rain_line_205" ]; then
0072
0073 ttype=line
0074 pos=0,0,205
0075 radius=260
0076 mom=0,0,-1
0077
0078 elif [ "${CHECK:0:21}" == "rain_point_xpositive_" ]; then
0079
0080 xpos=${CHECK:21}
0081 ttype=point
0082 pos=$xpos,0,195
0083 mom=0,0,-1
0084 radius=0
0085
0086 elif [ "${CHECK:0:21}" == "rain_point_xnegative_" ]; then
0087
0088 xpos=${CHECK:21}
0089 ttype=point
0090 pos=-$xpos,0,195
0091 mom=0,0,-1
0092 radius=0
0093
0094 elif [ "${CHECK:0:16}" == "circle_outwards_" ]; then
0095
0096 ttype=circle
0097 radius=${CHECK:16}
0098 pos=0,0,0
0099
0100 elif [ "${CHECK:0:15}" == "circle_inwards_" ]; then
0101
0102 ttype=circle
0103 radius=-${CHECK:15}
0104 pos=0,0,0
0105
0106 elif [ "$CHECK" == "rectangle_inwards" ]; then
0107
0108 ttype=rectangle
0109 pos=0,0,0
0110 zenith=-205,205
0111 azimuth=-290,290
0112
0113 elif [ "$CHECK" == "up_rain_line" ]; then
0114
0115 ttype=line
0116 radius=260
0117 pos=0,0,-195
0118 mom=0,0,1
0119
0120 elif [ "$CHECK" == "escape" ]; then
0121
0122 ttype=point
0123 pos=0,0,100
0124 mom=0,0,1
0125 radius=0
0126
0127 elif [ "$CHECK" == "rain_dynode" ]; then
0128
0129 ttype=line
0130 radius=120
0131 pos=0,0,-50
0132 mom=0,0,-1
0133
0134
0135 elif [ "$CHECK" == "rain_down_100" ]; then
0136
0137 ttype=line
0138 radius=100
0139 pos=0,0,-100
0140 mom=0,0,-1
0141
0142 elif [ "$CHECK" == "rain_dynode_diag" ]; then
0143
0144 ttype=line
0145 radius=120
0146 pos=0,0,-50
0147 mom=1,0,-1
0148
0149 elif [ "$CHECK" == "tub3_side_line" ]; then
0150
0151 ttype=line
0152 radius=60
0153 pos=-60,0,-20
0154 mom=1,0,0
0155
0156 elif [ "$CHECK" == "lhs_window_line" ]; then
0157
0158 ttype=line
0159 radius=95
0160 pos=-300,0,95
0161 mom=1,0,0
0162
0163 elif [ "$CHECK" == "lhs_reflector_line" ]; then
0164
0165 ttype=line
0166 radius=95
0167 pos=-300,0,-95
0168 mom=1,0,0
0169
0170 elif [ "$CHECK" == "lhs_reflector_point" ]; then
0171
0172 ttype=point
0173 pos=-300,0,-10
0174 mom=1,0,0
0175 radius=0
0176
0177 elif [ "$CHECK" == "mask_tail_diagonal_line" ]; then
0178
0179 intent="point symmetrically placed to tareget outside of nmskTail"
0180 ttype=line
0181 radius=50
0182 pos=-214,0,-127
0183 mom=1,0,1
0184
0185 else
0186 echo $BASH_SOURCE : ERROR LAYOUT $LAYOUT CHECK $CHECK IS NOT HANDLED
0187 fi
0188
0189
0190 elif [ "$LAYOUT" == "two_pmt" ]; then
0191
0192 check=right_line
0193 export CHECK=${CHECK:-$check}
0194
0195 if [ "$CHECK" == "right_line" ]; then
0196 ttype=line
0197 radius=250
0198 pos=0,0,0
0199 mom=1,0,0
0200 else
0201 echo $BASH_SOURCE : ERROR LAYOUT $LAYOUT CHECK $CHECK IS NOT HANDLED
0202 fi
0203 fi
0204
0205 export storch_FillGenstep_type=$ttype
0206 export storch_FillGenstep_radius=$radius
0207 export storch_FillGenstep_pos=$pos
0208 export storch_FillGenstep_mom=$mom
0209 [ -n "$zenith" ] && export storch_FillGenstep_zenith=$zenith
0210 [ -n "$azimuth" ] && export storch_FillGenstep_azimuth=$azimuth
0211
0212