Refactor AdePT into 2 libraries 1: remove AdePTG4Integration from AdePTTransport#517
Merged
SeverinDiederichs merged 1 commit intoapt-sim:masterfrom Mar 18, 2026
Conversation
|
Can one of the admins verify this patch? |
2 tasks
agheata
approved these changes
Mar 18, 2026
Contributor
agheata
left a comment
There was a problem hiding this comment.
Thanks for the design cleanup!
SeverinDiederichs
added a commit
that referenced
this pull request
Mar 18, 2026
…sport (#518) This PR belongs the the refactor of AdePT described in #516. It is based on #517 and should not be reviewed before that one is merged. In this PR, the B field is passed directly to the AdePTTransport, such that it does not rely on the AdePTGeant4Integration to get the B field value. In the end, the goal is to not pass the AdePTGeant4Integration to AdePTTransport, to be able to separate the libraries. It was verified that this PR - [ ] Changes physics results - [x] Does not change physics results
This file contains hidden or 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
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.
This PR belongs the the refactor of AdePT described in #516.
Currently, there is one
AdePTTrackingManagerper G4Worker. Each AdePTTrackingManager points to the global instance of theAdePTTransport. TheAdePTTransportowns an array over the G4Worker number of theAdePTGeant4Integration. Then, when the AdePTTrackingManager needs to access the AdePTGeant4Integration, it has to pass the correct threadId to the AdePTTransport to receive its corresponding AdePTGeant4Integration object.This diagram illustrates the previous ownership and access pattern (blue resides in the AdePT g4integration library, orange in the AdePT core library):

This PR cleans this to (blue resides in the AdePT g4integration library, orange in the AdePT core library):
Each AdePTTrackingManager owns a pointer to the global
AdePTTransportand the its ownAdePTGeant4Integrationdirectly. For calls inside theAdePTTransportthat currently still rely on theAdePTG4Integration(which in the future, it shouldn't anymore), the integration object is passed to the transport.So the new ownership / access pattern looks like this:

This change is important to separate the AdePTTransport (which will reside in the AdePT core library) from the AdePTGeant4Integration (which will reside in the AdePT g4integration library).
It was verified that this PR