| The Gaudi Framework v32r1 (f65d50dc)

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