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