Version: SMASH-3.3
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 26 of file decayactionsfinder.h.

Inheritance diagram for smash::DecayActionsFinder:
smash::ActionFinderInterface

Public Member Functions

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

Public Attributes

const double res_lifetime_factor_ = 1.
 Multiplicative factor to be applied to resonance lifetimes. More...
 
const bool do_final_non_strong_decays_
 Do all non-strong decays (including weak and electro-magnetic ones) More...
 
const bool find_final_decays_
 Whether to find final decay actions. More...
 
SpinInteractionType spin_interaction_type_
 Spin interaction type. More...
 
const bool decay_initial_particles_
 Whether to initial state particles can decay. More...
 

Constructor & Destructor Documentation

◆ DecayActionsFinder()

smash::DecayActionsFinder::DecayActionsFinder ( double  res_lifetime_factor,
bool  do_non_strong_decays,
bool  force_decays_at_end,
SpinInteractionType  spin_interaction_type = SpinInteractionType::Off 
)
inlineexplicit

Initialize the finder.

Parameters
[in]res_lifetime_factorThe multiplicative factor to be applied to resonance lifetimes; default is 1
[in]do_non_strong_decayswhether to do non-strong decays at the end
[in]force_decays_at_endwhether to enforce decays at the end
[in]spin_interaction_typeWhich type of spin interaction to use

Definition at line 37 of file decayactionsfinder.h.

41  : res_lifetime_factor_(res_lifetime_factor),
42  do_final_non_strong_decays_(do_non_strong_decays),
43  find_final_decays_(force_decays_at_end),
44  spin_interaction_type_(spin_interaction_type) {}
const bool find_final_decays_
Whether to find final decay actions.
const bool do_final_non_strong_decays_
Do all non-strong decays (including weak and electro-magnetic ones)
SpinInteractionType spin_interaction_type_
Spin interaction type.
const double res_lifetime_factor_
Multiplicative factor to be applied to resonance lifetimes.

Member Function Documentation

◆ find_actions_in_cell()

ActionList smash::DecayActionsFinder::find_actions_in_cell ( const ParticleList &  search_list,
double  dt,
const double  ,
const std::vector< FourVector > &   
) 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 20 of file decayactionsfinder.cc.

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

◆ find_actions_with_neighbors()

ActionList smash::DecayActionsFinder::find_actions_with_neighbors ( const ParticleList &  ,
const ParticleList &  ,
double  ,
const std::vector< FourVector > &   
) const
inlineoverridevirtual

Ignore the neighbor searches for decays.

Implements smash::ActionFinderInterface.

Definition at line 58 of file decayactionsfinder.h.

60  {
61  return {};
62  }

◆ find_actions_with_surrounding_particles()

ActionList smash::DecayActionsFinder::find_actions_with_surrounding_particles ( const ParticleList &  ,
const Particles ,
double  ,
const std::vector< FourVector > &   
) const
inlineoverridevirtual

Ignore the surrounding searches for decays.

Implements smash::ActionFinderInterface.

Definition at line 65 of file decayactionsfinder.h.

67  {
68  return {};
69  }

◆ find_final_actions()

ActionList smash::DecayActionsFinder::find_final_actions ( const Particles search_list) const
overridevirtual

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

Parameters
[in]search_listAll particles at the end of simulation.
Returns
List with the found (Decay)Action objects.

Implements smash::ActionFinderInterface.

Definition at line 77 of file decayactionsfinder.cc.

78  {
79  ActionList actions;
80  if (find_final_decays_) {
81  for (const auto &p : search_list) {
82  if (!do_final_non_strong_decays_ && p.type().is_stable()) {
83  continue; // particle is stable with respect to strong interaction
84  }
85 
86  if (p.type().decay_modes().is_empty()) {
87  continue; // particle cannot decay (not even e.m. or weakly)
88  }
89 
90  auto act = std::make_unique<DecayAction>(p, 0., spin_interaction_type_);
91  act->add_decays(p.type().get_partial_widths(
92  p.momentum(), p.position().threevec(), WhichDecaymodes::All));
93  actions.emplace_back(std::move(act));
94  }
95  }
96  return actions;
97 }
@ All
All decay mode widths.

Member Data Documentation

◆ res_lifetime_factor_

const double smash::DecayActionsFinder::res_lifetime_factor_ = 1.

Multiplicative factor to be applied to resonance lifetimes.

Definition at line 80 of file decayactionsfinder.h.

◆ do_final_non_strong_decays_

const bool smash::DecayActionsFinder::do_final_non_strong_decays_

Do all non-strong decays (including weak and electro-magnetic ones)

Definition at line 83 of file decayactionsfinder.h.

◆ find_final_decays_

const bool smash::DecayActionsFinder::find_final_decays_

Whether to find final decay actions.

Definition at line 86 of file decayactionsfinder.h.

◆ spin_interaction_type_

SpinInteractionType smash::DecayActionsFinder::spin_interaction_type_

Spin interaction type.

Definition at line 89 of file decayactionsfinder.h.

◆ decay_initial_particles_

const bool smash::DecayActionsFinder::decay_initial_particles_
Initial value:
=
default_type default_value() const
Get the default value of the key.
Definition: key.h:251
static const Key< bool > collTerm_decayInitial
See user guide description for more information.
Definition: input_keys.h:2248

Whether to initial state particles can decay.

Useful for analyzing interactions involving one or more resonances.

Definition at line 95 of file decayactionsfinder.h.


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