Back to home page

EIC code displayed by LXR

 
 

    


Warning, /eic-opticks/ana/pmt/treebase.rst is written in an unsupported language. File is not indexed.

0001 Treebase
0002 ===========
0003 
0004 ::
0005 
0006     In [1]: run treebase.py
0007     ...
0008     In [2]: tr.root
0009     Out[2]: Node  0 : dig 8c5f pig d41d : LV lvPmtHemi                           Pyrex None : None  : None 
0010 
0011     In [5]: tr.byindex
0012     Out[5]: 
0013     {0: Node  0 : dig f34b pig d41d : LV lvPmtHemi                           Pyrex None : None  : None ,
0014      1: Node  1 : dig fafa pig f34b : LV lvPmtHemiVacuum                    Vacuum None : None  : None ,
0015      2: Node  2 : dig 324d pig fafa : LV lvPmtHemiCathode                 Bialkali DsPmtSensDet : None  : None ,
0016      3: Node  3 : dig 9e61 pig fafa : LV lvPmtHemiBottom              OpaqueVacuum None : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0    ,
0017      4: Node  4 : dig 5e29 pig fafa : LV lvPmtHemiDynode              OpaqueVacuum None : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5    }
0018 
0019     In [6]: tr.registry
0020     Out[6]: 
0021     {'324d9022d803eae989b540bbb2375f38': Node  2 : dig 324d pig fafa : LV lvPmtHemiCathode                 Bialkali DsPmtSensDet : None  : None ,
0022      '5e291f5b9bbedf27f720e5dceb65ad56': Node  4 : dig 5e29 pig fafa : LV lvPmtHemiDynode              OpaqueVacuum None : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5    ,
0023      '9e612c43301f13a23a5fd41e7ea59404': Node  3 : dig 9e61 pig fafa : LV lvPmtHemiBottom              OpaqueVacuum None : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0    ,
0024      'f34ba27750136ebdc5bd9f3119f2c559': Node  0 : dig f34b pig d41d : LV lvPmtHemi                           Pyrex None : None  : None ,
0025      'fafaa4fcd3682ac3f89da9afb9680e9a': Node  1 : dig fafa pig f34b : LV lvPmtHemiVacuum                    Vacuum None : None  : None }
0026 
0027     In [7]: 
0028 
0029 
0030 Recursive dumper::
0031 
0032     In [20]: tr.get(0).traverse()
0033     [2017-04-14 19:51:48,181] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 0 Node  0 : dig f34b pig d41d : LV lvPmtHemi                           Pyrex None : None  : None  
0034     [2017-04-14 19:51:48,181] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 1 Node  1 : dig fafa pig f34b : LV lvPmtHemiVacuum                    Vacuum None : None  : None  
0035     [2017-04-14 19:51:48,181] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 2 Node  2 : dig 324d pig fafa : LV lvPmtHemiCathode                 Bialkali DsPmtSensDet : None  : None  
0036     [2017-04-14 19:51:48,181] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 2 Node  3 : dig 9e61 pig fafa : LV lvPmtHemiBottom              OpaqueVacuum None : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     
0037     [2017-04-14 19:51:48,181] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 2 Node  4 : dig 5e29 pig fafa : LV lvPmtHemiDynode              OpaqueVacuum None : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     
0038 
0039     In [21]: tr.get(1).traverse()
0040     [2017-04-14 19:52:01,124] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 0 Node  1 : dig fafa pig f34b : LV lvPmtHemiVacuum                    Vacuum None : None  : None  
0041     [2017-04-14 19:52:01,124] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 1 Node  2 : dig 324d pig fafa : LV lvPmtHemiCathode                 Bialkali DsPmtSensDet : None  : None  
0042     [2017-04-14 19:52:01,125] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 1 Node  3 : dig 9e61 pig fafa : LV lvPmtHemiBottom              OpaqueVacuum None : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     
0043     [2017-04-14 19:52:01,125] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 1 Node  4 : dig 5e29 pig fafa : LV lvPmtHemiDynode              OpaqueVacuum None : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     
0044 
0045     In [22]: tr.get(2).traverse()
0046     [2017-04-14 19:52:17,660] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 0 Node  2 : dig 324d pig fafa : LV lvPmtHemiCathode                 Bialkali DsPmtSensDet : None  : None  
0047 
0048     In [23]: tr.get(3).traverse()
0049     [2017-04-14 19:52:29,365] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 0 Node  3 : dig 9e61 pig fafa : LV lvPmtHemiBottom              OpaqueVacuum None : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     : PosXYZ  PmtHemiFaceOff+PmtHemiBellyOff : 69.0     
0050 
0051     In [24]: tr.get(4).traverse()
0052     [2017-04-14 19:52:42,476] p36676 {/Users/blyth/opticks/ana/pmt/tree.py:79} INFO - visit depth 0 Node  4 : dig 5e29 pig fafa : LV lvPmtHemiDynode              OpaqueVacuum None : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     : PosXYZ  -0.5*PmtHemiGlassBaseLength+PmtHemiGlassThickness : -81.5     
0053 
0054 
0055 ::
0056 
0057      37   <!-- The PMT glass -->
0058      38   <logvol name="lvPmtHemi" material="Pyrex">
0059      39     <union name="pmt-hemi">
0060      40       <intersection name="pmt-hemi-glass-bulb">
0061      41     <sphere name="pmt-hemi-face-glass"
0062      42         outerRadius="PmtHemiFaceROC"/>
0063      43 
0064      44     <sphere name="pmt-hemi-top-glass"
0065      45         outerRadius="PmtHemiBellyROC"/>
0066      46     <posXYZ z="PmtHemiFaceOff-PmtHemiBellyOff"/>
0067      47 
0068      48     <sphere name="pmt-hemi-bot-glass"
0069      49         outerRadius="PmtHemiBellyROC"/>
0070      50     <posXYZ z="PmtHemiFaceOff+PmtHemiBellyOff"/>
0071      51 
0072      52       </intersection>
0073      53       <tubs name="pmt-hemi-base"
0074      54         sizeZ="PmtHemiGlassBaseLength"
0075      55         outerRadius="PmtHemiGlassBaseRadius"/>
0076      56       <posXYZ z="-0.5*PmtHemiGlassBaseLength"/>
0077      57     </union>
0078      58 
0079      59     <physvol name="pvPmtHemiVacuum"
0080      60          logvol="/dd/Geometry/PMT/lvPmtHemiVacuum"/>
0081      61 
0082      62   </logvol>
0083 
0084 ::
0085 
0086     In [48]: py = tr.get(0)
0087 
0088     In [54]: py.lv.name
0089     Out[54]: 'lvPmtHemi'
0090 
0091     In [55]: py.lv.material
0092     Out[55]: 'Pyrex'
0093 
0094     In [57]: py.lv.findall_("./*")
0095     Out[57]: 
0096     [Union             pmt-hemi  ,
0097      PV pvPmtHemiVacuum      /dd/Geometry/PMT/lvPmtHemiVacuum ]
0098 
0099     In [58]: un = py.lv.findall_("./*")[0]
0100 
0101     In [59]: un
0102     Out[59]: Union             pmt-hemi  
0103 
0104     In [60]: un.findall_("./*")
0105     Out[60]: 
0106     [Intersection  pmt-hemi-glass-bulb  ,
0107      Tubs        pmt-hemi-base : outerRadius PmtHemiGlassBaseRadius : 42.25   sizeZ PmtHemiGlassBaseLength : 169.0   :  None ,
0108      PosXYZ  -0.5*PmtHemiGlassBaseLength : -84.5   ]
0109 
0110 
0111 Need to findall_ recurse on the lv, constructing NCSG node tree.
0112 Unclear what level to do this at, probably simpler to operate at dd level
0113 
0114