Fork me on GitHub

source: svn/trunk/Utilities/CLHEP/Units/SystemOfUnits.h@ 347

Last change on this file since 347 was 293, checked in by Xavier Rouby, 16 years ago

first commit

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