00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifndef HEP_SYSTEM_OF_UNITS_H
00061 #define HEP_SYSTEM_OF_UNITS_H
00062
00063 #include <math.h>
00064
00065 namespace units {
00066
00067
00068
00069
00070
00071 static const double millimeter = 0.1;
00072 static const double millimeter2 = millimeter*millimeter;
00073 static const double millimeter3 = millimeter*millimeter*millimeter;
00074
00075 static const double centimeter = 10*millimeter;
00076 static const double centimeter2 = centimeter*centimeter;
00077 static const double centimeter3 = centimeter*centimeter*centimeter;
00078
00079 static const double meter = 100.*centimeter;
00080 static const double meter2 = meter*meter;
00081 static const double meter3 = meter*meter*meter;
00082
00083 static const double kilometer = 1000.*meter;
00084 static const double kilometer2 = kilometer*kilometer;
00085 static const double kilometer3 = kilometer*kilometer*kilometer;
00086
00087 static const double micrometer = 1.e-6*meter;
00088 static const double nanometer = 1.e-9*meter;
00089 static const double femtometer = 1.e-15*meter;
00090 static const double fermi = 1*femtometer;
00091
00092 static const double barn = 1.e-28*meter2;
00093 static const double millibarn = 1.e-3*barn;
00094 static const double microbarn = 1.e-6*barn;
00095 static const double nanobarn = 1.e-9*barn;
00096 static const double inch = 2.54*centimeter;
00097
00098
00099
00100
00101 static const double radian = 1.;
00102 static const double milliradian = 1.e-3*radian;
00103 #ifndef __CINT__
00104 static const double degree = (M_PI/180.0)*radian;
00105 #endif
00106 static const double steradian = 1.;
00107
00108
00109
00110
00111 static const double second = 1;
00112 static const double millisecond = 1.e-3*second;
00113 static const double microsecond = 1.e-3*millisecond;
00114 static const double nanosecond = 1.e-3*microsecond;
00115
00116 static const double hertz = 1./second;
00117 static const double kilohertz = 1.e+3*hertz;
00118 static const double Megahertz = 1.e+6*hertz;
00119
00120
00121 static const double Hz = 1*hertz;
00122 static const double kHz = 1*kilohertz;
00123 static const double MHz = 1*Megahertz;
00124
00125
00126
00127
00128 static const double eplus = 1. ;
00129 static const double e_SI = 1.60217733e-19;
00130 static const double coulomb = eplus/e_SI;
00131
00132
00133
00134
00135 static const double Gigaelectronvolt = 1.;
00136 static const double Megaelectronvolt = 1.e-3*Gigaelectronvolt;
00137 static const double electronvolt = 1.e-6*Megaelectronvolt;
00138 static const double kiloelectronvolt = 1.e+3*electronvolt;
00139 static const double Teraelectronvolt = 1.e+3*Gigaelectronvolt;
00140
00141
00142 static const double MeV = Megaelectronvolt;
00143 static const double eV = electronvolt;
00144 static const double keV = kiloelectronvolt;
00145 static const double GeV = Gigaelectronvolt;
00146 static const double TeV = Teraelectronvolt;
00147
00148 static const double joule = electronvolt/e_SI;
00149
00150
00151
00152
00153 static const double kilogram = joule*second*second/(meter*meter);
00154 static const double gram = 1.e-3*kilogram;
00155 static const double milligram = 1.e-3*gram;
00156
00157
00158
00159
00160 static const double watt = joule/second;
00161
00162
00163
00164
00165 static const double newton = joule/meter;
00166
00167
00168
00169
00170 #ifndef __CINT__
00171 #define pascal hep_pascal // a trick to avoid warnings
00172 static const double hep_pascal = newton/meter2;
00173 #else
00174 static const double pascal = newton/meter2;
00175 #endif
00176 static const double bar = 100000*pascal;
00177 static const double atmosphere = 101325*pascal;
00178
00179
00180
00181
00182 static const double ampere = coulomb/second;
00183
00184
00185
00186
00187 static const double Megavolt = MeV/eplus;
00188 static const double kilovolt = 1.e-3*Megavolt;
00189 static const double volt = 1.e-6*Megavolt;
00190 static const double millivolt = 1.e-3*volt;
00191
00192
00193
00194
00195 static const double ohm = volt/ampere;
00196
00197
00198
00199
00200 static const double farad = coulomb/volt;
00201 static const double millifarad = 1.e-3*farad;
00202 static const double microfarad = 1.e-6*farad;
00203 static const double nanofarad = 1.e-9*farad;
00204 static const double picofarad = 1.e-12*farad;
00205
00206
00207
00208
00209 static const double weber = volt*second;
00210
00211
00212
00213
00214 static const double tesla = volt*second/meter2;
00215
00216 static const double gauss = 1.e-4*tesla;
00217 static const double kilogauss = 1.e-1*tesla;
00218
00219
00220
00221
00222 static const double henry = weber/ampere;
00223
00224
00225
00226
00227 static const double kelvin = 1.;
00228
00229
00230
00231
00232 static const double mole = 1.;
00233
00234
00235
00236
00237 static const double becquerel = 1./second;
00238 static const double curie = 3.7e+10 * becquerel;
00239
00240
00241
00242
00243 static const double gray = joule/kilogram ;
00244
00245
00246
00247
00248 static const double perCent = 0.01 ;
00249 static const double perThousand = 0.001;
00250 static const double perMillion = 0.000001;
00251
00252 #ifdef ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS
00253
00254 static const double mm = 0.1;
00255 static const double mm2 = mm*mm;
00256 static const double mm3 = mm*mm*mm;
00257
00258 static const double cm = 10.*mm;
00259 static const double cm2 = cm*cm;
00260 static const double cm3 = cm*cm*cm;
00261
00262 static const double m = 1000.*mm;
00263 static const double m2 = m*m;
00264 static const double m3 = m*m*m;
00265
00266 static const double km = 1000.*m;
00267 static const double km2 = km*km;
00268 static const double km3 = km*km*km;
00269
00270 static const double microm = 1.e-6*m;
00271 static const double nanom = 1.e-9*m;
00272
00273
00274
00275
00276
00277 static const double rad = 1.;
00278 static const double mrad = 1.e-3*rad;
00279 static const double deg = (M_PI/180.0)*rad;
00280
00281 static const double st = 1.;
00282
00283
00284
00285
00286 static const double s = 1;
00287 static const double ns = 1.e-9*s;
00288 static const double ms = 1.e-3*s;
00289
00290
00291
00292 static const double kg = joule*second*second/(meter*meter);
00293 static const double g = 1.e-3*kg;
00294 static const double mg = 1.e-3*g;
00295
00296 #endif
00297
00298 }
00299 using namespace units;
00300 #endif