Version: SMASH-1.5
smash::GrandCanThermalizer Class Reference

#include <grandcan_thermalizer.h>

The GrandCanThermalizer class implements the following functionality:

  1. Create a lattice and find the local rest frame energy density in each cell from the particles.
  2. Remove particles from the cells, where the energy density is high enough. Save the energy, momentum and quantum numbers of the removed particles.
  3. Sample new particles instead of the removed ones according to the grand-canonical thermal distribution, but with an additional constraint: the energy, momentum and quantum numbers should be the same as those of the removed particles.

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.

Collaboration diagram for smash::GrandCanThermalizer:
[legend]

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

Constructor & Destructor Documentation

◆ GrandCanThermalizer() [1/2]

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.

Parameters
[in]lat_sizesSize of lattice in x,y and z-direction in fm.
[in]n_cellsNumber of cells in x, y and z-direction.
[in]originCoordinates of the left, down, near corner of the lattice in fm.
[in]periodicityBoolean to decide, if the lattice is periodically extended to infinity or not
[in]e_criticalCritical energy density above which the cells are thermalized
[in]t_startStarting time of the simulation
[in]delta_tTimestep of the simulation
[in]algoChoice of algorithm for the canonical sampling

Definition at line 98 of file grandcan_thermalizer.cc.

105  N_sorts_(eos_typelist_.size()),
106  e_crit_(e_critical),
107  t_start_(t_start),
108  period_(delta_t),
109  algorithm_(algo) {
111  lat_ = make_unique<RectangularLattice<ThermLatticeNode>>(
112  lat_sizes, n_cells, origin, periodicity, upd);
113  const std::array<double, 3> abc = lat_->cell_sizes();
114  cell_volume_ = abc[0] * abc[1] * abc[2];
115  cells_to_sample_.resize(50000);
116  mult_sort_.resize(N_sorts_);
117  mult_int_.resize(N_sorts_);
118 }
const double e_crit_
Critical energy density above which cells are thermalized.
const size_t N_sorts_
Number of different species to be sampled.
ParticleTypePtrList list_eos_particles() const
Extracts the particles in the hadron gas equation of state from the complete list of particle types i...
const double period_
Defines periodicity of the lattice in fm.
LatticeUpdate
Enumerator option for lattice updates.
Definition: lattice.h:35
const ThermalizationAlgorithm algorithm_
Algorithm to choose for sampling of particles obeying conservation laws.
std::vector< size_t > cells_to_sample_
Cells above critical energy density.
std::vector< double > mult_sort_
Real number multiplicity for each particle type.
std::vector< int > mult_int_
Integer multiplicity for each particle type.
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
double cell_volume_
Volume of a single cell, necessary to convert thermal densities to actual particle numbers...
const ParticleTypePtrList eos_typelist_
List of particle types from which equation of state is computed.
const double t_start_
Starting time of the simulation.

◆ GrandCanThermalizer() [2/2]

smash::GrandCanThermalizer::GrandCanThermalizer ( Configuration conf,
const std::array< double, 3 >  lat_sizes,
const std::array< double, 3 >  origin,
bool  periodicity 
)
inline
See also
GrandCanThermalizer Exactly the same but taking values from config

Definition at line 227 of file grandcan_thermalizer.h.

231  lat_sizes, conf.take({"Cell_Number"}), origin, periodicity,
232  conf.take({"Critical_Edens"}), conf.take({"Start_Time"}),
233  conf.take({"Timestep"}),
234  conf.take({"Algorithm"}, ThermalizationAlgorithm::BiasedBF)) {}
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.

Member Function Documentation

◆ is_time_to_thermalize()

bool smash::GrandCanThermalizer::is_time_to_thermalize ( const Clock clock) const
inline

Check that the clock is close to n * period of thermalization, since the thermalization only happens at these times.

Parameters
[in]clockCurrent system time

Definition at line 240 of file grandcan_thermalizer.h.

240  {
241  const double t = clock.current_time();
242  const int n = static_cast<int>(std::floor((t - t_start_) / period_));
243  return (t > t_start_ &&
244  t < t_start_ + n * period_ + clock.timestep_duration());
245  }
const double period_
Defines periodicity of the lattice in fm.
constexpr int n
Neutron.
const double t_start_
Starting time of the simulation.
Here is the call graph for this function:

◆ update_thermalizer_lattice()

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.

Parameters
[in]particlesCurrent list of particles
See also
Particles
Parameters
[in]parParameters necessary for density determination
See also
DensityParameters
Parameters
[in]ignore_cells_under_thresholdBoolean that is true by default

Definition at line 120 of file grandcan_thermalizer.cc.

122  {
123  const DensityType dens_type = DensityType::Hadron;
125  update_lattice(lat_.get(), update, dens_type, dens_par, particles);
126  for (auto &node : *lat_) {
127  /* If energy density is definitely below e_crit -
128  no need to find T, mu, etc. So if e = T00 - T0i*vi <=
129  T00 + sum abs(T0i) < e_crit, no efforts are necessary. */
130  if (!ignore_cells_under_treshold ||
131  node.Tmu0().x0() + std::abs(node.Tmu0().x1()) +
132  std::abs(node.Tmu0().x2()) + std::abs(node.Tmu0().x3()) >=
133  e_crit_) {
134  node.compute_rest_frame_quantities(eos_);
135  } else {
136  node = ThermLatticeNode();
137  }
138  }
139 }
const double e_crit_
Critical energy density above which cells are thermalized.
void update_lattice(RectangularLattice< T > *lat, const LatticeUpdate update, const DensityType dens_type, const DensityParameters &par, const Particles &particles, const bool compute_gradient=false)
Updates the contents on the lattice.
Definition: density.h:386
LatticeUpdate
Enumerator option for lattice updates.
Definition: lattice.h:35
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
DensityType
Allows to choose which kind of density to calculate.
Definition: density.h:34
HadronGasEos eos_
Hadron gas equation of state.
Here is the call graph for this function:

