-
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
Changes related to restG4 MT #59
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
…pdated validations
…/rest-for-physics/geant4lib into lobis-prepare-for-multithreading
…' into lobis-geant4-event-viewer
juanangp
reviewed
Sep 12, 2022
juanangp
reviewed
Sep 12, 2022
…' into lobis-geant4-event-viewer
Updates to Geant4 event viewer
juanangp
approved these changes
Sep 14, 2022
Remember to change the pipeline |
This was referenced Sep 28, 2022
Closed
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.
Data Containers
Data containers (Event, Track, Steps) have been updated: some member names have been changed for consistency and others deemed redundant have been removed (such as
TRestGeant4Tracks::fNTracks
, same asfTracks.size()
etc.). Many unused or redundant methods have also been removed for simplicity. Class version have been updated.Data containers now have references to other containers as members. This references are not stored on the root file (
//!
) and are initialized dynamically byTRestRun::GetEntry
. The allow things like accessing the event from a track, getting the pointer to the parent track directly from the child track etc.Data containers initialization is handled by
restG4
with a constructor taking a const reference to the corresponding geant4 construct as argument.Geant4lib
purpose is to perform analysis on simulation events, we don't need to create the data usingGeant4lib
.The way subevent primary information is stored has been rethinked:
Now you can access the subevent primary information (position, energy, particle...) and the event primary information. For example for a nuclear decay subevent you can get the position of the primary decay particle via
GetSubEventPrimaryEventOrigin
and access the original primary position viaGetEventPrimaryEventOrigin
.Also the member
fSubEventPrimaryParticleName
automatically serves to store the decay particle name (if it exists) so we no longer need to use the event tag to store this information.Metadata
TRestGeant4Metadata
has been simplified and now longer directly contains primary generator information. This is now contained in the new classTRestGeant4PrimaryGeneratorInfo
. The RML declaration remains the same. The only change is regarding the getters for generator info: previously you could do things likeTRestGeant4Metadata::GetGeneratorPosition()
, now you need to do something likeTRestGeant4Metadata::GetGeant4PrimaryGeneratorInfo().GetGeneratorPosition()
.TRestGeant4PrimaryGeneratorInfo
contains the same logic previously present onTRestGeant4Metadata
and some other functions have been implemented. Better validation using enums to make sure a correct option has been selected, and to store a consistent string name for the options.energyDist
andangularDist
rml keywords have been replaced byenergy
andangular
. The previous names also work so both are supported and this should not break anything. All examples have been updated.A new type of distribution has been introduced called
Formula
which can be used on angular and energy distributions. Currently it only supports predefined formulas but it can support used defined formulas with little change.For example:
<angular type="TH1D" file="CosmicAngles.root" spctName="Theta2" direction="(0,0,-1)"/>
now can also be<angular type="formula" name="Cos2" direction="(0,0,-1)"/>
with does not require referencing a file. It should also have more precission since its sampling the mathematical formula directly. TheTF1
is stored in the particle source and can be retrieved and plotted directly.In the case of energy distributions they are defined in a predefined range (one where the formula is valid) and the user can choose a different range with the usual
range=
xml syntax. A validation logic has been introduced to make sure that the final range is always the intersection with the formula validity range, so we cannot use a energy distribution ranging from 1 MeV to 100 MeV to sample from 100 keV to 20 MeV for example. The final range would be from 1MeV to 20MeV automatically without giving error (the range can be consulted on the metadata as usual).