Version: SMASH-2.1
smash::OutputInterface Class Reference

#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 70 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)
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventstart (const std::vector< Particles > &ensembles, int event_number)
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventstart (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type, RectangularLattice< DensityOnLattice > lattice)
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventstart (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type, RectangularLattice< EnergyMomentumTensor > lattice)
 Output launched atevent start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventend (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type)
 Output launched at event end. More...
 
virtual void at_eventend (const ThermodynamicQuantity tq)
 Output launched at event end. More...
 
virtual void at_eventend (const Particles &particles, const int event_number, const EventInfo &info)
 Output launched at event end. More...
 
virtual void at_eventend (const std::vector< Particles > &ensembles, const int event_number)
 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 at_intermediate_time (const std::vector< Particles > &ensembles, const std::unique_ptr< Clock > &clock, const DensityParameters &dens_param)
 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_lattice_output (RectangularLattice< DensityOnLattice > &lattice, const double current_time)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_lattice_output (RectangularLattice< DensityOnLattice > &lattice, const double current_time, const std::vector< Particles > &ensembles, const DensityParameters &dens_param)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_lattice_output (const ThermodynamicQuantity tq, RectangularLattice< EnergyMomentumTensor > &lattice, const double current_time)
 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...
 
virtual void fields_output (const std::string name1, const std::string name2, RectangularLattice< std::pair< ThreeVector, ThreeVector >> &lat)
 Write fields in vtk output. 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 76 of file outputinterface.h.

77  : is_dilepton_output_(name == "Dileptons"),
78  is_photon_output_(name == "Photons"),
79  is_IC_output_(name == "SMASH_IC") {}
const bool is_photon_output_
Is this the photon output?
const bool is_dilepton_output_
Is this the dilepton output?
const bool is_IC_output_
Is this the IC output?

◆ ~OutputInterface()

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

Member Function Documentation

◆ at_eventstart() [1/4]

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

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

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

Definition at line 89 of file outputinterface.h.

90  {
91  SMASH_UNUSED(particles);
92  SMASH_UNUSED(event_number);
93  SMASH_UNUSED(info);
94  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24

◆ at_eventstart() [2/4]

virtual void smash::OutputInterface::at_eventstart ( const std::vector< Particles > &  ensembles,
int  event_number 
)
inlinevirtual

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

Parameters
ensemblesList of particles.
[in]event_numberNumber of the current event.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 101 of file outputinterface.h.

102  {
103  SMASH_UNUSED(ensembles);
104  SMASH_UNUSED(event_number);
105  }

◆ at_eventstart() [3/4]

virtual void smash::OutputInterface::at_eventstart ( const int  event_number,
const ThermodynamicQuantity  tq,
const DensityType  dens_type,
RectangularLattice< DensityOnLattice lattice 
)
inlinevirtual

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

Parameters
[in]event_numberNumber of the current event.
[in]tqThermodynamic quantity to deal with.
[in]dens_typeDensity type for the reference frame.
[in]latticeLattice of tabulated values.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 115 of file outputinterface.h.

118  {
119  SMASH_UNUSED(event_number);
120  SMASH_UNUSED(tq);
121  SMASH_UNUSED(dens_type);
122  SMASH_UNUSED(lattice);
123  }

◆ at_eventstart() [4/4]

virtual void smash::OutputInterface::at_eventstart ( const int  event_number,
const ThermodynamicQuantity  tq,
const DensityType  dens_type,
RectangularLattice< EnergyMomentumTensor lattice 
)
inlinevirtual

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

Parameters
[in]event_numberNumber of the current event.
[in]tqThermodynamic quantity to deal with.
[in]dens_typeDensity type for the reference frame.
[in]latticeLattice of tabulated values.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 133 of file outputinterface.h.

136  {
137  SMASH_UNUSED(event_number);
138  SMASH_UNUSED(tq);
139  SMASH_UNUSED(dens_type);
140  SMASH_UNUSED(lattice);
141  }

◆ at_eventend() [1/4]

virtual void smash::OutputInterface::at_eventend ( const int  event_number,
const ThermodynamicQuantity  tq,
const DensityType  dens_type 
)
inlinevirtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
[in]event_numberNumber of the current event.
[in]tqThermodynamic quantity to deal with
[in]dens_typeDensity type for the evaluation of thermodynamic quantities

Definition at line 151 of file outputinterface.h.

153  {
154  SMASH_UNUSED(event_number);
155  SMASH_UNUSED(tq);
156  SMASH_UNUSED(dens_type);
157  }

◆ at_eventend() [2/4]

virtual void smash::OutputInterface::at_eventend ( const ThermodynamicQuantity  tq)
inlinevirtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
[in]tqThermodynamic quantity to deal with.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 164 of file outputinterface.h.

164 { SMASH_UNUSED(tq); }

◆ at_eventend() [3/4]

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

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

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

Definition at line 173 of file outputinterface.h.

174  {
175  SMASH_UNUSED(particles);
176  SMASH_UNUSED(event_number);
177  SMASH_UNUSED(info);
178  }

◆ at_eventend() [4/4]

virtual void smash::OutputInterface::at_eventend ( const std::vector< Particles > &  ensembles,
const int  event_number 
)
inlinevirtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
ensemblesList of particles.
event_numberNumber of the current event.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 185 of file outputinterface.h.

186  {
187  SMASH_UNUSED(ensembles);
188  SMASH_UNUSED(event_number);
189  }

◆ 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::BinaryOutputCollisions, smash::HepMcInterface, smash::OscarOutput< Format, Contents >, smash::RootOutput, smash::BinaryOutputInitialConditions, and smash::ICOutput.

Definition at line 198 of file outputinterface.h.

198  {
199  SMASH_UNUSED(action);
200  SMASH_UNUSED(density);
201  }
Here is the caller graph for this function:

◆ at_intermediate_time() [1/2]

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::ICOutput, smash::BinaryOutputParticles, smash::OscarOutput< Format, Contents >, smash::RootOutput, and smash::VtkOutput.

Definition at line 210 of file outputinterface.h.

213  {
214  SMASH_UNUSED(particles);
215  SMASH_UNUSED(clock);
216  SMASH_UNUSED(dens_param);
217  SMASH_UNUSED(info);
218  }

◆ at_intermediate_time() [2/2]

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

Output launched after every N'th timestep.

N is controlled by an option.

Parameters
ensemblesList of particles.
clockSystem clock.
dens_paramParameters for density calculation.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 225 of file outputinterface.h.

227  {
228  SMASH_UNUSED(ensembles);
229  SMASH_UNUSED(clock);
230  SMASH_UNUSED(dens_param);
231  }

◆ 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.

Used for vtk output.

Reimplemented in smash::VtkOutput.

Definition at line 241 of file outputinterface.h.

243  {
244  SMASH_UNUSED(tq);
245  SMASH_UNUSED(dt);
246  SMASH_UNUSED(lattice);
247  }

◆ 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.

Used for vtk output.

Reimplemented in smash::VtkOutput.

Definition at line 258 of file outputinterface.h.

260  {
261  SMASH_UNUSED(tq);
262  SMASH_UNUSED(dt);
263  SMASH_UNUSED(lattice);
264  }

◆ thermodynamics_lattice_output() [1/3]

virtual void smash::OutputInterface::thermodynamics_lattice_output ( RectangularLattice< DensityOnLattice > &  lattice,
const double  current_time 
)
inlinevirtual

Output to write thermodynamics from the lattice.

Parameters
[in]latticeLattice type DensityOnLattice of tabulated values.
[in]current_timeTime of the simulation in the computational frame.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 273 of file outputinterface.h.

275  {
276  SMASH_UNUSED(lattice);
277  SMASH_UNUSED(current_time);
278  }

◆ thermodynamics_lattice_output() [2/3]

virtual void smash::OutputInterface::thermodynamics_lattice_output ( RectangularLattice< DensityOnLattice > &  lattice,
const double  current_time,
const std::vector< Particles > &  ensembles,
const DensityParameters dens_param 
)
inlinevirtual

Output to write thermodynamics from the lattice.

Parameters
[in]latticeLattice type FourVector of tabulated values.
[in]current_timeTime of the simulation in the computational frame.
[in]ensemblesParticles, from which the 4-currents j_{Q,B,S} are computed
[in]dens_paramset of parameters, defining smearing. For more info about smearing see ASCII Thermodynamics Output.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 292 of file outputinterface.h.

295  {
296  SMASH_UNUSED(lattice);
297  SMASH_UNUSED(current_time);
298  SMASH_UNUSED(ensembles);
299  SMASH_UNUSED(dens_param);
300  }

◆ thermodynamics_lattice_output() [3/3]

virtual void smash::OutputInterface::thermodynamics_lattice_output ( const ThermodynamicQuantity  tq,
RectangularLattice< EnergyMomentumTensor > &  lattice,
const double  current_time 
)
inlinevirtual

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

Parameters
[in]tqThermodynamic quantity to be written, used for file name etc.
[in]latticeLattice type EnergyMomentumTensor of tabulated values.
[in]current_timeTime of the simulation in the computational frame.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 311 of file outputinterface.h.

314  {
315  SMASH_UNUSED(tq);
316  SMASH_UNUSED(lattice);
317  SMASH_UNUSED(current_time);
318  }

◆ 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 327 of file outputinterface.h.

327  {
328  SMASH_UNUSED(gct);
329  }

◆ fields_output()

virtual void smash::OutputInterface::fields_output ( const std::string  name1,
const std::string  name2,
RectangularLattice< std::pair< ThreeVector, ThreeVector >> &  lat 
)
inlinevirtual

Write fields in vtk output.

Fields are a pair of threevectors for example electric and magnetic field

Parameters
[in]name1Name of the first field
[in]name2Name of the second field
[in]latLattice storing both fields

Reimplemented in smash::VtkOutput.

Definition at line 340 of file outputinterface.h.

342  {
343  SMASH_UNUSED(name1);
344  SMASH_UNUSED(name2);
345  SMASH_UNUSED(lat);
346  }

◆ is_dilepton_output()

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

Get, whether this is the dilepton output?

Definition at line 349 of file outputinterface.h.

349 { 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 352 of file outputinterface.h.

352 { 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 355 of file outputinterface.h.

355 { 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 362 of file outputinterface.h.

362  {
363  switch (tq) {
365  return "rho_eckart";
367  return "tmn";
369  return "tmn_landau";
371  return "v_landau";
373  return "j_QBS";
374  }
375  throw std::invalid_argument("Unknown thermodynamic quantity.");
376  }
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 383 of file outputinterface.h.

383  {
384  switch (dens_type) {
385  case DensityType::Hadron:
386  return "hadron";
387  case DensityType::Baryon:
388  return "net_baryon";
390  return "net_baryonI3";
391  case DensityType::Pion:
392  return "pion";
394  return "tot_isospin3";
395  case DensityType::Charge:
396  return "charge";
398  return "strangeness";
399  case DensityType::None:
400  return "none";
401  }
402  throw std::invalid_argument("Unknown density type.");
403  }

Member Data Documentation

◆ is_dilepton_output_

const bool smash::OutputInterface::is_dilepton_output_
protected

Is this the dilepton output?

Definition at line 407 of file outputinterface.h.

◆ is_photon_output_

const bool smash::OutputInterface::is_photon_output_
protected

Is this the photon output?

Definition at line 410 of file outputinterface.h.

◆ is_IC_output_

const bool smash::OutputInterface::is_IC_output_
protected

Is this the IC output?

Definition at line 413 of file outputinterface.h.


The documentation for this class was generated from the following file: