-
Notifications
You must be signed in to change notification settings - Fork 2
/
decay.py
135 lines (80 loc) · 2.91 KB
/
decay.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Decay widths and lifetimes
# All lifetimes in s
# All decay widths in MeV
from .constants import *
from .fmath import *
def W_gg(g_agamma, ma):
# a -> gamma gamma
# g_agamma in MeV^-1
return g_agamma**2 * ma**3 / (64*pi)
def W_ff(g, mf, ma):
# a -> f f generic decay
return g**2 * ma * sqrt(1 - (2 * mf / ma)**2) / (8 * pi) \
if 1 - 4 * (mf / ma) ** 2 > 0 else 0.0
def W_ee(g_ae, ma):
# a -> e+ e-
return g_ae**2 * ma * sqrt(1 - (2 * M_E / ma)**2) / (8 * pi) \
if 1 - 4 * (M_E / ma) ** 2 > 0 else 0.0
# Loop functions
def fp2(tau):
return arcsin(1/sqrt(tau))**2 if tau >= 1 \
else pi**2 / 4 + log((1+sqrt(1-tau))/(1-sqrt(1-tau)))**2 / 4
def b1(tau):
return 1 - tau*fp2(tau)
def W_gg_loop(g_af, ma, mf):
# a -> gamma gamma via f loop
#g_agamma = (g_af * ALPHA / (pi * mf)) * (1 - power(2*mf*arcsin(ma/(2*mf))/ma,2))
g_agamma_eff = g_af * ALPHA * b1(power(2*mf/ma, 2)) / (4*pi)
return W_gg(g_agamma_eff, ma)
def W_aprime_gamma_phi(g_gauge, m_aprime, m_phi):
# Aprime -> gamma + phi (scalar)
return power(g_gauge, 2) * power((m_aprime**2 - m_phi**2)/m_aprime, 3) / (128*pi)
def W_aprime_gamma_a(g_gauge, m_aprime, m_phi):
# Aprime -> gamma + a (pseudoscalar)
pass
def Tau(width):
# Get the lifetime in the rest frame in s
pass
def Tau_lab(width, va):
# Get the lifetime in the lab frame in s
pass
def p_survive(p, m, tau, l):
# Probability that a particle will survive a distance l from production site
# momentum in lab frame p
# lifetime tau in seconds
# mass of decaying particle m
# distance from source l in meters
energy = sqrt(p**2 + m**2)
boost = energy / m
v = p / energy
prob = exp(-l/(METER_BY_MEV*v*boost*tau/HBAR))
return prob
def p_decay(p, m, tau, l):
# Probability that a particle will decay before reaching a distance l
# momentum in lab frame p
# lifetime tau in seconds
# mass of decaying particle m
# distance from source l in meters
energy = sqrt(p**2 + m**2)
boost = energy / m
v = p / energy
prob = exp(-l/(METER_BY_MEV*v*boost*tau/HBAR))
return (1 - prob)
def p_decay_in_region(p, m, tau, l, dl):
# Probability that the particle will decay within a region (l, l + dl)
# momentum in lab frame p
# lifetime tau in seconds
# mass of decaying particle m
# l and dl in meters
energy = sqrt(p**2 + m**2)
boost = energy / m
v = p / energy
prob = exp(-l/(METER_BY_MEV*v*boost*tau/HBAR)) * (1 - exp(-dl/(METER_BY_MEV*v*boost*tau/HBAR)))
return prob
def decay_quantile(u, p, m, width_gamma):
# Quantile/PPF function to generate decay positions for a given lifetime and momentum.
# momentum in lab frame p
# decay width width_gamma in MeV
# mass of decaying particle m
# l and dl in meters
return (METER_BY_MEV * p / width_gamma / m) * log((sqrt(u) + 1)/(1 - u))