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

1019  {
1020  std::stringstream name;
1021  name << "[" << res_name << "->";
1022  for (const auto& p : decay->particle_types()) {
1023  name << p->name();
1024  final_state.push_back(p);
1025  }
1026  name << "]";
1027  return name.str();
1028 }
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 1037 of file scatteractionsfinder.cc.

1037  {
1038  // If there is more than one unstable particle in the current state, then
1039  // there will be redundant paths in the decay tree, corresponding to
1040  // reorderings of the decays. To avoid double counting, we normalize by the
1041  // number of possible decay orderings. Normalizing by the number of unstable
1042  // particles recursively corresponds to normalizing by the factorial that
1043  // gives the number of reorderings.
1044  //
1045  // Ideally, the redundant paths should never be added to the decay tree, but
1046  // we never have more than two redundant paths, so it probably does not
1047  // matter much.
1048  uint32_t n_unstable = 0;
1049  double sqrts_minus_masses = sqrts;
1050  for (const ParticleTypePtr ptype : node.state_) {
1051  if (!ptype->is_stable()) {
1052  n_unstable += 1;
1053  }
1054  sqrts_minus_masses -= ptype->mass();
1055  }
1056  const double norm =
1057  n_unstable != 0 ? 1. / static_cast<double>(n_unstable) : 1.;
1058 
1059  for (const ParticleTypePtr ptype : node.state_) {
1060  if (!ptype->is_stable()) {
1061  const double sqrts_decay = sqrts_minus_masses + ptype->mass();
1062  bool can_decay = false;
1063  for (const auto& decay : ptype->decay_modes().decay_mode_list()) {
1064  // Make sure to skip kinematically impossible decays.
1065  // In principle, we would have to integrate over the mass of the
1066  // resonance, but as an approximation we just assume it at its pole.
1067  double final_state_mass = 0.;
1068  for (const auto& p : decay->particle_types()) {
1069  final_state_mass += p->mass();
1070  }
1071  if (final_state_mass > sqrts_decay) {
1072  continue;
1073  }
1074  can_decay = true;
1075 
1076  ParticleTypePtrList parts;
1077  const auto name = make_decay_name(ptype->name(), decay, parts);
1078  auto& new_node = node.add_action(name, norm * decay->weight(), {ptype},
1079  std::move(parts));
1080  add_decays(new_node, sqrts_decay);
1081  }
1082  if (!can_decay) {
1083  // Remove final-state cross sections with resonances that cannot
1084  // decay due to our "mass = pole mass" approximation.
1085  node.weight_ = 0;
1086  return;
1087  }
1088  }
1089  }
1090 }
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: