Version: SMASH-1.5
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 659 of file scatteractionsfinder.cc.

661  {
662  std::stringstream name;
663  name << "[" << res_name << "->";
664  for (const auto& p : decay->particle_types()) {
665  name << p->name();
666  final_state.push_back(p);
667  }
668  name << "]";
669  return name.str();
670 }
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 678 of file scatteractionsfinder.cc.

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