FairShip
Loading...
Searching...
No Matches
ShipUnit.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5//
6// ShipUnit.h
7//
8//
9
10#ifndef SHIPDATA_SHIPUNIT_H_
11#define SHIPDATA_SHIPUNIT_H_
12
13namespace ShipUnit {
14
15//
16// Length [L]
17//
18static const Double_t millimeter = 1. / 10.;
19static const Double_t millimeter2 = millimeter * millimeter;
20static const Double_t millimeter3 = millimeter * millimeter * millimeter;
21
22static const Double_t centimeter = 10. * millimeter;
23static const Double_t centimeter2 = centimeter * centimeter;
24static const Double_t centimeter3 = centimeter * centimeter * centimeter;
25
26static const Double_t meter = 1000. * millimeter;
27static const Double_t meter2 = meter * meter;
28static const Double_t meter3 = meter * meter * meter;
29
30static const Double_t kilometer = 1000. * meter;
31static const Double_t kilometer2 = kilometer * kilometer;
32static const Double_t kilometer3 = kilometer * kilometer * kilometer;
33
34static const Double_t parsec = 3.0856775807e+16 * meter;
35
36static const Double_t micrometer = 1.e-6 * meter;
37static const Double_t nanometer = 1.e-9 * meter;
38static const Double_t angstrom = 1.e-10 * meter;
39static const Double_t fermi = 1.e-15 * meter;
40
41static const Double_t barn = 1.e-28 * meter2;
42static const Double_t millibarn = 1.e-3 * barn;
43static const Double_t microbarn = 1.e-6 * barn;
44static const Double_t nanobarn = 1.e-9 * barn;
45static const Double_t picobarn = 1.e-12 * barn;
46
47// symbols
48static const Double_t nm = nanometer;
49static const Double_t um = micrometer;
50
51static const Double_t mm = millimeter;
52static const Double_t mm2 = millimeter2;
53static const Double_t mm3 = millimeter3;
54
55static const Double_t cm = centimeter;
56static const Double_t cm2 = centimeter2;
57static const Double_t cm3 = centimeter3;
58
59static const Double_t m = meter;
60static const Double_t m2 = meter2;
61static const Double_t m3 = meter3;
62
63static const Double_t km = kilometer;
64static const Double_t km2 = kilometer2;
65static const Double_t km3 = kilometer3;
66
67static const Double_t pc = parsec;
68
69//
70// Angle
71//
72static const Double_t radian = 1.;
73static const Double_t milliradian = 1.e-3 * radian;
74static const Double_t degree = (3.14159265358979323846 / 180.0) * radian;
75
76static const Double_t steradian = 1.;
77
78// symbols
79static const Double_t rad = radian;
80static const Double_t mrad = milliradian;
81static const Double_t sr = steradian;
82static const Double_t deg = degree;
83
84//
85// Time [T]
86//
87static const Double_t nanosecond = 1.;
88static const Double_t second = 1.e+9 * nanosecond;
89static const Double_t millisecond = 1.e-3 * second;
90static const Double_t microsecond = 1.e-6 * second;
91static const Double_t picosecond = 1.e-12 * second;
92
93static const Double_t hertz = 1. / second;
94static const Double_t kilohertz = 1.e+3 * hertz;
95static const Double_t megahertz = 1.e+6 * hertz;
96
97// symbols
98static const Double_t ns = nanosecond;
99static const Double_t s = second;
100static const Double_t ms = millisecond;
101
102//
103// Electric charge [Q]
104//
105static const Double_t eplus = 1.; // positron charge
106static const Double_t e_SI = 1.602176487e-19; // positron charge in coulomb
107static const Double_t coulomb = eplus / e_SI; // coulomb = 6.24150 e+18 * eplus
108
109//
110// Energy [E]
111//
112static const Double_t megaelectronvolt = 1.;
113static const Double_t electronvolt = 1.e-6 * megaelectronvolt;
114static const Double_t kiloelectronvolt = 1.e-3 * megaelectronvolt;
115static const Double_t gigaelectronvolt = 1.e+3 * megaelectronvolt;
116static const Double_t teraelectronvolt = 1.e+6 * megaelectronvolt;
117static const Double_t petaelectronvolt = 1.e+9 * megaelectronvolt;
118
119static const Double_t joule =
120 electronvolt / e_SI; // joule = 6.24150 e+12 * MeV
121
122// symbols
123static const Double_t MeV = megaelectronvolt;
124static const Double_t eV = electronvolt;
125static const Double_t keV = kiloelectronvolt;
126static const Double_t GeV = gigaelectronvolt;
127static const Double_t TeV = teraelectronvolt;
128static const Double_t PeV = petaelectronvolt;
129
130//
131// Mass [E][T^2][L^-2]
132//
133static const Double_t kilogram = joule * second * second / (meter * meter);
134static const Double_t gram = 1.e-3 * kilogram;
135static const Double_t milligram = 1.e-3 * gram;
136
137// symbols
138static const Double_t kg = kilogram;
139static const Double_t g = gram;
140static const Double_t mg = milligram;
141
142//
143// Power [E][T^-1]
144//
145static const Double_t watt = joule / second; // watt = 6.24150 e+3 * MeV/ns
146
147//
148// Force [E][L^-1]
149//
150static const Double_t newton = joule / meter; // newton = 6.24150 e+9 * MeV/mm
151
152//
153// Pressure [E][L^-3]
154//
155#define pascal hep_pascal // a trick to avoid warnings
156static const Double_t hep_pascal =
157 newton / m2; // pascal = 6.24150 e+3 * MeV/mm3
158static const Double_t bar = 100000 * pascal; // bar = 6.24150 e+8 * MeV/mm3
159static const Double_t atmosphere =
160 101325 * pascal; // atm = 6.32420 e+8 * MeV/mm3
161
162//
163// Electric current [Q][T^-1]
164//
165static const Double_t ampere =
166 coulomb / second; // ampere = 6.24150 e+9 * eplus/ns
167static const Double_t milliampere = 1.e-3 * ampere;
168static const Double_t microampere = 1.e-6 * ampere;
169static const Double_t nanoampere = 1.e-9 * ampere;
170
171//
172// Electric potential [E][Q^-1]
173//
174static const Double_t megavolt = megaelectronvolt / eplus;
175static const Double_t kilovolt = 1.e-3 * megavolt;
176static const Double_t volt = 1.e-6 * megavolt;
177
178//
179// Electric resistance [E][T][Q^-2]
180//
181static const Double_t ohm =
182 volt / ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
183
184//
185// Electric capacitance [Q^2][E^-1]
186//
187static const Double_t farad =
188 coulomb / volt; // farad = 6.24150e+24 * eplus/Megavolt
189static const Double_t millifarad = 1.e-3 * farad;
190static const Double_t microfarad = 1.e-6 * farad;
191static const Double_t nanofarad = 1.e-9 * farad;
192static const Double_t picofarad = 1.e-12 * farad;
193
194//
195// Magnetic Flux [T][E][Q^-1]
196//
197static const Double_t weber = volt * second; // weber = 1000*megavolt*ns
198
199//
200// Magnetic Field [T][E][Q^-1][L^-2]
201//
202// static const Double_t tesla = volt*second/meter2;// tesla
203// =0.001*megavolt*ns/mm2 static const Double_t gauss = 1.e-4*tesla; static
204// const Double_t kilogauss = 1.e-1*tesla;
205
206static const Double_t kilogauss = 1.;
207static const Double_t tesla = 10 * kilogauss;
208static const Double_t gauss = 1.e-4 * tesla;
209
210//
211// Inductance [T^2][E][Q^-2]
212//
213static const Double_t henry =
214 weber / ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
215
216//
217// Temperature
218//
219static const Double_t kelvin = 1.;
220
221//
222// Amount of substance
223//
224static const Double_t mole = 1.;
225
226//
227// Activity [T^-1]
228//
229static const Double_t becquerel = 1. / second;
230static const Double_t curie = 3.7e+10 * becquerel;
231static const Double_t kilobecquerel = 1.e+3 * becquerel;
232static const Double_t megabecquerel = 1.e+6 * becquerel;
233static const Double_t gigabecquerel = 1.e+9 * becquerel;
234static const Double_t millicurie = 1.e-3 * curie;
235static const Double_t microcurie = 1.e-6 * curie;
236static const Double_t Bq = becquerel;
237static const Double_t kBq = kilobecquerel;
238static const Double_t MBq = megabecquerel;
239static const Double_t GBq = gigabecquerel;
240static const Double_t Ci = curie;
241static const Double_t mCi = millicurie;
242static const Double_t uCi = microcurie;
243
244//
245// Absorbed dose [L^2][T^-2]
246//
247static const Double_t gray = joule / kilogram;
248static const Double_t kilogray = 1.e+3 * gray;
249static const Double_t milligray = 1.e-3 * gray;
250static const Double_t microgray = 1.e-6 * gray;
251
252//
253// Luminous intensity [I]
254//
255static const Double_t candela = 1.;
256
257//
258// Luminous flux [I]
259//
260static const Double_t lumen = candela * steradian;
261
262//
263// Illuminance [I][L^-2]
264//
265static const Double_t lux = lumen / meter2;
266
267//
268// Miscellaneous
269//
270static const Double_t perCent = 0.01;
271static const Double_t perThousand = 0.001;
272static const Double_t perMillion = 0.000001;
273
274//
275// Physical Constants
276//
277
278static const Double_t pi = 3.14159265358979323846;
279static const Double_t twopi = 2. * pi;
280static const Double_t halfpi = pi / 2.;
281static const Double_t pi2 = pi * pi;
282
283//
284static const Double_t Avogadro = 6.0221367e+23 / mole;
285
286// c = 299.792458 mm/ns
287// c^2 = 898.7404 (mm/ns)^2
288static const Double_t c_light = 2.99792458e+8 * m / s;
289static const Double_t c_squared = c_light * c_light;
290
291// h = 4.13566e-12 MeV*ns
292// hbar = 6.58212e-13 MeV*ns
293// hbarc = 197.32705e-12 MeV*mm
294static const Double_t h_Planck = 6.6260755e-34 * joule * s;
295static const Double_t hbar_Planck = h_Planck / twopi;
296static const Double_t hbarc = hbar_Planck * c_light;
297static const Double_t hbarc_squared = hbarc * hbarc;
298
299//
300static const Double_t electron_charge = -eplus; // see SystemOfUnits.h
301static const Double_t e_squared = eplus * eplus;
302
303// amu_c2 - atomic equivalent mass unit
304// amu - atomic mass unit
305static const Double_t electron_mass_c2 = 0.51099906 * MeV;
306static const Double_t proton_mass_c2 = 938.27231 * MeV;
307static const Double_t neutron_mass_c2 = 939.56563 * MeV;
308static const Double_t amu_c2 = 931.49432 * MeV;
309static const Double_t amu = amu_c2 / c_squared;
310
311// permeability of free space mu0 = 2.01334e-16 Mev*(ns*eplus)^2/mm
312// permittivity of free space epsil0 = 5.52636e+10 eplus^2/(MeV*mm)
313static const Double_t mu0 = 4 * pi * 1.e-7 * henry / m;
314static const Double_t epsilon0 = 1. / (c_squared * mu0);
315
316// electromagnetic coupling = 1.43996e-12 MeV*mm/(eplus^2)
317static const Double_t elm_coupling = e_squared / (4 * pi * epsilon0);
318static const Double_t fine_structure_const = elm_coupling / hbarc;
319static const Double_t classic_electr_radius = elm_coupling / electron_mass_c2;
320static const Double_t electron_Compton_length = hbarc / electron_mass_c2;
321static const Double_t Bohr_radius =
322 electron_Compton_length / fine_structure_const;
323
324static const Double_t alpha_rcl2 =
325 fine_structure_const * classic_electr_radius * classic_electr_radius;
326static const Double_t twopi_mc2_rcl2 =
327 twopi * electron_mass_c2 * classic_electr_radius * classic_electr_radius;
328
329//
330static const Double_t k_Boltzmann = 8.617385e-11 * MeV / kelvin;
331
332//
333static const Double_t STP_Temperature = 273.15 * kelvin;
334static const Double_t STP_Pressure = 1. * atmosphere;
335static const Double_t kGasThreshold = 10. * mg / cm3;
336
337//
338static const Double_t universe_mean_density = 1.e-25 * g / cm3;
339
340}; // namespace ShipUnit
341
342#endif // SHIPDATA_SHIPUNIT_H_ /* defined(____ShipUnit__) */
Double_t tesla
Double_t cm
Double_t m
Double_t kilogauss
Double_t mm
#define pascal
Definition: ShipUnit.h:155