aboutsummaryrefslogtreecommitdiffstats
path: root/plot_llh/unitarity.py
diff options
context:
space:
mode:
authorshivesh <s.p.mandalia@qmul.ac.uk>2019-09-11 20:13:01 +0100
committershivesh <s.p.mandalia@qmul.ac.uk>2019-09-11 20:13:01 +0100
commit541dc3961ecf15707feee6e393c9ac321917b5c7 (patch)
tree5342328c4ea215494daa1d3bc9718d24805c01b2 /plot_llh/unitarity.py
parentfb85ac69022bb4be4893418e10dd8b0dca615213 (diff)
downloadGolemFlavor-541dc3961ecf15707feee6e393c9ac321917b5c7.tar.gz
GolemFlavor-541dc3961ecf15707feee6e393c9ac321917b5c7.zip
works!
Diffstat (limited to 'plot_llh/unitarity.py')
-rw-r--r--plot_llh/unitarity.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/plot_llh/unitarity.py b/plot_llh/unitarity.py
index 8fb56ce..d764d04 100644
--- a/plot_llh/unitarity.py
+++ b/plot_llh/unitarity.py
@@ -34,11 +34,12 @@ B_v = np.vectorize(
def norm_quad(x):
"""Normalise to quadrant -pi -> pi."""
- n = deepcopy(x)
- while np.abs(n) > np.pi:
- if n > np.pi: n -= 2*np.pi
- else: n += 2*np.pi
- return n
+ return x
+ # n = deepcopy(x)
+ # while np.abs(n) > np.pi:
+ # if n > np.pi: n -= 2*np.pi
+ # else: n += 2*np.pi
+ # return n
def Bn(B, omega, chi):
"""Normalised B."""
@@ -64,20 +65,21 @@ def calc_unitarity_bounds(f_s, n_samples):
numpy ndarray measured flavour ratios of shape (n_samples, 3)
"""
- omega = np.linspace(-np.pi, np.pi, n_samples)
- chi = np.linspace(-np.pi, np.pi, n_samples)
-
- x = (1 - f_s[0] - 2*f_s[1]) * np.sin(omega)
- y = (1 - 2*f_s[0] - f_s[1]) * np.cos(omega)
- z = (f_s[1] - f_s[0]) * (np.cos(omega) - np.sin(omega))
-
- B = B_v(x, y, z)
- if np.any(~np.isfinite(B)):
- print 'B', B
- raise AssertionError('inf elements found!')
+ chi = np.linspace(0., 2*np.pi, n_samples)
+ domega = np.linspace(-np.pi/2., np.pi/2, n_samples)
eta = np.full_like(chi, np.inf, dtype=np.float)
for i_chi in xrange(n_samples):
+ omega = chi[i_chi] + domega
+ x = (1 - f_s[0] - 2*f_s[1]) * np.sin(omega)
+ y = (1 - 2*f_s[0] - f_s[1]) * np.cos(omega)
+ z = (f_s[1] - f_s[0]) * (np.cos(omega) - np.sin(omega))
+
+ B = B_v(x, y, z)
+ if np.any(~np.isfinite(B)):
+ print 'B', B
+ raise AssertionError('inf elements found!')
+
nB = []
for i_ome in xrange(n_samples):
nB.append(Bn(B[i_ome], omega[i_ome], chi[i_chi]))