Version: SMASH-3.1
decayaction.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2015-2020
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_DECAYACTION_H_
11 #define SRC_INCLUDE_SMASH_DECAYACTION_H_
12 
13 #include <utility>
14 
15 #include "action.h"
16 
17 namespace smash {
18 
25 class DecayAction : public Action {
26  public:
36  DecayAction(const ParticleData &p, double time);
37 
42  void add_decays(DecayBranchList pv);
43 
48  void add_decay(DecayBranchPtr p);
49 
56  void generate_final_state() override;
57 
62  std::pair<double, double> sample_masses(
63  double kinetic_energy_cm) const override;
64 
66  double get_total_weight() const override { return total_width_; }
67 
72  double get_partial_weight() const override { return partial_width_; }
73 
78  double total_width() const { return total_width_; }
79 
85  class InvalidDecay : public std::invalid_argument {
86  using std::invalid_argument::invalid_argument;
87  };
88 
89  protected:
94  void format_debug_output(std::ostream &out) const override;
95 
97  DecayBranchList decay_channels_;
98 
100  double total_width_;
101 
104 
106  int L_ = 0;
107 };
108 
109 } // namespace smash
110 
111 #endif // SRC_INCLUDE_SMASH_DECAYACTION_H_
Action is the base class for a generic process that takes a number of incoming particles and transfor...
Definition: action.h:35
Thrown when DecayAction is called to perform with 0 or more than 2 entries in outgoing_particles.
Definition: decayaction.h:85
DecayAction is a special action which takes one single particle in the initial state and makes it dec...
Definition: decayaction.h:25
double partial_width_
partial decay width to the chosen outgoing channel
Definition: decayaction.h:103
double total_width_
total decay width
Definition: decayaction.h:100
double get_total_weight() const override
Return the total width of the decay process.
Definition: decayaction.h:66
void add_decays(DecayBranchList pv)
Add several new decays at once.
Definition: decayaction.cc:22
double total_width() const
Get total decay width.
Definition: decayaction.h:78
void generate_final_state() override
Generate the final state of the decay process.
Definition: decayaction.cc:30
DecayAction(const ParticleData &p, double time)
Construct a DecayAction from a particle p.
Definition: decayaction.cc:19
double get_partial_weight() const override
Get partial width of chosen channel.
Definition: decayaction.h:72
void add_decay(DecayBranchPtr p)
Add one new decay.
Definition: decayaction.cc:26
DecayBranchList decay_channels_
List of possible decays.
Definition: decayaction.h:97
int L_
Angular momentum of the decay.
Definition: decayaction.h:106
std::pair< double, double > sample_masses(double kinetic_energy_cm) const override
Sample the masses of the final particles.
Definition: decayaction.cc:79
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:58
void format_debug_output(std::ostream &out) const override
Writes information about this decay action to the out stream.
Definition: decayaction.cc:110
constexpr int p
Proton.
Definition: action.h:24