|
Celeritas 0.7+972e6cd
|
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 | |
| GeantTrackReconstruction & | operator= (GeantTrackReconstruction const &)=delete |
| GeantTrackReconstruction (GeantTrackReconstruction &&)=default | |
| GeantTrackReconstruction & | operator= (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. | |
| G4Track & | view (ParticleId, PrimaryId) const |
| Restore the G4Track from the reconstruction data. | |
| G4Track & | view (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. | |
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.
Register mapping from Celeritas PrimaryID to Geant4 TrackID.
This will take ownership of the G4VUserTrackInformation and unset it in the primary track.
| 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.
| void celeritas::GeantTrackReconstruction::init_event | ( | ) |
At the start of an event, reset the primary ID counter.
clear command.
|
static |
Allocate and initialize a valid Geant4 step object.
The allocation is done like G4SteppingManager constructor but we reset values to invalid ones.
| 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.
|
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.