Version: SMASH-3.3
nucleus.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2025
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #include "smash/nucleus.h"
8 
9 #include <fstream>
10 #include <iostream>
11 #include <limits>
12 #include <map>
13 #include <string>
14 
15 #include "smash/angles.h"
16 #include "smash/constants.h"
17 #include "smash/fourvector.h"
18 #include "smash/input_keys.h"
19 #include "smash/logging.h"
20 #include "smash/numerics.h"
21 #include "smash/particles.h"
22 #include "smash/random.h"
23 #include "smash/threevector.h"
24 
25 namespace smash {
26 static constexpr int LNucleus = LogArea::Nucleus::id;
27 
28 Nucleus::Nucleus(const std::map<PdgCode, int> &particle_list, int nTest,
29  SpinInteractionType spin_interaction_type) {
30  fill_from_list(particle_list, nTest);
33  if (spin_interaction_type != SpinInteractionType::Off) {
35  }
36 }
37 
38 Nucleus::Nucleus(Configuration &config, int nTest) {
39  assert(has_projectile_or_target(config));
40  const bool is_projectile = is_about_projectile(config);
41  const SpinInteractionType spin_interaction_type =
43  const auto &[particles_key, diffusiveness_key, radius_key,
44  saturation_key] = [&is_projectile]() {
45  return is_projectile
46  ? std::make_tuple(
51  : std::make_tuple(
56  }();
57  // Fill nuclei with particles.
58  std::map<PdgCode, int> part = config.take(particles_key);
59  fill_from_list(part, nTest);
60  if (spin_interaction_type != SpinInteractionType::Off) {
62  }
63  // Look for user-defined values or take the default parameters.
64  const bool is_diffusiveness_given = config.has_value(diffusiveness_key),
65  is_radius_given = config.has_value(radius_key),
66  is_saturation_given = config.has_value(saturation_key);
67  if (is_diffusiveness_given && is_radius_given && is_saturation_given) {
68  diffusiveness_ = config.take(diffusiveness_key);
69  nuclear_radius_ = config.take(radius_key);
70  saturation_density_ = config.take(saturation_key);
71  } else if (!is_diffusiveness_given && !is_radius_given &&
72  !is_saturation_given) {
75  } else {
76  throw std::invalid_argument(
77  "Diffusiveness, Radius and Saturation_Density required to manually "
78  "configure the Woods-Saxon distribution. Only one or two were provided."
79  "\nProviding none of the above mentioned parameters automatically "
80  "configures the distribution based on the atomic number.");
81  }
82 }
83 
84 double Nucleus::mass() const {
85  double total_mass = 0.;
86  for (auto i = cbegin(); i != cend(); i++) {
87  total_mass += i->momentum().abs();
88  }
89  return total_mass / (testparticles_ + 0.0);
90 }
91 
240  // Get the solid angle of the nucleon.
241  Angles dir;
243  // diffusiveness_ zero or negative? Use hard sphere.
244  if (almost_equal(diffusiveness_, 0.)) {
245  return dir.threevec() * nuclear_radius_ * std::cbrt(random::canonical());
246  }
247  if (almost_equal(nuclear_radius_, 0.)) {
248  return smash::ThreeVector();
249  }
250  double radius_scaled = nuclear_radius_ / diffusiveness_;
251  double prob_range1 = 1.0;
252  double prob_range2 = 3. / radius_scaled;
253  double prob_range3 = 2. * prob_range2 / radius_scaled;
254  double prob_range4 = 1. * prob_range3 / radius_scaled;
255  double ranges234 = prob_range2 + prob_range3 + prob_range4;
256  double t;
258  do {
259  double which_range = random::uniform(-prob_range1, ranges234);
260  if (which_range < 0.0) {
261  t = radius_scaled * (std::cbrt(random::canonical()) - 1.);
262  } else {
263  t = -std::log(random::canonical());
264  if (which_range >= prob_range2) {
265  t -= std::log(random::canonical());
266  if (which_range >= prob_range2 + prob_range3) {
267  t -= std::log(random::canonical());
268  }
269  }
270  }
278  } while (random::canonical() > 1. / (1. + std::exp(-std::abs(t))));
280  double position_scaled = t + radius_scaled;
281  double position = position_scaled * diffusiveness_;
282  return dir.threevec() * position;
283 }
284 
285 double Nucleus::woods_saxon(double r) {
286  return r * r / (std::exp((r - nuclear_radius_) / diffusiveness_) + 1);
287 }
288 
290  for (auto i = begin(); i != end(); i++) {
291  // Initialize momentum
292  i->set_4momentum(i->pole_mass(), 0.0, 0.0, 0.0);
293  /* Sampling the Woods-Saxon, get the radial
294  * position and solid angle for the nucleon. */
296 
297  // Set the position of the nucleon.
298  i->set_4position(FourVector(0.0, pos));
299  }
300 
301  // Recenter and rotate
302  align_center();
303  rotate();
304 }
305 
308  int Z = Nucleus::number_of_protons();
309  if (A == 1) { // single particle
310  /* In case of testparticles, an infinite reaction loop will be
311  * avoided by a small finite spread according to a single particles
312  * 'nucleus'. The proper solution will be to introduce parallel
313  * ensembles. */
315  testparticles_ == 1 ? 0. : 1. - std::exp(-(testparticles_ - 1.) * 0.1));
316  set_diffusiveness(testparticles_ == 1 ? -1. : 0.02);
317  } else if ((A == 238) && (Z == 92)) { // Uranium
318  // Default values.
319  set_diffusiveness(0.556);
320  set_nuclear_radius(6.86);
321  } else if ((A == 208) && (Z == 82)) { // Lead
322  // Default values.
323  set_diffusiveness(0.54);
324  set_nuclear_radius(6.67);
325  } else if ((A == 197) && (Z == 79)) { // Gold
326  // Default values from \iref{Schopper:2004qco}
327  set_diffusiveness(0.523);
328  set_nuclear_radius(6.55);
329  } else if ((A == 129) && (Z == 54)) { // Xenon
330  // Default values.
331  set_diffusiveness(0.59);
332  set_nuclear_radius(5.36);
333  } else if ((A == 63) && (Z == 29)) { // Copper
334  // Default values.
335  set_diffusiveness(0.5977);
336  set_nuclear_radius(4.20641);
337  } else if (A == 96) {
338  if (Z == 40) { // Zirconium
339  // Default values.
340  set_diffusiveness(0.46);
341  set_nuclear_radius(5.02);
342  } else if (Z == 44) { // Ruthenium
343  // Default values.
344  set_diffusiveness(0.46);
345  set_nuclear_radius(5.085);
346  } else {
347  // radius and diffusiveness taken from \iref{Rybczynski:2013yba}
348  set_diffusiveness(0.54);
349  set_nuclear_radius(1.12 * std::pow(A, 1.0 / 3.0) -
350  0.86 * std::pow(A, -1.0 / 3.0));
351  }
352  } else {
353  // saturation density already has reasonable default
355  if (A <= 16) {
356  set_diffusiveness(0.545);
357  } else {
358  // diffusiveness taken from \iref{Rybczynski:2013yba}
359  set_diffusiveness(0.54);
360  }
361  }
362 }
363 
365  const bool is_projectile =
366  has_projectile_or_target(config) ? is_about_projectile(config) : true;
367  const auto &[rotation_key, theta_key, phi_key, psi_key] = [&is_projectile]() {
368  return is_projectile
369  ? std::make_tuple(
374  : std::make_tuple(
379  }();
380  const bool was_any_angle_provided = config.has_value(theta_key) ||
381  config.has_value(phi_key) ||
382  config.has_value(psi_key);
383  random_rotation_ = config.take(rotation_key);
384  if (random_rotation_ && was_any_angle_provided) {
385  throw std::domain_error(
386  "The random rotation of nuclei has been requested, but some specific "
387  "rotation angle is provided, too. Please specify only either of them.");
388  } else {
389  euler_theta_ = config.take(theta_key);
390  euler_phi_ = config.take(phi_key);
391  euler_psi_ = config.take(psi_key);
392  }
393 }
394 
396  if (random_rotation_) {
397  // Randomly generate euler angles for theta and phi. Psi needs not be
398  // assigned, as the nucleus objects are symmetric with respect to psi.
400  }
401  if (euler_phi_ != 0.0 || euler_theta_ != 0.0 || euler_psi_ != 0.0) {
402  for (auto &particle : *this) {
403  /* Rotate every vector by the euler angles phi, theta and psi.
404  * This means applying the matrix for a rotation of phi around the z-axis,
405  * followed by the matrix for a rotation of theta around the rotated
406  * x-axis and the matrix for a rotation of psi around the rotated z-axis.
407  */
408  ThreeVector three_pos = particle.position().threevec();
410  particle.set_3position(three_pos);
411  }
412  }
413 }
414 
416  const int N_n = std::count_if(begin(), end(), [](const ParticleData i) {
417  return i.pdgcode() == pdg::n;
418  });
419  const int N_p = std::count_if(begin(), end(), [](const ParticleData i) {
420  return i.pdgcode() == pdg::p;
421  });
422  const FourVector nucleus_center = center();
423  const int A = N_n + N_p;
424  constexpr double pi2_3 = 3.0 * M_PI * M_PI;
425  logg[LNucleus].debug() << N_n << " neutrons, " << N_p << " protons.";
426 
427  ThreeVector ptot = ThreeVector(0.0, 0.0, 0.0);
428  for (auto i = begin(); i != end(); i++) {
429  // Only protons and neutrons get Fermi momenta
430  if (i->pdgcode() != pdg::p && i->pdgcode() != pdg::n) {
431  if (i->is_baryon()) {
432  logg[LNucleus].warn() << "No rule to calculate Fermi momentum "
433  << "for particle " << i->pdgcode();
434  }
435  continue;
436  }
437  const double r = (i->position() - nucleus_center).abs3();
438  const double theta = (i->position().threevec().get_theta());
439  const double phi = (i->position().threevec().get_phi());
440  double rho = nucleon_density(r, std::cos(theta), phi);
441 
442  if (i->pdgcode() == pdg::p) {
443  rho = rho * N_p / A;
444  }
445  if (i->pdgcode() == pdg::n) {
446  rho = rho * N_n / A;
447  }
448  const double p =
449  hbarc * std::pow(pi2_3 * rho * random::uniform(0.0, 1.0), 1.0 / 3.0);
450  Angles phitheta;
451  phitheta.distribute_isotropically();
452  const ThreeVector ith_3momentum = phitheta.threevec() * p;
453  ptot += ith_3momentum;
454  i->set_3momentum(ith_3momentum);
455  logg[LNucleus].debug() << "Particle: " << *i << ", pF[GeV]: "
456  << hbarc * std::pow(pi2_3 * rho, 1.0 / 3.0)
457  << " r[fm]: " << r
458  << " Nuclear radius[fm]: " << nuclear_radius_;
459  }
460  if (A == 0) {
461  // No Fermi momenta should be assigned
462  assert(ptot.x1() == 0.0 && ptot.x2() == 0.0 && ptot.x3() == 0.0);
463  } else {
464  /* Ensure zero total momentum of nucleus - redistribute ptot equally
465  * among protons and neutrons */
466  const ThreeVector centralizer = ptot / A;
467  for (auto i = begin(); i != end(); i++) {
468  if (i->pdgcode() == pdg::p || i->pdgcode() == pdg::n) {
469  i->set_4momentum(i->pole_mass(),
470  i->momentum().threevec() - centralizer);
471  }
472  }
473  }
474 }
475 
476 void Nucleus::boost(double beta_scalar) {
477  double beta_squared = beta_scalar * beta_scalar;
478  double one_over_gamma = std::sqrt(1.0 - beta_squared);
479  double gamma = 1.0 / one_over_gamma;
480  /* We are talking about a /passive/ lorentz transformation here, as
481  * far as I can see, so we need to boost in the direction opposite to
482  * where we want to go
483  * ( The vector we transform - p - stays unchanged, but we go into
484  * a system that moves with -beta. Now in this frame, it seems
485  * like p has been accelerated with +beta.
486  * ) */
487  for (auto i = begin(); i != end(); i++) {
488  /* a real Lorentz Transformation would leave the particles at
489  * different times here, which we would then have to propagate back
490  * to equal times. Since we know the result, we can simply multiply
491  * the z-value with 1/gamma. */
492  FourVector this_position = i->position();
493  this_position.set_x3(this_position.x3() * one_over_gamma);
494  i->set_4position(this_position);
495  /* The simple Lorentz transformation of momenta does not take into account
496  * that nucleus has binding energy. Here we apply the method used
497  * in the JAM code \iref{Nara:1999dz}: p' = p_beam + gamma*p_F.
498  * This formula is derived under assumption that all nucleons have
499  * the same binding energy. */
500  FourVector mom_i = i->momentum();
501  i->set_4momentum(i->pole_mass(), mom_i.x1(), mom_i.x2(),
502  gamma * (beta_scalar * mom_i.x0() + mom_i.x3()));
503  }
504 }
505 
506 void Nucleus::fill_from_list(const std::map<PdgCode, int> &particle_list,
507  int testparticles) {
508  testparticles_ = testparticles;
509  for (auto n = particle_list.cbegin(); n != particle_list.cend(); ++n) {
510  const ParticleType &current_type = ParticleType::find(n->first);
511  double current_mass = current_type.mass();
512  for (unsigned int i = 0; i < n->second * testparticles_; i++) {
513  // append particle to list and set its PDG code.
514  particles_.emplace_back(current_type);
515  particles_.back().set_4momentum(current_mass, 0.0, 0.0, 0.0);
516  }
517  }
518 }
519 
520 void Nucleus::shift(double z_offset, double x_offset, double simulation_time) {
521  // Move the nucleus in z and x directions, and set the time.
522  for (auto i = begin(); i != end(); i++) {
523  FourVector this_position = i->position();
524  this_position.set_x3(this_position.x3() + z_offset);
525  this_position.set_x1(this_position.x1() + x_offset);
526  this_position.set_x0(simulation_time);
527  i->set_4position(this_position);
528  i->set_formation_time(simulation_time);
529  }
530 }
531 
532 void Nucleus::copy_particles(Particles *external_particles) {
533  for (auto p = begin(); p != end(); p++) {
534  external_particles->insert(*p);
535  }
536 }
537 
539  FourVector centerpoint(0.0, 0.0, 0.0, 0.0);
540  for (auto p = cbegin(); p != cend(); p++) {
541  centerpoint += p->position();
542  }
543  centerpoint /= size();
544  return centerpoint;
545 }
546 
548  // Sample euler_theta_ such that cos(theta) is uniform
549  euler_phi_ = twopi * random::uniform(0., 1.);
550  euler_theta_ = std::acos(2 * random::uniform(0., 1.) - 1);
551  euler_psi_ = twopi * random::uniform(0., 1.);
552 }
553 
554 double Nucleus::nucleon_density(double r, double, double) const {
555  return get_saturation_density() /
556  (std::exp((r - nuclear_radius_) / diffusiveness_) + 1.);
557 }
558 
559 double Nucleus::nucleon_density_unnormalized(double r, double, double) const {
560  return 1.0 / (std::exp((r - nuclear_radius_) / diffusiveness_) + 1.);
561 }
562 
565  // Transform integral from (0, oo) to (0, 1) via r = (1 - t) / t.
566  // To prevent overflow, the integration is only performed to t = 0.01 which
567  // corresponds to r = 99fm. Additionally the precision settings in the
568  // Integrator2d scheme are equally important. However both these point affect
569  // the result only after the seventh digit which should not be relevant here.
570  const auto result = integrate(0.01, 1, -1, 1, [&](double t, double cosx) {
571  const double r = (1 - t) / t;
572  return twopi * std::pow(r, 2.0) *
573  nucleon_density_unnormalized(r, cosx, 0.0) / std::pow(t, 2.0);
574  });
575  const auto rho0 = number_of_particles() / result.value();
576  return rho0;
577 }
578 
579 std::ostream &operator<<(std::ostream &out, const Nucleus &n) {
580  return out << " #particles #testparticles mass [GeV] "
581  "radius [fm] diffusiveness [fm]\n"
582  << format(n.number_of_particles(), nullptr, 12)
583  << format(n.size(), nullptr, 17) << format(n.mass(), nullptr, 13)
584  << format(n.get_nuclear_radius(), nullptr, 14)
585  << format(n.get_diffusiveness(), nullptr, 20);
586 }
587 
589  const bool is_projectile = config.has_section(InputSections::m_c_projectile);
590  const bool is_target = config.has_section(InputSections::m_c_target);
591  return is_projectile || is_target;
592 }
593 
594 bool is_about_projectile(const Configuration &config) {
595  const bool is_projectile = config.has_section(InputSections::m_c_projectile);
596  const bool is_target = config.has_section(InputSections::m_c_target);
597  if (is_projectile == is_target) {
598  throw std::logic_error(
599  "Error parsing configuration of EITHER projectile OR target.\n"
600  "Configuration tested for it contains the following:\n------------\n" +
601  config.to_string() + "\n------------\n");
602  }
603  return is_projectile;
604 }
605 
606 } // namespace smash
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
Definition: angles.h:59
ThreeVector threevec() const
Definition: angles.h:288
void distribute_isotropically()
Populate the object with a new direction.
Definition: angles.h:199
Interface to the SMASH configuration files.
std::string to_string() const
Return a string of the current YAML tree.
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.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
double x3() const
Definition: fourvector.h:325
double x2() const
Definition: fourvector.h:321
ThreeVector threevec() const
Definition: fourvector.h:329
double x0() const
Definition: fourvector.h:313
void set_x3(double z)
Definition: fourvector.h:327
void set_x1(double x)
Definition: fourvector.h:319
double x1() const
Definition: fourvector.h:317
void set_x0(double t)
Definition: fourvector.h:315
A C++ interface for numerical integration in two dimensions with the Cuba Cuhre integration function.
Definition: integrate.h:219
A nucleus is a collection of particles that are initialized, before the beginning of the simulation a...
Definition: nucleus.h:27
Nucleus()=default
default constructor
double euler_theta_
Euler angle theta.
Definition: nucleus.h:308
std::vector< ParticleData >::const_iterator cbegin() const
For const iterators over the particle list:
Definition: nucleus.h:322
virtual double nucleon_density_unnormalized(double r, double, double) const
Return the unnormalized Woods-Saxon distribution for the given position without deformation.
Definition: nucleus.cc:559
void shift(double z_offset, double x_offset, double simulation_time)
Shifts the nucleus to correct impact parameter and z displacement.
Definition: nucleus.cc:520
double get_saturation_density() const
Definition: nucleus.h:343
double woods_saxon(double x)
Woods-Saxon distribution.
Definition: nucleus.cc:285
void random_euler_angles()
Randomly generate Euler angles.
Definition: nucleus.cc:547
virtual void arrange_nucleons()
Sets the positions of the nucleons inside a nucleus.
Definition: nucleus.cc:289
virtual double calculate_saturation_density() const
Definition: nucleus.cc:563
double default_nuclear_radius()
Default nuclear radius calculated as:
Definition: nucleus.h:351
double diffusiveness_
Diffusiveness of Woods-Saxon distribution of this nucleus in fm (for diffusiveness_ == 0,...
Definition: nucleus.h:269
double saturation_density_
Saturation density of this nucleus.
Definition: nucleus.h:293
FourVector center() const
Calculate geometrical center of the nucleus.
Definition: nucleus.cc:538
virtual void generate_fermi_momenta()
Generates momenta according to Fermi motion for the nucleons.
Definition: nucleus.cc:415
virtual void set_parameters_automatic()
Sets the deformation parameters of the Woods-Saxon distribution according to the current mass number.
Definition: nucleus.cc:306
std::vector< ParticleData >::const_iterator cend() const
For const iterators over the particle list:
Definition: nucleus.h:326
size_t size() const
Number of numerical (=test-)particles in the nucleus:
Definition: nucleus.h:151
size_t testparticles_
Number of testparticles per physical particle.
Definition: nucleus.h:278
virtual double nucleon_density(double r, double, double) const
Return the Woods-Saxon probability density for the given position.
Definition: nucleus.cc:554
double euler_phi_
The Euler angle phi of the three Euler angles used to apply rotations to the nucleus.
Definition: nucleus.h:306
double nuclear_radius_
Nuclear radius of this nucleus.
Definition: nucleus.h:271
void fill_from_list(const std::map< PdgCode, int > &particle_list, int testparticles)
Adds particles from a map PDG code => Number_of_particles_with_that_PDG_code to the nucleus.
Definition: nucleus.cc:506
std::vector< ParticleData > particles_
Particles associated with this nucleus.
Definition: nucleus.h:289
double euler_psi_
Euler angle psi.
Definition: nucleus.h:310
double mass() const
Definition: nucleus.cc:84
void make_nucleus_unpolarized()
Set unpolarized spin vectors for all particles in the nucleus.
Definition: nucleus.h:281
void align_center()
Shifts the nucleus so that its center is at (0,0,0)
Definition: nucleus.h:217
void copy_particles(Particles *particles)
Copies the particles from this nucleus into the particle list.
Definition: nucleus.cc:532
virtual void set_saturation_density(double density)
Sets the saturation density of the nucleus.
Definition: nucleus.h:255
void set_nuclear_radius(double rad)
Sets the nuclear radius.
Definition: nucleus.h:366
bool random_rotation_
Whether the nucleus should be rotated randomly.
Definition: nucleus.h:312
void set_diffusiveness(double diffuse)
Sets the diffusiveness of the nucleus.
Definition: nucleus.h:333
virtual void rotate()
Rotates the nucleus using the three euler angles phi, theta and psi.
Definition: nucleus.cc:395
std::vector< ParticleData >::iterator begin()
For iterators over the particle list:
Definition: nucleus.h:316
size_t number_of_protons() const
Number of physical protons in the nucleus:
Definition: nucleus.h:178
void boost(double beta_scalar)
Boosts the nuclei into the computational frame, such that the nucleons have the appropriate momentum ...
Definition: nucleus.cc:476
virtual ThreeVector distribute_nucleon()
The distribution of return values from this function is according to a spherically symmetric Woods-Sa...
Definition: nucleus.cc:239
size_t number_of_particles() const
Number of physical particles in the nucleus:
Definition: nucleus.h:159
void set_orientation_from_config(Configuration &orientation_config)
Set angles for rotation of the nucleus from config file.
Definition: nucleus.cc:364
std::vector< ParticleData >::iterator end()
For iterators over the particle list:
Definition: nucleus.h:320
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:59
PdgCode pdgcode() const
Get the pdgcode of the particle.
Definition: particledata.h:88
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
Definition: particledata.h:177
const FourVector & momentum() const
Get the particle's 4-momentum.
Definition: particledata.h:171
bool is_baryon() const
Definition: particledata.h:95
double pole_mass() const
Get the particle's pole mass ("on-shell").
Definition: particledata.h:119
void set_3momentum(const ThreeVector &mom)
Set the momentum of the particle without modifying the energy.
Definition: particledata.h:209
const FourVector & position() const
Get the particle's position in Minkowski space.
Definition: particledata.h:217
Particle type contains the static properties of a particle species.
Definition: particletype.h:98
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
Definition: particletype.cc:99
double mass() const
Definition: particletype.h:145
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
const ParticleData & insert(const ParticleData &p)
Inserts the particle into the list of particles.
Definition: particles.cc:50
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
double get_phi() const
Definition: threevector.h:279
double x3() const
Definition: threevector.h:194
void rotate(double phi, double theta, double psi)
Rotate vector by the given Euler angles phi, theta, psi.
Definition: threevector.h:292
double x2() const
Definition: threevector.h:190
double get_theta() const
Definition: threevector.h:287
double x1() const
Definition: threevector.h:186
Collection of useful constants that are known at compile time.
SpinInteractionType
Possible spin interaction types.
@ Off
No spin interactions.
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.
Definition: action.h:555
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:40
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:217
constexpr int p
Proton.
constexpr int n
Neutron.
T uniform(T min, T max)
Definition: random.h:88
T canonical()
Definition: random.h:113
Definition: action.h:24
bool almost_equal(const N x, const N y)
Checks whether two floating-point numbers are almost equal.
Definition: numerics.h:89
static Integrator integrate
Definition: decaytype.cc:143
constexpr double twopi
.
Definition: constants.h:49
bool has_projectile_or_target(const Configuration &config)
Find out whether a configuration has a projectile or a target sub-section.
Definition: nucleus.cc:588
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:29
bool is_about_projectile(const Configuration &config)
Find out whether a configuration is about projectile or target.
Definition: nucleus.cc:594
static constexpr int LNucleus
Definition: nucleus.cc:26
Generic numerical functions.
static const Key< double > modi_collider_projectile_saturationDensity
See user guide description for more information.
Definition: input_keys.h:3403
static const Key< double > modi_collider_projectile_radius
See user guide description for more information.
Definition: input_keys.h:3380
static const Key< double > modi_collider_target_orientation_theta
See user guide description for more information.
Definition: input_keys.h:3754
static const Key< double > modi_collider_projectile_diffusiveness
See user guide description for more information.
Definition: input_keys.h:3326
static const Key< double > modi_collider_target_saturationDensity
See user guide description for more information.
Definition: input_keys.h:3410
static const Key< bool > modi_collider_target_orientation_randRot
See user guide description for more information.
Definition: input_keys.h:3791
static const Key< double > modi_collider_projectile_orientation_theta
See user guide description for more information.
Definition: input_keys.h:3749
static const Key< double > modi_collider_target_radius
See user guide description for more information.
Definition: input_keys.h:3387
static const Key< std::map< PdgCode, int > > modi_collider_target_particles
See user guide description for more information.
Definition: input_keys.h:3360
static const Key< double > modi_collider_target_diffusiveness
See user guide description for more information.
Definition: input_keys.h:3333
static const Key< std::map< PdgCode, int > > modi_collider_projectile_particles
See user guide description for more information.
Definition: input_keys.h:3354
static const Key< double > modi_collider_target_orientation_phi
See user guide description for more information.
Definition: input_keys.h:3736
static const Key< double > modi_collider_projectile_orientation_psi
See user guide description for more information.
Definition: input_keys.h:3767
static const Key< SpinInteractionType > collTerm_spinInteractions
See user guide description for more information.
Definition: input_keys.h:2549
static const Key< double > modi_collider_target_orientation_psi
See user guide description for more information.
Definition: input_keys.h:3772
static const Key< double > modi_collider_projectile_orientation_phi
See user guide description for more information.
Definition: input_keys.h:3731
static const Key< bool > modi_collider_projectile_orientation_randRot
See user guide description for more information.
Definition: input_keys.h:3786
static const Section m_c_projectile
Subsection for the projectile in collider modus.
Definition: input_keys.h:102
static const Section m_c_target
Subsection for the target in collider modus.
Definition: input_keys.h:117