Version: SMASH-2.0
smash::Experiment< Modus > Class Template Reference

#include <experiment.h>

template<typename Modus>
class smash::Experiment< Modus >

The main class, where the simulation of an experiment is executed.

The Experiment class owns all data (maybe indirectly) relevant for the execution of the experiment simulation. The experiment can be conducted in different running modi. Since the abstraction of these differences should not incur any overhead, the design is built around the Policy pattern.

The Policy pattern was defined by Andrei Alexandrescu in his book "Modern C++ Design: Generic Programming and Design Patterns Applied". Addison-Wesley:

A policy defines a class interface or a class template interface. The interface consists of one or all of the following: inner type definitions, member functions, and member variables.

The policy pattern can also be understood as a compile-time variant of the strategy pattern.

The Modus template parameter defines the "policy" of the Experiment class. It determines several aspects of the experiment execution at compile time. The original strategy pattern would select these differences at run time, thus incurring an overhead. This overhead becomes severe in cases where calls to strategy/policy functions are done very frequently. Using the policy pattern, the compiler can fully optimize: It creates a new instance of all functions in Experiment for all different Modus types.

Definition at line 143 of file experiment.h.

Inheritance diagram for smash::Experiment< Modus >:
[legend]
Collaboration diagram for smash::Experiment< Modus >:
[legend]

Public Member Functions

void run () override
 Runs the experiment. More...
 
 Experiment (Configuration config, const bf::path &output_path)
 Create a new Experiment. More...
 
void initialize_new_event (int event_number)
 This is called in the beginning of each event. More...
 
void run_time_evolution ()
 Runs the time evolution of an event with fixed-sized time steps or without timesteps, from action to actions. More...
 
void do_final_decays ()
 Performs the final decays of an event. More...
 
void final_output (const int evt_num)
 Output at the end of an event. More...
 
Particlesparticles ()
 Provides external access to SMASH particles. More...
 
Modus * modus ()
 Provides external access to SMASH calculation modus. More...
 
- Public Member Functions inherited from smash::ExperimentBase
 ExperimentBase ()=default
 
virtual ~ExperimentBase ()=default
 The virtual destructor avoids undefined behavior when destroying derived objects. More...
 

Private Member Functions

template<typename Container >
bool perform_action (Action &action, const Container &particles_before_actions)
 Perform the given action. More...
 
void create_output (const std::string &format, const std::string &content, const bf::path &output_path, const OutputParameters &par)
 Create a list of output files. More...
 
void propagate_and_shine (double to_time)
 Propagate all particles until time to_time without any interactions and shine dileptons. More...
 
void run_time_evolution_timestepless (Actions &actions)
 Performs all the propagations and actions during a certain time interval neglecting the influence of the potentials. More...
 
void intermediate_output ()
 Intermediate output during an event. More...
 
void update_potentials ()
 Recompute potentials on lattices if necessary. More...
 
double compute_min_cell_length (double dt) const
 Calculate the minimal size for the grid cells such that the ScatterActionsFinder will find all collisions within the maximal transverse distance (which is determined by the maximal cross section). More...
 
double next_output_time () const
 Shortcut for next output time. More...
 

Private Attributes

ExperimentParameters parameters_
 Struct of several member variables. More...
 
DensityParameters density_param_
 Structure to precalculate and hold parameters for density computations. More...
 
Modus modus_
 Instance of the Modus template parameter. More...
 
Particles particles_
 Complete particle list. More...
 
std::unique_ptr< Potentialspotentials_
 An instance of potentials class, that stores parameters of potentials, calculates them and their gradients. More...
 
std::unique_ptr< PauliBlockerpauli_blocker_
 An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and computes phase-space density. More...
 
OutputsList outputs_
 A list of output formaters. More...
 
OutputPtr dilepton_output_
 The Dilepton output. More...
 
OutputPtr photon_output_
 The Photon output. More...
 
std::vector< bool > nucleon_has_interacted_ = {}
 nucleon_has_interacted_ labels whether the particles in the nuclei have experienced any collisions or not. More...
 
bool projectile_target_interact_ = false
 Whether the projectile and the target collided. More...
 
std::vector< FourVectorbeam_momentum_ = {}
 The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen. More...
 
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
 The Action finder objects. More...
 
std::unique_ptr< DecayActionsFinderDileptondilepton_finder_
 The Dilepton Action Finder. More...
 
std::unique_ptr< ActionFinderInterfacephoton_finder_
 The (Scatter) Actions Finder for Direct Photons. More...
 
int n_fractional_photons_
 Number of fractional photons produced per single reaction. More...
 
std::unique_ptr< DensityLatticejmu_B_lat_
 Baryon density on the lattices. More...
 
std::unique_ptr< DensityLatticejmu_I3_lat_
 Isospin projection density on the lattices. More...
 
std::unique_ptr< DensityLatticejmu_custom_lat_
 Custom density on the lattices. More...
 
DensityType dens_type_lattice_printout_ = DensityType::None
 Type of density for lattice printout. More...
 
std::unique_ptr< RectangularLattice< FourVector > > UB_lat_ = nullptr
 Lattices for Skyrme potentials (evaluated in the local rest frame) times the baryon flow 4-velocity. More...
 
std::unique_ptr< RectangularLattice< FourVector > > UI3_lat_ = nullptr
 Lattices for symmetry potentials (evaluated in the local rest frame) times the isospin flow 4-velocity. More...
 
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FB_lat_
 Lattices for the electric and magnetic components of the Skyrme force. More...
 
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FI3_lat_
 Lattices for the electric and magnetic component of the symmetry force. More...
 
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > Tmn_
 Lattices of energy-momentum tensors for printout. More...
 
bool printout_tmn_ = false
 Whether to print the energy-momentum tensor. More...
 
bool printout_tmn_landau_ = false
 Whether to print the energy-momentum tensor in Landau frame. More...
 
bool printout_v_landau_ = false
 Whether to print the 4-velocity in Landau fram. More...
 
bool printout_lattice_td_ = false
 Whether to print the thermodynamics quantities evaluated on the lattices. More...
 
std::unique_ptr< GrandCanThermalizerthermalizer_
 Instance of class used for forced thermalization. More...
 
StringProcessprocess_string_ptr_
 Pointer to the string process class object, which is used to set the random seed for PYTHIA objects in each event. More...
 
const int nevents_
 Number of events. More...
 
const double end_time_
 simulation time at which the evolution is stopped. More...
 
const double delta_time_startup_
 The clock's timestep size at start up. More...
 
const bool force_decays_
 This indicates whether we force all resonances to decay in the last timestep. More...
 
const bool use_grid_
 This indicates whether to use the grid. More...
 
const ExpansionProperties metric_
 This struct contains information on the metric to be used. More...
 
const bool dileptons_switch_
 This indicates whether dileptons are switched on. More...
 
const bool photons_switch_
 This indicates whether photons are switched on. More...
 
const bool bremsstrahlung_switch_
 This indicates whether bremsstrahlung is switched on. More...
 
const bool IC_output_switch_
 This indicates whether the IC output is enabled. More...
 
const TimeStepMode time_step_mode_
 This indicates whether to use time steps. More...
 
double max_transverse_distance_sqr_ = std::numeric_limits<double>::max()
 Maximal distance at which particles can interact, squared. More...
 
QuantumNumbers conserved_initial_
 The conserved quantities of the system. More...
 
double initial_mean_field_energy_
 The initial total mean field energy in the system. More...
 
SystemTimePoint time_start_ = SystemClock::now()
 system starting time of the simulation More...
 
DensityType dens_type_ = DensityType::None
 Type of density to be written to collision headers. More...
 
uint64_t interactions_total_ = 0
 Total number of interactions for current timestep. More...
 
uint64_t previous_interactions_total_ = 0
 Total number of interactions for previous timestep. More...
 
uint64_t wall_actions_total_ = 0
 Total number of wall-crossings for current timestep. More...
 
uint64_t previous_wall_actions_total_ = 0
 Total number of wall-crossings for previous timestep. More...
 
uint64_t total_pauli_blocked_ = 0
 Total number of Pauli-blockings for current timestep. More...
 
uint64_t total_hypersurface_crossing_actions_ = 0
 Total number of particles removed from the evolution in hypersurface crossing actions. More...
 
uint64_t discarded_interactions_total_ = 0
 Total number of discarded interactions, because they were invalidated before they could be performed. More...
 
double total_energy_removed_ = 0.0
 Total energy removed from the system in hypersurface crossing actions. More...
 
