-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: geant4 transform conversion #3038
Merged
kodiakhq
merged 4 commits into
acts-project:main
from
asalzburger:fix-geant4-transform3-conversion
Mar 18, 2024
Merged
fix: geant4 transform conversion #3038
kodiakhq
merged 4 commits into
acts-project:main
from
asalzburger:fix-geant4-transform3-conversion
Mar 18, 2024
Conversation
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3038 +/- ##
=======================================
Coverage 48.83% 48.83%
=======================================
Files 491 491
Lines 28889 28889
Branches 13711 13711
=======================================
Hits 14107 14107
Misses 4956 4956
Partials 9826 9826 ☔ View full report in Codecov by Sentry. |
📊: Physics performance monitoring for a9a776cphysmon summary
|
Shouldn't we merge the #3025 first, as it changes the interface of the |
andiwand
approved these changes
Mar 18, 2024
dimitra97
pushed a commit
to dimitra97/acts
that referenced
this pull request
Mar 19, 2024
When translating the `NA60+` gdml file, we notices a sign flip between Geant4 physical volume and Acts translated volume in global space. This PR introuces a unit test that reproduces the NA60+ setup in a very limited number, and fixes the transform translation in the `Geant4Converter` to Acts. @ssdetlab - I attached this test to your Gdml based Surface Provider test and made sure all your tests run through appropriately, however, might be good to have another look.
kodiakhq bot
pushed a commit
that referenced
this pull request
Apr 2, 2024
This PR addresses the issue raised in #3042 and #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.
Ragansu
pushed a commit
to Ragansu/acts
that referenced
this pull request
Apr 19, 2024
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.
EleniXoch
pushed a commit
to EleniXoch/acts
that referenced
this pull request
May 6, 2024
When translating the `NA60+` gdml file, we notices a sign flip between Geant4 physical volume and Acts translated volume in global space. This PR introuces a unit test that reproduces the NA60+ setup in a very limited number, and fixes the transform translation in the `Geant4Converter` to Acts. @ssdetlab - I attached this test to your Gdml based Surface Provider test and made sure all your tests run through appropriately, however, might be good to have another look.
EleniXoch
pushed a commit
to EleniXoch/acts
that referenced
this pull request
May 6, 2024
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.
asalzburger
added a commit
to asalzburger/acts
that referenced
this pull request
May 21, 2024
When translating the `NA60+` gdml file, we notices a sign flip between Geant4 physical volume and Acts translated volume in global space. This PR introuces a unit test that reproduces the NA60+ setup in a very limited number, and fixes the transform translation in the `Geant4Converter` to Acts. @ssdetlab - I attached this test to your Gdml based Surface Provider test and made sure all your tests run through appropriately, however, might be good to have another look.
asalzburger
pushed a commit
to asalzburger/acts
that referenced
this pull request
May 21, 2024
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When translating the
NA60+
gdml file, we notices a sign flip between Geant4 physical volume and Acts translated volume in global space.This PR introuces a unit test that reproduces the NA60+ setup in a very limited number, and fixes the transform translation in the
Geant4Converter
to Acts.@ssdetlab - I attached this test to your Gdml based Surface Provider test and made sure all your tests run through appropriately, however, might be good to have another look.