Version: SMASH-3.0
experiment.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2013-2023
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({"General", "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 
134 
135  const int ntest = config.take({"General", "Testparticles"}, 1);
136  if (ntest <= 0) {
137  throw std::invalid_argument("Testparticle number should be positive!");
138  }
139 
140  // sets whether to consider only participants in thermodynamic outputs or not
141  const bool only_participants =
142  config.take({"Output", "Thermodynamics", "Only_Participants"}, false);
143 
144  if (only_participants && config.has_value({"Potentials"})) {
145  throw std::invalid_argument(
146  "Only_Participants option cannot be "
147  "set to True when using Potentials.");
148  }
149 
150  const std::string modus_chooser = config.take({"General", "Modus"});
151  // remove config maps of unused Modi
152  config.remove_all_entries_in_section_but_one(modus_chooser, {"Modi"});
153 
154  double box_length = -1.0;
155  if (config.has_value({"Modi", "Box", "Length"})) {
156  box_length = config.read({"Modi", "Box", "Length"});
157  }
158 
159  if (config.has_value({"Modi", "ListBox", "Length"})) {
160  box_length = config.read({"Modi", "ListBox", "Length"});
161  }
162 
163  /* If this Delta_Time option is absent (this can be for timestepless mode)
164  * just assign 1.0 fm, reasonable value will be set at event initialization
165  */
166  const double dt = config.take({"General", "Delta_Time"}, 1.);
167  const double t_end = config.read({"General", "End_Time"});
168 
169  // Enforce a small time step, if the box modus is used
170  if (box_length > 0.0 && dt > box_length / 10.0) {
171  throw std::invalid_argument(
172  "Please decrease the timestep size. "
173  "A value of (dt <= l_box / 10) is necessary in the box modus.");
174  }
175 
176  // define output clock
177  std::unique_ptr<Clock> output_clock = nullptr;
178  if (config.has_value({"Output", "Output_Times"})) {
179  if (config.has_value({"Output", "Output_Interval"})) {
180  throw std::invalid_argument(
181  "Please specify either Output_Interval or Output_Times");
182  }
183  std::vector<double> output_times = config.take({"Output", "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 = config.take({"Output", "Output_Interval"}, t_end);
190  output_clock = std::make_unique<UniformClock>(0.0, output_dt, t_end);
191  }
192 
193  // Add proper error messages if photons are not configured properly.
194  // 1) Missing Photon config section.
195  if (config.has_value({"Output", "Photons"}) &&
196  (!config.has_value({"Collision_Term", "Photons"}))) {
197  throw std::invalid_argument(
198  "Photon output is enabled although photon production is disabled. "
199  "Photon production can be configured in the \"Photon\" subsection "
200  "of the \"Collision_Term\".");
201  }
202 
203  // 2) Missing Photon output section.
204  bool missing_output_2to2 = false;
205  bool missing_output_brems = false;
206  if (!(config.has_value({"Output", "Photons"}))) {
207  if (config.has_value({"Collision_Term", "Photons", "2to2_Scatterings"})) {
208  missing_output_2to2 =
209  config.read({"Collision_Term", "Photons", "2to2_Scatterings"});
210  }
211  if (config.has_value({"Collision_Term", "Photons", "Bremsstrahlung"})) {
212  missing_output_brems =
213  config.read({"Collision_Term", "Photons", "Bremsstrahlung"});
214  }
215 
216  if (missing_output_2to2 || missing_output_brems) {
217  throw std::invalid_argument(
218  "Photon output is disabled although photon production is enabled. "
219  "Please enable the photon output.");
220  }
221  }
222 
223  // Add proper error messages if dileptons are not configured properly.
224  // 1) Missing Dilepton config section.
225  if (config.has_value({"Output", "Dileptons"}) &&
226  (!config.has_value({"Collision_Term", "Dileptons"}))) {
227  throw std::invalid_argument(
228  "Dilepton output is enabled although dilepton production is disabled. "
229  "Dilepton production can be configured in the \"Dileptons\" subsection "
230  "of the \"Collision_Term\".");
231  }
232 
233  // 2) Missing Dilepton output section.
234  bool missing_output_decays = false;
235  if (!(config.has_value({"Output", "Dileptons"}))) {
236  if (config.has_value({"Collision_Term", "Dileptons", "Decays"})) {
237  missing_output_decays =
238  config.read({"Collision_Term", "Dileptons", "Decays"});
239  }
240 
241  if (missing_output_decays) {
242  throw std::invalid_argument(
243  "Dilepton output is disabled although dilepton production is "
244  "enabled. "
245  "Please enable the dilepton output.");
246  }
247  }
248  /* Elastic collisions between the nucleons with the square root s
249  * below low_snn_cut are excluded. */
250  const double low_snn_cut =
251  config.take({"Collision_Term", "Elastic_NN_Cutoff_Sqrts"}, 1.98);
252  const auto proton = ParticleType::try_find(pdg::p);
253  const auto pion = ParticleType::try_find(pdg::pi_z);
254  if (proton && pion &&
255  low_snn_cut > proton->mass() + proton->mass() + pion->mass()) {
256  logg[LExperiment].warn("The cut-off should be below the threshold energy",
257  " of the process: NN to NNpi");
258  }
259  const bool potential_affect_threshold =
260  config.take({"Lattice", "Potentials_Affect_Thresholds"}, false);
261  const double scale_xs =
262  config.take({"Collision_Term", "Cross_Section_Scaling"}, 1.0);
263 
264  const auto criterion = config.take({"Collision_Term", "Collision_Criterion"},
266 
267  if (config.has_value({"Collision_Term", "Fixed_Min_Cell_Length"}) &&
268  criterion != CollisionCriterion::Stochastic) {
269  throw std::invalid_argument(
270  "Only use a fixed minimal cell length with the stochastic collision "
271  "criterion.");
272  }
273  if (config.has_value({"Collision_Term", "Maximum_Cross_Section"}) &&
274  criterion == CollisionCriterion::Stochastic) {
275  throw std::invalid_argument(
276  "Only use maximum cross section with the "
277  "geometric collision criterion. Use Fixed_Min_Cell_Length to change "
278  "the grid "
279  "size for the stochastic criterion.");
280  }
281 
290  const double maximum_cross_section_default =
291  ParticleType::exists("d'") ? 2000.0 : 200.0;
292 
293  double maximum_cross_section =
294  config.take({"Collision_Term", "Maximum_Cross_Section"},
295  maximum_cross_section_default);
296  maximum_cross_section *= scale_xs;
297  return {
298  std::make_unique<UniformClock>(0.0, dt, t_end),
299  std::move(output_clock),
300  config.take({"General", "Ensembles"}, 1),
301  ntest,
302  config.take({"General", "Derivatives_Mode"},
304  config.has_value({"Potentials", "VDF"})
307  config.take({"General", "Field_Derivatives_Mode"},
309  config.take({"General", "Smearing_Mode"},
311  config.take({"General", "Gaussian_Sigma"}, 1.),
312  config.take({"General", "Gauss_Cutoff_In_Sigma"}, 4.),
313  config.take({"General", "Discrete_Weight"}, 1. / 3.0),
314  config.take({"General", "Triangular_Range"}, 2.0),
315  criterion,
316  config.take({"Collision_Term", "Two_to_One"}, true),
317  config.take({"Collision_Term", "Included_2to2"}, ReactionsBitSet().set()),
318  config.take({"Collision_Term", "Multi_Particle_Reactions"},
319  MultiParticleReactionsBitSet().reset()),
320  config.take({"Collision_Term", "Strings"}, modus_chooser != "Box"),
321  config.take({"Collision_Term", "Resonance_Lifetime_Modifier"}, 1.),
322  config.take({"Collision_Term", "NNbar_Treatment"},
324  low_snn_cut,
325  potential_affect_threshold,
326  box_length,
327  maximum_cross_section,
328  config.take({"Collision_Term", "Fixed_Min_Cell_Length"}, 2.5),
329  scale_xs,
330  only_participants,
331  config.take({"Collision_Term", "Include_Weak_And_EM_Decays_At_The_End"},
332  false),
333  std::nullopt};
334 }
335 
336 std::string format_measurements(const std::vector<Particles> &ensembles,
337  uint64_t scatterings_this_interval,
338  const QuantumNumbers &conserved_initial,
339  SystemTimePoint time_start, double time,
340  double E_mean_field,
341  double E_mean_field_initial) {
342  const SystemTimeSpan elapsed_seconds = SystemClock::now() - time_start;
343 
344  const QuantumNumbers current_values(ensembles);
345  const QuantumNumbers difference = current_values - conserved_initial;
346  int total_particles = 0;
347  for (const Particles &particles : ensembles) {
348  total_particles += particles.size();
349  }
350 
351  // Make sure there are no FPEs in case of IC output, were there will
352  // eventually be no more particles in the system
353  const double current_energy = current_values.momentum().x0();
354  const double energy_per_part =
355  (total_particles > 0) ? (current_energy + E_mean_field) / total_particles
356  : 0.0;
357 
358  std::ostringstream ss;
359  // clang-format off
360  ss << field<7, 3> << time
361  // total kinetic energy in the system
362  << field<11, 3> << current_energy
363  // total mean field energy in the system
364  << field<11, 3> << E_mean_field
365  // total energy in the system
366  << field<12, 3> << current_energy + E_mean_field
367  // total energy per particle in the system
368  << field<12, 6> << energy_per_part;
369  // change in total energy per particle (unless IC output is enabled)
370  if (total_particles == 0) {
371  ss << field<13, 6> << "N/A";
372  } else {
373  ss << field<13, 6> << (difference.momentum().x0()
374  + E_mean_field - E_mean_field_initial)
375  / total_particles;
376  }
377  ss << field<14, 3> << scatterings_this_interval
378  << field<10, 3> << total_particles
379  << field<9, 3> << elapsed_seconds;
380  // clang-format on
381  return ss.str();
382 }
383 
385  const Potentials &potentials,
387  RectangularLattice<std::pair<ThreeVector, ThreeVector>> *em_lattice,
388  const ExperimentParameters &parameters) {
389  // basic parameters and variables
390  const double V_cell = (jmuB_lat.cell_sizes())[0] *
391  (jmuB_lat.cell_sizes())[1] * (jmuB_lat.cell_sizes())[2];
392 
393  double E_mean_field = 0.0;
394  double density_mean = 0.0;
395  double density_variance = 0.0;
396 
397  /*
398  * We anticipate having other options, like the vector DFT potentials, in the
399  * future, hence we include checking which potentials are used.
400  */
401  if (potentials.use_skyrme()) {
402  /*
403  * Calculating the symmetry energy contribution to the total mean field
404  * energy in the system is not implemented at this time.
405  */
406  if (potentials.use_symmetry() &&
407  parameters.outputclock->current_time() == 0.0) {
408  logg[LExperiment].warn()
409  << "Note:"
410  << "\nSymmetry energy is not included in the mean field calculation."
411  << "\n\n";
412  }
413 
414  /*
415  * Skyrme potential parameters:
416  * C1GeV are the Skyrme coefficients converted to GeV,
417  * b1 are the powers of the baryon number density entering the expression
418  * for the energy density of the system. Note that these exponents are
419  * larger by 1 than those for the energy of a particle (which are used in
420  * Potentials class). The formula for a total mean field energy due to a
421  * Skyrme potential is E_MF = \sum_i (C_i/b_i) ( n_B^b_i )/( n_0^(b_i - 1) )
422  * where nB is the local rest frame baryon number density and n_0 is the
423  * saturation density. Then the single particle potential follows from
424  * V = d E_MF / d n_B .
425  */
426  double C1GeV = (potentials.skyrme_a()) / 1000.0;
427  double C2GeV = (potentials.skyrme_b()) / 1000.0;
428  double b1 = 2.0;
429  double b2 = (potentials.skyrme_tau()) + 1.0;
430 
431  /*
432  * Note: calculating the mean field only works if lattice is used.
433  * We iterate over the nodes of the baryon density lattice to sum their
434  * contributions to the total mean field.
435  */
436  int number_of_nodes = 0;
437  double lattice_mean_field_total = 0.0;
438 
439  for (auto &node : jmuB_lat) {
440  number_of_nodes++;
441  // the rest frame density
442  double rhoB = node.rho();
443  // the computational frame density
444  const double j0B = node.jmu_net().x0();
445 
446  const double abs_rhoB = std::abs(rhoB);
447  if (abs_rhoB < very_small_double) {
448  continue;
449  }
450  density_mean += j0B;
451  density_variance += j0B * j0B;
452 
453  /*
454  * The mean-field energy for the Skyrme potential. Note: this expression
455  * is only exact in the rest frame, and is expected to significantly
456  * deviate from the correct value for systems that are considerably
457  * relativistic. Note: symmetry energy is not taken into the account.
458  *
459  * TODO: Add symmetry energy.
460  */
461  double mean_field_contribution_1 = (C1GeV / b1) * std::pow(abs_rhoB, b1) /
462  std::pow(nuclear_density, b1 - 1);
463  double mean_field_contribution_2 = (C2GeV / b2) * std::pow(abs_rhoB, b2) /
464  std::pow(nuclear_density, b2 - 1);
465 
466  lattice_mean_field_total +=
467  V_cell * (mean_field_contribution_1 + mean_field_contribution_2);
468  }
469 
470  // logging statistical properties of the density calculation
471  density_mean = density_mean / number_of_nodes;
472  density_variance = density_variance / number_of_nodes;
473  double density_scaled_variance =
474  std::sqrt(density_variance - density_mean * density_mean) /
475  density_mean;
476  logg[LExperiment].debug() << "\t\t\t\t\t";
477  logg[LExperiment].debug()
478  << "\n\t\t\t\t\t density mean = " << density_mean;
479  logg[LExperiment].debug()
480  << "\n\t\t\t\t\t density scaled variance = " << density_scaled_variance;
481  logg[LExperiment].debug()
482  << "\n\t\t\t\t\t total mean_field = "
483  << lattice_mean_field_total * parameters.testparticles *
484  parameters.n_ensembles
485  << "\n";
486 
487  E_mean_field = lattice_mean_field_total;
488  } // if (potentials.use_skyrme())
489 
490  if (potentials.use_vdf()) {
491  /*
492  * Safety check:
493  * Calculating the symmetry energy contribution to the total mean field
494  * energy in the system is not implemented at this time.
495  */
496  if (potentials.use_symmetry() &&
497  parameters.outputclock->current_time() == 0.0) {
498  logg[LExperiment].error()
499  << "\nSymmetry energy is not included in the VDF mean-field "
500  "calculation"
501  << "\nas VDF potentials haven't been fitted with symmetry energy."
502  << "\n\n";
503  }
504 
505  /*
506  * The total mean-field energy density due to a VDF potential is
507  * E_MF = \sum_i C_i rho^(b_i - 2) *
508  * * [j_0^2 - rho^2 * (b_i - 1)/b_i] / rho_0^(b_i - 1)
509  * where j_0 is the local computational frame baryon density, rho is the
510  * local rest frame baryon density, and rho_0 is the saturation density.
511  */
512 
513  // saturation density of nuclear matter specified in the VDF parameters
514  double rhoB_0 = potentials.saturation_density();
515 
516  /*
517  * Note: calculating the mean field only works if lattice is used.
518  * We iterate over the nodes of the baryon density lattice to sum their
519  * contributions to the total mean field.
520  */
521  int number_of_nodes = 0;
522  double lattice_mean_field_total = 0.0;
523 
524  for (auto &node : jmuB_lat) {
525  number_of_nodes++;
526  // the rest frame density
527  double rhoB = node.rho();
528  // the computational frame density
529  const double j0B = node.jmu_net().x0();
530  double abs_rhoB = std::abs(rhoB);
531  density_mean += j0B;
532  density_variance += j0B * j0B;
533 
534  /*
535  * The mean-field energy for the VDF potential. This expression is correct
536  * in any frame, and in the rest frame conforms to the Skyrme mean-field
537  * energy (if same coefficients and powers are used).
538  */
539  // in order to prevent dividing by zero in case any b_i < 2.0
540  if (abs_rhoB < very_small_double) {
541  abs_rhoB = very_small_double;
542  }
543  double mean_field_contribution = 0.0;
544  for (int i = 0; i < potentials.number_of_terms(); i++) {
545  mean_field_contribution +=
546  potentials.coeffs()[i] *
547  std::pow(abs_rhoB, potentials.powers()[i] - 2.0) *
548  (j0B * j0B -
549  ((potentials.powers()[i] - 1.0) / potentials.powers()[i]) *
550  abs_rhoB * abs_rhoB) /
551  std::pow(rhoB_0, potentials.powers()[i] - 1.0);
552  }
553  lattice_mean_field_total += V_cell * mean_field_contribution;
554  }
555 
556  // logging statistical properties of the density calculation
557  density_mean = density_mean / number_of_nodes;
558  density_variance = density_variance / number_of_nodes;
559  double density_scaled_variance =
560  std::sqrt(density_variance - density_mean * density_mean) /
561  density_mean;
562  logg[LExperiment].debug() << "\t\t\t\t\t";
563  logg[LExperiment].debug()
564  << "\n\t\t\t\t\t density mean = " << density_mean;
565  logg[LExperiment].debug()
566  << "\n\t\t\t\t\t density scaled variance = " << density_scaled_variance;
567  logg[LExperiment].debug()
568  << "\n\t\t\t\t\t total mean_field = "
569  << lattice_mean_field_total * parameters.testparticles *
570  parameters.n_ensembles
571  << "\n";
572 
573  E_mean_field = lattice_mean_field_total;
574  }
575 
576  double electromagnetic_potential = 0.0;
577  if (potentials.use_coulomb() && em_lattice) {
578  // Use cell volume of electromagnetic fields lattice even though it should
579  // be the same as for net-baryon density
580  double V_cell_em = em_lattice->cell_sizes()[0] *
581  em_lattice->cell_sizes()[1] *
582  em_lattice->cell_sizes()[2];
583  for (auto &fields : *em_lattice) {
584  // Energy is 0.5 * int E^2 + B^2 dV
585  electromagnetic_potential +=
586  hbarc * 0.5 * V_cell_em * (fields.first.sqr() + fields.second.sqr());
587  }
588  }
589  logg[LExperiment].debug() << "Total energy in electromagnetic field = "
590  << electromagnetic_potential;
591  E_mean_field += electromagnetic_potential;
592  /*
593  * E_mean_field is multiplied by the number of testparticles per particle and
594  * the number of parallel ensembles because the total kinetic energy tracked
595  * is that of all particles in the simulation, including test-particles and/or
596  * ensembles, and so this way is more consistent.
597  */
598  E_mean_field =
599  E_mean_field * parameters.testparticles * parameters.n_ensembles;
600 
601  return E_mean_field;
602 }
603 
604 EventInfo fill_event_info(const std::vector<Particles> &ensembles,
605  double E_mean_field, double modus_impact_parameter,
606  const ExperimentParameters &parameters,
607  bool projectile_target_interact,
608  bool kinematic_cut_for_SMASH_IC) {
609  const QuantumNumbers current_values(ensembles);
610  const double E_kinetic_total = current_values.momentum().x0();
611  const double E_total = E_kinetic_total + E_mean_field;
612 
613  EventInfo event_info{modus_impact_parameter,
614  parameters.box_length,
615  parameters.outputclock->current_time(),
616  E_kinetic_total,
617  E_mean_field,
618  E_total,
619  parameters.testparticles,
620  parameters.n_ensembles,
621  !projectile_target_interact,
622  kinematic_cut_for_SMASH_IC};
623  return event_info;
624 }
625 
626 void validate_and_adjust_particle_list(ParticleList &particle_list) {
627  static bool warn_mass_discrepancy = true;
628  static bool warn_off_shell_particle = true;
629  for (auto it = particle_list.begin(); it != particle_list.end();) {
630  auto &particle = *it;
631  auto pdgcode = particle.pdgcode();
632  try {
633  // Convert Kaon-L or Kaon-S into K0 or Anti-K0 used in SMASH
634  if (pdgcode == 0x310 || pdgcode == 0x130) {
635  pdgcode = (random::uniform_int(0, 1) == 0) ? pdg::K_z : pdg::Kbar_z;
636  }
637  /* ATTENTION: It would be wrong to directly assign here the return value
638  * to 'particle', because this would potentially also change its id and
639  * process number, which in turn, might lead to actions to be discarded.
640  * Here, only the particle momentum has to be adjusted and this is done
641  * creating a new particle and using its momentum to set 'particle' one.
642  */
643  auto valid_smash_particle =
645  pdgcode, particle.effective_mass(), particle.momentum(),
646  LExperiment, warn_mass_discrepancy, warn_off_shell_particle);
647  particle.set_4momentum(valid_smash_particle.momentum());
648  particle.set_cross_section_scaling_factor(1.0);
649  it++;
651  logg[LExperiment].warn()
652  << "SMASH does not recognize pdg code " << pdgcode
653  << " obtained from hadron list. This particle will be ignored.\n";
654  it = particle_list.erase(it);
655  }
656  }
657 }
658 
659 } // namespace smash
Interface to the SMASH configuration files.
bool has_value(std::initializer_list< const char * > keys) const
Return whether there is a non-empty value behind the requested keys.
void remove_all_entries_in_section_but_one(const std::string &key, std::initializer_list< const char * > section={})
Remove all entries in the given section except for key.
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
Value read(std::initializer_list< const char * > keys) const
Additional interface for SMASH to read configuration values without removing them.
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 const ParticleTypePtr try_find(PdgCode pdgcode)
Returns the ParticleTypePtr for the given pdgcode.
Definition: particletype.cc:89
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:32
const std::vector< double > & powers() const
Definition: potentials.h:352
virtual bool use_symmetry() const
Definition: potentials.h:332
const std::vector< double > & coeffs() const
Definition: potentials.h:350
virtual bool use_skyrme() const
Definition: potentials.h:330
virtual bool use_coulomb() const
Definition: potentials.h:334
double skyrme_a() const
Definition: potentials.h:337
double skyrme_tau() const
Definition: potentials.h:341
int number_of_terms() const
Definition: potentials.h:354
double skyrme_b() const
Definition: potentials.h:339
virtual bool use_vdf() const
Definition: potentials.h:346
double saturation_density() const
Definition: potentials.h:348
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:47
const std::array< double, 3 > & cell_sizes() const
Definition: lattice.h:160
std::bitset< 10 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
@ Strings
Use string fragmentation.
std::bitset< 4 > MultiParticleReactionsBitSet
Container for the n to m reactions in the code.
@ Stochastic
Stochastic Criteiron.
@ Covariant
Covariant Criterion.
#define SMASH_SOURCE_LOCATION
Hackery that is required to output the location in the source code where the log statement occurs.
Definition: logging.h:150
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
constexpr int K_z
K⁰.
constexpr int p
Proton.
constexpr int pi_z
π⁰.
constexpr int Kbar_z
K̄⁰.
T uniform_int(T min, T max)
Definition: random.h:100
Definition: action.h:24
ParticleData create_valid_smash_particle_matching_provided_quantities(PdgCode pdgcode, double mass, const FourVector &four_momentum, int log_area, bool &mass_warning, bool &on_shell_warning)
This function creates a SMASH particle validating the provided information.
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:604
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:336
ExperimentParameters create_experiment_parameters(Configuration &config)
Gathers all general Experiment parameters.
Definition: experiment.cc:132
constexpr double very_small_double
A very small double, used to avoid division by zero.
Definition: constants.h:40
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:384
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:626
constexpr double nuclear_density
Ground state density of symmetric nuclear matter [fm^-3].
Definition: constants.h:48
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:25
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:143
Exception class that is thrown if the requested output path in the Experiment factory is not existing...
Definition: experiment.h:152
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.