Version: SMASH-2.1
scatteraction.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2021
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #include "smash/scatteraction.h"
11 
12 #include <cmath>
13 
14 #include "Pythia8/Pythia.h"
15 
16 #include "smash/angles.h"
17 #include "smash/constants.h"
18 #include "smash/crosssections.h"
19 #include "smash/cxx14compat.h"
20 #include "smash/fpenvironment.h"
21 #include "smash/logging.h"
22 #include "smash/pdgcode.h"
23 #include "smash/pow.h"
24 #include "smash/random.h"
25 
26 namespace smash {
27 static constexpr int LScatterAction = LogArea::ScatterAction::id;
28 
30  const ParticleData &in_part_b, double time,
31  bool isotropic, double string_formation_time,
32  double box_length)
33  : Action({in_part_a, in_part_b}, time),
34  total_cross_section_(0.),
35  isotropic_(isotropic),
36  string_formation_time_(string_formation_time) {
37  box_length_ = box_length;
38 }
39 
40 void ScatterAction::add_collision(CollisionBranchPtr p) {
41  add_process<CollisionBranch>(p, collision_channels_, total_cross_section_);
42 }
43 
44 void ScatterAction::add_collisions(CollisionBranchList pv) {
45  add_processes<CollisionBranch>(std::move(pv), collision_channels_,
47 }
48 
50  logg[LScatterAction].debug("Incoming particles: ", incoming_particles_);
51 
52  /* Decide for a particular final state. */
53  const CollisionBranch *proc = choose_channel<CollisionBranch>(
55  process_type_ = proc->get_type();
58 
59  logg[LScatterAction].debug("Chosen channel: ", process_type_,
61 
62  /* The production point of the new particles. */
63  FourVector middle_point = get_interaction_point();
64 
65  switch (process_type_) {
67  /* 2->2 elastic scattering */
69  break;
71  /* resonance formation */
73  break;
75  /* 2->2 inelastic scattering */
76  /* Sample the particle momenta in CM system. */
78  break;
80  /* 2->3 scattering */
82  break;
84  /* 2->5 scattering */
86  break;
94  break;
95  default:
97  "ScatterAction::generate_final_state: Invalid process type " +
98  std::to_string(static_cast<int>(process_type_)) + " was requested. " +
99  "(PDGcode1=" + incoming_particles_[0].pdgcode().string() +
100  ", PDGcode2=" + incoming_particles_[1].pdgcode().string() + ")");
101  }
102 
103  for (ParticleData &new_particle : outgoing_particles_) {
104  // Boost to the computational frame
105  new_particle.boost_momentum(
107  /* Set positions of the outgoing particles */
108  if (proc->get_type() != ProcessType::Elastic) {
109  new_particle.set_4position(middle_point);
110  }
111  }
112 }
113 
115  double elastic_parameter, bool two_to_one, ReactionsBitSet included_2to2,
116  MultiParticleReactionsBitSet included_multi, double low_snn_cut,
117  bool strings_switch, bool use_AQM, bool strings_with_probability,
118  NNbarTreatment nnbar_treatment, double scale_xs, double additional_el_xs) {
121  CollisionBranchList processes = xs.generate_collision_list(
122  elastic_parameter, two_to_one, included_2to2, included_multi, low_snn_cut,
123  strings_switch, use_AQM, strings_with_probability, nnbar_treatment,
124  string_process_, scale_xs, additional_el_xs);
125 
126  /* Add various subprocesses.*/
127  add_collisions(std::move(processes));
128 
129  /* If the string processes are not triggered by a probability, then they
130  * always happen as long as the parametrized total cross section is larger
131  * than the sum of the cross sections of the non-string processes, and the
132  * square root s exceeds the threshold by at least 0.9 GeV. The cross section
133  * of the string processes are counted by taking the difference between the
134  * parametrized total and the sum of the non-strings. */
135  if (!strings_with_probability &&
136  xs.string_probability(strings_switch, strings_with_probability, use_AQM,
137  nnbar_treatment == NNbarTreatment::Strings) == 1.) {
138  const double xs_diff = xs.high_energy() - cross_section();
139  if (xs_diff > 0.) {
140  add_collisions(xs.string_excitation(xs_diff, string_process_, use_AQM));
141  }
142  }
143 }
144 
146  return total_cross_section_ * incoming_particles_[0].xsec_scaling_factor() *
147  incoming_particles_[1].xsec_scaling_factor();
148 }
149 
151  return partial_cross_section_ * incoming_particles_[0].xsec_scaling_factor() *
152  incoming_particles_[1].xsec_scaling_factor();
153 }
154 
156  return total_momentum().velocity();
157 }
158 
159 double ScatterAction::gamma_cm() const {
160  return (1. / std::sqrt(1.0 - beta_cm().sqr()));
161 }
162 
163 double ScatterAction::mandelstam_s() const { return total_momentum().sqr(); }
164 
166  const double m1 = incoming_particles_[0].effective_mass();
167  const double m2 = incoming_particles_[1].effective_mass();
168  return pCM(sqrt_s(), m1, m2);
169 }
170 
172  const double m1 = incoming_particles_[0].effective_mass();
173  const double m2 = incoming_particles_[1].effective_mass();
174  return pCM_sqr(sqrt_s(), m1, m2);
175 }
176 
178  const double m1 = incoming_particles()[0].effective_mass();
179  const double m2 = incoming_particles()[1].effective_mass();
180  const double m_s = mandelstam_s();
181  const double lamb = lambda_tilde(m_s, m1 * m1, m2 * m2);
182  return std::sqrt(lamb) / (2. * incoming_particles()[0].momentum().x0() *
183  incoming_particles()[1].momentum().x0());
184 }
185 
187  // local copy of particles (since we need to boost them)
190  /* Boost particles to center-of-momentum frame. */
191  const ThreeVector velocity = beta_cm();
192  p_a.boost(velocity);
193  p_b.boost(velocity);
194  const ThreeVector pos_diff =
195  p_a.position().threevec() - p_b.position().threevec();
196  const ThreeVector mom_diff =
197  p_a.momentum().threevec() - p_b.momentum().threevec();
198 
199  logg[LScatterAction].debug("Particle ", incoming_particles_,
200  " position difference [fm]: ", pos_diff,
201  ", momentum difference [GeV]: ", mom_diff);
202 
203  const double dp2 = mom_diff.sqr();
204  const double dr2 = pos_diff.sqr();
205  /* Zero momentum leads to infite distance. */
206  if (dp2 < really_small) {
207  return dr2;
208  }
209  const double dpdr = pos_diff * mom_diff;
210 
219  const double result = dr2 - dpdr * dpdr / dp2;
220  return result > 0.0 ? result : 0.0;
221 }
222 
224  // local copy of particles (since we need to boost them)
227 
228  const FourVector delta_x = p_a.position() - p_b.position();
229  const double mom_diff_sqr =
230  (p_a.momentum().threevec() - p_b.momentum().threevec()).sqr();
231  const double x_sqr = delta_x.sqr();
232 
233  if (mom_diff_sqr < really_small) {
234  return -x_sqr;
235  }
236 
237  const double p_a_sqr = p_a.momentum().sqr();
238  const double p_b_sqr = p_b.momentum().sqr();
239  const double p_a_dot_x = p_a.momentum().Dot(delta_x);
240  const double p_b_dot_x = p_b.momentum().Dot(delta_x);
241  const double p_a_dot_p_b = p_a.momentum().Dot(p_b.momentum());
242 
243  const double b_sqr =
244  -x_sqr -
245  (p_a_sqr * std::pow(p_b_dot_x, 2) + p_b_sqr * std::pow(p_a_dot_x, 2) -
246  2 * p_a_dot_p_b * p_a_dot_x * p_b_dot_x) /
247  (std::pow(p_a_dot_p_b, 2) - p_a_sqr * p_b_sqr);
248  return b_sqr > 0.0 ? b_sqr : 0.0;
249 }
250 
264 static double Cugnon_bpp(double plab) {
265  if (plab < 2.) {
266  double p8 = pow_int(plab, 8);
267  return 5.5 * p8 / (7.7 + p8);
268  } else {
269  return std::min(9.0, 5.334 + 0.67 * (plab - 2.));
270  }
271 }
272 
283 static double Cugnon_bnp(double plab) {
284  if (plab < 0.225) {
285  return 0.;
286  } else if (plab < 0.6) {
287  return 16.53 * (plab - 0.225);
288  } else if (plab < 1.6) {
289  return -1.63 * plab + 7.16;
290  } else {
291  return Cugnon_bpp(plab);
292  }
293 }
294 
295 void ScatterAction::sample_angles(std::pair<double, double> masses,
296  double kinetic_energy_cm) {
299  // We potentially have more than two particles, so the following angular
300  // distributions don't work. Instead we just keep the angular
301  // distributions generated by string fragmentation.
302  return;
303  }
304  assert(outgoing_particles_.size() == 2);
305 
306  // NN scattering is anisotropic currently
307  const bool nn_scattering = incoming_particles_[0].type().is_nucleon() &&
308  incoming_particles_[1].type().is_nucleon();
309  /* Elastic process is anisotropic and
310  * the angular distribution is based on the NN elastic scattering. */
311  const bool el_scattering = process_type_ == ProcessType::Elastic;
312 
313  const double mass_in_a = incoming_particles_[0].effective_mass();
314  const double mass_in_b = incoming_particles_[1].effective_mass();
315 
318 
319  const double mass_a = masses.first;
320  const double mass_b = masses.second;
321 
322  const std::array<double, 2> t_range = get_t_range<double>(
323  kinetic_energy_cm, mass_in_a, mass_in_b, mass_a, mass_b);
324  Angles phitheta;
325  if (el_scattering && !isotropic_) {
329  double mandelstam_s_new = 0.;
330  if (nn_scattering) {
331  mandelstam_s_new = mandelstam_s();
332  } else {
333  /* In the case of elastic collisions other than NN collisions,
334  * there is an ambiguity on how to get the lab-frame momentum (plab),
335  * since the incoming particles can have different masses.
336  * Right now, we first obtain the center-of-mass momentum
337  * of the collision (pcom_now).
338  * Then, the lab-frame momentum is evaluated from the mandelstam s,
339  * which yields the original center-of-mass momentum
340  * when nucleon mass is assumed. */
341  const double pcm_now = pCM_from_s(mandelstam_s(), mass_in_a, mass_in_b);
342  mandelstam_s_new =
343  4. * std::sqrt(pcm_now * pcm_now + nucleon_mass * nucleon_mass);
344  }
345  double bb, a, plab = plab_from_s(mandelstam_s_new);
346  if (nn_scattering &&
347  p_a->pdgcode().antiparticle_sign() ==
348  p_b->pdgcode().antiparticle_sign() &&
349  std::abs(p_a->type().charge() + p_b->type().charge()) == 1) {
350  // proton-neutron and antiproton-antineutron
351  bb = std::max(Cugnon_bnp(plab), really_small);
352  a = (plab < 0.8) ? 1. : 0.64 / (plab * plab);
353  } else {
354  /* all others including pp, nn and AQM elastic processes
355  * This is applied for all particle pairs, which are allowed to
356  * interact elastically. */
357  bb = std::max(Cugnon_bpp(plab), really_small);
358  a = 1.;
359  }
360  double t = random::expo(bb, t_range[0], t_range[1]);
361  if (random::canonical() > 1. / (1. + a)) {
362  t = t_range[0] + t_range[1] - t;
363  }
364  // determine scattering angles in center-of-mass frame
365  phitheta = Angles(2. * M_PI * random::canonical(),
366  1. - 2. * (t - t_range[0]) / (t_range[1] - t_range[0]));
367  } else if (nn_scattering && p_a->pdgcode().is_Delta() &&
368  p_b->pdgcode().is_nucleon() &&
369  p_a->pdgcode().antiparticle_sign() ==
370  p_b->pdgcode().antiparticle_sign() &&
371  !isotropic_) {
375  const double plab = plab_from_s(mandelstam_s());
376  const double bb = std::max(Cugnon_bpp(plab), really_small);
377  double t = random::expo(bb, t_range[0], t_range[1]);
378  if (random::canonical() > 0.5) {
379  t = t_range[0] + t_range[1] - t; // symmetrize
380  }
381  phitheta = Angles(2. * M_PI * random::canonical(),
382  1. - 2. * (t - t_range[0]) / (t_range[1] - t_range[0]));
383  } else if (nn_scattering && p_b->pdgcode().is_nucleon() && !isotropic_ &&
384  (p_a->type().is_Nstar() || p_a->type().is_Deltastar())) {
386  const std::array<double, 4> p{1.46434, 5.80311, -6.89358, 1.94302};
387  const double a = p[0] + mass_a * (p[1] + mass_a * (p[2] + mass_a * p[3]));
388  /* If the resonance is so heavy that the index "a" exceeds 30,
389  * the power function turns out to be too sharp. Take t directly to be
390  * t_0 in such a case. */
391  double t = t_range[0];
392  if (a < 30) {
393  t = random::power(-a, t_range[0], t_range[1]);
394  }
395  if (random::canonical() > 0.5) {
396  t = t_range[0] + t_range[1] - t; // symmetrize
397  }
398  phitheta = Angles(2. * M_PI * random::canonical(),
399  1. - 2. * (t - t_range[0]) / (t_range[1] - t_range[0]));
400  } else {
401  /* isotropic angular distribution */
402  phitheta.distribute_isotropically();
403  }
404 
405  ThreeVector pscatt = phitheta.threevec();
406  // 3-momentum of first incoming particle in center-of-mass frame
407  ThreeVector pcm =
408  incoming_particles_[0].momentum().lorentz_boost(beta_cm()).threevec();
409  pscatt.rotate_z_axis_to(pcm);
410 
411  // final-state CM momentum
412  const double p_f = pCM(kinetic_energy_cm, mass_a, mass_b);
413  if (!(p_f > 0.0)) {
414  logg[LScatterAction].warn("Particle: ", p_a->pdgcode(),
415  " radial momentum: ", p_f);
416  logg[LScatterAction].warn("Etot: ", kinetic_energy_cm, " m_a: ", mass_a,
417  " m_b: ", mass_b);
418  }
419  p_a->set_4momentum(mass_a, pscatt * p_f);
420  p_b->set_4momentum(mass_b, -pscatt * p_f);
421 
422  /* Debug message is printed before boost, so that p_a and p_b are
423  * the momenta in the center of mass frame and thus opposite to
424  * each other.*/
425  logg[LScatterAction].debug("p_a: ", *p_a, "\np_b: ", *p_b);
426 }
427 
429  // copy initial particles into final state
432  // resample momenta
433  sample_angles({outgoing_particles_[0].effective_mass(),
434  outgoing_particles_[1].effective_mass()},
435  sqrt_s());
436 }
437 
439  // create new particles
442 }
443 
447  logg[LScatterAction].debug("2->3 scattering:", incoming_particles_, " -> ",
449 }
450 
454  logg[LScatterAction].debug("2->5 scattering:", incoming_particles_, " -> ",
456 }
457 
459  if (outgoing_particles_.size() != 1) {
460  std::string s =
461  "resonance_formation: "
462  "Incorrect number of particles in final state: ";
463  s += std::to_string(outgoing_particles_.size()) + " (";
464  s += incoming_particles_[0].pdgcode().string() + " + ";
465  s += incoming_particles_[1].pdgcode().string() + ")";
466  throw InvalidResonanceFormation(s);
467  }
468  // Set the momentum of the formed resonance in its rest frame.
469  outgoing_particles_[0].set_4momentum(
470  total_momentum_of_outgoing_particles().abs(), 0., 0., 0.);
472  /* this momentum is evaluated in the computational frame. */
473  logg[LScatterAction].debug("Momentum of the new particle: ",
474  outgoing_particles_[0].momentum());
475 }
476 
477 /* This function generates the outgoing state when
478  * ScatterAction::string_excitation() is used */
479 
483  /* Check momentum difference for debugging */
484  FourVector out_mom;
485  for (ParticleData data : outgoing_particles_) {
486  out_mom += data.momentum();
487  }
488  logg[LPythia].debug("Incoming momenta string:", total_momentum());
489  logg[LPythia].debug("Outgoing momenta string:", out_mom);
490 }
491 
492 /* This function will generate outgoing particles in computational frame
493  * from a hard process.
494  * The way to excite soft strings is based on the UrQMD model */
495 
497  assert(incoming_particles_.size() == 2);
498  // Disable floating point exception trap for Pythia
499  {
500  DisableFloatTraps guard;
501  /* initialize the string_process_ object for this particular collision */
503  /* implement collision */
504  bool success = false;
505  int ntry = 0;
506  const int ntry_max = 10000;
507  while (!success && ntry < ntry_max) {
508  ntry++;
509  switch (process_type_) {
511  /* single diffractive to A+X */
512  success = string_process_->next_SDiff(true);
513  break;
515  /* single diffractive to X+B */
516  success = string_process_->next_SDiff(false);
517  break;
519  /* double diffractive */
520  success = string_process_->next_DDiff();
521  break;
523  /* soft non-diffractive */
524  success = string_process_->next_NDiffSoft();
525  break;
527  /* soft BBbar 2 mesonic annihilation */
528  success = string_process_->next_BBbarAnn();
529  break;
531  success = string_process_->next_NDiffHard();
532  break;
533  default:
534  logg[LPythia].error("Unknown string process required.");
535  success = false;
536  }
537  }
538  if (ntry == ntry_max) {
539  /* If pythia fails to form a string, it is usually because the energy
540  * is not large enough. In this case, annihilation is then enforced. If
541  * this process still does not not produce any results, it defaults to
542  * an elastic collision. */
543  bool success_newtry = false;
544 
545  /* Check if the initial state is a baryon-antibaryon state.*/
546  PdgCode part1 = incoming_particles_[0].pdgcode(),
547  part2 = incoming_particles_[1].pdgcode();
548  bool is_BBbar_Pair = (part1.baryon_number() != 0) &&
549  (part1.baryon_number() == -part2.baryon_number());
550 
551  /* Decide on the new process .*/
552  if (is_BBbar_Pair) {
554  } else {
556  }
557  /* Perform the new process*/
558  int ntry_new = 0;
559  while (!success_newtry && ntry_new < ntry_max) {
560  ntry_new++;
561  if (is_BBbar_Pair) {
562  success_newtry = string_process_->next_BBbarAnn();
563  } else {
564  success_newtry = string_process_->next_DDiff();
565  }
566  }
567 
568  if (success_newtry) {
570  }
571 
572  if (!success_newtry) {
573  /* If annihilation fails:
574  * Particles are normally added after process selection for
575  * strings, outgoing_particles is still uninitialized, and memory
576  * needs to be allocated. We also shift the process_type_ to elastic
577  * so that sample_angles does a proper treatment. */
578  outgoing_particles_.reserve(2);
583  }
584  } else {
586  }
587  }
588 }
589 
590 void ScatterAction::format_debug_output(std::ostream &out) const {
591  out << "Scatter of " << incoming_particles_;
592  if (outgoing_particles_.empty()) {
593  out << " (not performed)";
594  } else {
595  out << " to " << outgoing_particles_;
596  }
597 }
598 
599 } // namespace smash
Thrown for example when ScatterAction is called to perform with a wrong number of final-state particl...
Definition: action.h:325
Action is the base class for a generic process that takes a number of incoming particles and transfor...
Definition: action.h:35
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:297
FourVector total_momentum_of_outgoing_particles() const
Calculate the total kinetic momentum of the outgoing particles.
Definition: action.cc:152
void assign_formation_time_to_outgoing_particles()
Assign the formation time to the outgoing particles.
Definition: action.cc:183
virtual void sample_5body_phasespace()
Sample the full 5-body phase-space (masses, momenta, angles) in the center-of-mass frame for the fina...
Definition: action.cc:345
std::pair< FourVector, FourVector > get_potential_at_interaction_point() const
Get the skyrme and asymmetry potential at the interaction point.
Definition: action.cc:108
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
Definition: action.h:339
FourVector total_momentum() const
Sum of 4-momenta of incoming particles.
Definition: action.h:365
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:345
const ParticleList & incoming_particles() const
Get the list of particles that go into the action.
Definition: action.cc:57
double sqrt_s() const
Determine the total energy in the center-of-mass frame [GeV].
Definition: action.h:266
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:331
FourVector get_interaction_point() const
Get the interaction point.
Definition: action.cc:67
virtual void sample_3body_phasespace()
Sample the full 3-body phase-space (masses, momenta, angles) in the center-of-mass frame for the fina...
Definition: action.cc:308
static double lambda_tilde(double a, double b, double c)
Little helper function that calculates the lambda function (sometimes written with a tilde to better ...
Definition: action.h:310
ProcessType process_type_
type of process
Definition: action.h:348
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
CollisionBranch is a derivative of ProcessBranch, which is used to represent particular final-state c...
ProcessType get_type() const override
The cross section class assembels everything that is needed to calculate the cross section and return...
Definition: crosssections.h:65
double string_probability(bool strings_switch, bool use_transition_probability, bool use_AQM, bool treat_nnbar_with_strings) const
double high_energy() const
Determine the parametrized total cross section at high energies for the given collision,...
CollisionBranchList string_excitation(double total_string_xs, StringProcess *string_process, bool use_AQM) const
Determine the cross section for string excitations, which is given by the difference between the para...
CollisionBranchList generate_collision_list(double elastic_parameter, bool two_to_one_switch, ReactionsBitSet included_2to2, MultiParticleReactionsBitSet included_multi, double low_snn_cut, bool strings_switch, bool use_AQM, bool strings_with_probability, NNbarTreatment nnbar_treatment, StringProcess *string_process, double scale_xs, double additional_el_xs) const
Generate a list of all possible collisions between the incoming particles with the given c....
Guard type that safely disables floating point traps for the scope in which it is placed.
Definition: fpenvironment.h:79
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
double sqr() const
calculate the square of the vector (which is a scalar)
Definition: fourvector.h:455
ThreeVector threevec() const
Definition: fourvector.h:324
double Dot(const FourVector &a) const
calculate the scalar product with another four-vector
Definition: fourvector.h:451
ThreeVector velocity() const
Get the velocity (3-vector divided by zero component).
Definition: fourvector.h:328
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
const ParticleType & type() const
Get the type of the particle.
Definition: particledata.h:128
const FourVector & momentum() const
Get the particle's 4-momentum.
Definition: particledata.h:158
void boost(const ThreeVector &v)
Apply a full Lorentz boost of momentum and position.
Definition: particledata.h:323
const FourVector & position() const
Get the particle's position in Minkowski space.
Definition: particledata.h:204
bool is_Nstar() const
Definition: particletype.h:224
int32_t charge() const
The charge of the particle.
Definition: particletype.h:188
bool is_Deltastar() const
Definition: particletype.h:233
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
Definition: pdgcode.h:108
int antiparticle_sign() const
Definition: pdgcode.h:549
int baryon_number() const
Definition: pdgcode.h:308
bool is_nucleon() const
Definition: pdgcode.h:324
bool is_Delta() const
Definition: pdgcode.h:348
ParticleList particle_list() const
double weight() const
Thrown when ScatterAction is called to perform with unknown ProcessType.
bool isotropic_
Do this collision isotropically?
void two_to_five_scattering()
Perform a two-to-five-body scattering.
void add_collision(CollisionBranchPtr p)
Add a new collision channel.
void resonance_formation()
Perform a 2->1 resonance-formation process.
ThreeVector beta_cm() const
Get the velocity of the center of mass of the scattering/incoming particles in the calculation frame.
double partial_cross_section_
Partial cross-section to the chosen outgoing channel.
double relative_velocity() const
Get the relative velocity of the two incoming particles.
double mandelstam_s() const
Determine the Mandelstam s variable,.
double get_partial_weight() const override
Get the partial cross section of the chosen channel.
StringProcess * string_process_
Pointer to interface class for strings.
void create_string_final_state()
Creates the final states for string-processes after they are performed.
double cm_momentum_squared() const
Get the squared momentum of the center of mass of the incoming particles in the calculation frame.
void generate_final_state() override
Generate the final-state of the scattering process.
double get_total_weight() const override
Get the total cross section of scattering particles.
void string_excitation()
Todo(ryu): document better - it is not really UrQMD-based, isn't it? Perform the UrQMD-based string e...
void elastic_scattering()
Perform an elastic two-body scattering, i.e. just exchange momentum.
void inelastic_scattering()
Perform an inelastic two-body scattering, i.e. new particles are formed.
ScatterAction(const ParticleData &in_part1, const ParticleData &in_part2, double time, bool isotropic=false, double string_formation_time=1.0, double box_length=-1.0)
Construct a ScatterAction object.
void two_to_three_scattering()
Perform a two-to-three-body scattering.
void sample_angles(std::pair< double, double > masses, double kinetic_energy_cm) override
Sample final-state angles in a 2->2 collision (possibly anisotropic).
void add_collisions(CollisionBranchList pv)
Add several new collision channels at once.
double total_cross_section_
Total hadronic cross section.
double gamma_cm() const
Get the gamma factor corresponding to a boost to the center of mass frame of the colliding particles.
double cm_momentum() const
Get the momentum of the center of mass of the incoming particles in the calculation frame.
double cov_transverse_distance_sqr() const
Calculate the transverse distance of the two incoming particles in their local rest frame written in ...
void add_all_scatterings(double elastic_parameter, bool two_to_one, ReactionsBitSet included_2to2, MultiParticleReactionsBitSet included_multi, double low_snn_cut, bool strings_switch, bool use_AQM, bool strings_with_probability, NNbarTreatment nnbar_treatment, double scale_xs, double additional_el_xs)
Add all possible scattering subprocesses for this action object.
virtual double cross_section() const
Get the total cross section of the scattering particles.
CollisionBranchList collision_channels_
List of possible collisions.
double transverse_distance_sqr() const
Calculate the transverse distance of the two incoming particles in their local rest frame.
bool next_SDiff(bool is_AB_to_AX)
Single-diffractive process is based on single pomeron exchange described in Ingelman:1984ns .
bool next_NDiffSoft()
Soft Non-diffractive process is modelled in accordance with dual-topological approach Capella:1978ig ...
bool next_DDiff()
Double-diffractive process ( A + B -> X + X ) is similar to the single-diffractive process,...
ParticleList get_final_state()
a function to get the final state particle list which is called after the collision
bool next_BBbarAnn()
Baryon-antibaryon annihilation process Based on what UrQMD Bass:1998ca , Bleicher:1999xi does,...
void init(const ParticleList &incoming, double tcoll)
initialization feed intial particles, time of collision and gamma factor of the center of mass.
bool next_NDiffHard()
Hard Non-diffractive process is based on PYTHIA 8 with partonic showers and interactions.
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
double sqr() const
Definition: threevector.h:259
void rotate_z_axis_to(ThreeVector &r)
Rotate the z-axis onto the vector r.
Definition: threevector.h:319
Collection of useful constants that are known at compile time.
std::bitset< 10 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
NNbarTreatment
Treatment of N Nbar Annihilation.
@ Strings
Use string fragmentation.
std::bitset< 3 > MultiParticleReactionsBitSet
Container for the n to m reactions in the code.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
void format_debug_output(std::ostream &out) const override
Writes information about this scatter action to the out stream.
constexpr int p
Proton.
T power(T n, T xMin, T xMax)
Draws a random number according to a power-law distribution ~ x^n.
Definition: random.h:203
T expo(T A, T x1, T x2)
Draws a random number x from an exponential distribution exp(A*x), where A is assumed to be positive,...
Definition: random.h:166
T canonical()
Definition: random.h:113
Definition: action.h:24
double plab_from_s(double mandelstam_s, double mass)
Convert Mandelstam-s to p_lab in a fixed-target collision.
Definition: kinematics.h:157
static double Cugnon_bnp(double plab)
Computes the B coefficients from the Cugnon parametrization of the angular distribution in elastic np...
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
@ FailedString
Soft String NNbar annihilation process can fail by lack of energy.
@ TwoToOne
resonance formation (2->1)
@ StringSoftDoubleDiffractive
double diffractive. Two strings are formed, one from A and one from B.
@ TwoToFive
2->5 scattering
@ StringSoftSingleDiffractiveXB
single diffractive AB->XB.
@ TwoToTwo
2->2 inelastic scattering
@ Elastic
elastic scattering: particles remain the same, only momenta change
@ StringSoftAnnihilation
a special case of baryon-antibaryon annihilation.
@ StringSoftNonDiffractive
non-diffractive. Two strings are formed both have ends in A and B.
@ StringSoftSingleDiffractiveAX
(41-45) soft string excitations.
@ StringHard
hard string process involving 2->2 QCD process by PYTHIA.
@ TwoToThree
2->3 scattering
constexpr double nucleon_mass
Nucleon mass in GeV.
Definition: constants.h:58
constexpr T pow_int(const T base, unsigned const exponent)
Efficient template for calculating integer powers using squaring.
Definition: pow.h:23
T pCM_from_s(const T s, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:66
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37
static constexpr int LScatterAction
static constexpr int LPythia
Definition: stringprocess.h:26
bool is_string_soft_process(ProcessType p)
Check if a given process type is a soft string excitation.
static double Cugnon_bpp(double plab)
Computes the B coefficients from the Cugnon parametrization of the angular distribution in elastic pp...