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

851  {
852  std::stringstream name;
853  name << "[" << res_name << "->";
854  for (const auto& p : decay->particle_types()) {
855  name << p->name();
856  final_state.push_back(p);
857  }
858  name << "]";
859  return name.str();
860 }
constexpr int p
Proton.

◆ 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 869 of file scatteractionsfinder.cc.

869  {
870  // If there is more than one unstable particle in the current state, then
871  // there will be redundant paths in the decay tree, corresponding to
872  // reorderings of the decays. To avoid double counting, we normalize by the
873  // number of possible decay orderings. Normalizing by the number of unstable
874  // particles recursively corresponds to normalizing by the factorial that
875  // gives the number of reorderings.
876  //
877  // Ideally, the redundant paths should never be added to the decay tree, but
878  // we never have more than two redundant paths, so it probably does not
879  // matter much.
880  uint32_t n_unstable = 0;
881  double sqrts_minus_masses = sqrts;
882  for (const ParticleTypePtr ptype : node.state_) {
883  if (!ptype->is_stable()) {
884  n_unstable += 1;
885  }
886  sqrts_minus_masses -= ptype->mass();
887  }
888  const double norm =
889  n_unstable != 0 ? 1. / static_cast<double>(n_unstable) : 1.;
890 
891  for (const ParticleTypePtr ptype : node.state_) {
892  if (!ptype->is_stable()) {
893  const double sqrts_decay = sqrts_minus_masses + ptype->mass();
894  bool can_decay = false;
895  for (const auto& decay : ptype->decay_modes().decay_mode_list()) {
896  // Make sure to skip kinematically impossible decays.
897  // In principle, we would have to integrate over the mass of the
898  // resonance, but as an approximation we just assume it at its pole.
899  double final_state_mass = 0.;
900  for (const auto& p : decay->particle_types()) {
901  final_state_mass += p->mass();
902  }
903  if (final_state_mass > sqrts_decay) {
904  continue;
905  }
906  can_decay = true;
907 
908  ParticleTypePtrList parts;
909  const auto name = make_decay_name(ptype->name(), decay, parts);
910  auto& new_node = node.add_action(name, norm * decay->weight(), {ptype},
911  std::move(parts));
912  add_decays(new_node, sqrts_decay);
913  }
914  if (!can_decay) {
915  // Remove final-state cross sections with resonances that cannot
916  // decay due to our "mass = pole mass" approximation.
917  node.weight_ = 0;
918  return;
919  }
920  }
921  }
922 }
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.