int64_t seed_ = -1
 random seed for the next event. More...
 

Friends

class ExperimentBase
 
std::ostream & operator<< (std::ostream &out, const Experiment &e)
 Creates a verbose textual description of the setup of the Experiment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from smash::ExperimentBase
static std::unique_ptr< ExperimentBasecreate (Configuration config, const bf::path &output_path)
 Factory method that creates and initializes a new Experiment<Modus>. More...
 

Constructor & Destructor Documentation

◆ Experiment()

template<typename Modus>
smash::Experiment< Modus >::Experiment ( Configuration  config,
const bf::path &  output_path 
)
explicit

Create a new Experiment.

This constructor is only called from the ExperimentBase::create factory method.

Parameters
[in]configThe Configuration object contains all initial setup of the experiment. It is forwarded to the constructors of member variables as needed. Note that the object is passed by non-const reference. This is only necessary for bookkeeping: Values are not only read, but actually taken out of the object. Thus, all values that remain were not used.
[in]output_pathThe directory where the output files are written.

Member Function Documentation

◆ run()

template<typename Modus >
void smash::Experiment< Modus >::run ( )
overridevirtual

Runs the experiment.

The constructor does the setup of the experiment. The run function executes the complete experiment.

Implements smash::ExperimentBase.

Definition at line 2221 of file experiment.h.

2221  {
2222  const auto &mainlog = logg[LMain];
2223  for (int j = 0; j < nevents_; j++) {
2224  mainlog.info() << "Event " << j;
2225 
2226  // Sample initial particles, start clock, some printout and book-keeping
2228  /* In the ColliderModus, if the first collisions within the same nucleus are
2229  * forbidden, 'nucleon_has_interacted_', which records whether a nucleon has
2230  * collided with another nucleon, is initialized equal to false. If allowed,
2231  * 'nucleon_has_interacted' is initialized equal to true, which means these
2232  * incoming particles have experienced some fake scatterings, they can
2233  * therefore collide with each other later on since these collisions are not
2234  * "first" to them. */
2235  if (modus_.is_collider()) {
2236  if (!modus_.cll_in_nucleus()) {
2237  nucleon_has_interacted_.assign(modus_.total_N_number(), false);
2238  } else {
2239  nucleon_has_interacted_.assign(modus_.total_N_number(), true);
2240  }
2241  }
2242  /* In the ColliderModus, if Fermi motion is frozen, assign the beam momenta
2243  * to the nucleons in both the projectile and the target. */
2244  if (modus_.is_collider() && modus_.fermi_motion() == FermiMotion::Frozen) {
2245  for (int i = 0; i < modus_.total_N_number(); i++) {
2246  const auto mass_beam = particles_.copy_to_vector()[i].effective_mass();
2247  const auto v_beam = i < modus_.proj_N_number()
2248  ? modus_.velocity_projectile()
2249  : modus_.velocity_target();
2250  const auto gamma = 1.0 / std::sqrt(1.0 - v_beam * v_beam);
2251  beam_momentum_.emplace_back(FourVector(gamma * mass_beam, 0.0, 0.0,
2252  gamma * v_beam * mass_beam));
2253  }
2254  }
2255 
2257 
2258  if (force_decays_) {
2259  do_final_decays();
2260  }
2261 
2262  // Output at event end
2263  final_output(j);
2264  }
2265 }

◆ initialize_new_event()

template<typename Modus >
void smash::Experiment< Modus >::initialize_new_event ( int  event_number)

This is called in the beginning of each event.

It initializes particles according to selected modus, resets the clock and saves the initial conserved quantities for subsequent sanity checks.

Definition at line 1451 of file experiment.h.