◆ uniform_in_cell()

ThreeVector smash::GrandCanThermalizer::uniform_in_cell ( ) const
Returns
3 vector uniformly sampled from the rectangular cell.

Definition at line 141 of file grandcan_thermalizer.cc.

141  {
142  return ThreeVector(random::uniform(-0.5 * lat_->cell_sizes()[0],
143  +0.5 * lat_->cell_sizes()[0]),
144  random::uniform(-0.5 * lat_->cell_sizes()[1],
145  +0.5 * lat_->cell_sizes()[1]),
146  random::uniform(-0.5 * lat_->cell_sizes()[2],
147  +0.5 * lat_->cell_sizes()[2]));
148 }
T uniform(T min, T max)
Definition: random.h:85
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renormalize_momenta()

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.

Parameters
[in]plistList of particles
See also
ParticleList
Parameters
[in]required_total_momentumThe necessary total momentum of the cell

Definition at line 150 of file grandcan_thermalizer.cc.

151  {
152  const auto &log = logger<LogArea::GrandcanThermalizer>();
153 
154  // Centralize momenta
155  QuantumNumbers conserved = QuantumNumbers(plist);
156  log.info("Required 4-momentum: ", required_total_momentum);
157  log.info("Sampled 4-momentum: ", conserved.momentum());
158  const ThreeVector mom_to_add =
159  (required_total_momentum.threevec() - conserved.momentum().threevec()) /
160  plist.size();
161  log.info("Adjusting momenta by ", mom_to_add);
162  for (auto &particle : plist) {
163  particle.set_4momentum(particle.type().mass(),
164  particle.momentum().threevec() + mom_to_add);
165  }
166 
167  // Boost every particle to the common center of mass frame
168  conserved = QuantumNumbers(plist);
169  const ThreeVector beta_CM_generated = conserved.momentum().velocity();
170  const ThreeVector beta_CM_required = required_total_momentum.velocity();
171 
172  double E = 0.0;
173  double E_expected = required_total_momentum.abs();
174  for (auto &particle : plist) {
175  particle.boost_momentum(beta_CM_generated);
176  E += particle.momentum().x0();
177  }
178  // Renorm. momenta by factor (1+a) to get the right energy, binary search
179  const double tolerance = really_small;
180  double a, a_min, a_max, er;
181  const int max_iter = 50;
182  int iter = 0;
183  if (E_expected >= E) {
184  a_min = 0.0;
185  a_max = 1.0;
186  } else {
187  a_min = -1.0;
188  a_max = 0.0;
189  }
190  do {
191  a = 0.5 * (a_min + a_max);
192  E = 0.0;
193  for (const auto &particle : plist) {
194  const double p2 = particle.momentum().threevec().sqr();
195  const double E2 = particle.momentum().x0() * particle.momentum().x0();
196  E += std::sqrt(E2 + a * (a + 2.0) * p2);
197  }
198  er = E - E_expected;
199  if (er >= 0.0) {
200  a_max = a;
201  } else {
202  a_min = a;
203  }
204  log.debug("Iteration ", iter, ": a = ", a, ", Δ = ", er);
205  iter++;
206  } while (std::abs(er) > tolerance && iter < max_iter);
207 
208  log.info("Renormalizing momenta by factor 1+a, a = ", a);
209  for (auto &particle : plist) {
210  particle.set_4momentum(particle.type().mass(),
211  (1 + a) * particle.momentum().threevec());
212  particle.boost_momentum(-beta_CM_required);
213  }
214 }
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:34
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_multinomial()

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.

Parameters
[in]particle_classA certain group of hadron species
See also
HadronClass
Parameters
[out]NNumber of particles to be sampled
Todo:
(oliiny) what to do with this output?

Definition at line 216 of file grandcan_thermalizer.cc.

217  {
218  /* The array mult_sort_ contains real numbers \f$ a_i \f$. The numbers \f$
219  * n_i \f$ are saved in the mult_int_ array. Only particles of class
220  * particle_class are sampled, where particle_class is defined by the
221  * get_class function. */
222  double sum = mult_class(particle_class);
223  for (size_t i_type = 0; (i_type < N_sorts_) && (N_to_sample > 0); i_type++) {
224  if (get_class(i_type) != particle_class) {
225  continue;
226  }
227  const double p = mult_sort_[i_type] / sum;
228  mult_int_[i_type] = random::binomial(N_to_sample, p);
230  /*std::cout << eos_typelist_[i_type]->name() <<
231  ": mult_sort = " << mult_sort_[i_type] <<
232  ", sum = " << sum <<
233  ", p = " << p <<
234  ", N to sample = " << N_to_sample <<
235  ", mult_int_ = " << mult_int_[i_type] << std::endl;*/
236  sum -= mult_sort_[i_type];
237  N_to_sample -= mult_int_[i_type];
238  }
239 }
HadronClass get_class(size_t typelist_index) const
Defines the class of hadrons by quantum numbers.
std::vector< double > mult_sort_
Real number multiplicity for each particle type.
int binomial(const int N, const T &p)
Returns a binomially distributed random number.
Definition: random.h:235
constexpr int p
Proton.
std::vector< int > mult_int_
Integer multiplicity for each particle type.
double mult_class(const HadronClass cl) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_in_random_cell_BF_algo()

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.

See also
sample_multinomial. This function samples mult_int_[type_index] particles. It chooses randomly the cell to sample and picks up momentum and coordinate from the corresponding distributions.
Parameters
[out]plist
See also
ParticleList of newly produced particles
Parameters
[in]timeCurrent time in the simulation to become zero component of sampled particles
[in]type_indexSpecies that should be sampled

Definition at line 241 of file grandcan_thermalizer.cc.

243  {
244  N_in_cells_.clear();
245  N_total_in_cells_ = 0.0;
246  for (auto cell_index : cells_to_sample_) {
247  const ThermLatticeNode cell = (*lat_)[cell_index];
248  const double gamma = 1.0 / std::sqrt(1.0 - cell.v().sqr());
249  const double N_this_cell =
250  cell_volume_ * gamma *
251  HadronGasEos::partial_density(*eos_typelist_[type_index], cell.T(),
252  cell.mub(), cell.mus());
253  N_in_cells_.push_back(N_this_cell);
254  N_total_in_cells_ += N_this_cell;
255  }
256 
257  for (int i = 0; i < mult_int_[type_index]; i++) {
258  // Choose random cell, probability = N_in_cell/N_total
259  double r = random::uniform(0.0, N_total_in_cells_);
260  double partial_sum = 0.0;
261  int index_only_thermalized = -1;
262  while (partial_sum < r) {
263  index_only_thermalized++;
264  partial_sum += N_in_cells_[index_only_thermalized];
265  }
266  const int cell_index = cells_to_sample_[index_only_thermalized];
267  const ThermLatticeNode cell = (*lat_)[cell_index];
268  const ThreeVector cell_center = lat_->cell_center(cell_index);
269 
270  ParticleData particle(*eos_typelist_[type_index]);
271  // Note: it's pole mass for resonances!
272  const double m = eos_typelist_[type_index]->mass();
273  // Position
274  particle.set_4position(FourVector(time, cell_center + uniform_in_cell()));
275  // Momentum
276  double momentum_radial = sample_momenta_from_thermal(cell.T(), m);
277  Angles phitheta;
278  phitheta.distribute_isotropically();
279  particle.set_4momentum(m, phitheta.threevec() * momentum_radial);
280  particle.boost_momentum(-cell.v());
281  particle.set_formation_time(time);
282 
283  plist.push_back(particle);
284  }
285 }
double sample_momenta_from_thermal(const double temperature, const double mass)
Samples a momentum from the Maxwell-Boltzmann (thermal) distribution in a faster way, given by Scott Pratt.
std::vector< size_t > cells_to_sample_
Cells above critical energy density.
T uniform(T min, T max)
Definition: random.h:85
double N_total_in_cells_
Total number of particles over all cells in thermalization region.
std::vector< double > N_in_cells_
Number of particles to be sampled in one cell.
ThreeVector uniform_in_cell() const
static double partial_density(const ParticleType &ptype, double T, double mub, double mus)
Compute partial density of one hadron sort.
Definition: hadgas_eos.cc:219
std::vector< int > mult_int_
Integer multiplicity for each particle type.
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
double cell_volume_
Volume of a single cell, necessary to convert thermal densities to actual particle numbers...
const ParticleTypePtrList eos_typelist_
List of particle types from which equation of state is computed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ thermalize_BF_algo()

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.

See also
sample_in_random_cell_BF_algo. Quantum numbers of the sampled particles are required to be equal to the original particles in this region.
Parameters
[in]conserved_initialThe quantum numbers of the total ensemble of of particles in the region to be thermalized
[in]timeCurrent time of the simulation
[in]ntestNumber of testparticles
Returns
Particle list with newly sampled particles according to Becattini-Feroni algorithm

Definition at line 287 of file grandcan_thermalizer.cc.

288  {
289  const auto &log = logger<LogArea::GrandcanThermalizer>();
290 
291  std::fill(mult_sort_.begin(), mult_sort_.end(), 0.0);
292  for (auto cell_index : cells_to_sample_) {
293  const ThermLatticeNode cell = (*lat_)[cell_index];
294  const double gamma = 1.0 / std::sqrt(1.0 - cell.v().sqr());
295  for (size_t i = 0; i < N_sorts_; i++) {
296  // N_i = n u^mu dsigma_mu = (isochronous hypersurface) n * V * gamma
297  mult_sort_[i] += cell_volume_ * gamma * ntest *
299  *eos_typelist_[i], cell.T(), cell.mub(), cell.mus());
300  }
301  }
302 
303  std::fill(mult_classes_.begin(), mult_classes_.end(), 0.0);
304  for (size_t i = 0; i < N_sorts_; i++) {
305  mult_classes_[static_cast<size_t>(get_class(i))] += mult_sort_[i];
306  }
307 
308  random::BesselSampler bessel_sampler_B(mult_class(HadronClass::Baryon),
310  conserved_initial.baryon_number());
311 
312  while (true) {
313  sampled_list_.clear();
314  std::fill(mult_int_.begin(), mult_int_.end(), 0);
315  const auto Nbar_antibar = bessel_sampler_B.sample();
316 
317  sample_multinomial(HadronClass::Baryon, Nbar_antibar.first);
318  sample_multinomial(HadronClass::Antibaryon, Nbar_antibar.second);
319 
320  // Count strangeness of the sampled particles
321  int S_sampled = 0;
322  for (size_t i = 0; i < N_sorts_; i++) {
323  S_sampled += eos_typelist_[i]->strangeness() * mult_int_[i];
324  }
325 
326  std::pair<int, int> NS_antiS;
328  random::BesselSampler bessel_sampler_S(
331  conserved_initial.strangeness() - S_sampled);
332  NS_antiS = bessel_sampler_S.sample();
334  NS_antiS = std::make_pair(
337  if (NS_antiS.first - NS_antiS.second !=
338  conserved_initial.strangeness() - S_sampled) {
339  continue;
340  }
341  }
342 
345  // Count charge of the sampled particles
346  int ch_sampled = 0;
347  for (size_t i = 0; i < N_sorts_; i++) {
348  ch_sampled += eos_typelist_[i]->charge() * mult_int_[i];
349  }
350 
351  std::pair<int, int> NC_antiC;
353  random::BesselSampler bessel_sampler_C(
356  conserved_initial.charge() - ch_sampled);
357  NC_antiC = bessel_sampler_C.sample();
359  NC_antiC = std::make_pair(
362  if (NC_antiC.first - NC_antiC.second !=
363  conserved_initial.charge() - ch_sampled) {
364  continue;
365  }
366  }
367 
373 
374  for (size_t itype = 0; itype < N_sorts_; itype++) {
376  }
377  double e_tot;
378  const double e_init = conserved_initial.momentum().x0();
379  e_tot = 0.0;
380  for (auto &particle : sampled_list_) {
381  e_tot += particle.momentum().x0();
382  }
383  if (std::abs(e_tot - e_init) > 0.01 * e_init) {
384  log.debug("Rejecting: energy ", e_tot, " too far from e_init = ", e_init);
385  continue;
386  }
387  break;
388  }
389 }
const size_t N_sorts_
Number of different species to be sampled.
void sample_multinomial(HadronClass particle_class, int N)
The sample_multinomial function samples integer numbers n_i distributed according to the multinomial ...
const ThermalizationAlgorithm algorithm_
Algorithm to choose for sampling of particles obeying conservation laws.
HadronClass get_class(size_t typelist_index) const
Defines the class of hadrons by quantum numbers.
ParticleList sampled_list_
Newly generated particles by thermalizer.
Non-strange mesons (S = 0) with electric cherge Q < 0.
std::vector< size_t > cells_to_sample_
Cells above critical energy density.
Mesons with strangeness S < 0.
Neutral non-strange mesons.
Non-strange mesons (S = 0) with electric cherge Q > 0.
std::vector< double > mult_sort_
Real number multiplicity for each particle type.
Mesons with strangeness S > 0.
static double partial_density(const ParticleType &ptype, double T, double mub, double mus)
Compute partial density of one hadron sort.
Definition: hadgas_eos.cc:219
std::vector< int > mult_int_
Integer multiplicity for each particle type.
int poisson(const T &lam)
Returns a Poisson distributed random number.
Definition: random.h:223
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...
std::array< double, 7 > mult_classes_
The different hadron species according to the enum defined in.
double cell_volume_
Volume of a single cell, necessary to convert thermal densities to actual particle numbers...
const ParticleTypePtrList eos_typelist_
List of particle types from which equation of state is computed.
double mult_class(const HadronClass cl) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_N_in_cells_mode_algo()

template<typename F >
void smash::GrandCanThermalizer::compute_N_in_cells_mode_algo ( F &&  condition)
inline

Computes average number of particles in each cell for the mode algorithm.

Parameters
[in]conditionSpecifies the current mode (1 to 7)

Definition at line 314 of file grandcan_thermalizer.h.

314  {
315  N_in_cells_.clear();
316  N_total_in_cells_ = 0.0;
317  for (auto cell_index : cells_to_sample_) {
318  const ThermLatticeNode cell = (*lat_)[cell_index];
319  const double gamma = 1.0 / std::sqrt(1.0 - cell.v().sqr());
320  double N_tot = 0.0;
321  for (ParticleTypePtr i : eos_typelist_) {
322  if (condition(i->strangeness(), i->baryon_number(), i->charge())) {
323  // N_i = n u^mu dsigma_mu = (isochronous hypersurface) n * V * gamma
324  N_tot += cell_volume_ * gamma *
325  HadronGasEos::partial_density(*i, cell.T(), cell.mub(),
326  cell.mus());
327  }
328  }
329  N_in_cells_.push_back(N_tot);
330  N_total_in_cells_ += N_tot;
331  }
332  }
std::vector< size_t > cells_to_sample_
Cells above critical energy density.
double N_total_in_cells_
Total number of particles over all cells in thermalization region.
std::vector< double > N_in_cells_
Number of particles to be sampled in one cell.
static double partial_density(const ParticleType &ptype, double T, double mub, double mus)
Compute partial density of one hadron sort.
Definition: hadgas_eos.cc:219
double cell_volume_
Volume of a single cell, necessary to convert thermal densities to actual particle numbers...
const ParticleTypePtrList eos_typelist_
List of particle types from which equation of state is computed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_in_random_cell_mode_algo()

template<typename F >
ParticleData smash::GrandCanThermalizer::sample_in_random_cell_mode_algo ( const double  time,
F &&  condition 
)
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);

Parameters
[in]timeCurrent time in simulation
[in]conditionSpecifies the actual mode (1 to 7)

Definition at line 345 of file grandcan_thermalizer.h.

346  {
347  // Choose random cell, probability = N_in_cell/N_total
348  double r = random::uniform(0.0, N_total_in_cells_);
349  double partial_sum = 0.0;
350  int index_only_thermalized = -1;
351  while (partial_sum < r) {
352  index_only_thermalized++;
353  partial_sum += N_in_cells_[index_only_thermalized];
354  }
355  const int cell_index = cells_to_sample_[index_only_thermalized];
356  const ThermLatticeNode cell = (*lat_)[cell_index];
357  const ThreeVector cell_center = lat_->cell_center(cell_index);
358  const double gamma = 1.0 / std::sqrt(1.0 - cell.v().sqr());
359  const double N_in_cell = N_in_cells_[index_only_thermalized];
360  // Which sort to sample - probability N_i/N_tot
361  r = random::uniform(0.0, N_in_cell);
362  double N_sum = 0.0;
363  ParticleTypePtr type_to_sample;
364  for (ParticleTypePtr i : eos_typelist_) {
365  if (!condition(i->strangeness(), i->baryon_number(), i->charge())) {
366  continue;
367  }
368  N_sum +=
369  cell_volume_ * gamma *
370  HadronGasEos::partial_density(*i, cell.T(), cell.mub(), cell.mus());
371  if (N_sum >= r) {
372  type_to_sample = i;
373  break;
374  }
375  }
376  ParticleData particle(*type_to_sample);
377  // Note: it's pole mass for resonances!
378  const double m = type_to_sample->mass();
379  // Position
380  particle.set_4position(FourVector(time, cell_center + uniform_in_cell()));
381  // Momentum
382  double momentum_radial = sample_momenta_from_thermal(cell.T(), m);
383  Angles phitheta;
384  phitheta.distribute_isotropically();
385  particle.set_4momentum(m, phitheta.threevec() * momentum_radial);
386  particle.boost_momentum(-cell.v());
387  particle.set_formation_time(time);
388  return particle;
389  }
double sample_momenta_from_thermal(const double temperature, const double mass)
Samples a momentum from the Maxwell-Boltzmann (thermal) distribution in a faster way, given by Scott Pratt.
std::vector< size_t > cells_to_sample_
Cells above critical energy density.
T uniform(T min, T max)
Definition: random.h:85
double N_total_in_cells_
Total number of particles over all cells in thermalization region.
std::vector< double > N_in_cells_
Number of particles to be sampled in one cell.
ThreeVector uniform_in_cell() const
static double partial_density(const ParticleType &ptype, double T, double mub, double mus)
Compute partial density of one hadron sort.
Definition: hadgas_eos.cc:219
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
double cell_volume_
Volume of a single cell, necessary to convert thermal densities to actual particle numbers...
const ParticleTypePtrList eos_typelist_
List of particle types from which equation of state is computed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ thermalize_mode_algo()

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.

Parameters
[in]conserved_initialQuantum numbers of the original particles in the region to be thermalized
[in]timeCurrent time of the simulation

Definition at line 391 of file grandcan_thermalizer.cc.

392  {
393  double energy = 0.0;
394  int S_plus = 0, S_minus = 0, B_plus = 0, B_minus = 0, E_plus = 0, E_minus = 0;
395  // Mode 1: sample until energy is conserved, take only strangeness < 0
396  auto condition1 = [](int, int, int) { return true; };
397  compute_N_in_cells_mode_algo(condition1);
398  while (conserved_initial.momentum().x0() > energy ||
399  S_plus < conserved_initial.strangeness()) {
400  ParticleData p = sample_in_random_cell_mode_algo(time, condition1);
401  energy += p.momentum().x0();
402  if (p.pdgcode().strangeness() > 0) {
403  sampled_list_.push_back(p);
404  S_plus += p.pdgcode().strangeness();
405  }
406  }
407 
408  // Mode 2: sample until strangeness is conserved
409  auto condition2 = [](int S, int, int) { return (S < 0); };
410  compute_N_in_cells_mode_algo(condition2);
411  while (S_plus + S_minus > conserved_initial.strangeness()) {
412  ParticleData p = sample_in_random_cell_mode_algo(time, condition2);
413  const int s_part = p.pdgcode().strangeness();
414  // Do not allow particles with S = -2 or -3 spoil the total sum
415  if (S_plus + S_minus + s_part >= conserved_initial.strangeness()) {
416  sampled_list_.push_back(p);
417  S_minus += s_part;
418  }
419  }
420 
421  // Mode 3: sample non-strange baryons
422  auto condition3 = [](int S, int, int) { return (S == 0); };
423  QuantumNumbers conserved_remaining =
424  conserved_initial - QuantumNumbers(sampled_list_);
425  energy = 0.0;
426  compute_N_in_cells_mode_algo(condition3);
427  while (conserved_remaining.momentum().x0() > energy ||
428  B_plus < conserved_remaining.baryon_number()) {
429  ParticleData p = sample_in_random_cell_mode_algo(time, condition3);
430  energy += p.momentum().x0();
431  if (p.pdgcode().baryon_number() > 0) {
432  sampled_list_.push_back(p);
433  B_plus += p.pdgcode().baryon_number();
434  }
435  }
436 
437  // Mode 4: sample non-strange anti-baryons
438  auto condition4 = [](int S, int B, int) { return (S == 0) && (B < 0); };
439  compute_N_in_cells_mode_algo(condition4);
440  while (B_plus + B_minus > conserved_remaining.baryon_number()) {
441  ParticleData p = sample_in_random_cell_mode_algo(time, condition4);
442  const int bar = p.pdgcode().baryon_number();
443  if (B_plus + B_minus + bar >= conserved_remaining.baryon_number()) {
444  sampled_list_.push_back(p);
445  B_minus += bar;
446  }
447  }
448 
449  // Mode 5: sample non_strange mesons, but take only with charge > 0
450  auto condition5 = [](int S, int B, int) { return (S == 0) && (B == 0); };
451  conserved_remaining = conserved_initial - QuantumNumbers(sampled_list_);
452  energy = 0.0;
453  compute_N_in_cells_mode_algo(condition5);
454  while (conserved_remaining.momentum().x0() > energy ||
455  E_plus < conserved_remaining.charge()) {
456  ParticleData p = sample_in_random_cell_mode_algo(time, condition5);
457  energy += p.momentum().x0();
458  if (p.pdgcode().charge() > 0) {
459  sampled_list_.push_back(p);
460  E_plus += p.pdgcode().charge();
461  }
462  }
463 
464  // Mode 6: sample non_strange mesons to conserve charge
465  auto condition6 = [](int S, int B, int C) {
466  return (S == 0) && (B == 0) && (C < 0);
467  };
468  compute_N_in_cells_mode_algo(condition6);
469  while (E_plus + E_minus > conserved_remaining.charge()) {
470  ParticleData p = sample_in_random_cell_mode_algo(time, condition6);
471  const int charge = p.pdgcode().charge();
472  if (E_plus + E_minus + charge >= conserved_remaining.charge()) {
473  sampled_list_.push_back(p);
474  E_minus += charge;
475  }
476  }
477 
478  // Mode 7: sample neutral non-strange mesons to conserve energy
479  auto condition7 = [](int S, int B, int C) {
480  return (S == 0) && (B == 0) && (C == 0);
481  };
482  conserved_remaining = conserved_initial - QuantumNumbers(sampled_list_);
483  energy = 0.0;
484  compute_N_in_cells_mode_algo(condition7);
485  while (conserved_remaining.momentum().x0() > energy) {
486  ParticleData p = sample_in_random_cell_mode_algo(time, condition7);
487  sampled_list_.push_back(p);
488  energy += p.momentum().x0();
489  }
490 }
ParticleList sampled_list_
Newly generated particles by thermalizer.
void compute_N_in_cells_mode_algo(F &&condition)
Computes average number of particles in each cell for the mode algorithm.
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...
constexpr int p
Proton.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ thermalize()

void smash::GrandCanThermalizer::thermalize ( const Particles particles,
double  time,
int  ntest 
)

Main thermalize function, that chooses the algorithm to follow (BF or mode sampling).

Parameters
[out]particlesList of sampled particles in thermalized region
[in]timeCurrent time of the simulation
[in]ntestnumber of testparticles

Definition at line 492 of file grandcan_thermalizer.cc.

493  {
494  const auto &log = logger<LogArea::GrandcanThermalizer>();
495  log.info("Starting forced thermalization, time ", time, " fm/c");
496  to_remove_.clear();
497  sampled_list_.clear();
498  /* Remove particles from the cells with e > e_crit_,
499  * sum up their conserved quantities */
500  QuantumNumbers conserved_initial = QuantumNumbers();
501  ThermLatticeNode node;
502  for (auto &particle : particles) {
503  const bool is_on_lattice =
504  lat_->value_at(particle.position().threevec(), node);
505  if (is_on_lattice && node.e() > e_crit_) {
506  to_remove_.push_back(particle);
507  }
508  }
509  /* Do not thermalize too small number of particles: for the number
510  * of particles < 30 the algorithm tends to hang or crash too often. */
511  if (to_remove_.size() > 30) {
512  for (auto &particle : to_remove_) {
513  conserved_initial.add_values(particle);
514  }
515  } else {
516  to_remove_.clear();
517  conserved_initial = QuantumNumbers();
518  }
519  log.info("Removed ", to_remove_.size(), " particles.");
520 
521  // Exit if there is nothing to thermalize
522  if (conserved_initial == QuantumNumbers()) {
523  return;
524  }
525  // Save the indices of cells inside the volume with e > e_crit_
526  cells_to_sample_.clear();
527  const size_t lattice_total_cells = lat_->size();
528  for (size_t i = 0; i < lattice_total_cells; i++) {
529  if ((*lat_)[i].e() > e_crit_) {
530  cells_to_sample_.push_back(i);
531  }
532  }
533  log.info("Number of cells in the thermalization region = ",
534  cells_to_sample_.size(), ", its total volume [fm^3]: ",
535  cells_to_sample_.size() * cell_volume_, ", in % of lattice: ",
536  100.0 * cells_to_sample_.size() / lattice_total_cells);
537 
538  switch (algorithm_) {
541  thermalize_BF_algo(conserved_initial, time, ntest);
542  break;
544  thermalize_mode_algo(conserved_initial, time);
545  break;
546  default:
547  throw std::invalid_argument(
548  "This thermalization algorithm is"
549  " not yet implemented");
550  }
551  log.info("Sampled ", sampled_list_.size(), " particles.");
552 
553  // Adjust momenta
554  renormalize_momenta(sampled_list_, conserved_initial.momentum());
555 }
const double e_crit_
Critical energy density above which cells are thermalized.
void thermalize_BF_algo(QuantumNumbers &conserved_initial, double time, int ntest)
Samples particles according to the BF algorithm by making use of the.
const ThermalizationAlgorithm algorithm_
Algorithm to choose for sampling of particles obeying conservation laws.
ParticleList sampled_list_
Newly generated particles by thermalizer.
std::vector< size_t > cells_to_sample_
Cells above critical energy density.
void thermalize_mode_algo(QuantumNumbers &conserved_initial, double time)
Samples particles to the according to the mode algorithm.
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.
ParticleList to_remove_
Particles to be removed after this thermalization step.
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
double cell_volume_
Volume of a single cell, necessary to convert thermal densities to actual particle numbers...
Here is the call graph for this function:

