Skip to content

Commit

Permalink
Text Output of RBC: Keep s column
Browse files Browse the repository at this point in the history
Position on the beamline/ring is important for quick processing.
  • Loading branch information
ax3l committed May 22, 2024
1 parent a5a4e15 commit 9119681
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/source/dataanalysis/dataanalysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ The code writes out the values in an ASCII file prefixed ``reduced_beam_characte

* ``step``
Iteration within the simulation
* ``s``
Reference particle coordinate ``s`` (unit: meter)
* ``x_mean/min/max``, ``y_mean/min/max``, ``t_mean/min/max``
Average / minimum / maximum beam particle position in the dimensions of ``x``, ``y`` (transverse coordinates, unit: meter), and ``t`` (normalized time difference :math:`ct`, unit: meter)
* ``sig_x``, ``sig_y``, ``sig_t``
Expand Down
6 changes: 4 additions & 2 deletions src/particles/diagnostics/DiagnosticOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace impactx::diagnostics
if (otype == OutputType::PrintRefParticle) {
file_handler << "step s beta gamma beta_gamma x y z t px py pz pt\n";
} else if (otype == OutputType::PrintReducedBeamCharacteristics) {
file_handler << "step" << " "
file_handler << "step" << " " << "s" << " "
<< "x_mean" << " " << "x_min" << " " << "x_max" << " "
<< "y_mean" << " " << "y_min" << " " << "y_max" << " "
<< "t_mean" << " " << "t_min" << " " << "t_max" << " "
Expand Down Expand Up @@ -88,7 +88,9 @@ namespace impactx::diagnostics
std::unordered_map<std::string, amrex::ParticleReal> const rbc =
diagnostics::reduced_beam_characteristics(pc);

file_handler << step << " "
amrex::ParticleReal const s = pc.GetRefParticle().s;

file_handler << step << " " << s << " "
<< rbc.at("x_mean") << " " << rbc.at("x_min") << " " << rbc.at("x_max") << " "
<< rbc.at("y_mean") << " " << rbc.at("y_min") << " " << rbc.at("y_max") << " "
<< rbc.at("t_mean") << " " << rbc.at("t_min") << " " << rbc.at("t_max") << " "
Expand Down

0 comments on commit 9119681

Please sign in to comment.