35 static constexpr
int LSphere = LogArea::Sphere::id;
39 : radius_(modus_config.take({
"Sphere",
"Radius"})),
40 sphere_temperature_(modus_config.take({
"Sphere",
"Temperature"})),
41 start_time_(modus_config.take({
"Sphere",
"Start_Time"}, 0.)),
43 modus_config.take({
"Sphere",
"Use_Thermal_Multiplicities"},
false)),
44 mub_(modus_config.take({
"Sphere",
"Baryon_Chemical_Potential"}, 0.)),
45 mus_(modus_config.take({
"Sphere",
"Strange_Chemical_Potential"}, 0.)),
46 muq_(modus_config.take({
"Sphere",
"Charge_Chemical_Potential"}, 0.)),
47 account_for_resonance_widths_(
48 modus_config.take({
"Sphere",
"Account_Resonance_Widths"},
true)),
49 init_multipl_(use_thermal_
50 ? std::map<PdgCode, int>()
51 : modus_config.take({
"Sphere",
"Init_Multiplicities"})
52 .convert_for(init_multipl_)),
54 modus_config.take({
"Sphere",
"Initial_Condition"},
57 modus_config.take({
"Sphere",
"Add_Radial_Velocity"}, -1.)),
64 jet_pdg_(modus_config.has_value({
"Sphere",
"Jet"})
65 ? make_optional<PdgCode>(
66 modus_config.take({
"Sphere",
"Jet",
"Jet_PDG"}))
69 jet_mom_(modus_config.take({
"Sphere",
"Jet",
"Jet_Momentum"}, 20.)) {}
73 out <<
"-- Sphere Modus:\nRadius of the sphere: " << m.
radius_ <<
" fm\n";
76 <<
" GeV, muB = " << m.
mub_ <<
" GeV, muS = " << m.
mus_
77 <<
" GeV, muQ = " << m.
muq_ <<
" GeV)\n";
81 out << ptype->
name() <<
" initial multiplicity " <<
p.second <<
'\n';
86 out <<
"Boltzmann momentum distribution with T = "
90 out <<
"Fermi/Bose momentum distribution with T = "
94 out <<
"Sphere Initial Condition is IC_ES";
97 out <<
"Sphere Initial Condition is IC_1M";
100 out <<
"Sphere Initial Condition is IC_2M";
103 out <<
"Sphere Initial Condition is IC_Massive";
108 out <<
"Adding a " << ptype->
name() <<
" as a jet in the middle "
109 <<
"of the sphere with " << m.
jet_mom_ <<
" GeV initial momentum.\n";
131 double nb_init = 0.0, ns_init = 0.0, nq_init = 0.0;
134 particles->
create(thermal_mult_int, mult.first);
135 nb_init += mult.second * mult.first.baryon_number();
136 ns_init += mult.second * mult.first.strangeness();
137 nq_init += mult.second * mult.first.charge();
138 logg[
LSphere].debug(mult.first,
" initial multiplicity ",
141 logg[
LSphere].info(
"Initial hadron gas baryon density ", nb_init);
142 logg[
LSphere].info(
"Initial hadron gas strange density ", ns_init);
143 logg[
LSphere].info(
"Initial hadron gas charge density ", nq_init);
147 logg[
LSphere].debug(
"Particle ",
p.first,
" initial multiplicity ",
151 std::unique_ptr<QuantumSampling> quantum_sampling;
153 quantum_sampling = std::make_unique<QuantumSampling>(
init_multipl_, V, T);
159 double momentum_radial = 0.0, mass = data.pole_mass();
189 mass = data.type().mass();
190 momentum_radial = quantum_sampling->sample(data.pdgcode());
194 logg[
LSphere].debug(data.type().name(),
"(id ", data.id(),
195 ") radial momentum ", momentum_radial,
", direction",
197 data.set_4momentum(mass, phitheta.
threevec() * momentum_radial);
198 momentum_total += data.momentum();
200 double position_radial;
213 throw std::invalid_argument(
214 "Additional velocity cannot be greater than 1!");
217 double particle_radius = std::sqrt(data.position().sqr3());
218 auto e_r = data.position().threevec() / particle_radius;
219 auto radial_velocity =
221 data.set_4momentum(data.momentum().lorentz_boost(radial_velocity));
222 momentum_total += data.momentum();
228 data.set_4momentum(data.momentum().abs(),
229 data.momentum().threevec() -
245 momentum_total += data.momentum();
250 logg[
LSphere].debug() <<
"Sphere initial total 4-momentum [GeV]: "
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
ThreeVector threevec() const
void distribute_isotropically()
Populate the object with a new direction.
Interface to the SMASH configuration files.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
ThreeVector threevec() const
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.
static double sample_mass_thermal(const ParticleType &ptype, double beta)
Sample resonance mass in a thermal medium.
static bool is_eos_particle(const ParticleType &ptype)
Check if a particle belongs to the EoS.
ParticleData contains the dynamic information of a certain particle.
A pointer-like interface to global references to ParticleType objects.
Particle type contains the static properties of a particle species.
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
const std::string & name() const
static const ParticleTypeList & list_all()
The Particles class abstracts the storage and manipulation of particles.
void create(size_t n, PdgCode pdg)
Add n particles of the same type (pdg) to the list.
SphereModus: Provides a modus for expanding matter calculations.
const bool account_for_resonance_widths_
In case of thermal initialization: true – account for resonance spectral functions,...
const bool use_thermal_
Whether to use a thermal initialization for all particles instead of specific numbers.
const double muq_
Charge chemical potential for thermal initialization; only used if use_thermal_ is true.
double sphere_temperature_
Temperature for momentum distribution (in GeV)
const double start_time_
Starting time for the Sphere.
const SphereInitialCondition init_distr_
Initialization scheme for momenta in the sphere; used for expanding metric setup.
const std::optional< PdgCode > jet_pdg_
Optional PDG code of the particle to use as a jet, i.e.
SphereModus(Configuration modus_config, const ExperimentParameters ¶meters)
Constructor.
double initial_conditions(Particles *particles, const ExperimentParameters ¶meters)
Generates initial state of the particles in the system according to specified parameters: number of p...
std::map< PdgCode, double > average_multipl_
Average multiplicities in case of thermal initialization.
const double mub_
Baryon chemical potential for thermal initialization; only used if use_thermal_ is true.
const double jet_mom_
Initial momentum of the jet particle; only used if jet_pdg_ is not nullopt.
const std::map< PdgCode, int > init_multipl_
Particle multiplicities at initialization; required if use_thermal_ is false.
const double mus_
Strange chemical potential for thermal initialization; only used if use_thermal_ is true.
const double radial_velocity_
Wether to add a constant radial velocity profile to the momenta of the particles in the sphere.
double radius_
Sphere radius (in fm)
The ThreeVector class represents a physical three-vector with the components .
Collection of useful constants that are known at compile time.
@ ThermalMomentaBoltzmann
A thermalized ensemble is generated, with momenta sampled from a Maxwell-Boltzmann distribution.
@ IC_ES
Off-equilibrium distribution used in massless comparisons of SMASH to the extended universe metric.
@ ThermalMomentaQuantum
A thermalized ensemble is generated, with momenta of baryons(mesons) sampled from a Fermi(Bose) distr...
@ IC_Massive
A generalization of IC_ES for the non-zero mass case; note that there is currently no analytical comp...
@ IC_2M
Off-equilibrium distribution used in massless comparisons of SMASH to the extended universe metric.
@ IC_1M
Off-equilibrium distribution used in massless comparisons of SMASH to the extended universe metric.
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
int poisson(const T &lam)
Returns a Poisson distributed random number.
static constexpr int LSphere
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 .
Helper structure for Experiment.
int testparticles
Number of test-particles.