◆ print_statistics()

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.

Parameters
[in]clockCurrent time of the simulation

Definition at line 557 of file grandcan_thermalizer.cc.

557  {
558  struct to_average {
559  double T;
560  double mub;
561  double mus;
562  double nb;
563  double ns;
564  };
565  struct to_average on_lattice = {0.0, 0.0, 0.0, 0.0, 0.0};
566  struct to_average in_therm_reg = {0.0, 0.0, 0.0, 0.0, 0.0};
567  double e_sum_on_lattice = 0.0, e_sum_in_therm_reg = 0.0;
568  int node_counter = 0;
569  for (const auto &node : *lat_) {
570  const double e = node.e();
571  on_lattice.T += node.T() * e;
572  on_lattice.mub += node.mub() * e;
573  on_lattice.mus += node.mus() * e;
574  on_lattice.nb += node.nb() * e;
575  on_lattice.ns += node.ns() * e;
576  e_sum_on_lattice += e;
577  if (e >= e_crit_) {
578  in_therm_reg.T += node.T() * e;
579  in_therm_reg.mub += node.mub() * e;
580  in_therm_reg.mus += node.mus() * e;
581  in_therm_reg.nb += node.nb() * e;
582  in_therm_reg.ns += node.ns() * e;
583  e_sum_in_therm_reg += e;
584  node_counter++;
585  }
586  }
587  if (e_sum_on_lattice > really_small) {
588  on_lattice.T /= e_sum_on_lattice;
589  on_lattice.mub /= e_sum_on_lattice;
590  on_lattice.mus /= e_sum_on_lattice;
591  on_lattice.nb /= e_sum_on_lattice;
592  on_lattice.ns /= e_sum_on_lattice;
593  }
594  if (e_sum_in_therm_reg > really_small) {
595  in_therm_reg.T /= e_sum_in_therm_reg;
596  in_therm_reg.mub /= e_sum_in_therm_reg;
597  in_therm_reg.mus /= e_sum_in_therm_reg;
598  in_therm_reg.nb /= e_sum_in_therm_reg;
599  in_therm_reg.ns /= e_sum_in_therm_reg;
600  }
601 
602  std::cout << "Current time [fm/c]: " << clock.current_time() << std::endl;
603  std::cout << "Averages on the lattice - T[GeV], mub[GeV], mus[GeV], "
604  << "nb[fm^-3], ns[fm^-3]: " << on_lattice.T << " " << on_lattice.mub
605  << " " << on_lattice.mus << " " << on_lattice.nb << " "
606  << on_lattice.ns << std::endl;
607  std::cout << "Averages in therm. region - T[GeV], mub[GeV], mus[GeV], "
608  << "nb[fm^-3], ns[fm^-3]: " << in_therm_reg.T << " "
609  << in_therm_reg.mub << " " << in_therm_reg.mus << " "
610  << in_therm_reg.nb << " " << in_therm_reg.ns << std::endl;
611  std::cout << "Volume with e > e_crit [fm^3]: " << cell_volume_ * node_counter
612  << std::endl;
613 }
const double e_crit_
Critical energy density above which cells are thermalized.
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:34
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
double cell_volume_
Volume of a single cell, necessary to convert thermal densities to actual particle numbers...
Here is the call graph for this function:

◆ lattice()

RectangularLattice<ThermLatticeNode>& smash::GrandCanThermalizer::lattice ( ) const
inline

Getter function for the lattice.

Definition at line 417 of file grandcan_thermalizer.h.

417 { return *lat_; }
std::unique_ptr< RectangularLattice< ThermLatticeNode > > lat_
The lattice on which the thermodynamic quantities are calculated.
Here is the caller graph for this function:

◆ e_crit()

double smash::GrandCanThermalizer::e_crit ( ) const
inline

Get the critical energy density.

Definition at line 419 of file grandcan_thermalizer.h.

419 { return e_crit_; }
const double e_crit_
Critical energy density above which cells are thermalized.

◆ particles_to_remove()

ParticleList smash::GrandCanThermalizer::particles_to_remove ( ) const
inline

List of particles to be removed from the simulation.

Definition at line 421 of file grandcan_thermalizer.h.

421 { return to_remove_; }
ParticleList to_remove_
Particles to be removed after this thermalization step.

◆ particles_to_insert()

ParticleList smash::GrandCanThermalizer::particles_to_insert ( ) const
inline

List of newly created particles to be inserted in the simulation.

Definition at line 423 of file grandcan_thermalizer.h.

423 { return sampled_list_; }
ParticleList sampled_list_
Newly generated particles by thermalizer.

◆ list_eos_particles()

ParticleTypePtrList smash::GrandCanThermalizer::list_eos_particles ( ) const
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.

