Version: SMASH-1.7
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

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

754  {
755  std::stringstream name;
756  name << "[" << res_name << "->";
757  for (const auto& p : decay->particle_types()) {
758  name << p->name();
759  final_state.push_back(p);
760  }
761  name << "]";
762  return name.str();
763 }
constexpr int p
Proton.

Here is the caller graph for this function:

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.

Definition at line 771 of file scatteractionsfinder.cc.

771  {
772  // If there is more than one unstable particle in the current state, then
773  // there will be redundant paths in the decay tree, corresponding to
774  // reorderings of the decays. To avoid double counting, we normalize by the
775  // number of possible decay orderings. Normalizing by the number of unstable
776  // particles recursively corresponds to normalizing by the factorial that
777  // gives the number of reorderings.
778  //
779  // Ideally, the redundant paths should never be added to the decay tree, but
780  // we never have more than two redundant paths, so it probably does not matter
781  // much.
782  uint32_t n_unstable = 0;
783  double sqrts_minus_masses = sqrts;
784  for (const ParticleTypePtr ptype : node.state_) {
785  if (!ptype->is_stable()) {
786  n_unstable += 1;
787  }
788  sqrts_minus_masses -= ptype->mass();
789  }
790  const double norm =
791  n_unstable != 0 ? 1. / static_cast<double>(n_unstable) : 1.;
792 
793  for (const ParticleTypePtr ptype : node.state_) {
794  if (!ptype->is_stable()) {
795  const double sqrts_decay = sqrts_minus_masses + ptype->mass();
796  bool can_decay = false;
797  for (const auto& decay : ptype->decay_modes().decay_mode_list()) {
798  // Make sure to skip kinematically impossible decays.
799  // In principle, we would have to integrate over the mass of the
800  // resonance, but as an approximation we just assume it at its pole.
801  double final_state_mass = 0.;
802  for (const auto& p : decay->particle_types()) {
803  final_state_mass += p->mass();
804  }
805  if (final_state_mass > sqrts_decay) {
806  continue;
807  }
808  can_decay = true;
809 
810  ParticleTypePtrList parts;
811  const auto name = make_decay_name(ptype->name(), decay, parts);
812  auto& new_node = node.add_action(name, norm * decay->weight(), {ptype},
813  std::move(parts));
814  add_decays(new_node, sqrts_decay);
815  }
816  if (!can_decay) {
817  // Remove final-state cross sections with resonances that cannot
818  // decay due to our "mass = pole mass" approximation.
819  node.weight_ = 0;
820  return;
821  }
822  }
823  }
824 }
static void add_decays(Node &node, double sqrts)
Add nodes for all decays possible from the given node and all of its children.
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.
constexpr int p
Proton.

Here is the call graph for this function:

Here is the caller graph for this function: