47#ifndef HEP_SYSTEM_OF_UNITS_H
48#define HEP_SYSTEM_OF_UNITS_H
55 static constexpr double pi = 3.14159265358979323846;
56 static constexpr double twopi = 2*pi;
57 static constexpr double halfpi = pi/2;
58 static constexpr double pi2 = pi*pi;
63 static constexpr double millimeter = 1.;
64 static constexpr double millimeter2 = millimeter*millimeter;
65 static constexpr double millimeter3 = millimeter*millimeter*millimeter;
67 static constexpr double centimeter = 10.*millimeter;
68 static constexpr double centimeter2 = centimeter*centimeter;
69 static constexpr double centimeter3 = centimeter*centimeter*centimeter;
71 static constexpr double meter = 1000.*millimeter;
72 static constexpr double meter2 = meter*meter;
73 static constexpr double meter3 = meter*meter*meter;
75 static constexpr double kilometer = 1000.*meter;
76 static constexpr double kilometer2 = kilometer*kilometer;
77 static constexpr double kilometer3 = kilometer*kilometer*kilometer;
79 static constexpr double parsec = 3.0856775807e+16*meter;
81 static constexpr double micrometer = 1.e-6 *meter;
82 static constexpr double nanometer = 1.e-9 *meter;
83 static constexpr double angstrom = 1.e-10*meter;
84 static constexpr double fermi = 1.e-15*meter;
86 static constexpr double barn = 1.e-28*meter2;
87 static constexpr double millibarn = 1.e-3 *barn;
88 static constexpr double microbarn = 1.e-6 *barn;
89 static constexpr double nanobarn = 1.e-9 *barn;
90 static constexpr double picobarn = 1.e-12*barn;
93 static constexpr double nm = nanometer;
94 static constexpr double um = micrometer;
96 static constexpr double mm = millimeter;
97 static constexpr double mm2 = millimeter2;
98 static constexpr double mm3 = millimeter3;
100 static constexpr double cm = centimeter;
101 static constexpr double cm2 = centimeter2;
102 static constexpr double cm3 = centimeter3;
104 static constexpr double liter = 1.e+3*cm3;
105 static constexpr double L = liter;
106 static constexpr double dL = 1.e-1*liter;
107 static constexpr double cL = 1.e-2*liter;
108 static constexpr double mL = 1.e-3*liter;
110 static constexpr double m = meter;
111 static constexpr double m2 = meter2;
112 static constexpr double m3 = meter3;
114 static constexpr double km = kilometer;
115 static constexpr double km2 = kilometer2;
116 static constexpr double km3 = kilometer3;
118 static constexpr double pc = parsec;
123 static constexpr double radian = 1.;
124 static constexpr double milliradian = 1.e-3*radian;
125 static constexpr double degree = (pi/180.0)*radian;
127 static constexpr double steradian = 1.;
130 static constexpr double rad = radian;
131 static constexpr double mrad = milliradian;
132 static constexpr double sr = steradian;
133 static constexpr double deg = degree;
138 static constexpr double nanosecond = 1.;
139 static constexpr double second = 1.e+9 *nanosecond;
140 static constexpr double millisecond = 1.e-3 *second;
141 static constexpr double microsecond = 1.e-6 *second;
142 static constexpr double picosecond = 1.e-12*second;
144 static constexpr double minute = 60*second;
145 static constexpr double hour = 60*minute;
146 static constexpr double day = 24*hour;
147 static constexpr double year = 365*day;
149 static constexpr double hertz = 1./second;
150 static constexpr double kilohertz = 1.e+3*hertz;
151 static constexpr double megahertz = 1.e+6*hertz;
154 static constexpr double ns = nanosecond;
155 static constexpr double s = second;
156 static constexpr double ms = millisecond;
157 static constexpr double us = microsecond;
158 static constexpr double ps = picosecond;
163 static constexpr double eplus = 1. ;
164 static constexpr double e_SI = 1.602176634e-19;
165 static constexpr double coulomb = eplus/e_SI;
170 static constexpr double megaelectronvolt = 1. ;
171 static constexpr double electronvolt = 1.e-6*megaelectronvolt;
172 static constexpr double kiloelectronvolt = 1.e-3*megaelectronvolt;
173 static constexpr double gigaelectronvolt = 1.e+3*megaelectronvolt;
174 static constexpr double teraelectronvolt = 1.e+6*megaelectronvolt;
175 static constexpr double petaelectronvolt = 1.e+9*megaelectronvolt;
176 static constexpr double millielectronvolt = 1.e-9*megaelectronvolt;
178 static constexpr double joule = electronvolt/e_SI;
181 static constexpr double MeV = megaelectronvolt;
182 static constexpr double eV = electronvolt;
183 static constexpr double keV = kiloelectronvolt;
184 static constexpr double GeV = gigaelectronvolt;
185 static constexpr double TeV = teraelectronvolt;
186 static constexpr double PeV = petaelectronvolt;
191 static constexpr double kilogram = joule*second*second/(meter*meter);
192 static constexpr double gram = 1.e-3*kilogram;
193 static constexpr double milligram = 1.e-3*gram;
196 static constexpr double kg = kilogram;
197 static constexpr double g = gram;
198 static constexpr double mg = milligram;
203 static constexpr double watt = joule/second;
208 static constexpr double newton = joule/meter;
213#define pascal hep_pascal
214 static constexpr double hep_pascal = newton/m2;
215 static constexpr double bar = 100000*
pascal;
216 static constexpr double atmosphere = 101325*
pascal;
221 static constexpr double ampere = coulomb/second;
222 static constexpr double milliampere = 1.e-3*ampere;
223 static constexpr double microampere = 1.e-6*ampere;
224 static constexpr double nanoampere = 1.e-9*ampere;
229 static constexpr double megavolt = megaelectronvolt/eplus;
230 static constexpr double kilovolt = 1.e-3*megavolt;
231 static constexpr double volt = 1.e-6*megavolt;
236 static constexpr double ohm = volt/ampere;
241 static constexpr double farad = coulomb/volt;
242 static constexpr double millifarad = 1.e-3*farad;
243 static constexpr double microfarad = 1.e-6*farad;
244 static constexpr double nanofarad = 1.e-9*farad;
245 static constexpr double picofarad = 1.e-12*farad;
250 static constexpr double weber = volt*second;
255 static constexpr double tesla = volt*second/meter2;
257 static constexpr double gauss = 1.e-4*tesla;
258 static constexpr double kilogauss = 1.e-1*tesla;
263 static constexpr double henry = weber/ampere;
268 static constexpr double kelvin = 1.;
273 static constexpr double mole = 1.;
278 static constexpr double becquerel = 1./second ;
279 static constexpr double curie = 3.7e+10 * becquerel;
280 static constexpr double kilobecquerel = 1.e+3*becquerel;
281 static constexpr double megabecquerel = 1.e+6*becquerel;
282 static constexpr double gigabecquerel = 1.e+9*becquerel;
283 static constexpr double millicurie = 1.e-3*curie;
284 static constexpr double microcurie = 1.e-6*curie;
285 static constexpr double Bq = becquerel;
286 static constexpr double kBq = kilobecquerel;
287 static constexpr double MBq = megabecquerel;
288 static constexpr double GBq = gigabecquerel;
289 static constexpr double Ci = curie;
290 static constexpr double mCi = millicurie;
291 static constexpr double uCi = microcurie;
296 static constexpr double gray = joule/kilogram ;
297 static constexpr double kilogray = 1.e+3*gray;
298 static constexpr double milligray = 1.e-3*gray;
299 static constexpr double microgray = 1.e-6*gray;
304 static constexpr double candela = 1.;
309 static constexpr double lumen = candela*steradian;
314 static constexpr double lux = lumen/meter2;
319 static constexpr double perCent = 0.01 ;
320 static constexpr double perThousand = 0.001;
321 static constexpr double perMillion = 0.000001;