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 // 19.08.15 added liter and its sub units (mma) 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 44 47 #ifndef HEP_SYSTEM_OF_UNITS_H 45 #ifndef HEP_SYSTEM_OF_UNITS_H 48 #define HEP_SYSTEM_OF_UNITS_H 46 #define HEP_SYSTEM_OF_UNITS_H 49 47 50 namespace CLHEP { 48 namespace CLHEP { 51 49 52 // 50 // 53 // 51 // 54 // 52 // 55 static constexpr double pi = 3.14159265 << 53 static const double pi = 3.14159265358979323846; 56 static constexpr double twopi = 2*pi; << 54 static const double twopi = 2*pi; 57 static constexpr double halfpi = pi/2; << 55 static const double halfpi = pi/2; 58 static constexpr double pi2 = pi*pi; << 56 static const double pi2 = pi*pi; 59 57 60 // 58 // 61 // Length [L] 59 // Length [L] 62 // 60 // 63 static constexpr double millimeter = 1.; << 61 static const double millimeter = 1.; 64 static constexpr double millimeter2 = millim << 62 static const double millimeter2 = millimeter*millimeter; 65 static constexpr double millimeter3 = millim << 63 static const double millimeter3 = millimeter*millimeter*millimeter; 66 << 64 67 static constexpr double centimeter = 10.*mi << 65 static const double centimeter = 10.*millimeter; 68 static constexpr double centimeter2 = centim << 66 static const double centimeter2 = centimeter*centimeter; 69 static constexpr double centimeter3 = centim << 67 static const double centimeter3 = centimeter*centimeter*centimeter; 70 68 71 static constexpr double meter = 1000.*milli << 69 static const double meter = 1000.*millimeter; 72 static constexpr double meter2 = meter*meter << 70 static const double meter2 = meter*meter; 73 static constexpr double meter3 = meter*meter << 71 static const double meter3 = meter*meter*meter; 74 << 72 75 static constexpr double kilometer = 1000.*me << 73 static const double kilometer = 1000.*meter; 76 static constexpr double kilometer2 = kilomet << 74 static const double kilometer2 = kilometer*kilometer; 77 static constexpr double kilometer3 = kilomet << 75 static const double kilometer3 = kilometer*kilometer*kilometer; 78 << 76 79 static constexpr double parsec = 3.085677580 << 77 static const double parsec = 3.0856775807e+16*meter; 80 << 78 81 static constexpr double micrometer = 1.e-6 * << 79 static const double micrometer = 1.e-6 *meter; 82 static constexpr double nanometer = 1.e-9 * << 80 static const double nanometer = 1.e-9 *meter; 83 static constexpr double angstrom = 1.e-10* << 81 static const double angstrom = 1.e-10*meter; 84 static constexpr double fermi = 1.e-15* << 82 static const double fermi = 1.e-15*meter; 85 << 83 86 static constexpr double barn = 1.e-28*m << 84 static const double barn = 1.e-28*meter2; 87 static constexpr double millibarn = 1.e-3 *b << 85 static const double millibarn = 1.e-3 *barn; 88 static constexpr double microbarn = 1.e-6 *b << 86 static const double microbarn = 1.e-6 *barn; 89 static constexpr double nanobarn = 1.e-9 *b << 87 static const double nanobarn = 1.e-9 *barn; 90 static constexpr double picobarn = 1.e-12*b << 88 static const double picobarn = 1.e-12*barn; 91 89 92 // symbols 90 // symbols 93 static constexpr double nm = nanometer; << 91 static const double nm = nanometer; 94 static constexpr double um = micrometer; << 92 static const double um = micrometer; 95 93 96 static constexpr double mm = millimeter; << 94 static const double mm = millimeter; 97 static constexpr double mm2 = millimeter2; << 95 static const double mm2 = millimeter2; 98 static constexpr double mm3 = millimeter3; << 96 static const double mm3 = millimeter3; 99 << 97 100 static constexpr double cm = centimeter; << 98 static const double cm = centimeter; 101 static constexpr double cm2 = centimeter2; << 99 static const double cm2 = centimeter2; 102 static constexpr double cm3 = centimeter3; << 100 static const double cm3 = centimeter3; 103 << 101 104 static constexpr double liter = 1.e+3*cm3; << 102 static const double liter = 1.e+3*cm3; 105 static constexpr double L = liter; << 103 static const double L = liter; 106 static constexpr double dL = 1.e-1*liter; << 104 static const double dL = 1.e-1*liter; 107 static constexpr double cL = 1.e-2*liter; << 105 static const double cL = 1.e-2*liter; 108 static constexpr double mL = 1.e-3*liter; << 106 static const double mL = 1.e-3*liter; 109 107 110 static constexpr double m = meter; << 108 static const double m = meter; 111 static constexpr double m2 = meter2; << 109 static const double m2 = meter2; 112 static constexpr double m3 = meter3; << 110 static const double m3 = meter3; 113 << 111 114 static constexpr double km = kilometer; << 112 static const double km = kilometer; 115 static constexpr double km2 = kilometer2; << 113 static const double km2 = kilometer2; 116 static constexpr double km3 = kilometer3; << 114 static const double km3 = kilometer3; 117 115 118 static constexpr double pc = parsec; << 116 static const double pc = parsec; 119 117 120 // 118 // 121 // Angle 119 // Angle 122 // 120 // 123 static constexpr double radian = 1.; << 121 static const double radian = 1.; 124 static constexpr double milliradian = 1.e-3* << 122 static const double milliradian = 1.e-3*radian; 125 static constexpr double degree = (pi/180.0)* << 123 static const double degree = (pi/180.0)*radian; 126 124 127 static constexpr double steradian = 1.; << 125 static const double steradian = 1.; 128 126 129 // symbols 127 // symbols 130 static constexpr double rad = radian; << 128 static const double rad = radian; 131 static constexpr double mrad = milliradian; << 129 static const double mrad = milliradian; 132 static constexpr double sr = steradian; << 130 static const double sr = steradian; 133 static constexpr double deg = degree; << 131 static const double deg = degree; 134 132 135 // 133 // 136 // Time [T] 134 // Time [T] 137 // 135 // 138 static constexpr double nanosecond = 1.; << 136 static const double nanosecond = 1.; 139 static constexpr double second = 1.e+9 << 137 static const double second = 1.e+9 *nanosecond; 140 static constexpr double millisecond = 1.e-3 << 138 static const double millisecond = 1.e-3 *second; 141 static constexpr double microsecond = 1.e-6 << 139 static const double microsecond = 1.e-6 *second; 142 static constexpr double picosecond = 1.e-12 << 140 static const double picosecond = 1.e-12*second; 143 << 141 144 static constexpr double minute = 60*second; << 142 static const double hertz = 1./second; 145 static constexpr double hour = 60*minute; << 143 static const double kilohertz = 1.e+3*hertz; 146 static constexpr double day = 24*hour; << 144 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 145 153 // symbols 146 // symbols 154 static constexpr double ns = nanosecond; << 147 static const double ns = nanosecond; 155 static constexpr double s = second; << 148 static const double s = second; 156 static constexpr double ms = millisecond; << 149 static const double ms = millisecond; 157 static constexpr double us = microsecond; << 158 static constexpr double ps = picosecond; << 159 150 160 // 151 // 161 // Electric charge [Q] 152 // Electric charge [Q] 162 // 153 // 163 static constexpr double eplus = 1. ;// posit << 154 static const double eplus = 1. ;// positron charge 164 static constexpr double e_SI = 1.602176634e << 155 static const double e_SI = 1.602176487e-19;// positron charge in coulomb 165 static constexpr double coulomb = eplus/e_SI << 156 static const double coulomb = eplus/e_SI;// coulomb = 6.24150 e+18 * eplus 166 157 167 // 158 // 168 // Energy [E] 159 // Energy [E] 169 // 160 // 170 static constexpr double megaelectronvolt = 1 << 161 static const double megaelectronvolt = 1. ; 171 static constexpr double electronvolt = 1 << 162 static const double electronvolt = 1.e-6*megaelectronvolt; 172 static constexpr double kiloelectronvolt = 1 << 163 static const double kiloelectronvolt = 1.e-3*megaelectronvolt; 173 static constexpr double gigaelectronvolt = 1 << 164 static const double gigaelectronvolt = 1.e+3*megaelectronvolt; 174 static constexpr double teraelectronvolt = 1 << 165 static const double teraelectronvolt = 1.e+6*megaelectronvolt; 175 static constexpr double petaelectronvolt = 1 << 166 static const double petaelectronvolt = 1.e+9*megaelectronvolt; 176 static constexpr double millielectronvolt = << 177 167 178 static constexpr double joule = electronvolt << 168 static const double joule = electronvolt/e_SI;// joule = 6.24150 e+12 * MeV 179 169 180 // symbols 170 // symbols 181 static constexpr double MeV = megaelectronvo << 171 static const double MeV = megaelectronvolt; 182 static constexpr double eV = electronvolt; << 172 static const double eV = electronvolt; 183 static constexpr double keV = kiloelectronvo << 173 static const double keV = kiloelectronvolt; 184 static constexpr double GeV = gigaelectronvo << 174 static const double GeV = gigaelectronvolt; 185 static constexpr double TeV = teraelectronvo << 175 static const double TeV = teraelectronvolt; 186 static constexpr double PeV = petaelectronvo << 176 static const double PeV = petaelectronvolt; 187 177 188 // 178 // 189 // Mass [E][T^2][L^-2] 179 // Mass [E][T^2][L^-2] 190 // 180 // 191 static constexpr double kilogram = joule*se << 181 static const double kilogram = joule*second*second/(meter*meter); 192 static constexpr double gram = 1.e-3*ki << 182 static const double gram = 1.e-3*kilogram; 193 static constexpr double milligram = 1.e-3*gr << 183 static const double milligram = 1.e-3*gram; 194 184 195 // symbols 185 // symbols 196 static constexpr double kg = kilogram; << 186 static const double kg = kilogram; 197 static constexpr double g = gram; << 187 static const double g = gram; 198 static constexpr double mg = milligram; << 188 static const double mg = milligram; 199 189 200 // 190 // 201 // Power [E][T^-1] 191 // Power [E][T^-1] 202 // 192 // 203 static constexpr double watt = joule/second; << 193 static const double watt = joule/second;// watt = 6.24150 e+3 * MeV/ns 204 194 205 // 195 // 206 // Force [E][L^-1] 196 // Force [E][L^-1] 207 // 197 // 208 static constexpr double newton = joule/meter << 198 static const double newton = joule/meter;// newton = 6.24150 e+9 * MeV/mm 209 199 210 // 200 // 211 // Pressure [E][L^-3] 201 // Pressure [E][L^-3] 212 // 202 // 213 #define pascal hep_pascal 203 #define pascal hep_pascal // a trick to avoid warnings 214 static constexpr double hep_pascal = newton/ << 204 static const double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3 215 static constexpr double bar = 100000* << 205 static const double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3 216 static constexpr double atmosphere = 101325* << 206 static const double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3 217 207 218 // 208 // 219 // Electric current [Q][T^-1] 209 // Electric current [Q][T^-1] 220 // 210 // 221 static constexpr double ampere = coulom << 211 static const double ampere = coulomb/second; // ampere = 6.24150 e+9 * eplus/ns 222 static constexpr double milliampere = 1.e-3* << 212 static const double milliampere = 1.e-3*ampere; 223 static constexpr double microampere = 1.e-6* << 213 static const double microampere = 1.e-6*ampere; 224 static constexpr double nanoampere = 1.e-9* << 214 static const double nanoampere = 1.e-9*ampere; 225 215 226 // 216 // 227 // Electric potential [E][Q^-1] 217 // Electric potential [E][Q^-1] 228 // 218 // 229 static constexpr double megavolt = megaelect << 219 static const double megavolt = megaelectronvolt/eplus; 230 static constexpr double kilovolt = 1.e-3*meg << 220 static const double kilovolt = 1.e-3*megavolt; 231 static constexpr double volt = 1.e-6*meg << 221 static const double volt = 1.e-6*megavolt; 232 222 233 // 223 // 234 // Electric resistance [E][T][Q^-2] 224 // Electric resistance [E][T][Q^-2] 235 // 225 // 236 static constexpr double ohm = volt/ampere;// << 226 static const double ohm = volt/ampere;// ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns) 237 227 238 // 228 // 239 // Electric capacitance [Q^2][E^-1] 229 // Electric capacitance [Q^2][E^-1] 240 // 230 // 241 static constexpr double farad = coulomb/volt << 231 static const double farad = coulomb/volt;// farad = 6.24150e+24 * eplus/Megavolt 242 static constexpr double millifarad = 1.e-3*f << 232 static const double millifarad = 1.e-3*farad; 243 static constexpr double microfarad = 1.e-6*f << 233 static const double microfarad = 1.e-6*farad; 244 static constexpr double nanofarad = 1.e-9*f << 234 static const double nanofarad = 1.e-9*farad; 245 static constexpr double picofarad = 1.e-12* << 235 static const double picofarad = 1.e-12*farad; 246 236 247 // 237 // 248 // Magnetic Flux [T][E][Q^-1] 238 // Magnetic Flux [T][E][Q^-1] 249 // 239 // 250 static constexpr double weber = volt*second; << 240 static const double weber = volt*second;// weber = 1000*megavolt*ns 251 241 252 // 242 // 253 // Magnetic Field [T][E][Q^-1][L^-2] 243 // Magnetic Field [T][E][Q^-1][L^-2] 254 // 244 // 255 static constexpr double tesla = volt*sec << 245 static const double tesla = volt*second/meter2;// tesla =0.001*megavolt*ns/mm2 256 246 257 static constexpr double gauss = 1.e-4*te << 247 static const double gauss = 1.e-4*tesla; 258 static constexpr double kilogauss = 1.e-1*te << 248 static const double kilogauss = 1.e-1*tesla; 259 249 260 // 250 // 261 // Inductance [T^2][E][Q^-2] 251 // Inductance [T^2][E][Q^-2] 262 // 252 // 263 static constexpr double henry = weber/ampere << 253 static const double henry = weber/ampere;// henry = 1.60217e-7*MeV*(ns/eplus)**2 264 254 265 // 255 // 266 // Temperature 256 // Temperature 267 // 257 // 268 static constexpr double kelvin = 1.; << 258 static const double kelvin = 1.; 269 259 270 // 260 // 271 // Amount of substance 261 // Amount of substance 272 // 262 // 273 static constexpr double mole = 1.; << 263 static const double mole = 1.; 274 264 275 // 265 // 276 // Activity [T^-1] 266 // Activity [T^-1] 277 // 267 // 278 static constexpr double becquerel = 1./secon << 268 static const double becquerel = 1./second ; 279 static constexpr double curie = 3.7e+10 * be << 269 static const double curie = 3.7e+10 * becquerel; 280 static constexpr double kilobecquerel = 1.e+ << 270 static const double kilobecquerel = 1.e+3*becquerel; 281 static constexpr double megabecquerel = 1.e+ << 271 static const double megabecquerel = 1.e+6*becquerel; 282 static constexpr double gigabecquerel = 1.e+ << 272 static const double gigabecquerel = 1.e+9*becquerel; 283 static constexpr double millicurie = 1.e-3*c << 273 static const double millicurie = 1.e-3*curie; 284 static constexpr double microcurie = 1.e-6*c << 274 static const double microcurie = 1.e-6*curie; 285 static constexpr double Bq = becquerel; << 275 static const double Bq = becquerel; 286 static constexpr double kBq = kilobecquerel; << 276 static const double kBq = kilobecquerel; 287 static constexpr double MBq = megabecquerel; << 277 static const double MBq = megabecquerel; 288 static constexpr double GBq = gigabecquerel; << 278 static const double GBq = gigabecquerel; 289 static constexpr double Ci = curie; << 279 static const double Ci = curie; 290 static constexpr double mCi = millicurie; << 280 static const double mCi = millicurie; 291 static constexpr double uCi = microcurie; << 281 static const double uCi = microcurie; 292 282 293 // 283 // 294 // Absorbed dose [L^2][T^-2] 284 // Absorbed dose [L^2][T^-2] 295 // 285 // 296 static constexpr double gray = joule/ki << 286 static const double gray = joule/kilogram ; 297 static constexpr double kilogray = 1.e+3*gr << 287 static const double kilogray = 1.e+3*gray; 298 static constexpr double milligray = 1.e-3*gr << 288 static const double milligray = 1.e-3*gray; 299 static constexpr double microgray = 1.e-6*gr << 289 static const double microgray = 1.e-6*gray; 300 290 301 // 291 // 302 // Luminous intensity [I] 292 // Luminous intensity [I] 303 // 293 // 304 static constexpr double candela = 1.; << 294 static const double candela = 1.; 305 295 306 // 296 // 307 // Luminous flux [I] 297 // Luminous flux [I] 308 // 298 // 309 static constexpr double lumen = candela*ster << 299 static const double lumen = candela*steradian; 310 300 311 // 301 // 312 // Illuminance [I][L^-2] 302 // Illuminance [I][L^-2] 313 // 303 // 314 static constexpr double lux = lumen/meter2; << 304 static const double lux = lumen/meter2; 315 305 316 // 306 // 317 // Miscellaneous 307 // Miscellaneous 318 // 308 // 319 static constexpr double perCent = 0.01 ; << 309 static const double perCent = 0.01 ; 320 static constexpr double perThousand = 0.001; << 310 static const double perThousand = 0.001; 321 static constexpr double perMillion = 0.0000 << 311 static const double perMillion = 0.000001; 322 312 323 } // namespace CLHEP 313 } // namespace CLHEP 324 314 325 #endif /* HEP_SYSTEM_OF_UNITS_H */ 315 #endif /* HEP_SYSTEM_OF_UNITS_H */ 326 316