1451  {
1453  logg[LExperiment].info() << "random number seed: " << seed_;
1454  /* Set seed for the next event. It has to be positive, so it can be entered
1455  * in the config.
1456  *
1457  * We have to be careful about the minimal integer, whose absolute value
1458  * cannot be represented. */
1459  int64_t r = random::advance();
1460  while (r == INT64_MIN) {
1461  r = random::advance();
1462  }
1463  seed_ = std::abs(r);
1464  /* Set the random seed used in PYTHIA hadronization
1465  * to be same with the SMASH one.
1466  * In this way we ensure that the results are reproducible
1467  * for every event if one knows SMASH random seed. */
1468  if (process_string_ptr_ != NULL) {
1470  }
1471 
1472  particles_.reset();
1473 
1474  // Sample particles according to the initial conditions
1475  double start_time = modus_.initial_conditions(&particles_, parameters_);
1476  /* For box modus make sure that particles are in the box. In principle, after
1477  * a correct initialization they should be, so this is just playing it safe.
1478  */
1479  modus_.impose_boundary_conditions(&particles_, outputs_);
1480  // Reset the simulation clock
1481  double timestep = delta_time_startup_;
1482 
1483  switch (time_step_mode_) {
1484  case TimeStepMode::Fixed:
1485  break;
1486  case TimeStepMode::None:
1487  timestep = end_time_ - start_time;
1488  // Take care of the box modus + timestepless propagation
1489  const double max_dt = modus_.max_timestep(max_transverse_distance_sqr_);
1490  if (max_dt > 0. && max_dt < timestep) {
1491  timestep = max_dt;
1492  }
1493  break;
1494  }
1495  std::unique_ptr<UniformClock> clock_for_this_event;
1496  if (modus_.is_list() && (timestep < 0.0)) {
1497  throw std::runtime_error(
1498  "Timestep for the given event is negative. \n"
1499  "This might happen if the formation times of the input particles are "
1500  "larger than the specified end time of the simulation.");
1501  }
1502  clock_for_this_event = make_unique<UniformClock>(start_time, timestep);
1503  parameters_.labclock = std::move(clock_for_this_event);
1504 
1505  // Reset the output clock
1506  parameters_.outputclock->reset(start_time, true);
1507  // remove time before starting time in case of custom output times.
1508  parameters_.outputclock->remove_times_in_past(start_time);
1509 
1510  logg[LExperiment].debug(
1511  "Lab clock: t_start = ", parameters_.labclock->current_time(),
1512  ", dt = ", parameters_.labclock->timestep_duration());
1513 
1514  /* Save the initial conserved quantum numbers and total momentum in
1515  * the system for conservation checks */
1516  conserved_initial_ = QuantumNumbers(particles_);
1517  wall_actions_total_ = 0;
1519  interactions_total_ = 0;
1525  total_energy_removed_ = 0.0;
1526  // Print output headers
1527  logg[LExperiment].info() << hline;
1528  logg[LExperiment].info() << "Time[fm] Ekin[GeV] E_MF[GeV] ETotal[GeV] "
1529  << "ETot/N[GeV] D(ETot/N)[GeV] Scatt&Decays "
1530  << "Particles Comp.Time";
1531  logg[LExperiment].info() << hline;
1532  double E_mean_field = 0.0;
1533  if (potentials_) {
1535  // using the lattice is necessary
1536  if ((jmu_B_lat_ != nullptr)) {
1537  E_mean_field =
1539  }
1540  }
1541  initial_mean_field_energy_ = E_mean_field;
1544  parameters_.labclock->current_time(), E_mean_field,
1546 
1547  auto event_info =
1548  fill_event_info(particles_, E_mean_field, modus_.impact_parameter(),
1550 
1551  // Output at event start
1552  for (const auto &output : outputs_) {
1553  output->at_eventstart(particles_, event_number, event_info);
1554  }
1555 }
Here is the call graph for this function:

◆ run_time_evolution()

template<typename Modus >
void smash::Experiment< Modus >::run_time_evolution ( )

Runs the time evolution of an event with fixed-sized time steps or without timesteps, from action to actions.

Within one timestep (fixed) evolution from action to action is invoked.

Definition at line 1714 of file experiment.h.

1714  {
1715  Actions actions;
1716 
1717  while (parameters_.labclock->current_time() < end_time_) {
1718  const double t = parameters_.labclock->current_time();
1719  const double dt =
1720  std::min(parameters_.labclock->timestep_duration(), end_time_ - t);
1721  logg[LExperiment].debug("Timestepless propagation for next ", dt, " fm/c.");
1722 
1723  // Perform forced thermalization if required
1724  if (thermalizer_ &&
1725  thermalizer_->is_time_to_thermalize(parameters_.labclock)) {
1726  const bool ignore_cells_under_treshold = true;
1727  thermalizer_->update_thermalizer_lattice(particles_, density_param_,
1728  ignore_cells_under_treshold);
1729  const double current_t = parameters_.labclock->current_time();
1730  thermalizer_->thermalize(particles_, current_t,
1732  ThermalizationAction th_act(*thermalizer_, current_t);
1733  if (th_act.any_particles_thermalized()) {
1734  perform_action(th_act, particles_);
1735  }
1736  }
1737 
1738  if (particles_.size() > 0 && action_finders_.size() > 0) {
1739  /* (1.a) Create grid. */
1740  double min_cell_length = compute_min_cell_length(dt);
1741  logg[LExperiment].debug("Creating grid with minimal cell length ",
1742  min_cell_length);
1743  const auto &grid =
1744  use_grid_ ? modus_.create_grid(particles_, min_cell_length, dt)
1745  : modus_.create_grid(particles_, min_cell_length, dt,
1747 
1748  const double gcell_vol = grid.cell_volume();
1749 
1750  /* (1.b) Iterate over cells and find actions. */
1751  grid.iterate_cells(
1752  [&](const ParticleList &search_list) {
1753  for (const auto &finder : action_finders_) {
1754  actions.insert(finder->find_actions_in_cell(
1755  search_list, dt, gcell_vol, beam_momentum_));
1756  }
1757  },
1758  [&](const ParticleList &search_list,
1759  const ParticleList &neighbors_list) {
1760  for (const auto &finder : action_finders_) {
1761  actions.insert(finder->find_actions_with_neighbors(
1762  search_list, neighbors_list, dt, beam_momentum_));
1763  }
1764  });
1765  }
1766 
1767  /* \todo (optimizations) Adapt timestep size here */
1768 
1769  /* (2) Propagation from action to action until the end of timestep */
1771 
1772  /* (3) Update potentials (if computed on the lattice) and
1773  * compute new momenta according to equations of motion */
1774  if (potentials_) {
1776  update_momenta(&particles_, parameters_.labclock->timestep_duration(),
1777  *potentials_, FB_lat_.get(), FI3_lat_.get());
1778  }
1779 
1780  /* (4) Expand universe if non-minkowskian metric; updates
1781  * positions and momenta according to the selected expansion */
1784  }
1785 
1786  ++(*parameters_.labclock);
1787 
1788  /* (5) Check conservation laws.
1789  *
1790  * Check conservation of conserved quantities if potentials and string
1791  * fragmentation are off. If potentials are on then momentum is conserved
1792  * only in average. If string fragmentation is on, then energy and
1793  * momentum are only very roughly conserved in high-energy collisions. */
1796  std::string err_msg = conserved_initial_.report_deviations(particles_);
1797  if (!err_msg.empty()) {
1798  logg[LExperiment].error() << err_msg;
1799  throw std::runtime_error("Violation of conserved quantities!");
1800  }
1801  }
1802  }
1803 
1804  if (pauli_blocker_) {
1805  logg[LExperiment].info(
1806  "Interactions: Pauli-blocked/performed = ", total_pauli_blocked_, "/",
1808  }
1809 }
Here is the call graph for this function:

◆ do_final_decays()

template<typename Modus >
void smash::Experiment< Modus >::do_final_decays ( )

Performs the final decays of an event.

Definition at line 2085 of file experiment.h.

2085  {
2086  /* At end of time evolution: Force all resonances to decay. In order to handle
2087  * decay chains, we need to loop until no further actions occur. */
2088  uint64_t interactions_old;
2089  const auto particles_before_actions = particles_.copy_to_vector();
2090  do {
2091  Actions actions;
2092 
2093  interactions_old = interactions_total_;
2094 
2095  // Dileptons: shining of remaining resonances
2096  if (dilepton_finder_ != nullptr) {
2097  for (const auto &output : outputs_) {
2098  dilepton_finder_->shine_final(particles_, output.get(), true);
2099  }
2100  }
2101  // Find actions.
2102  for (const auto &finder : action_finders_) {
2103  actions.insert(finder->find_final_actions(particles_));
2104  }
2105  // Perform actions.
2106  while (!actions.is_empty()) {
2107  perform_action(*actions.pop(), particles_before_actions);
2108  }
2109  // loop until no more decays occur
2110  } while (interactions_total_ > interactions_old);
2111 
2112  // Dileptons: shining of stable particles at the end
2113  if (dilepton_finder_ != nullptr) {
2114  for (const auto &output : outputs_) {
2115  dilepton_finder_->shine_final(particles_, output.get(), false);
2116  }
2117  }
2118 }
Here is the call graph for this function:

◆ final_output()

template<typename Modus >
void smash::Experiment< Modus >::final_output ( const int  evt_num)

Output at the end of an event.

Parameters
[in]evt_numNumber of the event

Definition at line 2121 of file experiment.h.

2121  {
2122  /* make sure the experiment actually ran (note: we should compare this
2123  * to the start time, but we don't know that. Therefore, we check that
2124  * the time is positive, which should heuristically be the same). */
2125  double E_mean_field = 0.0;
2126  if (likely(parameters_.labclock > 0)) {
2127  const uint64_t wall_actions_this_interval =
2129  const uint64_t interactions_this_interval = interactions_total_ -
2131  wall_actions_this_interval;
2132  if (potentials_) {
2133  // using the lattice is necessary
2134  if ((jmu_B_lat_ != nullptr)) {
2135  E_mean_field =
2137  }
2138  }
2140  particles_, interactions_this_interval, conserved_initial_, time_start_,
2141  end_time_, E_mean_field, initial_mean_field_energy_);
2142  if (IC_output_switch_ && (particles_.size() == 0)) {
2143  // Verify there is no more energy in the system if all particles were
2144  // removed when crossing the hypersurface
2145  const double remaining_energy =
2147  if (remaining_energy > really_small) {
2148  throw std::runtime_error(
2149  "There is remaining energy in the system although all particles "
2150  "were removed.\n"
2151  "E_remain = " +
2152  std::to_string(remaining_energy) + " [GeV]");
2153  } else {
2154  logg[LExperiment].info() << hline;
2155  logg[LExperiment].info()
2156  << "Time real: " << SystemClock::now() - time_start_;
2157  logg[LExperiment].info()
2158  << "Interactions before reaching hypersurface: "
2161  logg[LExperiment].info()
2162  << "Total number of particles removed on hypersurface: "
2164  }
2165  } else {
2166  const double precent_discarded =
2168  ? static_cast<double>(discarded_interactions_total_) * 100.0 /
2170  : 0.0;
2171  std::stringstream msg_discarded;
2172  msg_discarded
2173  << "Discarded interaction number: " << discarded_interactions_total_
2174  << " (" << precent_discarded
2175  << "% of the total interaction number including wall crossings)";
2176 
2177  logg[LExperiment].info() << hline;
2178  logg[LExperiment].info()
2179  << "Time real: " << SystemClock::now() - time_start_;
2180  logg[LExperiment].debug() << msg_discarded.str();
2181 
2183  precent_discarded > 1.0) {
2184  // The choosen threshold of 1% is a heuristical value
2185  logg[LExperiment].warn()
2186  << msg_discarded.str()
2187  << "\nThe number of discarded interactions is large, which means "
2188  "the assumption for the stochastic criterion of\n1 interaction"
2189  "per particle per timestep is probably violated. Consider "
2190  "reducing the timestep size.";
2191  }
2192 
2193  logg[LExperiment].info() << "Final interaction number: "
2195  }
2196 
2197  // Check if there are unformed particles
2198  int unformed_particles_count = 0;
2199  for (const auto &particle : particles_) {
2200  if (particle.formation_time() > end_time_) {
2201  unformed_particles_count++;
2202  }
2203  }
2204  if (unformed_particles_count > 0) {
2205  logg[LExperiment].warn(
2206  "End time might be too small. ", unformed_particles_count,
2207  " unformed particles were found at the end of the evolution.");
2208  }
2209  }
2210 
2211  auto event_info =
2212  fill_event_info(particles_, E_mean_field, modus_.impact_parameter(),
2214 
2215  for (const auto &output : outputs_) {
2216  output->at_eventend(particles_, evt_num, event_info);
2217  }
2218 }
Here is the call graph for this function:

◆ particles()

template<typename Modus>
Particles* smash::Experiment< Modus >::particles ( )
inline

Provides external access to SMASH particles.

This is helpful if SMASH is used as a 3rd-party library.

Definition at line 228 of file experiment.h.

228 { return &particles_; }

◆ modus()

template<typename Modus>
Modus* smash::Experiment< Modus >::modus ( )
inline

Provides external access to SMASH calculation modus.

This is helpful if SMASH is used as a 3rd-party library.

Definition at line 234 of file experiment.h.

234 { return &modus_; }

◆ perform_action()

template<typename Modus>
template<typename Container >
bool smash::Experiment< Modus >::perform_action ( Action action,
const Container &  particles_before_actions 
)
private

Perform the given action.

Template Parameters
Containertype that holds the particles before the action.
Parameters
[in]actionThe action to perform. If it performs, it'll modify the private member particles_.
[in]particles_before_actionsA container with the ParticleData from this time step before any actions were performed.
Returns
False if the action is rejected either due to invalidity or Pauli-blocking, or true if it's accepted and performed.

◆ create_output()

template<typename Modus >
void smash::Experiment< Modus >::create_output ( const std::string &  format,
const std::string &  content,
const bf::path &  output_path,
const OutputParameters par 
)
private

Create a list of output files.

Parameters
[in]formatFormat of the output file (e.g. Root, Oscar, Vtk)
[in]contentContent of the output (e.g. particles, collisions)
[in]output_pathPath of the output file
[in]parOutput options.(e.g. Extended)

Definition at line 587 of file experiment.h.

590  {
591  logg[LExperiment].info() << "Adding output " << content << " of format "
592  << format << std::endl;
593 
594  if (format == "VTK" && content == "Particles") {
595  outputs_.emplace_back(
596  make_unique<VtkOutput>(output_path, content, out_par));
597  } else if (format == "Root") {
598 #ifdef SMASH_USE_ROOT
599  if (content == "Initial_Conditions") {
600  outputs_.emplace_back(
601  make_unique<RootOutput>(output_path, "SMASH_IC", out_par));
602  } else {
603  outputs_.emplace_back(
604  make_unique<RootOutput>(output_path, content, out_par));
605  }
606 #else
607  logg[LExperiment].error(
608  "Root output requested, but Root support not compiled in");
609 #endif
610  } else if (format == "Binary") {
611  if (content == "Collisions" || content == "Dileptons" ||
612  content == "Photons") {
613  outputs_.emplace_back(
614  make_unique<BinaryOutputCollisions>(output_path, content, out_par));
615  } else if (content == "Particles") {
616  outputs_.emplace_back(
617  make_unique<BinaryOutputParticles>(output_path, content, out_par));
618  } else if (content == "Initial_Conditions") {
619  outputs_.emplace_back(make_unique<BinaryOutputInitialConditions>(
620  output_path, content, out_par));
621  }
622  } else if (format == "Oscar1999" || format == "Oscar2013") {
623  outputs_.emplace_back(
624  create_oscar_output(format, content, output_path, out_par));
625  } else if (content == "Thermodynamics" && format == "ASCII") {
626  outputs_.emplace_back(
627  make_unique<ThermodynamicOutput>(output_path, content, out_par));
628  } else if (content == "Thermodynamics" && format == "VTK") {
629  printout_lattice_td_ = true;
630  outputs_.emplace_back(
631  make_unique<VtkOutput>(output_path, content, out_par));
632  } else if (content == "Initial_Conditions" && format == "ASCII") {
633  outputs_.emplace_back(
634  make_unique<ICOutput>(output_path, "SMASH_IC", out_par));
635  } else if (content == "HepMC" && format == "ASCII") {
636 #ifdef SMASH_USE_HEPMC
637  outputs_.emplace_back(make_unique<HepMcOutput>(
638  output_path, "SMASH_HepMC", out_par, modus_.total_N_number(),
639  modus_.proj_N_number()));
640 #else
641  logg[LExperiment].error(
642  "HepMC output requested, but HepMC support not compiled in");
643 #endif
644  } else {
645  logg[LExperiment].error()
646  << "Unknown combination of format (" << format << ") and content ("
647  << content << "). Fix the config.";
648  }
649 }
Here is the call graph for this function:

◆ propagate_and_shine()

template<typename Modus >
void smash::Experiment< Modus >::propagate_and_shine ( double  to_time)
private

Propagate all particles until time to_time without any interactions and shine dileptons.

Parameters
[in]to_timeTime at the end of propagation [fm/c]

Definition at line 1812 of file experiment.h.

1812  {
1813  const double dt =
1815  if (dilepton_finder_ != nullptr) {
1816  for (const auto &output : outputs_) {
1817  dilepton_finder_->shine(particles_, output.get(), dt);
1818  }
1819  }
1820 }
Here is the call graph for this function:

◆ run_time_evolution_timestepless()

template<typename Modus >
void smash::Experiment< Modus >::run_time_evolution_timestepless ( Actions actions)
private

Performs all the propagations and actions during a certain time interval neglecting the influence of the potentials.

This function is called in either the time stepless cases or the cases with time steps. In a time stepless case, the time interval should be equal to the whole evolution time, while in the case with time step, the intervals are given by the time steps.

Parameters
[in,out]actionsActions occur during a certain time interval. They provide the ending times of the propagations and are updated during the time interval.

Definition at line 1837 of file experiment.h.

1837  {
1838  const double start_time = parameters_.labclock->current_time();
1839  const double end_time =
1840  std::min(parameters_.labclock->next_time(), end_time_);
1841  double time_left = end_time - start_time;
1842  logg[LExperiment].debug(
1843  "Timestepless propagation: ", "Actions size = ", actions.size(),
1844  ", start time = ", start_time, ", end time = ", end_time);
1845 
1846  // iterate over all actions
1847  while (!actions.is_empty()) {
1848  // get next action
1849  ActionPtr act = actions.pop();
1850  if (!act->is_valid(particles_)) {
1852  logg[LExperiment].debug(~einhard::DRed(), "✘ ", act,
1853  " (discarded: invalid)");
1854  continue;
1855  }
1856  if (act->time_of_execution() > end_time) {
1857  logg[LExperiment].error(
1858  act, " scheduled later than end time: t_action[fm/c] = ",
1859  act->time_of_execution(), ", t_end[fm/c] = ", end_time);
1860  }
1861  logg[LExperiment].debug(~einhard::Green(), "✔ ", act);
1862 
1863  while (next_output_time() <= act->time_of_execution()) {
1864  logg[LExperiment].debug("Propagating until output time: ",
1865  next_output_time());
1867  ++(*parameters_.outputclock);
1869  }
1870 
1871  /* (1) Propagate to the next action. */
1872  logg[LExperiment].debug("Propagating until next action ", act,
1873  ", action time = ", act->time_of_execution());
1874  propagate_and_shine(act->time_of_execution());
1875 
1876  /* (2) Perform action.
1877  *
1878  * Update the positions of the incoming particles, because the information
1879  * in the action object will be outdated as the particles have been
1880  * propagated since the construction of the action. */
1881  act->update_incoming(particles_);
1882  const bool performed = perform_action(*act, particles_);
1883 
1884  /* No need to update actions for outgoing particles
1885  * if the action is not performed. */
1886  if (!performed) {
1887  continue;
1888  }
1889 
1890  /* (3) Update actions for newly-produced particles. */
1891 
1892  time_left = end_time - act->time_of_execution();
1893  const ParticleList &outgoing_particles = act->outgoing_particles();
1894  // Grid cell volume set to zero, since there is no grid
1895  const double gcell_vol = 0.0;
1896  for (const auto &finder : action_finders_) {
1897  // Outgoing particles can still decay, cross walls...
1898  actions.insert(finder->find_actions_in_cell(outgoing_particles, time_left,
1899  gcell_vol, beam_momentum_));
1900  // ... and collide with other particles.
1901  actions.insert(finder->find_actions_with_surrounding_particles(
1902  outgoing_particles, particles_, time_left, beam_momentum_));
1903  }
1904 
1906  }
1907 
1908  while (next_output_time() <= end_time) {
1909  logg[LExperiment].debug("Propagating until output time: ",
1910  next_output_time());
1912  ++(*parameters_.outputclock);
1913  // Avoid duplicating printout at event end time
1914  if (parameters_.outputclock->current_time() < end_time_) {
1916  }
1917  }
1918  logg[LExperiment].debug("Propagating to time ", end_time);
1919  propagate_and_shine(end_time);
1920 }
Here is the call graph for this function:

◆ intermediate_output()

template<typename Modus >
void smash::Experiment< Modus >::intermediate_output ( )
private

Intermediate output during an event.

Definition at line 1923 of file experiment.h.

1923  {
1924  const uint64_t wall_actions_this_interval =
1927  const uint64_t interactions_this_interval = interactions_total_ -
1929  wall_actions_this_interval;
1931  double E_mean_field = 0.0;
1932  if (potentials_) {
1933  // using the lattice is necessary
1934  if ((jmu_B_lat_ != nullptr)) {
1935  E_mean_field =
1937  /*
1938  * Mean field calculated in a box should remain approximately constant if
1939  * the system is in equilibrium, and so deviations from its original value
1940  * may signal a phase transition or other dynamical process. This
1941  * comparison only makes sense in the Box Modus, hence the condition.
1942  */
1943  if (modus_.is_box()) {
1944  double tmp = (E_mean_field - initial_mean_field_energy_) /
1945  (E_mean_field + initial_mean_field_energy_);
1946  /*
1947  * This is displayed when the system evolves away from its initial
1948  * configuration (which is when the total mean field energy in the box
1949  * deviates from its initial value).
1950  */
1951  if (std::abs(tmp) > 0.01) {
1952  logg[LExperiment].info()
1953  << "\n\n\n\t The mean field at t = "
1954  << parameters_.outputclock->current_time()
1955  << " [fm/c] differs from the mean field at t = 0:"
1956  << "\n\t\t initial_mean_field_energy_ = "
1957  << initial_mean_field_energy_ << " [GeV]"
1958  << "\n\t\t abs[(E_MF - E_MF(t=0))/(E_MF + E_MF(t=0))] = "
1959  << std::abs(tmp)
1960  << "\n\t\t E_MF/E_MF(t=0) = "
1961  << E_mean_field / initial_mean_field_energy_ << "\n\n";
1962  }
1963  }
1964  }
1965  }
1966 
1968  particles_, interactions_this_interval, conserved_initial_, time_start_,
1969  parameters_.outputclock->current_time(), E_mean_field,
1971  const LatticeUpdate lat_upd = LatticeUpdate::AtOutput;
1972 
1973  auto event_info =
1974  fill_event_info(particles_, E_mean_field, modus_.impact_parameter(),
1976  // save evolution data
1977  if (!(modus_.is_box() && parameters_.outputclock->current_time() <
1978  modus_.equilibration_time())) {
1979  for (const auto &output : outputs_) {
1980  if (output->is_dilepton_output() || output->is_photon_output() ||
1981  output->is_IC_output()) {
1982  continue;
1983  }
1984 
1985  output->at_intermediate_time(particles_, parameters_.outputclock,
1986  density_param_, event_info);
1987 
1988  // Thermodynamic output on the lattice versus time
1989  switch (dens_type_lattice_printout_) {
1990  case DensityType::Baryon:
1992  density_param_, particles_, false);
1993  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
1995  break;
1997  update_lattice(jmu_I3_lat_.get(), lat_upd,
1999  particles_, false);
2000  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2002  *jmu_I3_lat_);
2003  break;
2004  case DensityType::None:
2005  break;
2006  default:
2007  update_lattice(jmu_custom_lat_.get(), lat_upd,
2009  particles_, false);
2010  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2012  *jmu_custom_lat_);
2013  }
2017  if (printout_tmn_) {
2018  output->thermodynamics_output(ThermodynamicQuantity::Tmn,
2020  }
2021  if (printout_tmn_landau_) {
2022  output->thermodynamics_output(ThermodynamicQuantity::TmnLandau,
2024  }
2025  if (printout_v_landau_) {
2026  output->thermodynamics_output(ThermodynamicQuantity::LandauVelocity,
2028  }
2029  }
2030 
2031  if (thermalizer_) {
2032  output->thermodynamics_output(*thermalizer_);
2033  }
2034  }
2035  }
2036 }
Here is the call graph for this function:

◆ update_potentials()

template<typename Modus >
void smash::Experiment< Modus >::update_potentials ( )
private

Recompute potentials on lattices if necessary.

Definition at line 2039 of file experiment.h.

2039  {
2040  if (potentials_) {
2041  if (potentials_->use_symmetry() && jmu_I3_lat_ != nullptr) {
2044  true);
2045  }
2046  if ((potentials_->use_skyrme() || potentials_->use_symmetry()) &&
2047  jmu_B_lat_ != nullptr) {
2050  const size_t UBlattice_size = UB_lat_->size();
2051  for (size_t i = 0; i < UBlattice_size; i++) {
2052  auto jB = (*jmu_B_lat_)[i];
2053  const FourVector flow_four_velocity_B =
2054  std::abs(jB.density()) > really_small ? jB.jmu_net() / jB.density()
2055  : FourVector();
2056  double baryon_density = jB.density();
2057  ThreeVector baryon_grad_rho = jB.grad_rho();
2058  ThreeVector baryon_dj_dt = jB.dj_dt();
2059  ThreeVector baryon_rot_j = jB.rot_j();
2060  if (potentials_->use_skyrme()) {
2061  (*UB_lat_)[i] =
2062  flow_four_velocity_B * potentials_->skyrme_pot(baryon_density);
2063  (*FB_lat_)[i] = potentials_->skyrme_force(
2064  baryon_density, baryon_grad_rho, baryon_dj_dt, baryon_rot_j);
2065  }
2066  if (potentials_->use_symmetry() && jmu_I3_lat_ != nullptr) {
2067  auto jI3 = (*jmu_I3_lat_)[i];
2068  const FourVector flow_four_velocity_I3 =
2069  std::abs(jI3.density()) > really_small
2070  ? jI3.jmu_net() / jI3.density()
2071  : FourVector();
2072  (*UI3_lat_)[i] =
2073  flow_four_velocity_I3 *
2074  potentials_->symmetry_pot(jI3.density(), baryon_density);
2075  (*FI3_lat_)[i] = potentials_->symmetry_force(
2076  jI3.density(), jI3.grad_rho(), jI3.dj_dt(), jI3.rot_j(),
2077  baryon_density, baryon_grad_rho, baryon_dj_dt, baryon_rot_j);
2078  }
2079  }
2080  }
2081  }
2082 }
Here is the call graph for this function:

◆ compute_min_cell_length()

template<typename Modus>
double smash::Experiment< Modus >::compute_min_cell_length ( double  dt) const
inlineprivate

Calculate the minimal size for the grid cells such that the ScatterActionsFinder will find all collisions within the maximal transverse distance (which is determined by the maximal cross section).

Parameters
[in]dtThe current time step size [fm/c]
Returns
The minimal required size of cells

Definition at line 298 of file experiment.h.

298  {
299  return std::sqrt(4 * dt * dt + max_transverse_distance_sqr_);
300  }

◆ next_output_time()

template<typename Modus>
double smash::Experiment< Modus >::next_output_time ( ) const
inlineprivate

Shortcut for next output time.

Definition at line 303 of file experiment.h.

303  {
304  return parameters_.outputclock->next_time();
305  }

Friends And Related Function Documentation

◆ ExperimentBase

template<typename Modus>
friend class ExperimentBase
friend

Definition at line 173 of file experiment.h.

Member Data Documentation

◆ parameters_

template<typename Modus>
ExperimentParameters smash::Experiment< Modus >::parameters_
private

Struct of several member variables.

These variables are combined into a struct for efficient input to functions outside of this class.

Definition at line 312 of file experiment.h.

◆ density_param_

template<typename Modus>
DensityParameters smash::Experiment< Modus >::density_param_
private

