Version: SMASH-3.4
wallcrossingaction.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2015-2020,2025
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_WALLCROSSINGACTION_H_
11 #define SRC_INCLUDE_SMASH_WALLCROSSINGACTION_H_
12 
13 #include <vector>
14 
15 #include "action.h"
16 #include "actionfinderfactory.h"
17 
18 namespace smash {
19 
20 /**
21  * \ingroup action
22  * WallcrossingAction is a special action which indicates that a particle
23  * has crossed a box wall.
24  */
25 class WallcrossingAction : public Action {
26  public:
27  /**
28  * Construct wallcrossing action.
29  * \param[in] in_part Data of incoming particle.
30  * \param[in] out_part Data of outgoing particle. Same as in_part, but with
31  * updated position.
32  * \param[in] time_until Time when the crossing takes place (relative to
33  * current time). Usually no delay therefore optional. [fm]
34  */
35  WallcrossingAction(const ParticleData &in_part, const ParticleData &out_part,
36  const double time_until = 0.0)
37  : Action(in_part, out_part, time_until, ProcessType::Wall) {}
38  double get_total_weight() const override { return 0.0; };
39  double get_partial_weight() const override { return 0.0; };
40  void generate_final_state() override{};
41  void format_debug_output(std::ostream &out) const override {
42  out << "Wall crossing of " << incoming_particles_;
43  }
44 };
45 
46 /**
47  * \ingroup action
48  * Finder for wall crossing actions, when using peridic boundary conditons.
49  * Loops through all particles and checks if they cross the box wall during the
50  * next timestep.
51  */
53  public:
54  /**
55  * Construct wallcrossing actionfinder.
56  * \param[in] l Box edge length. Box is assumbed to be a cube. [fm]
57  */
58  explicit WallCrossActionsFinder(double l) : l_{l, l, l} {};
59 
60  /**
61  * Find the next wall crossings for every particle before time t_max.
62  * \param[in] plist List of all particles.
63  * \param[in] t_max Time until crossing can appear. [fm]
64  * \return List of all found wall crossings.
65  */
66  ActionList find_actions_in_cell(
67  const ParticleList &plist, double t_max, const double,
68  const std::vector<FourVector> &) const override;
69 
70  /// Ignore the neighbor searches for wall crossing
72  const ParticleList &, const ParticleList &, double,
73  const std::vector<FourVector> &) const override {
74  return {};
75  }
76 
77  /// Ignore the surrounding searches for wall crossing
79  const ParticleList &, const Particles &, double,
80  const std::vector<FourVector> &) const override {
81  return {};
82  }
83 
84  /// No final actions for wall crossing
85  ActionList find_final_actions(const Particles &) const override { return {}; }
86 
87  private:
88  /// Periods in x,y,z directions in fm.
89  const std::array<double, 3> l_;
90 };
91 
92 } // namespace smash
93 
94 #endif // SRC_INCLUDE_SMASH_WALLCROSSINGACTION_H_
ActionFinderInterface is the abstract base class for all action finders, i.e.
Action is the base class for a generic process that takes a number of incoming particles and transfor...
Definition: action.h:35
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:355
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
Finder for wall crossing actions, when using peridic boundary conditons.
WallCrossActionsFinder(double l)
Construct wallcrossing actionfinder.
ActionList find_actions_with_surrounding_particles(const ParticleList &, const Particles &, double, const std::vector< FourVector > &) const override
Ignore the surrounding searches for wall crossing.
ActionList find_actions_in_cell(const ParticleList &plist, double t_max, const double, const std::vector< FourVector > &) const override
Find the next wall crossings for every particle before time t_max.
ActionList find_final_actions(const Particles &) const override
No final actions for wall crossing.
const std::array< double, 3 > l_
Periods in x,y,z directions in fm.
ActionList find_actions_with_neighbors(const ParticleList &, const ParticleList &, double, const std::vector< FourVector > &) const override
Ignore the neighbor searches for wall crossing.
WallcrossingAction is a special action which indicates that a particle has crossed a box wall.
double get_partial_weight() const override
Return the specific weight for the chosen outgoing channel, which is mainly used for the partial weig...
WallcrossingAction(const ParticleData &in_part, const ParticleData &out_part, const double time_until=0.0)
Construct wallcrossing action.
void generate_final_state() override
Generate the final state for this action.
double get_total_weight() const override
Return the total weight value, which is mainly used for the weight output entry.
void format_debug_output(std::ostream &out) const override
Writes information about this action to the out stream.
Definition: action.h:24
ProcessType
ProcessTypes are used to identify the type of the process.
Definition: processbranch.h:39
@ Wall
See here for a short description.