179 return (
m_buffer[tr]->getVertex(v));
200 const char *func_name =
"EGS_ParticleTrackContainer::readDataFile()";
201 ifstream *data =
new ifstream(filename, ios::binary);
202 if (!data || data->fail() || !data->good()) {
203 egsWarning(
"%s: Unable to open track space file '%s'! No tracks loaded\n",
204 func_name, filename);
210 int totalVertices = 0;
221 data->read((
char *)&nvertices,
sizeof(
int));
222 totalVertices += nvertices;
225 for (
int j = 0; j < nvertices; j++) {
232 egsInformation(
"%s: Total Vertices : %d\n", func_name, totalVertices);
264 egsWarning(
" *** There are particles still being tracked. This"
265 " should never happen if this is the end of the simulation!");
Vertex * getVertex(int v)
Gets vertex number v .
void grow()
Resize the array containing the vertices.
ofstream * m_trspFile
the file to which data is output
int m_totalTracks
total number of tracks registered
int readDataFile(const char *filename)
Load particle data from the file called filename .
A class representing a single track of a particle.
void updateHeader()
Update the output file's header.
void flushBuffer()
Write all track data to the file.
EGS_ParticleTrack class header file.
ParticleInfo * m_pInfo
type of the tracked particle
int writeTrack(ofstream *trsp)
Write this track to a "track space" file.
void addVertex(EGS_ParticleTrack::Vertex *x)
Add a vertex to the track currently being scorred.
int m_nEvents
number of events scored
void setParticleInfo(ParticleInfo *p)
Define the type of the particle being tracked.
int m_size
current size of the vertex array
EGS_ParticleTrack::Vertex * getTrackVertex(int tr, int v)
Get the v vertex from the tr track.
Structure describing the particle being tracked.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
Structure to store the data for each interaction along the track.
EGS_ParticleTrack ** m_buffer
the tracks array
void addVertex(Vertex *x)
Add additional point of interaction (Vertex) to the track.
int m_nTracks
number of tracks currently in memory
void reportResults(bool with_header=true)
Report results from the track scoring process so far.
void clearTrack()
Deallocate particle information and vertex data.
int m_bufferSize
max number of tracks in memory
void startNewTrack()
Start scoring a new track.
string m_trspFilename
filename of output file
Vertex ** m_track
the array with the vertices
int m_nVertices
current number of vertices in track
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.