Version: SMASH-1.5
Output Classes

Classes

class  smash::BinaryOutputBase
 Base class for SMASH binary output. More...
 
class  smash::BinaryOutputCollisions
 Saves SMASH collision history to binary file. More...
 
class  smash::BinaryOutputParticles
 Writes the particle list at specific times to the binary file. More...
 
class  smash::OscarOutput< Format, Contents >
 
class  smash::OutputInterface
 Abstraction of generic output. More...
 
class  smash::RootOutput
 

SMASH output to ROOT file

SMASH supports ROOT output as an option (see http://root.cern.ch). More...
 
class  smash::ThermodynamicOutput
 Writes the thermodynamic quantities at a specified point versus time. More...
 
class  smash::VtkOutput
 SMASH output in a paraview format, intended for simple visualization. More...
 

Enumerations

enum  smash::OscarOutputFormat { smash::OscarFormat2013, smash::OscarFormat2013Extended, smash::OscarFormat1999 }
 Selector for the output format of OscarOutput. More...
 
enum  smash::OscarOutputContents { smash::OscarInteractions = 0x001, smash::OscarTimesteps = 0x002, smash::OscarAtEventstart = 0x004, smash::OscarParticlesAtEventend = 0x008 }
 Flags for the Contents template parameter of OscarOutput. More...
 

Functions

std::unique_ptr< OutputInterfacesmash::create_oscar_output (const std::string &format, const std::string &content, const bf::path &path, const OutputParameters &out_par)
 

Enumeration Type Documentation

◆ OscarOutputFormat

Selector for the output format of OscarOutput.

Enumerator
OscarFormat2013 
OscarFormat2013Extended 
OscarFormat1999 

Definition at line 29 of file oscaroutput.h.

◆ OscarOutputContents

Flags for the Contents template parameter of OscarOutput.

Flags can be combined with binary OR operators to some arbitrary int. That's why the values of the enumerators are written out (in hexadecimal), to ensure every flag occupies a single bit.

Enumerator
OscarInteractions 

store interaction information (write_interaction)

OscarTimesteps 

store the state after N timesteps (after_Nth_timestep)

OscarAtEventstart 

store the state at the start of each event (at_eventstart)

OscarParticlesAtEventend 

store the state at the end of each event (at_eventend)

Definition at line 42 of file oscaroutput.h.

42  {
44  OscarInteractions = 0x001,
46  OscarTimesteps = 0x002,
48  OscarAtEventstart = 0x004,
51 };
store the state at the end of each event (at_eventend)
Definition: oscaroutput.h:50
store the state after N timesteps (after_Nth_timestep)
Definition: oscaroutput.h:46
store the state at the start of each event (at_eventstart)
Definition: oscaroutput.h:48
store interaction information (write_interaction)
Definition: oscaroutput.h:44

Function Documentation

◆ create_oscar_output()

std::unique_ptr< OutputInterface > smash::create_oscar_output ( const std::string &  format,
const std::string &  content,
const bf::path &  path,
const OutputParameters out_par 
)
Returns
A new OscarOutput object using information from config to select the correct implementation.
Parameters
[in]formatA string: "Oscar2013" or "Oscar1999"
[in]contentA string: "Particles", "Collisions", "Photons" or "Dileptons".
[in]pathThe path to the output directory where the file(s) will be placed.
[in]out_parA structure containing parameters of the output, in particular if it is extended or not, if printing only final particles in event, etc.

Definition at line 732 of file oscaroutput.cc.

734  {
735  const auto &log = logger<LogArea::Output>();
736  if (format != "Oscar2013" && format != "Oscar1999") {
737  throw std::invalid_argument("Creating Oscar output: unknown format");
738  }
739  const bool modern_format = (format == "Oscar2013");
740  if (content == "Particles") {
741  if (out_par.part_only_final) {
742  return create_select_format<OscarParticlesAtEventend>(
743  modern_format, path, out_par, "particle_lists");
744  } else {
747  modern_format, path, out_par, "particle_lists");
748  }
749  } else if (content == "Collisions") {
750  if (out_par.coll_printstartend) {
753  modern_format, path, out_par, "full_event_history");
754  } else {
755  return create_select_format<OscarInteractions>(
756  modern_format, path, out_par, "full_event_history");
757  }
758  } else if (content == "Dileptons") {
759  if (modern_format && out_par.dil_extended) {
760  return make_unique<
761  OscarOutput<OscarFormat2013Extended, OscarInteractions>>(path,
762  "Dileptons");
763  } else if (modern_format && !out_par.dil_extended) {
764  return make_unique<OscarOutput<OscarFormat2013, OscarInteractions>>(
765  path, "Dileptons");
766  } else if (!modern_format && !out_par.dil_extended) {
767  return make_unique<OscarOutput<OscarFormat1999, OscarInteractions>>(
768  path, "Dileptons");
769  } else if (!modern_format && out_par.dil_extended) {
770  log.warn() << "Creating Oscar output: "
771  << "There is no extended Oscar1999 (dileptons) format.";
772  }
773  } else if (content == "Photons") {
774  if (modern_format && !out_par.photons_extended) {
775  return make_unique<OscarOutput<OscarFormat2013, OscarInteractions>>(
776  path, "Photons");
777  } else if (modern_format && out_par.photons_extended) {
778  return make_unique<
779  OscarOutput<OscarFormat2013Extended, OscarInteractions>>(path,
780  "Photons");
781  } else if (!modern_format && !out_par.photons_extended) {
782  return make_unique<OscarOutput<OscarFormat1999, OscarInteractions>>(
783  path, "Photons");
784  } else if (!modern_format && out_par.photons_extended) {
785  log.warn() << "Creating Oscar output: "
786  << "There is no extended Oscar1999 (photons) format.";
787  }
788  }
789 
790  throw std::invalid_argument("Create_oscar_output got unknown content.");
791 }
FormattingHelper< T > format(const T &value, const char *unit, int width=-1, int precision=-1)
Acts as a stream modifier for std::ostream to output an object with an optional suffix string and wit...
Definition: logging.h:310
store the state at the end of each event (at_eventend)
Definition: oscaroutput.h:50
store the state after N timesteps (after_Nth_timestep)
Definition: oscaroutput.h:46
std::unique_ptr< T > make_unique(Args &&... args)
Definition for make_unique Is in C++14&#39;s standard library; necessary for older compilers.
Definition: cxx14compat.h:25
store the state at the start of each event (at_eventstart)
Definition: oscaroutput.h:48
std::unique_ptr< OutputInterface > create_select_format(bool modern_format, const bf::path &path, const OutputParameters &out_par, const std::string &name)
Helper function that creates the oscar output with the format selected by create_oscar_output (except...
Definition: oscaroutput.cc:710
store interaction information (write_interaction)
Definition: oscaroutput.h:44
Here is the call graph for this function:
Here is the caller graph for this function: