k4bench.geometry.patcher¶
k4bench.geometry.patcher ¶
Build temporary, validated DD4hep geometries with detectors removed.
RemovedPlugin
dataclass
¶
A plugin removed because one of its arguments named a detector.
PatchResult
dataclass
¶
PatchResult(top_path: Path, directory: Path, subfile_map: dict[Path, Path], removed_detectors: frozenset[str], collateral_detectors: frozenset[str], present_detectors: frozenset[str], removed_plugins: tuple[RemovedPlugin, ...], unresolved_refs: tuple[FilesystemRef, ...])
Generated patch paths and the facts measured during validation.
build_patch ¶
build_patch(index: GeometryIndex, remove: AbstractSet[str]) -> PatchResult
Build and validate one geometry patch.
The supplied index must be complete. Every declaration of each requested detector is removed, along with plugins whose argument values name it.
Source code in k4bench/geometry/patcher.py
patched ¶
patched(index: GeometryIndex, remove: AbstractSet[str]) -> Generator[PatchResult, None, None]
Yield one validated patch and always clean up its directory.
Source code in k4bench/geometry/patcher.py
patched_geometry ¶
Yield a strict, validated geometry with detector_name removed.
Source code in k4bench/geometry/patcher.py
patched_geometry_keep_only ¶
Yield a strict, validated geometry containing only keep_names.