#include <action.h>
Action is the base class for a generic process that takes a number of incoming particles and transforms them into any number of outgoing particles.
Currently such an action can be either a decay, a two-body collision, a wallcrossing or a thermalization. (see derived classes).
Classes | |
class | InvalidResonanceFormation |
Thrown for example when ScatterAction is called to perform with a wrong number of final-state particles or when the energy is too low to produce the resonance. More... | |
Public Member Functions | |
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 double | get_total_weight () const =0 |
Return the total weight value, which is mainly used for the weight output entry. More... | |
virtual double | get_partial_weight () const =0 |
Return the specific weight for the chosen outgoing channel, which is mainly used for the partial weight output entry. 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 void | generate_final_state ()=0 |
Generate the final state for this action. More... | |
virtual void | 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 void | 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, FourVector > | get_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... | |
Static Public Member Functions | |
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... | |
Protected Member Functions | |
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 std::pair< double, double > | sample_masses (double kinetic_energy_cm) const |
Sample final-state masses in general X->2 processes (thus also fixing the absolute c.o.m. 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... | |
void | sample_2body_phasespace () |
Sample the full 2-body phase-space (masses, momenta, angles) in the center-of-mass frame for the final state particles. More... | |
virtual void | sample_3body_phasespace () |
Sample the full 3-body phase-space (masses, momenta, angles) in the center-of-mass frame for the final state particles. More... | |
virtual void | sample_5body_phasespace () |
Sample the full 5-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... | |
virtual void | format_debug_output (std::ostream &out) const =0 |
Writes information about this action to the out stream. More... | |
Protected Attributes | |
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/c). 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... | |
Private Member Functions | |
const ParticleType & | type_of_pout (const ParticleData &p_out) const |
Get the type of a given particle. More... | |
const ParticleType & | type_of_pout (const ParticleTypePtr &p_out) const |
Get the particle type for given pointer to a particle type. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Action &action) |
Dispatches formatting to the virtual Action::format_debug_output function. More... | |
|
inline |
Construct an action object with incoming particles and relative time.
[in] | in_part | list of incoming particles |
[in] | time | time at which the action is supposed to take place (relative to the current time of the incoming particles) |
Definition at line 44 of file action.h.
|
inline |
Construct an action object with the incoming particles, relative time, and the already known outgoing particles and type of the process.
[in] | in_part | list of incoming particles |
[in] | out_part | list of outgoing particles |
[in] | time | time at which the action is supposed to take place (relative to the current time of the incoming particles) |
[in] | type | type of the interaction |
Definition at line 58 of file action.h.
|
inline |
Construct an action object with the incoming particles, absolute time, and the already known outgoing particles and type of the process.
[in] | in_part | list of incoming particles |
[in] | out_part | list of outgoing particles |
[in] | absolute_execution_time | absolute time at which the action is supposed to take place |
[in] | type | type of the interaction |
Definition at line 75 of file action.h.
|
delete |
Copying is disabled. Use pointers or create a new Action.
|
virtualdefault |
Virtual Destructor.
Destructor.
The declaration of the destructor is necessary to make it virtual.
|
inline |
Determine whether one action takes place before another in time.
|
pure virtual |
Return the total weight value, which is mainly used for the weight output entry.
It has different meanings depending of the type of action. It is the total cross section in case of a ScatterAction, the total decay width in case of a DecayAction and the shining weight in case of a DecayActionDilepton.
Prefer to use a more specific function. If there is no weight for the action type, 0 should be returned.
Implemented in smash::ThermalizationAction, smash::BremsstrahlungAction, smash::DecayAction, smash::DecayActionDilepton, smash::HypersurfacecrossingAction, smash::ScatterAction, smash::ScatterActionMulti, smash::ScatterActionPhoton, and smash::WallcrossingAction.
|
pure virtual |
Return the specific weight for the chosen outgoing channel, which is mainly used for the partial weight output entry.
For scatterings it will be the partial cross section, for decays (including dilepton decays) the partial decay width.
If there is no weight for the action type, 0 should be returned.
Implemented in smash::ThermalizationAction, smash::DecayAction, smash::HypersurfacecrossingAction, smash::ScatterAction, smash::ScatterActionMulti, and smash::WallcrossingAction.
|
inlinevirtual |
|
inline |
|
inline |
Add several new subprocesses at once.
[in] | pv | processes list to be added |
[out] | subprocesses | processes, where pv are added to |
[out] | total_weight | summed weights of all the subprocesses |
|
pure virtual |
Generate the final state for this action.
This function selects a subprocess by Monte-Carlo decision and sets up the final-state particles in phase space.
Implemented in smash::ThermalizationAction, smash::BremsstrahlungAction, smash::DecayAction, smash::HypersurfacecrossingAction, smash::ScatterAction, smash::ScatterActionMulti, smash::ScatterActionPhoton, and smash::WallcrossingAction.
|
virtual |
Actually perform the action, e.g.
carry out a decay or scattering by updating the particle list.
This function removes the initial-state particles from the particle list and then inserts the final-state particles. It does not do any sanity checks, but assumes that is_valid has been called to determine if the action is still valid.
[in] | id_process | unique id of the performed process |
[out] | particles | particle list that is updated |
Note that you are required to increase id_process before the next call, such that you get unique numbers.
Definition at line 124 of file action.cc.
bool smash::Action::is_valid | ( | const Particles & | particles | ) | const |
Check whether the action still applies.
It can happen that a different action removed the incoming_particles from the set of existing particles in the experiment, or that the particle has scattered elastically in the meantime. In this case the Action doesn't apply anymore and should be discarded.
[in] | particles | current particle list |
Definition at line 28 of file action.cc.
bool smash::Action::is_pauli_blocked | ( | const std::vector< Particles > & | ensembles, |
const PauliBlocker & | p_bl | ||
) | const |
Check if the action is Pauli-blocked.
If there are baryons in the final state then blocking probability is \( 1 - \Pi (1-f_i) \), where the product is taken by all fermions in the final state and \( f_i \) denotes the phase-space density at the position of i-th final-state fermion.
[in] | ensembles | current particle list, all ensembles |
[in] | p_bl | PauliBlocker that stores the configurations concerning Pauli-blocking. |
Definition at line 34 of file action.cc.
const ParticleList & smash::Action::incoming_particles | ( | ) | const |
void smash::Action::update_incoming | ( | const Particles & | particles | ) |
|
inline |
|
inline |
|
virtual |
Check various conservation laws.
[in] | id_process | process id only used for debugging output |
Reimplemented in smash::HypersurfacecrossingAction.
Definition at line 413 of file action.cc.
|
inline |
Determine the total energy in the center-of-mass frame [GeV].
Definition at line 266 of file action.h.
FourVector smash::Action::total_momentum_of_outgoing_particles | ( | ) | const |
Calculate the total kinetic momentum of the outgoing particles.
Use this to determine the momemtum and boost of the outgoing particles by calcluating the total momentum of the incoming particles and correcting it for the effect of potentials. This function is used when the species of the outgoing particles are already determined.
Definition at line 152 of file action.cc.
FourVector smash::Action::get_interaction_point | ( | ) | const |
Get the interaction point.
Definition at line 67 of file action.cc.
std::pair< FourVector, FourVector > smash::Action::get_potential_at_interaction_point | ( | ) | const |
Get the skyrme and asymmetry potential at the interaction point.
Definition at line 108 of file action.cc.
|
inline |
|
inlinestatic |
Little helper function that calculates the lambda function (sometimes written with a tilde to better distinguish it) that appears e.g.
in the relative velocity or 3-to-2 probability calculation, where it is used with a=s, b=m1^2 and c=m2^2. Defintion found e.g. in Seifert:2017oyb [45], eq. (5).
Definition at line 310 of file action.h.
|
inlineprotected |
|
inlineprotected |
Decide for a particular final-state channel via Monte-Carlo and return it as a ProcessBranch.
Branch | Type of processbranch |
[in] | subprocesses | list of possible processes |
[in] | total_weight | summed weight of all processes |
Definition at line 383 of file action.h.
|
protectedvirtual |
Sample final-state masses in general X->2 processes (thus also fixing the absolute c.o.m.
momentum).
[in] | kinetic_energy_cm | total kinetic energy of the outgoing particles in their center of mass frame [GeV] |
InvalidResonanceFormation |
Reimplemented in smash::DecayAction.
Definition at line 245 of file action.cc.
|
protectedvirtual |
Sample final-state momenta in general X->2 processes (here: using an isotropical angular distribution).
[in] | kinetic_energy_cm | total kinetic energy of the outgoing particles in their center of mass frame [GeV] |
[in] | masses | masses of each of the final state particles |
Reimplemented in smash::ScatterAction.
Definition at line 274 of file action.cc.
|
protected |
Sample the full 2-body phase-space (masses, momenta, angles) in the center-of-mass frame for the final state particles.
Definition at line 297 of file action.cc.
|
protectedvirtual |
Sample the full 3-body phase-space (masses, momenta, angles) in the center-of-mass frame for the final state particles.
std::invalid_argument | if one outgoing particle is a resonance |
Reimplemented in smash::BremsstrahlungAction, and smash::DecayActionDilepton.
Definition at line 308 of file action.cc.
|
protectedvirtual |
|
protected |
Assign the formation time to the outgoing particles.
The formation time is set to the largest formation time of the incoming particles, if it is larger than the execution time. The newly produced particles are supposed to continue forming exactly like the latest forming ingoing particle. Therefore the details on the formation are adopted. The initial cross section scaling factor of the incoming particles is considered to also be the scaling factor of the newly produced outgoing particles. If the formation time is smaller than the exectution time, the execution time is taken to be the formation time.
Note: Make sure to assign the formation times before boosting the outgoing particles to the computational frame.
Definition at line 183 of file action.cc.
|
inlineprivate |
|
inlineprivate |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |