EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A class representing a single track of a particle. More...
#include <egs_particle_track.h>
Classes | |
struct | ParticleInfo |
Structure describing the particle being tracked. More... | |
struct | Vertex |
Structure to store the data for each interaction along the track. More... | |
Public Member Functions | |
EGS_ParticleTrack () | |
Initialize the track and allocate minimum memory. | |
~EGS_ParticleTrack () | |
The destructor. Deallocate all memory. | |
void | clearTrack () |
Deallocate particle information and vertex data. More... | |
int | writeTrack (ofstream *trsp) |
Write this track to a "track space" file. More... | |
void | addVertex (Vertex *x) |
Add additional point of interaction (Vertex) to the track. | |
Vertex * | getVertex (int v) |
Gets vertex number v . More... | |
int | getNumVertices () |
Get number of vertices currently in the track. | |
void | setParticleInfo (ParticleInfo *p) |
Define the type of the particle being tracked. | |
ParticleInfo * | getParticleInfo () |
Get the type of the particle being tracked. | |
Protected Member Functions | |
void | grow () |
Resize the array containing the vertices. | |
Protected Attributes | |
ParticleInfo * | m_pInfo |
type of the tracked particle | |
int | m_size |
current size of the vertex array | |
int | m_nVertices |
current number of vertices in track | |
Vertex ** | m_track |
the array with the vertices | |
A class representing a single track of a particle.
This class contains all the necessary information about a single track - charge and energy of the particle, coordinates of interaction points along the track (vertices), etc. (might add additional data in future). This class is not meant to be used directly in the application as it is used by EGS_ParticleTrackContainer.
Definition at line 57 of file egs_particle_track.h.
void EGS_ParticleTrack::clearTrack | ( | ) |
Deallocate particle information and vertex data.
Practically, this method is quite the same as the Destructor, with the difference that it allows further track scoring if necessary.
Definition at line 58 of file egs_particle_track.cpp.
References m_nVertices, m_pInfo, and m_track.
Referenced by EGS_ParticleTrackContainer::flushBuffer().
int EGS_ParticleTrack::writeTrack | ( | ofstream * | trsp | ) |
Write this track to a "track space" file.
Writes the particle information block m_pInfo, the number of vertices in this track and finally all vertex data.
Definition at line 73 of file egs_particle_track.cpp.
References m_nVertices, m_pInfo, and m_track.
EGS_ParticleTrack::Vertex * EGS_ParticleTrack::getVertex | ( | int | v | ) |
Gets vertex number v .
If v is less than 0 or greater than m_nVertices - 1 the return value is NULL
.
Definition at line 86 of file egs_particle_track.cpp.
References m_nVertices, and m_track.