Geant4-11
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
static constexpr double centimeter
Definition: G4SIunits.hh:70
static constexpr double L
Definition: G4SIunits.hh:104
static constexpr double kilogauss
Definition: G4SIunits.hh:263
static constexpr double centimeter3
Definition: G4SIunits.hh:72
static constexpr double newton
Definition: G4SIunits.hh:215
static constexpr double ohm
Definition: G4SIunits.hh:238
static constexpr double steradian
Definition: G4SIunits.hh:126
static constexpr double petaelectronvolt
Definition: G4SIunits.hh:196
static constexpr double nanoampere
Definition: G4SIunits.hh:177
static constexpr double picobarn
Definition: G4SIunits.hh:89
static constexpr double milligray
Definition: G4SIunits.hh:304
static constexpr double megaelectronvolt
Definition: G4SIunits.hh:193
static constexpr double kelvin
Definition: G4SIunits.hh:274
static constexpr double mm2
Definition: G4SIunits.hh:96
static constexpr double millisecond
Definition: G4SIunits.hh:139
static constexpr double micrometer
Definition: G4SIunits.hh:80
static constexpr double volt
Definition: G4SIunits.hh:233
static constexpr double mL
Definition: G4SIunits.hh:107
static constexpr double kg
Definition: G4SIunits.hh:167
static constexpr double perCent
Definition: G4SIunits.hh:325
static constexpr double lux
Definition: G4SIunits.hh:320
static constexpr double gauss
Definition: G4SIunits.hh:262
static constexpr double ampere
Definition: G4SIunits.hh:174
static constexpr double milliradian
Definition: G4SIunits.hh:123
static constexpr double pi2
Definition: G4SIunits.hh:58
static constexpr double millicurie
Definition: G4SIunits.hh:289
static constexpr double megahertz
Definition: G4SIunits.hh:150
static constexpr double electronvolt
Definition: G4SIunits.hh:191
static constexpr double us
Definition: G4SIunits.hh:156
static constexpr double candela
Definition: G4SIunits.hh:310
static constexpr double ms
Definition: G4SIunits.hh:155
static constexpr double millimeter3
Definition: G4SIunits.hh:68
static constexpr double gray
Definition: G4SIunits.hh:302
static constexpr double gram
Definition: G4SIunits.hh:163
static constexpr double kilogram
Definition: G4SIunits.hh:162
static constexpr double mCi
Definition: G4SIunits.hh:296
static constexpr double mole
Definition: G4SIunits.hh:279
static constexpr double cm3
Definition: G4SIunits.hh:101
static constexpr double milliampere
Definition: G4SIunits.hh:175
static constexpr double minute
Definition: G4SIunits.hh:143
static constexpr double meter3
Definition: G4SIunits.hh:64
static constexpr double perMillion
Definition: G4SIunits.hh:327
static constexpr double kilometer
Definition: G4SIunits.hh:74
static constexpr double m
Definition: G4SIunits.hh:109
static constexpr double gigaelectronvolt
Definition: G4SIunits.hh:194
static constexpr double coulomb
Definition: G4SIunits.hh:182
static constexpr double e_SI
Definition: G4SIunits.hh:183
static constexpr double joule
Definition: G4SIunits.hh:189
static constexpr double hertz
Definition: G4SIunits.hh:148
static constexpr double kilobecquerel
Definition: G4SIunits.hh:286
static constexpr double twopi
Definition: G4SIunits.hh:56
static constexpr double teraelectronvolt
Definition: G4SIunits.hh:195
static constexpr double Ci
Definition: G4SIunits.hh:295
static constexpr double gigabecquerel
Definition: G4SIunits.hh:288
static constexpr double tesla
Definition: G4SIunits.hh:259
static constexpr double microgray
Definition: G4SIunits.hh:305
static constexpr double kilohertz
Definition: G4SIunits.hh:149
static constexpr double microcurie
Definition: G4SIunits.hh:290
static constexpr double hep_pascal
Definition: G4SIunits.hh:222
static constexpr double nm
Definition: G4SIunits.hh:92
static constexpr double mm3
Definition: G4SIunits.hh:97
static constexpr double watt
Definition: G4SIunits.hh:210
static constexpr double nanobarn
Definition: G4SIunits.hh:88
static constexpr double kilovolt
Definition: G4SIunits.hh:232
static constexpr double liter
Definition: G4SIunits.hh:103
static constexpr double barn
Definition: G4SIunits.hh:85
static constexpr double day
Definition: G4SIunits.hh:145
static constexpr double millimeter
Definition: G4SIunits.hh:66
static constexpr double meter
Definition: G4SIunits.hh:62
static constexpr double curie
Definition: G4SIunits.hh:285
static constexpr double km3
Definition: G4SIunits.hh:115
static constexpr double microsecond
Definition: G4SIunits.hh:140
static constexpr double cm2
Definition: G4SIunits.hh:100
static constexpr double megavolt
Definition: G4SIunits.hh:231
static constexpr double parsec
Definition: G4SIunits.hh:78
static constexpr double angstrom
Definition: G4SIunits.hh:82
static constexpr double rad
Definition: G4SIunits.hh:129
static constexpr double GBq
Definition: G4SIunits.hh:294
static constexpr double microbarn
Definition: G4SIunits.hh:87
static constexpr double s
Definition: G4SIunits.hh:154
static constexpr double millibarn
Definition: G4SIunits.hh:86
static constexpr double mm
Definition: G4SIunits.hh:95
static constexpr double eplus
Definition: G4SIunits.hh:184
static constexpr double second
Definition: G4SIunits.hh:137
static constexpr double keV
Definition: G4SIunits.hh:202
static constexpr double fermi
Definition: G4SIunits.hh:83
static constexpr double uCi
Definition: G4SIunits.hh:297
static constexpr double pc
Definition: G4SIunits.hh:117
static constexpr double m3
Definition: G4SIunits.hh:111
static constexpr double picosecond
Definition: G4SIunits.hh:141
static constexpr double picofarad
Definition: G4SIunits.hh:249
static constexpr double atmosphere
Definition: G4SIunits.hh:225
static constexpr double eV
Definition: G4SIunits.hh:201
static constexpr double nanosecond
Definition: G4SIunits.hh:138
static constexpr double centimeter2
Definition: G4SIunits.hh:71
static constexpr double lumen
Definition: G4SIunits.hh:315
static constexpr double km
Definition: G4SIunits.hh:113
static constexpr double g
Definition: G4SIunits.hh:168
static constexpr double mrad
Definition: G4SIunits.hh:130
static constexpr double milligram
Definition: G4SIunits.hh:164
static constexpr double cL
Definition: G4SIunits.hh:106
static constexpr double kiloelectronvolt
Definition: G4SIunits.hh:192
static constexpr double nanometer
Definition: G4SIunits.hh:81
static constexpr double mg
Definition: G4SIunits.hh:169
static constexpr double um
Definition: G4SIunits.hh:93
static constexpr double GeV
Definition: G4SIunits.hh:203
static constexpr double microampere
Definition: G4SIunits.hh:176
static constexpr double millielectronvolt
Definition: G4SIunits.hh:197
static constexpr double Bq
Definition: G4SIunits.hh:291
static constexpr double MeV
Definition: G4SIunits.hh:200
static constexpr double PeV
Definition: G4SIunits.hh:205
static constexpr double sr
Definition: G4SIunits.hh:131
static constexpr double degree
Definition: G4SIunits.hh:124
static constexpr double dL
Definition: G4SIunits.hh:105
static constexpr double ps
Definition: G4SIunits.hh:157
static constexpr double pi
Definition: G4SIunits.hh:55
static constexpr double millifarad
Definition: G4SIunits.hh:246
static constexpr double year
Definition: G4SIunits.hh:146
#define pascal
Definition: G4SIunits.hh:221
static constexpr double bar
Definition: G4SIunits.hh:224
static constexpr double kilogray
Definition: G4SIunits.hh:303
static constexpr double halfpi
Definition: G4SIunits.hh:57
static constexpr double weber
Definition: G4SIunits.hh:254
static constexpr double becquerel
Definition: G4SIunits.hh:284
static constexpr double cm
Definition: G4SIunits.hh:99
static constexpr double hour
Definition: G4SIunits.hh:144
static constexpr double TeV
Definition: G4SIunits.hh:204
static constexpr double nanofarad
Definition: G4SIunits.hh:248
static constexpr double ns
Definition: G4SIunits.hh:153
static constexpr double henry
Definition: G4SIunits.hh:268
static constexpr double m2
Definition: G4SIunits.hh:110
static constexpr double MBq
Definition: G4SIunits.hh:293
static constexpr double megabecquerel
Definition: G4SIunits.hh:287
static constexpr double radian
Definition: G4SIunits.hh:122
static constexpr double microfarad
Definition: G4SIunits.hh:247
static constexpr double millimeter2
Definition: G4SIunits.hh:67
static constexpr double deg
Definition: G4SIunits.hh:132
static constexpr double km2
Definition: G4SIunits.hh:114
static constexpr double perThousand
Definition: G4SIunits.hh:326
static constexpr double kBq
Definition: G4SIunits.hh:292
static constexpr double kilometer2
Definition: G4SIunits.hh:75
static constexpr double farad
Definition: G4SIunits.hh:244
static constexpr double meter2
Definition: G4SIunits.hh:63
static constexpr double kilometer3
Definition: G4SIunits.hh:76