10 #ifndef SRC_INCLUDE_SMASH_SCATTERACTIONSFINDER_H_
11 #define SRC_INCLUDE_SMASH_SCATTERACTIONSFINDER_H_
68 const std::vector<FourVector> &beam_momentum)
const {
79 if (p1.
id() < 0 || p2.
id() < 0) {
80 throw std::runtime_error(
"Invalid particle ID for Fermi motion");
82 const bool p1_has_no_prior_interactions =
83 (
static_cast<uint64_t
>(p1.
id()) <
84 static_cast<uint64_t
>(beam_momentum.size())) &&
87 const bool p2_has_no_prior_interactions =
88 (
static_cast<uint64_t
>(p2.
id()) <
89 static_cast<uint64_t
>(beam_momentum.size())) &&
92 const FourVector p1_mom = (p1_has_no_prior_interactions)
93 ? beam_momentum[p1.
id()]
95 const FourVector p2_mom = (p2_has_no_prior_interactions)
96 ? beam_momentum[p2.
id()]
106 const double p1_sqr = p1_mom.
sqr();
107 const double p2_sqr = p2_mom.
sqr();
108 const double p1_dot_x = p1_mom.
Dot(delta_x);
109 const double p2_dot_x = p2_mom.
Dot(delta_x);
110 const double p1_dot_p2 = p1_mom.
Dot(p2_mom);
111 const double denominator = std::pow(p1_dot_p2, 2) - p1_sqr * p2_sqr;
116 const double time_1 = (p2_sqr * p1_dot_x - p1_dot_p2 * p2_dot_x) *
117 p1_mom.
x0() / denominator;
118 const double time_2 = -(p1_sqr * p2_dot_x - p1_dot_p2 * p1_dot_x) *
119 p2_mom.
x0() / denominator;
120 return (time_1 + time_2) / 2;
133 const double dv_times_e1e2_sqr = dv_times_e1e2.
sqr();
139 return -(dr * dv_times_e1e2) *
140 (p1_mom.
x0() * p2_mom.
x0() / dv_times_e1e2_sqr);
160 const ParticleList &search_list,
double dt,
const double gcell_vol,
161 const std::vector<FourVector> &beam_momentum)
const override;
176 const ParticleList &search_list,
const ParticleList &neighbors_list,
177 double dt,
const std::vector<FourVector> &beam_momentum)
const override;
191 const ParticleList &search_list,
const Particles &surrounding_list,
192 double dt,
const std::vector<FourVector> &beam_momentum)
const override;
199 bool =
false)
const override {
235 testparticles *
fm2_mb * M_1_PI;
258 double m_a,
double m_b,
bool final_state,
259 std::vector<double> &plab)
const;
298 const std::vector<FourVector> &beam_momentum = {},
299 const double gcell_vol = 0.0)
const;
317 const double gcell_vol)
const;
ActionFinderInterface is the abstract base class for all action finders, i.e.
Interface to the SMASH configuration files.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
double sqr() const
calculate the square of the vector (which is a scalar)
ThreeVector threevec() const
double Dot(const FourVector &a) const
calculate the scalar product with another four-vector
ParticleData contains the dynamic information of a certain particle.
const FourVector & momentum() const
Get the particle's 4-momentum.
int32_t id() const
Get the id of the particle.
HistoryData get_history() const
Get history information.
const FourVector & position() const
Get the particle's position in Minkowski space.
Particle type contains the static properties of a particle species.
static const ParticleTypeList & list_all()
The Particles class abstracts the storage and manipulation of particles.
A simple scatter finder: Just loops through all particles and checks each pair for a collision.
ActionList find_final_actions(const Particles &, bool=false) const override
Find some final collisions at the end of the simulation.
ScatterActionsFinder(Configuration &config, const ExperimentParameters ¶meters)
Constructor of the finder with the given parameters.
ScatterActionsFinderParameters finder_parameters_
Struct collecting several parameters.
ActionList find_actions_in_cell(const ParticleList &search_list, double dt, const double gcell_vol, const std::vector< FourVector > &beam_momentum) const override
Search for all the possible collisions within one cell.
void dump_cross_sections(const ParticleType &a, const ParticleType &b, double m_a, double m_b, bool final_state, std::vector< double > &plab) const
Print out partial cross-sections of all processes that can occur in the collision of a(mass = m_a) an...
StringProcess * get_process_string_ptr()
const bool isotropic_
Do all collisions isotropically.
double max_transverse_distance_sqr(int testparticles) const
The maximal distance over which particles can interact in case of the geometric criterion,...
ActionPtr check_collision_two_part(const ParticleData &data_a, const ParticleData &data_b, double dt, const std::vector< FourVector > &beam_momentum={}, const double gcell_vol=0.0) const
Check for a single pair of particles (id_a, id_b) if a collision will happen in the next timestep and...
const double string_formation_time_
Parameter for formation time.
std::unique_ptr< StringProcess > string_process_interface_
Class that deals with strings, interfacing Pythia.
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),...
ActionPtr check_collision_multi_part(const ParticleList &plist, double dt, const double gcell_vol) const
Check for multiple i.e.
const double box_length_
Box length: needed to determine coordinates of collision correctly in case of collision through the w...
ActionList find_actions_with_surrounding_particles(const ParticleList &search_list, const Particles &surrounding_list, double dt, const std::vector< FourVector > &beam_momentum) const override
Search for all the possible secondary collisions between the outgoing particles and the rest.
ActionList find_actions_with_neighbors(const ParticleList &search_list, const ParticleList &neighbors_list, double dt, const std::vector< FourVector > &beam_momentum) const override
Search for all the possible collisions among the neighboring cells.
double collision_time(const ParticleData &p1, const ParticleData &p2, double dt, const std::vector< FourVector > &beam_momentum) const
Determine the collision time of the two particles.
String excitation processes used in SMASH.
The ThreeVector class represents a physical three-vector with the components .
@ Stochastic
Stochastic Criteiron.
@ Covariant
Covariant Criterion.
#define unlikely(x)
Tell the branch predictor that this expression is likely false.
ScatterActionsFinderParameters create_finder_parameters(Configuration &config, const ExperimentParameters ¶meters)
Gather all relevant parameters for a ScatterActionsFinder either getting them from an ExperimentParam...
constexpr double really_small
Numerical error tolerance.
constexpr double fm2_mb
mb <-> fm^2 conversion factor.
Helper structure for Experiment.
int32_t collisions_per_particle
Collision counter per particle, zero only for initially present particles.
Helper structure for ScatterActionsFinder.
const double elastic_parameter
Elastic cross section parameter (in mb).
const bool strings_switch
Indicates whether string fragmentation is switched on.
const double maximum_cross_section
const bool two_to_one
Enables resonance production.
const CollisionCriterion coll_crit
Specifies which collision criterion is used.