Version: SMASH-3.1
smash::FreeforallAction Class Reference

#include <freeforallaction.h>

Action class to create any incoming/outgoing particle combination freely.

This class is in particular designed to add and remove particles from the evolution. This introduces violations of the conservation laws, but it is needed for a concurrent running of transport and hydrodynamics.

Definition at line 24 of file freeforallaction.h.

Inheritance diagram for smash::FreeforallAction:
smash::Action

Public Member Functions

 FreeforallAction (const ParticleList &in_part, const ParticleList &out_part, double absolute_labframe_time)
 The FreeforallAction is able to add particles by providing an empty particle list for in_part and a list with particles which are supposed to be added to the evolution as out_part . More...
 
double get_total_weight () const override
 Return the total weight value, which is mainly used for the weight output entry. More...
 
double get_partial_weight () const override
 Return the specific weight for the chosen outgoing channel, which is mainly used for the partial weight output entry. More...
 
void generate_final_state () override
 Generate a final state for the FreeforallAction in the sense that the time and position of the particles in the list is scrolled back to the action time. More...
 
void format_debug_output (std::ostream &out) const override
 Function for debug output of incoming and outgoing particles from freeforall action. 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...
 

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...
 
- 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 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_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 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...
 

Constructor & Destructor Documentation

◆ FreeforallAction()

smash::FreeforallAction::FreeforallAction ( const ParticleList &  in_part,
const ParticleList &  out_part,
double  absolute_labframe_time 
)
inline

The FreeforallAction is able to add particles by providing an empty particle list for in_part and a list with particles which are supposed to be added to the evolution as out_part .

If particles should be removed a filled particle list with the corresponding particles should be provided as in_part and an empty list as out_part .

Parameters
[in]in_partList of incoming particles
[in]out_partList of outgoing particles
[in]absolute_labframe_timeAbsolute time at which the action is supposed to take place
Note
This action takes advantage of how the parent class works in order to fake 0 → 1 and 1 → 0 processes. If particles need to be both added and removed one needs to create and perform this action twice. Said differently, the provided lists cannot be non-empty at the same time.

Definition at line 43 of file freeforallaction.h.

45  : Action(in_part, out_part, absolute_labframe_time,
47  if (!in_part.empty() && !out_part.empty()) {
48  throw std::invalid_argument(
49  "The FreeforallAction was used with two non-empty lists. This is not "
50  "allowed. Please use the action twice, if particles should be added "
51  "and removed.");
52  }
53  }
Action(const ParticleList &in_part, double time)
Construct an action object with incoming particles and relative time.
Definition: action.h:44
@ Freeforall
See here for a short description.

Member Function Documentation

◆ get_total_weight()

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

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.

Returns
total cross section, decay width or shining weight

Implements smash::Action.

Definition at line 55 of file freeforallaction.h.

55 { return 0.0; }

◆ get_partial_weight()

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

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.

Returns
specific weight for the chosen output channel.

Implements smash::Action.

Definition at line 56 of file freeforallaction.h.

56 { return 0.0; }

◆ generate_final_state()

void smash::FreeforallAction::generate_final_state ( )
inlineoverridevirtual

Generate a final state for the FreeforallAction in the sense that the time and position of the particles in the list is scrolled back to the action time.

The outgoing particles are set in the constructor.

Implements smash::Action.

Definition at line 63 of file freeforallaction.h.

63  {
64  // Set time for arbitrary outgoing particles to time of action
65  for (auto &particle : outgoing_particles_) {
66  const double t = particle.position().x0();
67  const FourVector u(1.0, particle.velocity());
68  particle.set_formation_time(t);
69  particle.set_4position(particle.position() +
70  u * (time_of_execution() - t));
71  }
72  }
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
Definition: action.h:363
double time_of_execution() const
Get the time at which the action is supposed to be performed.
Definition: action.h:254

◆ format_debug_output()

void smash::FreeforallAction::format_debug_output ( std::ostream &  out) const
inlineoverridevirtual

Function for debug output of incoming and outgoing particles from freeforall action.

Parameters
[in]outLocation of the output stream

Implements smash::Action.

Definition at line 79 of file freeforallaction.h.

79  {
80  out << "Freeforall action of " << incoming_particles_.size() << " to "
81  << outgoing_particles_.size() << " particles.";
82  }
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:355

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