Version: SMASH-1.5.1
smash::decaytree Namespace Reference

Classes

struct  Node
 Node of a decay tree, representing a possible action (2-to-2 or 1-to-2). More...
 

Functions

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. More...
 
static void add_decays (Node &node)
 Add nodes for all decays possible from the given node and all of its children. More...
 

Function Documentation

◆ make_decay_name()

static std::string smash::decaytree::make_decay_name ( const std::string &  res_name,
const DecayBranchPtr &  decay,
ParticleTypePtrList &  final_state 
)
static

Generate name for decay and update final state.

Parameters
[in]res_nameName of resonance.
[in]decayDecay branch.
[out]final_stateFinal state of decay.
Returns
Name of decay.

Definition at line 660 of file scatteractionsfinder.cc.

662  {
663  std::stringstream name;
664  name << "[" << res_name << "->";
665  for (const auto& p : decay->particle_types()) {
666  name << p->name();
667  final_state.push_back(p);
668  }
669  name << "]";
670  return name.str();
671 }
constexpr int p
Proton.
Here is the caller graph for this function:

◆ add_decays()

static void smash::decaytree::add_decays ( Node node)
static

Add nodes for all decays possible from the given node and all of its children.

Parameters
nodeStarting node.

Definition at line 679 of file scatteractionsfinder.cc.

679  {
680  // If there is more than one unstable particle in the current state, then
681  // there will be redundant paths in the decay tree, corresponding to
682  // reorderings of the decays. To avoid double counting, we normalize by the
683  // number of possible decay orderings. Normalizing by the number of unstable
684  // particles recursively corresponds to normalizing by the factorial that
685  // gives the number of reorderings.
686  //
687  // Ideally, the redundant paths should never be added to the decay tree, but
688  // we never have more than two redundant paths, so it probably does not matter
689  // much.
690  uint32_t n_unstable = 0;
691  for (const ParticleTypePtr ptype : node.state_) {
692  if (!ptype->is_stable()) {
693  n_unstable += 1;
694  }
695  }
696  const double norm =
697  n_unstable != 0 ? 1. / static_cast<double>(n_unstable) : 1.;
698 
699  for (const ParticleTypePtr ptype : node.state_) {
700  if (!ptype->is_stable()) {
701  for (const auto& decay : ptype->decay_modes().decay_mode_list()) {
702  ParticleTypePtrList parts;
703  const auto name = make_decay_name(ptype->name(), decay, parts);
704  auto& new_node = node.add_action(name, norm * decay->weight(), {ptype},
705  std::move(parts));
706  add_decays(new_node);
707  }
708  }
709  }
710 }
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.
static void add_decays(Node &node)
Add nodes for all decays possible from the given node and all of its children.
Here is the call graph for this function:
Here is the caller graph for this function: