File indexing completed on 2025-01-18 09:14:22
0001 """Helper object for configuration of Geant4 commands to run during different phases."""
0002
0003 from DDSim.Helper.ConfigHelper import ConfigHelper
0004
0005
0006 class UI(ConfigHelper):
0007 """Configuration for setting commands to run during different phases.
0008
0009 In this section, one can configure commands that should be run during the different phases of the Geant4 execution.
0010
0011 1. Configuration
0012 2. Initialization
0013 3. Pre Run
0014 4. Post Run
0015 5. Terminate / Finalization
0016
0017 For example, one can add
0018
0019 >>> SIM.ui.commandsConfigure = ['/physics_lists/em/SyncRadiation true']
0020
0021 Further details should be taken from the Geant4 documentation.
0022 """
0023
0024 def __init__(self):
0025 super(UI, self).__init__()
0026
0027 self._commandsConfigure = []
0028 self._commandsInitialize = []
0029 self._commandsPostRun = []
0030 self._commandsPreRun = []
0031 self._commandsTerminate = []
0032 self._closeProperties()
0033
0034 @property
0035 def commandsConfigure(self):
0036 """List of UI commands to run during the 'Configure' phase."""
0037 return self._commandsConfigure
0038
0039 @commandsConfigure.setter
0040 def commandsConfigure(self, val):
0041 self._commandsConfigure = self.makeList(val)
0042
0043 @property
0044 def commandsInitialize(self):
0045 """List of UI commands to run during the 'Initialize' phase."""
0046 return self._commandsInitialize
0047
0048 @commandsInitialize.setter
0049 def commandsInitialize(self, val):
0050 self._commandsInitialize = self.makeList(val)
0051
0052 @property
0053 def commandsPostRun(self):
0054 """List of UI commands to run during the 'PostRun' phase."""
0055 return self._commandsPostRun
0056
0057 @commandsPostRun.setter
0058 def commandsPostRun(self, val):
0059 self._commandsPostRun = self.makeList(val)
0060
0061 @property
0062 def commandsPreRun(self):
0063 """List of UI commands to run during the 'PreRun' phase."""
0064 return self._commandsPreRun
0065
0066 @commandsPreRun.setter
0067 def commandsPreRun(self, val):
0068 self._commandsPreRun = self.makeList(val)
0069
0070 @property
0071 def commandsTerminate(self):
0072 """List of UI commands to run during the 'Terminate' phase."""
0073 return self._commandsTerminate
0074
0075 @commandsTerminate.setter
0076 def commandsTerminate(self, val):
0077 self._commandsTerminate = self.makeList(val)