Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SIunits.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4SIunits
27//
28// Description:
29//
30// This file is a modified version of CLHEP SystemOfUnits.h
31// It is provided for checking the overall 'units coherence' in Geant4.
32// The basic units are those of the International System:
33//
34// meter
35// second
36// kilogram
37// ampere
38// degree kelvin
39// the amount of substance (mole)
40// luminous intensity (candela)
41// radian
42// steradian
43//
44// The SI numerical value of the positron charge is defined here,
45// as it is needed for conversion factor: positron charge = e_SI (coulomb)
46//
47// The others physical constants are defined in the CLHEP header file
48// for PhysicalConstants.
49
50// Authors: M.Maire, S.Giani - 10.03.1999
51// --------------------------------------------------------------------
52#ifndef SI_SYSTEM_OF_UNITS_HH
53#define SI_SYSTEM_OF_UNITS_HH 1
54
55static constexpr double pi = 3.14159265358979323846;
56static constexpr double twopi = 2 * pi;
57static constexpr double halfpi = pi / 2;
58static constexpr double pi2 = pi * pi;
59//
60// Length [L]
61//
62static constexpr double meter = 1.;
63static constexpr double meter2 = meter * meter;
64static constexpr double meter3 = meter * meter * meter;
65
66static constexpr double millimeter = 0.001 * meter;
67static constexpr double millimeter2 = millimeter * millimeter;
68static constexpr double millimeter3 = millimeter * millimeter * millimeter;
69
70static constexpr double centimeter = 10. * millimeter;
71static constexpr double centimeter2 = centimeter * centimeter;
72static constexpr double centimeter3 = centimeter * centimeter * centimeter;
73
74static constexpr double kilometer = 1000. * meter;
75static constexpr double kilometer2 = kilometer * kilometer;
76static constexpr double kilometer3 = kilometer * kilometer * kilometer;
77
78static constexpr double parsec = 3.0856775807e+16 * meter;
79
80static constexpr double micrometer = 1.e-6 * meter;
81static constexpr double nanometer = 1.e-9 * meter;
82static constexpr double angstrom = 1.e-10 * meter;
83static constexpr double fermi = 1.e-15 * meter;
84
85static constexpr double barn = 1.e-28 * meter2;
86static constexpr double millibarn = 1.e-3 * barn;
87static constexpr double microbarn = 1.e-6 * barn;
88static constexpr double nanobarn = 1.e-9 * barn;
89static constexpr double picobarn = 1.e-12 * barn;
90
91// symbols
92static constexpr double nm = nanometer;
93static constexpr double um = micrometer;
94
95static constexpr double mm = millimeter;
96static constexpr double mm2 = millimeter2;
97static constexpr double mm3 = millimeter3;
98
99static constexpr double cm = centimeter;
100static constexpr double cm2 = centimeter2;
101static constexpr double cm3 = centimeter3;
102
103static constexpr double liter = 1.e+3 * cm3;
104static constexpr double L = liter;
105static constexpr double dL = 1.e-1 * liter;
106static constexpr double cL = 1.e-2 * liter;
107static constexpr double mL = 1.e-3 * liter;
108
109static constexpr double m = meter;
110static constexpr double m2 = meter2;
111static constexpr double m3 = meter3;
112
113static constexpr double km = kilometer;
114static constexpr double km2 = kilometer2;
115static constexpr double km3 = kilometer3;
116
117static constexpr double pc = parsec;
118
119//
120// Angle
121//
122static constexpr double radian = 1.;
123static constexpr double milliradian = 1.e-3 * radian;
124static constexpr double degree = (pi / 180.0) * radian;
125
126static constexpr double steradian = 1.;
127
128// symbols
129static constexpr double rad = radian;
130static constexpr double mrad = milliradian;
131static constexpr double sr = steradian;
132static constexpr double deg = degree;
133
134//
135// Time [T]
136//
137static constexpr double second = 1.;
138static constexpr double nanosecond = 1.e-9 * second;
139static constexpr double millisecond = 1.e-3 * second;
140static constexpr double microsecond = 1.e-6 * second;
141static constexpr double picosecond = 1.e-12 * second;
142
143static constexpr double minute = 60*second;
144static constexpr double hour = 60*minute;
145static constexpr double day = 24*hour;
146static constexpr double year = 365*day;
147
148static constexpr double hertz = 1. / second;
149static constexpr double kilohertz = 1.e+3 * hertz;
150static constexpr double megahertz = 1.e+6 * hertz;
151
152// symbols
153static constexpr double ns = nanosecond;
154static constexpr double s = second;
155static constexpr double ms = millisecond;
156static constexpr double us = microsecond;
157static constexpr double ps = picosecond;
158
159//
160// Mass [E][T^2][L^-2]
161//
162static constexpr double kilogram = 1.;
163static constexpr double gram = 1.e-3 * kilogram;
164static constexpr double milligram = 1.e-3 * gram;
165
166// symbols
167static constexpr double kg = kilogram;
168static constexpr double g = gram;
169static constexpr double mg = milligram;
170
171//
172// Electric current [Q][T^-1]
173//
174static constexpr double ampere = 1.;
175static constexpr double milliampere = 1.e-3 * ampere;
176static constexpr double microampere = 1.e-6 * ampere;
177static constexpr double nanoampere = 1.e-9 * ampere;
178
179//
180// Electric charge [Q]
181//
182static constexpr double coulomb = ampere * second;
183static constexpr double e_SI = 1.602176634e-19; // positron charge in coulomb
184static constexpr double eplus = e_SI * coulomb; // positron charge
185
186//
187// Energy [E]
188//
189static constexpr double joule = kg * m * m / (s * s);
190
191static constexpr double electronvolt = e_SI * joule;
192static constexpr double kiloelectronvolt = 1.e+3 * electronvolt;
193static constexpr double megaelectronvolt = 1.e+6 * electronvolt;
194static constexpr double gigaelectronvolt = 1.e+9 * electronvolt;
195static constexpr double teraelectronvolt = 1.e+12 * electronvolt;
196static constexpr double petaelectronvolt = 1.e+15 * electronvolt;
197static constexpr double millielectronvolt = 1.e-3 * electronvolt;
198
199// symbols
200static constexpr double MeV = megaelectronvolt;
201static constexpr double eV = electronvolt;
202static constexpr double keV = kiloelectronvolt;
203static constexpr double GeV = gigaelectronvolt;
204static constexpr double TeV = teraelectronvolt;
205static constexpr double PeV = petaelectronvolt;
206
207//
208// Power [E][T^-1]
209//
210static constexpr double watt = joule / second; // watt = 6.24150 e+3 * MeV/ns
211
212//
213// Force [E][L^-1]
214//
215static constexpr double newton =
216 joule / meter; // newton = 6.24150 e+9 * MeV/mm
217
218//
219// Pressure [E][L^-3]
220//
221#define pascal hep_pascal // a trick to avoid warnings
222static constexpr double hep_pascal =
223 newton / m2; // pascal = 6.24150 e+3 * MeV/mm3
224static constexpr double bar = 100000 * pascal; // bar = 6.24150 e+8 * MeV/mm3
225static constexpr double atmosphere =
226 101325 * pascal; // atm = 6.32420 e+8 * MeV/mm3
227
228//
229// Electric potential [E][Q^-1]
230//
231static constexpr double megavolt = megaelectronvolt / eplus;
232static constexpr double kilovolt = 1.e-3 * megavolt;
233static constexpr double volt = 1.e-6 * megavolt;
234
235//
236// Electric resistance [E][T][Q^-2]
237//
238static constexpr double ohm =
239 volt / ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
240
241//
242// Electric capacitance [Q^2][E^-1]
243//
244static constexpr double farad =
245 coulomb / volt; // farad = 6.24150e+24 * eplus/Megavolt
246static constexpr double millifarad = 1.e-3 * farad;
247static constexpr double microfarad = 1.e-6 * farad;
248static constexpr double nanofarad = 1.e-9 * farad;
249static constexpr double picofarad = 1.e-12 * farad;
250
251//
252// Magnetic Flux [T][E][Q^-1]
253//
254static constexpr double weber = volt * second; // weber = 1000*megavolt*ns
255
256//
257// Magnetic Field [T][E][Q^-1][L^-2]
258//
259static constexpr double tesla =
260 volt * second / meter2; // tesla =0.001*megavolt*ns/mm2
261
262static constexpr double gauss = 1.e-4 * tesla;
263static constexpr double kilogauss = 1.e-1 * tesla;
264
265//
266// Inductance [T^2][E][Q^-2]
267//
268static constexpr double henry =
269 weber / ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
270
271//
272// Temperature
273//
274static constexpr double kelvin = 1.;
275
276//
277// Amount of substance
278//
279static constexpr double mole = 1.;
280
281//
282// Activity [T^-1]
283//
284static constexpr double becquerel = 1. / second;
285static constexpr double curie = 3.7e+10 * becquerel;
286static constexpr double kilobecquerel = 1.e+3 * becquerel;
287static constexpr double megabecquerel = 1.e+6 * becquerel;
288static constexpr double gigabecquerel = 1.e+9 * becquerel;
289static constexpr double millicurie = 1.e-3 * curie;
290static constexpr double microcurie = 1.e-6 * curie;
291static constexpr double Bq = becquerel;
292static constexpr double kBq = kilobecquerel;
293static constexpr double MBq = megabecquerel;
294static constexpr double GBq = gigabecquerel;
295static constexpr double Ci = curie;
296static constexpr double mCi = millicurie;
297static constexpr double uCi = microcurie;
298
299//
300// Absorbed dose [L^2][T^-2]
301//
302static constexpr double gray = joule / kilogram;
303static constexpr double kilogray = 1.e+3 * gray;
304static constexpr double milligray = 1.e-3 * gray;
305static constexpr double microgray = 1.e-6 * gray;
306
307//
308// Luminous intensity [I]
309//
310static constexpr double candela = 1.;
311
312//
313// Luminous flux [I]
314//
315static constexpr double lumen = candela * steradian;
316
317//
318// Illuminance [I][L^-2]
319//
320static constexpr double lux = lumen / meter2;
321
322//
323// Miscellaneous
324//
325static constexpr double perCent = 0.01;
326static constexpr double perThousand = 0.001;
327static constexpr double perMillion = 0.000001;
328
329#endif
#define pascal
Definition: G4SIunits.hh:221
#define ns(x)
Definition: xmltok.c:1649