Version: SMASH-3.3
smash::DecayAction Class Reference

#include <decayaction.h>

DecayAction is a special action which takes one single particle in the initial state and makes it decay into a number of daughter particles (currently two or three).

Definition at line 26 of file decayaction.h.

Inheritance diagram for smash::DecayAction:
smash::Action smash::DecayActionDilepton

Classes

class  InvalidDecay
 Thrown when DecayAction is called to perform with 0 or more than 2 entries in outgoing_particles. More...
 

Public Member Functions

 DecayAction (const ParticleData &p, double time, SpinInteractionType spin_interaction_type=SpinInteractionType::Off)
 Construct a DecayAction from a particle p. More...
 
void add_decays (DecayBranchList pv)
 Add several new decays at once. More...
 
void add_decay (DecayBranchPtr p)
 Add one new decay. More...
 
void generate_final_state () override
 Generate the final state of the decay process. More...
 
std::pair< double, double > sample_masses (double kinetic_energy_cm) const override
 Sample the masses of the final particles. More...
 
void sample_2body_phasespace () override
 Sample the full 2-body phase space (masses, momenta, angles) in the center-of-mass frame for the final-state particles. More...
 
double get_total_weight () const override
 Return the total width of the decay process. More...
 
double get_partial_weight () const override
 Get partial width of chosen channel. More...
 
double total_width () const
 Get total decay width. More...
 
- Public Member Functions inherited from smash::Action
 Action (const ParticleList &in_part, double time)
 Construct an action object with incoming particles and relative time. More...
 
 Action (const ParticleData &in_part, const ParticleData &out_part, double time, ProcessType type)
 Construct an action object with the incoming particles, relative time, and the already known outgoing particles and type of the process. More...
 
 Action (const ParticleList &in_part, const ParticleList &out_part, double absolute_execution_time, ProcessType type)
 Construct an action object with the incoming particles, absolute time, and the already known outgoing particles and type of the process. More...
 
 Action (const Action &)=delete
 Copying is disabled. Use pointers or create a new Action. More...
 
virtual ~Action ()
 Virtual Destructor. More...
 
bool operator< (const Action &rhs) const
 Determine whether one action takes place before another in time. More...
 
virtual ProcessType get_type () const
 Get the process type. More...
 
template<typename Branch >
void add_process (ProcessBranchPtr< Branch > &p, ProcessBranchList< Branch > &subprocesses, double &total_weight)
 Add a new subprocess. More...
 
template<typename Branch >
void add_processes (ProcessBranchList< Branch > pv, ProcessBranchList< Branch > &subprocesses, double &total_weight)
 Add several new subprocesses at once. More...
 
virtual double perform (Particles *particles, uint32_t id_process)
 Actually perform the action, e.g. More...
 
bool is_valid (const Particles &particles) const
 Check whether the action still applies. More...
 
bool is_pauli_blocked (const std::vector< Particles > &ensembles, const PauliBlocker &p_bl) const
 Check if the action is Pauli-blocked. More...
 
const ParticleList & incoming_particles () const
 Get the list of particles that go into the action. More...
 
void update_incoming (const Particles &particles)
 Update the incoming particles that are stored in this action to the state they have in the global particle list. More...
 
const ParticleList & outgoing_particles () const
 Get the list of particles that resulted from the action. More...
 
double time_of_execution () const
 Get the time at which the action is supposed to be performed. More...
 
virtual double check_conservation (const uint32_t id_process) const
 Check various conservation laws. More...
 
double sqrt_s () const
 Determine the total energy in the center-of-mass frame [GeV]. More...
 
FourVector total_momentum_of_outgoing_particles () const
 Calculate the total kinetic momentum of the outgoing particles. More...
 
FourVector get_interaction_point () const
 Get the interaction point. More...
 
std::pair< FourVector, FourVectorget_potential_at_interaction_point () const
 Get the skyrme and asymmetry potential at the interaction point. More...
 
void set_stochastic_pos_idx ()
 Setter function that stores a random incoming particle index latter used to determine the interaction point. More...
 
void assign_unpolarized_spin_vector_to_outgoing_particles ()
 Assign an unpolarized spin vector to all outgoing particles. More...
 

Protected Member Functions

void format_debug_output (std::ostream &out) const override
 Writes information about this decay action to the out stream. More...
 
bool sample_outgoing_particles ()
 Sample outgoing particle types, masses and angles return success of sampling. More...
 
- Protected Member Functions inherited from smash::Action
FourVector total_momentum () const
 Sum of 4-momenta of incoming particles. More...
 
template<typename Branch >
const Branch * choose_channel (const ProcessBranchList< Branch > &subprocesses, double total_weight)
 Decide for a particular final-state channel via Monte-Carlo and return it as a ProcessBranch. More...
 
virtual void sample_angles (std::pair< double, double > masses, double kinetic_energy_cm)
 Sample final-state momenta in general X->2 processes (here: using an isotropical angular distribution). More...
 
virtual void sample_manybody_phasespace ()
 Sample the full n-body phase-space (masses, momenta, angles) in the center-of-mass frame for the final state particles. More...
 
void assign_formation_time_to_outgoing_particles ()
 Assign the formation time to the outgoing particles. More...
 

Protected Attributes

DecayBranchList decay_channels_
 List of possible decays. More...
 
double total_width_
 total decay width More...
 
double partial_width_
 partial decay width to the chosen outgoing channel More...
 
int L_ = 0
 Angular momentum of the decay. More...
 
- Protected Attributes inherited from smash::Action
ParticleList incoming_particles_
 List with data of incoming particles. More...
 
ParticleList outgoing_particles_
 Initially this stores only the PDG codes of final-state particles. More...
 
const double time_of_execution_
 Time at which the action is supposed to be performed (absolute time in the lab frame in fm). More...
 
ProcessType process_type_
 type of process More...
 
double box_length_ = -1.0
 Box length: needed to determine coordinates of collision correctly in case of collision through the wall. More...
 
int stochastic_position_idx_ = -1
 This stores a randomly-chosen index to an incoming particle. More...
 

Static Private Member Functions

static bool is_sigmastar_to_lambda_pion_decay (const ParticleData &parent, const ParticleData &daughter0, const ParticleData &daughter1, int &lambda_idx, int &pion_idx)
 Check for the decay Σ*→Λπ. More...
 

Private Attributes

std::optional< bool > was_2body_phase_space_sampled_with_potentials_as_valid_
 Optional success flag for sampling outgoing particles. More...
 
SpinInteractionType spin_interaction_type_
 Spin interaction type. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from smash::Action
static double lambda_tilde (double a, double b, double c)
 Little helper function that calculates the lambda function (sometimes written with a tilde to better distinguish it) that appears e.g. More...
 
static void sample_manybody_phasespace_impl (double sqrts, const std::vector< double > &m, std::vector< FourVector > &sampled_momenta)
 Implementation of the full n-body phase-space sampling (masses, momenta, angles) in the center-of-mass frame for the final state particles. More...
 

Constructor & Destructor Documentation

◆ DecayAction()

smash::DecayAction::DecayAction ( const ParticleData p,
double  time,
SpinInteractionType  spin_interaction_type = SpinInteractionType::Off 
)

Construct a DecayAction from a particle p.

It does not initialize the list of possible decay processes. You need to call add_processes after construction.

Parameters
[in]pThe particle that should decay if the action is performed.
[in]timeTime at which the action is supposed to take place
[in]spin_interaction_typeWhich type of spin interaction to use

Definition at line 21 of file decayaction.cc.

23  : Action({p}, time),
24  total_width_(0.),
25  spin_interaction_type_(spin_interaction_type) {}
Action(const ParticleList &in_part, double time)
Construct an action object with incoming particles and relative time.
Definition: action.h:44
double total_width_
total decay width
Definition: decayaction.h:181
SpinInteractionType spin_interaction_type_
Spin interaction type.
Definition: decayaction.h:191
constexpr int p
Proton.

Member Function Documentation

◆ add_decays()

void smash::DecayAction::add_decays ( DecayBranchList  pv)

Add several new decays at once.

Parameters
[in]pvList of decays to be added.

Definition at line 27 of file decayaction.cc.

27  {
28  add_processes<DecayBranch>(std::move(pv), decay_channels_, total_width_);
29 }
DecayBranchList decay_channels_
List of possible decays.
Definition: decayaction.h:178

◆ add_decay()

void smash::DecayAction::add_decay ( DecayBranchPtr  p)

Add one new decay.

Parameters
[in]pDecay to be added.

Definition at line 31 of file decayaction.cc.

31  {
32  add_process<DecayBranch>(p, decay_channels_, total_width_);
33 }

◆ generate_final_state()

void smash::DecayAction::generate_final_state ( )
overridevirtual

Generate the final state of the decay process.

Performs a decay of one particle to two or three particles.

Exceptions
InvalidDecay

Implements smash::Action.

Definition at line 76 of file decayaction.cc.

76  {
77  int n_try = 1000;
78  while (n_try--) {
80  break;
81  }
82 
83  const bool core_in_incoming = incoming_particles_[0].is_core();
84  // Set formation time.
85  for (auto &p : outgoing_particles_) {
86  logg[LDecayModes].debug("particle momenta in lrf ", p);
87  // assuming decaying particles are always fully formed
88  p.set_formation_time(time_of_execution_);
89  // Boost to the computational frame
90  p.boost_momentum(-total_momentum_of_outgoing_particles().velocity());
91  logg[LDecayModes].debug("particle momenta in comp ", p);
92  if (core_in_incoming) {
93  p.fluidize();
94  }
95  if (p.type().pdgcode().is_heavy_flavor()) {
96  p.set_perturbative_weight(incoming_particles_[0].perturbative_weight());
97  }
98  }
99 
100  /*
101  * @brief Σ* → Λ + π decay: propagate Λ polarization from the intermediate
102  * resonance.
103  *
104  * During Λ+π → Σ* formation we stored the incoming Λ polarization by
105  * writing it into the Σ* spin 4-vector (optionally applying a Λ spin-flip
106  * probability, cf. arXiv:2404.15890v2). At decay, we must hand this
107  * polarization back to the outgoing Λ to transport Λ polarization through the
108  * resonance stage.
109  */
111  outgoing_particles_.size() == 2) {
112  // Check for Σ* → Λ + π decay channel
113  int lambda_idx = -1;
114  int pion_idx = -1;
115  const bool is_sigmastar_decay = is_sigmastar_to_lambda_pion_decay(
117  lambda_idx, pion_idx);
118 
119  if (is_sigmastar_decay) {
120  auto &sigma_star = incoming_particles_[0];
121  auto &lambda = outgoing_particles_[lambda_idx];
122  auto &pion = outgoing_particles_[pion_idx];
123  // Copy spin vector from Σ* to Λ and boost it to the Λ frame
124  FourVector final_spin_vector =
125  sigma_star.spin_vector().lorentz_boost(lambda.velocity());
126  lambda.set_spin_vector(final_spin_vector);
127  pion.set_spin_vector(FourVector{0., 0., 0., 0.});
128  } else {
129  // Set unpolarized spin vectors
131  }
133  outgoing_particles_.size() != 2) {
134  // Set unpolarized spin vectors
136  }
137 }
FourVector total_momentum_of_outgoing_particles() const
Calculate the total kinetic momentum of the outgoing particles.
Definition: action.cc:160
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
Definition: action.h:372
const double time_of_execution_
Time at which the action is supposed to be performed (absolute time in the lab frame in fm).
Definition: action.h:378
void assign_unpolarized_spin_vector_to_outgoing_particles()
Assign an unpolarized spin vector to all outgoing particles.
Definition: action.cc:478
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:364
bool sample_outgoing_particles()
Sample outgoing particle types, masses and angles return success of sampling.
Definition: decayaction.cc:35
static bool is_sigmastar_to_lambda_pion_decay(const ParticleData &parent, const ParticleData &daughter0, const ParticleData &daughter1, int &lambda_idx, int &pion_idx)
Check for the decay Σ*→Λπ.
Definition: decayaction.h:138
@ Off
No spin interactions.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:40
static constexpr int LDecayModes
Definition: decayaction.cc:19

◆ sample_masses()

std::pair< double, double > smash::DecayAction::sample_masses ( double  kinetic_energy_cm) const
overridevirtual

Sample the masses of the final particles.

Returns
Pair of sampled masses of particle 1 and 2

Reimplemented from smash::Action.

Definition at line 156 of file decayaction.cc.

157  {
158  const ParticleType &t_a = outgoing_particles_[0].type();
159  const ParticleType &t_b = outgoing_particles_[1].type();
160 
161  // start with pole masses
162  std::pair<double, double> masses = {t_a.mass(), t_b.mass()};
163 
164  const bool below_threshold_energy =
165  kinetic_energy_cm < t_a.min_mass_kinematic() + t_b.min_mass_kinematic();
166 
167  const bool return_nan_on_failure = pot_pointer != nullptr;
168 
169  if (below_threshold_energy) {
170  if (return_nan_on_failure) {
171  return {smash_NaN<double>, smash_NaN<double>};
172  } else {
173  const std::string reaction =
174  incoming_particles_[0].type().name() + "→" + t_a.name() + t_b.name();
175  throw InvalidResonanceFormation(
176  reaction + ": not enough energy, " +
177  std::to_string(kinetic_energy_cm) + " < " +
178  std::to_string(t_a.min_mass_kinematic()) + " + " +
179  std::to_string(t_b.min_mass_kinematic()));
180  }
181  }
182  // If one of the particles is a resonance, sample its mass.
183  if (!t_a.is_stable() && t_b.is_stable()) {
184  masses.first = t_a.sample_resonance_mass(t_b.mass(), kinetic_energy_cm, L_);
185  } else if (!t_b.is_stable() && t_a.is_stable()) {
186  masses.second =
187  t_b.sample_resonance_mass(t_a.mass(), kinetic_energy_cm, L_);
188  } else if (!t_a.is_stable() && !t_b.is_stable()) {
189  // two resonances in final state
190  masses = t_a.sample_resonance_masses(t_b, kinetic_energy_cm, L_);
191  }
192 
193  return masses;
194 }
int L_
Angular momentum of the decay.
Definition: decayaction.h:187
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
Definition: stringify.cc:26
Potentials * pot_pointer
Pointer to a Potential class.

◆ sample_2body_phasespace()

void smash::DecayAction::sample_2body_phasespace ( )
overridevirtual

Sample the full 2-body phase space (masses, momenta, angles) in the center-of-mass frame for the final-state particles.

See also
Action::sample_2body_phasespace for the base behaviour.

This overrides the base implementation to integrate with DecayAction’s channel selection and potential-aware kinematics. If sample_masses() returns NaNs (i.e., the previously chosen channel is kinematically forbidden once potentials are considered), this method sets was_2body_phase_space_sampled_with_potentials_as_valid_ to 'false' so the caller can fall back to another channel instead of throwing. Otherwise it sets it to 'true' and proceeds with momentum/angle sampling (which may use L_).

Reimplemented from smash::Action.

Definition at line 139 of file decayaction.cc.

