Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 07:52:24

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 sys
0012 import time
0013 import DDG4
0014 import MiniTelSetup
0015 from DDG4 import OutputLevel as Output
0016 #
0017 #
0018 """
0019 
0020    dd4hep example setup using the python configuration
0021 
0022    \author  M.Frank
0023    \version 1.0
0024 
0025 """
0026 
0027 
0028 def run():
0029   m = MiniTelSetup.Setup()
0030   if len(sys.argv) >= 2 and sys.argv[1] == "batch":
0031     m.kernel.NumEvents = 200
0032     m.kernel.UI = ''
0033     DDG4.setPrintLevel(Output.WARNING)
0034 
0035   m.configure()
0036   m.setupGun()
0037   part = m.setupGenerator()
0038   part.OutputLevel = Output.DEBUG
0039   # This is the actual test:
0040   hit_tuple = DDG4.EventAction(m.kernel, 'HitTupleAction/MiniTelTuple', True)
0041   hit_tuple.OutputFile = 'MiniTel_EnergyDeposits_' + time.strftime('%Y-%m-%d_%H-%M') + '.root'
0042   hit_tuple.Collections = ['*']
0043   m.kernel.eventAction().add(hit_tuple)
0044   # Setup physics
0045   m.setupPhysics()
0046   # ... and run
0047   m.geant4.execute()
0048 
0049 
0050 if __name__ == "__main__":
0051   run()