Units.hh
Go to the documentation of this file.
00001 #ifndef RIVET_MATH_UNITS 00002 #define RIVET_MATH_UNITS 00003 00004 #include "Rivet/Math/MathHeader.hh" 00005 00006 namespace Rivet { 00007 00008 // 00009 // Length [L] 00010 // 00011 static const double millimeter = 1.; 00012 static const double millimeter2 = millimeter*millimeter; 00013 static const double millimeter3 = millimeter*millimeter*millimeter; 00014 00015 static const double centimeter = 10.*millimeter; 00016 static const double centimeter2 = centimeter*centimeter; 00017 static const double centimeter3 = centimeter*centimeter*centimeter; 00018 00019 static const double meter = 1000.*millimeter; 00020 static const double meter2 = meter*meter; 00021 static const double meter3 = meter*meter*meter; 00022 00023 static const double kilometer = 1000.*meter; 00024 static const double kilometer2 = kilometer*kilometer; 00025 static const double kilometer3 = kilometer*kilometer*kilometer; 00026 00027 static const double parsec = 3.0856775807e+16*meter; 00028 00029 static const double micrometer = 1.e-6 *meter; 00030 static const double nanometer = 1.e-9 *meter; 00031 static const double angstrom = 1.e-10*meter; 00032 static const double picometer = 1.e-12*meter; 00033 static const double femtometer = 1.e-15*meter; 00034 static const double attometer = 1.e-18*meter; 00035 static const double fermi = femtometer; 00036 00037 // symbols 00038 static const double mm = millimeter; 00039 static const double mm2 = millimeter2; 00040 static const double mm3 = millimeter3; 00041 00042 static const double cm = centimeter; 00043 static const double cm2 = centimeter2; 00044 static const double cm3 = centimeter3; 00045 00046 static const double m = meter; 00047 static const double m2 = meter2; 00048 static const double m3 = meter3; 00049 00050 static const double km = kilometer; 00051 static const double km2 = kilometer2; 00052 static const double km3 = kilometer3; 00053 00054 static const double pc = parsec; 00055 00056 00057 // static const double barn = 1.e-28*meter2; 00058 // Barn-units in terms of the pb returned by AGILe 00059 static const double picobarn = 1.0; 00060 static const double barn = 1.0e+12* picobarn; 00061 static const double millibarn = 1.0e-3 * barn; 00062 static const double microbarn = 1.0e-6 * barn; 00063 static const double nanobarn = 1.0e-9 * barn; 00064 static const double femtobarn = 1.0e-15 * barn; 00065 static const double attobarn = 1.0e-18 * barn; 00066 00067 // 00068 // Angle 00069 // 00070 static const double radian = 1.; 00071 static const double milliradian = 1.e-3*radian; 00072 static const double degree = (3.14159265358979323846/180.0)*radian; 00073 static const double steradian = 1.; 00074 00075 // symbols 00076 static const double rad = radian; 00077 static const double mrad = milliradian; 00078 static const double sr = steradian; 00079 static const double deg = degree; 00080 00081 // 00082 // Time [T] 00083 // 00084 static const double nanosecond = 1.0; 00085 static const double second = 1.e+9 *nanosecond; 00086 static const double millisecond = 1.e-3 *second; 00087 static const double microsecond = 1.e-6 *second; 00088 static const double picosecond = 1.e-12*second; 00089 00090 static const double hertz = 1.0/second; 00091 static const double kilohertz = 1.e+3*hertz; 00092 static const double megahertz = 1.e+6*hertz; 00093 00094 // symbols 00095 static const double ns = nanosecond; 00096 static const double s = second; 00097 static const double ms = millisecond; 00098 00099 // 00100 // Electric charge [Q] 00101 // 00102 static const double eplus = 1.0; // positron charge 00103 static const double e_SI = 1.60217733e-19; // positron charge in coulomb 00104 static const double coulomb = eplus/e_SI; // coulomb = 6.24150 e+18 * eplus 00105 00106 // 00107 // Energy [E] 00108 // 00109 static const double gigaelectronvolt = 1.; 00110 static const double electronvolt = 1.e-9*gigaelectronvolt; 00111 static const double kiloelectronvolt = 1.e-6*gigaelectronvolt; 00112 static const double megaelectronvolt = 1.e-3*gigaelectronvolt; 00113 static const double teraelectronvolt = 1.e+3*gigaelectronvolt; 00114 static const double petaelectronvolt = 1.e+6*gigaelectronvolt; 00115 static const double joule = electronvolt/e_SI; // joule = 6.24150 e+12 * MeV 00116 00117 // symbols 00118 static const double eV = electronvolt; 00119 static const double keV = kiloelectronvolt; 00120 static const double MeV = megaelectronvolt; 00121 static const double GeV = gigaelectronvolt; 00122 static const double TeV = teraelectronvolt; 00123 static const double PeV = petaelectronvolt; 00124 00125 static const double eV2 = eV*eV; 00126 static const double keV2 = keV*keV; 00127 static const double MeV2 = MeV*MeV; 00128 static const double GeV2 = GeV*GeV; 00129 static const double TeV2 = TeV*TeV; 00130 static const double PeV2 = PeV*PeV; 00131 00132 // 00133 // Mass [E][T^2][L^-2] 00134 // 00135 static const double kilogram = joule*second*second/(meter*meter); 00136 static const double gram = 1.e-3*kilogram; 00137 static const double milligram = 1.e-3*gram; 00138 00139 // symbols 00140 static const double kg = kilogram; 00141 static const double g = gram; 00142 static const double mg = milligram; 00143 00144 // 00145 // Power [E][T^-1] 00146 // 00147 static const double watt = joule/second; // watt = 6.24150 e+3 * MeV/ns 00148 00149 // 00150 // Force [E][L^-1] 00151 // 00152 static const double newton = joule/meter; // newton = 6.24150 e+9 * MeV/mm 00153 00154 // 00155 // Pressure [E][L^-3] 00156 // 00157 #define pascal hep_pascal // a trick to avoid warnings 00158 static const double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3 00159 static const double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3 00160 static const double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3 00161 00162 // 00163 // Electric current [Q][T^-1] 00164 // 00165 static const double ampere = coulomb/second; // ampere = 6.24150 e+9 * eplus/ns 00166 static const double milliampere = 1.e-3*ampere; 00167 static const double microampere = 1.e-6*ampere; 00168 static const double nanoampere = 1.e-9*ampere; 00169 00170 // 00171 // Electric potential [E][Q^-1] 00172 // 00173 static const double megavolt = megaelectronvolt/eplus; 00174 static const double kilovolt = 1.e-3*megavolt; 00175 static const double volt = 1.e-6*megavolt; 00176 00177 // 00178 // Electric resistance [E][T][Q^-2] 00179 // 00180 static const double ohm = volt/ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns) 00181 00182 // 00183 // Electric capacitance [Q^2][E^-1] 00184 // 00185 static const double farad = coulomb/volt; // farad = 6.24150e+24 * eplus/Megavolt 00186 static const double millifarad = 1.e-3*farad; 00187 static const double microfarad = 1.e-6*farad; 00188 static const double nanofarad = 1.e-9*farad; 00189 static const double picofarad = 1.e-12*farad; 00190 00191 // 00192 // Magnetic Flux [T][E][Q^-1] 00193 // 00194 static const double weber = volt*second; // weber = 1000*megavolt*ns 00195 00196 // 00197 // Magnetic Field [T][E][Q^-1][L^-2] 00198 // 00199 static const double tesla = volt*second/meter2; // tesla =0.001*megavolt*ns/mm2 00200 00201 static const double gauss = 1.e-4*tesla; 00202 static const double kilogauss = 1.e-1*tesla; 00203 00204 // 00205 // Inductance [T^2][E][Q^-2] 00206 // 00207 static const double henry = weber/ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2 00208 00209 // 00210 // Temperature 00211 // 00212 static const double kelvin = 1.; 00213 00214 // 00215 // Amount of substance 00216 // 00217 static const double mole = 1.; 00218 00219 // 00220 // Activity [T^-1] 00221 // 00222 static const double becquerel = 1./second ; 00223 static const double curie = 3.7e+10 * becquerel; 00224 00225 // 00226 // Absorbed dose [L^2][T^-2] 00227 // 00228 static const double gray = joule/kilogram ; 00229 00230 // 00231 // Luminous intensity [I] 00232 // 00233 static const double candela = 1.; 00234 00235 // 00236 // Luminous flux [I] 00237 // 00238 static const double lumen = candela*steradian; 00239 00240 // 00241 // Illuminance [I][L^-2] 00242 // 00243 static const double lux = lumen/meter2; 00244 00245 // 00246 // Miscellaneous 00247 // 00248 static const double perCent = 0.01 ; 00249 static const double perThousand = 0.001; 00250 static const double perMillion = 0.000001; 00251 00252 } 00253 00254 #endif Generated on Thu Feb 6 2014 17:38:46 for The Rivet MC analysis system by 1.7.6.1 |