You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The primaries output tree is removed; simplified primary particles info is now saved in the event tree for each vertex, while full information can be found in the new particles tree.
Full particle truth is moved into a general particles tree. By default, this tree stores the following particles:
-- all primaries;
-- all particles leaving hits in any SD;
-- all ancestors of any particle leaving hits in any SD;.
This tree is the last to be filled as particles (and their ancestors) are registered to be saved while looping the hits for the other output trees. It should provide all that's needed to recover the particle hierarchy of interest.
The particles tree can be forced to save all particles in the event (regardless of whether they left hits or not) by setting the /out/saveAllParticles to true. Note that in this case the output file can grow quickly and become quite big.
The particles tree can also be expanded to store the full particle trajectories by setting the /out/saveTrajectory parameter to true (needed by FPFDisplay).
A custom FPFTrajectory class now replaces the standard G4Trajectory. These trajectories are used to fill the new particles tree. This new class optionally disables storing individual trajectory points. As a result, if /out/saveTrajectory is false, G4 only stores light-weight tracks, which is better for memory usage.
StackingAction now fills two associations: one maps track_id into its parent_id and the second maps track_id to its ancestor_id (ie, the track id of the primary particle from which it came from). These two associations are used by the AnalysisManager for its particle-saving logic.
The computation of the ACTS-style barcode/particle_id is now perfomed by an helper function: to speed things out, values are cached in a map so they can be retrieve by all functions without re-computing. The above associations are used in this function to determine the number of generations of a particle from its ancestor.
The ACTS particles tree is removed in favor of the generic one which now contains the same (and more!) information.
Let me know what you think/ if you have suggestions!
One possibility that comes to mind is the saving only particles that leave hits + all their ancestors; so basically:
all primaries;
all particles leaving hits in any SD;
all ancestors of any particle leaving hits in any SD;
Basically, we would first store all track IDs of interest as we loop over the hits in AnalysisManager.
Then, while looping through the trajectories, just select those of interest or their ancestors.
This last task can probably be accomplished more efficiently by preparing in advance some kind of "daughter-parent" association.
Thanks @mvicenzi, this sounds like a nice idea! I'll review this as soon as I get some time
Thanks! Don't worry -- take your time for the review, I will also need to push new updates.
I thought it over, and I think I'm going to implement the changes I mentioned in my comment.
I have pushed the latest changes -- I think this is a good compromise, and the file sizes are now more reasonable.
FLArE-specific output needs to be optimized better, but that will be handled in #19 ..
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
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 closes #18
It includes the following changes:
The
primariesoutput tree is removed; simplified primary particles info is now saved in theeventtree for each vertex, while full information can be found in the newparticlestree.Full particle truth is moved into a general
particlestree. By default, this tree stores the following particles:-- all primaries;
-- all particles leaving hits in any SD;
-- all ancestors of any particle leaving hits in any SD;.
This tree is the last to be filled as particles (and their ancestors) are registered to be saved while looping the hits for the other output trees. It should provide all that's needed to recover the particle hierarchy of interest.
The
particlestree can be forced to save all particles in the event (regardless of whether they left hits or not) by setting the/out/saveAllParticlestotrue. Note that in this case the output file can grow quickly and become quite big.The
particlestree can also be expanded to store the full particle trajectories by setting the/out/saveTrajectoryparameter totrue(needed by FPFDisplay).A custom
FPFTrajectoryclass now replaces the standardG4Trajectory. These trajectories are used to fill the newparticlestree. This new class optionally disables storing individual trajectory points. As a result, if/out/saveTrajectoryisfalse, G4 only stores light-weight tracks, which is better for memory usage.StackingActionnow fills two associations: one mapstrack_idinto itsparent_idand the second mapstrack_idto itsancestor_id(ie, the track id of the primary particle from which it came from). These two associations are used by theAnalysisManagerfor its particle-saving logic.The computation of the ACTS-style barcode/
particle_idis now perfomed by an helper function: to speed things out, values are cached in a map so they can be retrieve by all functions without re-computing. The above associations are used in this function to determine the number of generations of a particle from its ancestor.The ACTS
particlestree is removed in favor of the generic one which now contains the same (and more!) information.Let me know what you think/ if you have suggestions!
EDIT: update description after latest changes.