35 static constexpr
int LSphere = LogArea::Sphere::id;
39 : radius_(modus_config.take(
InputKeys::modi_sphere_radius)),
41 modus_config.take(
InputKeys::modi_sphere_temperature)),
42 start_time_(modus_config.take(
InputKeys::modi_sphere_startTime)),
44 modus_config.take(
InputKeys::modi_sphere_useThermalMultiplicities)),
45 mub_(modus_config.take(
InputKeys::modi_sphere_baryonChemicalPotential)),
46 mus_(modus_config.take(
InputKeys::modi_sphere_strangeChemicalPotential)),
47 muq_(modus_config.take(
InputKeys::modi_sphere_chargeChemicalPotential)),
49 modus_config.take(
InputKeys::modi_sphere_heavyFlavorMultiplier)),
50 account_for_resonance_widths_(
51 modus_config.take(
InputKeys::modi_sphere_accountResonanceWidths)),
52 init_multipl_(use_thermal_
55 InputKeys::modi_sphere_initialMultiplicities)),
56 init_distr_(modus_config.take(
InputKeys::modi_sphere_initialCondition)),
58 modus_config.take(
InputKeys::modi_sphere_addRadialVelocity)),
59 radial_velocity_exponent_(
60 modus_config.take(
InputKeys::modi_sphere_addRadialVelocityExponent)),
69 modus_config.take(
InputKeys::modi_sphere_jet_jetPdg))
71 jet_mom_(modus_config.take(
InputKeys::modi_sphere_jet_jetMomentum)),
72 jet_pos_(modus_config.take(
InputKeys::modi_sphere_jet_jetPosition)),
73 jet_back_(modus_config.take(
InputKeys::modi_sphere_jet_backToBack)),
75 jet_back_ ? modus_config.take(
76 InputKeys::modi_sphere_jet_backToBackSeparation)
78 spin_interaction_type_(
79 modus_config.take(
InputKeys::collTerm_spinInteractions)) {
82 throw std::invalid_argument(
83 "In order to specify 'Back_To_Back_Separation', 'Back_To_Back' must be "
87 throw std::invalid_argument(
88 "Additional velocity cannot be greater than 1!");
91 throw std::invalid_argument(
"Temperature must be positive!");
94 throw std::invalid_argument(
"Flow velocity exponent cannot be negative!");
100 out <<
"-- Sphere Modus:\nRadius of the sphere: " << m.
radius_ <<
" fm\n";
103 <<
" GeV, muB = " << m.
mub_ <<
" GeV, muS = " << m.
mus_
104 <<
" GeV, muQ = " << m.
muq_ <<
" GeV)\n";
108 out << ptype->
name() <<
" initial multiplicity " <<
p.second <<
'\n';
113 out <<
"Boltzmann momentum distribution with T = "
117 out <<
"Fermi/Bose momentum distribution with T = "
121 out <<
"Sphere Initial Condition is IC_ES";
124 out <<
"Sphere Initial Condition is IC_1M";
127 out <<
"Sphere Initial Condition is IC_2M";
130 out <<
"Sphere Initial Condition is IC_Massive";
139 out <<
"Adding a dijet " << ptype->
name() << anti->
name()
140 <<
" centered at (" << pos.x1() <<
", " << pos.x2() <<
", "
142 <<
" fm,\neach with " << m.
jet_mom_ <<
" GeV of initial momentum.\n";
144 out <<
"Adding a " << ptype->
name() <<
" as a jet at (" << pos.x1()
145 <<
", " << pos.x2() <<
", " << pos.x3() <<
") fm with " << m.
jet_mom_
146 <<
" GeV of initial momentum.\n";
163 const bool use_heavy_flavor = ptype.pdgcode().is_heavy_flavor() &&
165 if (is_eos_particle || use_heavy_flavor) {
169 if (ptype.pdgcode().is_heavy_flavor()) {
175 double nb_init = 0.0, ns_init = 0.0, nq_init = 0.0;
178 particles->
create(thermal_mult_int, mult.first);
179 nb_init += mult.second * mult.first.baryon_number();
180 ns_init += mult.second * mult.first.strangeness();
181 nq_init += mult.second * mult.first.charge();
182 logg[
LSphere].debug(mult.first,
" initial multiplicity ",
185 logg[
LSphere].info(
"Initial hadron gas baryon density ", nb_init);
186 logg[
LSphere].info(
"Initial hadron gas strange density ", ns_init);
187 logg[
LSphere].info(
"Initial hadron gas charge density ", nq_init);
191 logg[
LSphere].debug(
"Particle ",
p.first,
" initial multiplicity ",
195 std::unique_ptr<QuantumSampling> quantum_sampling;
197 quantum_sampling = std::make_unique<QuantumSampling>(
init_multipl_, V, T);
203 double momentum_radial = 0.0, mass = data.pole_mass();
233 mass = data.type().mass();
234 momentum_radial = quantum_sampling->sample(data.pdgcode());
238 logg[
LSphere].debug(data.type().name(),
"(id ", data.id(),
239 ") radial momentum ", momentum_radial,
", direction",
241 data.set_4momentum(mass, phitheta.
threevec() * momentum_radial);
242 momentum_total += data.momentum();
244 double position_radial;
258 double particle_radius = std::sqrt(data.position().sqr3());
259 auto e_r = data.position().threevec() / particle_radius;
260 auto radial_velocity =
263 data.set_4momentum(data.momentum().lorentz_boost(radial_velocity));
264 momentum_total += data.momentum();
271 data.set_4momentum(data.momentum().abs(),
272 data.momentum().threevec() -
275 data.set_unpolarized_spin_vector();
282 auto &jet_particle = particles->
create(pdg);
285 jet_particle.set_4position(
290 auto &anti_pdg = pdg.has_antiparticle() ? pdg.get_antiparticle() : pdg;
291 auto &jet_antiparticle = particles->
create(anti_pdg);
293 jet_antiparticle.set_4position(
299 jet_particle.set_unpolarized_spin_vector();
306 momentum_total += data.momentum();
311 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.
bool has_value(const Key< T > &key) const
Return whether there is a non-empty value behind the requested key (which is supposed not to refer to...
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.
ParticleTypePtr get_antiparticle() const
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
const std::string & name() const
static const ParticleTypeList & list_all()
bool has_antiparticle() const
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.
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
SphereModus: Provides a modus for expanding matter calculations.
const bool account_for_resonance_widths_
In case of thermal initialization:
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.
const ThreeVector jet_pos_
Initial position of the jet particle; only used if jet_pdg_ is not nullopt.
double sphere_temperature_
Temperature for momentum distribution (in GeV)
const double start_time_
Starting time for the Sphere.
const double radial_velocity_exponent_
Parameter in the initial flow velocity profile of particles in the sphere, which has the form .
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.
const bool jet_back_
Create the back to back jet with the corresponding antiparticle; only used if jet_pdg_ is not nullopt...
const SpinInteractionType spin_interaction_type_
Spin interaction type.
const double hf_multiplier_
Multiplicative factor for thermal multiplicity of heavy flavored hadrons; only used if use_thermal_ i...
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 jet_back_separation_
Initial separation between the back to back jets; can only be set by the user if jet_back_ is true.
const double mus_
Strange chemical potential for thermal initialization; only used if use_thermal_ is true.
const double radial_velocity_
Parameter in the initial flow velocity profile of particles in the sphere, which has the form .
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.
@ Off
No spin interactions.
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 .
constexpr double really_small
Numerical error tolerance.
Helper structure for Experiment.
int testparticles
Number of test-particles.