Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields | Static Public Attributes
Lesson2Wx.MyApp Class Reference
Inheritance diagram for Lesson2Wx.MyApp:

Public Member Functions

def __init__
 
def OnPageChanged
 
def OnPageChanging
 
def RunStart
 

Data Fields

 nb
 
 runStart
 
 theAbsorberMaterial
 
 theGapMaterial
 
 theParticle
 
 processList
 
 theProcesses
 
 eventNo
 
 layerNo
 
 lengthUnit
 
 absorberThickSpin
 
 gapThickSpin
 
 sizeYZSpin
 
 cutLengthSpin
 
 magneticUnit
 
 magneticFieldSpin
 
 energyUnit
 
 energySpin
 

Static Public Attributes

list absorberTh = self.absorberThickSpin.theValue*self.lengthUnit[self.absorberThickSpin.theUnit]
 
list gapTh = self.gapThickSpin.theValue*self.lengthUnit[self.gapThickSpin.theUnit]
 
list yzSize = self.sizeYZSpin.theValue*self.lengthUnit[self.sizeYZSpin.theUnit]
 
list cutLen = self.cutLengthSpin.theValue*self.lengthUnit[self.cutLengthSpin.theUnit]
 
list magF = self.magneticFieldSpin.theValue*self.magneticUnit[self.magneticFieldSpin.theUnit]
 
tuple position = -self.layerNo.slider.GetValue()
 
tuple eventNum = self.eventNo.slider.GetValue()
 

Detailed Description

Definition at line 437 of file Lesson2Wx.py.

Constructor & Destructor Documentation

def Lesson2Wx.MyApp.__init__ (   self)

Definition at line 438 of file Lesson2Wx.py.

