Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test Namespace Reference

Classes

class  MyPrimaryGeneratorAction
 
class  MyRunAction
 
class  MyEventAction
 
class  MySteppingAction
 
class  MyField
 
class  MyDetectorConstruction
 
class  MyZClass1
 
class  MyZClass2
 
class  MyXClass
 
class  MyX
 

Functions

def Setup0
 
def Setup1
 
def Setup3
 
def Configure
 
def ConstructGeom
 
def DumpTree
 

Variables

string fname = "%s.wrl"
 
string cmdstr = "/vis/rayTracer/trace "
 
tuple a = test01.AClass()
 
tuple b = test01.AClass(0)
 
tuple c = test01.AClass(1, 1.)
 
tuple z = test06.ZBase()
 
tuple myz1 = MyZClass1()
 
tuple myz2 = MyZClass2()
 
tuple myx = MyXClass()
 
tuple x = test06.XBase()
 
tuple acolor = test07.Color()
 
tuple v = test12.AVector()
 
tuple alist = test13.alloc_int()
 

Function Documentation

def test.Configure ( )

Definition at line 18 of file test.py.

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 # constructing geometry
# ==================================================================
def Configure
Definition: test.py:18
gControlExecute
Definition: __init__.py:164

Here is the caller graph for this function:

def test.ConstructGeom ( )

Definition at line 45 of file test.py.

45 
46 def ConstructGeom():
47  print("* Constructing geometry...")
48  # reset world material
49  air= G4Material.GetMaterial("G4_AIR")
50  g4py.ezgeom.SetWorldMaterial(air)
51 
52  # target
53  global target
54  target= G4EzVolume("Target")
55  au= G4Material.GetMaterial("G4_Au")
56  target.CreateTubeVolume(au, 0., 1.*cm, 1.*mm)
57  target.PlaceIt(G4ThreeVector(0.,0.,-10.*cm))
58 
59  # dummy box
60  global detector_box, detector_box_pv
61  detector_box= G4EzVolume("DetectorBox")
62  detector_box.CreateBoxVolume(air, 20.*cm, 20.*cm, 40.*cm)
63  detector_box_pv= detector_box.PlaceIt(G4ThreeVector(0.,0.,20.*cm))
64 
65  # calorimeter
66  global cal
67  cal= G4EzVolume("Calorimeter")
68  nai= G4Material.GetMaterial("G4_SODIUM_IODIDE")
69  cal.CreateBoxVolume(nai, 5.*cm, 5.*cm, 30.*cm)
70  dd= 5.*cm
71  for ical in range(-1, 2):
72  calPos= G4ThreeVector(dd*ical, 0., 0.)
73  print(calPos)
74  cal.PlaceIt(calPos, ical+1, detector_box)
75 
76 
77 # ==================================================================
78 # main
79 # ==================================================================
80 # ------------------------------------------------------------------
81 # randum number
82 # ------------------------------------------------------------------
83 rand_engine= Ranlux64Engine()
84 HepRandom.setTheEngine(rand_engine)
85 HepRandom.setTheSeed(20050830)
86 
87 # setup...
88 Configure()
90 
91 # ------------------------------------------------------------------
92 # go...
93 # ------------------------------------------------------------------
94 gRunManager.Initialize()
95 
96 # visualization
97 gControlExecute("vis.mac")
98 
99 # beamOn
100 #gRunManager.BeamOn(3)
101 
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:602
const G4ParticleDefinition const G4Material *G4double range
def Configure
Definition: test.py:18
void print(G4double elem)
def ConstructGeom
Definition: test.py:45
gControlExecute
Definition: __init__.py:164

Here is the call graph for this function:

def test.DumpTree (   atree)

Definition at line 10 of file test.py.

10 
11 def DumpTree(atree):
12  print("@@", atree.GetPathName(), "::", atree.GetTitle())
13  ntree= atree.GetTreeEntry()
14  ncommand= atree.GetCommandEntry()
15 
16  for i in range(1, ncommand+1):
17  icommand= atree.GetCommand(i)
18  print(" **", icommand.GetCommandPath())
19  print(" ", icommand.GetTitle())
20  x= icommand.GetStateList()
21 
22  nparameter= icommand.GetParameterEntries()
23  for j in range(0, nparameter):
24  iparam= icommand.GetParameter(j)
25  print(" +", iparam.GetParameterName(), iparam.GetParameterType())
26 
27  for i in range(1, ntree+1):
28  itree= atree.GetTree(i)
29  DumpTree(itree)
30 
31 # ==================================================================
32 # main
33 # ==================================================================
34 root_tree= gUImanager.GetTree()
35 
36 DumpTree(root_tree)
37 
def DumpTree
Definition: test.py:10
const G4ParticleDefinition const G4Material *G4double range
void print(G4double elem)

Here is the call graph for this function:

def test.Setup0 ( )

Definition at line 21 of file test.py.

