Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
19 def Configure():
20  # ------------------------------------------------------------------
21  # setup for materials
22  # ------------------------------------------------------------------
23  # simple materials for Qgeom
24  g4py.NISTmaterials.Construct()
25 
26  # ------------------------------------------------------------------
27  # setup for geometry
28  # ------------------------------------------------------------------
29  #g4py.Qgeom.Construct()
30  g4py.ezgeom.Construct() # initialize
31 
32  # ------------------------------------------------------------------
33  # setup for physics list
34  # ------------------------------------------------------------------
35  g4py.EMSTDpl.Construct()
36 
37  # ------------------------------------------------------------------
38  # setup for primary generator action
39  # ------------------------------------------------------------------
40  g4py.ParticleGun.Construct()
41  gControlExecute("gun.mac")
42 
43 
44 # ==================================================================
45 # constructing geometry
# ==================================================================
def Configure
Definition: test_voxel.py:18
def test_voxel.ConstructGeom ( )

Definition at line 46 of file test_voxel.py.

References Configure(), python.gControlExecute, and G4Material.GetMaterial().

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