Version: SMASH-2.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, double sqrts)
 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 992 of file scatteractionsfinder.cc.

994  {
995  std::stringstream name;
996  name << "[" << res_name << "->";
997  for (const auto& p : decay->particle_types()) {
998  name << p->name();
999  final_state.push_back(p);
1000  }
1001  name << "]";
1002  return name.str();
1003 }
constexpr int p
Proton.
Here is the caller graph for this function:

◆ add_decays()

static void smash::decaytree::add_decays ( Node node,
double  sqrts 
)
static

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

Parameters
nodeStarting node.
[in]sqrtscenter-of-mass energy.

Definition at line 1012 of file scatteractionsfinder.cc.

1012  {
1013  // If there is more than one unstable particle in the current state, then
1014  // there will be redundant paths in the decay tree, corresponding to
1015  // reorderings of the decays. To avoid double counting, we normalize by the
1016  // number of possible decay orderings. Normalizing by the number of unstable
1017  // particles recursively corresponds to normalizing by the factorial that
1018  // gives the number of reorderings.
1019  //
1020  // Ideally, the redundant paths should never be added to the decay tree, but
1021  // we never have more than two redundant paths, so it probably does not
1022  // matter much.
1023  uint32_t n_unstable = 0;
1024  double sqrts_minus_masses = sqrts;
1025  for (const ParticleTypePtr ptype : node.state_) {
1026  if (!ptype->is_stable()) {
1027  n_unstable += 1;
1028  }
1029  sqrts_minus_masses -= ptype->mass();
1030  }
1031  const double norm =
1032  n_unstable != 0 ? 1. / static_cast<double>(n_unstable) : 1.;
1033 
1034  for (const ParticleTypePtr ptype : node.state_) {
1035  if (!ptype->is_stable()) {
1036  const double sqrts_decay = sqrts_minus_masses + ptype->mass();
1037  bool can_decay = false;
1038  for (const auto& decay : ptype->decay_modes().decay_mode_list()) {
1039  // Make sure to skip kinematically impossible decays.
1040  // In principle, we would have to integrate over the mass of the
1041  // resonance, but as an approximation we just assume it at its pole.
1042  double final_state_mass = 0.;
1043  for (const auto& p : decay->particle_types()) {
1044  final_state_mass += p->mass();
1045  }
1046  if (final_state_mass > sqrts_decay) {
1047  continue;
1048  }
1049  can_decay = true;
1050 
1051  ParticleTypePtrList parts;
1052  const auto name = make_decay_name(ptype->name(), decay, parts);
1053  auto& new_node = node.add_action(name, norm * decay->weight(), {ptype},
1054  std::move(parts));
1055  add_decays(new_node, sqrts_decay);
1056  }
1057  if (!can_decay) {
1058  // Remove final-state cross sections with resonances that cannot
1059  // decay due to our "mass = pole mass" approximation.
1060  node.weight_ = 0;
1061  return;
1062  }
1063  }
1064  }
1065 }
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, double sqrts)
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: