Version: SMASH-3.4
spheremodus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2023,2025
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_SMASH_SPHEREMODUS_H_
8 #define SRC_INCLUDE_SMASH_SPHEREMODUS_H_
9 
10 #include <stdint.h>
11 
12 #include <cmath>
13 #include <list>
14 #include <map>
15 
16 #include "forwarddeclarations.h"
17 #include "modusdefault.h"
18 
19 namespace smash {
20 
21 /**
22  * \ingroup modus
23  * SphereModus: Provides a modus for expanding matter calculations
24  *
25  * Matter is put in a sphere of radius R with uniform density;
26  * isotropic thermal momenta are typically used for initialization,
27  * although other initial momentum states are also included,
28  * see \iref{Bazow:2016oky} and \iref{Tindall:2016try}
29  *
30  * To use this modus, choose
31  * \code
32  * General:
33  * Modus: Sphere
34  * \endcode
35  * in the configuration file.
36  *
37  * Options for SphereModus go in the "Modi"→"Sphere" section of the
38  * configuration:
39  *
40  * \code
41  * Modi:
42  * Sphere:
43  * # definitions here
44  * \endcode
45  *
46  * The following configuration options are understood: \ref
47  * doxypage_input_conf_modi_sphere
48  */
49 class SphereModus : public ModusDefault {
50  public:
51  /**
52  * Constructor
53  *
54  * Takes all there is to take from the (truncated!) configuration
55  * object (only contains configuration for this modus).
56  *
57  * \param[in] modus_config The configuration object that sets all
58  * initial conditions of the experiment.
59  * \param[in] parameters Unused, but necessary because of templated
60  * initialization
61  */
62  explicit SphereModus(Configuration modus_config,
63  const ExperimentParameters &parameters);
64 
65  /**
66  * Generates initial state of the particles in the system according to
67  * specified parameters: number of particles of each species, momentum
68  * and coordinate space distributions. Susbsequently makes the total
69  * 3-momentum 0.
70  *
71  * \param[out] particles An empty list that gets filled up by this function
72  * \param[in] parameters The initialization parameters of the box
73  * \return The starting time of the simulation
74  */
75  double initial_conditions(Particles *particles,
76  const ExperimentParameters &parameters);
77 
78  /// \return If the modus is sphere modus, which is always true
79  bool is_sphere() const { return true; }
80  /// \return radius
81  double radius() const { return radius_; }
82 
83  private:
84  /// Sphere radius (in fm)
85  double radius_;
86  /// Temperature for momentum distribution (in GeV)
88  /// Starting time for the Sphere
89  const double start_time_ = 0.;
90  /**
91  * Whether to use a thermal initialization for all particles
92  * instead of specific numbers
93  */
94  const bool use_thermal_ = false;
95  /**
96  * Baryon chemical potential for thermal initialization;
97  * only used if \key use_thermal_ is true
98  */
99  const double mub_;
100  /**
101  * Strange chemical potential for thermal initialization;
102  * only used if \key use_thermal_ is true
103  */
104  const double mus_;
105  /**
106  * Charge chemical potential for thermal initialization;
107  * only used if \key use_thermal_ is true
108  */
109  const double muq_;
110  /**
111  * Multiplicative factor for thermal multiplicity of heavy flavored hadrons;
112  * only used if \key use_thermal_ is true
113  */
114  const double hf_multiplier_;
115  /**
116  * In case of thermal initialization:
117  * - true -- account for resonance spectral functions, while computing
118  * multiplicities and sampling masses,
119  * - false -- simply use pole masses.
120  */
122  /**
123  * Particle multiplicities at initialization;
124  * required if use_thermal_ is false
125  */
126  const std::map<PdgCode, int> init_multipl_;
127  /**
128  * Average multiplicities in case of thermal initialization.
129  * Saved to avoid recalculating at every event
130  */
131  std::map<PdgCode, double> average_multipl_;
132  /**
133  * Initialization scheme for momenta in the sphere;
134  * used for expanding metric setup
135  */
137  /**
138  * Parameter \f$ u_0\f$ in the initial flow velocity profile of particles in
139  * the sphere, which has the form \f$ u = u_0 (r / R)^n\f$.
140  */
141  const double radial_velocity_;
142  /**
143  * Parameter \f$ n\f$ in the initial flow velocity profile of particles in
144  * the sphere, which has the form \f$ u = u_0 (r / R)^n\f$.
145  */
147  /**
148  * Optional PDG code of the particle to use as a jet, i.e. a single high
149  * energy particle at the center (0,0,0) of the expanding sphere. This
150  * particle will be placed at t=0 and will initially be moving along the x
151  * axis, in the positive or negative direction depending on the sign of
152  * its momentum.
153  */
154  const std::optional<PdgCode> jet_pdg_;
155  /**
156  * Initial momentum of the jet particle; only used if jet_pdg_ is not nullopt
157  */
158  const double jet_mom_;
159  /**
160  * Initial position of the jet particle; only used if jet_pdg_ is not nullopt
161  */
163  /**
164  * Create the back to back jet with the corresponding antiparticle; only used
165  * if jet_pdg_ is not nullopt
166  */
167  const bool jet_back_;
168  /**
169  * Initial separation between the back to back jets; can only be set by the
170  * user if jet_back_ is true
171  */
172  const double jet_back_separation_ = smash_NaN<double>;
173  /// Spin interaction type
175  /**\ingroup logging
176  * Writes the initial state for the Sphere to the output stream.
177  *
178  * \param[in] out The ostream into which to output
179  * \param[in] m The SphereModus object to write into out
180  */
181  friend std::ostream &operator<<(std::ostream &out, const SphereModus &m);
182 };
183 } // namespace smash
184 #endif // SRC_INCLUDE_SMASH_SPHEREMODUS_H_
Interface to the SMASH configuration files.
Base class for Modus classes that provides default function implementations.
Definition: modusdefault.h:45
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
SphereModus: Provides a modus for expanding matter calculations.
Definition: spheremodus.h:49
const bool account_for_resonance_widths_
In case of thermal initialization:
Definition: spheremodus.h:121
const bool use_thermal_
Whether to use a thermal initialization for all particles instead of specific numbers.
Definition: spheremodus.h:94
const double muq_
Charge chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: spheremodus.h:109
const ThreeVector jet_pos_
Initial position of the jet particle; only used if jet_pdg_ is not nullopt.
Definition: spheremodus.h:162
double sphere_temperature_
Temperature for momentum distribution (in GeV)
Definition: spheremodus.h:87
double radius() const
Definition: spheremodus.h:81
const double start_time_
Starting time for the Sphere.
Definition: spheremodus.h:89
bool is_sphere() const
Definition: spheremodus.h:79
const double radial_velocity_exponent_
Parameter in the initial flow velocity profile of particles in the sphere, which has the form .
Definition: spheremodus.h:146
const SphereInitialCondition init_distr_
Initialization scheme for momenta in the sphere; used for expanding metric setup.
Definition: spheremodus.h:136
const std::optional< PdgCode > jet_pdg_
Optional PDG code of the particle to use as a jet, i.e.
Definition: spheremodus.h:154
SphereModus(Configuration modus_config, const ExperimentParameters &parameters)
Constructor.
Definition: spheremodus.cc:37
const bool jet_back_
Create the back to back jet with the corresponding antiparticle; only used if jet_pdg_ is not nullopt...
Definition: spheremodus.h:167
const SpinInteractionType spin_interaction_type_
Spin interaction type.
Definition: spheremodus.h:174
const double hf_multiplier_
Multiplicative factor for thermal multiplicity of heavy flavored hadrons; only used if use_thermal_ i...
Definition: spheremodus.h:114
double initial_conditions(Particles *particles, const ExperimentParameters &parameters)
Generates initial state of the particles in the system according to specified parameters: number of p...
Definition: spheremodus.cc:143
std::map< PdgCode, double > average_multipl_
Average multiplicities in case of thermal initialization.
Definition: spheremodus.h:131
const double mub_
Baryon chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: spheremodus.h:99
const double jet_mom_
Initial momentum of the jet particle; only used if jet_pdg_ is not nullopt.
Definition: spheremodus.h:158
const std::map< PdgCode, int > init_multipl_
Particle multiplicities at initialization; required if use_thermal_ is false.
Definition: spheremodus.h:126
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.
Definition: spheremodus.h:172
const double mus_
Strange chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: spheremodus.h:104
const double radial_velocity_
Parameter in the initial flow velocity profile of particles in the sphere, which has the form .
Definition: spheremodus.h:141
double radius_
Sphere radius (in fm)
Definition: spheremodus.h:85
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
SphereInitialCondition
Initial condition for a particle in a sphere.
SpinInteractionType
Possible spin interaction types.
friend std::ostream & operator<<(std::ostream &out, const SphereModus &m)
Writes the initial state for the Sphere to the output stream.
Definition: spheremodus.cc:89
Definition: action.h:24
Helper structure for Experiment.