Skip to content

[geom] Keep reflections through a GDML round trip - #25

Merged
sawenzel merged 1 commit into
alisw:alice/v6-36-10from
sawenzel:swenzel/gdml-reflection-fix-alice3
Sep 2, 2026
Merged

sawenzel merged 1 commit into
alisw:alice/v6-36-10from
sawenzel:swenzel/gdml-reflection-fix-alice3

Conversation

@sawenzel

@sawenzel sawenzel commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

This fixes a bug in the GDML writer and reader that could lose reflections when a geometry was exported to GDML and read back.

The writer now preserves reflections combined with rotations by factoring the reflection into a z-mirror and writing the remaining proper rotation. Diagonal reflection matrices keep their existing representation.

The reader now also handles the scale of placements inside assemblies, so reflections are preserved there as well.

A new test exports and re-imports a reflected box with an off-centre daughter, both in the world and in an assembly. It checks the global position, frame handedness and TGeoHMatrix::IsReflection() before and after the round trip.

The ALICE geometry is now correctly exported to GDML, with reflections preserved through the round trip.

This fixes root-project#23237, a bug in the
GDML writer and reader that could lose reflections when a geometry was
exported to GDML and read back.

The writer now preserves reflections combined with rotations by factoring the
reflection into a z-mirror and writing the remaining proper rotation. Diagonal
reflection matrices keep their existing representation.

The reader now also handles the scale of placements inside assemblies, so
reflections are preserved there as well.

A new test exports and re-imports a reflected box with an off-centre daughter,
both in the world and in an assembly. It checks the global position, frame
handedness and TGeoHMatrix::IsReflection() before and after the round trip.

The ALICE geometry is now correctly exported to GDML, with reflections
preserved through the round trip.
@sawenzel
sawenzel merged commit 3510acb into alisw:alice/v6-36-10 Sep 2, 2026
3 of 21 checks passed
@sawenzel
sawenzel deleted the swenzel/gdml-reflection-fix-alice3 branch September 2, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant