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

Classes

class  MyPrimaryGeneratorAction
 
class  MyRunAction
 
class  MyEventAction
 
class  MySteppingAction
 
class  MyField
 

Functions

def Setup0
 
def Setup1
 
def Setup3
 
def Configure
 
def ConstructGeom
 

Function Documentation

def run.Configure ( )

Definition at line 18 of file run.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: run.py:18
gControlExecute
Definition: __init__.py:164

Here is the caller graph for this function:

def run.ConstructGeom ( )

Definition at line 45 of file run.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(20050830L)
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
def ConstructGeom
Definition: run.py:45
const G4ParticleDefinition const G4Material *G4double range
def Configure
Definition: run.py:18
gControlExecute
Definition: __init__.py:164

Here is the call graph for this function:

def run.Setup0 ( )

Definition at line 21 of file run.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: run.py:21

Here is the caller graph for this function:

def run.Setup1 ( )

Definition at line 44 of file run.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: run.py:44
def run.Setup3 ( )

Definition at line 55 of file run.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(20050830L)
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: run.py:55
gApplyUICommand
Definition: __init__.py:165
def Setup0
Definition: run.py:21

Here is the call graph for this function: