Back to home page

EIC code displayed by LXR

 
 

    


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     #check=rain_disc
0039     #check=rain_line
0040     #check=rain_line_205
0041     #check=rain_point_xpositive_0
0042     #check=tub3_side_line
0043     #check=rain_point_xpositive_100
0044     #check=up_rain_line
0045     #check=escape
0046     #check=rain_dynode
0047     #check=rain_dynode_diag
0048     #check=lhs_window_line
0049     #check=lhs_reflector_line
0050     #check=lhs_reflector_point
0051     #check=rectangle_inwards
0052     check=mask_tail_diagonal_line
0053 
0054     export CHECK=${CHECK:-$check}  # CAUTION: this is duplicated for other layouts
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         # approx PMT extents : xy -255:255, z -190:190
0063 
0064     elif [ "$CHECK" == "rain_line" ]; then
0065 
0066         ttype=line
0067         pos=0,0,195    ## 190 grazes HAMA apex
0068         radius=260     # standand for line from above,  280 hangsover  
0069         mom=0,0,-1   
0070 
0071     elif [ "$CHECK" == "rain_line_205" ]; then
0072 
0073         ttype=line
0074         pos=0,0,205    ## increase for shooting nmskLogicMaskVirtual, hmskLogicMaskVirtual
0075         radius=260     # standand for line from above,  280 hangsover  
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    ## 190 grazes HAMA apex
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    ## 190 grazes HAMA apex
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}   # +ve radiys for outwards
0098         pos=0,0,0
0099 
0100     elif [ "${CHECK:0:15}" == "circle_inwards_" ]; then
0101 
0102         ttype=circle
0103         radius=-${CHECK:15}   # -ve radius for inwards
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    # focus on HAMA dynode
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   ## line from (-60,0,-80) to (-60,0,40) 
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   ## line from (-300,0,0) to (-300,0,190) 
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   ## line from (-300,0,0) to (-300,0,-190)
0168         mom=1,0,0        
0169 
0170     elif [ "$CHECK" == "lhs_reflector_point" ]; then
0171 
0172         ttype=point
0173         pos=-300,0,-10     ## PMT left below cathode at Z=0, for shooting the reflector 
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}  # CAUTION: this is duplicated for other layouts
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