Version: SMASH-2.0.2
smash::OutputInterface Class Referenceabstract

#include <outputinterface.h>

Abstraction of generic output.

Any output should inherit this class. It provides virtual methods that will be called at predefined moments: 1) At event start and event end: at_eventstart, at_eventend 2) After every fixed time period: at_intermediate_time, thermodynamics_output 3) At each interaction: at_interaction

Definition at line 66 of file outputinterface.h.

Inheritance diagram for smash::OutputInterface:
[legend]
Collaboration diagram for smash::OutputInterface:
[legend]

Public Member Functions

 OutputInterface (std::string name)
 Construct output interface. More...
 
virtual ~OutputInterface ()=default
 
virtual void at_eventstart (const Particles &particles, const int event_number, const EventInfo &info)=0
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventend (const Particles &particles, const int event_number, const EventInfo &info)=0
 Output launched at event end. More...
 
virtual void at_interaction (const Action &action, const double density)
 Called whenever an action modified one or more particles. More...
 
virtual void at_intermediate_time (const Particles &particles, const std::unique_ptr< Clock > &clock, const DensityParameters &dens_param, const EventInfo &info)
 Output launched after every N'th timestep. More...
 
virtual void thermodynamics_output (const ThermodynamicQuantity tq, const DensityType dt, RectangularLattice< DensityOnLattice > &lattice)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_output (const ThermodynamicQuantity tq, const DensityType dt, RectangularLattice< EnergyMomentumTensor > &lattice)
 Output to write energy-momentum tensor and related quantities from the lattice. More...
 
virtual void thermodynamics_output (const GrandCanThermalizer &gct)
 Output to write energy-momentum tensor and related quantities from the thermalizer class. More...
 
bool is_dilepton_output () const
 Get, whether this is the dilepton output? More...
 
bool is_photon_output () const
 Get, whether this is the photon output? More...
 
bool is_IC_output () const
 Get, whether this is the IC output? More...
 
const char * to_string (const ThermodynamicQuantity tq)
 Convert thermodynamic quantities to strings. More...
 
const char * to_string (const DensityType dens_type)
 Convert density types to strings. More...
 

Protected Attributes

const bool is_dilepton_output_
 Is this the dilepton output? More...
 
const bool is_photon_output_
 Is this the photon output? More...
 
const bool is_IC_output_
 Is this the IC output? More...
 

Constructor & Destructor Documentation

◆ OutputInterface()

smash::OutputInterface::OutputInterface ( std::string  name)
inlineexplicit

Construct output interface.

Parameters
[in]name(File)name of output.

Definition at line 72 of file outputinterface.h.

73  : is_dilepton_output_(name == "Dileptons"),
74  is_photon_output_(name == "Photons"),
75  is_IC_output_(name == "SMASH_IC") {}

◆ ~OutputInterface()

virtual smash::OutputInterface::~OutputInterface ( )
virtualdefault

Member Function Documentation

◆ at_eventstart()

virtual void smash::OutputInterface::at_eventstart ( const Particles particles,
const int  event_number,
const EventInfo info 
)
pure virtual

Output launched at event start after initialization, when particles are generated but not yet propagated.

Parameters
particlesList of particles.
event_numberNumber of the current event.
[in]infoEvent info, see event_info

Implemented in smash::BinaryOutputParticles, smash::BinaryOutputCollisions, smash::HepMcInterface, smash::RootOutput, smash::OscarOutput< Format, Contents >, smash::ThermodynamicOutput, smash::VtkOutput, smash::BinaryOutputInitialConditions, and smash::ICOutput.

◆ at_eventend()

virtual void smash::OutputInterface::at_eventend ( const Particles particles,
const int  event_number,
const EventInfo info 
)
pure virtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
particlesList of particles.
event_numberNumber of the current event.
[in]infoEvent info, see event_info

Implemented in smash::BinaryOutputInitialConditions, smash::BinaryOutputParticles, smash::RootOutput, smash::ThermodynamicOutput, smash::VtkOutput, smash::OscarOutput< Format, Contents >, and smash::ICOutput.

◆ at_interaction()

virtual void smash::OutputInterface::at_interaction ( const Action action,
const double  density 
)
inlinevirtual

Called whenever an action modified one or more particles.

Parameters
actionThe action object, containing the initial and final state etc.
densityThe density at the interaction point.

Reimplemented in smash::BinaryOutputInitialConditions, smash::ICOutput, smash::BinaryOutputCollisions, smash::RootOutput, smash::HepMcInterface, and smash::OscarOutput< Format, Contents >.

Definition at line 105 of file outputinterface.h.

105  {
106  SMASH_UNUSED(action);
107  SMASH_UNUSED(density);
108  }
Here is the caller graph for this function:

◆ at_intermediate_time()

virtual void smash::OutputInterface::at_intermediate_time ( const Particles particles,
const std::unique_ptr< Clock > &  clock,
const DensityParameters dens_param,
const EventInfo info 
)
inlinevirtual

Output launched after every N'th timestep.

N is controlled by an option.

Parameters
particlesList of particles.
clockSystem clock.
dens_paramParameters for density calculation.
[in]infoEvent info, see event_info

Reimplemented in smash::BinaryOutputParticles, smash::RootOutput, smash::OscarOutput< Format, Contents >, smash::ThermodynamicOutput, smash::VtkOutput, and smash::ICOutput.

Definition at line 117 of file outputinterface.h.

120  {
121  SMASH_UNUSED(particles);
122  SMASH_UNUSED(clock);
123  SMASH_UNUSED(dens_param);
124  SMASH_UNUSED(info);
125  }

◆ thermodynamics_output() [1/3]

