1 /***************************************************************************
5 * Author: blasiuk adapted from CLHEP
6 ***************************************************************************
8 * Description: This file is based on the SystemOfUnits provided
9 * in the CLHEP library v1.2: The units remain the same.
10 * It is just the naming conventions that are different:
12 * 1) No single letter unit:
17 * 2) All prefixes are spelled out explicitly (except electron Volt):
21 * 3) All units with proper names follow the international standard
22 * of being lower case:
26 * The basic units are :
27 * centimeter (centimeter)
29 * Giga electron Volt (GeV)
30 * positron charge (eplus)
31 * degree Kelvin (kelvin)
32 * the amount of substance (mole)
34 * steradian (steradian)
35 ***************************************************************************
38 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
39 * Importing the HBT code dir
41 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
42 * First version on CVS
44 * Revision 1.5 2003/09/02 17:59:35 perev
45 * gcc 3.2 updates + WarnOff
47 * Revision 1.4 1999/03/22 16:21:38 fisyak
50 * Revision 1.3 1999/03/11 14:53:07 ullrich
51 * Added definition of inch.
53 * Revision 1.2 1999/03/02 20:15:08 ullrich
56 * Revision 1.1 1999/01/30 03:59:06 fisyak
57 * Root Version of StarClassLibrary
59 * Revision 1.1 1999/01/23 00:28:08 ullrich
62 **************************************************************************/
63 #ifndef HEP_SYSTEM_OF_UNITS_H
64 #define HEP_SYSTEM_OF_UNITS_H
68 #define M_PI 3.14159265358979312
73 // new macro for CLHEP SystemOfUnits: at end of file
74 // ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS
78 static const double millimeter = 0.1;
79 static const double millimeter2 = millimeter*millimeter;
80 static const double millimeter3 = millimeter*millimeter*millimeter;
82 static const double centimeter = 10*millimeter;
83 static const double centimeter2 = centimeter*centimeter;
84 static const double centimeter3 = centimeter*centimeter*centimeter;
86 static const double meter = 100.*centimeter;
87 static const double meter2 = meter*meter;
88 static const double meter3 = meter*meter*meter;
90 static const double kilometer = 1000.*meter;
91 static const double kilometer2 = kilometer*kilometer;
92 static const double kilometer3 = kilometer*kilometer*kilometer;
94 static const double micrometer = 1.e-6*meter;
95 static const double nanometer = 1.e-9*meter;
96 static const double femtometer = 1.e-15*meter;
97 static const double fermi = 1*femtometer;
99 static const double barn = 1.e-28*meter2;
100 static const double millibarn = 1.e-3*barn;
101 static const double microbarn = 1.e-6*barn;
102 static const double nanobarn = 1.e-9*barn;
103 static const double inch = 2.54*centimeter;
108 static const double radian = 1.;
109 static const double milliradian = 1.e-3*radian;
111 static const double degree = (M_PI/180.0)*radian;
113 static const double steradian = 1.;
118 static const double second = 1;
119 static const double millisecond = 1.e-3*second;
120 static const double microsecond = 1.e-3*millisecond;
121 static const double nanosecond = 1.e-3*microsecond;
123 static const double hertz = 1./second;
124 static const double kilohertz = 1.e+3*hertz;
125 static const double Megahertz = 1.e+6*hertz;
127 // but these are also unambiguous and unlikely to be used as variable!
128 static const double Hz = 1*hertz;
129 static const double kHz = 1*kilohertz;
130 static const double MHz = 1*Megahertz;
133 // Electric charge [Q]
135 static const double eplus = 1. ; // positron charge
136 static const double e_SI = 1.60217733e-19; // positron charge in coulomb
137 static const double coulomb = eplus/e_SI;
142 static const double Gigaelectronvolt = 1.;
143 static const double Megaelectronvolt = 1.e-3*Gigaelectronvolt;
144 static const double electronvolt = 1.e-6*Megaelectronvolt;
145 static const double kiloelectronvolt = 1.e+3*electronvolt;
146 static const double Teraelectronvolt = 1.e+3*Gigaelectronvolt;
148 // but these are also unambiguous and unlikely to be used as variables
149 static const double MeV = Megaelectronvolt;
150 static const double eV = electronvolt;
151 static const double keV = kiloelectronvolt;
152 static const double GeV = Gigaelectronvolt;
153 static const double TeV = Teraelectronvolt;
155 static const double joule = electronvolt/e_SI;
158 // Mass [E][T^2][L^-2]
160 static const double kilogram = joule*second*second/(meter*meter);
161 static const double gram = 1.e-3*kilogram;
162 static const double milligram = 1.e-3*gram;
167 static const double watt = joule/second;
172 static const double newton = joule/meter;
175 // Pressure [E][L^-3]
178 #define pascal hep_pascal // a trick to avoid warnings
179 static const double hep_pascal = newton/meter2;
181 static const double pascal = newton/meter2;
183 static const double bar = 100000*pascal;
184 static const double atmosphere = 101325*pascal;
187 // Electric current [Q][T^-1]
189 static const double ampere = coulomb/second;
192 // Electric potential [E][Q^-1]
194 static const double Megavolt = MeV/eplus;
195 static const double kilovolt = 1.e-3*Megavolt;
196 static const double volt = 1.e-6*Megavolt;
197 static const double millivolt = 1.e-3*volt;
200 // Electric resistance [E][T][Q^-2]
202 static const double ohm = volt/ampere;
205 // Electric capacitance [Q^2][E^-1]
207 static const double farad = coulomb/volt;
208 static const double millifarad = 1.e-3*farad;
209 static const double microfarad = 1.e-6*farad;
210 static const double nanofarad = 1.e-9*farad;
211 static const double picofarad = 1.e-12*farad;
214 // Magnetic Flux [T][E][Q^-1]
216 static const double weber = volt*second;
219 // Magnetic Field [T][E][Q^-1][L^-2]
221 static const double tesla = volt*second/meter2;
223 static const double gauss = 1.e-4*tesla;
224 static const double kilogauss = 1.e-1*tesla;
227 // Inductance [T^2][E][Q^-2]
229 static const double henry = weber/ampere;
234 static const double kelvin = 1.;
237 // Amount of substance
239 static const double mole = 1.;
244 static const double becquerel = 1./second;
245 static const double curie = 3.7e+10 * becquerel;
248 // Absorbed dose [L^2][T^-2]
250 static const double gray = joule/kilogram ;
255 static const double perCent = 0.01 ;
256 static const double perThousand = 0.001;
257 static const double perMillion = 0.000001;
259 #ifdef ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS
261 static const double mm = 0.1; // millimeter
262 static const double mm2 = mm*mm;
263 static const double mm3 = mm*mm*mm;
265 static const double cm = 10.*mm; // centimeter
266 static const double cm2 = cm*cm;
267 static const double cm3 = cm*cm*cm;
269 static const double m = 1000.*mm; // meter
270 static const double m2 = m*m;
271 static const double m3 = m*m*m;
273 static const double km = 1000.*m; // kilometer
274 static const double km2 = km*km;
275 static const double km3 = km*km*km;
277 static const double microm = 1.e-6*m; // micro meter
278 static const double nanom = 1.e-9*m;
279 //static const double fermi = 1.e-15*m;
284 static const double rad = 1.; // radian
285 static const double mrad = 1.e-3*rad; // milliradian
286 static const double deg = (M_PI/180.0)*rad;
288 static const double st = 1.; // steradian
293 static const double s = 1; // second
294 static const double ns = 1.e-9*s; // nano second
295 static const double ms = 1.e-3*s; // milli second
297 // Mass [E][T^2][L^-2]
299 static const double kg = joule*second*second/(meter*meter); // kg = 6.24150 e+24 * MeV*ns*ns/(mm*mm)
300 static const double g = 1.e-3*kg;
301 static const double mg = 1.e-3*g;
306 using namespace units;
307 #endif /* HEP_SYSTEM_OF_UNITS_H */