[833] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4SIunits.hh,v 1.5 2006/09/15 08:16:10 gcosmo Exp $ |
---|
[1337] | 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
[833] | 29 | // |
---|
| 30 | // ---------------------------------------------------------------------- |
---|
| 31 | // |
---|
| 32 | // Class description: |
---|
| 33 | // |
---|
| 34 | // This file is a modified version of SystemOfUnits.h |
---|
| 35 | // It is provided for checking the overall 'units coherence' of the |
---|
| 36 | // Geant4 kernel. |
---|
| 37 | // ------- |
---|
| 38 | // Warning: if you use it, do not forget to recompile the whole Geant4 kernel |
---|
| 39 | // ------- |
---|
| 40 | // The basic units are those of the International System: |
---|
| 41 | // |
---|
| 42 | // meter |
---|
| 43 | // second |
---|
| 44 | // kilogram |
---|
| 45 | // ampere |
---|
| 46 | // degree kelvin |
---|
| 47 | // the amount of substance (mole) |
---|
| 48 | // luminous intensity (candela) |
---|
| 49 | // radian |
---|
| 50 | // steradian |
---|
| 51 | // |
---|
| 52 | // |
---|
| 53 | // The SI numerical value of the positron charge is defined here, |
---|
| 54 | // as it is needed for conversion factor : positron charge = e_SI (coulomb) |
---|
| 55 | // |
---|
| 56 | // The others physical constants are defined in the header file : |
---|
| 57 | // PhysicalConstants.h |
---|
| 58 | // |
---|
| 59 | |
---|
| 60 | // Authors: M.Maire, S.Giani |
---|
| 61 | // |
---|
| 62 | // History: |
---|
| 63 | // |
---|
| 64 | // 10.03.99 created |
---|
| 65 | // 01.03.01 parsec |
---|
| 66 | |
---|
| 67 | #ifndef G4UNITSTEST_HH |
---|
| 68 | #define G4UNITSTEST_HH |
---|
| 69 | |
---|
| 70 | // |
---|
| 71 | // Length [L] |
---|
| 72 | // |
---|
| 73 | static const double meter = 1.; |
---|
| 74 | static const double meter2 = meter*meter; |
---|
| 75 | static const double meter3 = meter*meter*meter; |
---|
| 76 | |
---|
| 77 | static const double millimeter = 0.001*meter; |
---|
| 78 | static const double millimeter2 = millimeter*millimeter; |
---|
| 79 | static const double millimeter3 = millimeter*millimeter*millimeter; |
---|
| 80 | |
---|
| 81 | static const double centimeter = 10.*millimeter; |
---|
| 82 | static const double centimeter2 = centimeter*centimeter; |
---|
| 83 | static const double centimeter3 = centimeter*centimeter*centimeter; |
---|
| 84 | |
---|
| 85 | static const double kilometer = 1000.*meter; |
---|
| 86 | static const double kilometer2 = kilometer*kilometer; |
---|
| 87 | static const double kilometer3 = kilometer*kilometer*kilometer; |
---|
| 88 | |
---|
| 89 | static const double parsec = 3.0856775807e+16*meter; |
---|
| 90 | |
---|
| 91 | static const double micrometer = 1.e-6 *meter; |
---|
| 92 | static const double nanometer = 1.e-9 *meter; |
---|
| 93 | static const double angstrom = 1.e-10*meter; |
---|
| 94 | static const double fermi = 1.e-15*meter; |
---|
| 95 | |
---|
| 96 | static const double barn = 1.e-28*meter2; |
---|
| 97 | static const double millibarn = 1.e-3 *barn; |
---|
| 98 | static const double microbarn = 1.e-6 *barn; |
---|
| 99 | static const double nanobarn = 1.e-9 *barn; |
---|
| 100 | static const double picobarn = 1.e-12*barn; |
---|
| 101 | |
---|
| 102 | // symbols |
---|
| 103 | static const double mm = millimeter; |
---|
| 104 | static const double mm2 = millimeter2; |
---|
| 105 | static const double mm3 = millimeter3; |
---|
| 106 | |
---|
| 107 | static const double cm = centimeter; |
---|
| 108 | static const double cm2 = centimeter2; |
---|
| 109 | static const double cm3 = centimeter3; |
---|
| 110 | |
---|
| 111 | static const double m = meter; |
---|
| 112 | static const double m2 = meter2; |
---|
| 113 | static const double m3 = meter3; |
---|
| 114 | |
---|
| 115 | static const double km = kilometer; |
---|
| 116 | static const double km2 = kilometer2; |
---|
| 117 | static const double km3 = kilometer3; |
---|
| 118 | |
---|
| 119 | static const double pc = parsec; |
---|
| 120 | |
---|
| 121 | // |
---|
| 122 | // Angle |
---|
| 123 | // |
---|
| 124 | static const double radian = 1.; |
---|
| 125 | static const double milliradian = 1.e-3*radian; |
---|
| 126 | static const double degree = (3.14159265358979323846/180.0)*radian; |
---|
| 127 | |
---|
| 128 | static const double steradian = 1.; |
---|
| 129 | |
---|
| 130 | // symbols |
---|
| 131 | static const double rad = radian; |
---|
| 132 | static const double mrad = milliradian; |
---|
| 133 | static const double sr = steradian; |
---|
| 134 | static const double deg = degree; |
---|
| 135 | |
---|
| 136 | // |
---|
| 137 | // Time [T] |
---|
| 138 | // |
---|
| 139 | static const double second = 1.; |
---|
| 140 | static const double nanosecond = 1.e-9 *second; |
---|
| 141 | static const double millisecond = 1.e-3 *second; |
---|
| 142 | static const double microsecond = 1.e-6 *second; |
---|
| 143 | static const double picosecond = 1.e-12*second; |
---|
| 144 | |
---|
| 145 | static const double hertz = 1./second; |
---|
| 146 | static const double kilohertz = 1.e+3*hertz; |
---|
| 147 | static const double megahertz = 1.e+6*hertz; |
---|
| 148 | |
---|
| 149 | // symbols |
---|
| 150 | static const double ns = nanosecond; |
---|
| 151 | static const double s = second; |
---|
| 152 | static const double ms = millisecond; |
---|
| 153 | |
---|
| 154 | // |
---|
| 155 | // Mass [E][T^2][L^-2] |
---|
| 156 | // |
---|
| 157 | static const double kilogram = 1.; |
---|
| 158 | static const double gram = 1.e-3*kilogram; |
---|
| 159 | static const double milligram = 1.e-3*gram; |
---|
| 160 | |
---|
| 161 | // symbols |
---|
| 162 | static const double kg = kilogram; |
---|
| 163 | static const double g = gram; |
---|
| 164 | static const double mg = milligram; |
---|
| 165 | |
---|
| 166 | // |
---|
| 167 | // Electric current [Q][T^-1] |
---|
| 168 | // |
---|
| 169 | static const double ampere = 1.; |
---|
| 170 | static const double milliampere = 1.e-3*ampere; |
---|
| 171 | static const double microampere = 1.e-6*ampere; |
---|
| 172 | static const double nanoampere = 1.e-9*ampere; |
---|
| 173 | |
---|
| 174 | // |
---|
| 175 | // Electric charge [Q] |
---|
| 176 | // |
---|
| 177 | static const double coulomb = ampere*second; |
---|
| 178 | static const double e_SI = 1.60217733e-19; // positron charge in coulomb |
---|
| 179 | static const double eplus = e_SI*coulomb ; // positron charge |
---|
| 180 | |
---|
| 181 | // |
---|
| 182 | // Energy [E] |
---|
| 183 | // |
---|
| 184 | static const double joule = kg*m*m/(s*s); |
---|
| 185 | |
---|
| 186 | static const double electronvolt = e_SI*joule; |
---|
| 187 | static const double kiloelectronvolt = 1.e+3*electronvolt; |
---|
| 188 | static const double megaelectronvolt = 1.e+6*electronvolt; |
---|
| 189 | static const double gigaelectronvolt = 1.e+9*electronvolt; |
---|
| 190 | static const double teraelectronvolt = 1.e+12*electronvolt; |
---|
| 191 | static const double petaelectronvolt = 1.e+15*electronvolt; |
---|
| 192 | |
---|
| 193 | // symbols |
---|
| 194 | static const double MeV = megaelectronvolt; |
---|
| 195 | static const double eV = electronvolt; |
---|
| 196 | static const double keV = kiloelectronvolt; |
---|
| 197 | static const double GeV = gigaelectronvolt; |
---|
| 198 | static const double TeV = teraelectronvolt; |
---|
| 199 | static const double PeV = petaelectronvolt; |
---|
| 200 | |
---|
| 201 | // |
---|
| 202 | // Power [E][T^-1] |
---|
| 203 | // |
---|
| 204 | static const double watt = joule/second; // watt = 6.24150 e+3 * MeV/ns |
---|
| 205 | |
---|
| 206 | // |
---|
| 207 | // Force [E][L^-1] |
---|
| 208 | // |
---|
| 209 | static const double newton = joule/meter; // newton = 6.24150 e+9 * MeV/mm |
---|
| 210 | |
---|
| 211 | // |
---|
| 212 | // Pressure [E][L^-3] |
---|
| 213 | // |
---|
| 214 | #define pascal hep_pascal // a trick to avoid warnings |
---|
| 215 | static const double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3 |
---|
| 216 | static const double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3 |
---|
| 217 | static const double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3 |
---|
| 218 | |
---|
| 219 | // |
---|
| 220 | // Electric potential [E][Q^-1] |
---|
| 221 | // |
---|
| 222 | static const double megavolt = megaelectronvolt/eplus; |
---|
| 223 | static const double kilovolt = 1.e-3*megavolt; |
---|
| 224 | static const double volt = 1.e-6*megavolt; |
---|
| 225 | |
---|
| 226 | // |
---|
| 227 | // Electric resistance [E][T][Q^-2] |
---|
| 228 | // |
---|
| 229 | static const double ohm = volt/ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns) |
---|
| 230 | |
---|
| 231 | // |
---|
| 232 | // Electric capacitance [Q^2][E^-1] |
---|
| 233 | // |
---|
| 234 | static const double farad = coulomb/volt; // farad = 6.24150e+24 * eplus/Megavolt |
---|
| 235 | static const double millifarad = 1.e-3*farad; |
---|
| 236 | static const double microfarad = 1.e-6*farad; |
---|
| 237 | static const double nanofarad = 1.e-9*farad; |
---|
| 238 | static const double picofarad = 1.e-12*farad; |
---|
| 239 | |
---|
| 240 | // |
---|
| 241 | // Magnetic Flux [T][E][Q^-1] |
---|
| 242 | // |
---|
| 243 | static const double weber = volt*second; // weber = 1000*megavolt*ns |
---|
| 244 | |
---|
| 245 | // |
---|
| 246 | // Magnetic Field [T][E][Q^-1][L^-2] |
---|
| 247 | // |
---|
| 248 | static const double tesla = volt*second/meter2; // tesla =0.001*megavolt*ns/mm2 |
---|
| 249 | |
---|
| 250 | static const double gauss = 1.e-4*tesla; |
---|
| 251 | static const double kilogauss = 1.e-1*tesla; |
---|
| 252 | |
---|
| 253 | // |
---|
| 254 | // Inductance [T^2][E][Q^-2] |
---|
| 255 | // |
---|
| 256 | static const double henry = weber/ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2 |
---|
| 257 | |
---|
| 258 | // |
---|
| 259 | // Temperature |
---|
| 260 | // |
---|
| 261 | static const double kelvin = 1.; |
---|
| 262 | |
---|
| 263 | // |
---|
| 264 | // Amount of substance |
---|
| 265 | // |
---|
| 266 | static const double mole = 1.; |
---|
| 267 | |
---|
| 268 | // |
---|
| 269 | // Activity [T^-1] |
---|
| 270 | // |
---|
| 271 | static const double becquerel = 1./second ; |
---|
| 272 | static const double curie = 3.7e+10 * becquerel; |
---|
| 273 | |
---|
| 274 | // |
---|
| 275 | // Absorbed dose [L^2][T^-2] |
---|
| 276 | // |
---|
| 277 | static const double gray = joule/kilogram ; |
---|
| 278 | |
---|
| 279 | // |
---|
| 280 | // Luminous intensity [I] |
---|
| 281 | // |
---|
| 282 | static const double candela = 1.; |
---|
| 283 | |
---|
| 284 | // |
---|
| 285 | // Luminous flux [I] |
---|
| 286 | // |
---|
| 287 | static const double lumen = candela*steradian; |
---|
| 288 | |
---|
| 289 | // |
---|
| 290 | // Illuminance [I][L^-2] |
---|
| 291 | // |
---|
| 292 | static const double lux = lumen/meter2; |
---|
| 293 | |
---|
| 294 | // |
---|
| 295 | // Miscellaneous |
---|
| 296 | // |
---|
| 297 | static const double perCent = 0.01 ; |
---|
| 298 | static const double perThousand = 0.001; |
---|
| 299 | static const double perMillion = 0.000001; |
---|
| 300 | |
---|
| 301 | #endif /* G4UNITSTEST_HH */ |
---|