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