/control/

UI control commands.

Sub-directories

/control/cout/Control cout/cerr for local thread.

Commands

macroPath
execute
loop
foreach
suppressAbortion
verbose
useDoublePrecision
saveHistory
stopSavingHistory
alias
unalias
listAlias
getEnv
getVal
echo
shell
manual
createHTML
maximumStoredHistory
if
doif
add
subtract
multiply
divide
remainder
strif
strdoif
ifBatch
ifInteractive
doifBatch
doifInteractive

macroPath [path]

Set macro search path with colon-separated list.

Available at all Geant4 states.

Parameters
path type s

execute [fileName]

Execute a macro file.

Available at all Geant4 states.

Parameters
fileName type s

loop [macroFile] [counterName] [initialValue] [finalValue] [stepSize]

Execute a macro file more than once.
Loop counter can be used as an aliased variable.

Available at all Geant4 states.

Parameters
macroFile type s
counterName type s
initialValue type d
finalValue type d
stepSize type d Omittable : default value = 1

foreach [macroFile] [counterName] [valueList]

Execute a macro file more than once.
Loop counter can be used as an aliased variable.
Values must be separated by a space.

Available at all Geant4 states.

Parameters
macroFile type s
counterName type s
valueList type s

suppressAbortion [level]

Suppress the program abortion caused by G4Exception.
Suppression level = 0 : no suppression
= 1 : suppress during EventProc state
= 2 : full suppression, i.e. no abortion by G4Exception
When abortion is suppressed, you will get error messages issued by G4Exception,
and there is NO guarantee for the correct result after the G4Exception error message.

Range : level >= 0 && level <= 2

Available at all Geant4 states.

Parameters
level type i Omittable : default value = 0

verbose [switch]

Applied command will also be shown on screen.
This command is useful with MACRO file.
0 : silent
1 : only the valid commands are shown.
2 : comment lines are also shown (default).

Range : switch >= 0 && switch <=2

Available at all Geant4 states.

Parameters
switch type i Omittable : default value = 2

useDoublePrecision [useDoublePrecision]

Use double precision for printing out the current parameter value(s).

Available at all Geant4 states.

Parameters
useDoublePrecision type b Omittable : default value = 1

saveHistory [fileName]

Store command history to a file.
Defaul file name is G4history.macro.

Available at all Geant4 states.

Parameters
fileName type s Omittable : default value = G4History.macro

stopSavingHistory

Stop saving history file.

Available at all Geant4 states.

alias [aliasName] [aliasValue]

Set an alias.
String can be aliased by this command.
The string may contain one or more spaces,
the string must be enclosed by double quotes (").
To use an alias, enclose the alias name with
parenthesis "{" and "}".

Available at all Geant4 states.

Parameters
aliasName type s
aliasValue type s

unalias [aliasName]

Remove an alias.

Available at all Geant4 states.

Parameters
aliasName type s

listAlias

List aliases.

Available at all Geant4 states.

getEnv []

Get a shell environment variable and define it as an alias.

Available at all Geant4 states.

Parameters
type s

getVal [alias_name] [UI_command] [iIdx]

Get the current value of the UI command and define it as an alias.
Command is ignored if the UI command does not support GetCurrentValue().
Syntax : <alias_name> <UI_command> <iIdx>

Available at all Geant4 states.

Parameters
alias_name type s
UI_command type s
iIdx type i Omittable : default value = 0

echo []

Display the valuerameter string.
If alias is contained, it is converted to the aliased value.

Available at all Geant4 states.

Parameters
type s

shell []

Execute a (Unix) SHELL command.

Available at all Geant4 states.

Parameters
type s

manual [dirPath]

Display all of sub-directories and commands.
Directory path should be given by FULL-PATH.

Available at all Geant4 states.

Parameters
dirPath type s Omittable : default value = /

createHTML [dirPath]

Generate HTML files for all of sub-directories and commands.
Directory path should be given by FULL-PATH.

Available at all Geant4 states.

Parameters
dirPath type s Omittable : default value = /

maximumStoredHistory [max]

Set maximum number of stored UI commands.

Available at all Geant4 states.

Parameters
max type i Omittable : default value = 20

if [left] [comp] [right] [macroFile]

Execute a macro file if the expression is true.
Syntax : <double> <comp> <double> <macro_file>

Available at all Geant4 states.

Parameters
left type d
comp type s Parameter candidates : > >= < <= == !=
right type d
macroFile type s

doif [left] [comp] [right] [UI_command]

Execute a UI command if the expression is true.
Syntax : <double> <comp> <double> <UI_command>

Available at all Geant4 states.

Parameters
left type d
comp type s Parameter candidates : > >= < <= == !=
right type d
UI_command type s

add [new_alias] [value1] [value2]

Define a new alias as the sum of two values.
Syntax : <new_alias> <value1> <value2>
<new_alias> may be an already existing alias. If it is the case,
aliased value is alternated.

Available at all Geant4 states.

Parameters
new_alias type s
value1 type d
value2 type d

subtract [new_alias] [value1] [value2]

Define a new alias as the subtraction of two values.
Syntax : <new_alias> <value1> <value2>
<new_alias> may be an already existing alias. If it is the case,
aliased value is alternated.

Available at all Geant4 states.

Parameters
new_alias type s
value1 type d
value2 type d

multiply [new_alias] [value1] [value2]

Define a new alias as the multiplication of two values.
Syntax : <new_alias> <value1> <value2>
<new_alias> may be an already existing alias. If it is the case,
aliased value is alternated.

Available at all Geant4 states.

Parameters
new_alias type s
value1 type d
value2 type d

divide [new_alias] [value1] [value2]

Define a new alias as the division of two values.
Syntax : <new_alias> <value1> <value2>
<new_alias> may be an already existing alias. If it is the case,
aliased value is alternated.

Available at all Geant4 states.

Parameters
new_alias type s
value1 type d
value2 type d Parameter range : value2 != 0

remainder [new_alias] [value1] [value2]

Define a new alias as the remainder of two values.
Syntax : <new_alias> <value1> <value2>
<new_alias> may be an already existing alias. If it is the case,
aliased value is alternated.

Available at all Geant4 states.

Parameters
new_alias type s
value1 type i
value2 type i

strif [left] [comp] [right] [macroFile]

Execute a macro file if the expression is true.
Syntax : <string> <comp> <string> <macro_file>

Available at all Geant4 states.

Parameters
left type s
comp type s Parameter candidates : == !=
right type s
macroFile type s

strdoif [left] [comp] [right] [UI_command]

Execute a UI command if the expression is true.
Syntax : <string> <comp> <string> <UI_command>

Available at all Geant4 states.

Parameters
left type s
comp type s Parameter candidates : == !=
right type s
UI_command type s

ifBatch [macroFile]

Execute a macro file if program is running in batch mode.

Available at all Geant4 states.

Parameters
macroFile type s

ifInteractive [macroFile]

Execute a macro file if program is running in interactive mode.

Available at all Geant4 states.

Parameters
macroFile type s

doifBatch [UIcommand]

Execute a UI command if program is running in batch mode.

Available at all Geant4 states.

Parameters
UIcommand type s

doifInteractive [UIcommand]

Execute a UI command if program is running in interactive mode.

Available at all Geant4 states.

Parameters
UIcommand type s