#include <grandcan_thermalizer.h>
The GrandCanThermalizer class implements the following functionality:
The step 3. is a challenging task, so several algorithms are implemented that try to fulfil the requirements. The algorithms are a trade-off between mathematical rigour and computational speed. All of them are shown to reproduce the mean values of multiplicities correctly. However, this is not the case for multiplicity fluctuations. For details see Oliinychenko:2016vkg.
Definition at line 205 of file grandcan_thermalizer.h.
Public Member Functions | |
GrandCanThermalizer (const std::array< double, 3 > lat_sizes, const std::array< int, 3 > n_cells, const std::array< double, 3 > origin, bool periodicity, double e_critical, double t_start, double delta_t, ThermalizationAlgorithm algo) | |
Default constructor for the GranCanThermalizer to allocate the lattice. More... | |
GrandCanThermalizer (Configuration &conf, const std::array< double, 3 > lat_sizes, const std::array< double, 3 > origin, bool periodicity) | |
bool | is_time_to_thermalize (const Clock &clock) const |
Check that the clock is close to n * period of thermalization, since the thermalization only happens at these times. More... | |
void | update_thermalizer_lattice (const Particles &particles, const DensityParameters &par, bool ignore_cells_under_threshold=true) |
Compute all the thermodynamical quantities on the lattice from particles. More... | |
ThreeVector | uniform_in_cell () const |
void | renormalize_momenta (ParticleList &plist, const FourVector required_total_momentum) |
Changes energy and momenta of the particles in plist to match the required_total_momentum. More... | |
void | sample_multinomial (HadronClass particle_class, int N) |
The sample_multinomial function samples integer numbers n_i distributed according to the multinomial distribution with sum N: \( p(n_1, n_2, \dots) = \prod a_i^{n_i} \times \frac{N!}{n_1!n_2! \dots} \) if \( \sum n_i = N \) and \( p = 0 \) otherwise. More... | |
void | sample_in_random_cell_BF_algo (ParticleList &plist, const double time, size_t type_index) |
The total number of particles of species type_index is defined by mult_int_ array that is returned by. More... | |
void | thermalize_BF_algo (QuantumNumbers &conserved_initial, double time, int ntest) |
Samples particles according to the BF algorithm by making use of the. More... | |
template<typename F > | |
void | compute_N_in_cells_mode_algo (F &&condition) |
Computes average number of particles in each cell for the mode algorithm. More... | |
template<typename F > | |
ParticleData | sample_in_random_cell_mode_algo (const double time, F &&condition) |
Samples one particle and the species, cell, momentum and coordinate are chosen from the corresponding distributions. More... | |
void | thermalize_mode_algo (QuantumNumbers &conserved_initial, double time) |
Samples particles to the according to the mode algorithm. More... | |
void | thermalize (const Particles &particles, double time, int ntest) |
Main thermalize function, that chooses the algorithm to follow (BF or mode sampling). More... | |
void | print_statistics (const Clock &clock) const |
Generates standard output with information about the thermodynamic properties of the lattice, the thermalized region and the volume to be thermalized above the critical energy density. More... | |
RectangularLattice< ThermLatticeNode > & | lattice () const |
Getter function for the lattice. More... | |
double | e_crit () const |
Get the critical energy density. More... | |
ParticleList | particles_to_remove () const |
List of particles to be removed from the simulation. More... | |
ParticleList | particles_to_insert () const |
List of newly created particles to be inserted in the simulation. More... | |
Private Member Functions | |
ParticleTypePtrList | list_eos_particles () const |
Extracts the particles in the hadron gas equation of state from the complete list of particle types in SMASH. More... | |
HadronClass | get_class (size_t typelist_index) const |
Defines the class of hadrons by quantum numbers. More... | |
double | mult_class (const HadronClass cl) const |
Private Attributes | |
std::vector< double > | N_in_cells_ |
Number of particles to be sampled in one cell. More... | |
std::vector< size_t > | cells_to_sample_ |
Cells above critical energy density. More... | |
HadronGasEos | eos_ = HadronGasEos(true) |
Hadron gas equation of state. More... | |
std::unique_ptr< RectangularLattice< ThermLatticeNode > > | lat_ |
The lattice on which the thermodynamic quantities are calculated. More... | |
ParticleList | to_remove_ |
Particles to be removed after this thermalization step. More... | |
ParticleList | sampled_list_ |
Newly generated particles by thermalizer. More... | |
const ParticleTypePtrList | eos_typelist_ |
List of particle types from which equation of state is computed. More... | |
const size_t | N_sorts_ |
Number of different species to be sampled. More... | |
std::vector< double > | mult_sort_ |
Real number multiplicity for each particle type. More... | |
std::vector< int > | mult_int_ |
Integer multiplicity for each particle type. More... | |
std::array< double, 7 > | mult_classes_ |
The different hadron species according to the enum defined in. More... | |
double | N_total_in_cells_ |
Total number of particles over all cells in thermalization region. More... | |
double | cell_volume_ |
Volume of a single cell, necessary to convert thermal densities to actual particle numbers. More... | |
const double | e_crit_ |
Critical energy density above which cells are thermalized. More... | |
const double | t_start_ |
Starting time of the simulation. More... | |
const double | period_ |
Defines periodicity of the lattice in fm. More... | |
const ThermalizationAlgorithm | algorithm_ |
Algorithm to choose for sampling of particles obeying conservation laws. More... | |
smash::GrandCanThermalizer::GrandCanThermalizer | ( | const std::array< double, 3 > | lat_sizes, |
const std::array< int, 3 > | n_cells, | ||
const std::array< double, 3 > | origin, | ||
bool | periodicity, | ||
double | e_critical, | ||
double | t_start, | ||
double | delta_t, | ||
ThermalizationAlgorithm | algo | ||
) |
Default constructor for the GranCanThermalizer to allocate the lattice.
[in] | lat_sizes | Size of lattice in x,y and z-direction in fm. |
[in] | n_cells | Number of cells in x, y and z-direction. |
[in] | origin | Coordinates of the left, down, near corner of the lattice in fm. |
[in] | periodicity | Boolean to decide, if the lattice is periodically extended to infinity or not |
[in] | e_critical | Critical energy density above which the cells are thermalized |
[in] | t_start | Starting time of the simulation |
[in] | delta_t | Timestep of the simulation |
[in] | algo | Choice of algorithm for the canonical sampling |
Definition at line 98 of file grandcan_thermalizer.cc.
|
inline |
Definition at line 227 of file grandcan_thermalizer.h.
|
inline |
Check that the clock is close to n * period of thermalization, since the thermalization only happens at these times.
[in] | clock | Current system time |
Definition at line 240 of file grandcan_thermalizer.h.
void smash::GrandCanThermalizer::update_thermalizer_lattice | ( | const Particles & | particles, |
const DensityParameters & | par, | ||
bool | ignore_cells_under_threshold = true |
||
) |
Compute all the thermodynamical quantities on the lattice from particles.
[in] | particles | Current list of particles |
[in] | par | Parameters necessary for density determination |
[in] | ignore_cells_under_threshold | Boolean that is true by default |
Definition at line 120 of file grandcan_thermalizer.cc.
ThreeVector smash::GrandCanThermalizer::uniform_in_cell | ( | ) | const |
Definition at line 141 of file grandcan_thermalizer.cc.
void smash::GrandCanThermalizer::renormalize_momenta | ( | ParticleList & | plist, |
const FourVector | required_total_momentum | ||
) |
Changes energy and momenta of the particles in plist to match the required_total_momentum.
The procedure is described in Oliinychenko:2016vkg.
[in] | plist | List of particles |
[in] | required_total_momentum | The necessary total momentum of the cell |
Definition at line 150 of file grandcan_thermalizer.cc.
void smash::GrandCanThermalizer::sample_multinomial | ( | HadronClass | particle_class, |
int | N | ||
) |
The sample_multinomial function samples integer numbers n_i distributed according to the multinomial distribution with sum N: \( p(n_1, n_2, \dots) = \prod a_i^{n_i} \times \frac{N!}{n_1!n_2! \dots} \) if \( \sum n_i = N \) and \( p = 0 \) otherwise.
[in] | particle_class | A certain group of hadron species |
[out] | N | Number of particles to be sampled |
Definition at line 216 of file grandcan_thermalizer.cc.
void smash::GrandCanThermalizer::sample_in_random_cell_BF_algo | ( | ParticleList & | plist, |
const double | time, | ||
size_t | type_index | ||
) |
The total number of particles of species type_index is defined by mult_int_ array that is returned by.
[out] | plist |
[in] | time | Current time in the simulation to become zero component of sampled particles |
[in] | type_index | Species that should be sampled |
Definition at line 241 of file grandcan_thermalizer.cc.
void smash::GrandCanThermalizer::thermalize_BF_algo | ( | QuantumNumbers & | conserved_initial, |
double | time, | ||
int | ntest | ||
) |
Samples particles according to the BF algorithm by making use of the.
[in] | conserved_initial | The quantum numbers of the total ensemble of of particles in the region to be thermalized |
[in] | time | Current time of the simulation |
[in] | ntest | Number of testparticles |
Definition at line 287 of file grandcan_thermalizer.cc.
|
inline |
Computes average number of particles in each cell for the mode algorithm.
[in] | condition | Specifies the current mode (1 to 7) |
Definition at line 314 of file grandcan_thermalizer.h.
|
inline |
Samples one particle and the species, cell, momentum and coordinate are chosen from the corresponding distributions.
The condition function limits the choice of possible species.
Condition is a function of the signature of quantum number S, B and Q. bool condition(int strangeness, int baryon_number, int charge);
[in] | time | Current time in simulation |
[in] | condition | Specifies the actual mode (1 to 7) |
Definition at line 345 of file grandcan_thermalizer.h.
void smash::GrandCanThermalizer::thermalize_mode_algo | ( | QuantumNumbers & | conserved_initial, |
double | time | ||
) |
Samples particles to the according to the mode algorithm.
Quantum numbers of the sampled particles are required to be as in conserved_initial.
[in] | conserved_initial | Quantum numbers of the original particles in the region to be thermalized |
[in] | time | Current time of the simulation |
Definition at line 391 of file grandcan_thermalizer.cc.
void smash::GrandCanThermalizer::thermalize | ( | const Particles & | particles, |
double | time, | ||
int | ntest | ||
) |
Main thermalize function, that chooses the algorithm to follow (BF or mode sampling).
[out] | particles | List of sampled particles in thermalized region |
[in] | time | Current time of the simulation |
[in] | ntest | number of testparticles |
Definition at line 492 of file grandcan_thermalizer.cc.
void smash::GrandCanThermalizer::print_statistics | ( | const Clock & | clock | ) | const |
Generates standard output with information about the thermodynamic properties of the lattice, the thermalized region and the volume to be thermalized above the critical energy density.
[in] | clock | Current time of the simulation |
Definition at line 557 of file grandcan_thermalizer.cc.
|
inline |
Getter function for the lattice.
Definition at line 417 of file grandcan_thermalizer.h.
|
inline |
Get the critical energy density.
Definition at line 419 of file grandcan_thermalizer.h.
|
inline |
List of particles to be removed from the simulation.
Definition at line 421 of file grandcan_thermalizer.h.
|
inline |
List of newly created particles to be inserted in the simulation.
Definition at line 423 of file grandcan_thermalizer.h.
|
inlineprivate |
Extracts the particles in the hadron gas equation of state from the complete list of particle types in SMASH.
Definition at line 430 of file grandcan_thermalizer.h.
|
inlineprivate |
Defines the class of hadrons by quantum numbers.
[in] | typelist_index | Index for a certain quantum number |
Definition at line 443 of file grandcan_thermalizer.h.
|
inlineprivate |
[out] | cl | Multiplicity of the hadron class |
Definition at line 458 of file grandcan_thermalizer.h.
|
private |
Number of particles to be sampled in one cell.
Definition at line 462 of file grandcan_thermalizer.h.
|
private |
Cells above critical energy density.
Definition at line 464 of file grandcan_thermalizer.h.
|
private |
Hadron gas equation of state.
Definition at line 466 of file grandcan_thermalizer.h.
|
private |
The lattice on which the thermodynamic quantities are calculated.
Definition at line 468 of file grandcan_thermalizer.h.
|
private |
Particles to be removed after this thermalization step.
Definition at line 470 of file grandcan_thermalizer.h.
|
private |
Newly generated particles by thermalizer.
Definition at line 472 of file grandcan_thermalizer.h.
|
private |
List of particle types from which equation of state is computed.
Most particles are included, but not all of them. For example, photons and leptons are not included. Heavy hadrons, that can originate from Pythia, but do not interact in SMASH are not included. The latter are excluded to avoid violations of charm and bottomness conservation, when HadronGasEoS is used for forced thermalization.
Definition at line 481 of file grandcan_thermalizer.h.
|
private |
Number of different species to be sampled.
Definition at line 483 of file grandcan_thermalizer.h.
|
private |
Real number multiplicity for each particle type.
Definition at line 485 of file grandcan_thermalizer.h.
|
private |
Integer multiplicity for each particle type.
Definition at line 487 of file grandcan_thermalizer.h.
|
private |
The different hadron species according to the enum defined in.
Definition at line 492 of file grandcan_thermalizer.h.
|
private |
Total number of particles over all cells in thermalization region.
Definition at line 494 of file grandcan_thermalizer.h.
|
private |
Volume of a single cell, necessary to convert thermal densities to actual particle numbers.
Definition at line 499 of file grandcan_thermalizer.h.
|
private |
Critical energy density above which cells are thermalized.
Definition at line 501 of file grandcan_thermalizer.h.
|
private |
Starting time of the simulation.
Definition at line 503 of file grandcan_thermalizer.h.
|
private |
Defines periodicity of the lattice in fm.
Definition at line 505 of file grandcan_thermalizer.h.
|
private |
Algorithm to choose for sampling of particles obeying conservation laws.
Definition at line 507 of file grandcan_thermalizer.h.