Geant4 10.7.0
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 hertz = 1. / second;
144static constexpr double kilohertz = 1.e+3 * hertz;
145static constexpr double megahertz = 1.e+6 * hertz;
146
147// symbols
148static constexpr double ns = nanosecond;
149static constexpr double s = second;
150static constexpr double ms = millisecond;
151static constexpr double us = microsecond;
152static constexpr double ps = picosecond;
153
154//
155// Mass [E][T^2][L^-2]
156//
157static constexpr double kilogram = 1.;
158static constexpr double gram = 1.e-3 * kilogram;
159static constexpr double milligram = 1.e-3 * gram;
160
161// symbols
162static constexpr double kg = kilogram;
163static constexpr double g = gram;
164static constexpr double mg = milligram;
165
166//
167// Electric current [Q][T^-1]
168//
169static constexpr double ampere = 1.;
170static constexpr double milliampere = 1.e-3 * ampere;
171static constexpr double microampere = 1.e-6 * ampere;
172static constexpr double nanoampere = 1.e-9 * ampere;
173
174//
175// Electric charge [Q]
176//
177static constexpr double coulomb = ampere * second;
178static constexpr double e_SI = 1.602176634e-19; // positron charge in coulomb
179static constexpr double eplus = e_SI * coulomb; // positron charge
180
181//
182// Energy [E]
183//
184static constexpr double joule = kg * m * m / (s * s);
185
186static constexpr double electronvolt = e_SI * joule;
187static constexpr double kiloelectronvolt = 1.e+3 * electronvolt;
188static constexpr double megaelectronvolt = 1.e+6 * electronvolt;
189static constexpr double gigaelectronvolt = 1.e+9 * electronvolt;
190static constexpr double teraelectronvolt = 1.e+12 * electronvolt;
191static constexpr double petaelectronvolt = 1.e+15 * electronvolt;
192
193// symbols
194static constexpr double MeV = megaelectronvolt;
195static constexpr double eV = electronvolt;
196static constexpr double keV = kiloelectronvolt;
197static constexpr double GeV = gigaelectronvolt;
198static constexpr double TeV = teraelectronvolt;
199static constexpr double PeV = petaelectronvolt;
200
201//
202// Power [E][T^-1]
203//
204static constexpr double watt = joule / second; // watt = 6.24150 e+3 * MeV/ns
205
206//
207// Force [E][L^-1]
208//
209static constexpr double newton =
210 joule / meter; // newton = 6.24150 e+9 * MeV/mm
211
212//
213// Pressure [E][L^-3]
214//
215#define pascal hep_pascal // a trick to avoid warnings
216static constexpr double hep_pascal =
217 newton / m2; // pascal = 6.24150 e+3 * MeV/mm3
218static constexpr double bar = 100000 * pascal; // bar = 6.24150 e+8 * MeV/mm3
219static constexpr double atmosphere =
220 101325 * pascal; // atm = 6.32420 e+8 * MeV/mm3
221
222//
223// Electric potential [E][Q^-1]
224//
225static constexpr double megavolt = megaelectronvolt / eplus;
226static constexpr double kilovolt = 1.e-3 * megavolt;
227static constexpr double volt = 1.e-6 * megavolt;
228
229//
230// Electric resistance [E][T][Q^-2]
231//
232static constexpr double ohm =
233 volt / ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
234
235//
236// Electric capacitance [Q^2][E^-1]
237//
238static constexpr double farad =
239 coulomb / volt; // farad = 6.24150e+24 * eplus/Megavolt
240static constexpr double millifarad = 1.e-3 * farad;
241static constexpr double microfarad = 1.e-6 * farad;
242static constexpr double nanofarad = 1.e-9 * farad;
243static constexpr double picofarad = 1.e-12 * farad;
244
245//
246// Magnetic Flux [T][E][Q^-1]
247//
248static constexpr double weber = volt * second; // weber = 1000*megavolt*ns
249
250//
251// Magnetic Field [T][E][Q^-1][L^-2]
252//
253static constexpr double tesla =
254 volt * second / meter2; // tesla =0.001*megavolt*ns/mm2
255
256static constexpr double gauss = 1.e-4 * tesla;
257static constexpr double kilogauss = 1.e-1 * tesla;
258
259//
260// Inductance [T^2][E][Q^-2]
261//
262static constexpr double henry =
263 weber / ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
264
265//
266// Temperature
267//
268static constexpr double kelvin = 1.;
269
270//
271// Amount of substance
272//
273static constexpr double mole = 1.;
274
275//
276// Activity [T^-1]
277//
278static constexpr double becquerel = 1. / second;
279static constexpr double curie = 3.7e+10 * becquerel;
280static constexpr double kilobecquerel = 1.e+3 * becquerel;
281static constexpr double megabecquerel = 1.e+6 * becquerel;
282static constexpr double gigabecquerel = 1.e+9 * becquerel;
283static constexpr double millicurie = 1.e-3 * curie;
284static constexpr double microcurie = 1.e-6 * curie;
285static constexpr double Bq = becquerel;
286static constexpr double kBq = kilobecquerel;
287static constexpr double MBq = megabecquerel;
288static constexpr double GBq = gigabecquerel;
289static constexpr double Ci = curie;
290static constexpr double mCi = millicurie;
291static constexpr double uCi = microcurie;
292
293//
294// Absorbed dose [L^2][T^-2]
295//
296static constexpr double gray = joule / kilogram;
297static constexpr double kilogray = 1.e+3 * gray;
298static constexpr double milligray = 1.e-3 * gray;
299static constexpr double microgray = 1.e-6 * gray;
300
301//
302// Luminous intensity [I]
303//
304static constexpr double candela = 1.;
305
306//
307// Luminous flux [I]
308//
309static constexpr double lumen = candela * steradian;
310
311//
312// Illuminance [I][L^-2]
313//
314static constexpr double lux = lumen / meter2;
315
316//
317// Miscellaneous
318//
319static constexpr double perCent = 0.01;
320static constexpr double perThousand = 0.001;
321static constexpr double perMillion = 0.000001;
322
323#endif
#define pascal
Definition: G4SIunits.hh:215
#define ns
Definition: xmlparse.cc:614