Structure to precalculate and hold parameters for density computations.

Definition at line 315 of file experiment.h.

◆ modus_

template<typename Modus>
Modus smash::Experiment< Modus >::modus_
private

Instance of the Modus template parameter.

May store modus-specific data and contains modus-specific function implementations.

Definition at line 321 of file experiment.h.

◆ particles_

template<typename Modus>
Particles smash::Experiment< Modus >::particles_
private

Complete particle list.

Definition at line 324 of file experiment.h.

◆ potentials_

template<typename Modus>
std::unique_ptr<Potentials> smash::Experiment< Modus >::potentials_
private

An instance of potentials class, that stores parameters of potentials, calculates them and their gradients.

Definition at line 330 of file experiment.h.

◆ pauli_blocker_

template<typename Modus>
std::unique_ptr<PauliBlocker> smash::Experiment< Modus >::pauli_blocker_
private

An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and computes phase-space density.

Definition at line 336 of file experiment.h.

◆ outputs_

template<typename Modus>
OutputsList smash::Experiment< Modus >::outputs_
private

A list of output formaters.

They will be called to write the state of the particles to file.

Definition at line 342 of file experiment.h.

◆ dilepton_output_

template<typename Modus>
OutputPtr smash::Experiment< Modus >::dilepton_output_
private

The Dilepton output.

Definition at line 345 of file experiment.h.

◆ photon_output_

template<typename Modus>
OutputPtr smash::Experiment< Modus >::photon_output_
private

The Photon output.

Definition at line 348 of file experiment.h.

◆ nucleon_has_interacted_

template<typename Modus>
std::vector<bool> smash::Experiment< Modus >::nucleon_has_interacted_ = {}
private

nucleon_has_interacted_ labels whether the particles in the nuclei have experienced any collisions or not.

It's only valid in the ColliderModus, so is set as an empty vector by default.

Definition at line 355 of file experiment.h.

◆ projectile_target_interact_

template<typename Modus>
bool smash::Experiment< Modus >::projectile_target_interact_ = false
private

Whether the projectile and the target collided.

Definition at line 359 of file experiment.h.

◆ beam_momentum_

template<typename Modus>
std::vector<FourVector> smash::Experiment< Modus >::beam_momentum_ = {}
private

The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen.

It's only valid in the ColliderModus, so is set as an empty vector by default.

Definition at line 366 of file experiment.h.

◆ action_finders_

template<typename Modus>
std::vector<std::unique_ptr<ActionFinderInterface> > smash::Experiment< Modus >::action_finders_
private

The Action finder objects.

Definition at line 369 of file experiment.h.

◆ dilepton_finder_

template<typename Modus>
std::unique_ptr<DecayActionsFinderDilepton> smash::Experiment< Modus >::dilepton_finder_
private

The Dilepton Action Finder.

Definition at line 372 of file experiment.h.

◆ photon_finder_

template<typename Modus>
std::unique_ptr<ActionFinderInterface> smash::Experiment< Modus >::photon_finder_
private

The (Scatter) Actions Finder for Direct Photons.

Definition at line 375 of file experiment.h.

◆ n_fractional_photons_

template<typename Modus>
int smash::Experiment< Modus >::n_fractional_photons_
private

Number of fractional photons produced per single reaction.

Definition at line 378 of file experiment.h.

◆ jmu_B_lat_

template<typename Modus>
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::jmu_B_lat_
private

Baryon density on the lattices.

Definition at line 381 of file experiment.h.

◆ jmu_I3_lat_

template<typename Modus>
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::jmu_I3_lat_
private

Isospin projection density on the lattices.

Definition at line 384 of file experiment.h.

◆ jmu_custom_lat_

template<typename Modus>
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::jmu_custom_lat_
private

Custom density on the lattices.

In the config user asks for some kind of density for printout. Baryon and isospin projection density are anyway needed for potentials. If user asks for some other density type for printout, it will be handled using jmu_custom variable.

Definition at line 393 of file experiment.h.

◆ dens_type_lattice_printout_

template<typename Modus>
DensityType smash::Experiment< Modus >::dens_type_lattice_printout_ = DensityType::None
private

Type of density for lattice printout.

Definition at line 396 of file experiment.h.

◆ UB_lat_

template<typename Modus>
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::UB_lat_ = nullptr
private

Lattices for Skyrme potentials (evaluated in the local rest frame) times the baryon flow 4-velocity.

Definition at line 402 of file experiment.h.

◆ UI3_lat_

template<typename Modus>
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::UI3_lat_ = nullptr
private

Lattices for symmetry potentials (evaluated in the local rest frame) times the isospin flow 4-velocity.

Definition at line 408 of file experiment.h.

◆ FB_lat_

template<typename Modus>
std::unique_ptr<RectangularLattice<std::pair<ThreeVector, ThreeVector> > > smash::Experiment< Modus >::FB_lat_
private

Lattices for the electric and magnetic components of the Skyrme force.

Definition at line 412 of file experiment.h.

◆ FI3_lat_

template<typename Modus>
std::unique_ptr<RectangularLattice<std::pair<ThreeVector, ThreeVector> > > smash::Experiment< Modus >::FI3_lat_
private

Lattices for the electric and magnetic component of the symmetry force.

Definition at line 416 of file experiment.h.

◆ Tmn_

template<typename Modus>
std::unique_ptr<RectangularLattice<EnergyMomentumTensor> > smash::Experiment< Modus >::Tmn_
private

Lattices of energy-momentum tensors for printout.

Definition at line 419 of file experiment.h.

◆ printout_tmn_

template<typename Modus>
bool smash::Experiment< Modus >::printout_tmn_ = false
private

Whether to print the energy-momentum tensor.

Definition at line 422 of file experiment.h.

◆ printout_tmn_landau_

template<typename Modus>
bool smash::Experiment< Modus >::printout_tmn_landau_ = false
private

Whether to print the energy-momentum tensor in Landau frame.

Definition at line 425 of file experiment.h.

◆ printout_v_landau_

template<typename Modus>
bool smash::Experiment< Modus >::printout_v_landau_ = false
private

Whether to print the 4-velocity in Landau fram.

Definition at line 428 of file experiment.h.

◆ printout_lattice_td_

template<typename Modus>
bool smash::Experiment< Modus >::printout_lattice_td_ = false
private

Whether to print the thermodynamics quantities evaluated on the lattices.

Definition at line 431 of file experiment.h.

◆ thermalizer_

template<typename Modus>
std::unique_ptr<GrandCanThermalizer> smash::Experiment< Modus >::thermalizer_
private

Instance of class used for forced thermalization.

Definition at line 434 of file experiment.h.

◆ process_string_ptr_

template<typename Modus>
StringProcess* smash::Experiment< Modus >::process_string_ptr_
private

Pointer to the string process class object, which is used to set the random seed for PYTHIA objects in each event.

Definition at line 440 of file experiment.h.

◆ nevents_

template<typename Modus>
const int smash::Experiment< Modus >::nevents_
private

Number of events.

Event is a single simulation of a physical phenomenon: elementary particle or nucleus-nucleus collision. Result of a single SMASH event is random (by construction) as well as result of one collision in nature. To compare simulation with experiment one has to take ensemble averages, i.e. perform simulation and real experiment many times and compare average results.

nevents_ is number of times single phenomenon (particle or nucleus-nucleus collision) will be simulated.

Definition at line 456 of file experiment.h.

◆ end_time_

template<typename Modus>
const double smash::Experiment< Modus >::end_time_
private

simulation time at which the evolution is stopped.

Definition at line 459 of file experiment.h.

◆ delta_time_startup_

template<typename Modus>
const double smash::Experiment< Modus >::delta_time_startup_
private

The clock's timestep size at start up.

Stored here so that the next event will remember this.

Definition at line 466 of file experiment.h.

◆ force_decays_

template<typename Modus>
const bool smash::Experiment< Modus >::force_decays_
private

This indicates whether we force all resonances to decay in the last timestep.

Definition at line 472 of file experiment.h.

◆ use_grid_

template<typename Modus>
const bool smash::Experiment< Modus >::use_grid_
private

This indicates whether to use the grid.

Definition at line 475 of file experiment.h.

◆ metric_

template<typename Modus>
const ExpansionProperties smash::Experiment< Modus >::metric_
private

This struct contains information on the metric to be used.

Definition at line 478 of file experiment.h.

◆ dileptons_switch_

template<typename Modus>
const bool smash::Experiment< Modus >::dileptons_switch_
private

This indicates whether dileptons are switched on.

Definition at line 481 of file experiment.h.

◆ photons_switch_

template<typename Modus>
const bool smash::Experiment< Modus >::photons_switch_
private

This indicates whether photons are switched on.

Definition at line 484 of file experiment.h.

◆ bremsstrahlung_switch_

template<typename Modus>
const bool smash::Experiment< Modus >::bremsstrahlung_switch_
private

This indicates whether bremsstrahlung is switched on.

Definition at line 487 of file experiment.h.

◆ IC_output_switch_

template<typename Modus>
const bool smash::Experiment< Modus >::IC_output_switch_
private

This indicates whether the IC output is enabled.

Definition at line 490 of file experiment.h.

◆ time_step_mode_

template<typename Modus>
const TimeStepMode smash::Experiment< Modus >::time_step_mode_
private

This indicates whether to use time steps.

Definition at line 493 of file experiment.h.

◆ max_transverse_distance_sqr_

template<typename Modus>
double smash::Experiment< Modus >::max_transverse_distance_sqr_ = std::numeric_limits<double>::max()
private

Maximal distance at which particles can interact, squared.

Definition at line 496 of file experiment.h.

◆ conserved_initial_

template<typename Modus>
QuantumNumbers smash::Experiment< Modus >::conserved_initial_
private

The conserved quantities of the system.

This struct carries the sums of the single particle's various quantities as measured at the beginning of the evolution and can be used to regularly check if they are still good.

Definition at line 505 of file experiment.h.

◆ initial_mean_field_energy_

template<typename Modus>
double smash::Experiment< Modus >::initial_mean_field_energy_
private

The initial total mean field energy in the system.

Note: will only be calculated if lattice is on.

Definition at line 511 of file experiment.h.

◆ time_start_

template<typename Modus>
SystemTimePoint smash::Experiment< Modus >::time_start_ = SystemClock::now()
private

system starting time of the simulation

Definition at line 514 of file experiment.h.

◆ dens_type_

template<typename Modus>
DensityType smash::Experiment< Modus >::dens_type_ = DensityType::None
private

Type of density to be written to collision headers.

Definition at line 517 of file experiment.h.

◆ interactions_total_

template<typename Modus>
uint64_t smash::Experiment< Modus >::interactions_total_ = 0
private

Total number of interactions for current timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 523 of file experiment.h.

◆ previous_interactions_total_

template<typename Modus>
uint64_t smash::Experiment< Modus >::previous_interactions_total_ = 0
private

Total number of interactions for previous timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 529 of file experiment.h.

◆ wall_actions_total_

template<typename Modus>
uint64_t smash::Experiment< Modus >::wall_actions_total_ = 0
private

Total number of wall-crossings for current timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 535 of file experiment.h.

◆ previous_wall_actions_total_

template<typename Modus>
uint64_t smash::Experiment< Modus >::previous_wall_actions_total_ = 0
private

Total number of wall-crossings for previous timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 541 of file experiment.h.

◆ total_pauli_blocked_

template<typename Modus>
uint64_t smash::Experiment< Modus >::total_pauli_blocked_ = 0
private

Total number of Pauli-blockings for current timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 547 of file experiment.h.

◆ total_hypersurface_crossing_actions_

template<typename Modus>
uint64_t smash::Experiment< Modus >::total_hypersurface_crossing_actions_ = 0
private

Total number of particles removed from the evolution in hypersurface crossing actions.

Definition at line 553 of file experiment.h.

◆ discarded_interactions_total_

template<typename Modus>
uint64_t smash::Experiment< Modus >::discarded_interactions_total_ = 0
private

Total number of discarded interactions, because they were invalidated before they could be performed.

Definition at line 559 of file experiment.h.

◆ total_energy_removed_

template<typename Modus>
double smash::Experiment< Modus >::total_energy_removed_ = 0.0
private

Total energy removed from the system in hypersurface crossing actions.

Definition at line 565 of file experiment.h.

◆ seed_

template<typename Modus>
int64_t smash::Experiment< Modus >::seed_ = -1
private

random seed for the next event.

Definition at line 568 of file experiment.h.


