celeritas icon indicating copy to clipboard operation
celeritas copied to clipboard

Support surface normals in VecGeom

Open hhollenb opened this issue 3 months ago • 1 comments

Optical surface physics requires getting the surface normal from the geometry implementation. Currently there's a working surface normal implementation in ORANGE but we should also add one to VecGeom (the VecGeomTrackView::normal() function throws CELER_NOT_IMPLEMENTED at the moment). This limits any of the integration tests using the surface normal from the track's geometry, including:

  • celeritas/optical/PrimaryGenerator
  • celeritas/optical/OpticalCollector
  • app/celer-sim:lar

Namely they call InitBoundaryExecutor as part of the optical photon transportation which (in an upcoming PR) will call GeoTrackView::normal(). For now I'll suggest limiting these tests to just running in ORANGE and then include VecGeom once surface normals are supported.

The convention we're using for surface normals is that they should always point from the post-volume into the pre-volume. In other words, the following assertion should pass after a call to cross_boundary:

#include "celeritas/optical/surface/SurfacePhysicsUtils.hh"
CELER_ASSERT(is_entering_volume(track.geometry().dir(), track.geometry().normal());

hhollenb avatar Aug 28 '25 21:08 hhollenb

@mrguilima Could you make this your highest priority?

sethrj avatar Aug 29 '25 01:08 sethrj