Version: SMASH-2.2
smash::SphereModus Class Reference

#include <spheremodus.h>

SphereModus: Provides a modus for expanding matter calculations.

Matter is put in a sphere of radius R with uniform density; isotropic thermal momenta are typically used for initialization, although other initial momentum states are also included, see Bazow:2016oky [6] and Tindall:2016try [52]

To use this modus, choose

General:
Modus: Sphere

in the configuration file.

Options for SphereModus go in the "Modi"→"Sphere" section of the configuration:

Modi:
Sphere:
# definitions here

The following configuration options are understood: Sphere

Definition at line 47 of file spheremodus.h.

Inheritance diagram for smash::SphereModus:
[legend]
Collaboration diagram for smash::SphereModus:
[legend]

Public Member Functions

 SphereModus (Configuration modus_config, const ExperimentParameters &parameters)
 Constructor. More...
 
double initial_conditions (Particles *particles, const ExperimentParameters &parameters)
 Generates initial state of the particles in the system according to specified parameters: number of particles of each species, momentum and coordinate space distributions. More...
 
bool is_sphere () const
 
double radius () const
 
- Public Member Functions inherited from smash::ModusDefault
int impose_boundary_conditions (Particles *, const OutputsList &={})
 Enforces sensible positions for the particles. More...
 
bool is_collider () const
 
bool is_box () const
 
bool is_list () const
 
bool is_sphere () const
 
double sqrt_s_NN () const
 
double impact_parameter () const
 
void sample_impact () const
 sample impact parameter for collider modus More...
 
double velocity_projectile () const
 
double velocity_target () const
 
FermiMotion fermi_motion () const
 
double max_timestep (double) const
 
double equilibration_time () const
 
double length () const
 
double radius () const
 
bool calculation_frame_is_fixed_target () const
 
double nuclei_passing_time () const
 Get the passing time of the two nuclei in a collision. More...
 
Grid< GridOptions::Normalcreate_grid (const Particles &particles, double min_cell_length, double timestep_duration, CollisionCriterion crit, const bool include_unformed_particles, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
 Creates the Grid with normal boundary conditions. More...
 

Private Attributes

double radius_
 Sphere radius (in fm/c) More...
 
double sphere_temperature_
 Temperature for momentum distribution (in GeV) More...
 
const double start_time_ = 0.
 Starting time for the Sphere. More...
 
const bool use_thermal_ = false
 Whether to use a thermal initialization for all particles instead of specific numbers. More...
 
const double mub_
 Baryon chemical potential for thermal initialization; only used if use_thermal_ is true. More...
 
const double mus_
 Strange chemical potential for thermal initialization; only used if use_thermal_ is true. More...
 
const double muq_
 Charge chemical potential for thermal initialization; only used if use_thermal_ is true. More...
 
const bool account_for_resonance_widths_
 In case of thermal initialization: true – account for resonance spectral functions, while computing multiplicities and sampling masses, false – simply use pole masses. More...
 
const std::map< PdgCode, int > init_multipl_
 Particle multiplicities at initialization; required if use_thermal_ is false. More...
 
std::map< PdgCode, double > average_multipl_
 Average multiplicities in case of thermal initialization. More...
 
const SphereInitialCondition init_distr_
 Initialization scheme for momenta in the sphere; used for expanding metric setup. More...
 
const double radial_velocity_
 Wether to add a constant radial velocity profile to the momenta of the particles in the sphere. More...
 
const bool insert_jet_ = false
 Whether to insert a single high energy particle at the center of the expanding sphere (0,0,0). More...
 
const PdgCode jet_pdg_
 Pdg of the particle to use as a jet; necessary if insert_jet_ is true, unused otherwise. More...
 
const double jet_mom_
 Initial momentum of the jet particle; only used if insert_jet_ is true. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const SphereModus &m)
 Writes the initial state for the Sphere to the output stream. More...
 

Constructor & Destructor Documentation

◆ SphereModus()

smash::SphereModus::SphereModus ( Configuration  modus_config,
const ExperimentParameters parameters 
)
explicit

Constructor.

Takes all there is to take from the (truncated!) configuration object (only contains configuration for this modus).

Parameters
[in]modus_configThe configuration object that sets all initial conditions of the experiment.
[in]parametersUnused, but necessary because of templated initialization

Definition at line 168 of file spheremodus.cc.