The documentation for this class was generated from the following file:
smash::LatticeUpdate
LatticeUpdate
Enumerator option for lattice updates.
Definition: lattice.h:36
smash::Experiment::jmu_I3_lat_
std::unique_ptr< DensityLattice > jmu_I3_lat_
Isospin projection density on the lattices.
Definition: experiment.h:384
smash::Experiment::time_step_mode_
const TimeStepMode time_step_mode_
This indicates whether to use time steps.
Definition: experiment.h:493
smash::Experiment::jmu_B_lat_
std::unique_ptr< DensityLattice > jmu_B_lat_
Baryon density on the lattices.
Definition: experiment.h:381
smash::Experiment::run_time_evolution
void run_time_evolution()
Runs the time evolution of an event with fixed-sized time steps or without timesteps,...
Definition: experiment.h:1714
smash::Experiment::printout_tmn_
bool printout_tmn_
Whether to print the energy-momentum tensor.
Definition: experiment.h:422
smash::QuantumNumbers::momentum
FourVector momentum() const
Definition: quantumnumbers.h:131
ThermodynamicQuantity::TmnLandau
smash::Experiment::Tmn_
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > Tmn_
Lattices of energy-momentum tensors for printout.
Definition: experiment.h:419
smash::Experiment::action_finders_
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
The Action finder objects.
Definition: experiment.h:369
smash::Experiment::initialize_new_event
void initialize_new_event(int event_number)
This is called in the beginning of each event.
Definition: experiment.h:1451
smash::expand_space_time
void expand_space_time(Particles *particles, const ExperimentParameters &parameters, const ExpansionProperties &metric)
Modifies positions and momentum of all particles to account for space-time deformation.
Definition: propagation.cc:86
smash::Experiment::total_energy_removed_
double total_energy_removed_
Total energy removed from the system in hypersurface crossing actions.
Definition: experiment.h:565
ThermodynamicQuantity::LandauVelocity
smash::Experiment::previous_wall_actions_total_
uint64_t previous_wall_actions_total_
Total number of wall-crossings for previous timestep.
Definition: experiment.h:541
smash::StringProcess::init_pythia_hadron_rndm
void init_pythia_hadron_rndm()
Set PYTHIA random seeds to be desired values.
Definition: stringprocess.h:289
smash::Experiment::beam_momentum_
std::vector< FourVector > beam_momentum_
The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen.
Definition: experiment.h:366
smash::Experiment::next_output_time
double next_output_time() const
Shortcut for next output time.
Definition: experiment.h:303
smash::Experiment::compute_min_cell_length
double compute_min_cell_length(double dt) const
Calculate the minimal size for the grid cells such that the ScatterActionsFinder will find all collis...
Definition: experiment.h:298
smash::Particles::size
size_t size() const
Definition: particles.h:87
smash::Particles::reset
void reset()
Reset the state of the Particles object to an empty list and a new id counter.
Definition: particles.cc:139
smash::LatticeUpdate::AtOutput
smash::Experiment::wall_actions_total_
uint64_t wall_actions_total_
Total number of wall-crossings for current timestep.
Definition: experiment.h:535
smash::Experiment::final_output
void final_output(const int evt_num)
Output at the end of an event.
Definition: experiment.h:2121
smash::check_interactions_total
void check_interactions_total(uint64_t interactions_total)
Make sure interactions_total can be represented as a 32-bit integer.
Definition: experiment.h:1829
smash::Experiment::UB_lat_
std::unique_ptr< RectangularLattice< FourVector > > UB_lat_
Lattices for Skyrme potentials (evaluated in the local rest frame) times the baryon flow 4-velocity.
Definition: experiment.h:402
smash::LExperiment
static constexpr int LExperiment
Definition: outputparameters.h:19
smash::Experiment::pauli_blocker_
std::unique_ptr< PauliBlocker > pauli_blocker_
An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and c...
Definition: experiment.h:336
smash::DensityType::BaryonicIsospin
ExpansionMode::NoExpansion
smash::Experiment::modus_
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:321
smash::hline
const std::string hline(113, '-')
String representing a horizontal line.
smash::format_measurements
std::string format_measurements(const Particles &particles, uint64_t scatterings_this_interval, const QuantumNumbers &conserved_initial, SystemTimePoint time_start, double time, double E_mean_field, double E_mean_field_initial)
Generate the tabulated string which will be printed to the screen when SMASH is running.
Definition: experiment.cc:490
smash::ExperimentParameters::coll_crit
const CollisionCriterion coll_crit
Employed collision criterion.
Definition: experimentparameters.h:41
smash::Experiment::projectile_target_interact_
bool projectile_target_interact_
Whether the projectile and the target collided.
Definition: experiment.h:359
smash::Experiment::jmu_custom_lat_
std::unique_ptr< DensityLattice > jmu_custom_lat_
Custom density on the lattices.
Definition: experiment.h:393
smash::Experiment::run_time_evolution_timestepless
void run_time_evolution_timestepless(Actions &actions)
Performs all the propagations and actions during a certain time interval neglecting the influence of ...
Definition: experiment.h:1837
smash::random::set_seed
void set_seed(T &&seed)
Sets the seed of the random number engine.
Definition: random.h:71
smash::Experiment::particles_
Particles particles_
Complete particle list.
Definition: experiment.h:324
smash::LatticeUpdate::EveryTimestep
smash::LMain
static constexpr int LMain
Definition: experiment.h:82
smash::Experiment::force_decays_
const bool force_decays_
This indicates whether we force all resonances to decay in the last timestep.
Definition: experiment.h:472
smash::Experiment::total_pauli_blocked_
uint64_t total_pauli_blocked_
Total number of Pauli-blockings for current timestep.
Definition: experiment.h:547
FermiMotion::Frozen
Use fermi motion without potentials.
smash::logg
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
smash::Experiment::thermalizer_
std::unique_ptr< GrandCanThermalizer > thermalizer_
Instance of class used for forced thermalization.
Definition: experiment.h:434
smash::really_small
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37
smash::ExpansionProperties::mode_
ExpansionMode mode_
Type of metric used.
Definition: propagation.h:28
smash::Experiment::density_param_
DensityParameters density_param_
Structure to precalculate and hold parameters for density computations.
Definition: experiment.h:315
smash::Experiment::nevents_
const int nevents_
Number of events.
Definition: experiment.h:456
smash::Experiment::seed_
int64_t seed_
random seed for the next event.
Definition: experiment.h:568
smash::fill_event_info
EventInfo fill_event_info(const Particles &particles, double E_mean_field, double modus_impact_parameter, const ExperimentParameters &parameters, bool projectile_target_interact)
Generate the EventInfo object which is passed to outputs_.
Definition: experiment.cc:648
smash::format
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:307
einhard::Color
A stream modifier that allows to colorize the log output.
Definition: einhard.hpp:142
smash::create_oscar_output
std::unique_ptr< OutputInterface > create_oscar_output(const std::string &format, const std::string &content, const bf::path &path, const OutputParameters &out_par)
Definition: oscaroutput.cc:769
smash::Experiment::metric_
const ExpansionProperties metric_
This struct contains information on the metric to be used.
Definition: experiment.h:478
CollisionCriterion::Stochastic
Stochastic Criteiron.
smash::Particles::copy_to_vector
ParticleList copy_to_vector() const
Definition: particles.h:44
smash::Experiment::printout_tmn_landau_
bool printout_tmn_landau_
Whether to print the energy-momentum tensor in Landau frame.
Definition: experiment.h:425
smash::Experiment::FI3_lat_
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FI3_lat_
Lattices for the electric and magnetic component of the symmetry force.
Definition: experiment.h:416
smash::FourVector::x0
double x0() const
Definition: fourvector.h:303
smash::Experiment::do_final_decays
void do_final_decays()
Performs the final decays of an event.
Definition: experiment.h:2085
smash::update_lattice
void update_lattice(RectangularLattice< T > *lat, const LatticeUpdate update, const DensityType dens_type, const DensityParameters &par, const Particles &particles, const bool compute_gradient=false)
Updates the contents on the lattice.
Definition: density.h:402
smash::QuantumNumbers::report_deviations
std::string report_deviations(const Particles &particles) const
Checks if the current particle list has still the same values and reports about differences.
Definition: quantumnumbers.h:248
ThermodynamicQuantity::Tmn
smash::Experiment::use_grid_
const bool use_grid_
This indicates whether to use the grid.
Definition: experiment.h:475
smash::Experiment::interactions_total_
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:523
smash::Experiment::intermediate_output
void intermediate_output()
Intermediate output during an event.
Definition: experiment.h:1923
smash::Experiment::propagate_and_shine
void propagate_and_shine(double to_time)
Propagate all particles until time to_time without any interactions and shine dileptons.
Definition: experiment.h:1812
smash::Experiment::delta_time_startup_
const double delta_time_startup_
The clock's timestep size at start up.
Definition: experiment.h:466
smash::Experiment::IC_output_switch_
const bool IC_output_switch_
This indicates whether the IC output is enabled.
Definition: experiment.h:490
smash::CellSizeStrategy::Largest
Make cells as large as possible.
ThermodynamicQuantity::EckartDensity
smash::ExperimentParameters::strings_switch
bool strings_switch
This indicates whether string fragmentation is switched on.
Definition: experimentparameters.h:53
smash::Experiment::previous_interactions_total_
uint64_t previous_interactions_total_
Total number of interactions for previous timestep.
Definition: experiment.h:529
smash::ExperimentParameters::labclock
std::unique_ptr< Clock > labclock
System clock (for simulation time keeping in the computational frame)
Definition: experimentparameters.h:26
smash::Experiment::perform_action
bool perform_action(Action &action, const Container &particles_before_actions)
Perform the given action.
smash::Experiment::update_potentials
void update_potentials()
Recompute potentials on lattices if necessary.
Definition: experiment.h:2039
smash::random::advance
Engine::result_type advance()
Advance the engine's state and return the generated value.
Definition: random.h:78
smash::Experiment::FB_lat_
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FB_lat_
Lattices for the electric and magnetic components of the Skyrme force.
Definition: experiment.h:412
smash::ExperimentParameters::outputclock
std::unique_ptr< Clock > outputclock
Output clock to keep track of the next output time.
Definition: experimentparameters.h:29
smash::Experiment::dens_type_lattice_printout_
DensityType dens_type_lattice_printout_
Type of density for lattice printout.
Definition: experiment.h:396
smash::Experiment::dilepton_finder_
std::unique_ptr< DecayActionsFinderDilepton > dilepton_finder_
The Dilepton Action Finder.
Definition: experiment.h:372
smash::Experiment::printout_lattice_td_
bool printout_lattice_td_
Whether to print the thermodynamics quantities evaluated on the lattices.
Definition: experiment.h:431
smash::calculate_mean_field_energy
double calculate_mean_field_energy(const Potentials &potentials, RectangularLattice< smash::DensityOnLattice > &jmu_B_lat, const ExperimentParameters &parameters)
Calculate the total mean field energy of the system; this will be printed to the screen when SMASH is...
Definition: experiment.cc:536
smash::Experiment::parameters_
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:312
smash::DensityType::None
smash::Experiment::end_time_
const double end_time_
simulation time at which the evolution is stopped.
Definition: experiment.h:459
smash::Experiment::nucleon_has_interacted_
std::vector< bool > nucleon_has_interacted_
nucleon_has_interacted_ labels whether the particles in the nuclei have experienced any collisions or...
Definition: experiment.h:355
smash::Experiment::process_string_ptr_
StringProcess * process_string_ptr_
Pointer to the string process class object, which is used to set the random seed for PYTHIA objects i...
Definition: experiment.h:440
smash::propagate_straight_line
double propagate_straight_line(Particles *particles, double to_time, const std::vector< FourVector > &beam_momentum)
Propagates the positions of all particles on a straight line to a given moment.
Definition: propagation.cc:44
smash::Experiment::potentials_
std::unique_ptr< Potentials > potentials_
An instance of potentials class, that stores parameters of potentials, calculates them and their grad...
Definition: experiment.h:330
likely
#define likely(x)
Tell the branch predictor that this expression is likely true.
Definition: macros.h:14
smash::Experiment::initial_mean_field_energy_
double initial_mean_field_energy_
The initial total mean field energy in the system.
Definition: experiment.h:511
smash::Experiment::outputs_
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:342
smash::Experiment::total_hypersurface_crossing_actions_
uint64_t total_hypersurface_crossing_actions_
Total number of particles removed from the evolution in hypersurface crossing actions.
Definition: experiment.h:553
smash::DensityType::Baryon
smash::ExperimentParameters::testparticles
int testparticles
Number of test particle.
Definition: experimentparameters.h:32
smash::Experiment::printout_v_landau_
bool printout_v_landau_
Whether to print the 4-velocity in Landau fram.
Definition: experiment.h:428
smash::Experiment::discarded_interactions_total_
uint64_t discarded_interactions_total_
Total number of discarded interactions, because they were invalidated before they could be performed.
Definition: experiment.h:559
smash::Experiment::time_start_
SystemTimePoint time_start_
system starting time of the simulation
Definition: experiment.h:514
TimeStepMode::Fixed
Use fixed time step.
smash::update_momenta
void update_momenta(Particles *particles, double dt, const Potentials &pot, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FB_lat, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FI3_lat)
Updates the momenta of all particles at the current time step according to the equations of motion:
Definition: propagation.cc:111
smash::Experiment::conserved_initial_
QuantumNumbers conserved_initial_
The conserved quantities of the system.
Definition: experiment.h:505
smash::Experiment::max_transverse_distance_sqr_
double max_transverse_distance_sqr_
Maximal distance at which particles can interact, squared.
Definition: experiment.h:496