Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-07 07:49:56

0001 # ==========================================================================
0002 #  AIDA Detector description implementation
0003 # --------------------------------------------------------------------------
0004 # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 # All rights reserved.
0006 #
0007 # For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 #
0010 # ==========================================================================
0011 import DDG4
0012 #
0013 """
0014 
0015    dd4hep example setup using the python configuration
0016 
0017    \author  M.Frank
0018    \version 1.0
0019 
0020 """
0021 
0022 
0023 def run():
0024   from MiniTelSetup import Setup
0025   args = DDG4.CommandLine()
0026 
0027   m = Setup(geometry=args.geometry)
0028   cmds = []
0029   if args.events:
0030     cmds = ['/run/beamOn ', str(args.events)]
0031 
0032   if args.batch:
0033     DDG4.setPrintLevel(DDG4.OutputLevel.WARNING)
0034     cmds.append('/ddg4/UI/terminate')
0035     m.kernel.UI = ''
0036 
0037   # Configure G4 geometry setup
0038   seq, act = m.geant4.addDetectorConstruction("Geant4DetectorGeometryConstruction/ConstructGeo")
0039   if args.debug:
0040     act.DebugVolumes = True
0041     act.DebugRegions = True
0042     act.DebugLimits = True
0043 
0044   seq, act = m.geant4.addDetectorConstruction("Geant4DetectorSensitivesConstruction/ConstructSD")
0045   m.ui.Commands = cmds
0046   m.configure()
0047   m.defineOutput()
0048   m.setupGun()
0049   m.setupGenerator()
0050   m.setupPhysics()
0051   m.run()
0052 
0053 
0054 if __name__ == "__main__":
0055   run()