-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve physics process store #54
Merged
Merged
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
juanangp
reviewed
Jun 15, 2022
Co-authored-by: Juan Antonio García <80903717+juanangp@users.noreply.github.com>
…rest-for-physics/geant4lib into lobis-remove-process-hardcoding
…e` to access Geant4 metadata from anywhere, if only one exists
juanangp
approved these changes
Jul 5, 2022
@juanangp could you also please review the related PR? rest-for-physics/restG4#55 ty |
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.
Related PR: rest-for-physics/restG4#55
Currently Geant4 process names - id relation are being stored in a hardcoded map on
TRestGeant4Track
.This PR provides a container class,
TRestGeant4PhysicsInfo
that stores this information (which can be different across Geant4 versions) without adding noticable overhead.Additionally this class can be used to print which particles or processes took place in the simulation for a quick overview:
Since Geant4 does not provide a way to generate a processID (only provides process name) I created one which should be unique (
process->GetProcessType() * 1000 + process->GetProcessSubType()
). This breaks compatilibty with old versions of REST where processes where using the manual assignment found onTRestGeant4Track
.This PR also deprecates some methods related to processes, which in my opinion were too specific, redundant, or were not garanteed to work in the current version. Methods such as
isPhotoElectric
have been replaced by the more genericContainsProcess
Now also print methods for event or track have access to the corresponding metadata class to access the volume / process names, so now print statements are more user readable, showing volume names instead of IDs and showing the Geant4 process names instead of the hardcoded ones.