Skip to content

Commit aa09dc2

Browse files
committed
Implemented correlation matrix in CMS 13 TeV Afb data set
1 parent 2a73cc6 commit aa09dc2

File tree

6 files changed

+5490
-3275
lines changed

6 files changed

+5490
-3275
lines changed
Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
data_central:
2-
- -0.0088087
3-
- -0.033938
4-
- -0.021486
5-
- -0.01283
6-
- -0.0010866
7-
- 0.0017601
8-
- 0.014298
9-
- 0.023975
10-
- 0.02063
11-
- 0.04671
12-
- 0.04132
13-
- -0.065286
14-
- -0.098281
15-
- -0.064055
16-
- -0.035366
17-
- -0.0091856
18-
- 0.015125
19-
- 0.03051
20-
- 0.067186
21-
- 0.078415
22-
- 0.12568
23-
- 0.17502
24-
- -0.13264
25-
- -0.17966
26-
- -0.1151
27-
- -0.063701
28-
- -0.017779
29-
- 0.026632
30-
- 0.057933
31-
- 0.10609
32-
- 0.14562
33-
- 0.21103
34-
- 0.30288
35-
- -0.21994
36-
- -0.26467
37-
- -0.13147
38-
- 0.039362
39-
- 0.18504
40-
- 0.31841
41-
- 0.43577
42-
- -0.28089
43-
- -0.37435
44-
- -0.20281
45-
- 0.057507
46-
- 0.27497
47-
- 0.45481
48-
- 0.63044
49-
- -0.37894
50-
- -0.52607
51-
- -0.27475
52-
- 0.080962
53-
- 0.35646
54-
- 0.61701
55-
- 0.79779
56-
- -0.45325
57-
- 0.1066
58-
- 0.49703
59-
- -0.59247
60-
- 0.12488
61-
- 0.65322
62-
- -0.67106
63-
- 0.15607
64-
- 0.74539
2+
- -0.0086482
3+
- -0.033992
4+
- -0.021625
5+
- -0.012986
6+
- -0.0011154
7+
- 0.0017664
8+
- 0.01436
9+
- 0.024078
10+
- 0.020788
11+
- 0.046908
12+
- 0.04152
13+
- -0.064782
14+
- -0.098499
15+
- -0.064554
16+
- -0.035726
17+
- -0.0093437
18+
- 0.015155
19+
- 0.030693
20+
- 0.067548
21+
- 0.07893
22+
- 0.12633
23+
- 0.17564
24+
- -0.13178
25+
- -0.18003
26+
- -0.11602
27+
- -0.064338
28+
- -0.018044
29+
- 0.026687
30+
- 0.05825
31+
- 0.10674
32+
- 0.14654
33+
- 0.21216
34+
- 0.30394
35+
- -0.21858
36+
- -0.26521
37+
- -0.13269
38+
- 0.039435
39+
- 0.18622
40+
- 0.32014
41+
- 0.43738
42+
- -0.27888
43+
- -0.37527
44+
- -0.20469
45+
- 0.057624
46+
- 0.27664
47+
- 0.45724
48+
- 0.63255
49+
- -0.3762
50+
- -0.52712
51+
- -0.2774
52+
- 0.081106
53+
- 0.35895
54+
- 0.62059
55+
- 0.80039
56+
- -0.45736
57+
- 0.10689
58+
- 0.49997
59+
- -0.59639
60+
- 0.1251
61+
- 0.65723
62+
- -0.67574
63+
- 0.15638
64+
- 0.75026

nnpdf_data/nnpdf_data/commondata/CMS_Z0_13TEV/filter.py

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88

99
import yaml
10+
from nnpdf_data.filter_utils.utils import cormat_to_covmat,covmat_to_artunc
1011

1112
def get_tables():
1213
"""
@@ -31,6 +32,9 @@ def get_all():
3132
data_central = []
3233
kinematics = []
3334
uncertainties = []
35+
art_uncert = []
36+
art_uncertainties = []
37+
correlations = []
3438
hepdata_tables = get_tables()
3539

3640
table=hepdata_tables[0]
@@ -58,36 +62,58 @@ def get_all():
5862
'max': kin_values_mll_max[i]["value"]}}
5963
kinematics.append(kin)
6064

61-
# Uncertainties
65+
# Artificial uncertainties (from correlation matrix)
66+
# Errors
6267
for data_value in data_values:
6368
errors = data_value["errors"]
6469
uncertainty = {}
6570
for error in errors:
66-
uncertainty[error["label"]] = error["symerror"]
67-
uncertainty.update(uncertainty)
68-
uncertainties.append(uncertainty)
71+
uncertainties.append(error["symerror"])
72+
73+
# Correlation coefficients
74+
table_corr = hepdata_tables[1]
75+
with open(table_corr, 'r') as f:
76+
input = yaml.safe_load(f)
77+
corr_coeffs = input["dependent_variables"][0]["values"]
78+
for corr_coeff in corr_coeffs:
79+
correlations.append(corr_coeff["value"])
80+
81+
covmat = cormat_to_covmat(uncertainties,correlations)
82+
art_uncertainties = covmat_to_artunc(len(uncertainties),covmat,1)
83+
84+
# Remap uncertainties
85+
for uncertainties in art_uncertainties:
86+
j = 1
87+
artificial_unc={}
88+
for uncertainty in uncertainties:
89+
key = "artificial uncertainty " + str(j)
90+
art_unc = {key: uncertainty}
91+
j = j + 1
92+
93+
artificial_unc.update(art_unc)
6994

70-
return(data_central, kinematics, uncertainties)
95+
art_uncert.append(artificial_unc)
96+
97+
return(data_central, kinematics, art_uncert)
7198

7299
def filter_CMS_Z0_13TEV_PT():
73100
"""
74101
Dumps data, kinematics, and uncertainties on .yaml files
75102
"""
76-
#central_values, kinematics, uncertainties = get_all()
77103
central_values, kinematics, uncertainties = get_all()
78104
# Central values
79105
data_central_yaml = {"data_central": central_values}
80106
# Kinematics
81107
kinematics_yaml = {"bins": kinematics}
82108
# Uncertainties
83-
treatment = {"A4 uncertainty": "ADD"}
84-
correlation = {"A4 uncertainty": "UNCORR"}
109+
treatment = {"artificial uncertainty": "ADD"}
110+
correlation = {"artificial uncertainty": "CORR"}
85111
definitions = {}
86112
for key,value in uncertainties[0].items():
87113
definition = {key :
88114
{"description": key,
89-
"treatment": treatment[key],
90-
"type": correlation[key]}}
115+
"treatment": "ADD",
116+
"type": "CORR"}}
91117
definitions.update(definition)
92118
uncertainties_yaml = {"definitions": definitions,"bins": uncertainties}
93119

nnpdf_data/nnpdf_data/commondata/CMS_Z0_13TEV/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ iNSPIRE:
88
url: https://inspirehep.net/literature/2818125
99
hepdata:
1010
url: https://www.hepdata.net/record/ins2818125
11-
version: 2
11+
version: 1
1212

1313
nnpdf_metadata:
1414
nnpdf31_process: "DY NC"

0 commit comments

Comments
 (0)