Skip to content

fix(drich): make mirror coating directional - #440

Open
plexoos wants to merge 2 commits into
mainfrom
fix-two-sided-surface
Open

fix(drich): make mirror coating directional#440
plexoos wants to merge 2 commits into
mainfrom
fix-two-sided-surface

Conversation

@plexoos

@plexoos plexoos commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the dRICH mirror logical skin surface with an ordered C2F6_DRICH → DRICH_mirror_sec0 border surface
  • introduce MirrorBacking_DRICH, retaining the acrylic composition and density while matching the surrounding gas optical properties
  • preserve the original direct-SiPM test as drich_direct_sensor
  • add dedicated mirror-only and full aerogel-to-SiPM integration tests

Motivation

PR #434 demonstrated that the original dRICH integration test sent photons
directly to the SiPMs and therefore did not exercise mirror reflection. A
one-bounce mirror configuration produced approximately 5,600 GPU hits but no
Geant4 hits.

The discrepancy came from the mirror coating being represented as a logical
skin surface. Skin surfaces apply from either side of their logical volume.
After the intended reflection, Geant4 could relocate the photon into the
mirror backing, encounter the same coating from the reverse side, and become
trapped in repeated StepTooSmall boundary interactions. Opticks performed
the intended reflection and continued toward the sensor.

This change models the coating as an ordered gas-to-mirror border surface, so
it is active only on the physically illuminated side. The optically
inaccessible backing is also index-matched to C2F6_DRICH, preventing a
numerical boundary relocation from introducing a nonphysical
acrylic-to-gas refraction.

Test coverage

The dRICH coverage is split into three independently named scenarios:

Test Optical path Geant4 hits GPU hits
drich_direct_sensor direct SiPM illumination 8,276 8,280
drich_mirror gas → mirror → SiPM 5,091 4,993
drich_aerogel Aerogel_DRICH → AirOptical → Acrylic_DRICH → C2F6_DRICH → mirror → SiPM 19 27

The mirror-only source disc is widened to 100 mm to exercise a broader
reflected footprint. The aerogel source starts inside the realistic radiator
aperture and traverses all three downstream interfaces before reflecting onto
a SiPM.

All cases use the existing 3-sigma hit-count comparison and chi-squared
position/direction checks.

Validation

ctest --test-dir build \
  -R 'Integration\.simg4ox\.drich_(direct_sensor|aerogel|mirror)$' \
  --output-on-failure

Model the dRICH mirror coating as an ordered gas-to-mirror border
surface instead of a logical skin surface.

The skin surface applied the reflective dielectric-metal coating from
both sides of the mirror volume. After the initial reflection, Geant4
could relocate the photon into the mirror backing, apply the coating
again from the reverse side, and trap the photon in repeated
StepTooSmall boundary interactions. The GPU performed only the intended
reflection and continued toward the sensors.

Introduce an optically gas-matched mirror-backing material while
retaining the acrylic density and composition. Since the metallic
coating is opaque, the backing should not affect optical transport.
Index matching also prevents a nonphysical acrylic-to-gas refraction
during Geant4 boundary relocation.

Add a drich_mirror torch configuration that sends 10,000 photons along
a realistic one-bounce mirror-to-SiPM path. Register a separate
simg4ox integration test so the existing direct-SiPM coverage remains
unchanged.

The new test compares Geant4 and GPU hit counts and hit distributions.
It produces 5672 Geant4 hits and 5637 GPU hits, with all statistical
comparisons passing.
Rename the original dRICH torch configuration to drich_direct_sensor so its direct SiPM-hit purpose is explicit in both the config and CTest names.

Add a drich_aerogel source that starts inside Aerogel_DRICH and sends a 30 mm photon disc through AirOptical and Acrylic_DRICH, off the directional mirror, and onto a SiPM. Run it through the shared CPU/GPU hit validator so hit counts and position and direction distributions use the existing statistical checks.

Widen the mirror-only source disc to 100 mm to exercise a broader reflected footprint while retaining the dedicated control for gas-to-mirror transport.
@plexoos plexoos self-assigned this Aug 22, 2026
@plexoos plexoos added the test label Aug 22, 2026
@plexoos plexoos added this to simphony Aug 22, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in simphony Aug 22, 2026
@plexoos plexoos moved this from Backlog to Ready in simphony Aug 22, 2026
@plexoos
plexoos requested a lite review from Copilot August 22, 2026 00:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the dRICH integration-test geometry and test harness to make the mirror coating directional (using an ordered gas→mirror border surface instead of a logical skin surface), and splits the previous single dRICH scenario into three targeted integration tests that exercise direct sensor illumination, mirror reflection, and a longer aerogel-to-sensor path.

Changes:

  • Replace the dRICH mirror skin surface with an ordered C2F6_DRICH → DRICH_mirror_sec0 border surface and introduce MirrorBacking_DRICH with gas-matched optical properties.
  • Split the previous drich integration test into three scenarios: drich_direct_sensor, drich_mirror, and drich_aerogel.
  • Add per-scenario torch configuration files under config/ to drive the new integration tests.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_simg4ox.sh Replaces the single drich test-case entry with three dedicated dRICH scenarios wired to run_hit_validation.
tests/geom/drich.gdml Makes the mirror coating directional by switching to a border surface and adds MirrorBacking_DRICH with gas-matched optical properties.
tests/CMakeLists.txt Registers three separate dRICH integration tests instead of one.
config/drich_mirror.json Adds a mirror-bounce torch configuration for the new drich_mirror test scenario.
config/drich_direct_sensor.json Adds a direct-illumination torch configuration preserving the prior direct-to-SiPM behavior as drich_direct_sensor.
config/drich_aerogel.json Adds an aerogel-to-SiPM (multi-interface + mirror) torch configuration for the drich_aerogel scenario.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

dRICH GDML simulation yields very different hits in G4 CPU and Simphony

2 participants