Version: SMASH-3.1
scatteraction.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2023
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_SCATTERACTION_H_
11 #define SRC_INCLUDE_SMASH_SCATTERACTION_H_
12 
13 #include <memory>
14 #include <set>
15 #include <string>
16 #include <utility>
17 
18 #include "action.h"
19 #include "isoparticletype.h"
21 #include "stringprocess.h"
22 
23 namespace smash {
24 
30 class ScatterAction : public Action {
31  public:
46  ScatterAction(const ParticleData& in_part1, const ParticleData& in_part2,
47  double time, bool isotropic = false,
48  double string_formation_time = 1.0, double box_length = -1.0,
49  bool is_total_parametrized = false);
50 
56  void add_collision(CollisionBranchPtr p);
57 
63  void add_collisions(CollisionBranchList pv);
64 
85  double transverse_distance_sqr() const;
86 
94  double cov_transverse_distance_sqr() const;
103  double mandelstam_s() const;
104 
111  double relative_velocity() const;
112 
120  void generate_final_state() override;
121 
127  double get_total_weight() const override;
128 
134  double get_partial_weight() const override;
135 
139  void sample_angles(std::pair<double, double> masses,
140  double kinetic_energy_cm) override;
141 
148  void add_all_scatterings(
149  const ScatterActionsFinderParameters& finder_parameters);
150 
158  const ScatterActionsFinderParameters& finder_parameters);
159 
165  const CollisionBranchList& collision_channels() {
166  return collision_channels_;
167  }
168 
173  class InvalidScatterAction : public std::invalid_argument {
174  using std::invalid_argument::invalid_argument;
175  };
176 
186  string_process_ = str_proc;
187  }
188 
195  virtual double cross_section() const {
198  }
200  }
201 
202  protected:
209  double cm_momentum() const;
216  double cm_momentum_squared() const;
217 
228  ThreeVector beta_cm() const;
235  double gamma_cm() const;
236 
238  void elastic_scattering();
239 
241  void inelastic_scattering();
242 
244  void two_to_many_scattering();
245 
252  void string_excitation();
253 
258  void format_debug_output(std::ostream& out) const override;
259 
261  CollisionBranchList collision_channels_;
262 
265 
268 
270  bool isotropic_ = false;
271 
274 
275  private:
281  bool is_elastic() const;
282 
287  void resonance_formation();
288 
296 
309  const PseudoResonance method,
310  const StringTransitionParameters& transition) const;
311 
314 
317 
319  std::optional<double> parametrized_total_cross_section_ = std::nullopt;
320 
322  bool were_processes_added_ = false;
323 };
324 
325 } // namespace smash
326 
327 #endif // SRC_INCLUDE_SMASH_SCATTERACTION_H_
Action is the base class for a generic process that takes a number of incoming particles and transfor...
Definition: action.h:35
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:58
A pointer-like interface to global references to ParticleType objects.
Definition: particletype.h:676
Thrown when ScatterAction is called to perform with unknown ProcessType.
ScatterAction is a special action which takes two incoming particles and performs a scattering,...
Definition: scatteraction.h:30
bool is_elastic() const
Check if the scattering is elastic.
bool isotropic_
Do this collision isotropically?
double string_formation_time_
Time fragments take to be fully formed in hard string excitation.
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, bool is_total_parametrized=false)
Construct a ScatterAction object.
std::optional< double > parametrized_total_cross_section_
If cross section is parametrized, store the value.
const CollisionBranchList & collision_channels()
Get list of possible collision channels.
void rescale_outgoing_branches()
Loop over the possible branches and rescales their weight according to the desired total cross sectio...
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,.
void set_parametrized_total_cross_section(const ScatterActionsFinderParameters &finder_parameters)
Given the incoming particles, assigns the correct parametrization of the total cross section.
double get_partial_weight() const override
Get the partial cross section of the chosen channel.
StringProcess * string_process_
Pointer to interface class for strings.
bool is_total_parametrized_
Whether the total cross section is parametrized.
void create_string_final_state()
Creates the final states for string-processes after they are performed.
double sum_of_partial_cross_sections_
Current sum of partial hadronic cross sections.
void set_string_interface(StringProcess *str_proc)
Set the StringProcess object to be used.
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.
void add_all_scatterings(const ScatterActionsFinderParameters &finder_parameters)
Add all possible scattering subprocesses for this action object.
void two_to_many_scattering()
Perform an inelastic two-to-many-body scattering (more than 2)
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.
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 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.
bool were_processes_added_
Lock for calling add_all_scatterings only once.
double cov_transverse_distance_sqr() const
Calculate the transverse distance of the two incoming particles in their local rest frame written in ...
virtual double cross_section() const
Get the total cross section of the scattering particles, either from a parametrization,...
ParticleTypePtr try_find_pseudoresonance(const PseudoResonance method, const StringTransitionParameters &transition) const
Try to find a pseudo-resonance that can be created from the incoming particles using a given method.
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.
String excitation processes used in SMASH.
Definition: stringprocess.h:45
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
PseudoResonance
Which pseudo-resonance fills the inelastic gap in the transition to string region of cross sections.
void format_debug_output(std::ostream &out) const override
Writes information about this scatter action to the out stream.
constexpr int p
Proton.
Definition: action.h:24
Helper structure for ScatterActionsFinder.
Constants related to transition between low and high collision energies.