k4bench.runner.steering¶
k4bench.runner.steering ¶
Reconcile a ddsim steering file with a patched geometry.
Steering files configure sensitive detectors by subdetector name. Most of
those mappings tolerate a name that is not in the geometry:
SIM.action.mapActions and SIM.filter.mapDetFilter are substring-matched
against the sensitive detectors that actually exist, so a stale entry is simply
never matched. SIM.geometry.regexSensitiveDetector is the exception — each
key is resolved to a DetElement by Geant4RegexSensitivesConstruction,
and a missing one aborts ddsim during kernel.initialize() with::
dd4hep: DetElement::child Unknown child with name: <detector>
Geometry sweeps remove subdetectors from the compact file, so any steering file naming a removed subdetector that way would fail. This module writes a copy of the steering file with a generated epilogue that drops the unresolvable entries, and leaves everything else untouched.
The copy is written into the run's log directory next to <label>.log so the
exact configuration a run used stays inspectable after the fact.
Only patched runs are reconciled. Baseline runs use the original steering file verbatim, which keeps a genuine typo in a steering file a hard error rather than a silently dropped sensitive detector.
reconcile_steering_file ¶
reconcile_steering_file(*, extra_args: list[str], present_detectors: set[str], log_dir: Path, label: str) -> list[str]
Return extra_args with --steeringFile pointing at a reconciled copy.
Returns extra_args unchanged when it carries no steering file, so callers can apply this to every patched run unconditionally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_args
|
list[str]
|
ddsim arguments for this run, as passed through to the executor. |
required |
present_detectors
|
set[str]
|
Subdetector names present in the patched geometry for this run. |
required |
log_dir
|
Path
|
Directory the reconciled copy is written to. |
required |
label
|
str
|
Run label; used as the filename stem. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Arguments to hand to :func: |