Back to home page

EIC code displayed by LXR

 
 

    


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

0001 ##
0002 ## Copyright (c) 2019 Opticks Team. All Rights Reserved.
0003 ##
0004 ## This file is part of Opticks
0005 ## (see https://bitbucket.org/simoncblyth/opticks).
0006 ##
0007 ## Licensed under the Apache License, Version 2.0 (the "License"); 
0008 ## you may not use this file except in compliance with the License.  
0009 ## You may obtain a copy of the License at
0010 ##
0011 ##   http://www.apache.org/licenses/LICENSE-2.0
0012 ##
0013 ## Unless required by applicable law or agreed to in writing, software 
0014 ## distributed under the License is distributed on an "AS IS" BASIS, 
0015 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0016 ## See the License for the specific language governing permissions and 
0017 ## limitations under the License.
0018 ##
0019 
0020 pmt-src(){      echo ana/pmt/pmt.bash ; }
0021 pmt-source(){   echo ${BASH_SOURCE:-$(opticks-home)/$(pmt-src)} ; }
0022 pmt-vi(){       vi $(pmt-source) ; }
0023 
0024 
0025 pmt-env(){      olocal- ; }
0026 pmt-usage(){ cat << EOU
0027 
0028 Analytic PMT Geometry Description
0029 ======================================
0030 
0031 TODO
0032 -----
0033 
0034 * place xml PMT sources into opticksdata where can be generally accessible
0035 
0036 
0037 FUNCTIONS
0038 -----------
0039 
0040 *pmt-analytic*
0041      runs analytic.py converting detdesc hemi-pmt.xml into parts buffer $IDPATH/GPmt/0/GPmt.npy 
0042      using more nuanced translation better suited to surface geometry lingo 
0043 
0044 Usage example::
0045 
0046     simon:ana blyth$ pmt-analytic --apmtidx=3
0047     /Users/blyth/opticks/ana/pmt/analytic.py --apmtidx=3
0048 
0049     Aiming to write serialized analytic PMT to below apmtpath
0050     $OPTICKS_INSTALL_PREFIX/opticksdata/export/DayaBay/GPmt/3/GPmt.npy
0051 
0052     Enter YES to proceed... 
0053 
0054 
0055 Skip the prompt::
0056 
0057      pmt-analytic --yes
0058 
0059 
0060 
0061 TESTS
0062 ------
0063 
0064 *pmt-parts*
0065      runs tree.py converting detdesc hemi-pmt.xml into parts buffer 
0066      using a direct translation approach, does not save the PMT, used
0067      just for testing conversion 
0068 
0069 *pmt-dd*
0070      test detdesc parsing 
0071 
0072 *pmt-gcsg*
0073      does nothing other than testing gcsg.py is valid python  
0074 
0075 
0076 See Also
0077 ---------
0078 
0079 * opticks/notes/issues/tpmt_broken_by_OpticksCSG_enum_move.rst
0080 
0081 
0082 Sources
0083 --------
0084 
0085 analytic.py
0086      top level steering for pmt-analytic, using tree.py and dd.py 
0087 
0088 tree.py 
0089      Assembles tree from Nodes using volume path digest trick
0090 
0091      Buf(np.ndarray)
0092      Node
0093      Tree
0094 
0095 gcsg.py
0096      serialization of CSG tree, so far not used GPU side, 
0097      (the part buffer representation is used GPU side)
0098 
0099      CSG serializarion is however used via ggeo/GCSG for 
0100      the creation the Geant4 test geometry, including the PMT
0101 
0102      NB ggeo/GCSG was my initial take on CSG that never worked on GPU, 
0103      the new way npy/NCSG was designed for GPU using a binary tree
0104      serialization to get over to GPU side 
0105      
0106      cfg4/CMaker
0107      cfg4/CPropLib
0108      cfg4/CTestDetector
0109 
0110 
0111 dd.py 
0112      detdesc XML parsing using lxml, and Dayabay PMT centric boolean partitioning 
0113      into single basis shape parts
0114 
0115      Parts(list)
0116      Uncoincide
0117      Att
0118      Elem
0119      Logvol(Elem)
0120      Physvol(Elem)
0121      Union(Elem)
0122      Intersection(Elem)
0123      Parameter(Elem)
0124      Primitive(Elem)  
0125      Sphere(Primitive)
0126      Tubs(Primitive)
0127      PosXYZ(Elem)
0128      Context
0129      Dddb(Elem)
0130 
0131 plot.py 
0132      PMT basis shape and also mesh 2d plots,  
0133 
0134 
0135 
0136 
0137 
0138 Checking the opticksdata/export/DayaBay/GPmt serializations
0139 -------------------------------------------------------------
0140 
0141 Used::
0142 
0143    pmt-analytic 
0144 
0145 
0146 ::
0147 
0148     simon:issues blyth$ cd /usr/local/opticks/opticksdata/export/DayaBay/GPmt
0149     simon:GPmt blyth$ l
0150     total 0
0151     drwxr-xr-x   8 blyth  staff  272 Apr 10 15:56 2
0152     drwxr-xr-x   8 blyth  staff  272 Mar 16 13:15 1
0153     drwxr-xr-x  12 blyth  staff  408 Jul  5  2016 0
0154     simon:GPmt blyth$ diff -r 1 2 
0155     simon:GPmt blyth$ diff -r 0 1
0156     Binary files 0/GPmt.npy and 1/GPmt.npy differ
0157     Only in 0: GPmt.txt
0158     Only in 0: GPmt_check.npy
0159     Only in 0: GPmt_check.txt
0160     Only in 0: GPmt_csg.txt
0161     simon:GPmt blyth$ 
0162 
0163 
0164 
0165 Serialization
0166 ----------------
0167 
0168 ::
0169 
0170     simon:PMT blyth$ l /tmp/blyth/opticks/GPmt/0/
0171     total 48
0172     -rw-r--r--  1 blyth  wheel   848 Mar 15 16:35 GPmt.npy
0173     -rw-r--r--  1 blyth  wheel   289 Mar 15 16:35 GPmt_boundaries.txt
0174     -rw-r--r--  1 blyth  wheel  1168 Mar 15 16:35 GPmt_csg.npy
0175     -rw-r--r--  1 blyth  wheel    74 Mar 15 16:35 GPmt_lvnames.txt
0176     -rw-r--r--  1 blyth  wheel    47 Mar 15 16:35 GPmt_materials.txt
0177     -rw-r--r--  1 blyth  wheel    74 Mar 15 16:35 GPmt_pvnames.txt
0178 
0179 ::
0180 
0181     delta:~ blyth$ cd /usr/local/opticks/opticksdata/export/DayaBay/GPmt/0/
0182     delta:0 blyth$ l
0183     total 80
0184 
0185     -rw-r--r--  1 blyth  staff   848 Jul  5  2016 GPmt_check.npy
0186     -rw-r--r--  1 blyth  staff   289 Jul  5  2016 GPmt_check.txt
0187 
0188 
0189     -rw-r--r--  1 blyth  staff   289 Jul  5  2016 GPmt.txt             # renamed to _boundaries ?
0190     -rw-r--r--  1 blyth  staff    47 Jul  5  2016 GPmt_csg.txt         # renamed to _materials ? 
0191 
0192     -rw-r--r--  1 blyth  staff   848 Jul  5  2016 GPmt.npy
0193     -rw-r--r--  1 blyth  staff   289 Jul  5  2016 GPmt_boundaries.txt
0194     -rw-r--r--  1 blyth  staff  1168 Jul  5  2016 GPmt_csg.npy
0195     -rw-r--r--  1 blyth  staff    74 Jul  5  2016 GPmt_lvnames.txt
0196     -rw-r--r--  1 blyth  staff    47 Jul  5  2016 GPmt_materials.txt
0197     -rw-r--r--  1 blyth  staff    74 Jul  5  2016 GPmt_pvnames.txt
0198 
0199     delta:0 blyth$ cat GPmt_csg.txt  # where is this one written ?  appears to be former name for GPmt_materials.txt
0200     Pyrex
0201     Vacuum
0202     Bialkali
0203     OpaqueVacuum
0204     OpaqueVacuum
0205 
0206     delta:0 blyth$ wc -l *.txt    # hmm seems wc actually counts newlines, so add one to all the below
0207           11 GPmt.txt
0208           11 GPmt_boundaries.txt
0209           11 GPmt_check.txt
0210            4 GPmt_csg.txt
0211            4 GPmt_lvnames.txt
0212            4 GPmt_materials.txt
0213            4 GPmt_pvnames.txt
0214           49 total
0215 
0216     delta:0 blyth$ head -1 *.npy
0217     ==> GPmt.npy <==
0218     ?NUMPYF{'descr': '<f4', 'fortran_order': False, 'shape': (12, 4, 4), }      
0219 
0220     ==> GPmt_check.npy <==
0221     ?NUMPYF{'descr': '<f4', 'fortran_order': False, 'shape': (12, 4, 4), }      
0222 
0223     ==> GPmt_csg.npy <==
0224     ?NUMPYF{'descr': '<f4', 'fortran_order': False, 'shape': (17, 4, 4), }      
0225     delta:0 blyth$ 
0226 
0227 
0228 
0229 Comparing existing serializations
0230 --------------------------------------
0231 
0232 All look effectively the same::
0233 
0234     simon:pmt blyth$ l /usr/local/opticks/opticksdata/export/DayaBay_VGDX_20140414-1300/g4_00.96ff965744a2f6b78c24e33c80d3a4cd.dae/GPmt/0/
0235     total 48
0236     -rw-r--r--  1 blyth  staff   848 Mar 15 16:27 GPmt.npy
0237     -rw-r--r--  1 blyth  staff   289 Mar 15 16:27 GPmt_boundaries.txt
0238     -rw-r--r--  1 blyth  staff  1168 Mar 15 16:27 GPmt_csg.npy
0239     -rw-r--r--  1 blyth  staff    74 Mar 15 16:27 GPmt_lvnames.txt
0240     -rw-r--r--  1 blyth  staff    47 Mar 15 16:27 GPmt_materials.txt
0241     -rw-r--r--  1 blyth  staff    74 Mar 15 16:27 GPmt_pvnames.txt
0242     simon:pmt blyth$ 
0243     simon:pmt blyth$ 
0244     simon:pmt blyth$ l $TMP/GPmt/0/
0245     total 48
0246     -rw-r--r--  1 blyth  wheel   848 Mar 15 17:31 GPmt.npy
0247     -rw-r--r--  1 blyth  wheel   289 Mar 15 17:31 GPmt_boundaries.txt
0248     -rw-r--r--  1 blyth  wheel  1168 Mar 15 17:31 GPmt_csg.npy
0249     -rw-r--r--  1 blyth  wheel    74 Mar 15 17:31 GPmt_lvnames.txt
0250     -rw-r--r--  1 blyth  wheel    47 Mar 15 17:31 GPmt_materials.txt
0251     -rw-r--r--  1 blyth  wheel    74 Mar 15 17:31 GPmt_pvnames.txt
0252     simon:pmt blyth$ diff -r --brief $IDPATH/GPmt/0 $TMP/GPmt/0
0253     simon:pmt blyth$ 
0254     simon:pmt blyth$ 
0255     simon:pmt blyth$ l /usr/local/opticks/opticksdata/export/DayaBay/GPmt/0/
0256     total 80
0257     -rw-r--r--  1 blyth  staff   848 Jul  5  2016 GPmt.npy
0258     -rw-r--r--  1 blyth  staff   289 Jul  5  2016 GPmt.txt
0259     -rw-r--r--  1 blyth  staff   289 Jul  5  2016 GPmt_boundaries.txt
0260     -rw-r--r--  1 blyth  staff   848 Jul  5  2016 GPmt_check.npy
0261     -rw-r--r--  1 blyth  staff   289 Jul  5  2016 GPmt_check.txt
0262     -rw-r--r--  1 blyth  staff  1168 Jul  5  2016 GPmt_csg.npy
0263     -rw-r--r--  1 blyth  staff    47 Jul  5  2016 GPmt_csg.txt
0264     -rw-r--r--  1 blyth  staff    74 Jul  5  2016 GPmt_lvnames.txt
0265     -rw-r--r--  1 blyth  staff    47 Jul  5  2016 GPmt_materials.txt
0266     -rw-r--r--  1 blyth  staff    74 Jul  5  2016 GPmt_pvnames.txt
0267 
0268     simon:pmt blyth$ echo $OPTICKS_DATA
0269     /usr/local/opticks/opticksdata
0270     simon:pmt blyth$ 
0271     simon:pmt blyth$ diff -r --brief $OPTICKS_DATA/export/DayaBay/GPmt/0/ $TMP/GPmt/0/
0272     Only in /usr/local/opticks/opticksdata/export/DayaBay/GPmt/0/: GPmt.txt
0273     Only in /usr/local/opticks/opticksdata/export/DayaBay/GPmt/0/: GPmt_check.npy
0274     Only in /usr/local/opticks/opticksdata/export/DayaBay/GPmt/0/: GPmt_check.txt
0275     Only in /usr/local/opticks/opticksdata/export/DayaBay/GPmt/0/: GPmt_csg.txt
0276 
0277 
0278 
0279 
0280 
0281 History
0282 --------
0283 
0284 The *pmt* directory hails from **env/nuwa/detdesc/pmt**
0285 
0286 
0287 Usage
0288 ------
0289 
0290 To visualize analytic PMT in a box, and test ggeo- optixrap- loading::
0291 
0292     ggv-pmt () 
0293     { 
0294         type $FUNCNAME;
0295         ggv --tracer --test --eye 0.5,0.5,0.0
0296     }
0297 
0298 
0299 TODO debug why below is failing::
0300 
0301     ggv --restrictmesh 1 --analyticmesh 1  
0302           # misses a GPmt associated to the MM
0303 
0304     ggv --test --eye 0.5,0.5,0.0 --animtimemax 10
0305 
0306 
0307 High Level CSG Persisting for G4 geometry
0308 -------------------------------------------
0309 
0310 * how to represent a single node (of the 5 separate nodes) ?
0311 
0312   * primitives and operations
0313 
0314 * tree of nodes  
0315 
0316 
0317 PMT Modelling
0318 -----------------------
0319 
0320 Detdesc::
0321 
0322     lvPmtHemi                 (Pyrex)  union of 3 sphere-intersection and tubs
0323         pvPmtHemiVacuum
0324 
0325     lvPmtHemiVacuum          (Vacuum) union of 3 sphere-intersection and tubs 
0326         pvPmtHemiCathode
0327         pvPmtHemiBottom
0328         pvPmtHemiDynode
0329 
0330         [Vacuum radii names match the Pyrex with "vac" suffix]    
0331 
0332             PmtHemiBellyROC : 102.000000 
0333          PmtHemiBellyROCvac : 99.000000 
0334 
0335              PmtHemiFaceROC : 131.000000 
0336           PmtHemiFaceROCvac : 128.000000 
0337 
0338       PmtHemiGlassThickness : 3.000000 
0339     PmtHemiCathodeThickness : 0.050000 
0340 
0341 
0342 
0343     lvPmtHemiCathode        (Bialkali) union of 2 partial spherical shells
0344 
0345           outerRadius="PmtHemiFaceROCvac"
0346           innerRadius="PmtHemiFaceROCvac-PmtHemiCathodeThickness"
0347 
0348           outerRadius="PmtHemiBellyROCvac"
0349           innerRadius="PmtHemiBellyROCvac-PmtHemiCathodeThickness"      
0350 
0351       **OUTER SURFACE OF CATHODE COINCIDES WITH VACUUM/PYREX INTERFACE* 
0352         
0353 
0354     lvPmtHemiBottom        (OpaqueVacuum) partial spherical shell
0355 
0356           outerRadius="PmtHemiBellyROCvac"
0357           innerRadius="PmtHemiBellyROCvac-1*mm"
0358 
0359       **OUTER SURFACE OF BOTTOM COINCIDES WITH VACUUM/PYREX INTERFACE* 
0360            
0361 
0362 
0363 
0364     lvPmtHemiDynode        (OpaqueVacuum) tubs
0365 
0366           outerRadius="PmtHemiDynodeRadius" 
0367 
0368 
0369             PmtHemiDynodeRadius : 27.500000 
0370 
0371 
0372 
0373  PmtHemiBellyCathodeAngleDelta : 26.735889 
0374   PmtHemiBellyCathodeAngleStart : 55.718631 
0375            PmtHemiBellyIntAngle : 82.454520 
0376                 PmtHemiBellyOff : 13.000000 
0377          PmtHemiCathodeDiameter : 190.000000 
0378         PmtHemiFaceCathodeAngle : 40.504998 
0379                  PmtHemiFaceOff : 56.000000 
0380 
0381               PmtHemiFaceTopOff : 55.046512 
0382          PmtHemiGlassBaseLength : 169.000000 
0383          PmtHemiGlassBaseRadius : 42.250000 
0384 
0385 
0386 Partitioned Boundary Translation
0387 ---------------------------------
0388 
0389 Cathode Z region, 3 boundary spherical parts::
0390 
0391     MineralOil///Pyrex
0392     Pyrex/lvPmtHemiCathodeSensorSurface//Bialkali
0393     Bialkali///Vacuum 
0394 
0395     * different from literal translation:
0396 
0397       MineralOil///Pyrex
0398       Pyrex///Vacuum                                     <-- coincident
0399       Vacuum/lvPmtHemiCathodeSensorSurface//Bialkali     <-- coincident
0400       Bialkali///Vacuum 
0401 
0402 Bottom Z region, 3 boundary spherical parts::
0403 
0404     MineralOil///Pyrex
0405     Pyrex///OpaqueVacuum  
0406     OpaqueVacuum///Vacuum 
0407 
0408     * different from literal translation (with zero size slice Vacuum)
0409 
0410       MineralOil///Pyrex
0411       Pyrex///Vacuum                <--- coincident
0412       Vacuum///OpaqueVacuum         <--- coincident
0413       OpaqueVacuum///Vacuum 
0414 
0415     * Bottom OpaqueVacuum is 1mm thick, but Cathode is 0.05mm stuck to inside of Pyrex
0416       so 0.95mm of protuding OpaqueVacuum : what will happen to photons hitting that 
0417       protuberance ...  
0418       BUT the Cathode in "std" model absorbs/detects all photons that hit it, so 
0419       probably do not need to worry much about loose edges inside ?
0420 
0421 
0422 Dynode Z region, 3 boundary tubs parts::
0423 
0424     MineralOil///Pyrex
0425     Pyrex///Vacuum
0426     Vacuum///OpaqueVacuum
0427  
0428     * dynode tubs overlaps the bottom spherical shell
0429 
0430 
0431 
0432 What about joining up the Z regions ? 
0433 
0434 * Does the BBox approach auto-close open ends ? need to shoot lots of photons and see..
0435 
0436 * MineralOil///Pyrex is no problem, as Z splits chosen for contiguity 
0437  
0438 
0439 
0440 Implementation
0441 ----------------
0442 
0443 * Surface model identities must diverge from Triangulated due to translation differences
0444   so need to label the parts with these boundaries  
0445 
0446 Original direct translation::
0447 
0448     Part Sphere        Pyrex    pmt-hemi-bot-glass_part_zleft    [0, 0, 69.0] r: 102.0 sz:  0.0 bb:BBox      [-101.17 -101.17  -23.84]      [ 101.17  101.17   56.  ] xyz [  0.     0.    16.08]
0449     Part Sphere        Pyrex  pmt-hemi-top-glass_part_zmiddle    [0, 0, 43.0] r: 102.0 sz:  0.0 bb:BBox      [-101.17 -101.17   56.  ]      [ 101.17  101.17  100.07] xyz [  0.     0.    78.03]
0450     Part Sphere        Pyrex  pmt-hemi-face-glass_part_zright       [0, 0, 0] r: 131.0 sz:  0.0 bb:BBox      [ -84.54  -84.54  100.07]      [  84.54   84.54  131.  ] xyz [   0.      0.    115.53]
0451     Part   Tubs        Pyrex               pmt-hemi-base_part   [0, 0, -84.5] r: 42.25 sz:169.0 bb:BBox      [ -42.25  -42.25 -169.  ]         [ 42.25  42.25 -23.84] xyz [  0.     0.   -96.42]
0452 
0453     Part Sphere       Vacuum    pmt-hemi-face-vac_part_zright       [0, 0, 0] r: 128.0 sz:  0.0 bb:BBox         [-82.29 -82.29  98.05]      [  82.29   82.29  128.  ] xyz [   0.      0.    113.02]
0454     Part Sphere       Vacuum    pmt-hemi-top-vac_part_zmiddle    [0, 0, 43.0] r:  99.0 sz:  0.0 bb:BBox         [-98.14 -98.14  56.  ]         [ 98.14  98.14  98.05] xyz [  0.     0.    77.02]
0455     Part Sphere       Vacuum      pmt-hemi-bot-vac_part_zleft    [0, 0, 69.0] r:  99.0 sz:  0.0 bb:BBox         [-98.14 -98.14 -21.89]         [ 98.14  98.14  56.  ] xyz [  0.     0.    17.06]
0456     Part   Tubs       Vacuum           pmt-hemi-base-vac_part   [0, 0, -81.5] r: 39.25 sz:166.0 bb:BBox      [ -39.25  -39.25 -164.5 ]         [ 39.25  39.25 -21.89] xyz [  0.     0.   -93.19]
0457 
0458     Part Sphere     Bialkali       pmt-hemi-cathode-face_part       [0, 0, 0] r: 128.0 sz:  0.0 bb:BBox         [-82.29 -82.29  98.05]      [  82.29   82.29  128.  ] xyz [   0.      0.    113.02]
0459     Part Sphere     Bialkali       pmt-hemi-cathode-face_part       [0, 0, 0] r:127.95 sz:  0.0 bb:BBox         [-82.25 -82.25  98.01]      [  82.25   82.25  127.95] xyz [   0.      0.    112.98]
0460     Part Sphere     Bialkali      pmt-hemi-cathode-belly_part    [0, 0, 43.0] r:  99.0 sz:  0.0 bb:BBox         [-98.14 -98.14  56.  ]         [ 98.14  98.14  98.05] xyz [  0.     0.    77.02]
0461     Part Sphere     Bialkali      pmt-hemi-cathode-belly_part    [0, 0, 43.0] r: 98.95 sz:  0.0 bb:BBox         [-98.09 -98.09  55.99]         [ 98.09  98.09  98.01] xyz [  0.   0.  77.]
0462 
0463     Part Sphere OpaqueVacuum                pmt-hemi-bot_part    [0, 0, 69.0] r:  99.0 sz:  0.0 bb:BBox         [-98.14 -98.14 -30.  ]         [ 98.14  98.14  56.  ] xyz [  0.   0.  13.]
0464     Part Sphere OpaqueVacuum                pmt-hemi-bot_part    [0, 0, 69.0] r:  98.0 sz:  0.0 bb:BBox         [-97.15 -97.15 -29.  ]         [ 97.15  97.15  56.13] xyz [  0.     0.    13.57]
0465     Part   Tubs OpaqueVacuum             pmt-hemi-dynode_part   [0, 0, -81.5] r:  27.5 sz:166.0 bb:BBox         [ -27.5  -27.5 -164.5]            [ 27.5  27.5   1.5] xyz [  0.    0.  -81.5]
0466 
0467 
0468 With coincident surface removal and boundary name rejig and persisting as bndspec list GPmt.txt::
0469 
0470     Part Sphere        Pyrex    pmt-hemi-bot-glass_part_zleft    [0, 0, 69.0] r: 102.0 sz:  0.0 BB      [-101.17 -101.17  -23.84]      [ 101.17  101.17   56.  ] z  16.08 MineralOil///Pyrex
0471     Part Sphere        Pyrex  pmt-hemi-top-glass_part_zmiddle    [0, 0, 43.0] r: 102.0 sz:  0.0 BB      [-101.17 -101.17   56.  ]      [ 101.17  101.17  100.07] z  78.03 MineralOil///Pyrex
0472     Part Sphere        Pyrex  pmt-hemi-face-glass_part_zright       [0, 0, 0] r: 131.0 sz:  0.0 BB      [ -84.54  -84.54  100.07]      [  84.54   84.54  131.  ] z 115.53 MineralOil///Pyrex
0473     Part   Tubs        Pyrex               pmt-hemi-base_part   [0, 0, -84.5] r: 42.25 sz:169.0 BB      [ -42.25  -42.25 -169.  ]         [ 42.25  42.25 -23.84] z -96.42 MineralOil///Pyrex
0474 
0475     Part Sphere       Vacuum      pmt-hemi-bot-vac_part_zleft    [0, 0, 69.0] r:  99.0 sz:  0.0 BB         [-98.14 -98.14 -21.89]         [ 98.14  98.14  56.  ] z  17.06 Pyrex///OpaqueVacuum
0476     Part Sphere       Vacuum    pmt-hemi-top-vac_part_zmiddle    [0, 0, 43.0] r:  99.0 sz:  0.0 BB         [-98.14 -98.14  56.  ]         [ 98.14  98.14  98.05] z  77.02 Pyrex/lvPmtHemiCathodeSensorSurface//Bialkali
0477     Part Sphere       Vacuum    pmt-hemi-face-vac_part_zright       [0, 0, 0] r: 128.0 sz:  0.0 BB         [-82.29 -82.29  98.05]      [  82.29   82.29  128.  ] z 113.02 Pyrex/lvPmtHemiCathodeSensorSurface//Bialkali
0478     Part   Tubs       Vacuum           pmt-hemi-base-vac_part   [0, 0, -81.5] r: 39.25 sz:166.0 BB      [ -39.25  -39.25 -164.5 ]         [ 39.25  39.25 -21.89] z -93.19 Pyrex///Vacuum
0479 
0480     Part Sphere     Bialkali       pmt-hemi-cathode-face_part       [0, 0, 0] r:127.95 sz:  0.0 BB         [-82.25 -82.25  98.01]      [  82.25   82.25  127.95] z 112.98 Bialkali///Vacuum
0481     Part Sphere     Bialkali      pmt-hemi-cathode-belly_part    [0, 0, 43.0] r: 98.95 sz:  0.0 BB         [-98.09 -98.09  55.99]         [ 98.09  98.09  98.01] z  77.00 Bialkali///Vacuum
0482 
0483     Part Sphere OpaqueVacuum                pmt-hemi-bot_part    [0, 0, 69.0] r:  98.0 sz:  0.0 BB         [-97.15 -97.15 -29.  ]         [ 97.15  97.15  56.13] z  13.57 OpaqueVacuum///Vacuum
0484     Part   Tubs OpaqueVacuum             pmt-hemi-dynode_part   [0, 0, -81.5] r:  27.5 sz:166.0 BB         [ -27.5  -27.5 -164.5]            [ 27.5  27.5   1.5] z -81.50 Vacuum///OpaqueVacuum
0485 
0486     [tree.py +214                 save ] saving to $IDPATH/GPmt/0/GPmt.npy shape (12, 4, 4) 
0487     [tree.py +217                 save ] saving boundaries to /usr/local/env/geant4/geometry/export/DayaBay_VGDX_20140414-1300/g4_00.96ff965744a2f6b78c24e33c80d3a4cd.dae/GPmt/0/GPmt.txt 
0488 
0489 
0490 EOU
0491 }
0492 
0493 pmt-cd(){  cd $(pmt-edir); }
0494 pmt-c(){   cd $(pmt-edir); }
0495 pmt-ocd(){ cd $(pmt-dir) ; }
0496 
0497 pmt-xml(){ vi $(pmt-dir)/hemi-pmt.xml ; }
0498 
0499 pmt-dir(){ echo $(local-base)/env/dyb/NuWa-trunk/dybgaudi/Detector/XmlDetDesc/DDDB/PMT ; }
0500 pmt-edir(){ echo $(opticks-home)/ana/pmt ; }
0501 
0502 pmt-pdf(){ open ~/opticks_refs/Detdesc_Solids.pdf ~/opticks_refs/Detdesc_lhcbdtd.pdf  ; }
0503 pmt-gg(){ open ~/opticks_refs/GDMLmanual.pdf ; }
0504 
0505 pmt-ddir(){ echo $(dirname $(pmt-dir)) ; }
0506 pmt-dcd(){  cd $(pmt-ddir) ; }
0507 
0508 pmt-dfind(){
0509   local iwd=$PWD
0510   pmt-dcd
0511   find . -name '*.xml' -exec grep -H ${1:-lvPmtHemi} {} \; 
0512 }
0513 
0514 pmt-export(){  
0515     echo -n 
0516     # PMT_DIR env setup moved into opticks_main in ana.base
0517 }
0518 
0519 pmt-i(){
0520    pmt-ecd
0521    i
0522 }
0523 
0524 
0525 # after moving env setup into python means no need to bash runners, just directly run the python
0526 #
0527 #pmt-run(){      python $(pmt-edir)/${1:-pmt}.py  ; }
0528 #pmt-ddpart(){   python $(pmt-edir)/ddpart.py  ; }
0529 #pmt-treepart(){ python $(pmt-edir)/treepart.py $*  ; }
0530 pmt-analytic(){ python $(pmt-edir)/analytic.py $*  ; }
0531 #pmt-gcsg(){     python $(pmt-edir)/gcsg.py $*  ; }
0532 #
0533