test(simg4ox): validate dRICH sensor hits - #428
Conversation
The partial-phi sphere and tube implementation from #426 has focused geometry and intersection tests, but it lacks an end-to-end regression using a realistic detector that converts those solids and compares optical-photon detection across Geant4 and Opticks. The dRICH fixture provides that coverage with one partial sphere, three partial tubes, and 210 annotated photon-sensor volumes. Add a deterministic 10,000-photon, 420 nm torch configuration aimed at a dRICH SiPM patch so the CPU and GPU receive identical optical input and produce stable nonzero hit samples. Register Integration.simg4ox.drich through the common CMake helper, allow hit-validation cases to select a custom macro, and use run_validate.mac so Geant4 invokes the sensor SDs. The complete geometry is converted before transport, so the test exercises partial-phi construction even though the controlled beam targets the sensors directly. GDML import strips pointer-like suffixes from logical-volume names, leaving distinct dRICH sensor volumes with duplicate names. Append a numeric index to each PhotonSD name so G4SDManager collection keys remain unique and all Geant4 sensor hits are retained for the existing three-sigma count and distribution comparison.
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end dRICH regression to the simg4ox integration suite, using a deterministic torch configuration to compare Geant4 vs Opticks optical-photon hit distributions while exercising partial-phi solid conversion and ensuring Geant4 hit collection names remain unique.
Changes:
- Add
drichas a CTest-driven simg4ox integration test case and wire it into the existing test runner. - Allow hit-validation tests to override the Geant4 macro file and run dRICH with
run_validate.macto ensure sensor SD invocation. - Introduce a
config/drich.jsontorch/event configuration and update Geant4PhotonSDnaming to avoid duplicate SD/HC keys.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_simg4ox.sh | Adds drich test case; allows hit-validation to pass a custom macro (uses run_validate.mac). |
| tests/CMakeLists.txt | Registers Integration.simg4ox.drich via the common CMake test helper. |
| src/g4app.h | Appends an index to PhotonSD names to avoid collisions from duplicate GDML logical-volume names. |
| config/drich.json | New deterministic 10,000-photon (420 nm) torch configuration for dRICH hit validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The partial-phi sphere and tube implementation from #426
has focused geometry and intersection tests, but it lacks an end-to-end
regression using a realistic detector that converts those solids and
compares optical-photon detection across Geant4 and Opticks. The dRICH
fixture provides that coverage with one partial sphere, three partial
tubes, and 210 annotated photon-sensor volumes.
Add a deterministic 10,000-photon, 420 nm torch configuration aimed at
a dRICH SiPM patch so the CPU and GPU receive identical optical input
and produce stable nonzero hit samples. Register
Integration.simg4ox.drich through the common CMake helper, allow
hit-validation cases to select a custom macro, and use run_validate.mac
so Geant4 invokes the sensor SDs. The complete geometry is converted
before transport, so the test exercises partial-phi construction even
though the controlled beam targets the sensors directly.
GDML import strips pointer-like suffixes from logical-volume names,
leaving distinct dRICH sensor volumes with duplicate names. Append
a numeric index to each PhotonSD name so G4SDManager collection keys
remain unique and all Geant4 sensor hits are retained for the existing
three-sigma count and distribution comparison.