remage.geombench package

Geometry benchmark utilities for remage.

Submodules

remage.geombench.__main__ module

remage.geombench.cli module

remage.geombench.cli.generate_macro(args, output_file_stem='')

Generate a macro file for the remage geometry benchmark.

This function creates a macro file based on the provided command-line arguments, which will be used to configure the remage simulation for the geometry benchmark.

Parameters:
  • args – Parsed command-line arguments.

  • output_file_stem (str)

Return type:

str

remage.geombench.cli.remage_geombench_cli(external_args=None)

Command-line interface for the remage geometry benchmark.

This function parses command-line arguments, sets up the macros, runs the geometry benchmark using the remage simulation framework, and analyzes the output plus provides a summary of the results.

Returns:

Exit code of the program. Returns 0 on success, non-zero on failure.

Return type:

int

Parameters:

external_args (list[str] | None)

remage.geombench.gdml_handling module

remage.geombench.gdml_handling.change_extent_of_world_volume(geometry, buffer_fraction=0, object_name='object_lv')

Expand the world volume to include buffer space around the geometry.

Parameters:
Return type:

dict

remage.geombench.gdml_handling.copy_referenced_resources(lv, src_reg, dst_reg)

Copy all resources referenced by a logical volume and its hierarchy.

This function recursively copies materials, solids, positions, rotations, and other defines needed by the logical volume and all its daughter volumes.

Parameters:
  • lv (LogicalVolume) – The logical volume whose resources are to be copied.

  • src_reg (Registry) – The source registry from which to copy resources.

  • dst_reg (Registry) – The destination registry to which resources will be copied.

Return type:

None

remage.geombench.gdml_handling.generate_tmp_gdml_geometry(geometry, buffer_fraction=0.25, object_name='object_lv')

Prepare a GDML geometry by wrapping it in a buffered world volume.

Creates a new GDML file with the geometry positioned in a world volume that includes buffer space around it.

Parameters:
  • geometry (dict) – Dictionary containing the loaded geometry with keys “object_lv” and “registry”.

  • buffer_fraction (optional) – Fractional buffer to add around the geometry. For example, 0.25 adds 12.5%% extra space on each side. Default is 0.25.

  • object_name (optional) – Name to assign to the object logical volume when positioning. Default is “object_lv”.

Returns:

Path to the temporary GDML file with the adjusted geometry.

Return type:

Path

remage.geombench.gdml_handling.load_gdml_geometry(gdml_path, object_name='object_lv')

Load a GDML geometry file and rename the world volume.

Parameters:
  • gdml_path (Path) – Path to the GDML file.

  • object_name (optional) – Name to assign to the loaded world volume. Default is “object_lv”.

Return type:

dict

remage.geombench.summary_generator module

class remage.geombench.summary_generator.SummaryGenerator(sim_output_file, args, output_file_stem)

Bases: object

Class to generate summary analysis for remage geometry benchmark outputs.

Parameters:
_get_hotspot_locations(threshold=0.8)

Get hotspot locations from multiplicative reconstruction above a certain threshold.

Parameters:

threshold (float)

Return type:

list[tuple[float, float, float]]

_multiplicative_reconstruction()

Reconstruct 3D using multiplication of normalized projections. This assumes independence and that hotspots must appear in all views.

Return type:

None

calculate_simulation_statistics(suffix='_stats.yaml')

Calculate simulation statistics.

Args:

suffix (str): Suffix for the output statistics file.

Returns:

dict: Dictionary containing simulation statistics.

Details:
  • Mean, standard deviation, minimum, and maximum simulation time per event.

  • Hotspot locations identified from the multiplicative reconstruction.

Parameters:

suffix (str)

Return type:

dict

draw_simulation_time_profiles(suffix='simulation_time_profiles.pdf')

Draw the simulation times per event for the three projections.

Parameters:

suffix (str)

Return type:

None

perform_analysis()
Return type:

dict