| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
47 namespace Units
48 {
49
50 //
51 // Length [L]
52 //
53 constexpr double millimeter = 1.;
54 constexpr double millimeter2 = millimeter * millimeter;
55 constexpr double millimeter3 = millimeter * millimeter * millimeter;
56
57 constexpr double centimeter = 10. * millimeter;
58 constexpr double centimeter2 = centimeter * centimeter;
59 constexpr double centimeter3 = centimeter * centimeter * centimeter;
60
61 constexpr double meter = 1000. * millimeter;
62 constexpr double meter2 = meter * meter;
63 constexpr double meter3 = meter * meter * meter;
64
65 constexpr double kilometer = 1000. * meter;
66 constexpr double kilometer2 = kilometer * kilometer;
67 constexpr double kilometer3 = kilometer * kilometer * kilometer;
68
69 constexpr double parsec = 3.0856775807e+16 * meter;
70
71 constexpr double micrometer = 1.e-6 * meter;
72 constexpr double nanometer = 1.e-9 * meter;
73 constexpr double angstrom = 1.e-10 * meter;
74 constexpr double fermi = 1.e-15 * meter;
75
76 constexpr double barn = 1.e-28 * meter2;
77 constexpr double millibarn = 1.e-3 * barn;
78 constexpr double microbarn = 1.e-6 * barn;
79 constexpr double nanobarn = 1.e-9 * barn;
80 constexpr double picobarn = 1.e-12 * barn;
81
82 // symbols
83 constexpr double nm = nanometer;
84 constexpr double um = micrometer;
85
86 constexpr double mm = millimeter;
87 constexpr double mm2 = millimeter2;
88 constexpr double mm3 = millimeter3;
89
90 constexpr double cm = centimeter;
91 constexpr double cm2 = centimeter2;
92 constexpr double cm3 = centimeter3;
93
94 constexpr double m = meter;
95 constexpr double m2 = meter2;
96 constexpr double m3 = meter3;
97
98 constexpr double km = kilometer;
99 constexpr double km2 = kilometer2;
100 constexpr double km3 = kilometer3;
101
102 constexpr double pc = parsec;
103
104 //
105 // Angle
106 //
107 constexpr double radian = 1.;
108 constexpr double milliradian = 1.e-3 * radian;
109 constexpr double degree = ( 3.14159265358979323846 / 180.0 ) * radian;
110
111 constexpr double steradian = 1.;
112
113 // symbols
114 constexpr double rad = radian;
115 constexpr double mrad = milliradian;
116 constexpr double sr = steradian;
117 constexpr double deg = degree;
118
119 //
120 // Time [T]
121 //
122 constexpr double nanosecond = 1.;
123 constexpr double second = 1.e+9 * nanosecond;
124 constexpr double millisecond = 1.e-3 * second;
125 constexpr double microsecond = 1.e-6 * second;
126 constexpr double picosecond = 1.e-12 * second;
127 constexpr double femtosecond = 1.e-15 * second;
128
129 constexpr double hertz = 1. / second;
130 constexpr double kilohertz = 1.e+3 * hertz;
131 constexpr double megahertz = 1.e+6 * hertz;
132
133 // symbols
134 constexpr double ns = nanosecond;
135 constexpr double s = second;
136 constexpr double ms = millisecond;
137
138 //
139 // Electric charge [Q]
140 //
141 constexpr double eplus = 1.; // positron charge
142 constexpr double e_SI = 1.60217733e-19; // positron charge in coulomb
143 constexpr double coulomb = eplus / e_SI; // coulomb = 6.24150 e+18 * eplus
144
145 //
146 // Energy [E]
147 //
148 constexpr double megaelectronvolt = 1.;
149 constexpr double electronvolt = 1.e-6 * megaelectronvolt;
150 constexpr double kiloelectronvolt = 1.e-3 * megaelectronvolt;
151 constexpr double gigaelectronvolt = 1.e+3 * megaelectronvolt;
152 constexpr double teraelectronvolt = 1.e+6 * megaelectronvolt;
153 constexpr double petaelectronvolt = 1.e+9 * megaelectronvolt;
154
155 constexpr double joule = electronvolt / e_SI; // joule = 6.24150 e+12 * MeV
156
157 // symbols
158 constexpr double MeV = megaelectronvolt;
159 constexpr double eV = electronvolt;
160 constexpr double keV = kiloelectronvolt;
161 constexpr double GeV = gigaelectronvolt;
162 constexpr double TeV = teraelectronvolt;
163 constexpr double PeV = petaelectronvolt;
164
165 //
166 // Mass [E][T^2][L^-2]
167 //
168 constexpr double kilogram = joule * second * second / ( meter * meter );
169 constexpr double gram = 1.e-3 * kilogram;
170 constexpr double milligram = 1.e-3 * gram;
171
172 // symbols
173 constexpr double kg = kilogram;
174 constexpr double g = gram;
175 constexpr double mg = milligram;
176
177 //
178 // Power [E][T^-1]
179 //
180 constexpr double watt = joule / second; // watt = 6.24150 e+3 * MeV/ns
181
182 //
183 // Force [E][L^-1]
184 //
185 constexpr double newton = joule / meter; // newton = 6.24150 e+9 * MeV/mm
186
187 //
188 // Pressure [E][L^-3]
189 //
190 constexpr double Pa = newton / m2; // pascal = 6.24150 e+3 * MeV/mm3
191 constexpr double bar = 100000 * Pa; // bar = 6.24150 e+8 * MeV/mm3
192 constexpr double atmosphere = 101325 * Pa; // atm = 6.32420 e+8 * MeV/mm3
193
194 //
195 // Electric current [Q][T^-1]
196 //
197 constexpr double ampere = coulomb / second; // ampere = 6.24150 e+9 * eplus/ns
198 constexpr double milliampere = 1.e-3 * ampere;
199 constexpr double microampere = 1.e-6 * ampere;
200 constexpr double nanoampere = 1.e-9 * ampere;
201
202 //
203 // Electric potential [E][Q^-1]
204 //
205 constexpr double megavolt = megaelectronvolt / eplus;
206 constexpr double kilovolt = 1.e-3 * megavolt;
207 constexpr double volt = 1.e-6 * megavolt;
208
209 //
210 // Electric resistance [E][T][Q^-2]
211 //
212 constexpr double ohm = volt / ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
213
214 //
215 // Electric capacitance [Q^2][E^-1]
216 //
217 constexpr double farad = coulomb / volt; // farad = 6.24150e+24 * eplus/Megavolt
218 constexpr double millifarad = 1.e-3 * farad;
219 constexpr double microfarad = 1.e-6 * farad;
220 constexpr double nanofarad = 1.e-9 * farad;
221 constexpr double picofarad = 1.e-12 * farad;
222
223 //
224 // Magnetic Flux [T][E][Q^-1]
225 //
226 constexpr double weber = volt * second; // weber = 1000*megavolt*ns
227
228 //
229 // Magnetic Field [T][E][Q^-1][L^-2]
230 //
231 constexpr double tesla = volt * second / meter2; // tesla =0.001*megavolt*ns/mm2
232
233 constexpr double gauss = 1.e-4 * tesla;
234 constexpr double kilogauss = 1.e-1 * tesla;
235
236 //
237 // Inductance [T^2][E][Q^-2]
238 //
239 constexpr double henry = weber / ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
240
241 //
242 // Temperature
243 //
244 constexpr double kelvin = 1.;
245
246 //
247 // Amount of substance
248 //
249 constexpr double mole = 1.;
250
251 //
252 // Activity [T^-1]
253 //
254 constexpr double becquerel = 1. / second;
255 constexpr double curie = 3.7e+10 * becquerel;
256
257 //
258 // Absorbed dose [L^2][T^-2]
259 //
260 constexpr double gray = joule / kilogram;
261
262 //
263 // Luminous intensity [I]
264 //
265 constexpr double candela = 1.;
266
267 //
268 // Luminous flux [I]
269 //
270 constexpr double lumen = candela * steradian;
271
272 //
273 // Illuminance [I][L^-2]
274 //
275 constexpr double lux = lumen / meter2;
276
277 //
278 // Miscellaneous
279 //
280 constexpr double perCent = 0.01;
281 constexpr double perThousand = 0.001;
282 constexpr double perMillion = 0.000001;
283
284 } // namespace Units
285 } // namespace Gaudi
286
287 #endif /* GAUDI_SYSTEM_OF_UNITS_H */
Gaudi::Units::e_SI
constexpr double e_SI
Definition: SystemOfUnits.h:142
Gaudi::Units::radian
constexpr double radian
Definition: SystemOfUnits.h:107
Gaudi::Units::gigaelectronvolt
constexpr double gigaelectronvolt
Definition: SystemOfUnits.h:151
Gaudi::Units::candela
constexpr double candela
Definition: SystemOfUnits.h:265
Gaudi::Units::sr
constexpr double sr
Definition: SystemOfUnits.h:116
Gaudi::Units::degree
constexpr double degree
Definition: SystemOfUnits.h:109
Gaudi::Units::teraelectronvolt
constexpr double teraelectronvolt
Definition: SystemOfUnits.h:152
Gaudi::Units::deg
constexpr double deg
Definition: SystemOfUnits.h:117
Gaudi::Units::s
constexpr double s
Definition: SystemOfUnits.h:135
Gaudi::Units::keV
constexpr double keV
Definition: SystemOfUnits.h:160
Gaudi::Units::barn
constexpr double barn
Definition: SystemOfUnits.h:76
Gaudi::Units::m2
constexpr double m2
Definition: SystemOfUnits.h:95
Gaudi::Units::um
constexpr double um
Definition: SystemOfUnits.h:84
Gaudi::Units::km
constexpr double km
Definition: SystemOfUnits.h:98
Gaudi::Units::eplus
constexpr double eplus
Definition: SystemOfUnits.h:141
Gaudi::Units::Pa
constexpr double Pa
Definition: SystemOfUnits.h:190
Gaudi::Units::mg
constexpr double mg
Definition: SystemOfUnits.h:175
Gaudi::Units::ohm
constexpr double ohm
Definition: SystemOfUnits.h:212
Gaudi::Units::parsec
constexpr double parsec
Definition: SystemOfUnits.h:69
Gaudi::Units::kilogauss
constexpr double kilogauss
Definition: SystemOfUnits.h:234
Gaudi::Units::MeV
constexpr double MeV
Definition: SystemOfUnits.h:158
Gaudi::Units::henry
constexpr double henry
Definition: SystemOfUnits.h:239
Gaudi::Units::fermi
constexpr double fermi
Definition: SystemOfUnits.h:74
Gaudi::Units::kiloelectronvolt
constexpr double kiloelectronvolt
Definition: SystemOfUnits.h:150
Gaudi::Units::lux
constexpr double lux
Definition: SystemOfUnits.h:275
Gaudi::Units::nanobarn
constexpr double nanobarn
Definition: SystemOfUnits.h:79
Gaudi::Units::km3
constexpr double km3
Definition: SystemOfUnits.h:100
Gaudi::Units::volt
constexpr double volt
Definition: SystemOfUnits.h:207
Gaudi::Units::milligram
constexpr double milligram
Definition: SystemOfUnits.h:170
Gaudi::Units::milliradian
constexpr double milliradian
Definition: SystemOfUnits.h:108
Gaudi::Units::microsecond
constexpr double microsecond
Definition: SystemOfUnits.h:125
Gaudi::Units::rad
constexpr double rad
Definition: SystemOfUnits.h:114
Gaudi::Units::pc
constexpr double pc
Definition: SystemOfUnits.h:102
Gaudi::Units::perCent
constexpr double perCent
Definition: SystemOfUnits.h:280
Gaudi::Units::kilometer
constexpr double kilometer
Definition: SystemOfUnits.h:65
Gaudi::Units::mm
constexpr double mm
Definition: SystemOfUnits.h:86
Gaudi::Units::angstrom
constexpr double angstrom
Definition: SystemOfUnits.h:73
Gaudi::Units::kilometer3
constexpr double kilometer3
Definition: SystemOfUnits.h:67
Gaudi::Units::mm3
constexpr double mm3
Definition: SystemOfUnits.h:88
Gaudi::Units::becquerel
constexpr double becquerel
Definition: SystemOfUnits.h:254
Gaudi::Units::millifarad
constexpr double millifarad
Definition: SystemOfUnits.h:218
Gaudi::Units::PeV
constexpr double PeV
Definition: SystemOfUnits.h:163
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:123
Gaudi::Units::meter3
constexpr double meter3
Definition: SystemOfUnits.h:63
Gaudi::Units::eV
constexpr double eV
Definition: SystemOfUnits.h:159
Gaudi::Units::milliampere
constexpr double milliampere
Definition: SystemOfUnits.h:198
Gaudi::Units::electronvolt
constexpr double electronvolt
Definition: SystemOfUnits.h:149
Gaudi::Units::centimeter3
constexpr double centimeter3
Definition: SystemOfUnits.h:59
Gaudi::Units::nanoampere
constexpr double nanoampere
Definition: SystemOfUnits.h:200
Gaudi::Units::petaelectronvolt
constexpr double petaelectronvolt
Definition: SystemOfUnits.h:153
Gaudi::Units::picosecond
constexpr double picosecond
Definition: SystemOfUnits.h:126
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:94
Gaudi::Units::millibarn
constexpr double millibarn
Definition: SystemOfUnits.h:77
Gaudi::Units::lumen
constexpr double lumen
Definition: SystemOfUnits.h:270
Gaudi::Units::millimeter3
constexpr double millimeter3
Definition: SystemOfUnits.h:55
Gaudi::Units::kilometer2
constexpr double kilometer2
Definition: SystemOfUnits.h:66
Gaudi::Units::joule
constexpr double joule
Definition: SystemOfUnits.h:155
Gaudi::Units::picobarn
constexpr double picobarn
Definition: SystemOfUnits.h:80
Gaudi::Units::kelvin
constexpr double kelvin
Definition: SystemOfUnits.h:244
Gaudi::Units::kilovolt
constexpr double kilovolt
Definition: SystemOfUnits.h:206
Gaudi::Units::micrometer
constexpr double micrometer
Definition: SystemOfUnits.h:71
Gaudi::Units::perMillion
constexpr double perMillion
Definition: SystemOfUnits.h:282
Gaudi::Units::nm
constexpr double nm
Definition: SystemOfUnits.h:83
Gaudi::Units::TeV
constexpr double TeV
Definition: SystemOfUnits.h:162
Gaudi::Units::mrad
constexpr double mrad
Definition: SystemOfUnits.h:115
Gaudi::Units::coulomb
constexpr double coulomb
Definition: SystemOfUnits.h:143
Gaudi::Units::km2
constexpr double km2
Definition: SystemOfUnits.h:99
Gaudi::Units::megaelectronvolt
constexpr double megaelectronvolt
Definition: SystemOfUnits.h:148
Gaudi::Units::millimeter
constexpr double millimeter
Definition: SystemOfUnits.h:53
Gaudi::Units::nanosecond
constexpr double nanosecond
Definition: SystemOfUnits.h:122
Gaudi::Units::cm
constexpr double cm
Definition: SystemOfUnits.h:90
Gaudi::Units::microampere
constexpr double microampere
Definition: SystemOfUnits.h:199
Gaudi::Units::gauss
constexpr double gauss
Definition: SystemOfUnits.h:233
Gaudi::Units::meter2
constexpr double meter2
Definition: SystemOfUnits.h:62
Gaudi::Units::megavolt
constexpr double megavolt
Definition: SystemOfUnits.h:205
Gaudi::Units::weber
constexpr double weber
Definition: SystemOfUnits.h:226
Gaudi::Units::perThousand
constexpr double perThousand
Definition: SystemOfUnits.h:281
Gaudi::Units::centimeter2
constexpr double centimeter2
Definition: SystemOfUnits.h:58
Gaudi::Units::kg
constexpr double kg
Definition: SystemOfUnits.h:173
Gaudi::Units::kilogram
constexpr double kilogram
Definition: SystemOfUnits.h:168
Gaudi::Units::megahertz
constexpr double megahertz
Definition: SystemOfUnits.h:131
Gaudi::Units::kilohertz
constexpr double kilohertz
Definition: SystemOfUnits.h:130
Gaudi::Units::atmosphere
constexpr double atmosphere
Definition: SystemOfUnits.h:192
Gaudi::Units::cm2
constexpr double cm2
Definition: SystemOfUnits.h:91
Gaudi::Units::watt
constexpr double watt
Definition: SystemOfUnits.h:180
Gaudi::Units::m3
constexpr double m3
Definition: SystemOfUnits.h:96
Gaudi::Units::millisecond
constexpr double millisecond
Definition: SystemOfUnits.h:124
Gaudi::Units::picofarad
constexpr double picofarad
Definition: SystemOfUnits.h:221
Gaudi::Units::gram
constexpr double gram
Definition: SystemOfUnits.h:169
Gaudi::Units::newton
constexpr double newton
Definition: SystemOfUnits.h:185
Gaudi::Units::millimeter2
constexpr double millimeter2
Definition: SystemOfUnits.h:54
Gaudi::Units::GeV
constexpr double GeV
Definition: SystemOfUnits.h:161
Gaudi::Units::mm2
constexpr double mm2
Definition: SystemOfUnits.h:87
Gaudi::Units::curie
constexpr double curie
Definition: SystemOfUnits.h:255
Gaudi::Units::steradian
constexpr double steradian
Definition: SystemOfUnits.h:111
Gaudi::Units::bar
constexpr double bar
Definition: SystemOfUnits.h:191
Gaudi::Units::microfarad
constexpr double microfarad
Definition: SystemOfUnits.h:219
Gaudi::Units::meter
constexpr double meter
Definition: SystemOfUnits.h:61
Gaudi::Units::microbarn
constexpr double microbarn
Definition: SystemOfUnits.h:78
Gaudi::Units::hertz
constexpr double hertz
Definition: SystemOfUnits.h:129
Gaudi::Units::mole
constexpr double mole
Definition: SystemOfUnits.h:249
Gaudi::Units::nanometer
constexpr double nanometer
Definition: SystemOfUnits.h:72
Gaudi::Units::nanofarad
constexpr double nanofarad
Definition: SystemOfUnits.h:220
Gaudi::Units::ms
constexpr double ms
Definition: SystemOfUnits.h:136
Gaudi::Units::ns
constexpr double ns
Definition: SystemOfUnits.h:134
Gaudi::Units::g
constexpr double g
Definition: SystemOfUnits.h:174
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::Units::femtosecond
constexpr double femtosecond
Definition: SystemOfUnits.h:127
Gaudi::Units::centimeter
constexpr double centimeter
Definition: SystemOfUnits.h:57
Gaudi::Units::cm3
constexpr double cm3
Definition: SystemOfUnits.h:92
Gaudi::Units::farad
constexpr double farad
Definition: SystemOfUnits.h:217
Gaudi::Units::tesla
constexpr double tesla
Definition: SystemOfUnits.h:231
Gaudi::Units::gray
constexpr double gray
Definition: SystemOfUnits.h:260
Gaudi::Units::ampere
constexpr double ampere
Definition: SystemOfUnits.h:197