ATLAS Offline Software
|
#include <BeamHaloParticleBuffer.h>
Public Member Functions | |
BeamHaloParticleBuffer (const std::string &fileName) | |
~BeamHaloParticleBuffer ()=default | |
int | openForWriting () |
int | openForReading () |
int | close () |
int | writeParticle (BeamHaloParticle *particle) |
A member function to append a particle to the binary file. More... | |
BeamHaloParticle * | readRandomParticle (CLHEP::HepRandomEngine *engine) |
A member function to read a random particle from the binary file. More... | |
Private Member Functions | |
BeamHaloParticle * | readParticle (void) |
A member function to read a particle from the current position in the binary file. More... | |
Private Attributes | |
std::string | m_fileName |
File name. More... | |
std::ofstream | m_ofstream |
A data member to store the output file stream. More... | |
std::ifstream | m_ifstream |
A data member to store the input file stream. More... | |
int | m_recordSize |
The size of 1 binary data record. More... | |
unsigned int | m_particlesPerInterval |
The number of particles per interval. More... | |
long | m_numberOfParticles |
The number of particles present within the output or input file. More... | |
std::vector< BinnedInterval > | m_binnedIntervals |
A map of the upper bin limits and an vector of bin limits within the given interval. More... | |
double | m_upperBinEdge |
The upper edge of the bin. More... | |
std::vector< double > | m_intervalUpperBinEdges |
A vector of bin limits for a given interval. More... | |
double | m_intervalUpperBinEdge |
The upper bin edge of a bin within a given interval. More... | |
bool | m_writeFlag |
A flag to select read or write. More... | |
Definition at line 45 of file BeamHaloParticleBuffer.h.
BeamHaloParticleBuffer::BeamHaloParticleBuffer | ( | const std::string & | fileName | ) |
Definition at line 32 of file BeamHaloParticleBuffer.cxx.
|
default |
int BeamHaloParticleBuffer::close | ( | ) |
Definition at line 84 of file BeamHaloParticleBuffer.cxx.
int BeamHaloParticleBuffer::openForReading | ( | ) |
Definition at line 65 of file BeamHaloParticleBuffer.cxx.
int BeamHaloParticleBuffer::openForWriting | ( | ) |
Definition at line 48 of file BeamHaloParticleBuffer.cxx.
|
private |
A member function to read a particle from the current position in the binary file.
Definition at line 264 of file BeamHaloParticleBuffer.cxx.
BeamHaloParticle * BeamHaloParticleBuffer::readRandomParticle | ( | CLHEP::HepRandomEngine * | engine | ) |
A member function to read a random particle from the binary file.
Definition at line 171 of file BeamHaloParticleBuffer.cxx.
int BeamHaloParticleBuffer::writeParticle | ( | BeamHaloParticle * | particle | ) |
A member function to append a particle to the binary file.
Definition at line 109 of file BeamHaloParticleBuffer.cxx.
|
private |
A map of the upper bin limits and an vector of bin limits within the given interval.
The file is split into intervals to avoid floating point precision problems. Each interval is considered as a separate histogram. The lower limit for the interval is taken from the last bin or 0 for the first bin entry.
Definition at line 88 of file BeamHaloParticleBuffer.h.
|
private |
File name.
Definition at line 66 of file BeamHaloParticleBuffer.h.
|
private |
A data member to store the input file stream.
Definition at line 72 of file BeamHaloParticleBuffer.h.
|
private |
The upper bin edge of a bin within a given interval.
Definition at line 97 of file BeamHaloParticleBuffer.h.
|
private |
A vector of bin limits for a given interval.
Definition at line 94 of file BeamHaloParticleBuffer.h.
|
private |
The number of particles present within the output or input file.
Definition at line 81 of file BeamHaloParticleBuffer.h.
|
private |
A data member to store the output file stream.
Definition at line 69 of file BeamHaloParticleBuffer.h.
|
private |
The number of particles per interval.
Definition at line 78 of file BeamHaloParticleBuffer.h.
|
private |
The size of 1 binary data record.
Definition at line 75 of file BeamHaloParticleBuffer.h.
|
private |
The upper edge of the bin.
Definition at line 91 of file BeamHaloParticleBuffer.h.
|
private |
A flag to select read or write.
Definition at line 100 of file BeamHaloParticleBuffer.h.