45 "Number of Macro Particles including the one with ID 0 that the moments exclude");
68 columns_m.
addColumn(
"ref_x",
"double",
"m",
"x coordinate of reference particle in lab cs");
69 columns_m.
addColumn(
"ref_y",
"double",
"m",
"y coordinate of reference particle in lab cs");
70 columns_m.
addColumn(
"ref_z",
"double",
"m",
"z coordinate of reference particle in lab cs");
72 columns_m.
addColumn(
"ref_px",
"double",
"1",
"x momentum of reference particle in lab cs");
73 columns_m.
addColumn(
"ref_py",
"double",
"1",
"y momentum of reference particle in lab cs");
74 columns_m.
addColumn(
"ref_pz",
"double",
"1",
"z momentum of reference particle in lab cs");
85 columns_m.
addColumn(
"Dx",
"double",
"m",
"Raw moment mean(x*pz) (not the dispersion)");
86 columns_m.
addColumn(
"DDx",
"double",
"1",
"Raw moment mean(px*pz) (not the dispersion derivative)");
87 columns_m.
addColumn(
"Dy",
"double",
"m",
"Raw moment mean(y*pz) (not the dispersion)");
88 columns_m.
addColumn(
"DDy",
"double",
"1",
"Raw moment mean(py*pz) (not the dispersion derivative)");
101 columns_m.
addColumn(
"DebyeLength",
"double",
"m",
"Debye length in the boosted frame");
102 columns_m.
addColumn(
"plasmaParameter",
"double",
"1",
"Plasma parameter that gives no. of particles in a Debye sphere");
108 "68.27 percentile (1 sigma of normal distribution) of x-component of position");
110 "68.27 percentile (1 sigma of normal distribution) of y-component of position");
112 "68.27 percentile (1 sigma of normal distribution) of z-component of position");
115 "95.45 percentile (2 sigma of normal distribution) of x-component of position");
117 "95.45 percentile (2 sigma of normal distribution) of y-component of position");
119 "95.45 percentile (2 sigma of normal distribution) of z-component of position");
122 "99.73 percentile (3 sigma of normal distribution) of x-component of position");
124 "99.73 percentile (3 sigma of normal distribution) of y-component of position");
126 "99.73 percentile (3 sigma of normal distribution) of z-component of position");
129 "99.994 percentile (4 sigma of normal distribution) of x-component of position");
131 "99.994 percentile (4 sigma of normal distribution) of y-component of position");
133 "99.994 percentile (4 sigma of normal distribution) of z-component of position");
136 "x-component of normalized emittance at 68 percentile (1 sigma of normal distribution)");
138 "y-component of normalized emittance at 68 percentile (1 sigma of normal distribution)");
140 "z-component of normalized emittance at 68 percentile (1 sigma of normal distribution)");
143 "x-component of normalized emittance at 95 percentile (2 sigma of normal distribution)");
145 "y-component of normalized emittance at 95 percentile (2 sigma of normal distribution)");
147 "z-component of normalized emittance at 95 percentile (2 sigma of normal distribution)");
150 "x-component of normalized emittance at 99 percentile (3 sigma of normal distribution)");
152 "y-component of normalized emittance at 99 percentile (3 sigma of normal distribution)");
154 "z-component of normalized emittance at 99 percentile (3 sigma of normal distribution)");
157 "x-component of normalized emittance at 99.99 percentile (4 sigma of normal distribution)");
159 "y-component of normalized emittance at 99.99 percentile (4 sigma of normal distribution)");
161 "z-component of normalized emittance at 99.99 percentile (4 sigma of normal distribution)");
198 columns_m.
addColumn(
"halo_x",
"double",
"1",
"Halo in x (kurtosis of x minus HALOSHIFT)");
199 columns_m.
addColumn(
"halo_y",
"double",
"1",
"Halo in y (kurtosis of y minus HALOSHIFT)");
200 columns_m.
addColumn(
"halo_z",
"double",
"1",
"Halo in z (kurtosis of z minus HALOSHIFT)");
203 "Azimuth in global coordinates");
211 "Mesh fitted to the core (1) or to all particles (0)");
213 "Live particles outside the core of the space-charge mesh fit");
215 "Live particles beyond 10 clipped rms widths in any axis");
217 "Charge of the far particles over the live charge");
219 "Clipped passes of the core selection");
221 "Far particles outside the mesh where the multipole expansion "
224 "Particles outside the space-charge mesh at the last update");
230 columns_m.
addColumn(
"scHr_x",
"double",
"m",
"Mesh spacing in x of the space-charge solve");
231 columns_m.
addColumn(
"scHr_y",
"double",
"m",
"Mesh spacing in y of the space-charge solve");
232 columns_m.
addColumn(
"scHr_s",
"double",
"m",
"Mesh spacing in z of the space-charge solve");
239 "Largest distance of a far particle in clipped rms widths");
242 "Solves with the mesh fitted to all particles");
244 "Switches between the core and all particles");
246 "Solves with the far-far field summed over a subsample "
247 "of the far particles");
249 "Solves with the exact core field summed over a "
250 "subsample of the core particles");
253 for (
size_t i = 0; i < losses.size(); ++ i) {
255 "Number of lost particles in element");
258 if (
mode_m == std::ios::app )
262 std::string dateStr(simtimer.
date());
263 std::string timeStr(simtimer.
time());
265 std::stringstream ss;
266 ss <<
"Statistics data '"
268 <<
"' " << dateStr <<
" " << timeStr;
280 const double& timeStep,
281 const losses_t &losses,
const double& azimuth,
282 const size_t npOutside)
286 double pathLength = beam->
get_sPos();
487 WARNMSG(
"The stat file has no columns for FIELDSOLVER, MESHFIT=\"CORE\": its columns "
488 "are those of the first TRACK/RUN, which had MESHFIT=\"ALL\"." <<
endl);
492 for(
size_t i = 0; i < losses.size(); ++ i) {
493 long unsigned int loss = losses[i].second;
Inform & endl(Inform &inf)
bool amr
Enable AMR if true.
double get_meanKineticEnergy() const
Vector_t get_99Percentile() const
const MeshFitParameters & getMeshFit() const
Vector_t get_normalizedEps_99Percentile() const
size_t getLocalNum() const
FMatrix< double, 2 *Dim, 2 *Dim > getSigmaMatrix() const
double get_debyeLength() const
double get_plasmaParameter() const
size_t getTotalNum() const
Vector_t get_95Percentile() const
Vector_t get_normalizedEps_68Percentile() const
ParticleAttrib< Vector_t > P
Vector_t get_rrms() const
double get_rmsDensity() const
Vector_t get_prms() const
const CoreFitSC::CoreSelection & getMeshFitCore() const
double getCharge() const
get the total charge per simulation particle
double get_temperature() const
Vector_t get_68Percentile() const
Vector_t get_norm_emit() const
Vector_t get_rprms() const
Vector_t get_maxExtent() const
Vector_t get_normalizedEps_95Percentile() const
Vector_t get_halo() const
Vector_t get_99_99Percentile() const
Vector_t get_normalizedEps_99_99Percentile() const
const CoreFitSC::ModeState & getMeshFitMode() const
const MeshFitStatistics & getMeshFitStatistics() const
Vector_t get_rmean() const
std::string getInputFn()
get opals input filename
static OpalData * getInstance()
Result of selectCore(), the same on every rank.
unsigned int passes
clipped passes done, 0 to maxClipPasses
double getFarChargeFraction() const
Far charge over live charge, 0 without live charge.
Vector_t boundsMin
minimum over the core particles [m]
std::size_t numFar
the other live particles
Vector_t sigma
clipped rms [m]
std::size_t numHalo
live particles beyond haloSigma * sigma in any axis
std::size_t numCore
live particles within nSigma * sigma in every axis
MESHFIT=CORE: statistics of the solves of this TRACK/RUN, for the stat file and the log.
size_t numOutside
particles outside the mesh domain at the last update()
size_t fullSolves
solves in FULL mode
size_t modeSwitches
switches between CORE and FULL
void addColumn(const std::string &name, const std::string &type, const std::string &unit, const std::string &desc, std::ios_base::fmtflags flags=std::ios_base::scientific, unsigned short precision=15)
void addColumnValue(const std::string &name, const T &val)
void addDefaultParameters()
void addDescription(const std::string &text, const std::string &content)
void writeHeader()
Write SDDS header.
std::ios_base::openmode mode_m
First write to the statistics output file.
void addInfo(const std::string &mode, const size_t &no_row_counts)
bool warnedMeshFitColumns_m
The warning that the core selection is not written has been given.
void fillHeader(const PartBunchBase< double, 3 > *beam, const losses_t &losses=losses_t())
std::vector< std::pair< std::string, unsigned int > > losses_t
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.
StatWriter(const std::string &fname, bool restart)
std::string date() const
Return date.
std::string time() const
Return time.