forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Geant4 transformation conversion (acts-project#3051)
This PR addresses the issue raised in acts-project#3042 and acts-project#3038. The underlying problem in both cases stemmed from the fact that the `Geant4DetectorSurfaceFactory` did not respect the Geant4 transformation relations between the mother and the daughter volumes. For example, in the picture below the `Blue` volume is the daughter of the `Red` volume and the `Red` volume is the daughter of the `Magenta` volume. The `Green` volume is the daughter of the `World` and its transformation is the composition of the `Magenta`, `Red`, and `Blue` volume transformations implemented as it is currently done in the `Geant4DetectorSurfaceFactory`. If the composition is realized correctly, the `Green` volume should completely overlap the `Blue` one, which is not the case here. ![bad_conversion](https://github.com/acts-project/acts/assets/113530373/10f661c7-6592-4a38-8915-fad610db74b5) The changes introduced here: a) Fix the transform composition in the `Geant4DetectorSurfaceFactory`; b) Fix the transformation conversion in the `Geant4Converters` so that the Geant4 rotation/translation order (first the daughter is translated with respect to the mother-volume frame and then rotated) is respected; c) Remove the unnecessary transposition of the rotation matrix in the `Geant4Converters` that resulted in the wrong normal direction of the converted surface. d) Add a Unit Test that will insure the correct conversion. With the new composition applied this is how the picture from above changes (i.e. we see the complete overlap): ![good_conversion](https://github.com/acts-project/acts/assets/113530373/91baddec-23cf-47fb-afde-dba193635ce4) And this is how it looks inside Acts: ![good_conversion_acts](https://github.com/acts-project/acts/assets/113530373/c5d095ba-42d3-441f-bf81-f721b6df504c) Using the opportunity, I'd like to raise a question of the convention for the rotation/translation order inside the Acts codebase, as it looks like right now there are no strict guidelines, which may be pretty confusing.
- Loading branch information
Showing
4 changed files
with
108 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters