Geant4  10.02
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 92196 2015-08-21 09:55:47Z 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 
68 #ifndef SI_SYSTEM_OF_UNITS_HH
69 #define SI_SYSTEM_OF_UNITS_HH
70 
71 //
72 //
73 //
74 static const double pi = 3.14159265358979323846;
75 static const double twopi = 2*pi;
76 static const double halfpi = pi/2;
77 static const double pi2 = pi*pi;
78 //
79 // Length [L]
80 //
81 static const double meter = 1.;
82 static const double meter2 = meter*meter;
83 static const double meter3 = meter*meter*meter;
84 
85 static const double millimeter = 0.001*meter;
86 static const double millimeter2 = millimeter*millimeter;
88 
89 static const double centimeter = 10.*millimeter;
90 static const double centimeter2 = centimeter*centimeter;
92 
93 static const double kilometer = 1000.*meter;
94 static const double kilometer2 = kilometer*kilometer;
95 static const double kilometer3 = kilometer*kilometer*kilometer;
96 
97 static const double parsec = 3.0856775807e+16*meter;
98 
99 static const double micrometer = 1.e-6 *meter;
100 static const double nanometer = 1.e-9 *meter;
101 static const double angstrom = 1.e-10*meter;
102 static const double fermi = 1.e-15*meter;
103 
104 static const double barn = 1.e-28*meter2;
105 static const double millibarn = 1.e-3 *barn;
106 static const double microbarn = 1.e-6 *barn;
107 static const double nanobarn = 1.e-9 *barn;
108 static const double picobarn = 1.e-12*barn;
109 
110 // symbols
111 static const double nm = nanometer;
112 static const double um = micrometer;
113 
114 static const double mm = millimeter;
115 static const double mm2 = millimeter2;
116 static const double mm3 = millimeter3;
117 
118 static const double cm = centimeter;
119 static const double cm2 = centimeter2;
120 static const double cm3 = centimeter3;
121 
122 static const double liter = 1.e+3*cm3;
123 static const double L = liter;
124 static const double dL = 1.e-1*liter;
125 static const double cL = 1.e-2*liter;
126 static const double mL = 1.e-3*liter;
127 
128 static const double m = meter;
129 static const double m2 = meter2;
130 static const double m3 = meter3;
131 
132 static const double km = kilometer;
133 static const double km2 = kilometer2;
134 static const double km3 = kilometer3;
135 
136 static const double pc = parsec;
137 
138 //
139 // Angle
140 //
141 static const double radian = 1.;
142 static const double milliradian = 1.e-3*radian;
143 static const double degree = (pi/180.0)*radian;
144 
145 static const double steradian = 1.;
146 
147 // symbols
148 static const double rad = radian;
149 static const double mrad = milliradian;
150 static const double sr = steradian;
151 static const double deg = degree;
152 
153 //
154 // Time [T]
155 //
156 static const double second = 1.;
157 static const double nanosecond = 1.e-9 *second;
158 static const double millisecond = 1.e-3 *second;
159 static const double microsecond = 1.e-6 *second;
160 static const double picosecond = 1.e-12*second;
161 
162 static const double hertz = 1./second;
163 static const double kilohertz = 1.e+3*hertz;
164 static const double megahertz = 1.e+6*hertz;
165 
166 // symbols
167 static const double ns = nanosecond;
168 static const double s = second;
169 static const double ms = millisecond;
170 
171 //
172 // Mass [E][T^2][L^-2]
173 //
174 static const double kilogram = 1.;
175 static const double gram = 1.e-3*kilogram;
176 static const double milligram = 1.e-3*gram;
177 
178 // symbols
179 static const double kg = kilogram;
180 static const double g = gram;
181 static const double mg = milligram;
182 
183 //
184 // Electric current [Q][T^-1]
185 //
186 static const double ampere = 1.;
187 static const double milliampere = 1.e-3*ampere;
188 static const double microampere = 1.e-6*ampere;
189 static const double nanoampere = 1.e-9*ampere;
190 
191 //
192 // Electric charge [Q]
193 //
194 static const double coulomb = ampere*second;
195 static const double e_SI = 1.602176487e-19; // positron charge in coulomb
196 static const double eplus = e_SI*coulomb ; // positron charge
197 
198 //
199 // Energy [E]
200 //
201 static const double joule = kg*m*m/(s*s);
202 
203 static const double electronvolt = e_SI*joule;
204 static const double kiloelectronvolt = 1.e+3*electronvolt;
205 static const double megaelectronvolt = 1.e+6*electronvolt;
206 static const double gigaelectronvolt = 1.e+9*electronvolt;
207 static const double teraelectronvolt = 1.e+12*electronvolt;
208 static const double petaelectronvolt = 1.e+15*electronvolt;
209 
210 // symbols
211 static const double MeV = megaelectronvolt;
212 static const double eV = electronvolt;
213 static const double keV = kiloelectronvolt;
214 static const double GeV = gigaelectronvolt;
215 static const double TeV = teraelectronvolt;
216 static const double PeV = petaelectronvolt;
217 
218 //
219 // Power [E][T^-1]
220 //
221 static const double watt = joule/second; // watt = 6.24150 e+3 * MeV/ns
222 
223 //
224 // Force [E][L^-1]
225 //
226 static const double newton = joule/meter; // newton = 6.24150 e+9 * MeV/mm
227 
228 //
229 // Pressure [E][L^-3]
230 //
231 #define pascal hep_pascal // a trick to avoid warnings
232 static const double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3
233 static const double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3
234 static const double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3
235 
236 //
237 // Electric potential [E][Q^-1]
238 //
239 static const double megavolt = megaelectronvolt/eplus;
240 static const double kilovolt = 1.e-3*megavolt;
241 static const double volt = 1.e-6*megavolt;
242 
243 //
244 // Electric resistance [E][T][Q^-2]
245 //
246 static const double ohm = volt/ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
247 
248 //
249 // Electric capacitance [Q^2][E^-1]
250 //
251 static const double farad = coulomb/volt; // farad = 6.24150e+24 * eplus/Megavolt
252 static const double millifarad = 1.e-3*farad;
253 static const double microfarad = 1.e-6*farad;
254 static const double nanofarad = 1.e-9*farad;
255 static const double picofarad = 1.e-12*farad;
256 
257 //
258 // Magnetic Flux [T][E][Q^-1]
259 //
260 static const double weber = volt*second; // weber = 1000*megavolt*ns
261 
262 //
263 // Magnetic Field [T][E][Q^-1][L^-2]
264 //
265 static const double tesla = volt*second/meter2; // tesla =0.001*megavolt*ns/mm2
266 
267 static const double gauss = 1.e-4*tesla;
268 static const double kilogauss = 1.e-1*tesla;
269 
270 //
271 // Inductance [T^2][E][Q^-2]
272 //
273 static const double henry = weber/ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
274 
275 //
276 // Temperature
277 //
278 static const double kelvin = 1.;
279 
280 //
281 // Amount of substance
282 //
283 static const double mole = 1.;
284 
285 //
286 // Activity [T^-1]
287 //
288 static const double becquerel = 1./second ;
289 static const double curie = 3.7e+10 * becquerel;
290 static const double kilobecquerel = 1.e+3*becquerel;
291 static const double megabecquerel = 1.e+6*becquerel;
292 static const double gigabecquerel = 1.e+9*becquerel;
293 static const double millicurie = 1.e-3*curie;
294 static const double microcurie = 1.e-6*curie;
295 static const double Bq = becquerel;
296 static const double kBq = kilobecquerel;
297 static const double MBq = megabecquerel;
298 static const double GBq = gigabecquerel;
299 static const double Ci = curie;
300 static const double mCi = millicurie;
301 static const double uCi = microcurie;
302 
303 //
304 // Absorbed dose [L^2][T^-2]
305 //
306 static const double gray = joule/kilogram;
307 static const double kilogray = 1.e+3*gray;
308 static const double milligray = 1.e-3*gray;
309 static const double microgray = 1.e-6*gray;
310 
311 //
312 // Luminous intensity [I]
313 //
314 static const double candela = 1.;
315 
316 //
317 // Luminous flux [I]
318 //
319 static const double lumen = candela*steradian;
320 
321 //
322 // Illuminance [I][L^-2]
323 //
324 static const double lux = lumen/meter2;
325 
326 //
327 // Miscellaneous
328 //
329 static const double perCent = 0.01 ;
330 static const double perThousand = 0.001;
331 static const double perMillion = 0.000001;
332 
333 
334 #endif /* SI_SYSTEM_OF_UNITS_HH */
static const double cm
Definition: G4SIunits.hh:118
static const double kilometer3
Definition: G4SIunits.hh:95
static const double megavolt
Definition: G4SIunits.hh:239
static const double gram
Definition: G4SIunits.hh:175
static const double farad
Definition: G4SIunits.hh:251
static const double lux
Definition: G4SIunits.hh:324
static const double MeV
Definition: G4SIunits.hh:211
static const double uCi
Definition: G4SIunits.hh:301
static const double lumen
Definition: G4SIunits.hh:319
static const double megaelectronvolt
Definition: G4SIunits.hh:205
static const double cm2
Definition: G4SIunits.hh:119
static const double halfpi
Definition: G4SIunits.hh:76
static const double kilometer
Definition: G4SIunits.hh:93
static const double nanobarn
Definition: G4SIunits.hh:107
static const double milligram
Definition: G4SIunits.hh:176
static const double GBq
Definition: G4SIunits.hh:298
static const double liter
Definition: G4SIunits.hh:122
static const double m3
Definition: G4SIunits.hh:130
static const double nanofarad
Definition: G4SIunits.hh:254
static const double nanometer
Definition: G4SIunits.hh:100
static const double volt
Definition: G4SIunits.hh:241
static const double millimeter3
Definition: G4SIunits.hh:87
static const double microbarn
Definition: G4SIunits.hh:106
static const double kilogray
Definition: G4SIunits.hh:307
static const double hep_pascal
Definition: G4SIunits.hh:232
static const double km2
Definition: G4SIunits.hh:133
static const double candela
Definition: G4SIunits.hh:314
static const double joule
Definition: G4SIunits.hh:201
static const double centimeter3
Definition: G4SIunits.hh:91
static const double kilohertz
Definition: G4SIunits.hh:163
static const double perThousand
Definition: G4SIunits.hh:330
static const double parsec
Definition: G4SIunits.hh:97
static const double mg
Definition: G4SIunits.hh:181
static const double henry
Definition: G4SIunits.hh:273
static const double MBq
Definition: G4SIunits.hh:297
static const double pi2
Definition: G4SIunits.hh:77
static const double microfarad
Definition: G4SIunits.hh:253
static const double milligray
Definition: G4SIunits.hh:308
static const double L
Definition: G4SIunits.hh:123
static const double watt
Definition: G4SIunits.hh:221
static const double newton
Definition: G4SIunits.hh:226
static const double steradian
Definition: G4SIunits.hh:145
static const double centimeter2
Definition: G4SIunits.hh:90
static const double s
Definition: G4SIunits.hh:168
static const double ohm
Definition: G4SIunits.hh:246
static const double microgray
Definition: G4SIunits.hh:309
static const double ms
Definition: G4SIunits.hh:169
static const double microsecond
Definition: G4SIunits.hh:159
static const double millimeter2
Definition: G4SIunits.hh:86
static const double kilobecquerel
Definition: G4SIunits.hh:290
static const double kiloelectronvolt
Definition: G4SIunits.hh:204
static const double km3
Definition: G4SIunits.hh:134
static const double megahertz
Definition: G4SIunits.hh:164
static const double electronvolt
Definition: G4SIunits.hh:203
static const double meter2
Definition: G4SIunits.hh:82
static const double m2
Definition: G4SIunits.hh:129
static const double meter
Definition: G4SIunits.hh:81
static const double deg
Definition: G4SIunits.hh:151
static const double coulomb
Definition: G4SIunits.hh:194
static const double nm
Definition: G4SIunits.hh:111
static const double twopi
Definition: G4SIunits.hh:75
static const double becquerel
Definition: G4SIunits.hh:288
static const double Bq
Definition: G4SIunits.hh:295
static const double cL
Definition: G4SIunits.hh:125
static const double cm3
Definition: G4SIunits.hh:120
static const double kg
Definition: G4SIunits.hh:179
static const double second
Definition: G4SIunits.hh:156
static const double GeV
Definition: G4SIunits.hh:214
static const double microcurie
Definition: G4SIunits.hh:294
static const double megabecquerel
Definition: G4SIunits.hh:291
static const double perCent
Definition: G4SIunits.hh:329
static const double bar
Definition: G4SIunits.hh:233
static const double Ci
Definition: G4SIunits.hh:299
static const double millisecond
Definition: G4SIunits.hh:158
static const double mrad
Definition: G4SIunits.hh:149
static const double millicurie
Definition: G4SIunits.hh:293
static const double teraelectronvolt
Definition: G4SIunits.hh:207
static const double pc
Definition: G4SIunits.hh:136
static const double hertz
Definition: G4SIunits.hh:162
static const double nanoampere
Definition: G4SIunits.hh:189
static const double rad
Definition: G4SIunits.hh:148
static const double kelvin
Definition: G4SIunits.hh:278
static const double curie
Definition: G4SIunits.hh:289
#define pascal
Definition: G4SIunits.hh:231
static const double gray
Definition: G4SIunits.hh:306
static const double kilovolt
Definition: G4SIunits.hh:240
static const double centimeter
Definition: G4SIunits.hh:89
static const double perMillion
Definition: G4SIunits.hh:331
static const double micrometer
Definition: G4SIunits.hh:99
static const double eV
Definition: G4SIunits.hh:212
static const double mCi
Definition: G4SIunits.hh:300
static const double picofarad
Definition: G4SIunits.hh:255
static const double PeV
Definition: G4SIunits.hh:216
static const double mm2
Definition: G4SIunits.hh:115
static const double nanosecond
Definition: G4SIunits.hh:157
static const double mL
Definition: G4SIunits.hh:126
static const double pi
Definition: G4SIunits.hh:74
static const double km
Definition: G4SIunits.hh:132
static const double e_SI
Definition: G4SIunits.hh:195
static const double millifarad
Definition: G4SIunits.hh:252
static const double kilogram
Definition: G4SIunits.hh:174
static const double g
Definition: G4SIunits.hh:180
static const double dL
Definition: G4SIunits.hh:124
static const double gauss
Definition: G4SIunits.hh:267
static const double atmosphere
Definition: G4SIunits.hh:234
static const double gigaelectronvolt
Definition: G4SIunits.hh:206
static const double petaelectronvolt
Definition: G4SIunits.hh:208
static const double millibarn
Definition: G4SIunits.hh:105
static const double degree
Definition: G4SIunits.hh:143
static const double milliampere
Definition: G4SIunits.hh:187
static const double um
Definition: G4SIunits.hh:112
static const double mole
Definition: G4SIunits.hh:283
static const double millimeter
Definition: G4SIunits.hh:85
static const double radian
Definition: G4SIunits.hh:141
static const double kBq
Definition: G4SIunits.hh:296
static const double TeV
Definition: G4SIunits.hh:215
static const double m
Definition: G4SIunits.hh:128
static const double keV
Definition: G4SIunits.hh:213
static const double barn
Definition: G4SIunits.hh:104
static const double picosecond
Definition: G4SIunits.hh:160
static const double tesla
Definition: G4SIunits.hh:265
static const double eplus
Definition: G4SIunits.hh:196
static const double kilogauss
Definition: G4SIunits.hh:268
static const double sr
Definition: G4SIunits.hh:150
static const double microampere
Definition: G4SIunits.hh:188
static const double mm
Definition: G4SIunits.hh:114
static const double ampere
Definition: G4SIunits.hh:186
static const double milliradian
Definition: G4SIunits.hh:142
static const double fermi
Definition: G4SIunits.hh:102
static const double gigabecquerel
Definition: G4SIunits.hh:292
static const double meter3
Definition: G4SIunits.hh:83
static const double weber
Definition: G4SIunits.hh:260
static const double kilometer2
Definition: G4SIunits.hh:94
static const double ns
Definition: G4SIunits.hh:167
static const double angstrom
Definition: G4SIunits.hh:101
static const double picobarn
Definition: G4SIunits.hh:108
static const double mm3
Definition: G4SIunits.hh:116