139  {
140  assert(outgoing_particles_.size() == 2);
141  const FourVector p_tot = total_momentum_of_outgoing_particles();
142  const double cm_kin_energy = p_tot.abs();
143  const std::pair<double, double> masses = sample_masses(cm_kin_energy);
144 
145  const bool is_valid = !std::isnan(masses.first) && !std::isnan(masses.second);
146 
147  if (pot_pointer) {
149  }
150 
151  sample_angles(masses, cm_kin_energy);
152 }
virtual void sample_angles(std::pair< double, double > masses, double kinetic_energy_cm)
Sample final-state momenta in general X->2 processes (here: using an isotropical angular distribution...
Definition: action.cc:282
bool is_valid(const Particles &particles) const
Check whether the action still applies.
Definition: action.cc:29
std::optional< bool > was_2body_phase_space_sampled_with_potentials_as_valid_
Optional success flag for sampling outgoing particles.
Definition: decayaction.h:125
std::pair< double, double > sample_masses(double kinetic_energy_cm) const override
Sample the masses of the final particles.
Definition: decayaction.cc:156

◆ get_total_weight()

double smash::DecayAction::get_total_weight ( ) const
inlineoverridevirtual

Return the total width of the decay process.

Implements smash::Action.

Reimplemented in smash::DecayActionDilepton.

Definition at line 87 of file decayaction.h.

87 { return total_width_; }

◆ get_partial_weight()

double smash::DecayAction::get_partial_weight ( ) const
inlineoverridevirtual

Get partial width of chosen channel.

Returns
Partial width of chosen channel

Implements smash::Action.

Definition at line 93 of file decayaction.h.

93 { return partial_width_; }
double partial_width_
partial decay width to the chosen outgoing channel
Definition: decayaction.h:184

◆ total_width()

double smash::DecayAction::total_width ( ) const
inline

Get total decay width.

Returns
Total width of decay

Definition at line 99 of file decayaction.h.

99 { return total_width_; }

◆ is_sigmastar_to_lambda_pion_decay()

static bool smash::DecayAction::is_sigmastar_to_lambda_pion_decay ( const ParticleData parent,
const ParticleData daughter0,
const ParticleData daughter1,
int &  lambda_idx,
int &  pion_idx 
)
inlinestaticprivate

Check for the decay Σ*→Λπ.

In this case it sets the output indices.

Parameters
[in]parentParticle decaying
[in]daughter0First decay product
[in]daughter1Second decay product
[out]lambda_idxPossible index for Λ in the decay channel
[out]pion_idxPossible index for π in the decay channel
Returns
true if parent is Σ* and daughters are {Λ, π}

Definition at line 138 of file decayaction.h.

140  {
141  // Fast rejections first
142  if (!parent.is_sigmastar())
143  return false;
144 
145  const bool lambda0 = daughter0.pdgcode().is_Lambda();
146  const bool lambda1 = daughter1.pdgcode().is_Lambda();
147  const bool pion0 = daughter0.pdgcode().is_pion();
148  const bool pion1 = daughter1.pdgcode().is_pion();
149 
150  // Check if one daughter is a lambda and the other a pion
151  if (lambda0 && pion1 && !lambda1 && !pion0) {
152  lambda_idx = 0;
153  pion_idx = 1;
154  return true;
155  } else if (lambda1 && pion0 && !lambda0 && !pion1) {
156  lambda_idx = 1;
157  pion_idx = 0;
158  return true;
159  } else {
160  return false;
161  }
162  }

◆ sample_outgoing_particles()

bool smash::DecayAction::sample_outgoing_particles ( )
protected

Sample outgoing particle types, masses and angles return success of sampling.

Definition at line 35 of file decayaction.cc.

35  {
36  logg[LDecayModes].debug("Process: Resonance decay. ");
37  /* Execute a decay process for the selected particle.
38  *
39  * randomly select one of the decay modes of the particle
40  * according to their relative weights. Then decay the particle
41  * by calling function sample_2body_phasespace or sample_manybody_phasespace.
42  */
43  const DecayBranch *proc =
44  choose_channel<DecayBranch>(decay_channels_, total_width_);
45  outgoing_particles_ = proc->particle_list();
46  // set positions of the outgoing particles
47  for (auto &p : outgoing_particles_) {
48  p.set_4position(incoming_particles_[0].position());
49  }
50  process_type_ = proc->get_type();
51  L_ = proc->angular_momentum();
52  partial_width_ = proc->weight();
53 
54  switch (outgoing_particles_.size()) {
55  case 2:
57  if (pot_pointer) {
59  } else {
60  return true;
61  }
62  case 3:
64  return true;
65  default:
66  throw InvalidDecay(
67  "DecayAction::perform: Only 1->2 or 1->3 processes are supported. "
68  "Decay from 1->" +
70  " was requested. (PDGcode=" +
71  incoming_particles_[0].pdgcode().string() + ", mass=" +
72  std::to_string(incoming_particles_[0].effective_mass()) + ")");
73  }
74 }
virtual void sample_manybody_phasespace()
Sample the full n-body phase-space (masses, momenta, angles) in the center-of-mass frame for the fina...
Definition: action.cc:449
ProcessType process_type_
type of process
Definition: action.h:381
void sample_2body_phasespace() override
Sample the full 2-body phase space (masses, momenta, angles) in the center-of-mass frame for the fina...
Definition: decayaction.cc:139

Member Data Documentation

◆ was_2body_phase_space_sampled_with_potentials_as_valid_

std::optional<bool> smash::DecayAction::was_2body_phase_space_sampled_with_potentials_as_valid_
private
Initial value:
=
std::nullopt

Optional success flag for sampling outgoing particles.

Set to true if 2-body phase-space sampling succeeded, false if sample_masses() signaled failure via NaNs (e.g., because the chosen channel turned out to be kinematically forbidden after considering potentials), or std::nullopt if not sampled yet.

This is a temporary workaround: the decay channel is currently chosen without knowledge of the potentials, and kinematic failure is handled a posteriori. In the future, this should be replaced by a proper channel selection that already accounts for potential effects during the decision, avoiding the need for this flag.

Definition at line 125 of file decayaction.h.

◆ decay_channels_

DecayBranchList smash::DecayAction::decay_channels_
protected

List of possible decays.

Definition at line 178 of file decayaction.h.

◆ total_width_

double smash::DecayAction::total_width_
protected

total decay width

Definition at line 181 of file decayaction.h.

◆ partial_width_

double smash::DecayAction::partial_width_
protected

partial decay width to the chosen outgoing channel

Definition at line 184 of file decayaction.h.

◆ L_

int smash::DecayAction::L_ = 0
protected

Angular momentum of the decay.

Definition at line 187 of file decayaction.h.

◆ spin_interaction_type_

SpinInteractionType smash::DecayAction::spin_interaction_type_
private

Spin interaction type.

Definition at line 191 of file decayaction.h.


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