Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:51

0001 #!/usr/bin/env python
0002 #
0003 # Copyright (c) 2019 Opticks Team. All Rights Reserved.
0004 #
0005 # This file is part of Opticks
0006 # (see https://bitbucket.org/simoncblyth/opticks).
0007 #
0008 # Licensed under the Apache License, Version 2.0 (the "License"); 
0009 # you may not use this file except in compliance with the License.  
0010 # You may obtain a copy of the License at
0011 #
0012 #   http://www.apache.org/licenses/LICENSE-2.0
0013 #
0014 # Unless required by applicable law or agreed to in writing, software 
0015 # distributed under the License is distributed on an "AS IS" BASIS, 
0016 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0017 # See the License for the specific language governing permissions and 
0018 # limitations under the License.
0019 #
0020 
0021 """
0022 Aiming for this to be generated, so keep it simple
0023 """
0024 import numpy as np
0025 from opticks.ana.shape import X, SEllipsoid, STubs, STorus, SCons, SSubtractionSolid, SUnionSolid, SIntersectionSolid
0026 
0027 
0028 class x019(X):
0029     """
0030     G4VSolid* make_solid()
0031     { 
0032         G4VSolid* d = new G4Ellipsoid("PMT_20inch_inner_solid_1_Ellipsoid0x4c91130", 249.000000, 249.000000, 179.000000, -179.000000, 179.000000) ; // 3
0033         G4VSolid* g = new G4Tubs("PMT_20inch_inner_solid_2_Tube0x4c91210", 0.000000, 75.951247, 23.782510, 0.000000, CLHEP::twopi) ; // 4
0034         G4VSolid* i = new G4Torus("PMT_20inch_inner_solid_2_Torus0x4c91340", 0.000000, 52.010000, 97.000000, -0.000175, CLHEP::twopi) ; // 4
0035         
0036         G4ThreeVector A(0.000000,0.000000,-23.772510);
0037         G4VSolid* f = new G4SubtractionSolid("PMT_20inch_inner_solid_part20x4cb2d80", g, i, NULL, A) ; // 3
0038         
0039         G4ThreeVector B(0.000000,0.000000,-195.227490);
0040         G4VSolid* c = new G4UnionSolid("PMT_20inch_inner_solid_1_20x4cb30f0", d, f, NULL, B) ; // 2
0041         G4VSolid* k = new G4Tubs("PMT_20inch_inner_solid_3_EndTube0x4cb2fc0", 0.000000, 45.010000, 57.510000, 0.000000, CLHEP::twopi) ; // 2
0042         
0043         G4ThreeVector C(0.000000,0.000000,-276.500000);
0044         G4VSolid* b = new G4UnionSolid("PMT_20inch_inner_solid0x4cb32e0", c, k, NULL, C) ; // 1
0045         G4VSolid* m = new G4Tubs("Inner_Separator0x4cb3530", 0.000000, 254.000000, 92.000000, 0.000000, CLHEP::twopi) ; // 1
0046         
0047         G4ThreeVector D(0.000000,0.000000,92.000000);
0048         G4VSolid* a = new G4SubtractionSolid("PMT_20inch_inner2_solid0x4cb3870", b, m, NULL, D) ; // 0
0049         return a ; 
0050     } 
0051 
0052 
0053 
0054 
0055                            a
0056 
0057                       b             m(D)
0058                                    
0059                 c          k(C)
0060               bulb+neck   endtube    
0061  
0062             d     f(B) 
0063          bulb     neck
0064 
0065                 g(B)  i(B+A)
0066                tubs   torus
0067 
0068 
0069     """
0070 
0071     def __init__(self):
0072         d = SEllipsoid( "d", [249.000, 179.000 ] )
0073         g = STubs(      "g", [75.951247,23.782510] )
0074         i = STorus(     "i", [ 52.010000, 97.000000] )
0075 
0076         A = np.array( [0, -23.772510] )
0077         f = SSubtractionSolid( "f", [g,i, A ] )
0078 
0079         B = np.array( [0, -195.227490] )
0080         c = SUnionSolid( "c",  [d, f, B] )
0081 
0082         k = STubs(      "k", [45.010000, 57.510000] )
0083 
0084         C = np.array( [0, -276.500000] )
0085         b = SUnionSolid( "b", [c, k, C] ) 
0086         m = STubs(      "m", [254.000000, 92.000000] )
0087 
0088         D = np.array( [0, 92.000000] )
0089         a = SSubtractionSolid( "a", [b, m, D ] )
0090 
0091         X.__init__(self, a )   # sets root
0092 
0093 
0094 if __name__ == '__main__':
0095     x = x019()
0096     print(repr(x))
0097