Version: SMASH-2.2
action.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2022
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #include "smash/action.h"
11 
12 #include <assert.h>
13 #include <algorithm>
14 #include <sstream>
15 
16 #include "smash/angles.h"
17 #include "smash/constants.h"
18 #include "smash/logging.h"
19 #include "smash/pauliblocking.h"
21 #include "smash/quantumnumbers.h"
22 
23 namespace smash {
25 Action::~Action() = default;
26 static constexpr int LPauliBlocking = LogArea::PauliBlocking::id;
27 
28 bool Action::is_valid(const Particles &particles) const {
29  return std::all_of(
31  [&particles](const ParticleData &p) { return particles.is_valid(p); });
32 }
33 
34 bool Action::is_pauli_blocked(const std::vector<Particles> &ensembles,
35  const PauliBlocker &p_bl) const {
36  // Wall-crossing actions should never be blocked: currently
37  // if the action is blocked, a particle continues to propagate in a straight
38  // line. This would simply bring it out of the box.
40  return false;
41  }
42  for (const auto &p : outgoing_particles_) {
43  if (p.is_baryon()) {
44  const auto f =
45  p_bl.phasespace_dens(p.position().threevec(), p.momentum().threevec(),
46  ensembles, p.pdgcode(), incoming_particles_);
47  if (f > random::uniform(0., 1.)) {
48  logg[LPauliBlocking].debug("Action ", *this,
49  " is pauli-blocked with f = ", f);
50  return true;
51  }
52  }
53  }
54  return false;
55 }
56 
57 const ParticleList &Action::incoming_particles() const {
58  return incoming_particles_;
59 }
60 
61 void Action::update_incoming(const Particles &particles) {
62  for (auto &p : incoming_particles_) {
63  p = particles.lookup(p);
64  }
65 }
66 
68  // Estimate for the interaction point in the calculational frame
69  ThreeVector interaction_point = ThreeVector(0., 0., 0.);
70  std::vector<ThreeVector> propagated_positions;
71  for (const auto &part : incoming_particles_) {
72  ThreeVector propagated_position =
73  part.position().threevec() +
74  part.velocity() * (time_of_execution_ - part.position().x0());
75  propagated_positions.push_back(propagated_position);
76  interaction_point += propagated_position;
77  }
78  interaction_point /= incoming_particles_.size();
79  /*
80  * In case of periodic boundaries interaction point is not necessarily
81  * (x1 + x2)/2. Consider only one dimension, e.g. x, the rest are analogous.
82  * Instead of x, there can be x + k * L, where k is any integer and L
83  * is period.Interaction point is either. Therefore, interaction point is
84  * (x1 + k * L + x2 + m * L) / 2 = (x1 + x2) / 2 + n * L / 2. We need
85  * this interaction point to be with [0, L], so n can be {-1, 0, 1}.
86  * Which n to choose? Our guiding principle is that n should be such that
87  * interaction point is closest to interacting particles.
88  */
89  if (box_length_ > 0 && stochastic_position_idx_ < 0) {
90  assert(incoming_particles_.size() == 2);
91  const ThreeVector r = propagated_positions[0] - propagated_positions[1];
92  for (int i = 0; i < 3; i++) {
93  const double d = std::abs(r[i]);
94  if (d > 0.5 * box_length_) {
95  if (interaction_point[i] >= 0.5 * box_length_) {
96  interaction_point[i] -= 0.5 * box_length_;
97  } else {
98  interaction_point[i] += 0.5 * box_length_;
99  }
100  }
101  }
102  }
103  /* In case of scatterings via the stochastic criterion, use postion of random
104  * incoming particle to prevent density hotspots in grid cell centers. */
105  if (stochastic_position_idx_ >= 0) {
107  }
108  return FourVector(time_of_execution_, interaction_point);
109 }
110 
111 std::pair<FourVector, FourVector> Action::get_potential_at_interaction_point()
112  const {
114  FourVector UB = FourVector();
115  FourVector UI3 = FourVector();
116  /* Check:
117  * Lattice is turned on. */
118  if (UB_lat_pointer != nullptr) {
119  UB_lat_pointer->value_at(r, UB);
120  }
121  if (UI3_lat_pointer != nullptr) {
122  UI3_lat_pointer->value_at(r, UI3);
123  }
124  return std::make_pair(UB, UI3);
125 }
126 
127 void Action::perform(Particles *particles, uint32_t id_process) {
128  assert(id_process != 0);
129 
131  // store the history info
133  p.set_history(p.get_history().collisions_per_particle + 1, id_process,
135  }
136  }
137 
138  /* For elastic collisions and box wall crossings it is not necessary to remove
139  * particles from the list and insert new ones, it is enough to update their
140  * properties. */
144 
145  logg[LAction].debug("Particle map now has ", particles->size(), " elements.");
146 
147  /* Check the conservation laws if the modifications of the total kinetic
148  * energy of the outgoing particles by the mean field potentials are not
149  * taken into account. */
150  if (UB_lat_pointer == nullptr && UI3_lat_pointer == nullptr) {
151  check_conservation(id_process);
152  }
153 }
154 
156  const auto potentials = get_potential_at_interaction_point();
157  /* scale_B returns the difference of the total force scales of the skyrme
158  * potential between the initial and final states. */
159  double scale_B = 0.0;
160  /* scale_I3 returns the difference of the total force scales of the symmetry
161  * potential between the initial and final states. */
162  double scale_I3 = 0.0;
163  for (const auto &p_in : incoming_particles_) {
164  // Get the force scale of the incoming particle.
165  const auto scale =
166  ((pot_pointer != nullptr) ? pot_pointer->force_scale(p_in.type())
167  : std::make_pair(0.0, 0));
168  scale_B += scale.first;
169  scale_I3 += scale.second * p_in.type().isospin3_rel();
170  }
171  for (const auto &p_out : outgoing_particles_) {
172  // Get the force scale of the outgoing particle.
173  const auto scale = ((pot_pointer != nullptr)
175  : std::make_pair(0.0, 0));
176  scale_B -= scale.first;
177  scale_I3 -= scale.second * type_of_pout(p_out).isospin3_rel();
178  }
179  /* Rescale to get the potential difference between the
180  * initial and final state, and thus get the total momentum
181  * of the outgoing particles*/
182  return total_momentum() + potentials.first * scale_B +
183  potentials.second * scale_I3;
184 }
185 
187  /* Find incoming particle with largest formation time i.e. the last formed
188  * incoming particle. If all particles form at the same time, take the one
189  * with the lowest cross section scaling factor */
190  ParticleList::iterator last_formed_in_part;
191  bool all_incoming_same_formation_time =
193  [&](const ParticleData &data_comp) {
194  return std::abs(incoming_particles_[0].formation_time() -
195  data_comp.formation_time()) < really_small;
196  });
197  if (all_incoming_same_formation_time) {
198  last_formed_in_part =
199  std::min_element(incoming_particles_.begin(), incoming_particles_.end(),
200  [](const ParticleData &a, const ParticleData &b) {
201  return a.initial_xsec_scaling_factor() <
202  b.initial_xsec_scaling_factor();
203  });
204  } else {
205  last_formed_in_part =
206  std::max_element(incoming_particles_.begin(), incoming_particles_.end(),
207  [](const ParticleData &a, const ParticleData &b) {
208  return a.formation_time() < b.formation_time();
209  });
210  }
211 
212  const double form_time_begin = last_formed_in_part->begin_formation_time();
213  const double sc = last_formed_in_part->initial_xsec_scaling_factor();
214 
215  if (last_formed_in_part->formation_time() > time_of_execution_) {
216  for (ParticleData &new_particle : outgoing_particles_) {
217  if (new_particle.initial_xsec_scaling_factor() < 1.0) {
218  /* The new cross section scaling factor will be the product of the
219  * cross section scaling factor of the ingoing particles and of the
220  * outgoing ones (since the outgoing ones are also string fragments
221  * and thus take time to form). */
222  double sc_out = new_particle.initial_xsec_scaling_factor();
223  new_particle.set_cross_section_scaling_factor(sc * sc_out);
224  if (last_formed_in_part->formation_time() >
225  new_particle.formation_time()) {
226  /* If the unformed incoming particles' formation time is larger than
227  * the current outgoing particle's formation time, then the latter
228  * is overwritten by the former*/
229  new_particle.set_slow_formation_times(
230  time_of_execution_, last_formed_in_part->formation_time());
231  }
232  } else {
233  // not a string product
234  new_particle.set_slow_formation_times(
235  form_time_begin, last_formed_in_part->formation_time());
236  new_particle.set_cross_section_scaling_factor(sc);
237  }
238  }
239  } else {
240  for (ParticleData &new_particle : outgoing_particles_) {
241  if (new_particle.initial_xsec_scaling_factor() == 1.0) {
242  new_particle.set_formation_time(time_of_execution_);
243  }
244  }
245  }
246 }
247 
248 std::pair<double, double> Action::sample_masses(
249  const double kinetic_energy_cm) const {
250  const ParticleType &t_a = outgoing_particles_[0].type();
251  const ParticleType &t_b = outgoing_particles_[1].type();
252  // start with pole masses
253  std::pair<double, double> masses = {t_a.mass(), t_b.mass()};
254 
255  if (kinetic_energy_cm < t_a.min_mass_kinematic() + t_b.min_mass_kinematic()) {
256  const std::string reaction = incoming_particles_[0].type().name() +
257  incoming_particles_[1].type().name() + "→" +
258  t_a.name() + t_b.name();
260  reaction + ": not enough energy, " + std::to_string(kinetic_energy_cm) +
261  " < " + std::to_string(t_a.min_mass_kinematic()) + " + " +
262  std::to_string(t_b.min_mass_kinematic()));
263  }
264 
265  /* If one of the particles is a resonance, sample its mass. */
266  if (!t_a.is_stable() && t_b.is_stable()) {
267  masses.first = t_a.sample_resonance_mass(t_b.mass(), kinetic_energy_cm);
268  } else if (!t_b.is_stable() && t_a.is_stable()) {
269  masses.second = t_b.sample_resonance_mass(t_a.mass(), kinetic_energy_cm);
270  } else if (!t_a.is_stable() && !t_b.is_stable()) {
271  // two resonances in final state
272  masses = t_a.sample_resonance_masses(t_b, kinetic_energy_cm);
273  }
274  return masses;
275 }
276 
277 void Action::sample_angles(std::pair<double, double> masses,
278  const double kinetic_energy_cm) {
281 
282  const double pcm = pCM(kinetic_energy_cm, masses.first, masses.second);
283  if (!(pcm > 0.0)) {
284  logg[LAction].warn("Particle: ", p_a->pdgcode(), " radial momentum: ", pcm);
285  logg[LAction].warn("Ektot: ", kinetic_energy_cm, " m_a: ", masses.first,
286  " m_b: ", masses.second);
287  }
288  /* Here we assume an isotropic angular distribution. */
289  Angles phitheta;
290  phitheta.distribute_isotropically();
291 
292  p_a->set_4momentum(masses.first, phitheta.threevec() * pcm);
293  p_b->set_4momentum(masses.second, -phitheta.threevec() * pcm);
294  /* Debug message is printed before boost, so that p_a and p_b are
295  * the momenta in the center of mass frame and thus opposite to
296  * each other.*/
297  logg[LAction].debug("p_a: ", *p_a, "\np_b: ", *p_b);
298 }
299 
301  /* This function only operates on 2-particle final states. */
302  assert(outgoing_particles_.size() == 2);
304  const double cm_kin_energy = p_tot.abs();
305  // first sample the masses
306  const std::pair<double, double> masses = sample_masses(cm_kin_energy);
307  // after the masses are fixed (and thus also pcm), sample the angles
308  sample_angles(masses, cm_kin_energy);
309 }
310 
312  double sqrts, const std::vector<double> &m,
313  std::vector<FourVector> &sampled_momenta) {
330  const size_t n = m.size();
331  assert(n > 1);
332  sampled_momenta.resize(n);
333 
334  // Arrange a convenient vector of m1, m1 + m2, m1 + m2 + m3, ...
335  std::vector<double> msum(n);
336  msum[0] = m[0];
337  for (size_t i = 1; i < n; i++) {
338  msum[i] = msum[i - 1] + m[i];
339  }
340  const double msum_all = msum[n - 1];
341  int rejection_counter = -1;
342  if (sqrts <= msum_all) {
343  logg[LAction].error() << "sample_manybody_phasespace_impl: "
344  << "Can't sample when sqrts = " << sqrts
345  << " < msum = " << msum_all;
346  }
347 
348  double w, r01;
349  std::vector<double> Minv(n);
350 
351  double weight_sqr_max = 1;
352  const double Ekin_share = (sqrts - msum_all) / (n - 1);
353  for (size_t i = 1; i < n; i++) {
354  // This maximum estimate idea is due Scott Pratt: maximum should be
355  // roughly at equal kinetic energies
356  weight_sqr_max *= pCM_sqr(i * Ekin_share + msum[i],
357  (i - 1) * Ekin_share + msum[i - 1], m[i]);
358  }
359  // Maximum estimate is rough and can be wrong. We multiply it by additional
360  // factor to be on the safer side.
361  const double safety_factor = 1.1 + (n - 2) * 0.2;
362  weight_sqr_max *= (safety_factor * safety_factor);
363  bool first_warning = true;
364 
365  do {
366  // Generate invariant masses of 1, 12, 123, 1243, etc.
367  // Minv = {m1, M12, M123, ..., M123n-1, sqrts}
368  Minv[0] = 0.0;
369  Minv[n - 1] = sqrts - msum_all;
370  for (size_t i = 1; i < n - 1; i++) {
371  Minv[i] = random::uniform(0.0, sqrts - msum_all);
372  }
373  std::sort(Minv.begin(), Minv.end());
374  for (size_t i = 0; i < n; i++) {
375  Minv[i] += msum[i];
376  }
377 
378  double weight_sqr = 1;
379  for (size_t i = 1; i < n; i++) {
380  weight_sqr *= pCM_sqr(Minv[i], Minv[i - 1], m[i]);
381  }
382 
383  rejection_counter++;
384  r01 = random::canonical();
385  w = weight_sqr / weight_sqr_max;
386  if (w > 1.0) {
387  logg[LAction].warn()
388  << "sample_manybody_phasespace_impl: alarm, weight > 1, w^2 = " << w
389  << ". Increase safety factor." << std::endl;
390  }
391  if (rejection_counter > 20 && first_warning) {
392  logg[LAction].warn() << "sample_manybody_phasespace_impl: "
393  << "likely hanging, way too many rejections,"
394  << " n = " << n << ", sqrts = " << sqrts
395  << ", msum = " << msum_all;
396  first_warning = false;
397  }
398  } while (w < r01 * r01);
399 
400  // Boost particles to the right frame
401  std::vector<ThreeVector> beta(n);
402  for (size_t i = n - 1; i > 0; i--) {
403  const double pcm = pCM(Minv[i], Minv[i - 1], m[i]);
404  Angles phitheta;
405  phitheta.distribute_isotropically();
406  const ThreeVector isotropic_unitvector = phitheta.threevec();
407  sampled_momenta[i] = FourVector(std::sqrt(m[i] * m[i] + pcm * pcm),
408  pcm * isotropic_unitvector);
409  if (i >= 2) {
410  beta[i - 2] = pcm * isotropic_unitvector /
411  std::sqrt(pcm * pcm + Minv[i - 1] * Minv[i - 1]);
412  }
413  if (i == 1) {
414  sampled_momenta[0] = FourVector(std::sqrt(m[0] * m[0] + pcm * pcm),
415  -pcm * isotropic_unitvector);
416  }
417  }
418 
419  for (size_t i = 0; i < n - 2; i++) {
420  // After each boost except the last one the sum of 3-momenta should be 0
421  FourVector ptot = FourVector(0.0, 0.0, 0.0, 0.0);
422  for (size_t j = 0; j <= i + 1; j++) {
423  ptot += sampled_momenta[j];
424  }
425  logg[LAction].debug() << "Total momentum of 0.." << i + 1 << " = "
426  << ptot.threevec() << " and should be (0, 0, 0). "
427  << std::endl;
428 
429  // Boost the first i+1 particles to the next CM frame
430  for (size_t j = 0; j <= i + 1; j++) {
431  sampled_momenta[j] = sampled_momenta[j].lorentz_boost(beta[i]);
432  }
433  }
434 
435  FourVector ptot_all = FourVector(0.0, 0.0, 0.0, 0.0);
436  for (size_t j = 0; j < n; j++) {
437  ptot_all += sampled_momenta[j];
438  }
439  logg[LAction].debug() << "Total 4-momentum = " << ptot_all << ", should be ("
440  << sqrts << ", 0, 0, 0)" << std::endl;
441 }
442 
444  const size_t n = outgoing_particles_.size();
445  if (n < 3) {
446  throw std::invalid_argument(
447  "sample_manybody_phasespace: number of outgoing particles should be 3 "
448  "or more");
449  }
450  bool all_stable = true;
451  for (size_t i = 0; i < n; i++) {
452  all_stable = all_stable && outgoing_particles_[i].type().is_stable();
453  }
454  if (!all_stable) {
455  throw std::invalid_argument(
456  "sample_manybody_phasespace: Found resonance in to be sampled outgoing "
457  "particles, but assumes stable particles.");
458  }
459 
460  std::vector<double> m(n);
461  for (size_t i = 0; i < n; i++) {
462  m[i] = outgoing_particles_[i].type().mass();
463  }
464  std::vector<FourVector> p(n);
465 
467  for (size_t i = 0; i < n; i++) {
468  outgoing_particles_[i].set_4momentum(p[i]);
469  }
470 }
471 
472 void Action::check_conservation(const uint32_t id_process) const {
475  if (before != after) {
476  std::stringstream particle_names;
477  for (const auto &p : incoming_particles_) {
478  particle_names << p.type().name();
479  }
480  particle_names << " vs. ";
481  for (const auto &p : outgoing_particles_) {
482  particle_names << p.type().name();
483  }
484  particle_names << "\n";
485  std::string err_msg = before.report_deviations(after);
486  /* Pythia does not conserve energy and momentum at high energy, so we just
487  * print the warning and continue. */
490  logg[LAction].warn() << "Conservation law violations due to Pyhtia\n"
491  << particle_names.str() << err_msg;
492  return;
493  }
494  /* We allow decay of particles stable under the strong interaction to decay
495  * at the end, so just warn about such a "weak" process violating
496  * conservation laws */
498  incoming_particles_[0].type().is_stable()) {
499  logg[LAction].warn()
500  << "Conservation law violations of strong interaction in weak or "
501  "e.m. decay\n"
502  << particle_names.str() << err_msg;
503  return;
504  }
505  logg[LAction].error() << "Conservation law violations detected\n"
506  << particle_names.str() << err_msg;
507  if (id_process == ID_PROCESS_PHOTON) {
508  throw std::runtime_error("Conservation laws violated in photon process");
509  } else {
510  throw std::runtime_error("Conservation laws violated in process " +
511  std::to_string(id_process));
512  }
513  }
514 }
515 
516 std::ostream &operator<<(std::ostream &out, const ActionList &actions) {
517  out << "ActionList {\n";
518  for (const auto &a : actions) {
519  out << "- " << a << '\n';
520  }
521  return out << '}';
522 }
523 
524 } // namespace smash
Thrown for example when ScatterAction is called to perform with a wrong number of final-state particl...
Definition: action.h:325
void sample_2body_phasespace()
Sample the full 2-body phase-space (masses, momenta, angles) in the center-of-mass frame for the fina...
Definition: action.cc:300
FourVector total_momentum_of_outgoing_particles() const
Calculate the total kinetic momentum of the outgoing particles.
Definition: action.cc:155
void assign_formation_time_to_outgoing_particles()
Assign the formation time to the outgoing particles.
Definition: action.cc:186
virtual ~Action()
Virtual Destructor.
int stochastic_position_idx_
This stores a randomly-chosen index to an incoming particle.
Definition: action.h:371
std::pair< FourVector, FourVector > get_potential_at_interaction_point() const
Get the skyrme and asymmetry potential at the interaction point.
Definition: action.cc:111
virtual void sample_angles(std::pair< double, double > masses, double kinetic_energy_cm)
Sample final-state momenta in general X->2 processes (here: using an isotropical angular distribution...
Definition: action.cc:277
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
Definition: action.h:348
const ParticleType & type_of_pout(const ParticleData &p_out) const
Get the type of a given particle.
Definition: action.h:494
FourVector total_momentum() const
Sum of 4-momenta of incoming particles.
Definition: action.h:374
virtual void sample_manybody_phasespace()
Sample the full n-body phase-space (masses, momenta, angles) in the center-of-mass frame for the fina...
Definition: action.cc:443
const double time_of_execution_
Time at which the action is supposed to be performed (absolute time in the lab frame in fm/c).
Definition: action.h:354
void update_incoming(const Particles &particles)
Update the incoming particles that are stored in this action to the state they have in the global par...
Definition: action.cc:61
const ParticleList & incoming_particles() const
Get the list of particles that go into the action.
Definition: action.cc:57
virtual void perform(Particles *particles, uint32_t id_process)
Actually perform the action, e.g.
Definition: action.cc:127
double sqrt_s() const
Determine the total energy in the center-of-mass frame [GeV].
Definition: action.h:266
double box_length_
Box length: needed to determine coordinates of collision correctly in case of collision through the w...
Definition: action.h:364
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:340
FourVector get_interaction_point() const
Get the interaction point.
Definition: action.cc:67
virtual std::pair< double, double > sample_masses(double kinetic_energy_cm) const
Sample final-state masses in general X->2 processes (thus also fixing the absolute c....
Definition: action.cc:248
ProcessType process_type_
type of process
Definition: action.h:357
virtual void check_conservation(const uint32_t id_process) const
Check various conservation laws.
Definition: action.cc:472
bool is_valid(const Particles &particles) const
Check whether the action still applies.
Definition: action.cc:28
static void sample_manybody_phasespace_impl(double sqrts, const std::vector< double > &m, std::vector< FourVector > &sampled_momenta)
Implementation of the full n-body phase-space sampling (masses, momenta, angles) in the center-of-mas...
Definition: action.cc:311
bool is_pauli_blocked(const std::vector< Particles > &ensembles, const PauliBlocker &p_bl) const
Check if the action is Pauli-blocked.
Definition: action.cc:34
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:268
void distribute_isotropically()
Populate the object with a new direction.
Definition: angles.h:188
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
double abs() const
calculate the lorentz invariant absolute value
Definition: fourvector.h:459
ThreeVector threevec() const
Definition: fourvector.h:324
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:58
PdgCode pdgcode() const
Get the pdgcode of the particle.
Definition: particledata.h:87
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
Definition: particledata.h:164
Particle type contains the static properties of a particle species.
Definition: particletype.h:97
double sample_resonance_mass(const double mass_stable, const double cms_energy, int L=0) const
Resonance mass sampling for 2-particle final state with one resonance (type given by 'this') and one ...
double min_mass_kinematic() const
The minimum mass of the resonance that is kinematically allowed.
const std::string & name() const
Definition: particletype.h:141
bool is_stable() const
Definition: particletype.h:242
double isospin3_rel() const
Definition: particletype.h:179
double mass() const
Definition: particletype.h:144
std::pair< double, double > sample_resonance_masses(const ParticleType &t2, const double cms_energy, int L=0) const
Resonance mass sampling for 2-particle final state with two resonances.
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
size_t size() const
Definition: particles.h:87
void update(const ParticleList &old_state, ParticleList &new_state, bool do_replace)
Updates the Particles object, replacing the particles in old_state with the particles in new_state.
Definition: particles.h:200
const ParticleData & lookup(const ParticleData &old_state) const
Returns the particle that is currently stored in this object given an old copy of that particle.
Definition: particles.h:222
A class that stores parameters needed for Pauli blocking, tabulates necessary integrals and computes ...
Definition: pauliblocking.h:38
double phasespace_dens(const ThreeVector &r, const ThreeVector &p, const std::vector< Particles > &ensembles, const PdgCode pdg, const ParticleList &disregard) const
Calculate phase-space density of a particle species at the point (r,p).
static std::pair< double, int > force_scale(const ParticleType &data)
Evaluates the scaling factor of the forces acting on the particles.
Definition: potentials.cc:318
A container for storing conserved values.
std::string report_deviations(const std::vector< Particles > &ensembles) const
Checks if the current particle list has still the same values and reports about differences.
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
Collection of useful constants that are known at compile time.
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.
Definition: action.h:532
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 p
Proton.
const PdgCode d(PdgCode::from_decimal(1000010020))
Deuteron.
constexpr int n
Neutron.
T beta(T a, T b)
Draws a random number from a beta-distribution, where probability density of is .
Definition: random.h:329
T uniform(T min, T max)
Definition: random.h:88
T canonical()
Definition: random.h:113
Definition: action.h:24
static constexpr int LPauliBlocking
Definition: action.cc:26
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:79
T pCM_sqr(const T sqrts, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:91
constexpr std::uint32_t ID_PROCESS_PHOTON
Process ID for any photon process.
Definition: constants.h:124
static constexpr int LAction
Definition: action.h:25
@ Decay
resonance decay
@ Wall
box wall crossing
@ Elastic
elastic scattering: particles remain the same, only momenta change
@ StringHard
hard string process involving 2->2 QCD process by PYTHIA.
bool all_of(Container &&c, UnaryPredicate &&p)
Convenience wrapper for std::all_of that operates on a complete container.
Definition: algorithms.h:80
Potentials * pot_pointer
Pointer to a Potential class.
RectangularLattice< FourVector > * UB_lat_pointer
Pointer to the skyrme potential on the lattice.
bool is_string_soft_process(ProcessType p)
Check if a given process type is a soft string excitation.
RectangularLattice< FourVector > * UI3_lat_pointer
Pointer to the symmmetry potential on the lattice.