CLHEP/Units/SystemOfUnits.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: SystemOfUnits.h,v 1.13 2003/10/29 10:20:21 evc Exp $
00003 // ----------------------------------------------------------------------
00004 // HEP coherent system of Units
00005 //
00006 // This file has been provided to CLHEP by Geant4 (simulation toolkit for HEP).
00007 //
00008 // The basic units are :
00009 //              millimeter              (millimeter)
00010 //              nanosecond              (nanosecond)
00011 //              Mega electron Volt      (MeV)
00012 //              positron charge         (eplus)
00013 //              degree Kelvin           (kelvin)
00014 //              the amount of substance (mole)
00015 //              luminous intensity      (candela)
00016 //              radian                  (radian)
00017 //              steradian               (steradian)
00018 //
00019 // Below is a non exhaustive list of derived and pratical units
00020 // (i.e. mostly the SI units).
00021 // You can add your own units.
00022 //
00023 // The SI numerical value of the positron charge is defined here,
00024 // as it is needed for conversion factor : positron charge = e_SI (coulomb)
00025 //
00026 // The others physical constants are defined in the header file :
00027 //                      PhysicalConstants.h
00028 //
00029 // Authors: M.Maire, S.Giani
00030 //
00031 // History:
00032 //
00033 // 06.02.96  Created.
00034 // 28.03.96  Added miscellaneous constants.
00035 // 05.12.97  E.Tcherniaev: Redefined pascal (to avoid warnings on WinNT)
00036 // 20.05.98  names: meter, second, gram, radian, degree
00037 //           (from Brian.Lasiuk@yale.edu (STAR)). Added luminous units.
00038 // 05.08.98  angstrom, picobarn, microsecond, picosecond, petaelectronvolt
00039 // 01.03.01  parsec
00040 // 20.10.03  added symbols: um = micrometer, nm = nanometer  (MMa)   
00041 
00042 #ifndef HEP_SYSTEM_OF_UNITS_H
00043 #define HEP_SYSTEM_OF_UNITS_H
00044 
00045 #include "CLHEP/config/CLHEP.h"
00046 
00047 // 
00048 // Length [L]
00049 //
00050 static const double millimeter  = 1.;                        
00051 static const double millimeter2 = millimeter*millimeter;
00052 static const double millimeter3 = millimeter*millimeter*millimeter;
00053 
00054 static const double centimeter  = 10.*millimeter;   
00055 static const double centimeter2 = centimeter*centimeter;
00056 static const double centimeter3 = centimeter*centimeter*centimeter;
00057 
00058 static const double meter  = 1000.*millimeter;                  
00059 static const double meter2 = meter*meter;
00060 static const double meter3 = meter*meter*meter;
00061 
00062 static const double kilometer = 1000.*meter;                   
00063 static const double kilometer2 = kilometer*kilometer;
00064 static const double kilometer3 = kilometer*kilometer*kilometer;
00065 
00066 static const double parsec = 3.0856775807e+16*meter;
00067 
00068 static const double micrometer = 1.e-6 *meter;             
00069 static const double  nanometer = 1.e-9 *meter;
00070 static const double  angstrom  = 1.e-10*meter;
00071 static const double  fermi     = 1.e-15*meter;
00072 
00073 static const double      barn = 1.e-28*meter2;
00074 static const double millibarn = 1.e-3 *barn;
00075 static const double microbarn = 1.e-6 *barn;
00076 static const double  nanobarn = 1.e-9 *barn;
00077 static const double  picobarn = 1.e-12*barn;
00078 
00079 // symbols
00080 static const double nm  = nanometer;
00081 static const double um  = micrometer;
00082 
00083 static const double mm  = millimeter;                        
00084 static const double mm2 = millimeter2;
00085 static const double mm3 = millimeter3;
00086 
00087 static const double cm  = centimeter;   
00088 static const double cm2 = centimeter2;
00089 static const double cm3 = centimeter3;
00090 
00091 static const double m  = meter;                  
00092 static const double m2 = meter2;
00093 static const double m3 = meter3;
00094 
00095 static const double km  = kilometer;                   
00096 static const double km2 = kilometer2;
00097 static const double km3 = kilometer3;
00098 
00099 static const double pc = parsec;
00100 
00101 //
00102 // Angle
00103 //
00104 static const double radian      = 1.;                  
00105 static const double milliradian = 1.e-3*radian;
00106 static const double degree = (3.14159265358979323846/180.0)*radian;
00107 
00108 static const double   steradian = 1.;
00109         
00110 // symbols
00111 static const double rad  = radian;      
00112 static const double mrad = milliradian;
00113 static const double sr   = steradian;
00114 static const double deg  = degree;
00115 
00116 //
00117 // Time [T]
00118 //
00119 static const double nanosecond  = 1.;
00120 static const double second      = 1.e+9 *nanosecond;
00121 static const double millisecond = 1.e-3 *second;
00122 static const double microsecond = 1.e-6 *second;
00123 static const double  picosecond = 1.e-12*second;
00124 
00125 static const double hertz = 1./second;
00126 static const double kilohertz = 1.e+3*hertz;
00127 static const double megahertz = 1.e+6*hertz;
00128 
00129 // symbols
00130 static const double ns = nanosecond;                    
00131 static const double  s = second;
00132 static const double ms = millisecond;
00133 
00134 //
00135 // Electric charge [Q]
00136 //
00137 static const double eplus = 1. ;                //positron charge
00138 static const double e_SI  = 1.60217733e-19;     //positron charge in coulomb
00139 static const double coulomb = eplus/e_SI;       //coulomb = 6.24150 e+18 * eplus
00140 
00141 //
00142 // Energy [E]
00143 //
00144 static const double megaelectronvolt = 1. ;
00145 static const double     electronvolt = 1.e-6*megaelectronvolt;
00146 static const double kiloelectronvolt = 1.e-3*megaelectronvolt;
00147 static const double gigaelectronvolt = 1.e+3*megaelectronvolt;
00148 static const double teraelectronvolt = 1.e+6*megaelectronvolt;
00149 static const double petaelectronvolt = 1.e+9*megaelectronvolt;
00150 
00151 static const double joule = electronvolt/e_SI;  //joule = 6.24150 e+12 * MeV
00152 
00153 // symbols
00154 static const double MeV = megaelectronvolt;
00155 static const double  eV = electronvolt;
00156 static const double keV = kiloelectronvolt;
00157 static const double GeV = gigaelectronvolt;
00158 static const double TeV = teraelectronvolt;
00159 static const double PeV = petaelectronvolt;
00160 
00161 //
00162 // Mass [E][T^2][L^-2]
00163 //
00164 static const double  kilogram = joule*second*second/(meter*meter);   
00165 static const double      gram = 1.e-3*kilogram;
00166 static const double milligram = 1.e-3*gram;
00167 
00168 // symbols
00169 static const double  kg = kilogram;
00170 static const double   g = gram;
00171 static const double  mg = milligram;
00172 
00173 //
00174 // Power [E][T^-1]
00175 //
00176 static const double watt = joule/second;
00177 
00178 //
00179 // Force [E][L^-1]
00180 //
00181 static const double newton = joule/meter;
00182 //
00183 // Pressure [E][L^-3]
00184 //
00185 #define pascal hep_pascal                          // a trick to avoid warnings
00186 static const double hep_pascal = newton/m2;
00187 static const double bar        = 100000*pascal;
00188 static const double atmosphere = 101325*pascal;
00189 
00190 //
00191 // Electric current [Q][T^-1]
00192 //
00193 static const double      ampere = coulomb/second;
00194 static const double milliampere = 1.e-3*ampere;
00195 static const double microampere = 1.e-6*ampere;
00196 static const double  nanoampere = 1.e-9*ampere;
00197 
00198 //
00199 // Electric potential [E][Q^-1]
00200 //
00201 static const double megavolt = megaelectronvolt/eplus;
00202 static const double kilovolt = 1.e-3*megavolt;
00203 static const double     volt = 1.e-6*megavolt;
00204 
00205 //
00206 // Electric resistance [E][T][Q^-2]
00207 //
00208 static const double ohm = volt/ampere;
00209 
00210 //
00211 // Electric capacitance [Q^2][E^-1]
00212 //
00213 static const double farad = coulomb/volt;
00214 static const double millifarad = 1.e-3*farad;
00215 static const double microfarad = 1.e-6*farad;
00216 static const double  nanofarad = 1.e-9*farad;
00217 static const double  picofarad = 1.e-12*farad;
00218 
00219 //
00220 // Magnetic Flux [T][E][Q^-1]
00221 //
00222 static const double weber = volt*second;
00223 
00224 //
00225 // Magnetic Field [T][E][Q^-1][L^-2]
00226 //
00227 static const double tesla     = volt*second/meter2;
00228 
00229 static const double gauss     = 1.e-4*tesla;
00230 static const double kilogauss = 1.e-1*tesla;
00231 
00232 //
00233 // Inductance [T^2][E][Q^-2]
00234 //
00235 static const double henry = weber/ampere;
00236 
00237 //
00238 // Temperature
00239 //
00240 static const double kelvin = 1.;
00241 
00242 //
00243 // Amount of substance
00244 //
00245 static const double mole = 1.;
00246 
00247 //
00248 // Activity [T^-1]
00249 //
00250 static const double becquerel = 1./second;
00251 static const double curie = 3.7e+10 * becquerel;
00252 
00253 //
00254 // Absorbed dose [L^2][T^-2]
00255 //
00256 static const double gray = joule/kilogram;
00257 
00258 //
00259 // Luminous intensity [I]
00260 //
00261 static const double candela = 1.;
00262 
00263 //
00264 // Luminous flux [I]
00265 //
00266 static const double lumen = candela*steradian;
00267 
00268 //
00269 // Illuminance [I][L^-2]
00270 //
00271 static const double lux = lumen/meter2;
00272 
00273 //
00274 // Miscellaneous
00275 //
00276 static const double perCent     = 0.01 ;
00277 static const double perThousand = 0.001;
00278 static const double perMillion  = 0.000001;
00279 
00280 #endif /* HEP_SYSTEM_OF_UNITS_H */

Class Library for High Energy Physics (version 1.8)