48#ifndef HEP_SYSTEM_OF_UNITS_H
49#define HEP_SYSTEM_OF_UNITS_H
51#include "CLHEP/Units/defs.h"
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;
66 static constexpr double millimeter = 1.;
67 static constexpr double millimeter2 = millimeter*millimeter;
68 static constexpr double millimeter3 = millimeter*millimeter*millimeter;
70 static constexpr double centimeter = 10.*millimeter;
71 static constexpr double centimeter2 = centimeter*centimeter;
72 static constexpr double centimeter3 = centimeter*centimeter*centimeter;
74 static constexpr double meter = 1000.*millimeter;
75 static constexpr double meter2 = meter*meter;
76 static constexpr double meter3 = meter*meter*meter;
78 static constexpr double kilometer = 1000.*meter;
79 static constexpr double kilometer2 = kilometer*kilometer;
80 static constexpr double kilometer3 = kilometer*kilometer*kilometer;
82 static constexpr double parsec = 3.0856775807e+16*meter;
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;
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;
96 static constexpr double nm = nanometer;
97 static constexpr double um = micrometer;
99 static constexpr double mm = millimeter;
100 static constexpr double mm2 = millimeter2;
101 static constexpr double mm3 = millimeter3;
103 static constexpr double cm = centimeter;
104 static constexpr double cm2 = centimeter2;
105 static constexpr double cm3 = centimeter3;
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;
113 static constexpr double m = meter;
114 static constexpr double m2 = meter2;
115 static constexpr double m3 = meter3;
117 static constexpr double km = kilometer;
118 static constexpr double km2 = kilometer2;
119 static constexpr double km3 = kilometer3;
121 static constexpr double pc = parsec;
126 static constexpr double radian = 1.;
127 static constexpr double milliradian = 1.e-3*radian;
128 static constexpr double degree = (pi/180.0)*radian;
130 static constexpr double steradian = 1.;
133 static constexpr double rad = radian;
134 static constexpr double mrad = milliradian;
135 static constexpr double sr = steradian;
136 static constexpr double deg = degree;
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;
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;
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;
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;
166 static constexpr double eplus = 1. ;
167 static constexpr double e_SI = 1.602176634e-19;
168 static constexpr double coulomb = eplus/e_SI;
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;
181 static constexpr double joule = electronvolt/e_SI;
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;
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;
199 static constexpr double kg = kilogram;
200 static constexpr double g = gram;
201 static constexpr double mg = milligram;
206 static constexpr double watt = joule/second;
211 static constexpr double newton = joule/meter;
216#define pascal hep_pascal
217 static constexpr double hep_pascal = newton/m2;
218 static constexpr double bar = 100000*
pascal;
219 static constexpr double atmosphere = 101325*
pascal;
224 static constexpr double ampere = coulomb/second;
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;
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;
239 static constexpr double ohm = volt/ampere;
244 static constexpr double farad = coulomb/volt;
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;
253 static constexpr double weber = volt*second;
258 static constexpr double tesla = volt*second/meter2;
260 static constexpr double gauss = 1.e-4*tesla;
261 static constexpr double kilogauss = 1.e-1*tesla;
266 static constexpr double henry = weber/ampere;
271 static constexpr double kelvin = 1.;
276 static constexpr double mole = 1.;
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;
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;
307 static constexpr double candela = 1.;
312 static constexpr double lumen = candela*steradian;
317 static constexpr double lux = lumen/meter2;
322 static constexpr double perCent = 0.01 ;
323 static constexpr double perThousand = 0.001;
324 static constexpr double perMillion = 0.000001;
328#ifdef ENABLE_BACKWARDS_COMPATIBILITY
330using namespace CLHEP;