4#include "SimCore/G4User/TrackMap.h"
7#include "SimCore/G4User/UserTrackInformation.h"
10#include "G4PrimaryParticle.hh"
11#include "G4VUserPrimaryParticleInformation.hh"
15namespace simcore::g4user {
24 track_info->initialize(track);
28 track->GetLogicalVolumeAtVertex()->GetRegion()->GetUserInformation());
31 int cur_gen_status = -1;
32 if (track->GetDynamicParticle()->GetPrimaryParticle()) {
34 track->GetDynamicParticle()
35 ->GetPrimaryParticle()
36 ->GetUserInformation());
38 cur_gen_status = primary_info->getHepEvtStatus();
54 if (cur_gen_status == 1 or !region_info or
55 region_info->getStoreSecondaries()) {
56 track_info->setSaveFlag(
true);
65 tracking_action->preUserTrackingAction(track);
71 tracking_action->postUserTrackingAction(track);
81 if (track_info->getSaveFlag() and
82 track->GetTrackStatus() == G4TrackStatus::fStopAndKill) {
Class which implements the user tracking action.
Class that provides extra information for Geant4 primary particles.
bool contains(const G4Track *track) const
Check if the passed track has already been inserted into the track map.
void save(const G4Track *track)
Add a track to be stored into output map.
void insert(const G4Track *track)
Add a record in the map for the input track.
Defines extra information attached to a Geant4 primary particle.
void PreUserTrackingAction(const G4Track *aTrack) override
Implementation of pre-tracking action.
void PostUserTrackingAction(const G4Track *aTrack) override
Implementation of post-tracking action.
std::vector< std::shared_ptr< UserAction > > tracking_actions_
custom user actions to be called before and after processing a track
TrackMap track_map_
Stores parentage information for all tracks in the event.