File indexing completed on 2026-05-29 07:35:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 import os
0012 import DDG4
0013
0014 """
0015
0016 dd4hep example setup using the python configuration
0017 and reading a HepEvt event
0018
0019 \author M.Frank
0020 \version 1.0
0021
0022 """
0023
0024
0025 def run():
0026 from MiniTelSetup import Setup
0027 args = DDG4.CommandLine()
0028 m = Setup()
0029 if args.batch:
0030 m.kernel.UI = ''
0031 m.configure()
0032 m.defineOutput()
0033 fname = os.environ['DD4hepExamplesINSTALL'] + '/examples/DDG4/data/Muons10GeV.HEPEvt'
0034 m.setupInput('Geant4EventReaderHepEvtShort|' + fname)
0035 m.setupGenerator()
0036 m.setupPhysics(model='FTFP_BERT')
0037
0038
0039
0040 phys_list = m.geant4.addPhysics('MyPhysics')
0041
0042
0043
0044 limiter_physics = phys_list.addPhysicsConstructorType('G4StepLimiterPhysics')
0045 limiter_physics.SetApplyToAll(True)
0046
0047
0048 m.phys.dump()
0049
0050
0051 if args.events:
0052 m.run(num_events=int(args.events))
0053 else:
0054 m.run(num_events=1)
0055
0056
0057 if __name__ == '__main__':
0058 run()