Version: SMASH-2.0
scatteraction.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2020
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;
90  break;
91  default:
93  "ScatterAction::generate_final_state: Invalid process type " +
94  std::to_string(static_cast<int>(process_type_)) + " was requested. " +
95  "(PDGcode1=" + incoming_particles_[0].pdgcode().string() +
96  ", PDGcode2=" + incoming_particles_[1].pdgcode().string() + ")");
97  }
98 
99  for (ParticleData &new_particle : outgoing_particles_) {
100  // Boost to the computational frame
101  new_particle.boost_momentum(
103  /* Set positions of the outgoing particles */
104  if (proc->get_type() != ProcessType::Elastic) {
105  new_particle.set_4position(middle_point);
106  }
107  }
108 }
109 
111  double elastic_parameter, bool two_to_one, ReactionsBitSet included_2to2,
112  MultiParticleReactionsBitSet included_multi, double low_snn_cut,
113  bool strings_switch, bool use_AQM, bool strings_with_probability,
114  NNbarTreatment nnbar_treatment, double scale_xs, double additional_el_xs) {
117  CollisionBranchList processes = xs.generate_collision_list(
118  elastic_parameter, two_to_one, included_2to2, included_multi, low_snn_cut,
119  strings_switch, use_AQM, strings_with_probability, nnbar_treatment,
120  string_process_, scale_xs, additional_el_xs);
121 
122  /* Add various subprocesses.*/
123  add_collisions(std::move(processes));
124 
125  /* If the string processes are not triggered by a probability, then they
126  * always happen as long as the parametrized total cross section is larger
127  * than the sum of the cross sections of the non-string processes, and the
128  * square root s exceeds the threshold by at least 0.9 GeV. The cross section
129  * of the string processes are counted by taking the difference between the
130  * parametrized total and the sum of the non-strings. */
131  if (!strings_with_probability &&
132  xs.string_probability(strings_switch, strings_with_probability, use_AQM,
133  nnbar_treatment == NNbarTreatment::Strings) == 1.) {
134  const double xs_diff = xs.high_energy() - cross_section();
135  if (xs_diff > 0.) {
136  add_collisions(xs.string_excitation(xs_diff, string_process_, use_AQM));
137  }
138  }
139 }
140 
142  return total_cross_section_ * incoming_particles_[0].xsec_scaling_factor() *
143  incoming_particles_[1].xsec_scaling_factor();
144 }
145 
147  return partial_cross_section_ * incoming_particles_[0].xsec_scaling_factor() *
148  incoming_particles_[1].xsec_scaling_factor();
149 }
150 
152  return total_momentum().velocity();
153 }
154 
155 double ScatterAction::gamma_cm() const {
156  return (1. / std::sqrt(1.0 - beta_cm().sqr()));
157 }
158 
159 double ScatterAction::mandelstam_s() const { return total_momentum().sqr(); }
160 
162  const double m1 = incoming_particles_[0].effective_mass();
163  const double m2 = incoming_particles_[1].effective_mass();
164  return pCM(sqrt_s(), m1, m2);
165 }
166 
168  const double m1 = incoming_particles_[0].effective_mass();
169  const double m2 = incoming_particles_[1].effective_mass();
170  return pCM_sqr(sqrt_s(), m1, m2);
171 }
172 
174  const double m1 = incoming_particles()[0].effective_mass();
175  const double m2 = incoming_particles()[1].effective_mass();
176  const double m_s = mandelstam_s();
177  const double lamb = lambda_tilde(m_s, m1 * m1, m2 * m2);
178  return std::sqrt(lamb) / (2. * incoming_particles()[0].momentum().x0() *
179  incoming_particles()[1].momentum().x0());
180 }
181 
183  // local copy of particles (since we need to boost them)
186  /* Boost particles to center-of-momentum frame. */
187  const ThreeVector velocity = beta_cm();
188  p_a.boost(velocity);
189  p_b.boost(velocity);
190  const ThreeVector pos_diff =
191  p_a.position().threevec() - p_b.position().threevec();
192  const ThreeVector mom_diff =
193  p_a.momentum().threevec() - p_b.momentum().threevec();
194 
195  logg[LScatterAction].debug("Particle ", incoming_particles_,
196  " position difference [fm]: ", pos_diff,
197  ", momentum difference [GeV]: ", mom_diff);
198 
199  const double dp2 = mom_diff.sqr();
200  const double dr2 = pos_diff.sqr();
201  /* Zero momentum leads to infite distance. */
202  if (dp2 < really_small) {
203  return dr2;
204  }
205  const double dpdr = pos_diff * mom_diff;
206 
215  const double result = dr2 - dpdr * dpdr / dp2;
216  return result > 0.0 ? result : 0.0;
217 }
218 
220  // local copy of particles (since we need to boost them)
223 
224  const FourVector delta_x = p_a.position() - p_b.position();
225  const double mom_diff_sqr =
226  (p_a.momentum().threevec() - p_b.momentum().threevec()).sqr();
227  const double x_sqr = delta_x.sqr();
228 
229  if (mom_diff_sqr < really_small) {
230  return -x_sqr;
231  }
232 
233  const double p_a_sqr = p_a.momentum().sqr();
234  const double p_b_sqr = p_b.momentum().sqr();
235  const double p_a_dot_x = p_a.momentum().Dot(delta_x);
236  const double p_b_dot_x = p_b.momentum().Dot(delta_x);
237  const double p_a_dot_p_b = p_a.momentum().Dot(p_b.momentum());
238 
239  const double b_sqr =
240  -x_sqr -
241  (p_a_sqr * std::pow(p_b_dot_x, 2) + p_b_sqr * std::pow(p_a_dot_x, 2) -
242  2 * p_a_dot_p_b * p_a_dot_x * p_b_dot_x) /
243  (std::pow(p_a_dot_p_b, 2) - p_a_sqr * p_b_sqr);
244  return b_sqr > 0.0 ? b_sqr : 0.0;
245 }
246 
260 static double Cugnon_bpp(double plab) {
261  if (plab < 2.) {
262  double p8 = pow_int(plab, 8);
263  return 5.5 * p8 / (7.7 + p8);
264  } else {
265  return std::min(9.0, 5.334 + 0.67 * (plab - 2.));
266  }
267 }
268 
279 static double Cugnon_bnp(double plab) {
280  if (plab < 0.225) {
281  return 0.;
282  } else if (plab < 0.6) {
283  return 16.53 * (plab - 0.225);
284  } else if (plab < 1.6) {
285  return -1.63 * plab + 7.16;
286  } else {
287  return Cugnon_bpp(plab);
288  }
289 }
290 
291 void ScatterAction::sample_angles(std::pair<double, double> masses,
292  double kinetic_energy_cm) {
295  // We potentially have more than two particles, so the following angular
296  // distributions don't work. Instead we just keep the angular
297  // distributions generated by string fragmentation.
298  return;
299  }
300  assert(outgoing_particles_.size() == 2);
301 
302  // NN scattering is anisotropic currently
303  const bool nn_scattering = incoming_particles_[0].type().is_nucleon() &&
304  incoming_particles_[1].type().is_nucleon();
305  /* Elastic process is anisotropic and
306  * the angular distribution is based on the NN elastic scattering. */
307  const bool el_scattering = process_type_ == ProcessType::Elastic;
308 
309  const double mass_in_a = incoming_particles_[0].effective_mass();
310  const double mass_in_b = incoming_particles_[1].effective_mass();
311 
314 
315  const double mass_a = masses.first;
316  const double mass_b = masses.second;
317 
318  const std::array<double, 2> t_range = get_t_range<double>(
319  kinetic_energy_cm, mass_in_a, mass_in_b, mass_a, mass_b);
320  Angles phitheta;
321  if (el_scattering && !isotropic_) {
325  double mandelstam_s_new = 0.;
326  if (nn_scattering) {
327  mandelstam_s_new = mandelstam_s();
328  } else {
329  /* In the case of elastic collisions other than NN collisions,
330  * there is an ambiguity on how to get the lab-frame momentum (plab),
331  * since the incoming particles can have different masses.
332  * Right now, we first obtain the center-of-mass momentum
333  * of the collision (pcom_now).
334  * Then, the lab-frame momentum is evaluated from the mandelstam s,
335  * which yields the original center-of-mass momentum
336  * when nucleon mass is assumed. */
337  const double pcm_now = pCM_from_s(mandelstam_s(), mass_in_a, mass_in_b);
338  mandelstam_s_new =
339  4. * std::sqrt(pcm_now * pcm_now + nucleon_mass * nucleon_mass);
340  }
341  double bb, a, plab = plab_from_s(mandelstam_s_new);
342  if (nn_scattering &&
343  p_a->pdgcode().antiparticle_sign() ==
344  p_b->pdgcode().antiparticle_sign() &&
345  std::abs(p_a->type().charge() + p_b->type().charge()) == 1) {
346  // proton-neutron and antiproton-antineutron
347  bb = std::max(Cugnon_bnp(plab), really_small);
348  a = (plab < 0.8) ? 1. : 0.64 / (plab * plab);
349  } else {
350  /* all others including pp, nn and AQM elastic processes
351  * This is applied for all particle pairs, which are allowed to
352  * interact elastically. */
353  bb = std::max(Cugnon_bpp(plab), really_small);
354  a = 1.;
355  }
356  double t = random::expo(bb, t_range[0], t_range[1]);
357  if (random::canonical() > 1. / (1. + a)) {
358  t = t_range[0] + t_range[1] - t;
359  }
360  // determine scattering angles in center-of-mass frame
361  phitheta = Angles(2. * M_PI * random::canonical(),
362  1. - 2. * (t - t_range[0]) / (t_range[1] - t_range[0]));
363  } else if (nn_scattering && p_a->pdgcode().is_Delta() &&
364  p_b->pdgcode().is_nucleon() &&
365  p_a->pdgcode().antiparticle_sign() ==
366  p_b->pdgcode().antiparticle_sign() &&
367  !isotropic_) {
371  const double plab = plab_from_s(mandelstam_s());
372  const double bb = std::max(Cugnon_bpp(plab), really_small);
373  double t = random::expo(bb, t_range[0], t_range[1]);
374  if (random::canonical() > 0.5) {
375  t = t_range[0] + t_range[1] - t; // symmetrize
376  }
377  phitheta = Angles(2. * M_PI * random::canonical(),
378  1. - 2. * (t - t_range[0]) / (t_range[1] - t_range[0]));
379  } else if (nn_scattering && p_b->pdgcode().is_nucleon() && !isotropic_ &&
380  (p_a->type().is_Nstar() || p_a->type().is_Deltastar())) {
382  const std::array<double, 4> p{1.46434, 5.80311, -6.89358, 1.94302};
383  const double a = p[0] + mass_a * (p[1] + mass_a * (p[2] + mass_a * p[3]));
384  /* If the resonance is so heavy that the index "a" exceeds 30,
385  * the power function turns out to be too sharp. Take t directly to be
386  * t_0 in such a case. */
387  double t = t_range[0];
388  if (a < 30) {
389  t = random::power(-a, t_range[0], t_range[1]);
390  }
391  if (random::canonical() > 0.5) {
392  t = t_range[0] + t_range[1] - t; // symmetrize
393  }
394  phitheta = Angles(2. * M_PI * random::canonical(),
395  1. - 2. * (t - t_range[0]) / (t_range[1] - t_range[0]));
396  } else {
397  /* isotropic angular distribution */
398  phitheta.distribute_isotropically();
399  }
400 
401  ThreeVector pscatt = phitheta.threevec();
402  // 3-momentum of first incoming particle in center-of-mass frame
403  ThreeVector pcm =
404  incoming_particles_[0].momentum().lorentz_boost(beta_cm()).threevec();
405  pscatt.rotate_z_axis_to(pcm);
406 
407  // final-state CM momentum
408  const double p_f = pCM(kinetic_energy_cm, mass_a, mass_b);
409  if (!(p_f > 0.0)) {
410  logg[LScatterAction].warn("Particle: ", p_a->pdgcode(),
411  " radial momentum: ", p_f);
412  logg[LScatterAction].warn("Etot: ", kinetic_energy_cm, " m_a: ", mass_a,
413  " m_b: ", mass_b);
414  }
415  p_a->set_4momentum(mass_a, pscatt * p_f);
416  p_b->set_4momentum(mass_b, -pscatt * p_f);
417 
418  /* Debug message is printed before boost, so that p_a and p_b are
419  * the momenta in the center of mass frame and thus opposite to
420  * each other.*/
421  logg[LScatterAction].debug("p_a: ", *p_a, "\np_b: ", *p_b);
422 }
423 
425  // copy initial particles into final state
428  // resample momenta
429  sample_angles({outgoing_particles_[0].effective_mass(),
430  outgoing_particles_[1].effective_mass()},
431  sqrt_s());
432 }
433 
435  // create new particles
438 }
439 
443  logg[LScatterAction].debug("2->3 scattering:", incoming_particles_, " -> ",
445 }
446 
448  if (outgoing_particles_.size() != 1) {
449  std::string s =
450  "resonance_formation: "
451  "Incorrect number of particles in final state: ";
452  s += std::to_string(outgoing_particles_.size()) + " (";
453  s += incoming_particles_[0].pdgcode().string() + " + ";
454  s += incoming_particles_[1].pdgcode().string() + ")";
455  throw InvalidResonanceFormation(s);
456  }
457  // Set the momentum of the formed resonance in its rest frame.
458  outgoing_particles_[0].set_4momentum(
459  total_momentum_of_outgoing_particles().abs(), 0., 0., 0.);
461  /* this momentum is evaluated in the computational frame. */
462  logg[LScatterAction].debug("Momentum of the new particle: ",
463  outgoing_particles_[0].momentum());
464 }
465 
466 /* This function will generate outgoing particles in computational frame
467  * from a hard process.
468  * The way to excite soft strings is based on the UrQMD model */
470  assert(incoming_particles_.size() == 2);
471  // Disable floating point exception trap for Pythia
472  {
473  DisableFloatTraps guard;
474  /* initialize the string_process_ object for this particular collision */
476  /* implement collision */
477  bool success = false;
478  int ntry = 0;
479  const int ntry_max = 10000;
480  while (!success && ntry < ntry_max) {
481  ntry++;
482  switch (process_type_) {
484  /* single diffractive to A+X */
485  success = string_process_->next_SDiff(true);
486  break;
488  /* single diffractive to X+B */
489  success = string_process_->next_SDiff(false);
490  break;
492  /* double diffractive */
493  success = string_process_->next_DDiff();
494  break;
496  /* soft non-diffractive */
497  success = string_process_->next_NDiffSoft();
498  break;
500  /* soft BBbar 2 mesonic annihilation */
501  success = string_process_->next_BBbarAnn();
502  break;
504  success = string_process_->next_NDiffHard();
505  break;
506  default:
507  logg[LPythia].error("Unknown string process required.");
508  success = false;
509  }
510  }
511  if (ntry == ntry_max) {
512  /* If pythia fails to form a string, it is usually because the energy
513  * is not large enough. In this case, an elastic scattering happens.
514  *
515  * Since particles are normally added after process selection for
516  * strings, outgoing_particles is still uninitialized, and memory
517  * needs to be allocated. We also shift the process_type_ to elastic
518  * so that sample_angles does a proper treatment. */
519  outgoing_particles_.reserve(2);
524  } else {
527  /* Check momentum difference for debugging */
528  FourVector out_mom;
529  for (ParticleData data : outgoing_particles_) {
530  out_mom += data.momentum();
531  }
532  logg[LPythia].debug("Incoming momenta string:", total_momentum());
533  logg[LPythia].debug("Outgoing momenta string:", out_mom);
534  }
535  }
536 }
537 
538 void ScatterAction::format_debug_output(std::ostream &out) const {
539  out << "Scatter of " << incoming_particles_;
540  if (outgoing_particles_.empty()) {
541  out << " (not performed)";
542  } else {
543  out << " to " << outgoing_particles_;
544  }
545 }
546 
547 } // namespace smash
smash::ScatterAction::transverse_distance_sqr
double transverse_distance_sqr() const
Calculate the transverse distance of the two incoming particles in their local rest frame.
Definition: scatteraction.cc:182
smash
Definition: action.h:24
smash::ProcessBranch::particle_list
ParticleList particle_list() const
Definition: processbranch.cc:26
smash::FourVector::Dot
double Dot(const FourVector &a) const
calculate the scalar product with another four-vector
Definition: fourvector.h:446
smash::Action::lambda_tilde
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
smash::Action::incoming_particles_
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:326
smash::ProcessType::StringHard
hard string process involving 2->2 QCD process by PYTHIA.
smash::Action::total_momentum
FourVector total_momentum() const
Sum of 4-momenta of incoming particles.
Definition: action.h:360
smash::Action::time_of_execution_
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:340
smash::StringProcess::get_final_state
ParticleList get_final_state()
a function to get the final state particle list which is called after the collision
Definition: stringprocess.h:773
pow.h
smash::plab_from_s
double plab_from_s(double mandelstam_s, double mass)
Convert Mandelstam-s to p_lab in a fixed-target collision.
Definition: kinematics.h:157
smash::ParticleType::is_Deltastar
bool is_Deltastar() const
Definition: particletype.h:233
smash::ParticleData::momentum
const FourVector & momentum() const
Get the particle's 4-momentum.
Definition: particledata.h:152
smash::ScatterAction::resonance_formation
void resonance_formation()
Perform a 2->1 resonance-formation process.
Definition: scatteraction.cc:447
smash::StringProcess::init
void init(const ParticleList &incoming, double tcoll)
initialization feed intial particles, time of collision and gamma factor of the center of mass.
Definition: stringprocess.cc:207
smash::Action::assign_formation_time_to_outgoing_particles
void assign_formation_time_to_outgoing_particles()
Assign the formation time to the outgoing particles.
Definition: action.cc:183
smash::ScatterAction::get_partial_weight
double get_partial_weight() const override
Get the partial cross section of the chosen channel.
Definition: scatteraction.cc:146
smash::random::expo
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
smash::ParticleData
Definition: particledata.h:52
smash::PdgCode::is_nucleon
bool is_nucleon() const
Definition: pdgcode.h:321
smash::Action::sample_2body_phasespace
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
smash::CrossSections::generate_collision_list
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....
Definition: crosssections.cc:111
smash::ParticleData::boost
void boost(const ThreeVector &v)
Apply a full Lorentz boost of momentum and position.
Definition: particledata.h:317
smash::StringProcess::next_NDiffHard
bool next_NDiffHard()
Hard Non-diffractive process is based on PYTHIA 8 with partonic showers and interactions.
Definition: stringprocess.cc:520
smash::PdgCode::is_Delta
bool is_Delta() const
Definition: pdgcode.h:345
cxx14compat.h
smash::ProcessType::StringSoftDoubleDiffractive
double diffractive. Two strings are formed, one from A and one from B.
NNbarTreatment::Strings
Use string fragmentation.
smash::ProcessType::StringSoftNonDiffractive
non-diffractive. Two strings are formed both have ends in A and B.
smash::ScatterAction::cm_momentum
double cm_momentum() const
Get the momentum of the center of mass of the incoming particles in the calculation frame.
Definition: scatteraction.cc:161
smash::is_string_soft_process
bool is_string_soft_process(ProcessType p)
Check if a given process type is a soft string excitation.
Definition: processbranch.cc:18
smash::ScatterAction::format_debug_output
void format_debug_output(std::ostream &out) const override
Definition: scatteraction.cc:538
smash::PdgCode::antiparticle_sign
int antiparticle_sign() const
Definition: pdgcode.h:546
smash::ScatterAction::cov_transverse_distance_sqr
double cov_transverse_distance_sqr() const
Calculate the transverse distance of the two incoming particles in their local rest frame written in ...
Definition: scatteraction.cc:219
smash::FourVector::sqr
double sqr() const
calculate the square of the vector (which is a scalar)
Definition: fourvector.h:450
smash::Angles::distribute_isotropically
void distribute_isotropically()
Populate the object with a new direction.
Definition: angles.h:188
smash::ScatterAction::collision_channels_
CollisionBranchList collision_channels_
List of possible collisions.
Definition: scatteraction.h:253
smash::ThreeVector::sqr
double sqr() const
Definition: threevector.h:259
smash::ParticleData::pdgcode
PdgCode pdgcode() const
Get the pdgcode of the particle.
Definition: particledata.h:81
smash::ScatterAction::elastic_scattering
void elastic_scattering()
Perform an elastic two-body scattering, i.e. just exchange momentum.
Definition: scatteraction.cc:424
smash::nucleon_mass
constexpr double nucleon_mass
Nucleon mass in GeV.
Definition: constants.h:55
smash::DisableFloatTraps
Guard type that safely disables floating point traps for the scope in which it is placed.
Definition: fpenvironment.h:79
smash::ProcessType::TwoToTwo
2->2 inelastic scattering
smash::ScatterAction::beta_cm
ThreeVector beta_cm() const
Get the velocity of the center of mass of the scattering/incoming particles in the calculation frame.
Definition: scatteraction.cc:151
smash::ProcessType::StringSoftSingleDiffractiveXB
single diffractive AB->XB.
ReactionsBitSet
std::bitset< 10 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
Definition: forwarddeclarations.h:231
smash::ParticleData::set_4momentum
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
Definition: particledata.h:158
smash::logg
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
smash::ScatterAction::string_process_
StringProcess * string_process_
Pointer to interface class for strings.
Definition: scatteraction.h:282
smash::pCM
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:79
smash::really_small
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37
random.h
angles.h
MultiParticleReactionsBitSet
std::bitset< 2 > MultiParticleReactionsBitSet
Container for the 2 to 2 reactions in the code.
Definition: forwarddeclarations.h:240
crosssections.h
smash::ScatterAction::ScatterAction
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.
Definition: scatteraction.cc:29
smash::ScatterAction::add_all_scatterings
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.
Definition: scatteraction.cc:110
smash::Cugnon_bpp
static double Cugnon_bpp(double plab)
Computes the B coefficients from the Cugnon parametrization of the angular distribution in elastic pp...
Definition: scatteraction.cc:260
smash::ThreeVector
Definition: threevector.h:31
smash::ScatterAction::string_excitation
void string_excitation()
Todo(ryu): document better - it is not really UrQMD-based, isn't it? Perform the UrQMD-based string e...
Definition: scatteraction.cc:469
smash::ScatterAction::cm_momentum_squared
double cm_momentum_squared() const
Get the squared momentum of the center of mass of the incoming particles in the calculation frame.
Definition: scatteraction.cc:167
smash::ScatterAction::get_total_weight
double get_total_weight() const override
Get the total cross section of scattering particles.
Definition: scatteraction.cc:141
smash::ProcessType::FailedString
Soft String NNbar annihilation process can fail by lack of energy.
smash::StringProcess::next_SDiff
bool next_SDiff(bool is_AB_to_AX)
Single-diffractive process is based on single pomeron exchange described in Ingelman:1984ns .
Definition: stringprocess.cc:236
smash::StringProcess::next_DDiff
bool next_DDiff()
Double-diffractive process ( A + B -> X + X ) is similar to the single-diffractive process,...
Definition: stringprocess.cc:388
smash::CrossSections::string_probability
double string_probability(bool strings_switch, bool use_transition_probability, bool use_AQM, bool treat_nnbar_with_strings) const
Definition: crosssections.cc:2702
smash::ParticleData::position
const FourVector & position() const
Get the particle's position in Minkowski space.
Definition: particledata.h:198
smash::Action::process_type_
ProcessType process_type_
type of process
Definition: action.h:343
smash::ScatterAction::total_cross_section_
double total_cross_section_
Total hadronic cross section.
Definition: scatteraction.h:256
smash::LPythia
static constexpr int LPythia
Definition: stringprocess.h:26
smash::CollisionBranch::get_type
ProcessType get_type() const override
Definition: processbranch.h:298
smash::LScatterAction
static constexpr int LScatterAction
Definition: bremsstrahlungaction.cc:16
smash::CrossSections
The cross section class assembels everything that is needed to calculate the cross section and return...
Definition: crosssections.h:65
smash::ScatterAction::cross_section
virtual double cross_section() const
Get the total cross section of the scattering particles.
Definition: scatteraction.h:194
smash::CrossSections::high_energy
double high_energy() const
Determine the parametrized total cross section at high energies for the given collision,...
Definition: crosssections.cc:2346
smash::Action::get_potential_at_interaction_point
std::pair< FourVector, FourVector > get_potential_at_interaction_point() const
Get the skyrme and asymmetry potential at the interaction point.
Definition: action.cc:108
smash::ScatterAction::gamma_cm
double gamma_cm() const
Get the gamma factor corresponding to a boost to the center of mass frame of the colliding particles.
Definition: scatteraction.cc:155
smash::Action::total_momentum_of_outgoing_particles
FourVector total_momentum_of_outgoing_particles() const
Calculate the total kinetic momentum of the outgoing particles.
Definition: action.cc:152
smash::FourVector::velocity
ThreeVector velocity() const
Get the velocity (3-vector divided by zero component).
Definition: fourvector.h:323
smash::ScatterAction::sample_angles
void sample_angles(std::pair< double, double > masses, double kinetic_energy_cm) override
Sample final-state angles in a 2->2 collision (possibly anisotropic).
Definition: scatteraction.cc:291
fpenvironment.h
smash::ScatterAction::isotropic_
bool isotropic_
Do this collision isotropically?
Definition: scatteraction.h:262
smash::Action::outgoing_particles_
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
Definition: action.h:334
smash::Action::sample_3body_phasespace
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
smash::Angles::threevec
ThreeVector threevec() const
Definition: angles.h:268
smash::ProcessType::StringSoftSingleDiffractiveAX
(41-45) soft string excitations.
smash::ThreeVector::rotate_z_axis_to
void rotate_z_axis_to(ThreeVector &r)
Rotate the z-axis onto the vector r.
Definition: threevector.h:319
smash::Action::sqrt_s
double sqrt_s() const
Determine the total energy in the center-of-mass frame [GeV].
Definition: action.h:266
smash::pow_int
constexpr T pow_int(const T base, unsigned const exponent)
Efficient template for calculating integer powers using squaring.
Definition: pow.h:23
smash::ProcessType::StringSoftAnnihilation
a special case of baryon-antibaryon annihilation.
smash::random::power
T power(T n, T xMin, T xMax)
Draws a random number according to a power-law distribution ~ x^n.
Definition: random.h:203
constants.h
smash::ScatterAction::add_collision
void add_collision(CollisionBranchPtr p)
Add a new collision channel.
Definition: scatteraction.cc:40
pdgcode.h
logging.h
smash::ProcessType::Elastic
elastic scattering: particles remain the same, only momenta change
smash::Action
Definition: action.h:35
smash::ScatterAction::inelastic_scattering
void inelastic_scattering()
Perform an inelastic two-body scattering, i.e. new particles are formed.
Definition: scatteraction.cc:434
smash::ParticleType::is_Nstar
bool is_Nstar() const
Definition: particletype.h:224
smash::FourVector
Definition: fourvector.h:33
smash::Action::get_interaction_point
FourVector get_interaction_point() const
Get the interaction point.
Definition: action.cc:67
smash::StringProcess::next_BBbarAnn
bool next_BBbarAnn()
Baryon-antibaryon annihilation process Based on what UrQMD Bass:1998ca , Bleicher:1999xi does,...
Definition: stringprocess.cc:1519
smash::pdg::p
constexpr int p
Proton.
Definition: pdgcode_constants.h:28
smash::Angles
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
Definition: angles.h:59
NNbarTreatment
NNbarTreatment
Treatment of N Nbar Annihilation.
Definition: forwarddeclarations.h:176
smash::ScatterAction::partial_cross_section_
double partial_cross_section_
Partial cross-section to the chosen outgoing channel.
Definition: scatteraction.h:259
smash::CrossSections::string_excitation
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...
Definition: crosssections.cc:2211
smash::Action::incoming_particles
const ParticleList & incoming_particles() const
Get the list of particles that go into the action.
Definition: action.cc:57
smash::ScatterAction::generate_final_state
void generate_final_state() override
Generate the final-state of the scattering process.
Definition: scatteraction.cc:49
smash::ProcessType::TwoToOne
resonance formation (2->1)
smash::ParticleData::type
const ParticleType & type() const
Get the type of the particle.
Definition: particledata.h:122
scatteraction.h
smash::Action::InvalidResonanceFormation
Definition: action.h:320
smash::ScatterAction::relative_velocity
double relative_velocity() const
Get the relative velocity of the two incoming particles.
Definition: scatteraction.cc:173
smash::random::canonical
T canonical()
Definition: random.h:113
smash::ScatterAction::two_to_three_scattering
void two_to_three_scattering()
Perform a two-to-three-body scattering.
Definition: scatteraction.cc:440
smash::Cugnon_bnp
static double Cugnon_bnp(double plab)
Computes the B coefficients from the Cugnon parametrization of the angular distribution in elastic np...
Definition: scatteraction.cc:279
smash::FourVector::threevec
ThreeVector threevec() const
Definition: fourvector.h:319
smash::ScatterAction::add_collisions
void add_collisions(CollisionBranchList pv)
Add several new collision channels at once.
Definition: scatteraction.cc:44
smash::StringProcess::next_NDiffSoft
bool next_NDiffSoft()
Soft Non-diffractive process is modelled in accordance with dual-topological approach Capella:1978ig ...
Definition: stringprocess.cc:443
smash::ParticleType::charge
int32_t charge() const
The charge of the particle.
Definition: particletype.h:188
smash::ScatterAction::mandelstam_s
double mandelstam_s() const
Determine the Mandelstam s variable,.
Definition: scatteraction.cc:159
smash::ProcessBranch::weight
double weight() const
Definition: processbranch.h:198
smash::ScatterAction::InvalidScatterAction
Definition: scatteraction.h:173
smash::CollisionBranch
Definition: processbranch.h:221
smash::pCM_sqr
T pCM_sqr(const T sqrts, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:91
smash::pCM_from_s
T pCM_from_s(const T s, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:66
smash::ProcessType::TwoToThree
2->3 scattering