Version: SMASH-1.5
scatteractionsfinder.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2018
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SCATTERACTIONSFINDER_H_
11 #define SRC_INCLUDE_SCATTERACTIONSFINDER_H_
12 
13 #include <memory>
14 #include <set>
15 #include <vector>
16 
17 #include "action.h"
18 #include "actionfinderfactory.h"
19 #include "configuration.h"
20 #include "constants.h"
21 #include "scatteraction.h"
22 
23 namespace smash {
24 
31  public:
57  const ExperimentParameters &parameters,
58  const std::vector<bool> &nucleon_has_interacted,
59  int N_tot, int N_proj);
60 
72  static inline double collision_time(const ParticleData &p1,
73  const ParticleData &p2) {
83  const ThreeVector dv_times_e1e2 =
84  p1.momentum().threevec() * p2.momentum().x0() -
85  p2.momentum().threevec() * p1.momentum().x0();
86  const double dv_times_e1e2_sqr = dv_times_e1e2.sqr();
87  if (dv_times_e1e2_sqr < really_small) {
88  return -1.0;
89  }
90  const ThreeVector dr = p1.position().threevec() - p2.position().threevec();
91  return -(dr * dv_times_e1e2) *
92  (p1.momentum().x0() * p2.momentum().x0() / dv_times_e1e2_sqr);
93  }
94 
106  ActionList find_actions_in_cell(const ParticleList &search_list,
107  double dt) const override;
108 
119  ActionList find_actions_with_neighbors(const ParticleList &search_list,
120  const ParticleList &neighbors_list,
121  double dt) const override;
122 
133  const ParticleList &search_list, const Particles &surrounding_list,
134  double dt) const override;
135 
140  ActionList find_final_actions(const Particles & /*search_list*/,
141  bool /*only_res*/ = false) const override {
142  return ActionList();
143  }
144 
155  inline bool is_constant_elastic_isotropic() const {
156  return ParticleType::list_all().size() == 1 && !two_to_one_ && isotropic_ &&
157  elastic_parameter_ > 0.;
158  }
159 
170  double max_transverse_distance_sqr(int testparticles) const {
173  testparticles * fm2_mb * M_1_PI;
174  }
175 
180  void dump_reactions() const;
181 
193  void dump_cross_sections(const ParticleType &a, const ParticleType &b,
194  double m_a, double m_b, bool final_state) const;
195 
201  if (strings_switch_) {
202  return string_process_interface_.get();
203  } else {
204  return NULL;
205  }
206  }
207 
208  private:
220  ActionPtr check_collision(const ParticleData &data_a,
221  const ParticleData &data_b, double dt) const;
223  std::unique_ptr<StringProcess> string_process_interface_;
225  const double elastic_parameter_;
227  const int testparticles_;
229  const bool isotropic_;
231  const bool two_to_one_;
238  const double low_snn_cut_;
240  const bool strings_switch_;
242  const bool use_AQM_;
251  const std::vector<bool> &nucleon_has_interacted_;
253  const int N_tot_;
255  const int N_proj_;
258 };
259 
260 } // namespace smash
261 
262 #endif // SRC_INCLUDE_SCATTERACTIONSFINDER_H_
StringProcess * get_process_string_ptr()
static double collision_time(const ParticleData &p1, const ParticleData &p2)
Determine the collision time of the two particles.
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:30
const int testparticles_
Number of test particles.
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:34
String excitation processes used in SMASH.
Definition: processstring.h:46
const ReactionsBitSet incl_set_
List of included 2<->2 reactions.
const bool two_to_one_
Enable 2->1 processes.
const double low_snn_cut_
Elastic collsions between two nucleons with sqrt_s below low_snn_cut_ are excluded.
const double string_formation_time_
Parameter for formation time.
Collection of useful constants that are known at compile time.
const bool strings_with_probability_
Decide whether to implement string fragmentation based on a probability.
ActionList find_final_actions(const Particles &, bool=false) const override
Find some final collisions at the end of the simulation.
double max_transverse_distance_sqr(int testparticles) const
The maximal distance over which particles can interact, related to the number of test particles and t...
ActionPtr check_collision(const ParticleData &data_a, const ParticleData &data_b, double dt) const
Check for a single pair of particles (id_a, id_b) if a collision will happen in the next timestep and...
constexpr double fm2_mb
mb <-> fm^2 conversion factor.
Definition: constants.h:28
const FourVector & momentum() const
Get the particle&#39;s 4-momentum.
Definition: particledata.h:139
const std::vector< bool > & nucleon_has_interacted_
Parameter to record whether the nucleon has experienced a collision or not.
Interface to the SMASH configuration files.
constexpr double maximum_cross_section
The maximal cross section (in mb) for which it is guaranteed that all collisions with this cross sect...
Definition: constants.h:108
NNbarTreatment
Treatment of N Nbar Annihilation.
std::unique_ptr< StringProcess > string_process_interface_
Class that deals with strings, interfacing Pythia.
double x0() const
Definition: fourvector.h:290
const bool strings_switch_
Switch to turn off string excitation.
ActionList find_actions_in_cell(const ParticleList &search_list, double dt) const override
Search for all the possible collisions within one cell.
ThreeVector threevec() const
Definition: fourvector.h:306
static const ParticleTypeList & list_all()
Definition: particletype.cc:55
const FourVector & position() const
Get the particle&#39;s position in Minkowski space.
Definition: particledata.h:185
Particle type contains the static properties of a particle species.
Definition: particletype.h:87
ScatterActionsFinder(Configuration config, const ExperimentParameters &parameters, const std::vector< bool > &nucleon_has_interacted, int N_tot, int N_proj)
Constructor of the finder with the given parameters.
void dump_cross_sections(const ParticleType &a, const ParticleType &b, double m_a, double m_b, bool final_state) const
Print out partial cross-sections of all processes that can occur in the collision of a(mass = m_a) an...
A simple scatter finder: Just loops through all particles and checks each pair for a collision...
const NNbarTreatment nnbar_treatment_
Switch for NNbar reactions.
double sqr() const
Definition: threevector.h:249
std::bitset< 6 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
void dump_reactions() const
Prints out all the 2-> n (n > 1) reactions with non-zero cross-sections between all possible pairs of...
bool is_constant_elastic_isotropic() const
If there is only one particle sort, no decays (only elastic scatterings are possible), scatterings are isotropic and cross-section fixed to elastic_parameter_ independently on momenta, then maximal cross-section is elastic_parameter_.
const bool use_AQM_
Switch to control whether to use AQM or not.
const int N_proj_
Record the number of the nucleons in the projectile.
const bool isotropic_
Do all collisions isotropically.
const int N_tot_
Record the total number of the nucleons in the two colliding nuclei.
ActionFinderInterface is the abstract base class for all action finders, i.e.
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
ActionList find_actions_with_surrounding_particles(const ParticleList &search_list, const Particles &surrounding_list, double dt) const override
Search for all the possible secondary collisions between the outgoing particles and the rest...
Helper structure for Experiment.
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:52
const double elastic_parameter_
Elastic cross section parameter (in mb).
Definition: action.h:24
ActionList find_actions_with_neighbors(const ParticleList &search_list, const ParticleList &neighbors_list, double dt) const override
Search for all the possible collisions among the neighboring cells.