Version: SMASH-3.1
freeforallaction.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2022-2023
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_FREEFORALLACTION_H_
11 #define SRC_INCLUDE_SMASH_FREEFORALLACTION_H_
12 
13 #include "action.h"
14 
15 namespace smash {
16 
24 class FreeforallAction : public Action {
25  public:
43  FreeforallAction(const ParticleList &in_part, const ParticleList &out_part,
44  double absolute_labframe_time)
45  : Action(in_part, out_part, absolute_labframe_time,
47  if (!in_part.empty() && !out_part.empty()) {
48  throw std::invalid_argument(
49  "The FreeforallAction was used with two non-empty lists. This is not "
50  "allowed. Please use the action twice, if particles should be added "
51  "and removed.");
52  }
53  }
54 
55  double get_total_weight() const override { return 0.0; }
56  double get_partial_weight() const override { return 0.0; }
57 
63  void generate_final_state() override {
64  // Set time for arbitrary outgoing particles to time of action
65  for (auto &particle : outgoing_particles_) {
66  const double t = particle.position().x0();
67  const FourVector u(1.0, particle.velocity());
68  particle.set_formation_time(t);
69  particle.set_4position(particle.position() +
70  u * (time_of_execution() - t));
71  }
72  }
73 
79  void format_debug_output(std::ostream &out) const override {
80  out << "Freeforall action of " << incoming_particles_.size() << " to "
81  << outgoing_particles_.size() << " particles.";
82  }
83 };
84 
85 } // namespace smash
86 
87 #endif // SRC_INCLUDE_SMASH_FREEFORALLACTION_H_
Action is the base class for a generic process that takes a number of incoming particles and transfor...
Definition: action.h:35
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
Definition: action.h:363
double time_of_execution() const
Get the time at which the action is supposed to be performed.
Definition: action.h:254
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:355
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
Action class to create any incoming/outgoing particle combination freely.
double get_total_weight() const override
Return the total weight value, which is mainly used for the weight output entry.
FreeforallAction(const ParticleList &in_part, const ParticleList &out_part, double absolute_labframe_time)
The FreeforallAction is able to add particles by providing an empty particle list for in_part and a l...
void format_debug_output(std::ostream &out) const override
Function for debug output of incoming and outgoing particles from freeforall action.
void generate_final_state() override
Generate a final state for the FreeforallAction in the sense that the time and position of the partic...
double get_partial_weight() const override
Return the specific weight for the chosen outgoing channel, which is mainly used for the partial weig...
Definition: action.h:24
ProcessType
ProcessTypes are used to identify the type of the process.
Definition: processbranch.h:39
@ Freeforall
See here for a short description.