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 os
0013 import time
0014 import DDG4TestSetup
0015 """
0016 
0017    dd4hep example setup using the python configuration
0018 
0019    \author  M.Frank
0020    \version 1.0
0021 
0022 """
0023 
0024 
0025 class Setup(DDG4TestSetup.Setup):
0026   def __init__(self, geometry=None, macro=None, vis=None):
0027     install_dir = os.environ['DD4hepExamplesINSTALL']
0028     if geometry is None:
0029       geometry = "/examples/ClientTests/compact/MiniTel.xml"
0030     DDG4TestSetup.Setup.__init__(self, "file:" + install_dir + geometry, macro=macro, vis=vis)
0031 
0032   def configure(self, output_level=None):
0033     from dd4hep import DetElement
0034     DDG4TestSetup.Setup.configure(self)
0035     for i in self.geant4.description.detectors():
0036       det = DetElement(i.second.ptr())
0037       sd = self.description.sensitiveDetector(str(det.name()))
0038       if sd.isValid():
0039         seq, act = self.geant4.setupTracker(det.name())
0040         if output_level:
0041           act.OutputLevel = output_level
0042     return self
0043 
0044   def defineOutput(self, output=None):
0045     if output is None:
0046       output = 'MiniTel_' + time.strftime('%Y-%m-%d_%H-%M')
0047     return DDG4TestSetup.Setup.defineOutput(self, output)
0048 
0049   def defineEdm4hepOutput(self, output=None):
0050     if output is None:
0051       output = 'MiniTel_' + time.strftime('%Y-%m-%d_%H-%M')
0052     return DDG4TestSetup.Setup.defineEdm4hepOutput(self, output)