170  : radius_(modus_config.take({"Sphere", "Radius"})),
171  sphere_temperature_(modus_config.take({"Sphere", "Temperature"})),
172  start_time_(modus_config.take({"Sphere", "Start_Time"}, 0.)),
173  use_thermal_(
174  modus_config.take({"Sphere", "Use_Thermal_Multiplicities"}, false)),
175  mub_(modus_config.take({"Sphere", "Baryon_Chemical_Potential"}, 0.)),
176  mus_(modus_config.take({"Sphere", "Strange_Chemical_Potential"}, 0.)),
177  muq_(modus_config.take({"Sphere", "Charge_Chemical_Potential"}, 0.)),
179  modus_config.take({"Sphere", "Account_Resonance_Widths"}, true)),
181  ? std::map<PdgCode, int>()
182  : modus_config.take({"Sphere", "Init_Multiplicities"})
183  .convert_for(init_multipl_)),
184  init_distr_(
185  modus_config.take({"Sphere", "Initial_Condition"},
188  modus_config.take({"Sphere", "Add_Radial_Velocity"}, -1.)),
189  insert_jet_(modus_config.has_value({"Sphere", "Jet", "Jet_PDG"})),
190  jet_pdg_(insert_jet_ ? modus_config.take({"Sphere", "Jet", "Jet_PDG"})
191  .convert_for(jet_pdg_)
192  : pdg::p), // dummy default; never used
193  jet_mom_(modus_config.take({"Sphere", "Jet", "Jet_Momentum"}, 20.)) {}
const bool account_for_resonance_widths_
In case of thermal initialization: true – account for resonance spectral functions,...
Definition: spheremodus.h:113
const bool use_thermal_
Whether to use a thermal initialization for all particles instead of specific numbers.
Definition: spheremodus.h:92
const double muq_
Charge chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: spheremodus.h:107
double sphere_temperature_
Temperature for momentum distribution (in GeV)
Definition: spheremodus.h:85
const double start_time_
Starting time for the Sphere.
Definition: spheremodus.h:87
const bool insert_jet_
Whether to insert a single high energy particle at the center of the expanding sphere (0,...
Definition: spheremodus.h:140
const PdgCode jet_pdg_
Pdg of the particle to use as a jet; necessary if insert_jet_ is true, unused otherwise.
Definition: spheremodus.h:145
const SphereInitialCondition init_distr_
Initialization scheme for momenta in the sphere; used for expanding metric setup.
Definition: spheremodus.h:128
const double mub_
Baryon chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: spheremodus.h:97
const double jet_mom_
Initial momentum of the jet particle; only used if insert_jet_ is true.
Definition: spheremodus.h:149
const std::map< PdgCode, int > init_multipl_
Particle multiplicities at initialization; required if use_thermal_ is false.
Definition: spheremodus.h:118
const double mus_
Strange chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: spheremodus.h:102
const double radial_velocity_
Wether to add a constant radial velocity profile to the momenta of the particles in the sphere.
Definition: spheremodus.h:134
double radius_
Sphere radius (in fm/c)
Definition: spheremodus.h:83
constexpr int p
Proton.

Member Function Documentation

◆ initial_conditions()

double smash::SphereModus::initial_conditions ( Particles particles,
const ExperimentParameters parameters 
)

Generates initial state of the particles in the system according to specified parameters: number of particles of each species, momentum and coordinate space distributions.

Susbsequently makes the total 3-momentum 0.

Parameters
[out]particlesAn empty list that gets filled up by this function
[in]parametersThe initialization parameters of the box
Returns
The starting time of the simulation

Definition at line 239 of file spheremodus.cc.

240  {
241  FourVector momentum_total(0, 0, 0, 0);
242  const double T = this->sphere_temperature_;
243  const double V = 4.0 / 3.0 * M_PI * radius_ * radius_ * radius_;
244  /* Create NUMBER OF PARTICLES according to configuration */
245  if (use_thermal_) {
246  if (average_multipl_.empty()) {
247  for (const ParticleType &ptype : ParticleType::list_all()) {
248  if (HadronGasEos::is_eos_particle(ptype)) {
249  const double n = HadronGasEos::partial_density(
251  average_multipl_[ptype.pdgcode()] = n * V * parameters.testparticles;
252  }
253  }
254  }
255  double nb_init = 0.0, ns_init = 0.0, nq_init = 0.0;
256  for (const auto &mult : average_multipl_) {
257  const int thermal_mult_int = random::poisson(mult.second);
258  particles->create(thermal_mult_int, mult.first);
259  nb_init += mult.second * mult.first.baryon_number();
260  ns_init += mult.second * mult.first.strangeness();
261  nq_init += mult.second * mult.first.charge();
262  logg[LSphere].debug(mult.first, " initial multiplicity ",
263  thermal_mult_int);
264  }
265  logg[LSphere].info("Initial hadron gas baryon density ", nb_init);
266  logg[LSphere].info("Initial hadron gas strange density ", ns_init);
267  logg[LSphere].info("Initial hadron gas charge density ", nq_init);
268  } else {
269  for (const auto &p : init_multipl_) {
270  particles->create(p.second * parameters.testparticles, p.first);
271  logg[LSphere].debug("Particle ", p.first, " initial multiplicity ",
272  p.second);
273  }
274  }
275  std::unique_ptr<QuantumSampling> quantum_sampling;
277  quantum_sampling = make_unique<QuantumSampling>(init_multipl_, V, T);
278  }
279  /* loop over particle data to fill in momentum and position information */
280  for (ParticleData &data : *particles) {
281  Angles phitheta;
282  /* thermal momentum according Maxwell-Boltzmann distribution */
283  double momentum_radial = 0.0, mass = data.pole_mass();
284  /* assign momentum_radial according to requested distribution */
285  switch (init_distr_) {
287  momentum_radial = sample_momenta_IC_ES(T);
288  break;
290  momentum_radial = sample_momenta_1M_IC(T, mass);
291  break;
293  momentum_radial = sample_momenta_2M_IC(T, mass);
294  break;
296  momentum_radial = sample_momenta_non_eq_mass(T, mass);
297  break;
299  default:
301  ? data.type().mass()
302  : HadronGasEos::sample_mass_thermal(data.type(), 1.0 / T);
303  momentum_radial = sample_momenta_from_thermal(T, mass);
304  break;
306  /*
307  * **********************************************************************
308  * Sampling the thermal momentum according Bose/Fermi/Boltzmann
309  * distribution.
310  * We take the pole mass as the mass.
311  * **********************************************************************
312  */
313  mass = data.type().mass();
314  momentum_radial = quantum_sampling->sample(data.pdgcode());
315  break;
316  }
317  phitheta.distribute_isotropically();
318  logg[LSphere].debug(data.type().name(), "(id ", data.id(),
319  ") radial momentum ", momentum_radial, ", direction",
320  phitheta);
321  data.set_4momentum(mass, phitheta.threevec() * momentum_radial);
322  momentum_total += data.momentum();
323  /* uniform sampling in a sphere with radius r */
324  double position_radial;
325  position_radial = std::cbrt(random::canonical()) * radius_;
326  Angles pos_phitheta;
327  pos_phitheta.distribute_isotropically();
328  data.set_4position(
329  FourVector(start_time_, pos_phitheta.threevec() * position_radial));
330  data.set_formation_time(start_time_);
331  }
332 
333  /* boost in radial direction with an underlying velocity field of the form u_r
334  * = u_0 * r / R */
335  if (radial_velocity_ > 0.0) {
336  if (radial_velocity_ > 1.0) {
337  throw std::invalid_argument(
338  "Additional velocity cannot be greater than 1!");
339  }
340  for (ParticleData &data : *particles) {
341  double particle_radius = std::sqrt(data.position().sqr3());
342  auto e_r = data.position().threevec() / particle_radius;
343  auto radial_velocity = radial_velocity_ * e_r * particle_radius / radius_;
344  data.set_4momentum(data.momentum().lorentz_boost(radial_velocity));
345  momentum_total += data.momentum();
346  }
347  }
348 
349  /* Make total 3-momentum 0 */
350  for (ParticleData &data : *particles) {
351  data.set_4momentum(data.momentum().abs(),
352  data.momentum().threevec() -
353  momentum_total.threevec() / particles->size());
354  }
355 
356  /* Add a single highly energetic particle in the center of the sphere (jet) */
357  if (insert_jet_) {
358  auto &jet_particle = particles->create(jet_pdg_);
359  jet_particle.set_formation_time(start_time_);
360  jet_particle.set_4position(FourVector(start_time_, 0., 0., 0.));
361  jet_particle.set_4momentum(ParticleType::find(jet_pdg_).mass(),
362  ThreeVector(jet_mom_, 0., 0.));
363  }
364 
365  /* Recalculate total momentum */
366  momentum_total = FourVector(0, 0, 0, 0);
367  for (ParticleData &data : *particles) {
368  momentum_total += data.momentum();
369  /* IC: debug checks */
370  logg[LSphere].debug() << data;
371  }
372  /* allows to check energy conservation */
373  logg[LSphere].debug() << "Sphere initial total 4-momentum [GeV]: "
374  << momentum_total;
375  return start_time_;
376 }
static double partial_density(const ParticleType &ptype, double T, double mub, double mus, double muq, bool account_for_resonance_widths=false)
Compute partial density of one hadron sort.
Definition: hadgas_eos.cc:270
static double sample_mass_thermal(const ParticleType &ptype, double beta)
Sample resonance mass in a thermal medium.
Definition: hadgas_eos.cc:385
static bool is_eos_particle(const ParticleType &ptype)
Check if a particle belongs to the EoS.
Definition: hadgas_eos.h:355
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
Definition: particletype.cc:99
static const ParticleTypeList & list_all()
Definition: particletype.cc:51
std::map< PdgCode, double > average_multipl_
Average multiplicities in case of thermal initialization.
Definition: spheremodus.h:123
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
constexpr int n
Neutron.
int poisson(const T &lam)
Returns a Poisson distributed random number.
Definition: random.h:226
T canonical()
Definition: random.h:113
static constexpr int LSphere
Definition: spheremodus.cc:33
double sample_momenta_from_thermal(const double temperature, const double mass)
Samples a momentum from the Maxwell-Boltzmann (thermal) distribution in a faster way,...
double sample_momenta_IC_ES(const double temperature)
Sample momenta according to the momentum distribution in Bazow:2016oky .
double sample_momenta_non_eq_mass(const double temperature, const double mass)
Samples a momentum via rejection method from the non-equilibrium distribution.
double sample_momenta_1M_IC(const double temperature, const double mass)
Samples a momentum from the non-equilibrium distribution 1M_IC from Bazow:2016oky .
double sample_momenta_2M_IC(const double temperature, const double mass)
Samples a momentum from the non-equilibrium distribution 2M_IC from Bazow:2016oky .
Here is the call graph for this function:

◆ is_sphere()

bool smash::SphereModus::is_sphere ( ) const
inline
Returns
If the modus is sphere modus, which is always true

Definition at line 77 of file spheremodus.h.

77 { return true; }

◆ radius()

double smash::SphereModus::radius ( ) const
inline
Returns
radius

Definition at line 79 of file spheremodus.h.

79 { return radius_; }

Member Data Documentation

◆ radius_

double smash::SphereModus::radius_
private

Sphere radius (in fm/c)

Definition at line 83 of file spheremodus.h.

◆ sphere_temperature_

double smash::SphereModus::sphere_temperature_
private

Temperature for momentum distribution (in GeV)

Definition at line 85 of file spheremodus.h.

◆ start_time_

const double smash::SphereModus::start_time_ = 0.
private

Starting time for the Sphere.

Definition at line 87 of file spheremodus.h.

◆ use_thermal_

const bool smash::SphereModus::use_thermal_ = false
private

Whether to use a thermal initialization for all particles instead of specific numbers.

Definition at line 92 of file spheremodus.h.

◆ mub_

const double smash::SphereModus::mub_
private

Baryon chemical potential for thermal initialization; only used if use_thermal_ is true.

Definition at line 97 of file spheremodus.h.

◆ mus_

const double smash::SphereModus::mus_
private

Strange chemical potential for thermal initialization; only used if use_thermal_ is true.

Definition at line 102 of file spheremodus.h.

◆ muq_

const double smash::SphereModus::muq_
private

Charge chemical potential for thermal initialization; only used if use_thermal_ is true.

Definition at line 107 of file spheremodus.h.

◆ account_for_resonance_widths_

const bool smash::SphereModus::account_for_resonance_widths_
private

In case of thermal initialization: true – account for resonance spectral functions, while computing multiplicities and sampling masses, false – simply use pole masses.

Definition at line 113 of file spheremodus.h.

◆ init_multipl_

const std::map<PdgCode, int> smash::SphereModus::init_multipl_
private

Particle multiplicities at initialization; required if use_thermal_ is false.

Definition at line 118 of file spheremodus.h.

◆ average_multipl_

std::map<PdgCode, double> smash::SphereModus::average_multipl_
private

Average multiplicities in case of thermal initialization.

Saved to avoid recalculating at every event

Definition at line 123 of file spheremodus.h.

◆ init_distr_

const SphereInitialCondition smash::SphereModus::init_distr_
private

Initialization scheme for momenta in the sphere; used for expanding metric setup.

Definition at line 128 of file spheremodus.h.

◆ radial_velocity_

const double smash::SphereModus::radial_velocity_
private

Wether to add a constant radial velocity profile to the momenta of the particles in the sphere.

The underlying velocity field has the form u = u_0 * r / R.

Definition at line 134 of file spheremodus.h.

◆ insert_jet_

const bool smash::SphereModus::insert_jet_ = false
private

Whether to insert a single high energy particle at the center of the expanding sphere (0,0,0).

This particle will initially be moving along the x axis, outwards from the sphere.

Definition at line 140 of file spheremodus.h.

◆ jet_pdg_

const PdgCode smash::SphereModus::jet_pdg_
private

Pdg of the particle to use as a jet; necessary if insert_jet_ is true, unused otherwise.

Definition at line 145 of file spheremodus.h.

◆ jet_mom_

const double smash::SphereModus::jet_mom_
private

Initial momentum of the jet particle; only used if insert_jet_ is true.

Definition at line 149 of file spheremodus.h.


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