Version: SMASH-1.6
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< OutputInterface > smash::create_oscar_output (const std::string &format, const std::string &content, const bf::path &path, const OutputParameters &out_par)
 

Enumeration Type Documentation

Selector for the output format of OscarOutput.

Enumerator
OscarFormat2013 
OscarFormat2013Extended 
OscarFormat1999 

Definition at line 29 of file oscaroutput.h.

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

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 735 of file oscaroutput.cc.

737  {
738  const auto &log = logger<LogArea::Output>();
739  if (format != "Oscar2013" && format != "Oscar1999") {
740  throw std::invalid_argument("Creating Oscar output: unknown format");
741  }
742  const bool modern_format = (format == "Oscar2013");
743  if (content == "Particles") {
744  if (out_par.part_only_final) {
745  return create_select_format<OscarParticlesAtEventend>(
746  modern_format, path, out_par, "particle_lists");
747  } else {
750  modern_format, path, out_par, "particle_lists");
751  }
752  } else if (content == "Collisions") {
753  if (out_par.coll_printstartend) {
756  modern_format, path, out_par, "full_event_history");
757  } else {
758  return create_select_format<OscarInteractions>(
759  modern_format, path, out_par, "full_event_history");
760  }
761  } else if (content == "Dileptons") {
762  if (modern_format && out_par.dil_extended) {
763  return make_unique<
764  OscarOutput<OscarFormat2013Extended, OscarInteractions>>(path,
765  "Dileptons");
766  } else if (modern_format && !out_par.dil_extended) {
767  return make_unique<OscarOutput<OscarFormat2013, OscarInteractions>>(
768  path, "Dileptons");
769  } else if (!modern_format && !out_par.dil_extended) {
770  return make_unique<OscarOutput<OscarFormat1999, OscarInteractions>>(
771  path, "Dileptons");
772  } else if (!modern_format && out_par.dil_extended) {
773  log.warn() << "Creating Oscar output: "
774  << "There is no extended Oscar1999 (dileptons) format.";
775  }
776  } else if (content == "Photons") {
777  if (modern_format && !out_par.photons_extended) {
778  return make_unique<OscarOutput<OscarFormat2013, OscarInteractions>>(
779  path, "Photons");
780  } else if (modern_format && out_par.photons_extended) {
781  return make_unique<
782  OscarOutput<OscarFormat2013Extended, OscarInteractions>>(path,
783  "Photons");
784  } else if (!modern_format && !out_par.photons_extended) {
785  return make_unique<OscarOutput<OscarFormat1999, OscarInteractions>>(
786  path, "Photons");
787  } else if (!modern_format && out_par.photons_extended) {
788  log.warn() << "Creating Oscar output: "
789  << "There is no extended Oscar1999 (photons) format.";
790  }
791  }
792 
793  throw std::invalid_argument("Create_oscar_output got unknown content.");
794 }
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
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 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
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:713
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: