Version: SMASH-3.4
hypersurfacecrossingfinder.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2019-2020,2022-2025
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_HYPERSURFACECROSSINGFINDER_H_
11 #define SRC_INCLUDE_SMASH_HYPERSURFACECROSSINGFINDER_H_
12 
13 #include <vector>
14 
15 #include "action.h"
16 #include "actionfinderfactory.h"
17 
18 namespace smash {
19 
20 /**
21  * \ingroup action
22  * Finder for hypersurface crossing actions.
23  * Loops through all particles and checks if they cross the hypersurface
24  * during the next timestep.
25  */
27  public:
28  /**
29  * Construct hypersurfacecrossing action finder.
30  * \param[in] tau Proper time of the hypersurface. [fm]
31  * \param[in] y Value for rapidity cut: absolute value of momentum space
32  * rapidity up to which particles are considered for initial
33  * conditions
34  * \param[in] pT Value for transverse momentum cut: maximum transverse
35  * momentum up to which particles are considered for initial
36  * conditions
37  */
38  explicit HyperSurfaceCrossActionsFinder(double tau, double y, double pT)
39  : prop_time_{tau}, rap_cut_{y}, pT_cut_{pT} {};
40 
41  /**
42  * Find the next hypersurface crossings for each particle that occur within
43  * the timestepless propagation.
44  * \param[in] plist List of all particles.
45  * \param[in] dt Time until crossing can appear (until end of timestep). [fm]
46  * \param[in] beam_momentum [GeV] List of beam momenta for each particle;
47  * only necessary if frozen Fermi Motion is activated
48  *
49  * \return List of all found hypersurface crossings.
50  */
51  ActionList find_actions_in_cell(
52  const ParticleList &plist, double dt, const double,
53  const std::vector<FourVector> &beam_momentum) const override;
54 
55  /// Ignore the neighbor searches for hypersurface crossing
57  const ParticleList &, const ParticleList &, double,
58  const std::vector<FourVector> &) const override {
59  return {};
60  }
61 
62  /// Ignore the surrounding searches for hypersurface crossing
64  const ParticleList &, const Particles &, double,
65  const std::vector<FourVector> &) const override {
66  return {};
67  }
68 
69  /// No final actions for hypersurface crossing
70  ActionList find_final_actions(const Particles &) const override { return {}; }
71 
72  /**
73  * Gives a warning if \p number_of_particles is not 0 and there are no
74  * kinematic cuts. If this is the case, it may be that the end time set
75  * by the user is too small.
76  *
77  * \param[in] number_of_particles how many particles are in the system
78  * \param[in] impose_kinematic_cut whether kinematic cuts were applied
79  */
81  const size_t number_of_particles, bool impose_kinematic_cut);
82 
83  private:
84  /// Proper time of the hypersurface in fm.
85  const double prop_time_;
86 
87  /**
88  * Rapidity (momentum space) cut for the particles contributing to the initial
89  * conditions for hydrodynamics.
90  * If applied, only particles characterized by a rapidity between
91  * [-y_cut, y_cut] are printed to the hypersurface.
92  */
93  const double rap_cut_;
94 
95  /**
96  * Transverse momentum cut for the particles contributing to the initial
97  * conditions for hydrodynamics.
98  * If applied, only particles characterized by a transverse momentum between
99  * [0, pT_cut] are
100  * printed to the hypersurface.
101  */
102  const double pT_cut_;
103 
104  /**
105  * Determine whether particle crosses hypersurface within next timestep
106  * during propagation
107  * \param[in] pdata_before_propagation Particle data at the beginning of time
108  * step in question
109  * \param[in] pdata_after_propagation Particle data at the end of time step
110  * in question
111  * \param[in] tau Proper time of the hypersurface that is tested
112  * \return Does particle cross the hypersurface?
113  */
114  bool crosses_hypersurface(ParticleData &pdata_before_propagation,
115  ParticleData &pdata_after_propagation,
116  const double tau) const;
117 
118  /**
119  * Find the coordinates where particle crosses hypersurface
120  * \param[in] pdata_before_propagation Particle data at the beginning of time
121  * in question
122  * \param[in] pdata_after_propagation Particle data at the end of time step
123  * in question
124  * \param[in] tau Proper time of the hypersurface that is crossed
125  * \return Fourvector of the crossing position
126  */
127  FourVector coordinates_on_hypersurface(ParticleData &pdata_before_propagation,
128  ParticleData &pdata_after_propagation,
129  const double tau) const;
130 };
131 
132 } // namespace smash
133 
134 #endif // SRC_INCLUDE_SMASH_HYPERSURFACECROSSINGFINDER_H_
ActionFinderInterface is the abstract base class for all action finders, i.e.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
Finder for hypersurface crossing actions.
const double prop_time_
Proper time of the hypersurface in fm.
FourVector coordinates_on_hypersurface(ParticleData &pdata_before_propagation, ParticleData &pdata_after_propagation, const double tau) const
Find the coordinates where particle crosses hypersurface.
const double rap_cut_
Rapidity (momentum space) cut for the particles contributing to the initial conditions for hydrodynam...
ActionList find_final_actions(const Particles &) const override
No final actions for hypersurface crossing.
HyperSurfaceCrossActionsFinder(double tau, double y, double pT)
Construct hypersurfacecrossing action finder.
static void warn_if_some_particles_did_not_cross(const size_t number_of_particles, bool impose_kinematic_cut)
Gives a warning if number_of_particles is not 0 and there are no kinematic cuts.
const double pT_cut_
Transverse momentum cut for the particles contributing to the initial conditions for hydrodynamics.
ActionList find_actions_in_cell(const ParticleList &plist, double dt, const double, const std::vector< FourVector > &beam_momentum) const override
Find the next hypersurface crossings for each particle that occur within the timestepless propagation...
bool crosses_hypersurface(ParticleData &pdata_before_propagation, ParticleData &pdata_after_propagation, const double tau) const
Determine whether particle crosses hypersurface within next timestep during propagation.
ActionList find_actions_with_neighbors(const ParticleList &, const ParticleList &, double, const std::vector< FourVector > &) const override
Ignore the neighbor searches for hypersurface crossing.
ActionList find_actions_with_surrounding_particles(const ParticleList &, const Particles &, double, const std::vector< FourVector > &) const override
Ignore the surrounding searches for hypersurface crossing.
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:59
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
Definition: action.h:24