40 columns_m.
addColumn(
"ref_x",
"double",
"m",
"x coordinate of reference particle in lab cs");
41 columns_m.
addColumn(
"ref_y",
"double",
"m",
"y coordinate of reference particle in lab cs");
42 columns_m.
addColumn(
"ref_z",
"double",
"m",
"z coordinate of reference particle in lab cs");
44 columns_m.
addColumn(
"ref_px",
"double",
"1",
"x momentum of reference particle in lab cs");
45 columns_m.
addColumn(
"ref_py",
"double",
"1",
"y momentum of reference particle in lab cs");
46 columns_m.
addColumn(
"ref_pz",
"double",
"1",
"z momentum of reference particle in lab cs");
90 "Azimuth in global coordinates");
93 for (
size_t i = 0; i < losses.size(); ++ i) {
95 "Number of lost particles in element");
98 if (
mode_m == std::ios::app )
102 std::string dateStr(simtimer.
date());
103 std::string timeStr(simtimer.
time());
105 std::stringstream ss;
106 ss <<
"Statistics data '"
108 <<
"' " << dateStr <<
" " << timeStr;
120 const losses_t &losses,
const double& azimuth)
127 size_t npOutside = 0;
131 double pathLength = beam->
get_sPos();
232 for(
size_t i = 0; i < losses.size(); ++ i) {
233 long unsigned int loss = losses[i].second;
244 double sposHead,
double sposRef,
double sposTail)
Vector_t get_rprms() const
ParticleAttrib< Vector_t > P
double get_dEdt()
returns the energy spread
double get_meanKineticEnergy()
returns the mean energy
Vector_t get_rrms()
returns RMS x,y,z
constexpr double e
The value of .
double getT()
returns the current time of the bunch
void writeHeader()
Write SDDS header.
core of the envelope tracker based on Rene Bakkers BET implementation
Vector_t get_norm_emit()
returns vector with normalized emittance
void gatherLoadBalanceStatistics()
Vector_t get_rrms() const
double get_meanKineticEnergy() const
void addDescription(const std::string &text, const std::string &content)
size_t getTotalNum() const
Vector_t get_prms() const
std::string date() const
Return date.
Vector_t get_rmean() const
static OpalData * getInstance()
void calcBeamParameters()
Vector_t get_maxExtent() const
Vector_t get_halo() const
std::string getInputFn()
get opals input filename
size_t calcNumPartsOutside(Vector_t x)
returns the number of particles outside of a box defined by x
void addColumnValue(const std::string &name, const T &val)
void write(PartBunchBase< double, 3 > *beam, Vector_t FDext[], const losses_t &losses=losses_t(), const double &azimuth=-1)
Write statistical data.
void fillHeader(const losses_t &losses=losses_t())
StatWriter(const std::string &fname, bool restart)
Vector_t get_norm_emit() const
size_t getLocalNum() const
double getCharge() const
get the total charge per simulation particle
std::ios_base::openmode mode_m
First write to the statistics output file.
std::vector< std::pair< std::string, unsigned int > > losses_t
std::string time() const
Return time.
double getChargePerParticle()
returns charge per slice
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 addDefaultParameters()
int getTotalNum()
returns the total number of slices
void calcBeamParameters()
calculates envelope statistics
void addInfo(const std::string &mode, const size_t &no_row_counts)
Vector_t get_prms()
returns RMSP x,y,z