Skip to content

Commit 84b7a86

Browse files
authored
Merge pull request #2428 from NNPDF/2426-implement-inter-spectra-correlations-atlas-lj-13-tev
2426 implement inter spectra correlations atlas lj 13 tev
2 parents 3d31eaf + 7226714 commit 84b7a86

11 files changed

+6389
-76
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
import numpy as np
2+
from numpy.linalg import eig
3+
import yaml
4+
5+
from nnpdf_data.filter_utils.utils import concat_matrices as cm
6+
from nnpdf_data.filter_utils.utils import cormat_to_covmat as ctc
7+
from nnpdf_data.filter_utils.utils import covmat_to_artunc as cta
8+
from nnpdf_data.filter_utils.utils import matlist_to_matrix as mtm
9+
from nnpdf_data.filter_utils.utils import percentage_to_absolute as pta
10+
11+
12+
def artunc():
13+
statArr = []
14+
for i in [618, 610, 614, 626]:
15+
with open('rawdata/Table' + str(i) + '.yaml', 'r') as file:
16+
input = yaml.safe_load(file)
17+
for j in range(len(input['dependent_variables'][0]['values'])):
18+
datval = input['dependent_variables'][0]['values'][j]['value']
19+
statperc = input['dependent_variables'][0]['values'][j]['errors'][0]['symerror']
20+
statArr.append(pta(statperc, datval))
21+
22+
# mttbar(9)| pTt (8)| yt(5)| yttbar(7)
23+
# mttbar| 803 801 802 810
24+
# pTt | 801t 798 799 808
25+
# yt | 802t 799t 800 809
26+
# yttbar| 810t 808t 809t 812
27+
ml803, ml801, ml802, ml810, ml798, ml799, ml808, ml800, ml809, ml812 = ([] for i in range(10))
28+
29+
with open('rawdata/Table803.yaml', 'r') as file:
30+
input = yaml.safe_load(file)
31+
for i in range(len(input['dependent_variables'][0]['values'])):
32+
ml803.append(input['dependent_variables'][0]['values'][i]['value'])
33+
34+
with open('rawdata/Table801.yaml', 'r') as file:
35+
input = yaml.safe_load(file)
36+
for i in range(len(input['dependent_variables'][0]['values'])):
37+
ml801.append(input['dependent_variables'][0]['values'][i]['value'])
38+
39+
with open('rawdata/Table802.yaml', 'r') as file:
40+
input = yaml.safe_load(file)
41+
for i in range(len(input['dependent_variables'][0]['values'])):
42+
ml802.append(input['dependent_variables'][0]['values'][i]['value'])
43+
44+
with open('rawdata/Table810.yaml', 'r') as file:
45+
input = yaml.safe_load(file)
46+
for i in range(len(input['dependent_variables'][0]['values'])):
47+
ml810.append(input['dependent_variables'][0]['values'][i]['value'])
48+
49+
with open('rawdata/Table798.yaml', 'r') as file:
50+
input = yaml.safe_load(file)
51+
for i in range(len(input['dependent_variables'][0]['values'])):
52+
ml798.append(input['dependent_variables'][0]['values'][i]['value'])
53+
54+
with open('rawdata/Table799.yaml', 'r') as file:
55+
input = yaml.safe_load(file)
56+
for i in range(len(input['dependent_variables'][0]['values'])):
57+
ml799.append(input['dependent_variables'][0]['values'][i]['value'])
58+
59+
with open('rawdata/Table808.yaml', 'r') as file:
60+
input = yaml.safe_load(file)
61+
for i in range(len(input['dependent_variables'][0]['values'])):
62+
ml808.append(input['dependent_variables'][0]['values'][i]['value'])
63+
64+
with open('rawdata/Table800.yaml', 'r') as file:
65+
input = yaml.safe_load(file)
66+
for i in range(len(input['dependent_variables'][0]['values'])):
67+
ml800.append(input['dependent_variables'][0]['values'][i]['value'])
68+
69+
with open('rawdata/Table809.yaml', 'r') as file:
70+
input = yaml.safe_load(file)
71+
for i in range(len(input['dependent_variables'][0]['values'])):
72+
ml809.append(input['dependent_variables'][0]['values'][i]['value'])
73+
74+
with open('rawdata/Table812.yaml', 'r') as file:
75+
input = yaml.safe_load(file)
76+
for i in range(len(input['dependent_variables'][0]['values'])):
77+
ml812.append(input['dependent_variables'][0]['values'][i]['value'])
78+
79+
mat803 = mtm(9, 9, ml803)
80+
mat801 = mtm(9, 8, ml801)
81+
mat801t = mat801.transpose()
82+
mat802 = mtm(9, 5, ml802)
83+
mat802t = mat802.transpose()
84+
mat810t = mtm(7, 9, ml810)
85+
mat810 = mat810t.transpose()
86+
mat798 = mtm(8, 8, ml798)
87+
mat799t = mtm(5, 8, ml799)
88+
mat799 = mat799t.transpose()
89+
mat808t = mtm(7, 8, ml808)
90+
mat808 = mat808t.transpose()
91+
mat800 = mtm(5, 5, ml800)
92+
mat809t = mtm(7, 5, ml809)
93+
mat809 = mat809t.transpose()
94+
mat812 = mtm(7, 7, ml812)
95+
96+
cormatlist = cm(
97+
4,
98+
4,
99+
[
100+
mat803,
101+
mat801,
102+
mat802,
103+
mat810,
104+
mat801t,
105+
mat798,
106+
mat799,
107+
mat808,
108+
mat802t,
109+
mat799t,
110+
mat800,
111+
mat809,
112+
mat810t,
113+
mat808t,
114+
mat809t,
115+
mat812,
116+
],
117+
)
118+
119+
covmatlist_stat = ctc(statArr, cormatlist)
120+
covmat_stat = mtm(29, 29, covmatlist_stat)
121+
artunc = cta(29, covmatlist_stat)
122+
return covmat_stat, artunc
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
data_central:
2+
- 2.50408940e+00
3+
- 3.13037950e+00
4+
- 1.75617674e+00
5+
- 8.48910282e-01
6+
- 3.59374358e-01
7+
- 1.59687456e-01
8+
- 5.72135556e-02
9+
- 2.18712751e-02
10+
- 3.51971236e-03
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data_central:
2+
- 2.52016612e+00
3+
- 5.28550215e+00
4+
- 3.91536522e+00
5+
- 1.81327566e+00
6+
- 6.71075534e-01
7+
- 2.32658949e-01
8+
- 7.16020182e-02
9+
- 1.10413090e-02
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
data_central:
2+
- 4.72400572e+02
3+
- 4.57349511e+02
4+
- 3.93913968e+02
5+
- 2.93297350e+02
6+
- 1.49537360e+02
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
data_central:
2+
- 5.66214940e+02
3+
- 5.69935045e+02
4+
- 5.07735069e+02
5+
- 4.22559135e+02
6+
- 3.32748678e+02
7+
- 2.16741100e+02
8+
- 9.01916721e+01

0 commit comments

Comments
 (0)