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