Celeritas 0.7+972e6cd
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
celeritas::GeantTrackReconstruction Class Reference

Manage track information for reconstruction. More...

#include <GeantTrackReconstruction.hh>

Public Types

Type aliases
using VecParticle = std::vector< G4ParticleDefinition const * >
 
using SPStep = std::shared_ptr< G4Step >
 
using EventIdGetter = int(*)()
 

Public Member Functions

 GeantTrackReconstruction (VecParticle const &, SPStep)
 Construct with particle definitions for track reconstruction.
 
 ~GeantTrackReconstruction ()
 Unset the user information for all tracks.
 
 GeantTrackReconstruction (GeantTrackReconstruction const &)=delete
 
GeantTrackReconstructionoperator= (GeantTrackReconstruction const &)=delete
 
 GeantTrackReconstruction (GeantTrackReconstruction &&)=default
 
GeantTrackReconstructionoperator= (GeantTrackReconstruction &&)=default
 
void clear ()
 Clear G4Track reconstruction data.
 
PrimaryId acquire (G4Track &)
 Register mapping from Celeritas PrimaryID to Geant4 TrackID.
 
void init_event ()
 At the start of an event, reset the primary ID counter.
 
G4Trackview (ParticleId, PrimaryId) const
 Restore the G4Track from the reconstruction data.
 
G4Trackview (ParticleId) const
 View a track with the given particle ID.
 

Static Public Member Functions

static SPStep make_g4step ()
 Allocate and initialize a valid Geant4 step object.
 

Static Public Attributes

static EventIdGetter get_current_event_id {nullptr}
 Event ID function pointer for unit testing when CELERITAS_DEBUG.
 

Detailed Description

Manage track information for reconstruction.

This class handles the bookkeeping of Geant4 track information needed to reconstruct tracks during hit processing. It maintains mappings between Celeritas PrimaryID and Geant4 track data.

Member Function Documentation

◆ acquire()

PrimaryId celeritas::GeantTrackReconstruction::acquire ( G4Track primary)

Register mapping from Celeritas PrimaryID to Geant4 TrackID.

This will take ownership of the G4VUserTrackInformation and unset it in the primary track.

◆ clear()

void celeritas::GeantTrackReconstruction::clear ( )

Clear G4Track reconstruction data.

This should be done when all Celeritas tracks have been completed, since afterward it will be impossible to reconstruct them.

The primary ID offset is saved to ensure consistency when flushing before an event is complete.

◆ init_event()

void celeritas::GeantTrackReconstruction::init_event ( )

At the start of an event, reset the primary ID counter.

Precondition
The track data must have been previously flushed with the clear command.

◆ make_g4step()

auto celeritas::GeantTrackReconstruction::make_g4step ( )
static

Allocate and initialize a valid Geant4 step object.

The allocation is done like G4SteppingManager constructor but we reset values to invalid ones.

◆ view()

G4Track & celeritas::GeantTrackReconstruction::view ( ParticleId  particle_id,
PrimaryId  primary_id 
) const

Restore the G4Track from the reconstruction data.

Returns the track for the given particle ID with restored primary track information.

Member Data Documentation

◆ get_current_event_id

GeantTrackReconstruction::EventIdGetter celeritas::GeantTrackReconstruction::get_current_event_id {nullptr}
static

Event ID function pointer for unit testing when CELERITAS_DEBUG.

When constructing a class instance, if the function pointer is null, it will be set to a function that gets the Geant4 event manager's active event.


The documentation for this class was generated from the following files: