ATLAS Offline Software
Loading...
Searching...
No Matches
BeamHaloParticleBuffer Class Reference

#include <BeamHaloParticleBuffer.h>

Collaboration diagram for BeamHaloParticleBuffer:

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.
BeamHaloParticlereadRandomParticle (CLHEP::HepRandomEngine *engine)
 A member function to read a random particle from the binary file.

Private Member Functions

BeamHaloParticlereadParticle (void)
 A member function to read a particle from the current position in the binary file.

Private Attributes

std::string m_fileName
 File name.
std::ofstream m_ofstream
 A data member to store the output file stream.
std::ifstream m_ifstream
 A data member to store the input file stream.
int m_recordSize
 The size of 1 binary data record.
unsigned int m_particlesPerInterval
 The number of particles per interval.
long m_numberOfParticles
 The number of particles present within the output or input file.
std::vector< BinnedIntervalm_binnedIntervals
 A map of the upper bin limits and an vector of bin limits within the given interval.
double m_upperBinEdge
 The upper edge of the bin.
std::vector< double > m_intervalUpperBinEdges
 A vector of bin limits for a given interval.
double m_intervalUpperBinEdge
 The upper bin edge of a bin within a given interval.
bool m_writeFlag
 A flag to select read or write.

Detailed Description

Definition at line 45 of file BeamHaloParticleBuffer.h.

Constructor & Destructor Documentation

◆ BeamHaloParticleBuffer()

BeamHaloParticleBuffer::BeamHaloParticleBuffer ( const std::string & fileName)

Definition at line 40 of file BeamHaloParticleBuffer.cxx.

◆ ~BeamHaloParticleBuffer()

BeamHaloParticleBuffer::~BeamHaloParticleBuffer ( )
default

Member Function Documentation

◆ close()

int BeamHaloParticleBuffer::close ( )

Definition at line 92 of file BeamHaloParticleBuffer.cxx.

◆ openForReading()

int BeamHaloParticleBuffer::openForReading ( )

Definition at line 73 of file BeamHaloParticleBuffer.cxx.

◆ openForWriting()

int BeamHaloParticleBuffer::openForWriting ( )

Definition at line 56 of file BeamHaloParticleBuffer.cxx.

◆ readParticle()

BeamHaloParticle * BeamHaloParticleBuffer::readParticle ( void )
private

A member function to read a particle from the current position in the binary file.

Definition at line 272 of file BeamHaloParticleBuffer.cxx.

◆ readRandomParticle()

BeamHaloParticle * BeamHaloParticleBuffer::readRandomParticle ( CLHEP::HepRandomEngine * engine)

A member function to read a random particle from the binary file.

Definition at line 179 of file BeamHaloParticleBuffer.cxx.

◆ writeParticle()

int BeamHaloParticleBuffer::writeParticle ( BeamHaloParticle * particle)

A member function to append a particle to the binary file.

Definition at line 117 of file BeamHaloParticleBuffer.cxx.

Member Data Documentation

◆ m_binnedIntervals

std::vector<BinnedInterval> BeamHaloParticleBuffer::m_binnedIntervals
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.

◆ m_fileName

std::string BeamHaloParticleBuffer::m_fileName
private

File name.

Definition at line 66 of file BeamHaloParticleBuffer.h.

◆ m_ifstream

std::ifstream BeamHaloParticleBuffer::m_ifstream
private

A data member to store the input file stream.

Definition at line 72 of file BeamHaloParticleBuffer.h.

◆ m_intervalUpperBinEdge

double BeamHaloParticleBuffer::m_intervalUpperBinEdge
private

The upper bin edge of a bin within a given interval.

Definition at line 97 of file BeamHaloParticleBuffer.h.

◆ m_intervalUpperBinEdges

std::vector<double> BeamHaloParticleBuffer::m_intervalUpperBinEdges
private

A vector of bin limits for a given interval.

Definition at line 94 of file BeamHaloParticleBuffer.h.

◆ m_numberOfParticles

long BeamHaloParticleBuffer::m_numberOfParticles
private

The number of particles present within the output or input file.

Definition at line 81 of file BeamHaloParticleBuffer.h.

◆ m_ofstream

std::ofstream BeamHaloParticleBuffer::m_ofstream
private

A data member to store the output file stream.

Definition at line 69 of file BeamHaloParticleBuffer.h.

◆ m_particlesPerInterval

unsigned int BeamHaloParticleBuffer::m_particlesPerInterval
private

The number of particles per interval.

Definition at line 78 of file BeamHaloParticleBuffer.h.

◆ m_recordSize

int BeamHaloParticleBuffer::m_recordSize
private

The size of 1 binary data record.

Definition at line 75 of file BeamHaloParticleBuffer.h.

◆ m_upperBinEdge

double BeamHaloParticleBuffer::m_upperBinEdge
private

The upper edge of the bin.

Definition at line 91 of file BeamHaloParticleBuffer.h.

◆ m_writeFlag

bool BeamHaloParticleBuffer::m_writeFlag
private

A flag to select read or write.

Definition at line 100 of file BeamHaloParticleBuffer.h.


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