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