Version: SMASH-2.0
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_
smash
Definition: action.h:24
smash::DecayAction::total_width_
double total_width_
total decay width
Definition: decayaction.h:100
smash::DecayAction::L_
int L_
Angular momentum of the decay.
Definition: decayaction.h:106
smash::DecayAction::add_decays
void add_decays(DecayBranchList pv)
Add several new decays at once.
Definition: decayaction.cc:22
smash::DecayAction
Definition: decayaction.h:25
smash::ParticleData
Definition: particledata.h:52
smash::DecayAction::format_debug_output
void format_debug_output(std::ostream &out) const override
Definition: decayaction.cc:110
smash::DecayAction::DecayAction
DecayAction(const ParticleData &p, double time)
Construct a DecayAction from a particle p.
Definition: decayaction.cc:19
smash::DecayAction::get_partial_weight
double get_partial_weight() const override
Get partial width of chosen channel.
Definition: decayaction.h:72
smash::DecayAction::get_total_weight
double get_total_weight() const override
Return the total width of the decay process.
Definition: decayaction.h:66
action.h
smash::DecayAction::partial_width_
double partial_width_
partial decay width to the chosen outgoing channel
Definition: decayaction.h:103
smash::DecayAction::decay_channels_
DecayBranchList decay_channels_
List of possible decays.
Definition: decayaction.h:97
smash::DecayAction::generate_final_state
void generate_final_state() override
Generate the final state of the decay process.
Definition: decayaction.cc:30
smash::Action
Definition: action.h:35
smash::pdg::p
constexpr int p
Proton.
Definition: pdgcode_constants.h:28
smash::DecayAction::add_decay
void add_decay(DecayBranchPtr p)
Add one new decay.
Definition: decayaction.cc:26
smash::DecayAction::total_width
double total_width() const
Get total decay width.
Definition: decayaction.h:78
smash::DecayAction::InvalidDecay
Definition: decayaction.h:85
smash::DecayAction::sample_masses
std::pair< double, double > sample_masses(double kinetic_energy_cm) const override
Sample the masses of the final particles.
Definition: decayaction.cc:79