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