439  def __init__(self):
440  wx.Frame.__init__(self, None, -1, "Geant4Py")
441  self.nb = wx.Notebook(self, -1, wx.DefaultPosition, wx.DefaultSize,
442  style=
443  wx.NB_TOP # | wx.NB_MULTILINE
444  #wx.NB_BOTTOM
445  #wx.NB_LEFT
446  #wx.NB_RIGHT
447  )
448  self.nb.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
449  self.nb.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self.OnPageChanging)
450 
451  panel = wx.Panel(self.nb)
452  self.nb.AddPage(panel, "ExampleN03")
453  commandPanel = wx.Panel(self.nb)
454  self.nb.AddPage(commandPanel, "Geant4 Commands")
455  comP = ComPanel(commandPanel)
456  gxsizer = wx.BoxSizer(wx.HORIZONTAL)
457  gxsizer.Add(comP)
458  commandPanel.SetSizer(gxsizer)
459 
460 
461  visualizationPanel = wx.Panel(self.nb)
462  self.nb.AddPage(visualizationPanel, "Vis Commands")
463  visP = VisPanel(visualizationPanel)
464  vxsizer = wx.BoxSizer(wx.HORIZONTAL)
465  vxsizer.Add(visP)
466  visualizationPanel.SetSizer(vxsizer)
467 
468 # outmost sizer in the vertical direction
469  bxsizer = wx.BoxSizer(wx.VERTICAL)
470 # nested sizer in the horizontal direction
471  bysizer = wx.BoxSizer(wx.HORIZONTAL)
472 
474  self.runStart = wx.Button(panel, -1, " Run Start", wx.DefaultPosition, wx.DefaultSize)
475  self.Bind(wx.EVT_BUTTON, self.RunStart, self.runStart)
476  bxsizer.Add(self.runStart, 0, wx.ALL)
477 # widgets
478 
479  absorberMaterialList = ['Aluminium', 'Lead']
480  self.theAbsorberMaterial = SelectOne(panel, "Absorber Materials", absorberMaterialList)
481  gapMaterialList = ["liquidArgon","Scintillator", "Air", "Aerogel", "Galactic"]
482  self.theGapMaterial = SelectOne(panel, "Gap Materials", gapMaterialList)
483 
484  particleList = ["proton", "gamma", "e-", "e+", "mu-", "mu+"]
485  self.theParticle = SelectOne(panel, "Particles", particleList)
487  self.processList = ["phot", "compt", "conv", "msc", "eIoni", "eBrem", "annihil","muIoni", "muBrems", "hIoni"]
488  self.theProcesses = Processes(panel, "Processes", self.processList)
490  self.eventNo = Adjuster(panel, "Number of Events", 1 , 100 , 1)
491  self.layerNo = Adjuster(panel, "Number of Layers", 1, 10, 10)
492 
493  self.lengthUnit = {'micrometer':micrometer, 'mm':mm, 'cm':cm, 'm':m}
494  self.absorberThickSpin = FloatCounter(panel, "Absorber Thickness", self.lengthUnit.keys())
495  self.gapThickSpin = FloatCounter(panel, "Gap Thickness", self.lengthUnit.keys())
496  self.sizeYZSpin = FloatCounter(panel, "Section Size", self.lengthUnit.keys())
497  self.cutLengthSpin = FloatCounter(panel, "Cut Length", self.lengthUnit.keys())
498  self.magneticUnit = {'Tesla':tesla, 'gauss':gauss, 'kilogauss':kilogauss}
499  self.magneticFieldSpin = FloatCounter(panel, "Magnetic Field", self.magneticUnit.keys())
501  self.energyUnit = { 'keV':keV, 'MeV':MeV, 'GeV':GeV, 'TeV':TeV, 'PeV':PeV}
502  self.energySpin = FloatCounter(panel, "incident beam energy", self.energyUnit.keys())
503 
504 
505 # now sizers
506 
507  bxsizer.Add(wx.StaticLine(panel), 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5)
508  bysizer.Add((10, -1))
509  bysizer.Add(self.theAbsorberMaterial, 0, wx.EXPAND, 10)
510  bysizer.Add((10, -1))
511  bysizer.Add(self.theGapMaterial, 0, wx.EXPAND, 10)
512  bysizer.Add((10, -1))
513  bysizer.Add(self.theParticle, 0, wx.EXPAND, 10)
514  bysizer.Add((10, -1))
515  bysizer.Add(self.theProcesses.sizer, 0, wx.EXPAND, 10)
516 
517  bxsizer.Add(bysizer, 0, wx.EXPAND)
518 
519  bxsizer.Add(wx.StaticLine(panel), 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5)
520  bxsizer.Add(self.layerNo.sizer, 0, wx.EXPAND)
521  bxsizer.Add(self.absorberThickSpin.sizer, 0, wx.EXPAND)
522  bxsizer.Add(self.gapThickSpin.sizer, 0, wx.EXPAND)
523  bxsizer.Add(self.sizeYZSpin.sizer, 0, wx.EXPAND)
524  bxsizer.Add(wx.StaticLine(panel), 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5)
525 
526  bxsizer.Add(self.energySpin.sizer, 0, wx.EXPAND)
527  bxsizer.Add(wx.StaticLine(panel), 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5)
528  bxsizer.Add(self.cutLengthSpin.sizer, 0, wx.EXPAND)
529  bxsizer.Add(wx.StaticLine(panel), 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5)
530  bxsizer.Add(self.magneticFieldSpin.sizer, 0, wx.EXPAND)
531 
532  bxsizer.Add(wx.StaticLine(panel), 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5)
533  bxsizer.Add(self.eventNo.sizer, 0, wx.EXPAND)
534 
535 # self.solid = EZgeom.G4EzVolume.GetSold(water_phantom)
536 # gControlExecute("oglx.mac")
537 
538  panel.SetSizer(bxsizer)
539  bxsizer.Fit(self)
bxsizer.SetSizeHints(self)

Member Function Documentation

def Lesson2Wx.MyApp.OnPageChanged (   self,
  event 
)

Definition at line 540 of file Lesson2Wx.py.

