Skip to content

Replace the TPC half-space cuts by bounded boxes - #15716

Open
sawenzel wants to merge 2 commits into
AliceO2Group:devfrom
sawenzel:sawenzel/o2-4534-halfspace-to-box
Open

Replace the TPC half-space cuts by bounded boxes#15716
sawenzel wants to merge 2 commits into
AliceO2Group:devfrom
sawenzel:sawenzel/o2-4534-halfspace-to-box

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

Replace unbounded TGeoHalfSpace cuts with equivalent bounded boxes so the geometry can be written to GDML and converted to Geant4.

This is one step in achieving native Geant4 geometry navigation as an alternative to TGeo. Useful for future oriented
developments such as GPU/AdePt simulation.

Fixes https://its.cern.ch/jira/browse/O2-4534

This replaces the fifteen TGeoHalfSpace cuts in the TPC support geometry by
equivalent bounded boxes and adds a unit test.

- TGeoHalfSpace is unbounded, so ROOT's GDML writer drops every volume that
  uses one and VGM cannot convert it to native Geant4 geometry.
- All fifteen occurrences in AliceO2 are TPC support structures, and every one
  of them is subtracted from a solid smaller than 10 cm in each direction.
- Each is now a cube of 100 cm half-size placed with one face on the cut plane,
  built by the new TGeoGeometryUtils::makeHalfSpaceBox.
- A subtraction takes its bounding box from the left-hand solid only, so the
  composite shapes are unchanged in extent.
- The cut term is written in parentheses. A trailing "shape:matrix" is unsafe:
  TGeoManager::Parse reads the last top-level ":" of an expression that already
  contains a top-level ")" as a transformation of the whole expression and then
  drops it, which would leave an unplaced cube swallowing the parent solid.
- The new test compares both forms point by point and along random rays, for
  the fifteen real planes, 200 arbitrary ones, and one compound expression of
  the shape that makes the parentheses necessary.

https://its.cern.ch/jira/browse/O2-4534

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants