Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/python
# ==================================================================
# An example for reading a GDML file
#
# ==================================================================
from Geant4 import *
from Geant4.G4gdml import *
import ExN01pl, ParticleGun
# ==================================================================
# user actions in python
# ==================================================================
class MyDetectorConstruction(G4VUserDetectorConstruction):
"My Detector Construction"
def __init__(self):
G4VUserDetectorConstruction.__init__(self)
self.world= None
self.sxp= SAXProcessor()
self.config= ProcessingConfigurator()
# -----------------------------------------------------------------
def __del__(self):
self.sxp.Finalize()
# -----------------------------------------------------------------
def Construct(self):
self.sxp.Initialize()
self.config.SetURI("qgeom.gdml")
self.config.SetSetupName("Default")
self.sxp.Configure(self.config)
self.sxp.Run()
self.world= GDMLProcessor.GetInstance().GetWorldVolume()
return self.world
# ==================================================================
# main
# ==================================================================
# set geometry
myDC= MyDetectorConstruction()
gRunManager.SetUserInitialization(myDC)
# minimal physics list
ExN01pl.Construct()
# set primary generator action
ParticleGun.Construct()
# initialize
gRunManager.Initialize()
# visualization
gApplyUICommand("/vis/open OGLIX")
gApplyUICommand("/vis/scene/create")
gApplyUICommand("/vis/scene/add/volume")
gApplyUICommand("/vis/sceneHandler/attach")
gApplyUICommand("/vis/viewer/set/viewpointThetaPhi 90. -90.")