Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:17:46

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