430  {
431  ParticleTypePtrList res;
432  for (const ParticleType& ptype : ParticleType::list_all()) {
433  if (HadronGasEos::is_eos_particle(ptype)) {
434  res.push_back(&ptype);
435  }
436  }
437  return res;
438  }
static bool is_eos_particle(const ParticleType &ptype)
Check if a particle belongs to the EoS.
Definition: hadgas_eos.h:277
static const ParticleTypeList & list_all()
Definition: particletype.cc:55
Here is the call graph for this function:

◆ get_class()

HadronClass smash::GrandCanThermalizer::get_class ( size_t  typelist_index) const
inlineprivate

Defines the class of hadrons by quantum numbers.

Parameters
[in]typelist_indexIndex for a certain quantum number

Definition at line 443 of file grandcan_thermalizer.h.

443  {
444  const int B = eos_typelist_[typelist_index]->baryon_number();
445  const int S = eos_typelist_[typelist_index]->strangeness();
446  const int ch = eos_typelist_[typelist_index]->charge();
447  // clang-format off
448  return (B > 0) ? HadronClass::Baryon :
449  (B < 0) ? HadronClass::Antibaryon :
450  (S > 0) ? HadronClass::PositiveSMeson :
451  (S < 0) ? HadronClass::NegativeSMeson :
455  // clang-format on
456  }
Non-strange mesons (S = 0) with electric cherge Q < 0.
Mesons with strangeness S < 0.
Neutral non-strange mesons.
Non-strange mesons (S = 0) with electric cherge Q > 0.
Mesons with strangeness S > 0.
const ParticleTypePtrList eos_typelist_
List of particle types from which equation of state is computed.
Here is the caller graph for this function:

◆ mult_class()

double smash::GrandCanThermalizer::mult_class ( const HadronClass  cl) const
inlineprivate
Parameters
[out]clMultiplicity of the hadron class

Definition at line 458 of file grandcan_thermalizer.h.

458  {
459  return mult_classes_[static_cast<size_t>(cl)];
460  }
std::array< double, 7 > mult_classes_
The different hadron species according to the enum defined in.
Here is the caller graph for this function:

Member Data Documentation

◆ N_in_cells_

std::vector<double> smash::GrandCanThermalizer::N_in_cells_
private

Number of particles to be sampled in one cell.

Definition at line 462 of file grandcan_thermalizer.h.

◆ cells_to_sample_

std::vector<size_t> smash::GrandCanThermalizer::cells_to_sample_
private

Cells above critical energy density.

Definition at line 464 of file grandcan_thermalizer.h.

◆ eos_

HadronGasEos smash::GrandCanThermalizer::eos_ = HadronGasEos(true)
private

Hadron gas equation of state.

Definition at line 466 of file grandcan_thermalizer.h.

◆ lat_

std::unique_ptr<RectangularLattice<ThermLatticeNode> > smash::GrandCanThermalizer::lat_
private

The lattice on which the thermodynamic quantities are calculated.

Definition at line 468 of file grandcan_thermalizer.h.

◆ to_remove_

ParticleList smash::GrandCanThermalizer::to_remove_
private

Particles to be removed after this thermalization step.

Definition at line 470 of file grandcan_thermalizer.h.

◆ sampled_list_

ParticleList smash::GrandCanThermalizer::sampled_list_
private

Newly generated particles by thermalizer.

Definition at line 472 of file grandcan_thermalizer.h.

◆ eos_typelist_

const ParticleTypePtrList smash::GrandCanThermalizer::eos_typelist_
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.

◆ N_sorts_

const size_t smash::GrandCanThermalizer::N_sorts_
private

Number of different species to be sampled.

Definition at line 483 of file grandcan_thermalizer.h.

◆ mult_sort_

std::vector<double> smash::GrandCanThermalizer::mult_sort_
private

Real number multiplicity for each particle type.

Definition at line 485 of file grandcan_thermalizer.h.

◆ mult_int_

std::vector<int> smash::GrandCanThermalizer::mult_int_
private

Integer multiplicity for each particle type.

Definition at line 487 of file grandcan_thermalizer.h.

◆ mult_classes_

std::array<double, 7> smash::GrandCanThermalizer::mult_classes_
private

The different hadron species according to the enum defined in.

See also
HadronClass

Definition at line 492 of file grandcan_thermalizer.h.

◆ N_total_in_cells_

double smash::GrandCanThermalizer::N_total_in_cells_
private

Total number of particles over all cells in thermalization region.

Definition at line 494 of file grandcan_thermalizer.h.

◆ cell_volume_

double smash::GrandCanThermalizer::cell_volume_
private

Volume of a single cell, necessary to convert thermal densities to actual particle numbers.

Definition at line 499 of file grandcan_thermalizer.h.

◆ e_crit_

const double smash::GrandCanThermalizer::e_crit_
private

Critical energy density above which cells are thermalized.

Definition at line 501 of file grandcan_thermalizer.h.

◆ t_start_

const double smash::GrandCanThermalizer::t_start_
private

Starting time of the simulation.

Definition at line 503 of file grandcan_thermalizer.h.

◆ period_

const double smash::GrandCanThermalizer::period_
private

Defines periodicity of the lattice in fm.

Definition at line 505 of file grandcan_thermalizer.h.

◆ algorithm_

const ThermalizationAlgorithm smash::GrandCanThermalizer::algorithm_
private

Algorithm to choose for sampling of particles obeying conservation laws.

Definition at line 507 of file grandcan_thermalizer.h.


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