Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testem0.App Class Reference
Inheritance diagram for testem0.App:
Collaboration diagram for testem0.App:

Public Member Functions

def init
 
def __init__
 
def cmd_beamOn
 

Public Attributes

 particleListBox
 
 materialListBox
 
 energyEntry
 
 energyListBox
 
 cutsEntry
 
 cutsListBox
 

Detailed Description

Definition at line 53 of file testem0.py.

Constructor & Destructor Documentation

def testem0.App.__init__ (   self,
  master = None 
)

Definition at line 154 of file testem0.py.

155  def __init__(self, master=None):
156  Frame.__init__(self, master)
157  self.init()
158  self.grid()
def init
Definition: testem0.py:56
def __init__
Definition: testem0.py:154

Here is the call graph for this function:

Member Function Documentation

def testem0.App.cmd_beamOn (   self)

Definition at line 159 of file testem0.py.

160  def cmd_beamOn(self):
161 
162  # get and set particle
163  if self.particleListBox.curselection():
164  index =int(self.particleListBox.curselection()[0])
165  g4.gApplyUICommand("/gun/particle " + particleList[index])
166 
167  # get and set detector Material
168  if self.materialListBox.curselection():
169  index =int(self.materialListBox.curselection()[0])
170  g4.gApplyUICommand("/testem/det/setMat " + materialList[index])
171 
172  # get and set energy
173  energy = self.energyEntry.get()
174  if self.energyListBox.curselection():
175  index = int(self.energyListBox.curselection()[0])
176  unity = enrgyList[index]
177  g4.gApplyUICommand("/gun/energy " + energy + " " + unity)
178 
179  # get and set cuts
180  cuts = self.cutsEntry.get()
181  if self.cutsListBox.curselection():
182  index = int(self.cutsListBox.curselection()[0])
183  unity = cutsList[index]
184  g4.gApplyUICommand("/testem/phys/setCuts " + cuts + " " + unity)
185 
186  # run beamOn
187  g4.gRunManager.BeamOn(1)
188 
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
def cmd_beamOn
Definition: testem0.py:159

Here is the call graph for this function:

def testem0.App.init (   self)

Definition at line 56 of file testem0.py.

56 
57  def init(self):
58 
59 # title and header
60  title = Label(self, text="TestEm0 empowered by Geant4Py\n\n\n")
61  title.grid(row=0, column=1, columnspan = 4)
62 
63 # particle list box
64  particle_title = Label(self, text="Particle")
65  particle_title.grid(row=2, column=0)
66 
67  particleFrame = Frame(self)
68  scrollbar2 = Scrollbar(particleFrame)
69  scrollbar2.pack(side = RIGHT, fill = Y)
70  self.particleListBox = Listbox(particleFrame, yscrollcommand=scrollbar2.set, exportselection=FALSE,height = 6)
71  self.particleListBox.pack(side = LEFT)
72  for item in particleList:
73  self.particleListBox.insert(END, item)
74  scrollbar2.config(command=self.particleListBox.yview)
75  particleFrame.grid(row=3, column=0)
76  self.particleListBox.select_set(0)
77 
78 # separator frame
79  fblank = Frame(self,width = 40)
80  fblank.grid(row=3,column=1)
81 
82 # material list box
83  detmaterial_title = Label(self, text="Material")
84  detmaterial_title.grid(row=2, column=2)
85 
86  materialFrame = Frame(self)
87  scrollbar = Scrollbar(materialFrame)
88  scrollbar.pack(side = RIGHT, fill = Y)
89  self.materialListBox = Listbox(materialFrame, yscrollcommand=scrollbar.set, exportselection=FALSE, height = 6)
90  self.materialListBox.pack(side = LEFT, fill = Y)
91  for item in materialList:
92  self.materialListBox.insert(END, item)
93  scrollbar.config(command=self.materialListBox.yview)
94  materialFrame.grid(row=3, column=2)
95  self.materialListBox.select_set(0)
96 
97 # separator frame
98  fblank = Frame(self,width = 40)
99  fblank.grid(row=3,column=3)
100 
101 # energy
102  fEnergy = Frame(self)
103  energyLabel = Label(self, text="Energy")
104  energyLabel.grid(row = 2, column = 4)
105 
106  scrollbarEnergy = Scrollbar(fEnergy)
107  scrollbarEnergy.pack(side = RIGHT, fill = Y)
108  self.energyEntry = Entry(fEnergy, width= 8 );
109  self.energyEntry.pack(side = TOP)
110  self.energyEntry.insert(0, "1.0")
112  self.energyListBox = Listbox(fEnergy, yscrollcommand=scrollbarEnergy.set,exportselection=FALSE,width=8,height = 5)
113  self.energyListBox.pack(side = BOTTOM )
114  for item in enrgyList:
115  self.energyListBox.insert(END, item)
116  scrollbarEnergy.config(command=self.energyListBox.yview)
117  fEnergy.grid(row = 3, column = 4 )
118  self.energyListBox.select_set(0)
119 
120 # separator frame
121  fblank = Frame(self,width = 40)
122  fblank.grid(row=3,column=5)
123 
124 # cuts
125  fCuts = Frame(self)
126  cutsLabel = Label(self, text="Cuts", width= 8)
127  cutsLabel.grid(row = 2, column = 6)
128 
129  scrollbarCuts = Scrollbar(fCuts)
130  scrollbarCuts.pack(side = RIGHT, fill = Y)
131  self.cutsEntry = Entry(fCuts, width= 8);
132  self.cutsEntry.pack(side = TOP)
133  self.cutsEntry.insert(0, "1.0")
135  self.cutsListBox = Listbox(fCuts, width= 8 ,yscrollcommand=scrollbarCuts.set,exportselection=FALSE,height = 5)
136  self.cutsListBox.pack(side = BOTTOM )
137  for item in cutsList:
138  self.cutsListBox.insert(END, item)
139  scrollbarCuts.config(command=self.cutsListBox.yview)
140  fCuts.grid(row = 3, column = 6 )
141  self.cutsListBox.select_set(0)
142 
143 # separator frame
144  fblank = Frame(self,height = 40)
145  fblank.grid(row=4,column=0)
146 
147 # start a run button
148  startBut = Button(self, bg="green", text="Start a run", command=self.cmd_beamOn)
149  startBut.grid(row=5, column=2, sticky=W)
150 
151 # exit button
152  exitBut = Button(self, bg="grey", text="Exit", command=self.quit)
153  exitBut.grid(row=5, column=6, sticky=E)
particleListBox
Definition: testem0.py:69
def init
Definition: testem0.py:56
def cmd_beamOn
Definition: testem0.py:159
materialListBox
Definition: testem0.py:88

Here is the caller graph for this function:

Member Data Documentation

testem0.App.cutsEntry

Definition at line 130 of file testem0.py.

testem0.App.cutsListBox

Definition at line 134 of file testem0.py.

testem0.App.energyEntry

Definition at line 107 of file testem0.py.

testem0.App.energyListBox

Definition at line 111 of file testem0.py.

testem0.App.materialListBox

Definition at line 88 of file testem0.py.

testem0.App.particleListBox

Definition at line 69 of file testem0.py.


The documentation for this class was generated from the following file: