spine.geo.manager.GeoManager
- class spine.geo.manager.GeoManager[source]
Manages a singleton instance of a Geometry class.
Methods
Get the current geometry instance.
Get the current geometry instance if initialized.
initialize(detector[, tag, version])Initialize the geometry module for a given detector.
initialize_or_get(detector[, tag, version])Initialize the geometry if needed, or return the existing instance.
Check if the geometry instance is initialized.
reset()Reset the geometry instance (useful for testing).
- __init__(*args, **kwargs)
Methods
__init__(*args, **kwargs)Get the current geometry instance.
Get the current geometry instance if initialized.
initialize(detector[, tag, version])Initialize the geometry module for a given detector.
initialize_or_get(detector[, tag, version])Initialize the geometry if needed, or return the existing instance.
Check if the geometry instance is initialized.
reset()Reset the geometry instance (useful for testing).
- classmethod initialize(detector: str, tag: str | None = None, version: str | int | float | None = None) Geometry[source]
Initialize the geometry module for a given detector.
- Parameters:
detector (str) – The name of the detector.
tag (str, optional) – A tag to identify a specific configuration.
version (str, optional) – A version number for the geometry configuration.
- Returns:
The initialized geometry instance.
- Return type:
- classmethod initialize_or_get(detector: str, tag: str | None = None, version: str | int | float | None = None) Geometry[source]
Initialize the geometry if needed, or return the existing instance.
- Parameters:
detector (str) – The name of the detector.
tag (str, optional) – A tag to identify a specific configuration.
version (str, optional) – A version number for the geometry configuration.
- classmethod is_initialized() bool[source]
Check if the geometry instance is initialized.
- Returns:
True if the geometry instance is initialized, False otherwise.
- Return type:
bool
- classmethod get_instance() Geometry[source]
Get the current geometry instance.
- Parameters:
raise_error (bool, optional) – Whether to raise an error if the instance is not initialized.
- Returns:
The current geometry instance.
- Return type: