| The Gaudi Framework v28r2-patches (bc4ad17a)

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