Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //
27 // $Id: G4SIunits.hh 96706 2016-05-02 09:31:38Z gcosmo $
28 //
29 // ----------------------------------------------------------------------
30 //
31 // Class description:
32 //
33 // This file is a modified version of SystemOfUnits.h
34 // It is provided for checking the overall 'units coherence' of the
35 // Geant4 kernel.
36 // -------
37 // Warning: if you use it, do not forget to recompile the whole Geant4 kernel
38 // -------
39 // The basic units are those of the International System:
40 //
41 // meter
42 // second
43 // kilogram
44 // ampere
45 // degree kelvin
46 // the amount of substance (mole)
47 // luminous intensity (candela)
48 // radian
49 // steradian
50 //
51 //
52 // The SI numerical value of the positron charge is defined here,
53 // as it is needed for conversion factor : positron charge = e_SI (coulomb)
54 //
55 // The others physical constants are defined in the header file :
56 // PhysicalConstants.h
57 //
58 
59 // Authors: M.Maire, S.Giani
60 //
61 // History:
62 //
63 // 10.03.99 created
64 // 01.03.01 parsec
65 // 11.06.15 upgrate. Equivalent to SystemOfUnits.h
66 // 08.08.15 add decimeter, liter (mma)
67 // 12.01.16 added symbols for microsecond (us) and picosecond (ps) (mma)
68 
69 #ifndef SI_SYSTEM_OF_UNITS_HH
70 #define SI_SYSTEM_OF_UNITS_HH
71 
72 //
73 //
74 //
75 static constexpr double pi = 3.14159265358979323846;
76 static constexpr double twopi = 2*pi;
77 static constexpr double halfpi = pi/2;
78 static constexpr double pi2 = pi*pi;
79 //
80 // Length [L]
81 //
82 static constexpr double meter = 1.;
83 static constexpr double meter2 = meter*meter;
84 static constexpr double meter3 = meter*meter*meter;
85 
86 static constexpr double millimeter = 0.001*meter;
87 static constexpr double millimeter2 = millimeter*millimeter;
88 static constexpr double millimeter3 = millimeter*millimeter*millimeter;
89 
90 static constexpr double centimeter = 10.*millimeter;
91 static constexpr double centimeter2 = centimeter*centimeter;
92 static constexpr double centimeter3 = centimeter*centimeter*centimeter;
93 
94 static constexpr double kilometer = 1000.*meter;
95 static constexpr double kilometer2 = kilometer*kilometer;
96 static constexpr double kilometer3 = kilometer*kilometer*kilometer;
97 
98 static constexpr double parsec = 3.0856775807e+16*meter;
99 
100 static constexpr double micrometer = 1.e-6 *meter;
101 static constexpr double nanometer = 1.e-9 *meter;
102 static constexpr double angstrom = 1.e-10*meter;
103 static constexpr double fermi = 1.e-15*meter;
104 
105 static constexpr double barn = 1.e-28*meter2;
106 static constexpr double millibarn = 1.e-3 *barn;
107 static constexpr double microbarn = 1.e-6 *barn;
108 static constexpr double nanobarn = 1.e-9 *barn;
109 static constexpr double picobarn = 1.e-12*barn;
110 
111 // symbols
112 static constexpr double nm = nanometer;
113 static constexpr double um = micrometer;
114 
115 static constexpr double mm = millimeter;
116 static constexpr double mm2 = millimeter2;
117 static constexpr double mm3 = millimeter3;
118 
119 static constexpr double cm = centimeter;
120 static constexpr double cm2 = centimeter2;
121 static constexpr double cm3 = centimeter3;
122 
123 static constexpr double liter = 1.e+3*cm3;
124 static constexpr double L = liter;
125 static constexpr double dL = 1.e-1*liter;
126 static constexpr double cL = 1.e-2*liter;
127 static constexpr double mL = 1.e-3*liter;
128 
129 static constexpr double m = meter;
130 static constexpr double m2 = meter2;
131 static constexpr double m3 = meter3;
132 
133 static constexpr double km = kilometer;
134 static constexpr double km2 = kilometer2;
135 static constexpr double km3 = kilometer3;
136 
137 static constexpr double pc = parsec;
138 
139 //
140 // Angle
141 //
142 static constexpr double radian = 1.;
143 static constexpr double milliradian = 1.e-3*radian;
144 static constexpr double degree = (pi/180.0)*radian;
145 
146 static constexpr double steradian = 1.;
147 
148 // symbols
149 static constexpr double rad = radian;
150 static constexpr double mrad = milliradian;
151 static constexpr double sr = steradian;
152 static constexpr double deg = degree;
153 
154 //
155 // Time [T]
156 //
157 static constexpr double second = 1.;
158 static constexpr double nanosecond = 1.e-9 *second;
159 static constexpr double millisecond = 1.e-3 *second;
160 static constexpr double microsecond = 1.e-6 *second;
161 static constexpr double picosecond = 1.e-12*second;
162 
163 static constexpr double hertz = 1./second;
164 static constexpr double kilohertz = 1.e+3*hertz;
165 static constexpr double megahertz = 1.e+6*hertz;
166 
167 // symbols
168 static constexpr double ns = nanosecond;
169 static constexpr double s = second;
170 static constexpr double ms = millisecond;
171 static constexpr double us = microsecond;
172 static constexpr double ps = picosecond;
173 
174 //
175 // Mass [E][T^2][L^-2]
176 //
177 static constexpr double kilogram = 1.;
178 static constexpr double gram = 1.e-3*kilogram;
179 static constexpr double milligram = 1.e-3*gram;
180 
181 // symbols
182 static constexpr double kg = kilogram;
183 static constexpr double g = gram;
184 static constexpr double mg = milligram;
185 
186 //
187 // Electric current [Q][T^-1]
188 //
189 static constexpr double ampere = 1.;
190 static constexpr double milliampere = 1.e-3*ampere;
191 static constexpr double microampere = 1.e-6*ampere;
192 static constexpr double nanoampere = 1.e-9*ampere;
193 
194 //
195 // Electric charge [Q]
196 //
197 static constexpr double coulomb = ampere*second;
198 static constexpr double e_SI = 1.602176487e-19; // positron charge in coulomb
199 static constexpr double eplus = e_SI*coulomb ; // positron charge
200 
201 //
202 // Energy [E]
203 //
204 static constexpr double joule = kg*m*m/(s*s);
205 
206 static constexpr double electronvolt = e_SI*joule;
207 static constexpr double kiloelectronvolt = 1.e+3*electronvolt;
208 static constexpr double megaelectronvolt = 1.e+6*electronvolt;
209 static constexpr double gigaelectronvolt = 1.e+9*electronvolt;
210 static constexpr double teraelectronvolt = 1.e+12*electronvolt;
211 static constexpr double petaelectronvolt = 1.e+15*electronvolt;
212 
213 // symbols
214 static constexpr double MeV = megaelectronvolt;
215 static constexpr double eV = electronvolt;
216 static constexpr double keV = kiloelectronvolt;
217 static constexpr double GeV = gigaelectronvolt;
218 static constexpr double TeV = teraelectronvolt;
219 static constexpr double PeV = petaelectronvolt;
220 
221 //
222 // Power [E][T^-1]
223 //
224 static constexpr double watt = joule/second; // watt = 6.24150 e+3 * MeV/ns
225 
226 //
227 // Force [E][L^-1]
228 //
229 static constexpr double newton = joule/meter; // newton = 6.24150 e+9 * MeV/mm
230 
231 //
232 // Pressure [E][L^-3]
233 //
234 #define pascal hep_pascal // a trick to avoid warnings
235 static constexpr double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3
236 static constexpr double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3
237 static constexpr double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3
238 
239 //
240 // Electric potential [E][Q^-1]
241 //
242 static constexpr double megavolt = megaelectronvolt/eplus;
243 static constexpr double kilovolt = 1.e-3*megavolt;
244 static constexpr double volt = 1.e-6*megavolt;
245 
246 //
247 // Electric resistance [E][T][Q^-2]
248 //
249 static constexpr double ohm = volt/ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
250 
251 //
252 // Electric capacitance [Q^2][E^-1]
253 //
254 static constexpr double farad = coulomb/volt; // farad = 6.24150e+24 * eplus/Megavolt
255 static constexpr double millifarad = 1.e-3*farad;
256 static constexpr double microfarad = 1.e-6*farad;
257 static constexpr double nanofarad = 1.e-9*farad;
258 static constexpr double picofarad = 1.e-12*farad;
259 
260 //
261 // Magnetic Flux [T][E][Q^-1]
262 //
263 static constexpr double weber = volt*second; // weber = 1000*megavolt*ns
264 
265 //
266 // Magnetic Field [T][E][Q^-1][L^-2]
267 //
268 static constexpr double tesla = volt*second/meter2; // tesla =0.001*megavolt*ns/mm2
269 
270 static constexpr double gauss = 1.e-4*tesla;
271 static constexpr double kilogauss = 1.e-1*tesla;
272 
273 //
274 // Inductance [T^2][E][Q^-2]
275 //
276 static constexpr double henry = weber/ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
277 
278 //
279 // Temperature
280 //
281 static constexpr double kelvin = 1.;
282 
283 //
284 // Amount of substance
285 //
286 static constexpr double mole = 1.;
287 
288 //
289 // Activity [T^-1]
290 //
291 static constexpr double becquerel = 1./second ;
292 static constexpr double curie = 3.7e+10 * becquerel;
293 static constexpr double kilobecquerel = 1.e+3*becquerel;
294 static constexpr double megabecquerel = 1.e+6*becquerel;
295 static constexpr double gigabecquerel = 1.e+9*becquerel;
296 static constexpr double millicurie = 1.e-3*curie;
297 static constexpr double microcurie = 1.e-6*curie;
298 static constexpr double Bq = becquerel;
299 static constexpr double kBq = kilobecquerel;
300 static constexpr double MBq = megabecquerel;
301 static constexpr double GBq = gigabecquerel;
302 static constexpr double Ci = curie;
303 static constexpr double mCi = millicurie;
304 static constexpr double uCi = microcurie;
305 
306 //
307 // Absorbed dose [L^2][T^-2]
308 //
309 static constexpr double gray = joule/kilogram;
310 static constexpr double kilogray = 1.e+3*gray;
311 static constexpr double milligray = 1.e-3*gray;
312 static constexpr double microgray = 1.e-6*gray;
313 
314 //
315 // Luminous intensity [I]
316 //
317 static constexpr double candela = 1.;
318 
319 //
320 // Luminous flux [I]
321 //
322 static constexpr double lumen = candela*steradian;
323 
324 //
325 // Illuminance [I][L^-2]
326 //
327 static constexpr double lux = lumen/meter2;
328 
329 //
330 // Miscellaneous
331 //
332 static constexpr double perCent = 0.01 ;
333 static constexpr double perThousand = 0.001;
334 static constexpr double perMillion = 0.000001;
335 
336 
337 #endif /* SI_SYSTEM_OF_UNITS_HH */
static constexpr double tesla
Definition: G4SIunits.hh:268
static constexpr double parsec
Definition: G4SIunits.hh:98
static constexpr double candela
Definition: G4SIunits.hh:317
static constexpr double gigabecquerel
Definition: G4SIunits.hh:295
static constexpr double perMillion
Definition: G4SIunits.hh:334
static constexpr double MBq
Definition: G4SIunits.hh:300
static constexpr double kilogray
Definition: G4SIunits.hh:310
static constexpr double picofarad
Definition: G4SIunits.hh:258
static constexpr double km
Definition: G4SIunits.hh:133
static constexpr double henry
Definition: G4SIunits.hh:276
static constexpr double km2
Definition: G4SIunits.hh:134
static constexpr double km3
Definition: G4SIunits.hh:135
static constexpr double mm
Definition: G4SIunits.hh:115
static constexpr double mg
Definition: G4SIunits.hh:184
static constexpr double kilovolt
Definition: G4SIunits.hh:243
static constexpr double hep_pascal
Definition: G4SIunits.hh:235
static constexpr double teraelectronvolt
Definition: G4SIunits.hh:210
static constexpr double millimeter2
Definition: G4SIunits.hh:87
static constexpr double cm2
Definition: G4SIunits.hh:120
static constexpr double Bq
Definition: G4SIunits.hh:298
static constexpr double e_SI
Definition: G4SIunits.hh:198
static constexpr double millicurie
Definition: G4SIunits.hh:296
static constexpr double milliradian
Definition: G4SIunits.hh:143
static constexpr double centimeter
Definition: G4SIunits.hh:90
static constexpr double perCent
Definition: G4SIunits.hh:332
static constexpr double megaelectronvolt
Definition: G4SIunits.hh:208
static constexpr double lux
Definition: G4SIunits.hh:327
static constexpr double us
Definition: G4SIunits.hh:171
static constexpr double becquerel
Definition: G4SIunits.hh:291
static constexpr double pc
Definition: G4SIunits.hh:137
static constexpr double microcurie
Definition: G4SIunits.hh:297
static constexpr double coulomb
Definition: G4SIunits.hh:197
static constexpr double liter
Definition: G4SIunits.hh:123
static constexpr double hertz
Definition: G4SIunits.hh:163
static constexpr double nanometer
Definition: G4SIunits.hh:101
static constexpr double ampere
Definition: G4SIunits.hh:189
static constexpr double weber
Definition: G4SIunits.hh:263
static constexpr double second
Definition: G4SIunits.hh:157
static constexpr double m3
Definition: G4SIunits.hh:131
static constexpr double rad
Definition: G4SIunits.hh:149
static constexpr double millimeter3
Definition: G4SIunits.hh:88
static constexpr double watt
Definition: G4SIunits.hh:224
static constexpr double mCi
Definition: G4SIunits.hh:303
static constexpr double microfarad
Definition: G4SIunits.hh:256
static constexpr double uCi
Definition: G4SIunits.hh:304
static constexpr double electronvolt
Definition: G4SIunits.hh:206
static constexpr double newton
Definition: G4SIunits.hh:229
static constexpr double meter3
Definition: G4SIunits.hh:84
static constexpr double nanosecond
Definition: G4SIunits.hh:158
static constexpr double picosecond
Definition: G4SIunits.hh:161
static constexpr double meter
Definition: G4SIunits.hh:82
static constexpr double twopi
Definition: G4SIunits.hh:76
static constexpr double mm2
Definition: G4SIunits.hh:116
static constexpr double gram
Definition: G4SIunits.hh:178
static constexpr double microgray
Definition: G4SIunits.hh:312
static constexpr double GBq
Definition: G4SIunits.hh:301
static constexpr double TeV
Definition: G4SIunits.hh:218
static constexpr double microampere
Definition: G4SIunits.hh:191
static constexpr double kilometer2
Definition: G4SIunits.hh:95
const XML_Char * s
Definition: expat.h:262
static constexpr double um
Definition: G4SIunits.hh:113
static constexpr double m
Definition: G4SIunits.hh:129
static constexpr double gauss
Definition: G4SIunits.hh:270
static constexpr double nanobarn
Definition: G4SIunits.hh:108
static constexpr double milliampere
Definition: G4SIunits.hh:190
static constexpr double degree
Definition: G4SIunits.hh:144
static constexpr double megahertz
Definition: G4SIunits.hh:165
static constexpr double lumen
Definition: G4SIunits.hh:322
static constexpr double mm3
Definition: G4SIunits.hh:117
static constexpr double kilogauss
Definition: G4SIunits.hh:271
static constexpr double steradian
Definition: G4SIunits.hh:146
static constexpr double gray
Definition: G4SIunits.hh:309
static constexpr double cm
Definition: G4SIunits.hh:119
static constexpr double eplus
Definition: G4SIunits.hh:199
static constexpr double centimeter2
Definition: G4SIunits.hh:91
static constexpr double mrad
Definition: G4SIunits.hh:150
static constexpr double nanofarad
Definition: G4SIunits.hh:257
static constexpr double sr
Definition: G4SIunits.hh:151
static constexpr double eV
Definition: G4SIunits.hh:215
static constexpr double kilobecquerel
Definition: G4SIunits.hh:293
static constexpr double megabecquerel
Definition: G4SIunits.hh:294
static constexpr double milligray
Definition: G4SIunits.hh:311
static constexpr double PeV
Definition: G4SIunits.hh:219
static constexpr double ns
Definition: G4SIunits.hh:168
static constexpr double kg
Definition: G4SIunits.hh:182
static constexpr double kelvin
Definition: G4SIunits.hh:281
static constexpr double cm3
Definition: G4SIunits.hh:121
#define pascal
Definition: G4SIunits.hh:234
static constexpr double radian
Definition: G4SIunits.hh:142
static constexpr double millifarad
Definition: G4SIunits.hh:255
static constexpr double petaelectronvolt
Definition: G4SIunits.hh:211
static constexpr double kilohertz
Definition: G4SIunits.hh:164
static constexpr double ohm
Definition: G4SIunits.hh:249
static constexpr double gigaelectronvolt
Definition: G4SIunits.hh:209
static constexpr double kBq
Definition: G4SIunits.hh:299
static constexpr double kilogram
Definition: G4SIunits.hh:177
static constexpr double nm
Definition: G4SIunits.hh:112
static constexpr double nanoampere
Definition: G4SIunits.hh:192
static constexpr double joule
Definition: G4SIunits.hh:204
static constexpr double milligram
Definition: G4SIunits.hh:179
static constexpr double kiloelectronvolt
Definition: G4SIunits.hh:207
static constexpr double farad
Definition: G4SIunits.hh:254
static constexpr double millimeter
Definition: G4SIunits.hh:86
static constexpr double mL
Definition: G4SIunits.hh:127
static constexpr double GeV
Definition: G4SIunits.hh:217
static constexpr double megavolt
Definition: G4SIunits.hh:242
static constexpr double millisecond
Definition: G4SIunits.hh:159
static constexpr double microsecond
Definition: G4SIunits.hh:160
static constexpr double MeV
Definition: G4SIunits.hh:214
static constexpr double angstrom
Definition: G4SIunits.hh:102
static constexpr double kilometer3
Definition: G4SIunits.hh:96
static constexpr double pi
Definition: G4SIunits.hh:75
static constexpr double meter2
Definition: G4SIunits.hh:83
static constexpr double halfpi
Definition: G4SIunits.hh:77
static constexpr double perThousand
Definition: G4SIunits.hh:333
static constexpr double bar
Definition: G4SIunits.hh:236
static constexpr double volt
Definition: G4SIunits.hh:244
static constexpr double curie
Definition: G4SIunits.hh:292
static constexpr double deg
Definition: G4SIunits.hh:152
static constexpr double ms
Definition: G4SIunits.hh:170
static constexpr double ps
Definition: G4SIunits.hh:172
static constexpr double fermi
Definition: G4SIunits.hh:103
static constexpr double barn
Definition: G4SIunits.hh:105
static constexpr double L
Definition: G4SIunits.hh:124
static constexpr double cL
Definition: G4SIunits.hh:126
static constexpr double centimeter3
Definition: G4SIunits.hh:92
static constexpr double keV
Definition: G4SIunits.hh:216
static constexpr double atmosphere
Definition: G4SIunits.hh:237
static constexpr double micrometer
Definition: G4SIunits.hh:100
static constexpr double mole
Definition: G4SIunits.hh:286
static constexpr double m2
Definition: G4SIunits.hh:130
static constexpr double kilometer
Definition: G4SIunits.hh:94
static constexpr double dL
Definition: G4SIunits.hh:125
static constexpr double millibarn
Definition: G4SIunits.hh:106
static constexpr double microbarn
Definition: G4SIunits.hh:107
static constexpr double picobarn
Definition: G4SIunits.hh:109
static constexpr double Ci
Definition: G4SIunits.hh:302
static constexpr double pi2
Definition: G4SIunits.hh:78