Version: SMASH-2.2
scatteraction.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2015-2021
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 "cxx14compat.h"
20 #include "isoparticletype.h"
21 #include "stringprocess.h"
22 
23 namespace smash {
24 
30 class ScatterAction : public Action {
31  public:
44  ScatterAction(const ParticleData& in_part1, const ParticleData& in_part2,
45  double time, bool isotropic = false,
46  double string_formation_time = 1.0, double box_length = -1.0);
47 
53  void add_collision(CollisionBranchPtr p);
54 
60  void add_collisions(CollisionBranchList pv);
61 
77  double transverse_distance_sqr() const;
78 
86  double cov_transverse_distance_sqr() const;
95  double mandelstam_s() const;
96 
103  double relative_velocity() const;
104 
112  void generate_final_state() override;
113 
119  double get_total_weight() const override;
120 
126  double get_partial_weight() const override;
127 
131  void sample_angles(std::pair<double, double> masses,
132  double kinetic_energy_cm) override;
133 
152  void add_all_scatterings(double elastic_parameter, bool two_to_one,
153  ReactionsBitSet included_2to2,
154  MultiParticleReactionsBitSet included_multi,
155  double low_snn_cut, bool strings_switch,
156  bool use_AQM, bool strings_with_probability,
157  NNbarTreatment nnbar_treatment, double scale_xs,
158  double additional_el_xs);
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 
194  virtual double cross_section() const { return total_cross_section_; }
195 
196  protected:
203  double cm_momentum() const;
210  double cm_momentum_squared() const;
211 
222  ThreeVector beta_cm() const;
229  double gamma_cm() const;
230 
232  void elastic_scattering();
233 
235  void inelastic_scattering();
236 
238  void two_to_many_scattering();
239 
246  void string_excitation();
247 
252  void format_debug_output(std::ostream& out) const override;
253 
255  CollisionBranchList collision_channels_;
256 
259 
262 
264  bool isotropic_ = false;
265 
268 
269  private:
275  bool is_elastic() const;
276 
281  void resonance_formation();
282 
285 };
286 
287 } // namespace smash
288 
289 #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
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.
const CollisionBranchList & collision_channels()
Get list of possible collision channels.
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.
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 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.
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 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.
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
std::bitset< 10 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
NNbarTreatment
Treatment of N Nbar Annihilation.
std::bitset< 4 > MultiParticleReactionsBitSet
Container for the n to m reactions in the code.
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