Geant4-11
Functions
test_voxel Namespace Reference

Functions

def Configure ()
 
def ConstructGeom ()
 

Function Documentation

◆ Configure()

def test_voxel.Configure ( )

Definition at line 18 of file test_voxel.py.

18def 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# ==================================================================
gControlExecute
Definition: __init__.py:157
def Configure()
Definition: test_voxel.py:18

References source.gControlExecute.

Referenced by ConstructGeom().

◆ ConstructGeom()

def test_voxel.ConstructGeom ( )

Definition at line 46 of file test_voxel.py.

46def ConstructGeom():
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# ------------------------------------------------------------------
67rand_engine= Ranlux64Engine()
68HepRandom.setTheEngine(rand_engine)
69HepRandom.setTheSeed(20050830L)
70
71# setup...
74
75# ------------------------------------------------------------------
76# go...
77# ------------------------------------------------------------------
78gRunManager.Initialize()
79
80# visualization
81gControlExecute("vis.mac")
82
83# beamOn
84#gRunManager.BeamOn(3)
85
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:686
def ConstructGeom()
Definition: test_voxel.py:46

References Configure(), ConstructGeom(), source.gControlExecute, and G4Material.GetMaterial().

Referenced by ConstructGeom().