OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
#include <StatWriter.h>
Public Types | |
typedef std::vector< std::pair < std::string, unsigned int > > | losses_t |
Public Types inherited from SDDSWriter | |
typedef std::pair< std::string, std::string > | desc_t |
typedef std::tuple < std::string, std::string, std::string > | param_t |
typedef std::pair< std::string, size_t > | data_t |
typedef std::tuple < std::string, std::string, std::string, std::string > | cols_t |
Public Member Functions | |
StatWriter (const std::string &fname, bool restart) | |
void | write (PartBunchBase< double, 3 > *beam, Vector_t FDext[], const losses_t &losses=losses_t(), const double &azimuth=-1) |
Write statistical data. More... | |
void | write (EnvelopeBunch &beam, Vector_t FDext[], double sposHead, double sposRef, double sposTail) |
Public Member Functions inherited from StatBaseWriter | |
StatBaseWriter (const std::string &fname, bool restart) | |
unsigned int | rewindToSpos (double maxSpos) |
delete the last 'numberOfLines' lines of the statistics file More... | |
Public Member Functions inherited from SDDSWriter | |
SDDSWriter (const std::string &fname, bool restart) | |
virtual | ~SDDSWriter () |
virtual void | write (PartBunchBase< double, 3 > *beam) |
void | rewindLines (size_t numberOfLines) |
delete the last 'numberOfLines' lines of the file 'fileName' More... | |
void | replaceVersionString () |
double | getLastValue (const std::string &column) |
bool | exists () const |
Private Member Functions | |
void | fillHeader (const losses_t &losses=losses_t()) |
Additional Inherited Members | |
Protected Member Functions inherited from SDDSWriter | |
void | addDescription (const std::string &text, const std::string &content) |
template<typename T > | |
void | addParameter (const std::string &name, const std::string &type, const std::string &desc, const T &value) |
void | addDefaultParameters () |
void | addColumn (const std::string &name, const std::string &type, const std::string &unit, const std::string &desc) |
void | addInfo (const std::string &mode, const size_t &no_row_counts) |
void | writeRow () |
void | open () |
void | close () |
void | writeHeader () |
Write SDDS header. More... | |
template<typename T > | |
std::string | toString (const T &val) |
bool | hasColumns () const |
Protected Attributes inherited from SDDSWriter | |
std::string | fname_m |
std::ios_base::openmode | mode_m |
First write to the statistics output file. More... | |
SDDSColumnSet | columns_m |
Definition at line 8 of file StatWriter.h.
typedef std::vector<std::pair<std::string, unsigned int> > StatWriter::losses_t |
Definition at line 11 of file StatWriter.h.
StatWriter::StatWriter | ( | const std::string & | fname, |
bool | restart | ||
) |
Definition at line 7 of file StatWriter.cpp.
Definition at line 12 of file StatWriter.cpp.
References SDDSColumnSet::addColumn(), SDDSWriter::addDefaultParameters(), SDDSWriter::addDescription(), SDDSWriter::addInfo(), SDDSWriter::columns_m, OPALTimer::Timer::date(), OpalData::getInputFn(), OpalData::getInstance(), IpplInfo::getNodes(), SDDSWriter::hasColumns(), SDDSWriter::mode_m, and OPALTimer::Timer::time().
Referenced by write().
void StatWriter::write | ( | PartBunchBase< double, 3 > * | beam, |
Vector_t | FDext[], | ||
const losses_t & | losses = losses_t() , |
||
const double & | azimuth = -1 |
||
) |
Write statistical data.
Writes statistical beam data to proper output file. This is information such as RMS beam parameters etc.
Also gathers and writes load balancing data to load balance statistics file.
beam | The beam. |
FDext | The external E and B field for the head, reference and tail particles. The vector array has the following layout:
|
Calculate beam statistics.
Write data to files. If this is the first write to the beam statistics file, write SDDS header information.
Definition at line 119 of file StatWriter.cpp.
References SDDSColumnSet::addColumnValue(), Options::beamHaloBoundary, PartBunchBase< T, Dim >::calcBeamParameters(), PartBunchBase< T, Dim >::calcNumPartsOutside(), SDDSWriter::close(), SDDSWriter::columns_m, fillHeader(), PartBunchBase< T, Dim >::get_DDx(), PartBunchBase< T, Dim >::get_DDy(), PartBunchBase< T, Dim >::get_Dx(), PartBunchBase< T, Dim >::get_Dy(), PartBunchBase< T, Dim >::get_halo(), PartBunchBase< T, Dim >::get_maxExtent(), PartBunchBase< T, Dim >::get_meanKineticEnergy(), PartBunchBase< T, Dim >::get_norm_emit(), PartBunchBase< T, Dim >::get_prms(), PartBunchBase< T, Dim >::get_rmean(), PartBunchBase< T, Dim >::get_rprms(), PartBunchBase< T, Dim >::get_rrms(), PartBunchBase< T, Dim >::get_sPos(), PartBunchBase< T, Dim >::getCharge(), PartBunchBase< T, Dim >::getdE(), PartBunchBase< T, Dim >::getdT(), OpalData::getInstance(), PartBunchBase< T, Dim >::getLocalNum(), IpplInfo::getNodes(), PartBunchBase< T, Dim >::getT(), PartBunchBase< T, Dim >::getTotalNum(), IpplInfo::myNode(), SDDSWriter::open(), PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::R, PartBunchBase< T, Dim >::RefPartP_m, PartBunchBase< T, Dim >::RefPartR_m, SDDSWriter::writeHeader(), and SDDSWriter::writeRow().
void StatWriter::write | ( | EnvelopeBunch & | beam, |
Vector_t | FDext[], | ||
double | sposHead, | ||
double | sposRef, | ||
double | sposTail | ||
) |
FIXME https://gitlab.psi.ch/OPAL/src/issues/245
Calculate beam statistics and gather load balance statistics.
Definition at line 243 of file StatWriter.cpp.
References SDDSColumnSet::addColumnValue(), EnvelopeBunch::calcBeamParameters(), SDDSWriter::close(), SDDSWriter::columns_m, Physics::e, fillHeader(), PartBunchBase< T, Dim >::gatherLoadBalanceStatistics(), PartBunchBase< T, Dim >::get_DDx(), PartBunchBase< T, Dim >::get_DDy(), EnvelopeBunch::get_dEdt(), PartBunchBase< T, Dim >::get_Dx(), PartBunchBase< T, Dim >::get_Dy(), PartBunchBase< T, Dim >::get_maxExtent(), EnvelopeBunch::get_meanKineticEnergy(), EnvelopeBunch::get_norm_emit(), EnvelopeBunch::get_prms(), PartBunchBase< T, Dim >::get_rmean(), EnvelopeBunch::get_rrms(), EnvelopeBunch::getChargePerParticle(), EnvelopeBunch::getT(), EnvelopeBunch::getTotalNum(), IpplInfo::myNode(), SDDSWriter::open(), SDDSWriter::writeHeader(), and SDDSWriter::writeRow().