The Gaudi Framework  master (37c0b60a)
SystemOfUnits.py
Go to the documentation of this file.
1 
15 
16 # This script is a direct adaptation of CLHEP/Units/SystemOfUnits.h
17 # and the following is the originial CLHEP comment:
18 #
19 # -----
20 # HEP coherent system of Units
21 #
22 # This file has been provided to CLHEP by Geant4 (simulation toolkit for HEP).
23 #
24 # The basic units are :
25 # millimeter (millimeter)
26 # nanosecond (nanosecond)
27 # Mega electron Volt (MeV)
28 # positron charge (eplus)
29 # degree Kelvin (kelvin)
30 # the amount of substance (mole)
31 # luminous intensity (candela)
32 # radian (radian)
33 # steradian (steradian)
34 #
35 # Below is a non exhaustive list of derived and pratical units
36 # (i.e. mostly the SI units).
37 # You can add your own units.
38 #
39 # The SI numerical value of the positron charge is defined here,
40 # as it is needed for conversion factor : positron charge = e_SI (coulomb)
41 #
42 # The others physical constants are defined in the header file :
43 # PhysicalConstants.h
44 #
45 # Authors: M.Maire, S.Giani
46 #
47 # History:
48 #
49 # 06.02.96 Created.
50 # 28.03.96 Added miscellaneous constants.
51 # 05.12.97 E.Tcherniaev: Redefined pascal (to avoid warnings on WinNT)
52 # 20.05.98 names: meter, second, gram, radian, degree
53 # (from Brian.Lasiuk@yale.edu (STAR)). Added luminous units.
54 # 05.08.98 angstrom, picobarn, microsecond, picosecond, petaelectronvolt
55 # 01.03.01 parsec
56 # -----
57 
58 #
59 # Length [L]
60 #
61 millimeter = 1.0
62 millimeter2 = millimeter * millimeter
63 millimeter3 = millimeter * millimeter * millimeter
64 
65 centimeter = 10.0 * millimeter
66 centimeter2 = centimeter * centimeter
67 centimeter3 = centimeter * centimeter * centimeter
68 
69 meter = 1000.0 * millimeter
70 meter2 = meter * meter
71 meter3 = meter * meter * meter
72 
73 kilometer = 1000.0 * meter
74 kilometer2 = kilometer * kilometer
75 kilometer3 = kilometer * kilometer * kilometer
76 
77 parsec = 3.0856775807e16 * meter
78 
79 micrometer = 1.0e-6 * meter
80 nanometer = 1.0e-9 * meter
81 angstrom = 1.0e-10 * meter
82 fermi = 1.0e-15 * meter
83 
84 barn = 1.0e-28 * meter2
85 millibarn = 1.0e-3 * barn
86 microbarn = 1.0e-6 * barn
87 nanobarn = 1.0e-9 * barn
88 picobarn = 1.0e-12 * barn
89 
90 liter = 1.0e3 * centimeter3
91 L = liter
92 dL = 1.0e-1 * liter
93 cL = 1.0e-2 * liter
94 mL = 1.0e-3 * liter
95 
96 # symbols
97 mm = millimeter
98 mm2 = millimeter2
99 mm3 = millimeter3
100 
101 cm = centimeter
102 cm2 = centimeter2
103 cm3 = centimeter3
104 
105 m = meter
106 m2 = meter2
107 m3 = meter3
108 
109 km = kilometer
110 km2 = kilometer2
111 km3 = kilometer3
112 
113 pc = parsec
114 
115 #
116 # Angle
117 #
118 radian = 1.0
119 milliradian = 1.0e-3 * radian
120 degree = (3.14159265358979323846 / 180.0) * radian
121 
122 steradian = 1.0
123 
124 # symbols
125 rad = radian
126 mrad = milliradian
127 sr = steradian
128 deg = degree
129 
130 #
131 # Time [T]
132 #
133 nanosecond = 1.0
134 second = 1.0e9 * nanosecond
135 millisecond = 1.0e-3 * second
136 microsecond = 1.0e-6 * second
137 picosecond = 1.0e-12 * second
138 femtosecond = 1.0e-15 * second
139 
140 hertz = 1.0 / second
141 kilohertz = 1.0e3 * hertz
142 megahertz = 1.0e6 * hertz
143 
144 # symbols
145 ns = nanosecond
146 s = second
147 ms = millisecond
148 us = microsecond
149 ps = picosecond
150 
151 #
152 # Electric charge [Q]
153 #
154 eplus = 1.0 # positron charge
155 e_SI = 1.602176487e-19 # positron charge in coulomb
156 coulomb = eplus / e_SI # coulomb = 6.24150 e+18 * eplus
157 
158 #
159 # Energy [E]
160 #
161 megaelectronvolt = 1.0
162 electronvolt = 1.0e-6 * megaelectronvolt
163 kiloelectronvolt = 1.0e-3 * megaelectronvolt
164 gigaelectronvolt = 1.0e3 * megaelectronvolt
165 teraelectronvolt = 1.0e6 * megaelectronvolt
166 petaelectronvolt = 1.0e9 * megaelectronvolt
167 
168 joule = electronvolt / e_SI # joule = 6.24150 e+12 * MeV
169 
170 # symbols
171 MeV = megaelectronvolt
172 eV = electronvolt
173 keV = kiloelectronvolt
174 GeV = gigaelectronvolt
175 TeV = teraelectronvolt
176 PeV = petaelectronvolt
177 
178 #
179 # Mass [E][T^2][L^-2]
180 #
181 kilogram = joule * second * second / (meter * meter)
182 gram = 1.0e-3 * kilogram
183 milligram = 1.0e-3 * gram
184 
185 # symbols
186 kg = kilogram
187 g = gram
188 mg = milligram
189 
190 #
191 # Power [E][T^-1]
192 #
193 watt = joule / second # watt = 6.24150 e+3 * MeV/ns
194 
195 #
196 # Force [E][L^-1]
197 #
198 newton = joule / meter # newton = 6.24150 e+9 * MeV/mm
199 
200 #
201 # Pressure [E][L^-3]
202 #
203 hep_pascal = newton / m2 # pascal = 6.24150 e+3 * MeV/mm3
204 pascal = hep_pascal # a trick to avoid warnings
205 bar = 100000 * pascal # bar = 6.24150 e+8 * MeV/mm3
206 atmosphere = 101325 * pascal # atm = 6.32420 e+8 * MeV/mm3
207 
208 #
209 # Electric current [Q][T^-1]
210 #
211 ampere = coulomb / second # ampere = 6.24150 e+9 * eplus/ns
212 milliampere = 1.0e-3 * ampere
213 microampere = 1.0e-6 * ampere
214 nanoampere = 1.0e-9 * ampere
215 
216 #
217 # Electric potential [E][Q^-1]
218 #
219 megavolt = megaelectronvolt / eplus
220 kilovolt = 1.0e-3 * megavolt
221 volt = 1.0e-6 * megavolt
222 
223 #
224 # Electric resistance [E][T][Q^-2]
225 #
226 # ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
227 ohm = volt / ampere
228 
229 #
230 # Electric capacitance [Q^2][E^-1]
231 #
232 # farad = 6.24150e+24 * eplus/Megavolt
233 farad = coulomb / volt
234 millifarad = 1.0e-3 * farad
235 microfarad = 1.0e-6 * farad
236 nanofarad = 1.0e-9 * farad
237 picofarad = 1.0e-12 * farad
238 
239 #
240 # Magnetic Flux [T][E][Q^-1]
241 #
242 weber = volt * second # weber = 1000*megavolt*ns
243 
244 #
245 # Magnetic Field [T][E][Q^-1][L^-2]
246 #
247 tesla = volt * second / meter2 # tesla =0.001*megavolt*ns/mm2
248 
249 gauss = 1.0e-4 * tesla
250 kilogauss = 1.0e-1 * tesla
251 
252 #
253 # Inductance [T^2][E][Q^-2]
254 #
255 # henry = 1.60217e-7*MeV*(ns/eplus)**2
256 henry = weber / ampere
257 
258 #
259 # Temperature
260 #
261 kelvin = 1.0
262 
263 #
264 # Amount of substance
265 #
266 mole = 1.0
267 
268 #
269 # Activity [T^-1]
270 #
271 becquerel = 1.0 / second
272 curie = 3.7e10 * becquerel
273 kilobecquerel = 1.0e3 * becquerel
274 megabecquerel = 1.0e6 * becquerel
275 gigabecquerel = 1.0e9 * becquerel
276 millicurie = 1.0e-3 * curie
277 microcurie = 1.0e-6 * curie
278 Bq = becquerel
279 kBq = kilobecquerel
280 MBq = megabecquerel
281 GBq = gigabecquerel
282 Ci = curie
283 mCi = millicurie
284 uCi = microcurie
285 
286 #
287 # Absorbed dose [L^2][T^-2]
288 #
289 gray = joule / kilogram
290 kilogray = 1.0e3 * gray
291 milligray = 1.0e-3 * gray
292 microgray = 1.0e-6 * gray
293 
294 #
295 # Luminous intensity [I]
296 #
297 candela = 1.0
298 
299 #
300 # Luminous flux [I]
301 #
302 lumen = candela * steradian
303 
304 #
305 # Illuminance [I][L^-2]
306 #
307 lux = lumen / meter2
308 
309 #
310 # Miscellaneous
311 #
312 perCent = 0.01
313 perThousand = 0.001
314 perMillion = 0.000001