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

943  {
944  std::stringstream name;
945  name << "[" << res_name << "->";
946  for (const auto& p : decay->particle_types()) {
947  name << p->name();
948  final_state.push_back(p);
949  }
950  name << "]";
951  return name.str();
952 }
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 961 of file scatteractionsfinder.cc.

961  {
962  // If there is more than one unstable particle in the current state, then
963  // there will be redundant paths in the decay tree, corresponding to
964  // reorderings of the decays. To avoid double counting, we normalize by the
965  // number of possible decay orderings. Normalizing by the number of unstable
966  // particles recursively corresponds to normalizing by the factorial that
967  // gives the number of reorderings.
968  //
969  // Ideally, the redundant paths should never be added to the decay tree, but
970  // we never have more than two redundant paths, so it probably does not matter
971  // much.
972  uint32_t n_unstable = 0;
973  double sqrts_minus_masses = sqrts;
974  for (const ParticleTypePtr ptype : node.state_) {
975  if (!ptype->is_stable()) {
976  n_unstable += 1;
977  }
978  sqrts_minus_masses -= ptype->mass();
979  }
980  const double norm =
981  n_unstable != 0 ? 1. / static_cast<double>(n_unstable) : 1.;
982 
983  for (const ParticleTypePtr ptype : node.state_) {
984  if (!ptype->is_stable()) {
985  const double sqrts_decay = sqrts_minus_masses + ptype->mass();
986  bool can_decay = false;
987  for (const auto& decay : ptype->decay_modes().decay_mode_list()) {
988  // Make sure to skip kinematically impossible decays.
989  // In principle, we would have to integrate over the mass of the
990  // resonance, but as an approximation we just assume it at its pole.
991  double final_state_mass = 0.;
992  for (const auto& p : decay->particle_types()) {
993  final_state_mass += p->mass();
994  }
995  if (final_state_mass > sqrts_decay) {
996  continue;
997  }
998  can_decay = true;
999 
1000  ParticleTypePtrList parts;
1001  const auto name = make_decay_name(ptype->name(), decay, parts);
1002  auto& new_node = node.add_action(name, norm * decay->weight(), {ptype},
1003  std::move(parts));
1004  add_decays(new_node, sqrts_decay);
1005  }
1006  if (!can_decay) {
1007  // Remove final-state cross sections with resonances that cannot
1008  // decay due to our "mass = pole mass" approximation.
1009  node.weight_ = 0;
1010  return;
1011  }
1012  }
1013  }
1014 }
Here is the call graph for this function:
Here is the caller graph for this function:
smash::decaytree::add_decays
static void add_decays(Node &node, double sqrts)
Add nodes for all decays possible from the given node and all of its children.
Definition: scatteractionsfinder.cc:961
smash::decaytree::make_decay_name
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.
Definition: scatteractionsfinder.cc:941
smash::pdg::p
constexpr int p
Proton.
Definition: pdgcode_constants.h:28