Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:33

0001 #!/bin/bash -l 
0002 usage(){ cat << EOU
0003 cxs_solidXJfixture.sh
0004 =======================
0005 
0006 NB unlike many others this does not honour GEOM, **it sets GEOM** based on COMP 
0007 
0008 Whilst iterating on cxs running on workstation and 
0009 grabbing the intersect photons to local laptop with
0010 the grab script is is convenient to use "lrun" mode.  
0011 
0012     ./cxs_grab.sh 
0013     ./cxs_solidXJfixture.sh lrun     
0014 
0015 The grab writes CSGOptiXSimtraceTest_OUTPUT_DIR.sh script
0016 to the LOGDIR directory which is then sourced by the cxs.sh
0017 script when run in lrun mode.   
0018 
0019 For custom geometry such as from GeoChain test geometry need to use::
0020 
0021     ./tmp_grab.sh png
0022     ./tmp_grab.sh png
0023     ./cxs_solidXJfixture.sh lrun     
0024 
0025 
0026 
0027 Whilst working on the plot presentation of previously 
0028 grabbed intersect photons the COMP control is used.
0029 This is used for changing annotations and deciding 
0030 on which to publish::
0031 
0032     COMP=PR_55 ./cxs_solidXJfixture.sh
0033 
0034 Once decided to publish a figure png use the PUB control 
0035 together with the usual pub.py arguments eg sp/s5/cp/dp/xdp::
0036 
0037     PUB=1 COMP=PR_55 ./cxs_solidXJfixture.sh sp
0038     PUB=1 COMP=PR_55 ./cxs_solidXJfixture.sh cp 
0039     PUB=1 COMP=PR_55 ./cxs_solidXJfixture.sh cp | sh 
0040     PUB=1 COMP=PR_55 ./cxs_solidXJfixture.sh cp | grep mpplt 
0041     PUB=1 COMP=PR_55 ./cxs_solidXJfixture.sh cp | grep mpplt | sh 
0042 
0043 
0044     COMP=XZ_10 ./cxs_solidXJfixture.sh 
0045     PUB=1 COMP=XZ_10 ./cxs_solidXJfixture.sh cp | sh 
0046 
0047 
0048     COMP=PR_0 ISEL=1 ./cxs_solidXJfixture.sh 
0049 
0050 EOU
0051 
0052 }
0053 
0054 
0055 msg="=== $BASH_SOURCE :"
0056 
0057 #comp=XZ_10         # done
0058 #comp=YZ_10         # rerun
0059 
0060 #comp=TP_10         # rerun
0061 #comp=RT_10         # rerun
0062 
0063 #comp=PR_55         # done 
0064 #comp=TR_55         # done 
0065 
0066 #comp=PR_0          # done 
0067 #comp=TR_0          # done
0068 #comp=TP_0          # done  
0069 #comp=TP_0_Rshift   # done
0070 
0071 comp=custom_XY
0072 #comp=TR_2
0073 #comp=TR_52
0074 #comp=TR_41
0075 #comp=PR_41
0076 #comp=ClosePR_41
0077 #comp=CloserPR_41
0078 
0079 
0080 
0081 GBASE=XJfixtureConstruction
0082 export COMP=${COMP:-$comp} 
0083 
0084 case $COMP in 
0085   custom_XY)  geom=custom_${GBASE}XY ;;  
0086           *)  geom=${GBASE}${COMP}   ;; 
0087 esac
0088 
0089 export GEOM=$geom
0090 
0091 
0092 isel=
0093 cfbase=
0094 ce_offset=0
0095 ce_scale=0
0096 gsplot=1
0097 
0098 if [ "$GEOM" == "${GBASE}XZ_10" ]; then
0099 
0100     note="side cross section of sTarget sAcrylic sXJfixture sXJanchor  "
0101     moi="solidXJfixture:10"
0102     cegs=16:0:9:100           
0103     gridscale=0.20
0104 
0105     ce_offset=1    # pre-tangential-frame approach  
0106     ce_scale=1 
0107 
0108 elif [ "$GEOM" == "${GBASE}YZ_10" ]; then
0109 
0110     note="view is difficult to interpret : could be a bug or just a slice at a funny angle, need tangential check"
0111     moi="solidXJfixture:10"
0112     cegs=0:16:9:100            
0113     gridscale=0.20
0114 
0115     ce_offset=1    # pre-tangential-frame approach  
0116     ce_scale=1 
0117 
0118 elif [ "$GEOM" == "${GBASE}TP_10" ]; then
0119 
0120     note="nicely aligned rectangle in YZ=(TP), longer in T direction +- 1 extent unit, +-0.24 extent units in P  "
0121     moi="solidXJfixture:10:-3"
0122     #    R:T:P 
0123     cegs=0:16:9:100            
0124     gridscale=0.20
0125 
0126 elif [ "$GEOM" == "${GBASE}RT_10" ]; then
0127 
0128     note="bang on tangential view from P(phi-tangent-direction) showing the radial coincidence issues clearly" 
0129     moi="solidXJfixture:10:-3"
0130     cegs=16:9:0:100            
0131     gridscale=0.20
0132 
0133 
0134 elif [ "$GEOM" == "${GBASE}TR_2" ]; then
0135 
0136     note="depth check : looks like positioned to correspond to sTarget radius" 
0137     moi="solidXJfixture:2:-3"
0138     cegs=9:16:0:100            
0139     gridscale=0.80
0140 
0141 elif [ "$GEOM" == "${GBASE}TR_52" ]; then
0142 
0143     note="picked as render suggests directly under foot : bumps into rods" 
0144     moi="solidXJfixture:52:-3"
0145     cegs=9:16:0:100            
0146     gridscale=0.80
0147 
0148 elif [ "$GEOM" == "${GBASE}TR_41" ]; then
0149 
0150     note="picked as render looks on edge of foot : cross section shows poking out" 
0151     moi="solidXJfixture:41:-3"
0152     cegs=9:16:0:100            
0153     gridscale=0.80
0154 
0155 elif [ "$GEOM" == "${GBASE}PR_41" ]; then
0156 
0157     note="very clear impinge" 
0158     moi="solidXJfixture:41:-3"
0159     cegs=9:0:16:100      
0160     gridscale=0.80
0161 
0162 elif [ "$GEOM" == "${GBASE}ClosePR_41" ]; then
0163 
0164     note="very clear impinge" 
0165     moi="solidXJfixture:41:-3"
0166     cegs=9:0:16:100      
0167     gridscale=0.20
0168 
0169 elif [ "$GEOM" == "${GBASE}CloserPR_41" ]; then
0170 
0171     note="very clear impinge" 
0172     moi="solidXJfixture:41:-3"
0173     cegs=9:0:16:100      
0174     gridscale=0.10
0175 
0176 elif [ "$GEOM" == "${GBASE}PR_55" ]; then
0177 
0178     note="sXJfixture and sXJanchor are inside uni_acrylic1 and bump into uni1 "
0179     moi="solidXJfixture:55:-3"
0180     #    R:T:P        larger side of grid becomes horizontal : hence  PR  (not RP)
0181     cegs=9:0:16:100          
0182     gridscale=0.80
0183 
0184 elif [ "$GEOM" == "${GBASE}TR_55" ]; then
0185 
0186     note="clearly solidXJfixture and solidXJanchor are inside the foot of the stick uni_acrylic1"
0187     note1="but as slice is to the side as can be seen from PR_55 do not see much of the stick "
0188     moi="solidXJfixture:55:-3"
0189     #    R:T:P        larger side of grid becomes horizontal : hence  TR  (not RT)
0190     cegs=9:16:0:100            
0191     gridscale=0.80
0192 
0193 elif [ "$GEOM" == "${GBASE}PR_0" ]; then
0194 
0195     note="clear overlap : 3 rectangle : spurious intersects"
0196     moi="solidXJfixture:0:-3"
0197     #    R:T:P        larger side of grid becomes horizontal : hence  PR  (not RP)
0198     cegs=9:0:16:100          
0199     gridscale=0.10
0200 
0201 elif [ "$GEOM" == "${GBASE}TR_0" ]; then
0202 
0203     note="mid-chimney with ce 0,0,17696.94  : solidSJReceiver and solidXJfixture clearly overlapped "
0204     moi="solidXJfixture:0:-3"
0205     #    R:T:P        larger side of grid becomes horizontal : hence  TR  (not RT)
0206     cegs=9:16:0:100            
0207     gridscale=0.10
0208 
0209 elif [ "$GEOM" == "${GBASE}TP_0" ]; then
0210 
0211     note="crossed rectangles"
0212     moi="solidXJfixture:0:-3"
0213     #    R:T:P        larger side of grid becomes horizontal : hence  TP
0214     cegs=0:16:9:100            
0215     gridscale=0.10
0216 
0217 elif [ "$GEOM" == "${GBASE}TP_0_Rshift" ]; then
0218 
0219     note="crossed celtic crosses"
0220     moi="solidXJfixture:0:-3"
0221     #    R:T:P        larger side of grid becomes horizontal : hence  TP
0222     cegs=0:16:9:-2:0:0:100            
0223     gridscale=0.10
0224 
0225 elif [ "$GEOM" == "custom_${GBASE}XY" ]; then
0226 
0227     ## HMM : THIS IS KINDA MISPLACED BETTER IN A cxs_geochain.sh  
0228     note="all interior lines are spurious from coincidences"
0229     cfbase=$TMP/GeoChain/XJfixtureConstruction  
0230     moi=0
0231     #cegs=0:16:9:-2:0:0:100    # YZ with offset in X           
0232     cegs=0:16:9:0:0:0:100            
0233     gridscale=0.10
0234 
0235     ce_offset=1    # pre-tangential-frame approach  
0236     ce_scale=1 
0237 
0238     export ZZ=-33.5,6.5 
0239     #export YY=-65,-50,-35,0,35,50,65 
0240     #export YY=-45,-25,25,45 
0241 
0242 
0243 else
0244     echo $msg ERROR GEOM $GEOM is not handled  
0245     echo $msg comp $comp COMP $COMP
0246     echo $msg geom $geom GEOM $GEOM
0247     exit 1 
0248 fi
0249 
0250 
0251 export TOPLINE="COMP=$COMP ./cxs_solidXJfixture.sh  "
0252 
0253 if [ -n "$PUB" ]; then 
0254    source ./cxs_pub.sh $* 
0255 else
0256    echo $msg COMP $COMP GEOM $GEOM note $note PUB $PUB
0257    source ./cxs.sh $*
0258 fi
0259 
0260 
0261 if [ -z "$cfbase" ]; then
0262     echo $msg cfbase $cfbase is not defined : so are handling standard geometry : hence use cxs_grab.sh to grab from workstation to laptop
0263 else
0264     echo $msg cfbase $cfbase is defined : so are handling non-standard geometry : hence use tmp_grab.sh to grab from workstation to laptop
0265 fi 
0266 
0267 
0268 
0269 
0270 
0271