Geant4-11
Public Member Functions | Data Fields
testem0.App Class Reference
Inheritance diagram for testem0.App:

Public Member Functions

def __init__ (self, master=None)
 
def cmd_beamOn (self)
 
def init (self)
 

Data Fields

 cutsEntry
 
 cutsListBox
 
 energyEntry
 
 energyListBox
 
 materialListBox
 
 particleListBox
 

Detailed Description

Definition at line 53 of file testem0.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 154 of file testem0.py.

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

References G4SimplexDownhill< G4ConvergenceTester >.init(), G4SimplexDownhill< T >.init(), G4LFission.init(), G4INCL::Config.init(), G4HepRepFileXMLWriter.init(), G4GIDI_target.init(), G4GIDI.init(), demo.App.init(), testem0.App.init(), Lesson1.App.init(), and ExN03.App.init().

Member Function Documentation

◆ cmd_beamOn()

def testem0.App.cmd_beamOn (   self)

Definition at line 159 of file testem0.py.

159 def cmd_beamOn(self):
160
161 # get and set particle
162 if self.particleListBox.curselection():
163 index =int(self.particleListBox.curselection()[0])
164 g4.gApplyUICommand("/gun/particle " + particleList[index])
165
166 # get and set detector Material
167 if self.materialListBox.curselection():
168 index =int(self.materialListBox.curselection()[0])
169 g4.gApplyUICommand("/testem/det/setMat " + materialList[index])
170
171 # get and set energy
172 energy = self.energyEntry.get()
173 if self.energyListBox.curselection():
174 index = int(self.energyListBox.curselection()[0])
175 unity = enrgyList[index]
176 g4.gApplyUICommand("/gun/energy " + energy + " " + unity)
177
178 # get and set cuts
179 cuts = self.cutsEntry.get()
180 if self.cutsListBox.curselection():
181 index = int(self.cutsListBox.curselection()[0])
182 unity = cutsList[index]
183 g4.gApplyUICommand("/testem/phys/setCuts " + cuts + " " + unity)
184
185 # run beamOn
186 g4.gRunManager.BeamOn(1)
187
188
auto get(Tuple< Elements... > &t) -> decltype(get_height< sizeof...(Elements) - I - 1 >(t))
Definition: Tuple.hh:139

References demo.App.cutsEntry, testem0.App.cutsEntry, demo.App.cutsListBox, testem0.App.cutsListBox, demo.App.energyEntry, testem0.App.energyEntry, demo.App.energyListBox, testem0.App.energyListBox, PTL.get(), demo.App.materialListBox, testem0.App.materialListBox, demo.App.particleListBox, and testem0.App.particleListBox.

◆ init()

def testem0.App.init (   self)

Definition at line 56 of file testem0.py.

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

Referenced by demo.App.__init__(), testem0.App.__init__(), Lesson1.App.__init__(), and ExN03.App.__init__().

Field Documentation

◆ cutsEntry

testem0.App.cutsEntry

Definition at line 130 of file testem0.py.

Referenced by demo.App.cmd_beamOn(), and testem0.App.cmd_beamOn().

◆ cutsListBox

testem0.App.cutsListBox

Definition at line 134 of file testem0.py.

Referenced by demo.App.cmd_beamOn(), and testem0.App.cmd_beamOn().

◆ energyEntry

testem0.App.energyEntry

Definition at line 107 of file testem0.py.

Referenced by demo.App.cmd_beamOn(), and testem0.App.cmd_beamOn().

◆ energyListBox

testem0.App.energyListBox

Definition at line 111 of file testem0.py.

Referenced by demo.App.cmd_beamOn(), and testem0.App.cmd_beamOn().

◆ materialListBox

testem0.App.materialListBox

Definition at line 88 of file testem0.py.

Referenced by demo.App.cmd_beamOn(), and testem0.App.cmd_beamOn().

◆ particleListBox

testem0.App.particleListBox

Definition at line 69 of file testem0.py.

Referenced by demo.App.cmd_beamOn(), and testem0.App.cmd_beamOn().


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