 |
Version: SMASH-1.8
|
|
Go to the documentation of this file.
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 char c);
51 void write(
const std::string &s);
57 void write(
const double x);
69 void write(
const std::int32_t x) {
70 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
77 void write(
const std::uint32_t x) {
78 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
85 void write(
const std::uint16_t x) {
86 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
93 void write(
const size_t x) {
write(boost::numeric_cast<uint32_t>(x)); }
105 void write(
const ParticleList &particles);
154 const int event_number)
override;
166 double impact_parameter,
bool empty_event)
override;
214 const int event_number)
override;
225 double impact_parameter,
bool empty_event)
override;
234 const std::unique_ptr<Clock> &clock,
282 double impact_parameter,
bool empty_event)
override;
295 #endif // SRC_INCLUDE_BINARYOUTPUT_H_
bool extended_
Option for extended output.
void at_eventstart(const Particles &particles, const int event_number) override
Writes the initial particle information list of an event to the binary output.
A class to pre-calculate and store parameters relevant for density calculation.
OutputOnlyFinal only_final_
Whether final- or initial-state particles should be written.
OutputOnlyFinal
Whether and when only final state particles should be printed.
void at_eventend(const Particles &particles, const int event_number, double impact_parameter, bool empty_event) override
Writes the final particle information of an event to the binary output.
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.
void at_eventend(const Particles &particles, const int event_number, double impact_parameter, bool empty_event) override
Writes the final particle information of an event to the binary output.
BinaryOutputBase(const bf::path &path, const std::string &mode, const std::string &name, bool extended_format)
Create binary output base.
FILE * get()
Get the underlying FILE* pointer.
void write(const std::uint32_t x)
Write unsigned integer (32 bit) to binary output.
Writes the particle list at specific times to the binary file.
Helper structure for Experiment to hold output options and parameters.
RenamingFilePtr file_
Binary particles output file path.
void write_particledata(const ParticleData &p)
Write particle data to binary output.
Abstraction of generic output.
void write(const char c)
Write byte to binary output.
const uint16_t format_version_
Binary file format version number.
void at_interaction(const Action &action, const double) override
Writes particles that are removed when crossing the hypersurface to the output.
void at_interaction(const Action &action, const double density) override
Writes an interaction block, including information about the incoming and outgoing particles,...
bool print_start_end_
Write initial and final particles additonally to collisions?
A RAII type to replace std::FILE *.
void write(const std::int32_t x)
Write integer (32 bit) to binary output.
Saves SMASH collision history to binary file.
BinaryOutputInitialConditions(const bf::path &path, std::string name, const OutputParameters &out_par)
Create binary initial conditions particle output.
BinaryOutputParticles(const bf::path &path, std::string name, const OutputParameters &out_par)
Create binary particle output.
void at_eventend(const Particles &particles, const int32_t event_number, double impact_parameter, bool empty_event) override
Writes the final particle information list of an event to the binary output.
void at_eventstart(const Particles &particles, const int event_number) override
Writes the initial particle information of an event to the binary output.
void at_eventstart(const Particles &, const int) override
Writes the initial particle information of an event to the binary output.
BinaryOutputCollisions(const bf::path &path, std::string name, const OutputParameters &out_par)
Create binary particle output.
Writes the particles when crossing the hypersurface to the binary file.
void at_intermediate_time(const Particles &particles, const std::unique_ptr< Clock > &clock, const DensityParameters &dens_param) override
Writes particles at each time interval; fixed by option OUTPUT_INTERVAL.