Back to home page

EIC code displayed by LXR

 
 

    


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

0001 usage(){ cat << EOU
0002 FewPMT.sh
0003 ==========
0004 
0005 This geomscript may depending on GEOM be sourced for example from::
0006 
0007    u4/tests/U4SimtraceTest.sh
0008    u4/tests/U4SimulateTest.sh
0009    g4cx/tests/G4CXTest.sh
0010 
0011 
0012 Moved LAYOUT control here to be in common 
0013 between U4SimulateTest.sh and U4SimtraceTest.sh 
0014 
0015 
0016 What to to do after changing geometry config
0017 ----------------------------------------------
0018 
0019 1. rerun U4SimtraceTest intersect geometries with:: 
0020 
0021    ./viz.sh runboth 
0022 
0023 2. rerun U4SimulateTest simulation results with::
0024 
0025    ./cf.sh    # default run_cf
0026 
0027 
0028 Which config where ?
0029 ----------------------
0030 
0031 Any geometry specific config belongs here.
0032 Photon generation while depending on geometry for targetting
0033 is sufficiently independent to make it better handled separately. 
0034 
0035 +-------------------+------------------------------+
0036 |  input envvars    |                              |
0037 +===================+==============================+
0038 | VERSION           |  0/1                         |
0039 +-------------------+------------------------------+
0040 | POM               |  0/1 traditional/multifilm   |
0041 +-------------------+------------------------------+
0042 
0043 +-------------------+------------------------------+
0044 |  output envvars   |                              |
0045 +===================+==============================+
0046 | LAYOUT            |  one_pmt/two_pmt             |
0047 +-------------------+------------------------------+
0048 | Many envvars      | Config geometry and fakes    |
0049 +-------------------+------------------------------+
0050 
0051 EOU
0052 }
0053 
0054 version=1
0055 pom=1 
0056 #layout=two_pmt  
0057 layout=one_pmt
0058 
0059 VERSION=${VERSION:-$version}
0060 POM=${POM:-$pom}
0061 LAYOUT=${LAYOUT:-$layout}
0062 
0063 export LAYOUT
0064 
0065 case $VERSION in
0066   0) version_desc="N=0 unnatural geometry : FastSim/jPOM" ;;
0067   1) version_desc="N=1 natural geometry : CustomBoundary" ;;
0068 esac
0069 
0070 case $POM in 
0071   0) pom_desc="POM:$POM traditional stop at photocathode : PMT with no innards"  ;;
0072   1) pom_desc="POM:$POM allow photons into PMT which has innards" ;; 
0073 esac
0074 
0075 fastcover=Cheese
0076 
0077 ## PMTSim declProp config of the PMTManager
0078 
0079 export hama_FastCoverMaterial=$fastcover
0080 export nnvt_FastCoverMaterial=$fastcover
0081 
0082 export hama_UsePMTOpticalModel=$pom     
0083 export nnvt_UsePMTOpticalModel=$pom   
0084 
0085 export hama_UsePMTNaturalGeometry=$version 
0086 export nnvt_UsePMTNaturalGeometry=$version 
0087 
0088 #geomlist=hamaLogicalPMT,nnvtLogicalPMT     # in one_pmt layout get NNVT with this 
0089 #geomlist=nnvtLogicalPMT,hamaLogicalPMT    # in one_pmt layout get HAMA with this
0090 #geomlist=nnvtLogicalPMT
0091 #geomlist=hamaLogicalPMT
0092 #geomlist=tub3LogicalPMT       # A/B match with circle_inwards_100 
0093 
0094 #geomlist=hmskLogicMaskVirtual
0095 #geomlist=nmskLogicMaskVirtual  
0096 #geomlist=xjacLogical
0097 geomlist=xjfcLogical
0098 
0099 export FewPMT_GEOMList=$geomlist
0100 
0101 # OBSERVATIONS ALL WITH SEventConfig::PropagateEpsilon default of 0.05 
0102 #delta=1e-3   # YUCK WITH tub3 G4CXTest.sh : DEGENERATE DEFAULT IN ORIGINAL C++ 
0103 #delta=1e-2   # ALSO YUCK WITH tub3 G4CXTest.sh
0104 #delta=4e-2   # TODO: TRY THIS : IS IT REALLY JUST WHEN DIP BELOW PropagateEpsilon THAT THINGS FALL TO PIECES ?
0105 #delta=5e-2   # OK WITH tub3 G4CXTest.sh  THIS EQUALS SEventConfig::PropagateEpsilon 
0106 #delta=1e-1   # OK WITH tub3 G4CXTest.sh
0107 delta=1       # OK WITH tub3 G4CXTest.sh   
0108 export Tub3inchPMTV3Manager__VIRTUAL_DELTA_MM=$delta
0109 
0110 
0111 #magic=0.01    # decrease to try to get LPMT apex degeneracy issue to appear standalone 
0112 #magic=0.04     # just less than PropagateEpsilon
0113 #magic=0.05    # initial default in original C++ of both HamamatsuMaskManager and NNVTMaskManager
0114 magic=0.1      # TRY A CONSERVATIVE DOUBLING OF THE CLEARANCE 
0115 #magic=1       # CHECK ITS WORKING BY MAKING EASILY VISIBLE IN simtrace plot : yes, but this could cause overlaps 
0116 export HamamatsuMaskManager__MAGIC_virtual_thickness_MM=$magic
0117 export NNVTMaskManager__MAGIC_virtual_thickness_MM=$magic
0118 
0119 #export U4Tree__DISABLE_OSUR_IMPLICIT=1  # HMM: THIS IS SOMEWHAT OF A HIDDEN PLACE TO DO THIS ? 
0120 
0121 
0122 vars="BASH_SOURCE VERSION version_desc POM pom_desc GEOM FewPMT_GEOMList LAYOUT "
0123 for var in $vars ; do printf "%-30s : %s \n" "$var" "${!var}" ; done
0124 
0125 
0126 aspect=1.7777777777777  # 1280/720
0127 
0128 
0129 
0130 case $LAYOUT in 
0131   one_pmt) loc="upper right" ;; 
0132         *) loc="skip"        ;; 
0133 esac
0134 export LOC=${LOC:-$loc}      # python ana level presentation, a bit out-of-place ?
0135 
0136 
0137 if [ "$LAYOUT" == "one_pmt" ]; then 
0138 
0139    export U4VolumeMaker_WrapRockWater_Rock_HALFSIDE=220     # formerly 210
0140    export U4VolumeMaker_WrapRockWater_Water_HALFSIDE=210    # formerly 200
0141    export U4VolumeMaker_WrapRockWater_BOXSCALE=$aspect,$aspect,1
0142 
0143 elif [ "$LAYOUT" == "two_pmt" ]; then 
0144 
0145    export U4VolumeMaker_WrapAroundItem_Rock_HALFSIDE=310  
0146    export U4VolumeMaker_WrapAroundItem_Water_HALFSIDE=300  
0147    export U4VolumeMaker_WrapAroundItem_Rock_BOXSCALE=$aspect,1,1
0148    export U4VolumeMaker_WrapAroundItem_Water_BOXSCALE=$aspect,1,1 
0149 
0150    export ${GEOM}_GEOMWrap=AroundCircle 
0151 
0152    export U4VolumeMaker_MakeTransforms_AroundCircle_radius=250
0153    export U4VolumeMaker_MakeTransforms_AroundCircle_numInRing=2
0154    export U4VolumeMaker_MakeTransforms_AroundCircle_fracPhase=0
0155 
0156 else
0157    echo $BASH_SOURCE LAYOUT $LAYOUT not handled 
0158 fi 
0159 
0160 # Simtrace config
0161 export CEGS=16:0:9:10   
0162 
0163 
0164 if [ "$VERSION" == "0" ]; then 
0165 
0166     # jPOM config
0167     ModelTriggerSimple=0  # default 
0168     ModelTriggerBuggy=1
0169     ModelTrigger_IMPL=$ModelTriggerSimple
0170     #ModelTrigger_IMPL=$ModelTriggerBuggy
0171 
0172     export junoPMTOpticalModel__PIDX_ENABLED=1
0173     export junoPMTOpticalModel__ModelTrigger_IMPL=$ModelTrigger_IMPL
0174     export G4FastSimulationManagerProcess_ENABLE=1  
0175 
0176     #export U4Recorder__FAKES_SKIP=1
0177     #export U4Recorder__ClassifyFake_FindPV_r=1  ## this is slow, but it finds fakes better, use in standalone testing 
0178     ## export U4Recorder__FAKES="$fakes"  formerly used manual config of fakes skipping
0179 
0180 fi 
0181 
0182 # standalone access to PMT data 
0183 #export PMTSimParamData_BASE=$HOME/.opticks/GEOM/J007/CSGFoundry/SSim/juno
0184 export PMTSimParamData_BASE=$HOME/.opticks/GEOM/V1J009/CSGFoundry/SSim/extra/jpmt
0185 
0186 
0187