Newer
Older
import os, time, DDG4
from DDG4 import OutputLevel as Output
from SystemOfUnits import *
#
#
"""
dd4hep example setup using the python configuration
install_dir = os.environ['DD4hepINSTALL']
example_dir = install_dir+'/examples/DDG4/examples';
kernel.setOutputLevel('Geant4Converter',Output.DEBUG)
kernel.setOutputLevel('RootOutput',Output.INFO)
kernel.setOutputLevel('ShellHandler',Output.DEBUG)
kernel.setOutputLevel('Gun',Output.INFO)
kernel.loadGeometry("file:"+install_dir+"/examples/ClientTests/compact/FCC_HcalBarrel.xml")
geant4 = DDG4.Geant4(kernel)
geant4.printDetectors()
geant4.setupCshUI()
field = geant4.setupTrackingField(prt=True)
evt_root = geant4.setupROOTOutput('RootOutput','FCC_'+time.strftime('%Y-%m-%d_%H-%M'),mc_truth=False)
geant4.setupGun("Gun",particle='pi-',energy=100*GeV,multiplicity=1)
seq,act = geant4.setupTracker('HcalBarrel')
seq,act = geant4.setupDetector('ContainmentShell','Geant4EscapeCounter')
# Now build the physics list:
phys = kernel.physicsList()
phys.extends = 'QGSP_BERT'
phys.enableUI()
phys.dump()