k4bench.geometry.scanner¶
k4bench.geometry.scanner ¶
Public discovery façade over :class:~k4bench.geometry.index.GeometryIndex.
get_detector_names ¶
Return the names of all <detector> elements in the geometry.
Recursively follows DD4hep document references starting from xml_path,
including both <include ref="..."/> and <includes><file
ref="..."/></includes>, collecting every <detector name="...">
attribute found across all reachable files. Order is encounter order;
duplicates are suppressed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml_path
|
Path
|
Path to the top-level compact XML file. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Detector names in the order they are first encountered. |
Source code in k4bench/geometry/scanner.py
resolve_includes ¶
Return all XML files reachable from xml_path via includes.
Follows DD4hep document references recursively. The returned list is in encounter order and contains no duplicates. xml_path itself is always the first element.
Includes whose ref attribute contains an unresolved environment
variable (e.g. ${DD4hepINSTALL}/...) are skipped silently —
ddsim resolves these at runtime using its own search path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml_path
|
Path
|
Absolute or relative path to a DD4hep compact XML file. |
required |
Returns:
| Type | Description |
|---|---|
list[Path]
|
Resolved, deduplicated paths in encounter order. |