File indexing completed on 2025-01-30 09:17:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 from __future__ import absolute_import, unicode_literals
0012 import DDG4
0013
0014 """
0015
0016 dd4hep example setup using the python configuration
0017
0018 \author M.Frank
0019 \version 1.0
0020
0021 """
0022
0023
0024 def run():
0025 from MiniTelSetup import Setup
0026 args = DDG4.CommandLine()
0027
0028 m = Setup(geometry=args.geometry)
0029 cmds = []
0030 if args.events:
0031 cmds = ['/run/beamOn ', str(args.events)]
0032
0033 if args.batch:
0034 DDG4.setPrintLevel(DDG4.OutputLevel.WARNING)
0035 cmds.append('/ddg4/UI/terminate')
0036 m.kernel.UI = ''
0037
0038
0039 seq, act = m.geant4.addDetectorConstruction("Geant4DetectorGeometryConstruction/ConstructGeo")
0040 if args.debug:
0041 act.DebugVolumes = True
0042 act.DebugRegions = True
0043 act.DebugLimits = True
0044
0045 seq, act = m.geant4.addDetectorConstruction("Geant4DetectorSensitivesConstruction/ConstructSD")
0046 m.ui.Commands = cmds
0047 m.configure()
0048 m.defineOutput()
0049 m.setupGun()
0050 m.setupGenerator()
0051 m.setupPhysics()
0052 m.run()
0053
0054
0055 if __name__ == "__main__":
0056 run()