#include <listmodus.h>
ListModus: Provides a modus for running SMASH on an external particle list, for example as an afterburner calculation.
To use this modus, choose Modus: List
in the configuration file.
Options for ListModus go in the "Modi"→"List" section of the configuration:
For configuring see List.
Since SMASH is searching for collisions in computational frame time 't', all particles need to be at the same time. If this is not the case in the list provided, the particles will be propagated backwards on straight lines ("anti-freestreaming"). To avoid unphysical interactions of these particles, the back-propagated particles receive a formation_time and zero cross_section_scaling_factor. The cross-sections are set to zero during the time, where the particle will just propagate on a straight line again to appear at the formation_time into the system.
Definition at line 56 of file listmodus.h.
Classes | |
struct | LoadFailure |
Used when external particle list cannot be found. More... | |
Public Member Functions | |
ListModus (Configuration modus_config, const ExperimentParameters ¶meters) | |
Constructor. More... | |
ListModus () | |
Construct an empty list. Useful for convenient JetScape connection. More... | |
double | initial_conditions (Particles *particles, const ExperimentParameters ¶meters) |
Generates initial state of the particles in the system according to a list. More... | |
void | backpropagate_to_same_time (Particles &particles) |
Judge whether formation times are the same for all the particles; Don't do anti-freestreaming if all particles start already at the same time. More... | |
void | try_create_particle (Particles &particles, PdgCode pdgcode, double t, double x, double y, double z, double mass, double E, double px, double py, double pz) |
Tries to add a new particle to particles and performs consistency checks: (i) The PDG code is legal and exists in SMASH. More... | |
![]() | |
int | impose_boundary_conditions (Particles *, const OutputsList &={}) |
Enforces sensible positions for the particles. More... | |
int | total_N_number () const |
int | proj_N_number () const |
bool | cll_in_nucleus () const |
bool | is_collider () const |
double | impact_parameter () const |
double | velocity_projectile () const |
double | velocity_target () const |
FermiMotion | fermi_motion () const |
double | max_timestep (double) const |
double | length () const |
Grid< GridOptions::Normal > | create_grid (const Particles &particles, double min_cell_length, double timestep_duration, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const |
Creates the Grid with normal boundary conditions. More... | |
Protected Attributes | |
double | start_time_ = 0. |
Starting time for the List; changed to the earliest formation time. More... | |
Private Member Functions | |
bool | file_has_events_ (bf::path filepath, std::streampos last_position) |
Check if the file given by filepath has events left after streampos last_position. More... | |
bf::path | file_path_ (const int file_id) |
Return the absolute file path based on given integer. More... | |
std::string | next_event_ () |
Read the next event. More... | |
Private Attributes | |
std::string | particle_list_file_directory_ |
File directory of the particle list. More... | |
std::string | particle_list_file_prefix_ |
File prefix of the particle list. More... | |
std::string | current_particle_list_file_ |
File name of current file. More... | |
const int | shift_id_ |
shift_id is the start number of file_id_ More... | |
int | event_id_ |
event_id_ = the unique id of the current event More... | |
int | file_id_ |
file_id_ is the id of the current file More... | |
int | n_warns_precision_ = 0 |
Counter for mass-check warnings to avoid spamming. More... | |
int | n_warns_mass_consistency_ = 0 |
Counter for energy-momentum conservation warnings to avoid spamming. More... | |
std::streampos | last_read_position_ |
last read position in current file More... | |
Friends | |
std::ostream & | operator<< (std::ostream &, const ListModus &) |
Writes the initial state for the List to the output stream. More... | |
|
explicit |
Constructor.
Gathers all configuration variables for the List.
[in] | modus_config | The configuration object that sets all initial conditions of the experiment. |
[in] | parameters | Unused, but necessary because of templated initialization |
Definition at line 122 of file listmodus.cc.
|
inline |
Construct an empty list. Useful for convenient JetScape connection.
Definition at line 72 of file listmodus.h.
double smash::ListModus::initial_conditions | ( | Particles * | particles, |
const ExperimentParameters & | parameters | ||
) |
Generates initial state of the particles in the system according to a list.
[out] | particles | An empty list that gets filled up by this function |
[in] | parameters | Unused, but necessary because of templated use of this function |
runtime_error | if an input list file could not be found |
LoadFailure | if an input list file is not correctly formatted |
invalid_argument | if the listed charge of a particle does not correspond to its pdg charge |
Definition at line 231 of file listmodus.cc.
void smash::ListModus::backpropagate_to_same_time | ( | Particles & | particles | ) |
Judge whether formation times are the same for all the particles; Don't do anti-freestreaming if all particles start already at the same time.
If particles are at different times, calculate earliest formation time as start_time_ and free-stream all particles back to this time.
particles | particles to be checked and possibly back-streamed |
Definition at line 141 of file listmodus.cc.
void smash::ListModus::try_create_particle | ( | Particles & | particles, |
PdgCode | pdgcode, | ||
double | t, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double | mass, | ||
double | E, | ||
double | px, | ||
double | py, | ||
double | pz | ||
) |
Tries to add a new particle to particles and performs consistency checks: (i) The PDG code is legal and exists in SMASH.
If not, a warning is printed and the particle is ignored. (ii) The mass matches the pole mass of pdgcode
in SMASH. If it does not, then a warning is printed, the pole mass of the particle is set equal to the corresponding mass from SMASH particle table and it's energy is recomputed as \( E^2 = p^2 + m^2 \). (iii) Any stable particle is on-shell, i.e. \( E^2 - p^2 = m^2 \). If it is not, then a warning is printed and the energy is set to \( E^2 = p^2 + m^2 \). This very tolerant behaviour is justified by the practical usage of SMASH as afterburner. Usually particles unknown to SMASH are rare resonances, which do not play a large role. Mass mismatch is typically less than 1% and comes from rounding and from SMASH enforcing isospin symmetry (for example the mass of neutral pion is artificially forced to be the same as charged pion). On-shellness violation typically comes from the insufficient number of significant digits in the input file + rounding.
[in] | pdgcode | pdg code of added particle |
[in] | pdgcode | pdg code of added particle |
[in] | t | time of added particle |
[in] | x | x-coordinate of added particle |
[in] | y | y-coordinate of added particle |
[in] | z | z-coordinate of added particle |
[in] | mass | mass of added particle |
[in] | E | energy of added particle |
[in] | px | x-component of momentum of added particle |
[in] | py | y-component of momentum of added particle |
[in] | pz | z-component of momentum of added particle |
[out] | particles | structure, to which the particle is added |
Definition at line 178 of file listmodus.cc.
|
private |
Check if the file given by filepath has events left after streampos last_position.
[in] | filepath | Path to file to be checked. |
[in] | last_position | Streamposition in file after which check is performed |
runtime_error | If file could not be read for whatever reason. |
Definition at line 333 of file listmodus.cc.
|
private |
Return the absolute file path based on given integer.
The filename is assumed to have the form (particle_list_prefix)_(file_id)
[in] | file_id | integer of wanted file |
runtime_error | if file does not exist. |
Definition at line 266 of file listmodus.cc.
|
private |
Read the next event.
Either from the current file if it has more events or from the next file (with file_id += 1)
runtime_error | If file could not be read for whatever reason. |
Definition at line 293 of file listmodus.cc.
|
protected |
Starting time for the List; changed to the earliest formation time.
Definition at line 145 of file listmodus.h.
|
private |
File directory of the particle list.
Definition at line 149 of file listmodus.h.
|
private |
File prefix of the particle list.
Definition at line 152 of file listmodus.h.
|
private |
File name of current file.
Definition at line 155 of file listmodus.h.
|
private |
shift_id is the start number of file_id_
Definition at line 158 of file listmodus.h.
|
private |
event_id_ = the unique id of the current event
Definition at line 161 of file listmodus.h.
|
private |
file_id_ is the id of the current file
Definition at line 164 of file listmodus.h.
|
private |
Counter for mass-check warnings to avoid spamming.
Definition at line 167 of file listmodus.h.
|
private |
Counter for energy-momentum conservation warnings to avoid spamming.
Definition at line 169 of file listmodus.h.
|
private |
last read position in current file
Definition at line 183 of file listmodus.h.