541  def OnPageChanged(self, event):
542  old = event.GetOldSelection()
543  new = event.GetSelection()
544  sel = self.nb.GetSelection()
545  event.Skip()
def Lesson2Wx.MyApp.OnPageChanging (   self,
  event 
)

Definition at line 546 of file Lesson2Wx.py.

547  def OnPageChanging(self, event):
548  old = event.GetOldSelection()
549  new = event.GetSelection()
550  sel = self.nb.GetSelection()
551  event.Skip()
def Lesson2Wx.MyApp.RunStart (   self,
  event 
)

Definition at line 552 of file Lesson2Wx.py.

553  def RunStart(self, event):

Field Documentation

list Lesson2Wx.MyApp.absorberTh = self.absorberThickSpin.theValue*self.lengthUnit[self.absorberThickSpin.theUnit]
static

Definition at line 554 of file Lesson2Wx.py.

Lesson2Wx.MyApp.absorberThickSpin

Definition at line 493 of file Lesson2Wx.py.

list Lesson2Wx.MyApp.cutLen = self.cutLengthSpin.theValue*self.lengthUnit[self.cutLengthSpin.theUnit]
static

Definition at line 558 of file Lesson2Wx.py.

Lesson2Wx.MyApp.cutLengthSpin

Definition at line 496 of file Lesson2Wx.py.

Lesson2Wx.MyApp.energySpin

Definition at line 501 of file Lesson2Wx.py.

Lesson2Wx.MyApp.energyUnit

Definition at line 500 of file Lesson2Wx.py.

Lesson2Wx.MyApp.eventNo

Definition at line 489 of file Lesson2Wx.py.

tuple Lesson2Wx.MyApp.eventNum = self.eventNo.slider.GetValue()
static

Definition at line 590 of file Lesson2Wx.py.

list Lesson2Wx.MyApp.gapTh = self.gapThickSpin.theValue*self.lengthUnit[self.gapThickSpin.theUnit]
static

Definition at line 555 of file Lesson2Wx.py.

Lesson2Wx.MyApp.gapThickSpin

Definition at line 494 of file Lesson2Wx.py.

Lesson2Wx.MyApp.layerNo

Definition at line 490 of file Lesson2Wx.py.

Lesson2Wx.MyApp.lengthUnit

Definition at line 492 of file Lesson2Wx.py.

list Lesson2Wx.MyApp.magF = self.magneticFieldSpin.theValue*self.magneticUnit[self.magneticFieldSpin.theUnit]
static

Definition at line 559 of file Lesson2Wx.py.

Lesson2Wx.MyApp.magneticFieldSpin

Definition at line 498 of file Lesson2Wx.py.

Lesson2Wx.MyApp.magneticUnit

Definition at line 497 of file Lesson2Wx.py.

Lesson2Wx.MyApp.nb

Definition at line 440 of file Lesson2Wx.py.

tuple Lesson2Wx.MyApp.position = -self.layerNo.slider.GetValue()
static

Definition at line 567 of file Lesson2Wx.py.

Lesson2Wx.MyApp.processList

Definition at line 486 of file Lesson2Wx.py.

Lesson2Wx.MyApp.runStart

Definition at line 473 of file Lesson2Wx.py.

Lesson2Wx.MyApp.sizeYZSpin

Definition at line 495 of file Lesson2Wx.py.

Lesson2Wx.MyApp.theAbsorberMaterial

Definition at line 479 of file Lesson2Wx.py.

Lesson2Wx.MyApp.theGapMaterial

Definition at line 481 of file Lesson2Wx.py.

Lesson2Wx.MyApp.theParticle

Definition at line 484 of file Lesson2Wx.py.

Lesson2Wx.MyApp.theProcesses

Definition at line 487 of file Lesson2Wx.py.

list Lesson2Wx.MyApp.yzSize = self.sizeYZSpin.theValue*self.lengthUnit[self.sizeYZSpin.theUnit]
static

Definition at line 556 of file Lesson2Wx.py.


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