3.1.2.19. opengate.utility

3.1.2.19.1. Module Contents

3.1.2.19.1.1. Functions

assert_equal_dic(d1, d2[, name])

ensure_directory_exists(directory)

get_material_name_variants(material_name)

Get different variants of a material name, e.g. with/without prepended G4_, only first letter capital.

g4_best_unit(value, unit_type)

assert_key(key, d)

assert_keys(keys, d)

indent(amount, text[, ch])

Prefix the text with indent spaces

assert_unique_element_name(elements, name)

make_builders(class_names)

Consider a list of Classname. For each, it build a key/value, with:

read_mac_file_to_commands(filename)

ensure_filename_is_str(filename)

insert_suffix_before_extension(file_path, suffix[, ...])

get_random_folder_name([size, create])

get_rnd_seed(seed)

DDF()

Debug print current Function name

DD(arg)

Debug print variable name and its value

print_dic(dic)

get_release_date(opengate_version)

get_contrib_path()

print_opengate_info()

Print information about OpenGate and the environment

standard_error_c4_correction(n)

Parameters

3.1.2.19.1.2. Attributes

g4_units

opengate.utility.assert_equal_dic(d1, d2, name='')[source]
opengate.utility.ensure_directory_exists(directory)[source]
opengate.utility.g4_units[source]
opengate.utility.get_material_name_variants(material_name)[source]

Get different variants of a material name, e.g. with/without prepended G4_, only first letter capital. Intended to bridge inconsistencies in naming conventions.

opengate.utility.g4_best_unit(value, unit_type)[source]
opengate.utility.assert_key(key: str, d: box.Box)[source]
opengate.utility.assert_keys(keys: list, d: box.Box)[source]
opengate.utility.indent(amount, text, ch=' ')[source]

Prefix the text with indent spaces https://stackoverflow.com/questions/8234274/how-to-indent-the-contents-of-a-multi-line-string

opengate.utility.assert_unique_element_name(elements, name)[source]
opengate.utility.make_builders(class_names)[source]

Consider a list of Classname. For each, it build a key/value, with: - the type of the class as key - and a lambda function that create an object of this class as value

opengate.utility.read_mac_file_to_commands(filename)[source]
opengate.utility.ensure_filename_is_str(filename)[source]
opengate.utility.insert_suffix_before_extension(file_path, suffix, suffixSeparator='-')[source]
opengate.utility.get_random_folder_name(size=8, create=True)[source]
opengate.utility.get_rnd_seed(seed)[source]
opengate.utility.DDF()[source]

Debug print current Function name

opengate.utility.DD(arg)[source]

Debug print variable name and its value

opengate.utility.print_dic(dic)[source]
opengate.utility.get_release_date(opengate_version)[source]
opengate.utility.get_contrib_path()[source]
opengate.utility.print_opengate_info()[source]

Print information about OpenGate and the environment

opengate.utility.standard_error_c4_correction(n)[source]

3.1.2.19. Parameters

ninteger

Number of subsets (of the samples).

3.1.2.19. Returns

c4double

Factor to convert the biased standard error of the mean of subsets of the sample into an unbiased - assuming a normal distribution . Usage: standard_error(unbiased) = standard_deviation_of_mean(=biased) / c4 The reason is that the standard deviation of the mean of subsets of the sample X underestimates the true standard error. For n = 2 this underestimation is about 25%.

Values for c4: n=2: 0.7979; n= 9: 0.9693