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
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/python
# ==================================================================
# An example of writing a GDML file
#
# ==================================================================
from Geant4 import *
from Geant4.G4gdml import *
import Qmaterials, Qgeom
import ExN01pl, ParticleGun
# ==================================================================
# main
# ==================================================================
# set geometry
Qmaterials.Construct()
Qgeom.Construct()
# 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.")
# write to a GDML file
print "\n*** write to a GDML file..."
navigator= gTransportationManager.GetNavigatorForTracking()
world_volume= navigator.GetWorldVolume()
gdml_writer= G4GDMLWriter("GDMLSchema/gdml.xsd", "qgeom.gdml")
gdml_writer.DumpGeometryInfo(world_volume)