Version: SMASH-1.5
smash::DecayActionsFinder Class Reference

#include <decayactionsfinder.h>

A simple decay finder: Just loops through all particles and checks if they can decay during the next timestep.

Definition at line 25 of file decayactionsfinder.h.

Inheritance diagram for smash::DecayActionsFinder:
[legend]
Collaboration diagram for smash::DecayActionsFinder:
[legend]

Public Member Functions

 DecayActionsFinder ()
 Initialize the finder. More...
 
ActionList find_actions_in_cell (const ParticleList &search_list, double dt) const override
 Check the whole particle list for decays. More...
 
ActionList find_actions_with_neighbors (const ParticleList &, const ParticleList &, double) const override
 Ignore the neighbor searches for decays. More...
 
ActionList find_actions_with_surrounding_particles (const ParticleList &, const Particles &, double) const override
 Ignore the surrounding searches for decays. More...
 
ActionList find_final_actions (const Particles &search_list, bool only_res=false) const override
 Force all resonances to decay at the end of the simulation. More...
 
- Public Member Functions inherited from smash::ActionFinderInterface
virtual ~ActionFinderInterface ()=default
 

Constructor & Destructor Documentation

◆ DecayActionsFinder()

smash::DecayActionsFinder::DecayActionsFinder ( )
inline

Initialize the finder.

Definition at line 28 of file decayactionsfinder.h.

28 {}

Member Function Documentation

◆ find_actions_in_cell()

ActionList smash::DecayActionsFinder::find_actions_in_cell ( const ParticleList &  search_list,
double  dt 
) const
overridevirtual

Check the whole particle list for decays.

Parameters
[in]search_listAll particles in grid cell.
[in]dtSize of timestep [fm]
Returns
List with the found (Decay)Action objects.

Implements smash::ActionFinderInterface.

Definition at line 22 of file decayactionsfinder.cc.

23  {
24  ActionList actions;
25  /* for short time steps this seems reasonable to expect
26  * less than 10 decays in most time steps */
27  actions.reserve(10);
28 
29  for (const auto &p : search_list) {
30  if (p.type().is_stable()) {
31  continue; // particle doesn't decay
32  }
33 
34  DecayBranchList processes = p.type().get_partial_widths_hadronic(
35  p.momentum(), p.position().threevec());
36  // total decay width (mass-dependent)
37  const double width = total_weight<DecayBranch>(processes);
38 
39  // check if there are any (hadronic) decays
40  if (!(width > 0.0)) {
41  continue;
42  }
43 
44  constexpr double one_over_hbarc = 1. / hbarc;
45 
46  /* The decay_time is sampled from an exponential distribution.
47  * Even though it may seem suspicious that it is sampled every
48  * timestep, it can be proven that this still overall obeys
49  * the exponential decay law.
50  */
51  const double decay_time = random::exponential<double>(
52  /* The clock goes slower in the rest
53  * frame of the resonance */
54  one_over_hbarc * p.inverse_gamma() * width);
55  /* If the particle is not yet formed at the decay time,
56  * it should not be able to decay */
57  if (decay_time < dt &&
58  (p.formation_time() < (p.position().x0() + decay_time))) {
59  /* => decay_time ∈ [0, dt[
60  * => the particle decays in this timestep. */
61  auto act = make_unique<DecayAction>(p, decay_time);
62  act->add_decays(std::move(processes));
63  actions.emplace_back(std::move(act));
64  }
65  }
66  return actions;
67 }
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:25
constexpr int p
Proton.

◆ find_actions_with_neighbors()

ActionList smash::DecayActionsFinder::find_actions_with_neighbors ( const ParticleList &  ,
const ParticleList &  ,
double   
) const
inlineoverridevirtual

Ignore the neighbor searches for decays.

Implements smash::ActionFinderInterface.

Definition at line 41 of file decayactionsfinder.h.

43  {
44  return {};
45  }

◆ find_actions_with_surrounding_particles()

ActionList smash::DecayActionsFinder::find_actions_with_surrounding_particles ( const ParticleList &  ,
const Particles ,
double   
) const
inlineoverridevirtual

Ignore the surrounding searches for decays.

Implements smash::ActionFinderInterface.

Definition at line 48 of file decayactionsfinder.h.

50  {
51  return {};
52  }

◆ find_final_actions()

ActionList smash::DecayActionsFinder::find_final_actions ( const Particles search_list,
bool  only_res = false 
) const
overridevirtual

Force all resonances to decay at the end of the simulation.

Parameters
[in]search_listAll particles at the end of simulation.
[in]only_resoptional parameter that requests that only actions regarding resonances are considered (disregarding stable particles)
Returns
List with the found (Decay)Action objects.

Implements smash::ActionFinderInterface.

Definition at line 69 of file decayactionsfinder.cc.

70  {
71  ActionList actions;
72 
73  for (const auto &p : search_list) {
74  if (p.type().is_stable()) {
75  continue; // particle doesn't decay
76  }
77  auto act = make_unique<DecayAction>(p, 0.);
78  act->add_decays(p.type().get_partial_widths(p.effective_mass()));
79  actions.emplace_back(std::move(act));
80  }
81  return actions;
82 }
constexpr int p
Proton.

The documentation for this class was generated from the following files: