-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconstants.py
48 lines (33 loc) · 3.17 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import numpy as np
ELECTRON_MASS = 0.510998910E-03 # GeV/c^2
AVOGADRO_NUMBER = 6.02214076E+23
# optimizing Avogadro Number special for bremsstrahlung
# see bremsstrahlung.py
AVOGADRO_NUMBER_brems = 6.02214076
MUON_MASS = 0.10565839 # GeV/c^2
class AtomicElement:
def __init__(self, A, I, Z):
self.A = A # Atomic mass
self.I = I # Mean Excitation
self.Z = Z # Atomic Number
STANDARD_ROCK = AtomicElement(22.0, 0.1364E-6, 11)
# Coefficients for the Gaussian quadrature from:
# https://pomax.github.io/bezierinfo/legendre-gauss.html
x_2 = np.array([-0.5773502691896257, 0.5773502691896257], np.float64)
w_2 = np.array([1.0, 1.0], np.float64)
x_3 = np.array([0.0000000000000000, -0.7745966692414834, 0.7745966692414834], np.float64)
w_3 = np.array([0.8888888888888888, 0.5555555555555556, 0.5555555555555556], np.float64)
x_4 = np.array([-0.3399810435848563, 0.3399810435848563, -0.8611363115940526, 0.8611363115940526], np.float64)
w_4 = np.array([0.6521451548625461, 0.6521451548625461, 0.3478548451374538, 0.3478548451374538], np.float64)
x_5 = np.array([0.0, -0.5384693101056831, 0.5384693101056831, -0.9061798459386640, 0.9061798459386640], np.float64)
w_5 = np.array([0.5688888888888889, 0.4786286704993665, 0.4786286704993665, 0.2369268850561891, 0.2369268850561891], np.float64)
x_6 = np.array([0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.9324695142031521, 0.9324695142031521], np.float64)
w_6 = np.array([0.3607615730481386, 0.3607615730481386, 0.4679139345726910, 0.4679139345726910, 0.1713244923791704, 0.1713244923791704], np.float64)
x_7 = np.array([0.0000000000000000, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585], np.float64)
w_7 = np.array([0.417959183673469, 0.3818300505051189, 0.3818300505051189, 0.2797053914892766, 0.2797053914892766, 0.1294849661688697, 0.1294849661688697], np.float64)
x_8 = np.array([-0.1834346424956498, 0.1834346424956498, -0.5255324099163290, 0.5255324099163290, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363], np.float64)
w_8 = np.array([0.3626837833783620, 0.3626837833783620, 0.3137066458778873, 0.3137066458778873, 0.2223810344533745, 0.2223810344533745, 0.1012285362903763, 0.1012285362903763], np.float64)
x_9 = np.array([0.0000000000000000, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904], np.float64)
w_9 = np.array([0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.0812743883615744, 0.0812743883615744, 0.3123470770400029, 0.3123470770400029, 0.2606106964029354, 0.2606106964029354], np.float64)
x_10 = np.array([-0.1488743389816312, 0.1488743389816312, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717], np.float64)
w_10 = np.array([0.2955242247147529, 0.2955242247147529, 0.2692667193099963, 0.2692667193099963, 0.2190863625159820, 0.2190863625159820, 0.1494513491505806, 0.1494513491505806, 0.0666713443086881, 0.0666713443086881], np.float64)