|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
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 (const PartBunchBase< double, 3 > *beam, Vector_t FDext[], const double &timeStep, const losses_t &losses=losses_t(), const double &azimuth=-1, const size_t npOutside=0) |
| Write statistical data. | |
| virtual void | write (PartBunchBase< double, 3 > *) |
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 | |
Public Member Functions inherited from SDDSWriter | |
| SDDSWriter (const std::string &fname, bool restart) | |
| virtual | ~SDDSWriter () |
| void | rewindLines (size_t numberOfLines) |
| delete the last 'numberOfLines' lines of the file 'fileName' | |
| void | replaceVersionString () |
| double | getLastValue (const std::string &column) |
| bool | exists () const |
Private Member Functions | |
| void | fillHeader (const PartBunchBase< double, 3 > *beam, const losses_t &losses=losses_t()) |
Private Attributes | |
| bool | hasMeshFitColumns_m = false |
| bool | warnedMeshFitColumns_m = false |
| The warning that the core selection is not written has been given. | |
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. | |
| 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. | |
| SDDSColumnSet | columns_m |
Definition at line 24 of file StatWriter.h.
| typedef std::vector<std::pair<std::string, unsigned int> > StatWriter::losses_t |
Definition at line 27 of file StatWriter.h.
| StatWriter::StatWriter | ( | const std::string & | fname, |
| bool | restart | ||
| ) |
Definition at line 28 of file StatWriter.cpp.
|
private |
Definition at line 33 of file StatWriter.cpp.
References SDDSColumnSet::addColumn(), SDDSWriter::addDefaultParameters(), SDDSWriter::addDescription(), SDDSWriter::addInfo(), Options::amr, SDDSWriter::columns_m, Options::computePercentiles, CORE, OPALTimer::Timer::date(), Options::dumpBeamMatrix, OpalData::getInputFn(), OpalData::getInstance(), PartBunchBase< T, Dim >::getMeshFit(), IpplInfo::getNodes(), SDDSWriter::hasColumns(), hasMeshFitColumns_m, SDDSWriter::mode_m, OPALTimer::Timer::time(), and MeshFitParameters::type.
Referenced by write().

| void StatWriter::write | ( | const PartBunchBase< double, 3 > * | beam, |
| Vector_t | FDext[], | ||
| const double & | timeStep, | ||
| const losses_t & | losses = losses_t(), |
||
| const double & | azimuth = -1, |
||
| const size_t | npOutside = 0 |
||
| ) |
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:
|
| timeStep | The integration time step [s] written as 'dt'. This is beam->getdT(), except in OPAL-cycl, which integrates with getdT() times the harmonic number. |
Write data to files. If this is the first write to the beam statistics file, write SDDS header information.
Definition at line 279 of file StatWriter.cpp.
References SDDSColumnSet::addColumnValue(), CoreFitSC::CoreSelection::boundsMax, CoreFitSC::CoreSelection::boundsMin, SDDSWriter::close(), SDDSWriter::columns_m, Options::computePercentiles, CoreFitSC::CORE, CORE, Options::dumpBeamMatrix, endl(), PartBunchBase< T, Dim >::MeshFitStatistics::farFarSampled, CoreFitSC::CoreSelection::farMaxDistance, fillHeader(), PartBunchBase< T, Dim >::MeshFitStatistics::fullSolves, PartBunchBase< T, Dim >::get_68Percentile(), PartBunchBase< T, Dim >::get_95Percentile(), PartBunchBase< T, Dim >::get_99_99Percentile(), PartBunchBase< T, Dim >::get_99Percentile(), PartBunchBase< T, Dim >::get_DDx(), PartBunchBase< T, Dim >::get_DDy(), PartBunchBase< T, Dim >::get_debyeLength(), 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_normalizedEps_68Percentile(), PartBunchBase< T, Dim >::get_normalizedEps_95Percentile(), PartBunchBase< T, Dim >::get_normalizedEps_99_99Percentile(), PartBunchBase< T, Dim >::get_normalizedEps_99Percentile(), PartBunchBase< T, Dim >::get_plasmaParameter(), PartBunchBase< T, Dim >::get_prms(), PartBunchBase< T, Dim >::get_rmean(), PartBunchBase< T, Dim >::get_rmsDensity(), PartBunchBase< T, Dim >::get_rprms(), PartBunchBase< T, Dim >::get_rrms(), PartBunchBase< T, Dim >::get_sPos(), PartBunchBase< T, Dim >::get_temperature(), PartBunchBase< T, Dim >::getCharge(), PartBunchBase< T, Dim >::getdE(), CoreFitSC::CoreSelection::getFarChargeFraction(), OpalData::getInstance(), PartBunchBase< T, Dim >::getLocalNum(), PartBunchBase< T, Dim >::getMeshFit(), PartBunchBase< T, Dim >::getMeshFitCore(), PartBunchBase< T, Dim >::getMeshFitMode(), PartBunchBase< T, Dim >::getMeshFitStatistics(), IpplInfo::getNodes(), PartBunchBase< T, Dim >::getSigmaMatrix(), PartBunchBase< T, Dim >::getT(), PartBunchBase< T, Dim >::getTotalNum(), hasMeshFitColumns_m, PartBunchBase< T, Dim >::MeshFitStatistics::meshSpacing, CoreFitSC::ModeState::mode, PartBunchBase< T, Dim >::MeshFitStatistics::modeSwitches, IpplInfo::myNode(), PartBunchBase< T, Dim >::MeshFitStatistics::nearSampled, CoreFitSC::CoreSelection::numCore, CoreFitSC::CoreSelection::numFar, PartBunchBase< T, Dim >::MeshFitStatistics::numFlagged, CoreFitSC::CoreSelection::numHalo, PartBunchBase< T, Dim >::MeshFitStatistics::numOutside, SDDSWriter::open(), PartBunchBase< T, Dim >::P, CoreFitSC::CoreSelection::passes, PartBunchBase< T, Dim >::R, PartBunchBase< T, Dim >::RefPartP_m, PartBunchBase< T, Dim >::RefPartR_m, Units::s2ns, CoreFitSC::CoreSelection::sigma, MeshFitParameters::type, warnedMeshFitColumns_m, WARNMSG, SDDSWriter::writeHeader(), and SDDSWriter::writeRow().

|
inlinevirtual |
Reimplemented from SDDSWriter.
Definition at line 63 of file SDDSWriter.h.
|
private |
The header has the columns of FIELDSOLVER, MESHFIT=CORE. Like all columns they are fixed by the first write: a later TRACK/RUN with MESHFIT=ALL writes zeros into them, and one with MESHFIT=CORE goes without them if the first had MESHFIT=ALL.
Definition at line 61 of file StatWriter.h.
Referenced by fillHeader(), and write().
|
private |
The warning that the core selection is not written has been given.
Definition at line 63 of file StatWriter.h.
Referenced by write().