Version: SMASH-3.4
constants.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2021,2023,2025-2026
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_SMASH_CONSTANTS_H_
8 #define SRC_INCLUDE_SMASH_CONSTANTS_H_
9 
10 #include <cmath>
11 #include <cstdint>
12 #include <limits>
13 
14 /**
15  * \file
16  *
17  * Collection of useful constants that are known at compile time.
18  */
19 
20 namespace smash {
21 
22 /// Centralized alias for a quiet NaN.
23 template <typename T>
24 constexpr T smash_NaN = std::numeric_limits<T>::quiet_NaN();
25 
26 /**
27  * GeV <-> fm conversion factor.
28  */
29 constexpr double hbarc = 0.197327053;
30 
31 /// mb <-> fm^2 conversion factor.
32 constexpr double fm2_mb = 0.1;
33 
34 /// GeV^-2 <-> mb conversion factor.
35 constexpr double gev2_mb = hbarc * hbarc / fm2_mb;
36 
37 /// MeV to GeV conversion factor.
38 constexpr double mev_to_gev = 1.e-3;
39 
40 /// Numerical error tolerance.
41 constexpr double really_small = 1.0e-6;
42 
43 /// A very small double, used to avoid division by zero
44 constexpr double very_small_double = 1.0e-15;
45 
46 /**
47  * \f$ 2\pi \f$.
48  */
49 constexpr double twopi = 2. * M_PI;
50 
51 /// Ground state density of symmetric nuclear matter [fm^-3].
52 constexpr double nuclear_density = 0.168;
53 
54 /// Physical error tolerance.
55 constexpr double small_number = 1.0e-4;
56 
57 /**
58  * Electron mass in GeV.
59  *
60  * Note that this should be the same as in particles.txt.
61  */
62 constexpr double electron_mass = 0.000511;
63 
64 /**
65  * Nucleon mass in GeV.
66  *
67  * Note that this should be the same as in particles.txt.
68  */
69 constexpr double nucleon_mass = 0.938;
70 
71 /**
72  * Pion mass in GeV.
73  *
74  * Note that this should be the same as in particles.txt.
75  */
76 constexpr double pion_mass = 0.138;
77 
78 /**
79  * Kaon mass in GeV.
80  *
81  * Note that this should be the same as in particles.txt.
82  */
83 constexpr double kaon_mass = 0.494;
84 
85 /**
86  * omega mass in GeV.
87  *
88  * Note that this should be the same as in particles.txt.
89  */
90 constexpr double omega_mass = 0.783;
91 
92 /**
93  * Delta mass in GeV.
94  *
95  * Note that this should be the same as in particles.txt.
96  */
97 constexpr double delta_mass = 1.232;
98 /**
99  * Deuteron mass in GeV.
100  *
101  * Note that this should be the same as in particles.txt.
102  */
103 constexpr double deuteron_mass = 1.8756;
104 
105 /// Fine-struture constant, approximately 1/137.
106 constexpr double fine_structure = 7.2973525698e-3;
107 
108 /// Elementary electric charge in natural units, approximately 0.3
109 const double elementary_charge = std::sqrt(fine_structure * 4 * M_PI);
110 
111 /**
112  * The maximum value of the random seed used in PYTHIA.
113  */
114 constexpr int maximum_rndm_seed_in_pythia = 900000000;
115 
116 /**
117  * Energy in GeV, below which hard reactions via pythia are impossible.
118  * This constraint is technical and comes from the pythia model itself.
119  * At the same time, physics-wise, hard cross-sections at the low
120  * energies are so small, that this constrant is well justified.
121  */
122 constexpr double minimum_sqrts_pythia_can_handle = 10.0; // GeV
123 
124 /**
125  * Process ID for any photon process.
126  *
127  * It is chosen such that it will not conflict with any other process.
128  */
129 constexpr std::uint32_t ID_PROCESS_PHOTON =
130  std::numeric_limits<std::uint32_t>::max();
131 
132 } // namespace smash
133 
134 #endif // SRC_INCLUDE_SMASH_CONSTANTS_H_
Definition: action.h:24
constexpr double mev_to_gev
MeV to GeV conversion factor.
Definition: constants.h:38
constexpr double delta_mass
Delta mass in GeV.
Definition: constants.h:97
constexpr double gev2_mb
GeV^-2 <-> mb conversion factor.
Definition: constants.h:35
constexpr int maximum_rndm_seed_in_pythia
The maximum value of the random seed used in PYTHIA.
Definition: constants.h:114
constexpr std::uint32_t ID_PROCESS_PHOTON
Process ID for any photon process.
Definition: constants.h:129
constexpr double electron_mass
Electron mass in GeV.
Definition: constants.h:62
constexpr double minimum_sqrts_pythia_can_handle
Energy in GeV, below which hard reactions via pythia are impossible.
Definition: constants.h:122
constexpr double very_small_double
A very small double, used to avoid division by zero.
Definition: constants.h:44
constexpr double twopi
.
Definition: constants.h:49
constexpr double small_number
Physical error tolerance.
Definition: constants.h:55
constexpr double deuteron_mass
Deuteron mass in GeV.
Definition: constants.h:103
constexpr double nucleon_mass
Nucleon mass in GeV.
Definition: constants.h:69
constexpr double nuclear_density
Ground state density of symmetric nuclear matter [fm^-3].
Definition: constants.h:52
constexpr double pion_mass
Pion mass in GeV.
Definition: constants.h:76
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:29
constexpr T smash_NaN
Centralized alias for a quiet NaN.
Definition: constants.h:24
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:41
constexpr double kaon_mass
Kaon mass in GeV.
Definition: constants.h:83
constexpr double fine_structure
Fine-struture constant, approximately 1/137.
Definition: constants.h:106
constexpr double omega_mass
omega mass in GeV.
Definition: constants.h:90
const double elementary_charge
Elementary electric charge in natural units, approximately 0.3.
Definition: constants.h:109
constexpr double fm2_mb
mb <-> fm^2 conversion factor.
Definition: constants.h:32