Functions
test_voxel Namespace Reference

Functions

def Configure ()
 
def ConstructGeom ()
 

Function Documentation

def test_voxel.Configure ( )

Definition at line 18 of file test_voxel.py.

References python.gControlExecute.

Referenced by ConstructGeom().

18 def Configure():
19  # ------------------------------------------------------------------
20  # setup for materials
21  # ------------------------------------------------------------------
22  # simple materials for Qgeom
23  g4py.NISTmaterials.Construct()
24 
25  # ------------------------------------------------------------------
26  # setup for geometry
27  # ------------------------------------------------------------------
28  #g4py.Qgeom.Construct()
29  g4py.ezgeom.Construct() # initialize
30 
31  # ------------------------------------------------------------------
32  # setup for physics list
33  # ------------------------------------------------------------------
34  g4py.EMSTDpl.Construct()
35 
36  # ------------------------------------------------------------------
37  # setup for primary generator action
38  # ------------------------------------------------------------------
39  g4py.ParticleGun.Construct()
40  gControlExecute("gun.mac")
41 
42 
43 # ==================================================================
44 # constructing geometry
45 # ==================================================================
def Configure()
Definition: test_voxel.py:18
gControlExecute
Definition: __init__.py:164
def test_voxel.ConstructGeom ( )

Definition at line 46 of file test_voxel.py.

References Configure(), and python.gControlExecute.

47  print "* Constructing geometry..."
48  # reset world material
49  air= G4Material.GetMaterial("G4_AIR")
50  g4py.ezgeom.SetWorldMaterial(air)
51 
52  # phantom
53  global phantom
54  phantom= G4EzVolume("DetectorBox")
55  water= G4Material.GetMaterial("G4_WATER")
56  phantom.CreateBoxVolume(water, 40.*cm, 40.*cm, 50.*cm)
57  phantom.PlaceIt(G4ThreeVector(0.,0.,20.*cm))
58  vsize=phantom.VoxelizeIt(100, 100, 100)
59  print "voxel size=", vsize
60 
61 # ==================================================================
62 # main
63 # ==================================================================
64 # ------------------------------------------------------------------
65 # randum number
66 # ------------------------------------------------------------------
67 rand_engine= Ranlux64Engine()
68 HepRandom.setTheEngine(rand_engine)
69 HepRandom.setTheSeed(20050830L)
70 
71 # setup...
72 Configure()
74 
75 # ------------------------------------------------------------------
76 # go...
77 # ------------------------------------------------------------------
78 gRunManager.Initialize()
79 
80 # visualization
81 gControlExecute("vis.mac")
82 
83 # beamOn
84 #gRunManager.BeamOn(3)
85 
86 
def Configure()
Definition: test_voxel.py:18
gControlExecute
Definition: __init__.py:164
def ConstructGeom()
Definition: test_voxel.py:46