21 
22 def Setup0():
23  # simple materials for Qgeom
24  g4py.Qmaterials.Construct()
25 
26  # NIST materials
27  #g4py.NISTmaterials.Construct()
28 
29  # normal way for constructing user geometry
30  #qDC= g4py.Qgeom.QDetectorConstruction()
31  #gRunManager.SetUserInitialization(qDC)
32 
33  # 2nd way, short-cut way
34  g4py.Qgeom.Construct()
35 
36  # primary
37  global primary_position, primary_direction
38  primary_position= G4ThreeVector(0.,0., -14.9*cm)
39  primary_direction= G4ThreeVector(0.2, 0., 1.)
40 
41 
42 # ------------------------------------------------------------------
43 # Setup-1 (ExampleN01)
# ------------------------------------------------------------------
def Setup0
Definition: test.py:21

Here is the caller graph for this function:

def test.Setup1 ( )

Definition at line 44 of file test.py.

44 
45 def Setup1():
46  g4py.ExN01geom.Construct()
47 
48  global primary_position, primary_direction
49  primary_position= G4ThreeVector(-2.5*m, 0., 0.)
50  primary_direction= G4ThreeVector(1., 0., 0.)
51 
52 
53 # ------------------------------------------------------------------
54 # Setup-3 (ExampleN03)
# ------------------------------------------------------------------
def Setup1
Definition: test.py:44
def test.Setup3 ( )

Definition at line 55 of file test.py.

55 
56 def Setup3():
57  #exN03geom= g4py.ExN03geom.ExN03DetectorConstruction()
58  #gRunManager.SetUserInitialization(exN03geom)
59 
60  g4py.ExN03geom.Construct()
61 
62  global primary_position, primary_direction
63  primary_position= G4ThreeVector(-1.*m, 0., 0.)
64  primary_direction= G4ThreeVector(1., 0., 0.)
65 
66 
67 # ==================================================================
68 # main
69 # ==================================================================
70 # ------------------------------------------------------------------
71 # randum number
72 # ------------------------------------------------------------------
73 rand_engine= Ranlux64Engine()
74 HepRandom.setTheEngine(rand_engine)
75 HepRandom.setTheSeed(20050830)
76 
77 # ------------------------------------------------------------------
78 # user setup
79 # ------------------------------------------------------------------
80 Setup0()
81 #Setup1()
82 #Setup3()
83 
84 
85 # ------------------------------------------------------------------
86 # setup for physics list
87 # ------------------------------------------------------------------
88 # normal way for constructing user physics list
89 #exN01PL= ExN01PhysicsList.ExN01PhysicsList()
90 #gRunManager.SetUserInitialization(exN01PL)
91 
92 # 2nd way, short-cut way
93 # geantino + transportation
94 #g4py.ExN01pl.Construct()
95 
96 # electron/gamma standard EM
97 g4py.EMSTDpl.Construct()
98 
99 # ------------------------------------------------------------------
100 # setup for primary generator action
101 # ------------------------------------------------------------------
102 # ------------
103 # Particle Gun
104 # ------------
105 # normal way for constructing user physics list
106 #pgPGA= g4py.ParticleGun.ParticleGunAction()
107 #gRunManager.SetUserAction(pgPGA)
108 #pg= pgPGA.GetParticleGun()
109 
110 # 2nd way, short-cut way
111 pg= g4py.ParticleGun.Construct()
112 
113 # set parameters of particle gun
114 pg.SetParticleByName("e-")
115 pg.SetParticleEnergy(300.*MeV)
116 pg.SetParticlePosition(primary_position)
117 pg.SetParticleMomentumDirection(primary_direction)
118 
119 # ------------
120 # Medical Beam
121 # ------------
122 #beam= g4py.MedicalBeam.Construct()
123 
124 # ------------------------------------------------------------------
125 # go...
126 # ------------------------------------------------------------------
127 gRunManager.Initialize()
128 
129 # visualization
130 gApplyUICommand("/control/execute vis.mac")
131 
132 # beamOn
133 #gRunManager.BeamOn(3)
134 
def Setup3
Definition: test.py:55
def Setup0
Definition: test.py:21
gApplyUICommand
Definition: __init__.py:165

Here is the call graph for this function:

Variable Documentation

tuple test.a = test01.AClass()

Definition at line 11 of file test.py.

tuple test.acolor = test07.Color()

Definition at line 9 of file test.py.

tuple test.alist = test13.alloc_int()

Definition at line 9 of file test.py.

tuple test.b = test01.AClass(0)

Definition at line 12 of file test.py.

tuple test.c = test01.AClass(1, 1.)

Definition at line 13 of file test.py.

string test.cmdstr = "/vis/rayTracer/trace "

Definition at line 123 of file test.py.

string test.fname = "%s.wrl"

Definition at line 308 of file test.py.

tuple test.myx = MyXClass()

Definition at line 45 of file test.py.

tuple test.myz1 = MyZClass1()

Definition at line 34 of file test.py.

tuple test.myz2 = MyZClass2()

Definition at line 39 of file test.py.

tuple test.v = test12.AVector()

Definition at line 18 of file test.py.

list test.x = test06.XBase()

Definition at line 50 of file test.py.

tuple test.z = test06.ZBase()

Definition at line 28 of file test.py.