Version: SMASH-3.4
experiment.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2013-2026
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #include "smash/experiment.h"
11 
12 #include <cstdint>
13 
14 #include "smash/boxmodus.h"
15 #include "smash/collidermodus.h"
16 #include "smash/listmodus.h"
17 #include "smash/spheremodus.h"
18 
19 namespace smash {
20 
21 /* ExperimentBase carries everything that is needed for the evolution */
22 ExperimentPtr ExperimentBase::create(Configuration &config,
23  const std::filesystem::path &output_path) {
24  if (!std::filesystem::exists(output_path)) {
25  throw NonExistingOutputPathRequest("The requested output path (" +
26  output_path.string() +
27  ") does not exist.");
28  }
30 
31  const std::string modus_chooser = config.read(InputKeys::gen_modus);
32  logg[LExperiment].debug() << "Modus for this calculation: " << modus_chooser;
33 
34  if (modus_chooser == "Box") {
35  return std::make_unique<Experiment<BoxModus>>(config, output_path);
36  } else if (modus_chooser == "List") {
37  return std::make_unique<Experiment<ListModus>>(config, output_path);
38  } else if (modus_chooser == "ListBox") {
39  return std::make_unique<Experiment<ListBoxModus>>(config, output_path);
40  } else if (modus_chooser == "Collider") {
41  return std::make_unique<Experiment<ColliderModus>>(config, output_path);
42  } else if (modus_chooser == "Sphere") {
43  return std::make_unique<Experiment<SphereModus>>(config, output_path);
44  } else {
45  throw InvalidModusRequest("Invalid Modus (" + modus_chooser +
46  ") requested from ExperimentBase::create.");
47  }
48 }
49 
50 /*!\Userguide
51  * \page doxypage_input_conf_output_examples
52  *
53  * The following example configures the output to be printed in an interval of
54  * 1 fm and with the net baryon density being printed to the header.
55  * The particles output is generated in "Oscar1999", VTK and "Root" format,
56  * generating output for each time step. The collisions output is formatted
57  * according to an extended "Oscar2013" format and the initial and final
58  * particle lists are printed as well.
59  *\verbatim
60  Output:
61  Output_Interval: 1.0
62  Density_Type: "baryon"
63  Particles:
64  Format: ["Oscar1999", "VTK", "Root"]
65  Extended: False
66  Only_Final: No
67  Collisions:
68  Format: ["Oscar2013"]
69  Extended: True
70  Print_Start_End: True
71  \endverbatim
72  *
73  * In addition, the photon and dilepton output can be enabled as follows, where
74  * the dilepton output is generated in extended "Oscar2013" and the
75  * corresponding binary version of it, while the photon output is printed in
76  * "Oscar2013" format only.
77  *\verbatim
78  Output:
79  Dileptons:
80  Format: ["Oscar2013", "Oscar2013_bin"]
81  Extended: True
82  Photons:
83  Format: ["Oscar2013"]
84  \endverbatim
85  *
86  * Additionally, the thermodynamics output can be activated. In this example,
87  * thermodynamic output is activated for hadrons. The quanities that are printed
88  * are the density in the Eckart rest frame and the energy momentum tensor in
89  * the Landau rest frame. These quantities are printed at each time step for the
90  * position (0,0,0). Gaussian smearing is not applied. The output is provided
91  * in "ASCII" and "VTK" format.
92  *\verbatim
93  Output:
94  Thermodynamics:
95  Format: ["ASCII", "VTK"]
96  Type: "hadron"
97  Quantities: ["rho_eckart", "tmn_landau"]
98  Position: [0.0, 0.0, 0.0]
99  Smearing: False
100  \endverbatim
101  * SMASH can further be applied to extract initial conditions for hydrodynamic
102  * simulations, either in a hypersurface of constant hyperbolic time or based on
103  * the local energy density, as controlled by the key <tt>\ref key_MC_IC_type_
104  * "Modi: Collider: Initial_Conditions: Type"</tt>. The "For_vHLLE" output
105  * format is only available in conjunction with the iso-tau hypersurface
106  * option.\n The initial conditions output can be enabled as follows (for
107  * further possible formats, see the \ref list_of_output_formats
108  * "corresponding documentation"):
109  *\verbatim
110  Output:
111  Initial_Conditions:
112  Format: ["For_vHLLE", "Oscar2013", "Oscar2013_bin", "Root"]
113  Extended: False
114  \endverbatim
115  * The HepMC_asciiv3 and/or HepMC_treeroot ouputs are enabled by specifying
116  * these output options under %Particles or Collisions depending on the desired
117  * content.
118  *\verbatim
119  Output:
120  Particles:
121  Format: ["HepMC_asciiv3","HepMC_treeroot"]
122  Collisions:
123  Format: ["HepMC_asciiv3","HepMC_treeroot"]
124  \endverbatim
125  * If a lattice is configured and coulomb potentials are enabled, a VTK output
126  * for the electric and magnetic fields is available. It can be obtained by
127  * adding the following to the output section of the configuration:
128  *\verbatim
129  Output:
130  Coulomb:
131  Format: ["VTK"]
132  \endverbatim
133  */
134 
137 
138  const int ntest = config.take(InputKeys::gen_testparticles);
139 
140  // sets whether to consider only participants in thermodynamic outputs or not
141  const bool only_participants =
143 
144  const bool ignore_unformed =
146 
147  if (only_participants && config.has_section(InputSections::potentials)) {
148  throw std::invalid_argument(
149  "Only_Participants option cannot be "
150  "set to True when using Potentials.");
151  }
152 
153  const std::string modus_chooser = config.take(InputKeys::gen_modus);
154  // remove config maps of unused Modi
155  config.remove_all_entries_in_section_but_one(modus_chooser, {"Modi"});
156 
157  double box_length = -1.0;
159  box_length = config.read(InputKeys::modi_box_length);
160  }
162  box_length = config.read(InputKeys::modi_listBox_length);
163  }
164 
165  const double dt = config.take(InputKeys::gen_deltaTime);
166  const double t_end = config.read(InputKeys::gen_endTime);
167 
168  // Enforce a small time step, if the box modus is used
169  if (box_length > 0.0 && dt > box_length / 10.0) {
170  throw std::invalid_argument(
171  "Please decrease the timestep size. "
172  "A value of (dt <= l_box / 10) is necessary in the box modus.");
173  }
174 
175  // define output clock
176  std::unique_ptr<Clock> output_clock = nullptr;
179  throw std::invalid_argument(
180  "Please specify either Output_Interval or Output_Times");
181  }
182  std::vector<double> output_times =
184  // Add an output time larger than the end time so that the next time is
185  // always defined during the time evolution
186  output_times.push_back(t_end + 1.);
187  output_clock = std::make_unique<CustomClock>(output_times);
188  } else {
189  const double output_dt =
190  config.take(InputKeys::output_outputInterval, t_end);
191  if (output_dt <= 0.) {
192  throw std::invalid_argument(
193  "Output_Interval cannot be zero or negative.");
194  }
195  output_clock = std::make_unique<UniformClock>(0.0, output_dt, t_end);
196  }
197 
198  // Add proper error messages if photons are not configured properly.
199  // 1) Missing Photon config section.
202  throw std::invalid_argument(
203  "Photon output is enabled although photon production is disabled. "
204  "Photon production can be configured in the \"Photon\" subsection "
205  "of the \"Collision_Term\".");
206  }
207 
208  // 2) Missing Photon output section.
209  if (!(config.has_section(InputSections::o_photons))) {
210  const bool missing_output_2to2 =
212  missing_output_brems =
214  if (missing_output_2to2 || missing_output_brems) {
215  throw std::invalid_argument(
216  "Photon output is disabled although photon production is enabled. "
217  "Please enable the photon output.");
218  }
219  }
220 
221  // Add proper error messages if dileptons are not configured properly.
222  // 1) Missing Dilepton config section.
225  throw std::invalid_argument(
226  "Dilepton output is enabled although dilepton production is disabled. "
227  "Dilepton production can be configured in the \"Dileptons\" subsection "
228  "of the \"Collision_Term\".");
229  }
230 
231  // 2) Missing Dilepton output section.
232  if (!(config.has_section(InputSections::o_dileptons))) {
233  const bool missing_output_decays =
235  if (missing_output_decays) {
236  throw std::invalid_argument(
237  "Dilepton output is disabled although dilepton production is "
238  "enabled. Please enable the dilepton output.");
239  }
240  }
241 
242  /* Elastic collisions between the nucleons with the square root s
243  * below low_snn_cut are excluded. */
244  const double low_snn_cut =
246 
247  const bool potential_affect_threshold =
249  const double scale_xs = config.take(InputKeys::collTerm_crossSectionScaling);
250 
251  const auto criterion = config.take(InputKeys::collTerm_collisionCriterion);
252 
254  criterion != CollisionCriterion::Stochastic) {
255  throw std::invalid_argument(
256  "Only use a fixed minimal cell length with the stochastic collision "
257  "criterion.");
258  }
260  criterion == CollisionCriterion::Stochastic) {
261  throw std::invalid_argument(
262  "Only use maximum cross section with the geometric collision "
263  "criterion. Use Fixed_Min_Cell_Length to change the grid size for the "
264  "stochastic criterion.");
265  }
266 
267  /**
268  * The maximum around 200 mb occurs in the Delta peak of the pi+p
269  * cross section. Many SMASH cross sections diverge at the threshold,
270  * these divergent parts are effectively cut off. If deuteron production
271  * via d' is considered, then the default should be increased to 2000 mb
272  * to function correctly (see \iref{Oliinychenko:2018ugs}). If the cross
273  * sections are globally scaled, the maximum cross section is also scaled.
274  */
275  const double maximum_cross_section_default =
276  ParticleType::exists("d'") ? 2000.0 : 200.0;
277 
278  double maximum_cross_section = config.take(
279  InputKeys::collTerm_maximumCrossSection, maximum_cross_section_default);
280  maximum_cross_section *= scale_xs;
281  return {std::make_unique<UniformClock>(0.0, dt, t_end),
282  std::move(output_clock),
284  ntest,
295  criterion,
300  config.take(InputKeys::collTerm_strings, modus_chooser != "Box"),
303  low_snn_cut,
304  potential_affect_threshold,
305  box_length,
306  maximum_cross_section,
308  scale_xs,
309  only_participants,
310  ignore_unformed,
316 }
317 
318 std::string format_measurements(const std::vector<Particles> &ensembles,
319  uint64_t scatterings_this_interval,
320  const QuantumNumbers &conserved_initial,
321  SystemTimePoint time_start, double time,
322  double E_mean_field,
323  double E_mean_field_initial) {
324  const SystemTimeSpan elapsed_seconds = SystemClock::now() - time_start;
325 
326  const QuantumNumbers current_values(ensembles);
327  const QuantumNumbers difference = current_values - conserved_initial;
328  int total_particles = 0;
329  for (const Particles &particles : ensembles) {
330  total_particles += particles.size();
331  }
332 
333  // Make sure there are no FPEs in case of IC output, were there will
334  // eventually be no more particles in the system
335  const double current_energy = current_values.momentum().x0();
336  const double energy_per_part =
337  (total_particles > 0) ? (current_energy + E_mean_field) / total_particles
338  : 0.0;
339 
340  std::ostringstream ss;
341  // clang-format off
342  ss << field<7, 3> << time
343  // total kinetic energy in the system
344  << field<11, 3> << current_energy
345  // total mean field energy in the system
346  << field<11, 3> << E_mean_field
347  // total energy in the system
348  << field<12, 3> << current_energy + E_mean_field
349  // total energy per particle in the system
350  << field<12, 6> << energy_per_part;
351  // change in total energy per particle (unless IC output is enabled)
352  if (total_particles == 0) {
353  ss << field<13, 6> << "N/A";
354  } else {
355  ss << field<13, 6> << (difference.momentum().x0()
356  + E_mean_field - E_mean_field_initial)
357  / total_particles;
358  }
359  ss << field<14, 3> << scatterings_this_interval
360  << field<10, 3> << total_particles
361  << field<9, 3> << elapsed_seconds;
362  // clang-format on
363  return ss.str();
364 }
365 
367  const Potentials &potentials,
369  RectangularLattice<std::pair<ThreeVector, ThreeVector>> *em_lattice,
370  const ExperimentParameters &parameters) {
371  // basic parameters and variables
372  const double V_cell = (jmuB_lat.cell_sizes())[0] *
373  (jmuB_lat.cell_sizes())[1] * (jmuB_lat.cell_sizes())[2];
374 
375  double E_mean_field = 0.0;
376  double density_mean = 0.0;
377  double density_variance = 0.0;
378 
379  /*
380  * We anticipate having other options, like the vector DFT potentials, in the
381  * future, hence we include checking which potentials are used.
382  */
383  if (potentials.use_skyrme()) {
384  /*
385  * Calculating the symmetry energy contribution to the total mean field
386  * energy in the system is not implemented at this time.
387  */
388  if (potentials.use_symmetry() &&
389  parameters.outputclock->current_time() == 0.0) {
390  logg[LExperiment].warn()
391  << "Note:"
392  << "\nSymmetry energy is not included in the mean field calculation."
393  << "\n\n";
394  }
395 
396  /*
397  * Skyrme potential parameters:
398  * C1GeV are the Skyrme coefficients converted to GeV,
399  * b1 are the powers of the baryon number density entering the expression
400  * for the energy density of the system. Note that these exponents are
401  * larger by 1 than those for the energy of a particle (which are used in
402  * Potentials class). The formula for a total mean field energy due to a
403  * Skyrme potential is E_MF = \sum_i (C_i/b_i) ( n_B^b_i )/( n_0^(b_i - 1) )
404  * where nB is the local rest frame baryon number density and n_0 is the
405  * saturation density. Then the single particle potential follows from
406  * V = d E_MF / d n_B .
407  */
408  double C1GeV = (potentials.skyrme_a()) / 1000.0;
409  double C2GeV = (potentials.skyrme_b()) / 1000.0;
410  double b1 = 2.0;
411  double b2 = (potentials.skyrme_tau()) + 1.0;
412 
413  /*
414  * Note: calculating the mean field only works if lattice is used.
415  * We iterate over the nodes of the baryon density lattice to sum their
416  * contributions to the total mean field.
417  */
418  int number_of_nodes = 0;
419  double lattice_mean_field_total = 0.0;
420 
421  for (auto &node : jmuB_lat) {
422  number_of_nodes++;
423  // the rest frame density
424  double rhoB = node.rho();
425  // the computational frame density
426  const double j0B = node.jmu_net().x0();
427 
428  const double abs_rhoB = std::abs(rhoB);
429  if (abs_rhoB < very_small_double) {
430  continue;
431  }
432  density_mean += j0B;
433  density_variance += j0B * j0B;
434 
435  /*
436  * The mean-field energy for the Skyrme potential. Note: this expression
437  * is only exact in the rest frame, and is expected to significantly
438  * deviate from the correct value for systems that are considerably
439  * relativistic. Note: symmetry energy is not taken into the account.
440  *
441  * TODO: Add symmetry energy.
442  */
443  double mean_field_contribution_1 = (C1GeV / b1) * std::pow(abs_rhoB, b1) /
444  std::pow(nuclear_density, b1 - 1);
445  double mean_field_contribution_2 = (C2GeV / b2) * std::pow(abs_rhoB, b2) /
446  std::pow(nuclear_density, b2 - 1);
447 
448  lattice_mean_field_total +=
449  V_cell * (mean_field_contribution_1 + mean_field_contribution_2);
450  }
451 
452  // logging statistical properties of the density calculation
453  density_mean = density_mean / number_of_nodes;
454  density_variance = density_variance / number_of_nodes;
455  double density_scaled_variance =
456  std::sqrt(density_variance - density_mean * density_mean) /
457  density_mean;
458  logg[LExperiment].debug() << "\t\t\t\t\t";
459  logg[LExperiment].debug()
460  << "\n\t\t\t\t\t density mean = " << density_mean;
461  logg[LExperiment].debug()
462  << "\n\t\t\t\t\t density scaled variance = " << density_scaled_variance;
463  logg[LExperiment].debug()
464  << "\n\t\t\t\t\t total mean_field = "
465  << lattice_mean_field_total * parameters.testparticles *
466  parameters.n_ensembles
467  << "\n";
468 
469  E_mean_field = lattice_mean_field_total;
470  } // if (potentials.use_skyrme())
471 
472  if (potentials.use_vdf()) {
473  /*
474  * Safety check:
475  * Calculating the symmetry energy contribution to the total mean field
476  * energy in the system is not implemented at this time.
477  */
478  if (potentials.use_symmetry() &&
479  parameters.outputclock->current_time() == 0.0) {
480  logg[LExperiment].error()
481  << "\nSymmetry energy is not included in the VDF mean-field "
482  "calculation"
483  << "\nas VDF potentials haven't been fitted with symmetry energy."
484  << "\n\n";
485  }
486 
487  /*
488  * The total mean-field energy density due to a VDF potential is
489  * E_MF = \sum_i C_i rho^(b_i - 2) *
490  * * [j_0^2 - rho^2 * (b_i - 1)/b_i] / rho_0^(b_i - 1)
491  * where j_0 is the local computational frame baryon density, rho is the
492  * local rest frame baryon density, and rho_0 is the saturation density.
493  */
494 
495  // saturation density of nuclear matter specified in the VDF parameters
496  double rhoB_0 = potentials.saturation_density();
497 
498  /*
499  * Note: calculating the mean field only works if lattice is used.
500  * We iterate over the nodes of the baryon density lattice to sum their
501  * contributions to the total mean field.
502  */
503  int number_of_nodes = 0;
504  double lattice_mean_field_total = 0.0;
505 
506  for (auto &node : jmuB_lat) {
507  number_of_nodes++;
508  // the rest frame density
509  double rhoB = node.rho();
510  // the computational frame density
511  const double j0B = node.jmu_net().x0();
512  double abs_rhoB = std::abs(rhoB);
513  density_mean += j0B;
514  density_variance += j0B * j0B;
515 
516  /*
517  * The mean-field energy for the VDF potential. This expression is correct
518  * in any frame, and in the rest frame conforms to the Skyrme mean-field
519  * energy (if same coefficients and powers are used).
520  */
521  // in order to prevent dividing by zero in case any b_i < 2.0
522  if (abs_rhoB < very_small_double) {
523  abs_rhoB = very_small_double;
524  }
525  double mean_field_contribution = 0.0;
526  for (int i = 0; i < potentials.number_of_terms(); i++) {
527  mean_field_contribution +=
528  potentials.coeffs()[i] *
529  std::pow(abs_rhoB, potentials.powers()[i] - 2.0) *
530  (j0B * j0B -
531  ((potentials.powers()[i] - 1.0) / potentials.powers()[i]) *
532  abs_rhoB * abs_rhoB) /
533  std::pow(rhoB_0, potentials.powers()[i] - 1.0);
534  }
535  lattice_mean_field_total += V_cell * mean_field_contribution;
536  }
537 
538  // logging statistical properties of the density calculation
539  density_mean = density_mean / number_of_nodes;
540  density_variance = density_variance / number_of_nodes;
541  double density_scaled_variance =
542  std::sqrt(density_variance - density_mean * density_mean) /
543  density_mean;
544  logg[LExperiment].debug() << "\t\t\t\t\t";
545  logg[LExperiment].debug()
546  << "\n\t\t\t\t\t density mean = " << density_mean;
547  logg[LExperiment].debug()
548  << "\n\t\t\t\t\t density scaled variance = " << density_scaled_variance;
549  logg[LExperiment].debug()
550  << "\n\t\t\t\t\t total mean_field = "
551  << lattice_mean_field_total * parameters.testparticles *
552  parameters.n_ensembles
553  << "\n";
554 
555  E_mean_field = lattice_mean_field_total;
556  }
557 
558  double electromagnetic_potential = 0.0;
559  if (potentials.use_coulomb() && em_lattice) {
560  // Use cell volume of electromagnetic fields lattice even though it should
561  // be the same as for net-baryon density
562  double V_cell_em = em_lattice->cell_sizes()[0] *
563  em_lattice->cell_sizes()[1] *
564  em_lattice->cell_sizes()[2];
565  for (auto &fields : *em_lattice) {
566  // Energy is 0.5 * int E^2 + B^2 dV
567  electromagnetic_potential +=
568  hbarc * 0.5 * V_cell_em * (fields.first.sqr() + fields.second.sqr());
569  }
570  }
571  logg[LExperiment].debug() << "Total energy in electromagnetic field = "
572  << electromagnetic_potential;
573  E_mean_field += electromagnetic_potential;
574  /*
575  * E_mean_field is multiplied by the number of testparticles per particle and
576  * the number of parallel ensembles because the total kinetic energy tracked
577  * is that of all particles in the simulation, including test-particles and/or
578  * ensembles, and so this way is more consistent.
579  */
580  E_mean_field =
581  E_mean_field * parameters.testparticles * parameters.n_ensembles;
582 
583  return E_mean_field;
584 }
585 
586 EventInfo fill_event_info(const std::vector<Particles> &ensembles,
587  double E_mean_field, double modus_impact_parameter,
588  const ExperimentParameters &parameters,
589  bool projectile_target_interact,
590  bool kinematic_cut_for_SMASH_IC) {
591  const QuantumNumbers current_values(ensembles);
592  const double E_kinetic_total = current_values.momentum().x0();
593  const double E_total = E_kinetic_total + E_mean_field;
594 
595  EventInfo event_info{modus_impact_parameter,
596  parameters.box_length,
597  parameters.outputclock->current_time(),
598  E_kinetic_total,
599  E_mean_field,
600  E_total,
601  parameters.testparticles,
602  parameters.n_ensembles,
603  !projectile_target_interact,
604  kinematic_cut_for_SMASH_IC};
605  return event_info;
606 }
607 
608 void validate_and_adjust_particle_list(ParticleList &particle_list) {
609  static bool warn_mass_discrepancy = true;
610  static bool warn_off_shell_particle = true;
611  for (auto it = particle_list.begin(); it != particle_list.end();) {
612  auto &particle = *it;
613  auto pdgcode = particle.pdgcode();
614  try {
615  // Convert Kaon-L or Kaon-S into K0 or Anti-K0 used in SMASH
616  if (pdgcode == 0x310 || pdgcode == 0x130) {
617  pdgcode = (random::uniform_int(0, 1) == 0) ? pdg::K_z : pdg::Kbar_z;
618  }
619  /* ATTENTION: It would be wrong to directly assign here the return value
620  * to 'particle', because this would potentially also change its id and
621  * process number, which in turn, might lead to actions to be discarded.
622  * Here, only the particle momentum has to be adjusted and this is done
623  * creating a new particle and using its momentum to set 'particle' one.
624  * The position and momentum of the particle are checked for nan values.
625  */
626  auto valid_smash_particle =
628  pdgcode, particle.effective_mass(), particle.position(),
629  particle.momentum(), LExperiment, warn_mass_discrepancy,
630  warn_off_shell_particle);
631  particle.set_4position(valid_smash_particle.position());
632  particle.set_4momentum(valid_smash_particle.momentum());
633  particle.set_cross_section_scaling_factor(
634  valid_smash_particle.xsec_scaling_factor());
635  it++;
637  logg[LExperiment].warn()
638  << "SMASH does not recognize pdg code " << pdgcode
639  << " obtained from hadron list. This particle will be ignored.\n";
640  it = particle_list.erase(it);
641  }
642  }
643 }
644 
645 } // namespace smash
Interface to the SMASH configuration files.
T read(const Key< T > &key) const
Additional interface for SMASH to read configuration values without removing them.
bool has_value(const Key< T > &key) const
Return whether there is a non-empty value behind the requested key (which is supposed not to refer to...
bool has_section(const KeyLabels &labels) const
Return whether there is a (possibly empty) section with the given labels.
T take(const Key< T > &key)
The default interface for SMASH to read configuration values.
void remove_all_entries_in_section_but_one(const std::string &key, KeyLabels section={})
Remove all entries in the given section except for key.
static std::unique_ptr< ExperimentBase > create(Configuration &config, const std::filesystem::path &output_path)
Factory method that creates and initializes a new Experiment<Modus>.
Definition: experiment.cc:22
double x0() const
Definition: fourvector.h:313
static bool exists(PdgCode pdgcode)
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
A class that stores parameters of potentials, calculates potentials and their gradients.
Definition: potentials.h:36
A container for storing conserved values.
FourVector momentum() const
A container class to hold all the arrays on the lattice and access them.
Definition: lattice.h:49
const std::array< double, 3 > & cell_sizes() const
Definition: lattice.h:162
@ Stochastic
Stochastic Criteiron.
#define SMASH_SOURCE_LOCATION
Hackery that is required to output the location in the source code where the log statement occurs.
Definition: logging.h:153
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > & logg
An array that stores all pre-configured Logger objects.
Definition: logging.h:245
constexpr Section p_vdf
Subsection for the VDF potentials information.
Definition: input_keys.h:239
constexpr Section c_photons
Subsection for the photons.
Definition: input_keys.h:126
constexpr Section o_photons
Subsection for the output photons content.
Definition: input_keys.h:218
constexpr Section c_dileptons
Subsection for the dileptons.
Definition: input_keys.h:120
constexpr Section potentials
Section for the potentials information.
Definition: input_keys.h:228
constexpr Section o_dileptons
Subsection for the output dileptons content.
Definition: input_keys.h:211
constexpr int K_z
K⁰.
constexpr int Kbar_z
K̄⁰.
T uniform_int(T min, T max)
Definition: random.h:106
Definition: action.h:24
EventInfo fill_event_info(const std::vector< Particles > &ensembles, double E_mean_field, double modus_impact_parameter, const ExperimentParameters &parameters, bool projectile_target_interact, bool kinematic_cut_for_SMASH_IC)
Generate the EventInfo object which is passed to outputs_.
Definition: experiment.cc:586
SystemClock::duration SystemTimeSpan
The time duration type (alias) used for measuring run times.
Definition: chrono.h:28
std::string format_measurements(const std::vector< Particles > &ensembles, uint64_t scatterings_this_interval, const QuantumNumbers &conserved_initial, SystemTimePoint time_start, double time, double E_mean_field, double E_mean_field_initial)
Generate a string which will be printed to the screen when SMASH is running.
Definition: experiment.cc:318
ExperimentParameters create_experiment_parameters(Configuration &config)
Gathers all general Experiment parameters.
Definition: experiment.cc:135
constexpr double very_small_double
A very small double, used to avoid division by zero.
Definition: constants.h:44
double calculate_mean_field_energy(const Potentials &potentials, RectangularLattice< smash::DensityOnLattice > &jmu_B_lat, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *em_lattice, 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:366
static constexpr int LExperiment
void validate_and_adjust_particle_list(ParticleList &particle_list)
Validate a particle list adjusting each particle to be a valid SMASH particle.
Definition: experiment.cc:608
constexpr double nuclear_density
Ground state density of symmetric nuclear matter [fm^-3].
Definition: constants.h:52
ParticleData create_valid_smash_particle_matching_provided_quantities(PdgCode pdgcode, double mass, const FourVector &four_position, const FourVector &four_momentum, int log_area, bool &mass_warning, bool &on_shell_warning)
This function creates a SMASH particle validating the provided information.
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:29
std::chrono::time_point< std::chrono::system_clock > SystemTimePoint
Type (alias) that is used to store the current time.
Definition: chrono.h:22
Structure to contain custom data for output.
Exception class that is thrown if an invalid modus is requested from the Experiment factory.
Definition: experiment.h:149
Exception class that is thrown if the requested output path in the Experiment factory is not existing...
Definition: experiment.h:158
Helper structure for Experiment.
double box_length
Length of the box in fm in case of box modus, otherwise -1.
int n_ensembles
Number of parallel ensembles.
std::unique_ptr< Clock > outputclock
Output clock to keep track of the next output time.
int testparticles
Number of test-particles.
static const Key< bool > collTerm_photons_twoToTwoScatterings
See user guide description for more information.
Definition: input_keys.h:3967
static const Key< double > modi_listBox_length
See user guide description for more information.
Definition: input_keys.h:6068
static const Key< double > collTerm_resonanceLifetimeModifier
See user guide description for more information.
Definition: input_keys.h:3001
static const Key< ReactionsBitSet > collTerm_includedTwoToTwo
See user guide description for more information.
Definition: input_keys.h:2727
static const Key< double > collTerm_crossSectionScaling
See user guide description for more information.
Definition: input_keys.h:2578
static const Key< double > modi_box_length
See user guide description for more information.
Definition: input_keys.h:5633
static const Key< CharmRescattering > collTerm_charmRescatteringMethod
See user guide description for more information.
Definition: input_keys.h:2509
static const Key< bool > collTerm_decayInitial
See user guide description for more information.
Definition: input_keys.h:2676
static const Key< std::string > gen_modus
See user guide description for more information.
Definition: input_keys.h:1361
static const Key< double > gen_smearingTriangularRange
See user guide description for more information.
Definition: input_keys.h:1814
static const Key< double > output_outputInterval
See user guide description for more information.
Definition: input_keys.h:6164
static const Key< bool > output_thermodynamics_ignoreUnformed
See user guide description for more information.
Definition: input_keys.h:7058
static const Key< double > gen_smearingGaussianSigma
See user guide description for more information.
Definition: input_keys.h:1633
static const Key< bool > collTerm_dileptons_decays
See user guide description for more information.
Definition: input_keys.h:3907
static const Key< bool > collTerm_strings
See user guide description for more information.
Definition: input_keys.h:3034
static const Key< DerivativesMode > gen_derivativesMode
See user guide description for more information.
Definition: input_keys.h:1486
static const Key< bool > collTerm_forceDecaysAtEnd
See user guide description for more information.
Definition: input_keys.h:2659
static const Key< double > gen_endTime
See user guide description for more information.
Definition: input_keys.h:1333
static const Key< bool > collTerm_photons_bremsstrahlung
See user guide description for more information.
Definition: input_keys.h:3983
static const Key< double > gen_smearingGaussCutoffInSigma
See user guide description for more information.
Definition: input_keys.h:1613
static const Key< double > gen_smearingDiscreteWeight
See user guide description for more information.
Definition: input_keys.h:1504
static const Key< double > collTerm_elasticNNCutoffSqrts
See user guide description for more information.
Definition: input_keys.h:2621
static const Key< int > gen_ensembles
See user guide description for more information.
Definition: input_keys.h:1539
static const Key< double > collTerm_fixedMinCellLength
See user guide description for more information.
Definition: input_keys.h:2643
static const Key< MultiParticleReactionsBitSet > collTerm_multiParticleReactions
See user guide description for more information.
Definition: input_keys.h:2874
static const Key< double > collTerm_maximumCrossSection
See user guide description for more information.
Definition: input_keys.h:2817
static const Key< SpinInteractionType > collTerm_spinInteractions
See user guide description for more information.
Definition: input_keys.h:3017
static const Key< CollisionCriterion > collTerm_collisionCriterion
See user guide description for more information.
Definition: input_keys.h:2560
static const Key< SmearingMode > gen_smearingMode
See user guide description for more information.
Definition: input_keys.h:1731
static const Key< bool > output_thermodynamics_onlyParticipants
See user guide description for more information.
Definition: input_keys.h:7034
static const Key< FieldDerivativesMode > gen_fieldDerivativesMode
See user guide description for more information.
Definition: input_keys.h:1595
static const Key< bool > collTerm_ignoreDecayWidthAtTheEnd
See user guide description for more information.
Definition: input_keys.h:2770
static const Key< NNbarTreatment > collTerm_nnbarTreatment
See user guide description for more information.
Definition: input_keys.h:2900
static const Key< double > gen_deltaTime
See user guide description for more information.
Definition: input_keys.h:1460
static const Key< std::vector< double > > output_outputTimes
See user guide description for more information.
Definition: input_keys.h:6192
static const Key< bool > lattice_potentialsAffectThreshold
See user guide description for more information.
Definition: input_keys.h:7303
static const Key< bool > collTerm_twoToOne
See user guide description for more information.
Definition: input_keys.h:3118
static const Key< DileptonBremsPionFormFactor > collTerm_dileptons_pion_form_factor
See user guide description for more information.
Definition: input_keys.h:3950
static const Key< int > gen_testparticles
See user guide description for more information.
Definition: input_keys.h:1764