21 ParticleList empty_list;
31 const uint32_t id_process)
const {
34 if (before == after) {
37 throw std::runtime_error(
38 "Conservation laws conserved in the hypersurface "
39 "crossing action. Particle was not properly removed in process: " +
40 std::to_string(id_process));
44 throw std::runtime_error(
45 "Particle was not removed successfully in "
46 "hypersurface crossing action.");
52 const ParticleList &plist,
double dt,
const double,
53 const std::vector<FourVector> &beam_momentum)
const {
54 std::vector<ActionPtr> actions;
59 double t0 =
p.position().x0();
60 double t_end = t0 + dt;
79 const bool no_prior_interactions =
80 (
static_cast<uint64_t
>(
p.id()) <
81 static_cast<uint64_t
>(beam_momentum.size())) &&
82 (
p.get_history().collisions_per_particle == 0);
84 if (no_prior_interactions) {
100 pdata_before_propagation, pdata_after_propagation,
prop_time_);
111 bool is_within_y_cut =
true;
114 const double rapidity =
115 0.5 * std::log((
p.momentum().x0() +
p.momentum().x3()) /
116 (
p.momentum().x0() -
p.momentum().x3()));
117 if (std::fabs(rapidity) >
rap_cut_) {
118 is_within_y_cut =
false;
122 bool is_within_pT_cut =
true;
125 const double transverse_momentum =
126 std::sqrt(
p.momentum().x1() *
p.momentum().x1() +
127 p.momentum().x2() *
p.momentum().x2());
128 if (transverse_momentum >
pT_cut_) {
129 is_within_pT_cut =
false;
133 if (hypersurface_is_crossed && is_within_y_cut && is_within_pT_cut) {
136 pdata_before_propagation, pdata_after_propagation,
prop_time_);
138 double time_until_crossing = crossing_position[0] - t0;
142 ActionPtr action = std::make_unique<HypersurfacecrossingAction>(
143 p, outgoing_particle, time_until_crossing);
144 actions.emplace_back(std::move(action));
152 ParticleData &pdata_after_propagation,
const double tau)
const {
153 bool hypersurface_is_crossed =
false;
154 const bool t_greater_z_before_prop =
155 (std::fabs(pdata_before_propagation.
position().
x0()) >
156 std::fabs(pdata_before_propagation.
position().
x3())
159 const bool t_greater_z_after_prop =
160 (std::fabs(pdata_after_propagation.
position().
x0()) >
161 std::fabs(pdata_after_propagation.
position().
x3())
165 if (t_greater_z_before_prop && t_greater_z_after_prop) {
167 const double tau_before = pdata_before_propagation.
position().
tau();
168 const double tau_after = pdata_after_propagation.
position().
tau();
170 if (tau_before <= tau && tau <= tau_after) {
171 hypersurface_is_crossed =
true;
173 }
else if (!t_greater_z_before_prop && t_greater_z_after_prop) {
175 const double tau_after = pdata_after_propagation.
position().
tau();
176 if (tau_after >= tau) {
177 hypersurface_is_crossed =
true;
181 return hypersurface_is_crossed;
186 ParticleData &pdata_after_propagation,
const double tau)
const {
188 const double t1 = pdata_before_propagation.
position().
x0();
189 const double z1 = pdata_before_propagation.
position().
x3();
192 const double t2 = pdata_after_propagation.
position().
x0();
193 const double z2 = pdata_after_propagation.
position().
x3();
197 const double m = (z2 - z1) / (t2 - t1);
198 const double n = z1 - m * t1;
202 const double sol1 =
n * m / (1 - m * m) +
203 std::sqrt((1 - m * m) * tau * tau +
n *
n) / (1 - m * m);
204 [[maybe_unused]]
const double sol2 =
205 n * m / (1 - m * m) -
206 std::sqrt((1 - m * m) * tau * tau +
n *
n) / (1 - m * m);
208 assert((sol1 >= t1 && sol1 <= t2));
209 assert(!(sol2 >= t1 && sol2 <= t2));
215 crossing_position.
set_x0(sol1);
217 return crossing_position;
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
ParticleList incoming_particles_
List with data of incoming particles.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
ThreeVector velocity() const
Get the velocity (3-vector divided by zero component).
double tau() const
calculate the proper time from the given four vector
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...
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.
double check_conservation(const uint32_t id_process) const override
Check various conservation laws.
void generate_final_state() override
Generate the final state of the hypersurface crossing particles.
ParticleData contains the dynamic information of a certain particle.
void set_4position(const FourVector &pos)
Set the particle's 4-position directly.
ThreeVector velocity() const
Get the velocity 3-vector.
const FourVector & position() const
Get the particle's position in Minkowski space.
A container for storing conserved values.
The ThreeVector class represents a physical three-vector with the components .
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
static constexpr int LHyperSurfaceCrossing