You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: align post-boundary optical timing with Geant4 11.4+ (#260)
Geant4 11.4 substantially refactored G4OpBoundaryProcess, including the
dielectric-dielectric boundary handling path. In our simg4ox and
GPURaytrace workflows, Geant4 11.4+ is the first release family where
timing-sensitive optical comparisons diverge from the Geant4 11.3
baselines. That makes post-boundary timing correctness explicit in a way
our previous implementation did not handle.
This branch fixes two gaps in our handling of post-boundary optical
timing:
1. The Opticks GPU path advanced the next segment using the pre-boundary
medium group velocity even after transmission into material2.
2. The lightweight Geant4-side tracking/recording path used by simg4ox
did not explicitly enable UseGivenVelocity(true) for optical photons,
so the track was not forced to follow the boundary-selected velocity
during post-boundary recording.
Fix the GPU side by carrying the active-medium timing state through
qsim:
- store both material1 and material2 group velocities in sstate
- track current_material_index/current_group_velocity in sctx
- use current_group_velocity in propagate_to_boundary
- switch the carried material/velocity in propagate_at_boundary after
reflection/transmission
- refresh the carried velocity after each boundary lookup when the
boundary orientation still matches the active medium
- initialize the new fields in the QSim test/debug kernels
Fix the Geant4-side CPU recording path by enabling
UseGivenVelocity(true) for optical photons in g4app tracking action, so
the recorded post-boundary timing follows the velocity selected by
Geant4.
Because hit merging in this codebase is time-bucket based, correcting
post-boundary timing changes timing-sensitive observables and can change
merged hit counts. The follow-up test updates on this branch therefore
make expected residual diffs and hit-count baselines depend on the
Geant4 release family instead of treating the new values as regressions.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
s.material2=boundary_lookup( wavelength, m2_line, 0); // refractive_index, (absorption_length, scattering_length, reemission_prob) only m2:refractive index actually used
196
198
s.surface=boundary_lookup( wavelength, su_line, 0); // detect, , absorb , (reflect_specular), reflect_diffuse [they add to 1. so one not used]
0 commit comments