File indexing completed on 2025-01-18 10:11:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 #ifndef TGEANT4_SYSTEM_OF_UNITS_H
0055 #define TGEANT4_SYSTEM_OF_UNITS_H
0056
0057 namespace TGeant4Unit {
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 static constexpr double pi = 3.14159265358979323846;
0068 static constexpr double twopi = 2 * pi;
0069 static constexpr double halfpi = pi / 2;
0070 static constexpr double pi2 = pi * pi;
0071
0072
0073
0074
0075 static constexpr double millimeter = 1.0;
0076 static constexpr double millimeter2 = millimeter * millimeter;
0077 static constexpr double millimeter3 = millimeter * millimeter * millimeter;
0078
0079 static constexpr double centimeter = 10. * millimeter;
0080 static constexpr double centimeter2 = centimeter * centimeter;
0081 static constexpr double centimeter3 = centimeter * centimeter * centimeter;
0082
0083 static constexpr double meter = 1000. * millimeter;
0084 static constexpr double meter2 = meter * meter;
0085 static constexpr double meter3 = meter * meter * meter;
0086
0087 static constexpr double kilometer = 1000. * meter;
0088 static constexpr double kilometer2 = kilometer * kilometer;
0089 static constexpr double kilometer3 = kilometer * kilometer * kilometer;
0090
0091 static constexpr double parsec = 3.0856775807e+16 * meter;
0092
0093 static constexpr double micrometer = 1.e-6 * meter;
0094 static constexpr double nanometer = 1.e-9 * meter;
0095 static constexpr double angstrom = 1.e-10 * meter;
0096 static constexpr double fermi = 1.e-15 * meter;
0097
0098 static constexpr double barn = 1.e-28 * meter2;
0099 static constexpr double millibarn = 1.e-3 * barn;
0100 static constexpr double microbarn = 1.e-6 * barn;
0101 static constexpr double nanobarn = 1.e-9 * barn;
0102 static constexpr double picobarn = 1.e-12 * barn;
0103
0104
0105 static constexpr double nm = nanometer;
0106 static constexpr double um = micrometer;
0107
0108 static constexpr double mm = millimeter;
0109 static constexpr double mm2 = millimeter2;
0110 static constexpr double mm3 = millimeter3;
0111
0112 static constexpr double cm = centimeter;
0113 static constexpr double cm2 = centimeter2;
0114 static constexpr double cm3 = centimeter3;
0115
0116 static constexpr double liter = 1.e+3 * cm3;
0117 static constexpr double L = liter;
0118 static constexpr double dL = 1.e-1 * liter;
0119 static constexpr double cL = 1.e-2 * liter;
0120 static constexpr double mL = 1.e-3 * liter;
0121
0122 static constexpr double m = meter;
0123 static constexpr double m2 = meter2;
0124 static constexpr double m3 = meter3;
0125
0126 static constexpr double km = kilometer;
0127 static constexpr double km2 = kilometer2;
0128 static constexpr double km3 = kilometer3;
0129
0130 static constexpr double pc = parsec;
0131
0132
0133
0134
0135 static constexpr double degree = 1.0;
0136 static constexpr double radian = (180.0 / pi) * degree;
0137 static constexpr double milliradian = 1.e-3 * radian;
0138
0139 static constexpr double steradian = 1.;
0140
0141
0142 static constexpr double rad = radian;
0143 static constexpr double mrad = milliradian;
0144 static constexpr double sr = steradian;
0145 static constexpr double deg = degree;
0146
0147
0148
0149
0150 static constexpr double nanosecond = 1.0;
0151 static constexpr double second = 1.e+9 * nanosecond;
0152 static constexpr double millisecond = 1.e-3 * second;
0153 static constexpr double microsecond = 1.e-6 * second;
0154 static constexpr double picosecond = 1.e-12 * second;
0155
0156 static constexpr double hertz = 1. / second;
0157 static constexpr double kilohertz = 1.e+3 * hertz;
0158 static constexpr double megahertz = 1.e+6 * hertz;
0159
0160
0161 static constexpr double ns = nanosecond;
0162 static constexpr double s = second;
0163 static constexpr double ms = millisecond;
0164 static constexpr double us = microsecond;
0165 static constexpr double ps = picosecond;
0166
0167
0168
0169
0170 static constexpr double eplus = 1.;
0171 static constexpr double e_SI = 1.602176487e-19;
0172 static constexpr double coulomb = eplus / e_SI;
0173
0174
0175
0176
0177 static constexpr double megaelectronvolt = 1.0;
0178 static constexpr double electronvolt = 1.e-6 * megaelectronvolt;
0179 static constexpr double kiloelectronvolt = 1.e-3 * megaelectronvolt;
0180 static constexpr double gigaelectronvolt = 1.e+3 * megaelectronvolt;
0181 static constexpr double teraelectronvolt = 1.e+6 * megaelectronvolt;
0182 static constexpr double petaelectronvolt = 1.e+9 * megaelectronvolt;
0183
0184 static constexpr double joule = electronvolt / e_SI;
0185
0186
0187 static constexpr double MeV = megaelectronvolt;
0188 static constexpr double eV = electronvolt;
0189 static constexpr double keV = kiloelectronvolt;
0190 static constexpr double GeV = gigaelectronvolt;
0191 static constexpr double TeV = teraelectronvolt;
0192 static constexpr double PeV = petaelectronvolt;
0193
0194
0195
0196
0197 static constexpr double kilogram = joule * second * second / (meter * meter);
0198 static constexpr double gram = 1.e-3 * kilogram;
0199 static constexpr double milligram = 1.e-3 * gram;
0200
0201
0202 static constexpr double kg = kilogram;
0203 static constexpr double g = gram;
0204 static constexpr double mg = milligram;
0205
0206
0207
0208
0209 static constexpr double watt = joule / second;
0210
0211
0212
0213
0214 static constexpr double newton = joule / meter;
0215
0216
0217
0218
0219 #define pascal hep_pascal
0220 static constexpr double hep_pascal = newton / m2;
0221 static constexpr double bar = 100000 * pascal;
0222 static constexpr double atmosphere = 101325 * pascal;
0223
0224
0225
0226
0227 static constexpr double ampere = coulomb / second;
0228 static constexpr double milliampere = 1.e-3 * ampere;
0229 static constexpr double microampere = 1.e-6 * ampere;
0230 static constexpr double nanoampere = 1.e-9 * ampere;
0231
0232
0233
0234
0235 static constexpr double megavolt = megaelectronvolt / eplus;
0236 static constexpr double kilovolt = 1.e-3 * megavolt;
0237 static constexpr double volt = 1.e-6 * megavolt;
0238
0239
0240
0241
0242 static constexpr double ohm = volt / ampere;
0243
0244
0245
0246
0247 static constexpr double farad = coulomb / volt;
0248 static constexpr double millifarad = 1.e-3 * farad;
0249 static constexpr double microfarad = 1.e-6 * farad;
0250 static constexpr double nanofarad = 1.e-9 * farad;
0251 static constexpr double picofarad = 1.e-12 * farad;
0252
0253
0254
0255
0256 static constexpr double weber = volt * second;
0257
0258
0259
0260
0261 static constexpr double tesla = volt * second / meter2;
0262
0263 static constexpr double gauss = 1.e-4 * tesla;
0264 static constexpr double kilogauss = 1.e-1 * tesla;
0265
0266
0267
0268
0269 static constexpr double henry = weber / ampere;
0270
0271
0272
0273
0274 static constexpr double kelvin = 1.;
0275
0276
0277
0278
0279 static constexpr double mole = 1.;
0280
0281
0282
0283
0284 static constexpr double becquerel = 1. / second;
0285 static constexpr double curie = 3.7e+10 * becquerel;
0286 static constexpr double kilobecquerel = 1.e+3 * becquerel;
0287 static constexpr double megabecquerel = 1.e+6 * becquerel;
0288 static constexpr double gigabecquerel = 1.e+9 * becquerel;
0289 static constexpr double millicurie = 1.e-3 * curie;
0290 static constexpr double microcurie = 1.e-6 * curie;
0291 static constexpr double Bq = becquerel;
0292 static constexpr double kBq = kilobecquerel;
0293 static constexpr double MBq = megabecquerel;
0294 static constexpr double GBq = gigabecquerel;
0295 static constexpr double Ci = curie;
0296 static constexpr double mCi = millicurie;
0297 static constexpr double uCi = microcurie;
0298
0299
0300
0301
0302 static constexpr double gray = joule / kilogram;
0303 static constexpr double kilogray = 1.e+3 * gray;
0304 static constexpr double milligray = 1.e-3 * gray;
0305 static constexpr double microgray = 1.e-6 * gray;
0306
0307
0308
0309
0310 static constexpr double candela = 1.;
0311
0312
0313
0314
0315 static constexpr double lumen = candela * steradian;
0316
0317
0318
0319
0320 static constexpr double lux = lumen / meter2;
0321
0322
0323
0324
0325 static constexpr double perCent = 0.01;
0326 static constexpr double perThousand = 0.001;
0327 static constexpr double perMillion = 0.000001;
0328 }
0329
0330 #endif