Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:23

0001 # File: AthenaCommon/share/SystemOfUnits.py
0002 # Author: Wim Lavrijsen (LBNL, WLavrijsen@lbl.gov)
0003 # Created: 01/21/04
0004 # Last: 01/21/04
0005 
0006 # This script is a direct adaptation of CLHEP/Units/SystemOfUnits.h
0007 # and the following is the originial CLHEP comment:
0008 #
0009 # -----
0010 # HEP coherent system of Units
0011 #
0012 # This file has been provided to CLHEP by Geant4 (simulation toolkit for HEP).
0013 #
0014 # The basic units are :
0015 #               millimeter              (millimeter)
0016 #               nanosecond              (nanosecond)
0017 #               Mega electron Volt      (MeV)
0018 #               positron charge         (eplus)
0019 #               degree Kelvin           (kelvin)
0020 #              the amount of substance (mole)
0021 #              luminous intensity      (candela)
0022 #               radian                  (radian)
0023 #              steradian               (steradian)
0024 #
0025 # Below is a non exhaustive list of derived and pratical units
0026 # (i.e. mostly the SI units).
0027 # You can add your own units.
0028 #
0029 # The SI numerical value of the positron charge is defined here,
0030 # as it is needed for conversion factor : positron charge = e_SI (coulomb)
0031 #
0032 # The others physical constants are defined in the header file :
0033 #                       PhysicalConstants.h
0034 #
0035 # Authors: M.Maire, S.Giani
0036 #
0037 # History:
0038 #
0039 # 06.02.96   Created.
0040 # 28.03.96   Added miscellaneous constants.
0041 # 05.12.97   E.Tcherniaev: Redefined pascal (to avoid warnings on WinNT)
0042 # 20.05.98   names: meter, second, gram, radian, degree
0043 #            (from Brian.Lasiuk@yale.edu (STAR)). Added luminous units.
0044 # 05.08.98   angstrom, picobarn, microsecond, picosecond, petaelectronvolt
0045 # 01.03.01   parsec
0046 # -----
0047 
0048 #
0049 # Length [L]
0050 #
0051 from __future__ import absolute_import, unicode_literals, division
0052 
0053 millimeter = 1.
0054 millimeter2 = millimeter * millimeter
0055 millimeter3 = millimeter * millimeter * millimeter
0056 
0057 centimeter = 10. * millimeter
0058 centimeter2 = centimeter * centimeter
0059 centimeter3 = centimeter * centimeter * centimeter
0060 
0061 meter = 1000. * millimeter
0062 meter2 = meter * meter
0063 meter3 = meter * meter * meter
0064 
0065 kilometer = 1000. * meter
0066 kilometer2 = kilometer * kilometer
0067 kilometer3 = kilometer * kilometer * kilometer
0068 
0069 parsec = 3.0856775807e+16 * meter
0070 
0071 micrometer = 1.e-6 * meter
0072 nanometer = 1.e-9 * meter
0073 angstrom = 1.e-10 * meter
0074 fermi = 1.e-15 * meter
0075 
0076 barn = 1.e-28 * meter2
0077 millibarn = 1.e-3 * barn
0078 microbarn = 1.e-6 * barn
0079 nanobarn = 1.e-9 * barn
0080 picobarn = 1.e-12 * barn
0081 
0082 # symbols
0083 mm = millimeter
0084 mm2 = millimeter2
0085 mm3 = millimeter3
0086 
0087 cm = centimeter
0088 cm2 = centimeter2
0089 cm3 = centimeter3
0090 
0091 m = meter
0092 m2 = meter2
0093 m3 = meter3
0094 
0095 km = kilometer
0096 km2 = kilometer2
0097 km3 = kilometer3
0098 
0099 pc = parsec
0100 
0101 #
0102 # Angle
0103 #
0104 radian = 1.
0105 milliradian = 1.e-3 * radian
0106 degree = (3.14159265358979323846 / 180.0) * radian
0107 
0108 steradian = 1.
0109 
0110 # symbols
0111 rad = radian
0112 mrad = milliradian
0113 sr = steradian
0114 deg = degree
0115 
0116 #
0117 # Time [T]
0118 #
0119 nanosecond = 1.
0120 second = 1.e+9 * nanosecond
0121 millisecond = 1.e-3 * second
0122 microsecond = 1.e-6 * second
0123 picosecond = 1.e-12 * second
0124 femtosecond = 1.e-15 * second
0125 
0126 hertz = 1. / second
0127 kilohertz = 1.e+3 * hertz
0128 megahertz = 1.e+6 * hertz
0129 
0130 # symbols
0131 ns = nanosecond
0132 s = second
0133 ms = millisecond
0134 
0135 #
0136 # Electric charge [Q]
0137 #
0138 eplus = 1.                                   # positron charge
0139 e_SI = 1.60217733e-19                       # positron charge in coulomb
0140 coulomb = eplus / e_SI                         # coulomb = 6.24150 e+18 * eplus
0141 
0142 #
0143 # Energy [E]
0144 #
0145 megaelectronvolt = 1.
0146 electronvolt = 1.e-6 * megaelectronvolt
0147 kiloelectronvolt = 1.e-3 * megaelectronvolt
0148 gigaelectronvolt = 1.e+3 * megaelectronvolt
0149 teraelectronvolt = 1.e+6 * megaelectronvolt
0150 petaelectronvolt = 1.e+9 * megaelectronvolt
0151 
0152 joule = electronvolt / e_SI                    # joule = 6.24150 e+12 * MeV
0153 
0154 # symbols
0155 MeV = megaelectronvolt
0156 eV = electronvolt
0157 keV = kiloelectronvolt
0158 GeV = gigaelectronvolt
0159 TeV = teraelectronvolt
0160 PeV = petaelectronvolt
0161 
0162 #
0163 # Mass [E][T^2][L^-2]
0164 #
0165 kilogram = joule * second * second / (meter * meter)
0166 gram = 1.e-3 * kilogram
0167 milligram = 1.e-3 * gram
0168 
0169 # symbols
0170 kg = kilogram
0171 g = gram
0172 mg = milligram
0173 
0174 #
0175 # Power [E][T^-1]
0176 #
0177 watt = joule / second                          # watt = 6.24150 e+3 * MeV/ns
0178 
0179 #
0180 # Force [E][L^-1]
0181 #
0182 newton = joule / meter                         # newton = 6.24150 e+9 * MeV/mm
0183 
0184 #
0185 # Pressure [E][L^-3]
0186 #
0187 hep_pascal = newton / m2                       # pascal = 6.24150 e+3 * MeV/mm3
0188 pascal = hep_pascal                      # a trick to avoid warnings
0189 bar = 100000 * pascal                   # bar    = 6.24150 e+8 * MeV/mm3
0190 atmosphere = 101325 * pascal                   # atm    = 6.32420 e+8 * MeV/mm3
0191 
0192 #
0193 # Electric current [Q][T^-1]
0194 #
0195 ampere = coulomb / second                 # ampere = 6.24150 e+9 * eplus/ns
0196 milliampere = 1.e-3 * ampere
0197 microampere = 1.e-6 * ampere
0198 nanoampere = 1.e-9 * ampere
0199 
0200 #
0201 # Electric potential [E][Q^-1]
0202 #
0203 megavolt = megaelectronvolt / eplus
0204 kilovolt = 1.e-3 * megavolt
0205 volt = 1.e-6 * megavolt
0206 
0207 #
0208 # Electric resistance [E][T][Q^-2]
0209 #
0210 ohm = volt / ampere                            # ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
0211 
0212 #
0213 # Electric capacitance [Q^2][E^-1]
0214 #
0215 farad = coulomb / volt                         # farad = 6.24150e+24 * eplus/Megavolt
0216 millifarad = 1.e-3 * farad
0217 microfarad = 1.e-6 * farad
0218 nanofarad = 1.e-9 * farad
0219 picofarad = 1.e-12 * farad
0220 
0221 #
0222 # Magnetic Flux [T][E][Q^-1]
0223 #
0224 weber = volt * second                          # weber = 1000*megavolt*ns
0225 
0226 #
0227 # Magnetic Field [T][E][Q^-1][L^-2]
0228 #
0229 tesla = volt * second / meter2               # tesla =0.001*megavolt*ns/mm2
0230 
0231 gauss = 1.e-4 * tesla
0232 kilogauss = 1.e-1 * tesla
0233 
0234 #
0235 # Inductance [T^2][E][Q^-2]
0236 #
0237 henry = weber / ampere                         # henry = 1.60217e-7*MeV*(ns/eplus)**2
0238 
0239 #
0240 # Temperature
0241 #
0242 kelvin = 1.
0243 
0244 #
0245 # Amount of substance
0246 #
0247 mole = 1.
0248 
0249 #
0250 # Activity [T^-1]
0251 #
0252 becquerel = 1. / second
0253 curie = 3.7e+10 * becquerel
0254 
0255 #
0256 # Absorbed dose [L^2][T^-2]
0257 #
0258 gray = joule / kilogram
0259 
0260 #
0261 # Luminous intensity [I]
0262 #
0263 candela = 1.
0264 
0265 #
0266 # Luminous flux [I]
0267 #
0268 lumen = candela * steradian
0269 
0270 #
0271 # Illuminance [I][L^-2]
0272 #
0273 lux = lumen / meter2
0274 
0275 #
0276 # Miscellaneous
0277 #
0278 perCent = 0.01
0279 perThousand = 0.001
0280 perMillion = 0.000001