virtual void smash::OutputInterface::thermodynamics_output ( const ThermodynamicQuantity  tq,
const DensityType  dt,
RectangularLattice< DensityOnLattice > &  lattice 
)
inlinevirtual

Output to write thermodynamics from the lattice.

Parameters
tqThermodynamic quantity to be written, used for file name etc.
dtType of density, i.e. which particles to take into account.
latticeLattice of tabulated values.

Only used for vtk output. Not connected to ThermodynamicOutput.

Reimplemented in smash::VtkOutput.

Definition at line 135 of file outputinterface.h.

137  {
138  SMASH_UNUSED(tq);
139  SMASH_UNUSED(dt);
140  SMASH_UNUSED(lattice);
141  }

◆ thermodynamics_output() [2/3]

virtual void smash::OutputInterface::thermodynamics_output ( const ThermodynamicQuantity  tq,
const DensityType  dt,
RectangularLattice< EnergyMomentumTensor > &  lattice 
)
inlinevirtual

Output to write energy-momentum tensor and related quantities from the lattice.

Parameters
tqThermodynamic quantity to be written: Tmn, Tmn_Landau, v_Landau
dtType of density, i.e. which particles to take into account.
latticeLattice of tabulated values.

Only used for vtk output. Not connected to ThermodynamicOutput.

Reimplemented in smash::VtkOutput.

Definition at line 152 of file outputinterface.h.

154  {
155  SMASH_UNUSED(tq);
156  SMASH_UNUSED(dt);
157  SMASH_UNUSED(lattice);
158  }

◆ thermodynamics_output() [3/3]

virtual void smash::OutputInterface::thermodynamics_output ( const GrandCanThermalizer gct)
inlinevirtual

Output to write energy-momentum tensor and related quantities from the thermalizer class.

Parameters
gctPointer to thermalizer

Only used for vtk output. Not connected to ThermodynamicOutput.

Reimplemented in smash::VtkOutput.

Definition at line 167 of file outputinterface.h.

167  {
168  SMASH_UNUSED(gct);
169  }

◆ is_dilepton_output()

bool smash::OutputInterface::is_dilepton_output ( ) const
inline

Get, whether this is the dilepton output?

Definition at line 172 of file outputinterface.h.

172 { return is_dilepton_output_; }
Here is the caller graph for this function:

◆ is_photon_output()

bool smash::OutputInterface::is_photon_output ( ) const
inline

Get, whether this is the photon output?

Definition at line 175 of file outputinterface.h.

175 { return is_photon_output_; }

◆ is_IC_output()

bool smash::OutputInterface::is_IC_output ( ) const
inline

Get, whether this is the IC output?

Definition at line 178 of file outputinterface.h.

178 { return is_IC_output_; }

◆ to_string() [1/2]

const char* smash::OutputInterface::to_string ( const ThermodynamicQuantity  tq)
inline

Convert thermodynamic quantities to strings.

Parameters
[in]tqEnum value of the thermodynamic quantity.
Returns
String description of the enumerator.

Definition at line 185 of file outputinterface.h.

185  {
186  switch (tq) {
188  return "rho_eckart";
190  return "tmn";
192  return "tmn_landau";
194  return "v_landau";
196  return "j_QBS";
197  }
198  throw std::invalid_argument("Unknown thermodynamic quantity.");
199  }
Here is the caller graph for this function:

◆ to_string() [2/2]

const char* smash::OutputInterface::to_string ( const DensityType  dens_type)
inline

Convert density types to strings.

Parameters
[in]dens_typeenum value of the density type
Returns
String description of the enumerator.

Definition at line 206 of file outputinterface.h.

206  {
207  switch (dens_type) {
208  case DensityType::Hadron:
209  return "hadron";
210  case DensityType::Baryon:
211  return "net_baryon";
213  return "net_baryonI3";
214  case DensityType::Pion:
215  return "pion";
217  return "tot_isospin3";
218  case DensityType::Charge:
219  return "charge";
221  return "strangeness";
222  case DensityType::None:
223  return "none";
224  }
225  throw std::invalid_argument("Unknown density type.");
226  }

Member Data Documentation

◆ is_dilepton_output_

const bool smash::OutputInterface::is_dilepton_output_
protected

Is this the dilepton output?

Definition at line 230 of file outputinterface.h.

◆ is_photon_output_

const bool smash::OutputInterface::is_photon_output_
protected

Is this the photon output?

Definition at line 233 of file outputinterface.h.

◆ is_IC_output_

const bool smash::OutputInterface::is_IC_output_
protected

Is this the IC output?

Definition at line 236 of file outputinterface.h.


The documentation for this class was generated from the following file:
smash::DensityType::Strangeness
@ Strangeness
ThermodynamicQuantity::TmnLandau
@ TmnLandau
ThermodynamicQuantity::LandauVelocity
@ LandauVelocity
smash::DensityType::BaryonicIsospin
@ BaryonicIsospin
smash::OutputInterface::is_photon_output_
const bool is_photon_output_
Is this the photon output?
Definition: outputinterface.h:233
smash::DensityType::Charge
@ Charge
ThermodynamicQuantity::Tmn
@ Tmn
smash::DensityType::Pion
@ Pion
smash::OutputInterface::is_dilepton_output_
const bool is_dilepton_output_
Is this the dilepton output?
Definition: outputinterface.h:230
ThermodynamicQuantity::EckartDensity
@ EckartDensity
SMASH_UNUSED
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24
smash::DensityType::None
@ None
smash::DensityType::Isospin3_tot
@ Isospin3_tot
ThermodynamicQuantity::j_QBS
@ j_QBS
smash::DensityType::Hadron
@ Hadron
smash::DensityType::Baryon
@ Baryon
smash::OutputInterface::is_IC_output_
const bool is_IC_output_
Is this the IC output?
Definition: outputinterface.h:236