10 #ifndef SRC_INCLUDE_BINARYOUTPUT_H_ 11 #define SRC_INCLUDE_BINARYOUTPUT_H_ 15 #include <boost/numeric/conversion/cast.hpp> 39 const std::string &name,
bool extended_format);
45 void write(
const std::string &s);
51 void write(
const double x);
63 void write(
const std::int32_t x) {
64 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
71 void write(
const std::uint32_t x) {
72 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
79 void write(
const std::uint16_t x) {
80 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
87 void write(
const size_t x) {
write(boost::numeric_cast<uint32_t>(x)); }
99 void write(
const ParticleList &particles);
148 const int event_number)
override;
158 double impact_parameter)
override;
206 const int event_number)
override;
215 double impact_parameter)
override;
233 #endif // SRC_INCLUDE_BINARYOUTPUT_H_ A class to pre-calculate and store parameters relevant for density calculation.
virtual void at_eventstart(const Particles &particles, const int event_number)=0
Output launched at event start after initialization, when particles are generated but not yet propaga...
void write(const std::uint16_t x)
Write unsigned integer (16 bit) to binary output.
void write(const size_t x)
Write a std::size_t to binary output.
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
Writes the particle list at specific times to the binary file.
virtual void at_intermediate_time(const Particles &particles, const Clock &clock, const DensityParameters &dens_param)
Output launched after every N'th timestep.
void write_particledata(const ParticleData &p)
Write particle data to binary output.
void write(const std::uint32_t x)
Write unsigned integer (32 bit) to binary output.
void write(const std::int32_t x)
Write integer (32 bit) to binary output.
uint16_t format_version_
Binary file format version number.
A RAII type to replace std::FILE *.
void write(const std::string &s)
Write string to binary output.
virtual void at_interaction(const Action &action, const double density)
Called whenever an action modified one or more particles.
Helper structure for Experiment to hold output options and parameters.
Saves SMASH collision history to binary file.
Base class for SMASH binary output.
Clock tracks the time in the simulation.
Action is the base class for a generic process that takes a number of incoming particles and transfor...
BinaryOutputBase(const bf::path &path, const std::string &mode, const std::string &name, bool extended_format)
Create binary output base.
bool print_start_end_
Write initial and final particles additonally to collisions?
bool only_final_
Write only final particles (True) or both, inital and final (False).
The Particles class abstracts the storage and manipulation of particles.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
virtual void at_eventend(const Particles &particles, const int event_number, double impact_parameter)=0
Output launched at event end.
ParticleData contains the dynamic information of a certain particle.
Abstraction of generic output.
bool extended_
Option for extended output.