Add nodes for all decays possible from the given node and all of its children.
782 uint32_t n_unstable = 0;
783 double sqrts_minus_masses = sqrts;
784 for (
const ParticleTypePtr ptype : node.state_) {
785 if (!ptype->is_stable()) {
788 sqrts_minus_masses -= ptype->mass();
791 n_unstable != 0 ? 1. /
static_cast<double>(n_unstable) : 1.;
793 for (
const ParticleTypePtr ptype : node.state_) {
794 if (!ptype->is_stable()) {
795 const double sqrts_decay = sqrts_minus_masses + ptype->mass();
796 bool can_decay =
false;
797 for (
const auto& decay : ptype->decay_modes().decay_mode_list()) {
801 double final_state_mass = 0.;
802 for (
const auto&
p : decay->particle_types()) {
803 final_state_mass +=
p->mass();
805 if (final_state_mass > sqrts_decay) {
810 ParticleTypePtrList parts;
812 auto& new_node = node.add_action(name, norm * decay->weight(), {ptype},
static void add_decays(Node &node, double sqrts)
Add nodes for all decays possible from the given node and all of its children.
static std::string make_decay_name(const std::string &res_name, const DecayBranchPtr &decay, ParticleTypePtrList &final_state)
Generate name for decay and update final state.