celeritas-project / celeritas

Celeritas is a new Monte Carlo transport code designed to accelerate scientific discovery in high energy physics by improving detector simulation throughput and energy efficiency using GPUs.
https://celeritas-project.github.io/celeritas/user/index.html
Other
58 stars 32 forks source link

Support union boundaries #1260

Open sethrj opened 1 month ago

sethrj commented 1 month ago

We've encountered an issue where the exterior boundary of a unit is a union so we cannot eliminate the surfaces from the boundary, resulting in a coincident (or nearly coincident) boundary in multiple levels. This results in a tracking error when crossing from the parent to the daughter because we end up in the "exterior" of the daughter universe. (It can also cause assertion errors when the daughter universe is complex because we start by validating that the point is "inside".) This shows up in the ATLAS tile calorimeter which has a union that contains another physical volume.

The proposed short-term solution is to keep logically eliminating boundary surfaces on the daughters when we can, but we will also support coincident surfaces (rather, the same surface appearing in multiple universe, potentially with transformations and negations applied).

Long term solution for the Geant4 representation might be to have only a stack of universe IDs, a local tracker, and a detailed mapping of parent/child universes: because for this geometry specification we do not need to worry about parents truncating the children via overlaps. This is something I'd thought about for being more efficient but the tricky case of not being able to eliminate daughter surfaces may make it a requirement.

Parent universe where the daughter is a union of two spheres:

Screenshot 2024-06-04 at 16 33 16

Daughter universe after the CSG tree has been simplified to remove the "boundary" (see #1256):

Screenshot 2024-06-04 at 16 33 42