Version: SMASH-1.5
decayaction.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2015-2018
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_DECAYACTION_H_
11 #define SRC_INCLUDE_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  protected:
115  virtual void one_to_three();
116 };
117 
118 } // namespace smash
119 
120 #endif // SRC_INCLUDE_DECAYACTION_H_
Thrown when DecayAction is called to perform with 0 or more than 2 entries in outgoing_particles.
Definition: decayaction.h:85
double get_total_weight() const override
Return the total width of the decay process.
Definition: decayaction.h:66
void add_decay(DecayBranchPtr p)
Add one new decay.
Definition: decayaction.cc:28
virtual void one_to_three()
Kinematics of a 1-to-3 decay process.
Definition: decayaction.cc:32
void add_decays(DecayBranchList pv)
Add several new decays at once.
Definition: decayaction.cc:24
DecayAction(const ParticleData &p, double time)
Construct a DecayAction from a particle p.
Definition: decayaction.cc:21
DecayBranchList decay_channels_
List of possible decays.
Definition: decayaction.h:97
double total_width_
total decay width
Definition: decayaction.h:100
int L_
Angular momentum of the decay.
Definition: decayaction.h:106
double total_width() const
Get total decay width.
Definition: decayaction.h:78
DecayAction is a special action which takes one single particle in the initial state and makes it dec...
Definition: decayaction.h:25
Action is the base class for a generic process that takes a number of incoming particles and transfor...
Definition: action.h:34
void generate_final_state() override
Generate the final state of the decay process.
Definition: decayaction.cc:149
constexpr int p
Proton.
double get_partial_weight() const override
Get partial width of chosen channel.
Definition: decayaction.h:72
std::pair< double, double > sample_masses(double kinetic_energy_cm) const override
Sample the masses of the final particles.
Definition: decayaction.cc:199
double partial_width_
partial decay width to the chosen outgoing channel
Definition: decayaction.h:103
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:52
Definition: action.h:24
void format_debug_output(std::ostream &out) const override
Writes information about this decay action to the out stream.
Definition: decayaction.cc:230