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