Geant4 Cross Reference |
1 // -*- C++ -*- 1 2 // ------------------------------------------- 3 // HEP coherent system of Units 4 // 5 // This file has been provided to CLHEP by Gea 6 // 7 // The basic units are : 8 // millimeter (millimeter) 9 // nanosecond (nanosecond) 10 // Mega electron Volt (MeV) 11 // positron charge (eplus) 12 // degree Kelvin (kelvin) 13 // the amount of substance (mole) 14 // luminous intensity (candela) 15 // radian (radian) 16 // steradian (steradian) 17 // 18 // Below is a non exhaustive list of derived a 19 // (i.e. mostly the SI units). 20 // You can add your own units. 21 // 22 // The SI numerical value of the positron char 23 // as it is needed for conversion factor : pos 24 // 25 // The others physical constants are defined i 26 // PhysicalConstants.h 27 // 28 // Authors: M.Maire, S.Giani 29 // 30 // History: 31 // 32 // 06.02.96 Created. 33 // 28.03.96 Added miscellaneous constants. 34 // 05.12.97 E.Tcherniaev: Redefined pascal ( 35 // 20.05.98 names: meter, second, gram, radi 36 // (from Brian.Lasiuk@yale.edu (STA 37 // 05.08.98 angstrom, picobarn, microsecond, 38 // 01.03.01 parsec 39 // 31.01.06 kilogray, milligray, microgray 40 // 29.04.08 use PDG 2006 value of e_SI 41 // 03.11.08 use PDG 2008 value of e_SI 42 // 19.08.15 added liter and its sub units (m 43 // 12.01.16 added symbols for microsecond (u 44 // 17.07.20 use PDG 2019 value of e_SI 45 // 06.05.21 added minute, hour, day, year an 46 47 #ifndef HEP_SYSTEM_OF_UNITS_H 48 #define HEP_SYSTEM_OF_UNITS_H 49 50 namespace CLHEP { 51 52 // 53 // 54 // 55 static constexpr double pi = 3.14159265 56 static constexpr double twopi = 2*pi; 57 static constexpr double halfpi = pi/2; 58 static constexpr double pi2 = pi*pi; 59 60 // 61 // Length [L] 62 // 63 static constexpr double millimeter = 1.; 64 static constexpr double millimeter2 = millim 65 static constexpr double millimeter3 = millim 66 67 static constexpr double centimeter = 10.*mi 68 static constexpr double centimeter2 = centim 69 static constexpr double centimeter3 = centim 70 71 static constexpr double meter = 1000.*milli 72 static constexpr double meter2 = meter*meter 73 static constexpr double meter3 = meter*meter 74 75 static constexpr double kilometer = 1000.*me 76 static constexpr double kilometer2 = kilomet 77 static constexpr double kilometer3 = kilomet 78 79 static constexpr double parsec = 3.085677580 80 81 static constexpr double micrometer = 1.e-6 * 82 static constexpr double nanometer = 1.e-9 * 83 static constexpr double angstrom = 1.e-10* 84 static constexpr double fermi = 1.e-15* 85 86 static constexpr double barn = 1.e-28*m 87 static constexpr double millibarn = 1.e-3 *b 88 static constexpr double microbarn = 1.e-6 *b 89 static constexpr double nanobarn = 1.e-9 *b 90 static constexpr double picobarn = 1.e-12*b 91 92 // symbols 93 static constexpr double nm = nanometer; 94 static constexpr double um = micrometer; 95 96 static constexpr double mm = millimeter; 97 static constexpr double mm2 = millimeter2; 98 static constexpr double mm3 = millimeter3; 99 100 static constexpr double cm = centimeter; 101 static constexpr double cm2 = centimeter2; 102 static constexpr double cm3 = centimeter3; 103 104 static constexpr double liter = 1.e+3*cm3; 105 static constexpr double L = liter; 106 static constexpr double dL = 1.e-1*liter; 107 static constexpr double cL = 1.e-2*liter; 108 static constexpr double mL = 1.e-3*liter; 109 110 static constexpr double m = meter; 111 static constexpr double m2 = meter2; 112 static constexpr double m3 = meter3; 113 114 static constexpr double km = kilometer; 115 static constexpr double km2 = kilometer2; 116 static constexpr double km3 = kilometer3; 117 118 static constexpr double pc = parsec; 119 120 // 121 // Angle 122 // 123 static constexpr double radian = 1.; 124 static constexpr double milliradian = 1.e-3* 125 static constexpr double degree = (pi/180.0)* 126 127 static constexpr double steradian = 1.; 128 129 // symbols 130 static constexpr double rad = radian; 131 static constexpr double mrad = milliradian; 132 static constexpr double sr = steradian; 133 static constexpr double deg = degree; 134 135 // 136 // Time [T] 137 // 138 static constexpr double nanosecond = 1.; 139 static constexpr double second = 1.e+9 140 static constexpr double millisecond = 1.e-3 141 static constexpr double microsecond = 1.e-6 142 static constexpr double picosecond = 1.e-12 143 144 static constexpr double minute = 60*second; 145 static constexpr double hour = 60*minute; 146 static constexpr double day = 24*hour; 147 static constexpr double year = 365*day; 148 149 static constexpr double hertz = 1./second; 150 static constexpr double kilohertz = 1.e+3*he 151 static constexpr double megahertz = 1.e+6*he 152 153 // symbols 154 static constexpr double ns = nanosecond; 155 static constexpr double s = second; 156 static constexpr double ms = millisecond; 157 static constexpr double us = microsecond; 158 static constexpr double ps = picosecond; 159 160 // 161 // Electric charge [Q] 162 // 163 static constexpr double eplus = 1. ;// posit 164 static constexpr double e_SI = 1.602176634e 165 static constexpr double coulomb = eplus/e_SI 166 167 // 168 // Energy [E] 169 // 170 static constexpr double megaelectronvolt = 1 171 static constexpr double electronvolt = 1 172 static constexpr double kiloelectronvolt = 1 173 static constexpr double gigaelectronvolt = 1 174 static constexpr double teraelectronvolt = 1 175 static constexpr double petaelectronvolt = 1 176 static constexpr double millielectronvolt = 177 178 static constexpr double joule = electronvolt 179 180 // symbols 181 static constexpr double MeV = megaelectronvo 182 static constexpr double eV = electronvolt; 183 static constexpr double keV = kiloelectronvo 184 static constexpr double GeV = gigaelectronvo 185 static constexpr double TeV = teraelectronvo 186 static constexpr double PeV = petaelectronvo 187 188 // 189 // Mass [E][T^2][L^-2] 190 // 191 static constexpr double kilogram = joule*se 192 static constexpr double gram = 1.e-3*ki 193 static constexpr double milligram = 1.e-3*gr 194 195 // symbols 196 static constexpr double kg = kilogram; 197 static constexpr double g = gram; 198 static constexpr double mg = milligram; 199 200 // 201 // Power [E][T^-1] 202 // 203 static constexpr double watt = joule/second; 204 205 // 206 // Force [E][L^-1] 207 // 208 static constexpr double newton = joule/meter 209 210 // 211 // Pressure [E][L^-3] 212 // 213 #define pascal hep_pascal 214 static constexpr double hep_pascal = newton/ 215 static constexpr double bar = 100000* 216 static constexpr double atmosphere = 101325* 217 218 // 219 // Electric current [Q][T^-1] 220 // 221 static constexpr double ampere = coulom 222 static constexpr double milliampere = 1.e-3* 223 static constexpr double microampere = 1.e-6* 224 static constexpr double nanoampere = 1.e-9* 225 226 // 227 // Electric potential [E][Q^-1] 228 // 229 static constexpr double megavolt = megaelect 230 static constexpr double kilovolt = 1.e-3*meg 231 static constexpr double volt = 1.e-6*meg 232 233 // 234 // Electric resistance [E][T][Q^-2] 235 // 236 static constexpr double ohm = volt/ampere;// 237 238 // 239 // Electric capacitance [Q^2][E^-1] 240 // 241 static constexpr double farad = coulomb/volt 242 static constexpr double millifarad = 1.e-3*f 243 static constexpr double microfarad = 1.e-6*f 244 static constexpr double nanofarad = 1.e-9*f 245 static constexpr double picofarad = 1.e-12* 246 247 // 248 // Magnetic Flux [T][E][Q^-1] 249 // 250 static constexpr double weber = volt*second; 251 252 // 253 // Magnetic Field [T][E][Q^-1][L^-2] 254 // 255 static constexpr double tesla = volt*sec 256 257 static constexpr double gauss = 1.e-4*te 258 static constexpr double kilogauss = 1.e-1*te 259 260 // 261 // Inductance [T^2][E][Q^-2] 262 // 263 static constexpr double henry = weber/ampere 264 265 // 266 // Temperature 267 // 268 static constexpr double kelvin = 1.; 269 270 // 271 // Amount of substance 272 // 273 static constexpr double mole = 1.; 274 275 // 276 // Activity [T^-1] 277 // 278 static constexpr double becquerel = 1./secon 279 static constexpr double curie = 3.7e+10 * be 280 static constexpr double kilobecquerel = 1.e+ 281 static constexpr double megabecquerel = 1.e+ 282 static constexpr double gigabecquerel = 1.e+ 283 static constexpr double millicurie = 1.e-3*c 284 static constexpr double microcurie = 1.e-6*c 285 static constexpr double Bq = becquerel; 286 static constexpr double kBq = kilobecquerel; 287 static constexpr double MBq = megabecquerel; 288 static constexpr double GBq = gigabecquerel; 289 static constexpr double Ci = curie; 290 static constexpr double mCi = millicurie; 291 static constexpr double uCi = microcurie; 292 293 // 294 // Absorbed dose [L^2][T^-2] 295 // 296 static constexpr double gray = joule/ki 297 static constexpr double kilogray = 1.e+3*gr 298 static constexpr double milligray = 1.e-3*gr 299 static constexpr double microgray = 1.e-6*gr 300 301 // 302 // Luminous intensity [I] 303 // 304 static constexpr double candela = 1.; 305 306 // 307 // Luminous flux [I] 308 // 309 static constexpr double lumen = candela*ster 310 311 // 312 // Illuminance [I][L^-2] 313 // 314 static constexpr double lux = lumen/meter2; 315 316 // 317 // Miscellaneous 318 // 319 static constexpr double perCent = 0.01 ; 320 static constexpr double perThousand = 0.001; 321 static constexpr double perMillion = 0.0000 322 323 } // namespace CLHEP 324 325 #endif /* HEP_SYSTEM_OF_UNITS_H */ 326