Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions | Variables
Lesson1Wx Namespace Reference

Data Structures

class  Adjuster
 
class  ComPanel
 
class  Counter
 
class  FloatCounter
 
class  MyApp
 
class  MyText
 
class  Processes
 
class  SelectOne
 
class  VisPanel
 

Functions

def Configure
 
def ConstructGeom
 
def DumpTree
 

Variables

dictionary commandDic = {}
 
list commandList = []
 
tuple heprepViewer = os.environ.get("G4HEPREPFILE_VIEWER")
 
tuple heprepDir = os.environ.get("G4HEPREPFILE_DIR")
 
tuple heprepName = os.environ.get("G4HEPREPFILE_NAME")
 
tuple vrmlDir = os.environ.get("G4VRML_DEST_DIR")
 
tuple vrmlViewer = os.environ.get("G4VRMLFILE_VIEWER")
 
tuple app = wx.PySimpleApp(False)
 

Function Documentation

def Lesson1Wx.Configure ( )

Definition at line 17 of file Lesson1Wx.py.

References python.gControlExecute.

Referenced by ConstructGeom().

17 
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.ezgeom.Construct() # initialize
29 
30  # ------------------------------------------------------------------
31  # setup for physics list of N03
32  # ------------------------------------------------------------------
33  g4py.ExN03pl.Construct()
34 
35  # ------------------------------------------------------------------
36  # setup for primary generator action
37  # ------------------------------------------------------------------
38  g4py.ParticleGun.Construct()
39  gControlExecute("gun.mac")
40 
41 # ==================================================================
42 # constructing geometry
# ==================================================================
def Configure
Definition: Lesson1Wx.py:17
def Lesson1Wx.ConstructGeom ( )

Definition at line 43 of file Lesson1Wx.py.

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

43 
44 def ConstructGeom():
45 
46  print "* Constructing geometry..."
47  # reset world material
48  global absorber
49  air= G4Material.GetMaterial("G4_AIR", 1)
50  galactic = G4Material.GetMaterial("G4_Galactic", 1)
51  absorber = {} # material's dictionary to be used by a radiobutton
52  aluminum = G4Material.GetMaterial("G4_Al", 1)
53  iron = G4Material.GetMaterial("G4_Fe", 1)
54  silver = G4Material.GetMaterial("G4_Ag", 1)
55  gold = G4Material.GetMaterial("G4_Au", 1)
56  lead = G4Material.GetMaterial("G4_Pb", 1)
57  water = G4Material.GetMaterial("G4_WATER", 1)
58  absorber = {"air":air, "aluminum":aluminum, "iron":iron, "lead":lead, "water":water, "gold":gold
59 }
60  g4py.ezgeom.SetWorldMaterial(galactic)
61  g4py.ezgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
62  # water phantom
63  global water_phantom, water_phantom_pv
64 
65  water_phantom= G4EzVolume("WaterPhantom")
66  water_phantom.CreateBoxVolume(water, 110.*cm, 110.*cm, 10.*cm)
67  water_phantom_pv = water_phantom.PlaceIt(G4ThreeVector(0.,0.,0.*cm))
68 
69 # ==================================================================
70 # main
71 # ==================================================================
72 # ------------------------------------------------------------------
73 # randum number
74 # ------------------------------------------------------------------
75 #print "Random numbers..."
76 rand_engine= Ranlux64Engine()
77 HepRandom.setTheEngine(rand_engine)
78 HepRandom.setTheSeed(20050830L)
79 
80 # setup...
81 
82 Configure()
84 
85 # ------------------------------------------------------------------
86 # go...
87 # ------------------------------------------------------------------
88 gRunManager.Initialize()
89 
90 
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
def Configure
Definition: Lesson1Wx.py:17
def ConstructGeom
Definition: Lesson1Wx.py:43
def Lesson1Wx.DumpTree (   atree)

Definition at line 95 of file Lesson1Wx.py.

References python.gApplyUICommand.

95 
96 def DumpTree(atree):
97 
98  ntree= atree.GetTreeEntry()
99  ncommand= atree.GetCommandEntry()
100  for i in range(1, ncommand+1):
101  icommand= atree.GetCommand(i)
102  command = str( icommand.GetCommandPath())
103  commandList.append(command)
104  nparameter= icommand.GetParameterEntries()
105  pguide = ""
106  for j in range(0, nparameter):
107  iparam= icommand.GetParameter(j)
108  pguide = pguide + "Parameter: " + str(iparam.GetParameterName())+ " Type: " + str(iparam.GetParameterType()) + '\n'
109  guide = str(icommand.GetTitle()) + '\n' + pguide
110  commandDic[command] = guide
111 
112  for i in range(1, ntree+1):
113  itree= atree.GetTree(i)
114  DumpTree(itree)
115 
116 root_tree= gUImanager.GetTree()
117 DumpTree(root_tree)
118 
119 # visualization
120 # OGLSX, VRML and HEPREP sceneHandlers are all created with names
121 gApplyUICommand("/vis/sceneHandler/create OGLSX OGLSX")
122 gApplyUICommand("/vis/sceneHandler/create VRML2FILE VRML")
123 gApplyUICommand("/vis/sceneHandler/create HepRepFile HEPREP")
124 
125 
126 # OGLSX is the default so, viewer is created and volume is drawn
127 gApplyUICommand("/vis/viewer/create OGLSX oglsxviewer")
128 gApplyUICommand("/vis/viewer/select oglsxviewer")
129 gApplyUICommand("/vis/drawVolume")
130 gApplyUICommand("/vis/scene/add/trajectories")
131 
132 gApplyUICommand("/tracking/storeTrajectory 1")
133 gApplyUICommand("/vis/scene/endOfEventAction accumulate")
134 gApplyUICommand("/vis/scene/endOfRunAction accumulate")
135 
136 gApplyUICommand("/vis/viewer/set/viewpointThetaPhi 90. 0.")
137 gApplyUICommand("/vis/viewer/set/style s")
138 
139 # viewers VRML and Wired are tested by their envs vars
140 # if their envs var are set, then viewers are created and drawVolume
def DumpTree
Definition: Lesson1Wx.py:95

Variable Documentation

tuple Lesson1Wx.app = wx.PySimpleApp(False)

Definition at line 555 of file Lesson1Wx.py.

dictionary Lesson1Wx.commandDic = {}

Definition at line 92 of file Lesson1Wx.py.

list Lesson1Wx.commandList = []

Definition at line 93 of file Lesson1Wx.py.

tuple Lesson1Wx.heprepDir = os.environ.get("G4HEPREPFILE_DIR")

Definition at line 143 of file Lesson1Wx.py.

tuple Lesson1Wx.heprepName = os.environ.get("G4HEPREPFILE_NAME")

Definition at line 144 of file Lesson1Wx.py.

tuple Lesson1Wx.heprepViewer = os.environ.get("G4HEPREPFILE_VIEWER")

Definition at line 142 of file Lesson1Wx.py.

tuple Lesson1Wx.vrmlDir = os.environ.get("G4VRML_DEST_DIR")

Definition at line 150 of file Lesson1Wx.py.

tuple Lesson1Wx.vrmlViewer = os.environ.get("G4VRMLFILE_VIEWER")

Definition at line 151 of file Lesson1Wx.py.