Skip to content

Commit a334f63

Browse files
committed
Added split of ZpT data sets according to different processes. Adde utils for specialised theory covmat prescriptions
1 parent 386b117 commit a334f63

File tree

208 files changed

+247055
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+247055
-1
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
data_central:
2+
- 0.0473835
3+
- 0.0405684
4+
- 0.0343165
5+
- 0.0291566
6+
- 0.0248037
7+
- 0.021268
8+
- 0.018325
9+
- 0.0156045
10+
- 0.01318
11+
- 0.0112073
12+
- 0.00955676
13+
- 0.00810287
14+
- 0.00678809
15+
- 0.00575628
16+
- 0.00487686
17+
- 0.00416884
18+
- 0.00352131
19+
- 0.00297507
20+
- 0.00254333
21+
- 0.00218319
22+
- 0.00187701
23+
- 0.0015932
24+
- 0.00135193
25+
- 0.0011323
26+
- 0.00095743
27+
- 0.000814977
28+
- 0.000653718
29+
- 0.000484859
30+
- 0.000329051
31+
- 0.000186048
32+
- 0.000104998
33+
- 6.12794e-05
34+
- 3.0584e-05
35+
- 1.22113e-05
36+
- 5.90263e-06
37+
- 2.77421e-06
38+
- 1.25134e-06
39+
- 5.5219e-07
40+
- 2.01646e-07
41+
- 5.11526e-08
42+
- 2.51767e-06
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
"""
2+
This file contains the piece of code needed to implement the ATLAS ZpT
3+
measurement at 13 TeV. We consider the combined electron-muon measurement, for
4+
which a total uncorrelated and a total correlated ucnertainties are given. The
5+
measurement is normalised to the fiducial cross section, therefore there is no
6+
luminosity ucnertainty. The first three bins in pT are cropped, because of
7+
the impossiblity of producing theoretical predictions.
8+
"""
9+
10+
import yaml
11+
12+
def get_tables():
13+
"""
14+
Get the Hepdata table
15+
"""
16+
hepdata_tables = ["rawdata/HEPData-ins1768911-v3-Table_4a.yaml"]
17+
18+
return hepdata_tables
19+
20+
def get_all():
21+
"""
22+
Returns data, kinematics and uncertainties for dumping in the .yaml files
23+
"""
24+
data_central = []
25+
kinematics = []
26+
uncertainties = []
27+
28+
hepdata_tables = get_tables()
29+
for table in hepdata_tables:
30+
with open(table, 'r') as f:
31+
input = yaml.safe_load(f)
32+
33+
# Central values
34+
data_values = input["dependent_variables"][0]["values"]
35+
for data_value in data_values:
36+
data_central.append(data_value["value"])
37+
# Kinematic bins
38+
kin_values = input["independent_variables"][0]["values"]
39+
for kin_value in kin_values:
40+
kin = {
41+
'pT': {'min': kin_value['low'],
42+
'mid': 0.5 * (kin_value['low'] + kin_value['high']),
43+
'max': kin_value['high']},
44+
'm_Z2': {'min': None, 'mid': 8317.44, 'max': None},
45+
'sqrts': {'min': None, 'mid': 13000, 'max': None}}
46+
47+
kinematics.append(kin)
48+
# Uncertainties
49+
i = 0
50+
for data_value in data_values:
51+
errors = data_value["errors"]
52+
uncertainty = {}
53+
for error in errors:
54+
uncertainty[error["label"]] = float(error["symerror"].replace('%',''))*data_central[i]/100.
55+
uncertainty.update(uncertainty)
56+
57+
uncertainties.append(uncertainty)
58+
i = i+1
59+
60+
n=3
61+
return (data_central[n:], kinematics[n:], uncertainties[n:])
62+
63+
def filter_ATLAS_Z0J_13TEV_PT():
64+
"""
65+
Dumps data, kinematics, and uncertainties on .yaml files
66+
"""
67+
central_values, kinematics, uncertainties = get_all()
68+
# Central values
69+
data_central_yaml = {"data_central": central_values}
70+
# Kinematics
71+
kinematics_yaml = {"bins": kinematics}
72+
# Uncertainties
73+
treatment = {"correlated uncertainty": "ADD",
74+
"uncorrelated uncertainty": "ADD",}
75+
correlation = {"correlated uncertainty": "CORR",
76+
"uncorrelated uncertainty": "UNCORR",}
77+
definitions = {}
78+
for key,value in uncertainties[0].items():
79+
definition = {key :
80+
{"description": key,
81+
"treatment": treatment[key],
82+
"type": correlation[key]}}
83+
definitions.update(definition)
84+
uncertainties_yaml = {"definitions": definitions,"bins": uncertainties}
85+
86+
with open("data.yaml", "w") as file:
87+
yaml.dump(data_central_yaml, file, sort_keys=False)
88+
with open("kinematics.yaml", "w") as file:
89+
yaml.dump(kinematics_yaml, file, sort_keys=False)
90+
with open("uncertainties.yaml", "w") as file:
91+
yaml.dump(uncertainties_yaml, file, sort_keys=False)
92+
93+
if __name__ == "__main__":
94+
filter_ATLAS_Z0J_13TEV_PT()

0 commit comments

Comments
 (0)