52#ifndef SI_SYSTEM_OF_UNITS_HH
53#define SI_SYSTEM_OF_UNITS_HH 1
55static constexpr double pi = 3.14159265358979323846;
56static constexpr double twopi = 2 * pi;
57static constexpr double halfpi = pi / 2;
58static constexpr double pi2 = pi * pi;
62static constexpr double meter = 1.;
63static constexpr double meter2 = meter * meter;
64static constexpr double meter3 = meter * meter * meter;
66static constexpr double millimeter = 0.001 * meter;
67static constexpr double millimeter2 = millimeter * millimeter;
68static constexpr double millimeter3 = millimeter * millimeter * millimeter;
70static constexpr double centimeter = 10. * millimeter;
71static constexpr double centimeter2 = centimeter * centimeter;
72static constexpr double centimeter3 = centimeter * centimeter * centimeter;
74static constexpr double kilometer = 1000. * meter;
75static constexpr double kilometer2 = kilometer * kilometer;
76static constexpr double kilometer3 = kilometer * kilometer * kilometer;
78static constexpr double parsec = 3.0856775807e+16 * meter;
80static constexpr double micrometer = 1.e-6 * meter;
81static constexpr double nanometer = 1.e-9 * meter;
82static constexpr double angstrom = 1.e-10 * meter;
83static constexpr double fermi = 1.e-15 * meter;
85static constexpr double barn = 1.e-28 * meter2;
86static constexpr double millibarn = 1.e-3 * barn;
87static constexpr double microbarn = 1.e-6 * barn;
88static constexpr double nanobarn = 1.e-9 * barn;
89static constexpr double picobarn = 1.e-12 * barn;
92static constexpr double nm = nanometer;
93static constexpr double um = micrometer;
95static constexpr double mm = millimeter;
96static constexpr double mm2 = millimeter2;
97static constexpr double mm3 = millimeter3;
99static constexpr double cm = centimeter;
100static constexpr double cm2 = centimeter2;
101static constexpr double cm3 = centimeter3;
103static constexpr double liter = 1.e+3 * cm3;
104static constexpr double L = liter;
105static constexpr double dL = 1.e-1 * liter;
106static constexpr double cL = 1.e-2 * liter;
107static constexpr double mL = 1.e-3 * liter;
109static constexpr double m = meter;
110static constexpr double m2 = meter2;
111static constexpr double m3 = meter3;
113static constexpr double km = kilometer;
114static constexpr double km2 = kilometer2;
115static constexpr double km3 = kilometer3;
117static constexpr double pc = parsec;
122static constexpr double radian = 1.;
123static constexpr double milliradian = 1.e-3 * radian;
124static constexpr double degree = (pi / 180.0) * radian;
126static constexpr double steradian = 1.;
129static constexpr double rad = radian;
130static constexpr double mrad = milliradian;
131static constexpr double sr = steradian;
132static constexpr double deg = degree;
137static constexpr double second = 1.;
138static constexpr double nanosecond = 1.e-9 * second;
139static constexpr double millisecond = 1.e-3 * second;
140static constexpr double microsecond = 1.e-6 * second;
141static constexpr double picosecond = 1.e-12 * second;
143static constexpr double minute = 60*second;
144static constexpr double hour = 60*minute;
145static constexpr double day = 24*hour;
146static constexpr double year = 365*day;
148static constexpr double hertz = 1. / second;
149static constexpr double kilohertz = 1.e+3 * hertz;
150static constexpr double megahertz = 1.e+6 * hertz;
153static constexpr double ns = nanosecond;
154static constexpr double s = second;
155static constexpr double ms = millisecond;
156static constexpr double us = microsecond;
157static constexpr double ps = picosecond;
162static constexpr double kilogram = 1.;
163static constexpr double gram = 1.e-3 * kilogram;
164static constexpr double milligram = 1.e-3 * gram;
167static constexpr double kg = kilogram;
168static constexpr double g = gram;
169static constexpr double mg = milligram;
174static constexpr double ampere = 1.;
175static constexpr double milliampere = 1.e-3 * ampere;
176static constexpr double microampere = 1.e-6 * ampere;
177static constexpr double nanoampere = 1.e-9 * ampere;
182static constexpr double coulomb = ampere * second;
183static constexpr double e_SI = 1.602176634e-19;
184static constexpr double eplus = e_SI * coulomb;
189static constexpr double joule = kg * m * m / (s * s);
191static constexpr double electronvolt = e_SI * joule;
192static constexpr double kiloelectronvolt = 1.e+3 * electronvolt;
193static constexpr double megaelectronvolt = 1.e+6 * electronvolt;
194static constexpr double gigaelectronvolt = 1.e+9 * electronvolt;
195static constexpr double teraelectronvolt = 1.e+12 * electronvolt;
196static constexpr double petaelectronvolt = 1.e+15 * electronvolt;
197static constexpr double millielectronvolt = 1.e-3 * electronvolt;
200static constexpr double MeV = megaelectronvolt;
201static constexpr double eV = electronvolt;
202static constexpr double keV = kiloelectronvolt;
203static constexpr double GeV = gigaelectronvolt;
204static constexpr double TeV = teraelectronvolt;
205static constexpr double PeV = petaelectronvolt;
210static constexpr double watt = joule / second;
215static constexpr double newton =
221#define pascal hep_pascal
222static constexpr double hep_pascal =
224static constexpr double bar = 100000 *
pascal;
225static constexpr double atmosphere =
231static constexpr double megavolt = megaelectronvolt / eplus;
232static constexpr double kilovolt = 1.e-3 * megavolt;
233static constexpr double volt = 1.e-6 * megavolt;
238static constexpr double ohm =
244static constexpr double farad =
246static constexpr double millifarad = 1.e-3 * farad;
247static constexpr double microfarad = 1.e-6 * farad;
248static constexpr double nanofarad = 1.e-9 * farad;
249static constexpr double picofarad = 1.e-12 * farad;
254static constexpr double weber = volt * second;
259static constexpr double tesla =
260 volt * second / meter2;
262static constexpr double gauss = 1.e-4 * tesla;
263static constexpr double kilogauss = 1.e-1 * tesla;
268static constexpr double henry =
274static constexpr double kelvin = 1.;
279static constexpr double mole = 1.;
284static constexpr double becquerel = 1. / second;
285static constexpr double curie = 3.7e+10 * becquerel;
286static constexpr double kilobecquerel = 1.e+3 * becquerel;
287static constexpr double megabecquerel = 1.e+6 * becquerel;
288static constexpr double gigabecquerel = 1.e+9 * becquerel;
289static constexpr double millicurie = 1.e-3 * curie;
290static constexpr double microcurie = 1.e-6 * curie;
291static constexpr double Bq = becquerel;
292static constexpr double kBq = kilobecquerel;
293static constexpr double MBq = megabecquerel;
294static constexpr double GBq = gigabecquerel;
295static constexpr double Ci = curie;
296static constexpr double mCi = millicurie;
297static constexpr double uCi = microcurie;
302static constexpr double gray = joule / kilogram;
303static constexpr double kilogray = 1.e+3 * gray;
304static constexpr double milligray = 1.e-3 * gray;
305static constexpr double microgray = 1.e-6 * gray;
310static constexpr double candela = 1.;
315static constexpr double lumen = candela * steradian;
320static constexpr double lux = lumen / meter2;
325static constexpr double perCent = 0.01;
326static constexpr double perThousand = 0.001;
327static constexpr double perMillion = 0.000001;