Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:01

0001 #!/bin/bash -l 
0002 usage(){ cat << EOU
0003 cxs_geochain.sh : CenterExtentGensteps onto GeoChain GPU geometry using CSGOptiXSimtraceTest with OptiX 7
0004 =============================================================================================================
0005 
0006 NB remember that must run BOTH : "oo" followed by "b7" (or the just now added "oo7") to rebuild 
0007 
0008 NOMASK=1 ./cxs_geochain.sh 
0009    use NOMASK to debug empty frames, eg when the genstep grid is too small for the geometry 
0010 
0011 SIM=1 ./cxs_geochain.sh 
0012    use pvplt_simple for debugging 
0013 
0014 MASK=t GEOM=AltXJfixtureConstruction_XYZ ./cxs_geochain.sh 
0015    3D pyvista view of intersects  
0016 
0017 GEOM=AltXJfixtureConstruction_XY ./cxs_geochain.sh 
0018 
0019 
0020 Local-Remote development
0021 -------------------------
0022 
0023 On laptop configure the GeoChain geometry to use and scp that config to remote::
0024 
0025     geom     ## edits the GEOM.txt config file
0026     geom scp 
0027 
0028 On remote GPU workstation, create the CSGFoundry geometry if not already done::
0029 
0030     gc   ## cd ~/opticks/GeoChain
0031     ./translate.sh                 # this uses the GEOM config from GEOM.txt
0032 
0033 On remote GPU workstation, run this cxs_geochain.sh script which runs the CSGOptiXSimtraceTest executable, with::
0034 
0035    cx
0036    ./cxs_geochain.sh 
0037 
0038 Grab outputs from remote GPU workstation to laptop for analysis::
0039 
0040    cx
0041    ./tmp_grab.sh 
0042    ./cxs_geochain.sh lrun    # runs python analysis on the the last grabbed geometry 
0043 
0044 Edit code on laptop and then scp to remote working copy without committing::
0045 
0046     ~/opticks/bin/git.py put       ## check the scp commands
0047     ~/opticks/bin/git.py put | sh  ## invoke the scp commands
0048 
0049     ## cross-node development without committing is useful to avoid 
0050     ## very many uninteresting "sync" commits 
0051 
0052 On remote GPU workstation::
0053 
0054    # rebuild the updated packages + b7 
0055 
0056 At appropriate junctures "git commit/push" on laptop, and 
0057 use "git checkout ." on remote to clean working copy of all changes before "git pull"
0058 to avoid merging. 
0059 
0060 EOU
0061 }
0062 
0063 
0064 source $PWD/../bin/GEOM.sh  ## sets GEOM envvar including the projection eg _XZ
0065 
0066 
0067 msg="=== $BASH_SOURCE :"
0068 
0069 
0070 moi=0   # intended to catch the first meshname (which for geochain is usually the only meshname)
0071 dx=0
0072 dy=0
0073 dz=0
0074 num_pho=100
0075 isel=0   # setting isel to zero, prevents skipping bnd 0 
0076 gridscale=0.1
0077 ce_offset=0
0078 ce_scale=1
0079 gsplot=1
0080 
0081 
0082 dcyl(){    gridscale=0.025 ; }
0083 bssc(){    gridscale=0.025 ; }
0084 Annulus(){ gridscale=0.15 ;  }  # enlarge genstep grid to fit the protruding unioned boxes
0085 default(){ echo -n  ; }
0086 
0087 pmt_default()
0088 {
0089     # everything else assume single PMT dimensions
0090     dz=-4
0091     isel=
0092     unset CXS_OVERRIDE_CE
0093     export CXS_OVERRIDE_CE=0:0:-130:320   ## fix at the full uncut ce 
0094 }
0095 
0096 gcn=${GEOM%%_*}  ## name up to the first underscore, assuming use of axis suffix  _XZ _YZ _XY _ZX _ZY _YX 
0097 
0098 case $GEOM in 
0099    dcyl_*)    cfbase=$TMP/CSGDemoTest/$gcn  && dcyl     ;;
0100    bssc_*)    cfbase=$TMP/CSGDemoTest/$gcn  && bssc     ;; 
0101    Annulus*)  cfbase=$TMP/GeoChain/$gcn     && Annulus  ;;    
0102    *)         cfbase=$TMP/GeoChain/$gcn     && default  ;;    
0103 esac
0104 
0105 case $GEOM in 
0106    bssc_XZ) note="HMM : box minus sub-sub cylinder NOT showing the spurious intersects, maybe nice round demo numbers effect" ;; 
0107    AnnulusBoxUnion_YZ) note="no spurious intersects seen" ;; 
0108    AnnulusBoxUnion_XY) note="no spurious intersects seen" ;; 
0109    AnnulusTwoBoxUnion_XY) note="no spurious intersects seen" ;; 
0110    AnnulusTwoBoxUnion_YZ) note="no spurious" ;; 
0111    AnnulusFourBoxUnion_XY) note="spurious intersects appear with four boxes, not with two" ;; 
0112    AnnulusFourBoxUnion_YZ) note="curious the spurious intersects visible in XY cross-section are not apparent in YZ cross-section" ;; 
0113    AnnulusOtherTwoBoxUnion_XY) note="no spurious intersects seen" ;; 
0114    AnnulusOtherTwoBoxUnion_XZ) note="no spurious intersects seen" ;; 
0115    AltXJfixtureConstruction_YZ) note="spurious intersects in YZ plane avoided with the Alt CSG modelling" ;; 
0116    AltXJfixtureConstruction_XZ) note="thin xbox cross piece apparent" ;; 
0117    AltXJfixtureConstruction_XY) note="some spurious remain between the curve of the outer tubs and the protruding boxes" ;; 
0118 esac
0119 
0120 case $GEOM in  
0121    *_XZ) cegs=16:0:9:$dx:$dy:$dz:$num_pho  ;;
0122    *_YZ) cegs=0:16:9:$dx:$dy:$dz:$num_pho  ;;
0123    *_XY) cegs=16:9:0:$dx:$dy:$dz:$num_pho  ;;
0124    *_ZX) cegs=9:0:16:$dx:$dy:$dz:$num_pho  ;;
0125    *_ZY) cegs=0:9:16:$dx:$dy:$dz:$num_pho  ;;
0126    *_YX) cegs=9:16:0:$dx:$dy:$dz:$num_pho  ;;
0127    *_XYZ) cegs=9:16:9:$dx:$dy:$dz:$num_pho ;;  
0128 esac
0129 # first axis named is the longer one that is presented on the horizontal in landscape aspect   
0130 
0131 echo $msg GEOM $GEOM gcn $gcn cegs $cegs cfbase $cfbase
0132 
0133 source ./cxs.sh 
0134 
0135