Skip to content

Commit 3d39b83

Browse files
committed
topaz all impl
1 parent 45ff9ca commit 3d39b83

18 files changed

Lines changed: 476 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
data_central:
2+
- 0.41
3+
- 0.61
4+
- 0.63
5+
- 0.75
6+
- 0.69
7+
- 0.51
8+
- 0.39
9+
- 0.44
10+
- 0.48
11+
- 0.29
12+
- 0.24
13+
- 0.12
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from filter_core import magic
2+
import yaml
3+
4+
table = "rawdata/Table2.yaml"
5+
ndat = 12
6+
var_name = 'xi'
7+
8+
data, kin, err = magic(table, ndat, var_name, 1)
9+
10+
with open('data.yaml', 'w') as f:
11+
yaml.dump(data, f, sort_keys=False)
12+
with open('kinematics.yaml', 'w') as f:
13+
yaml.dump(kin, f, sort_keys=False)
14+
with open('uncertainties.yaml', 'w') as f:
15+
yaml.dump(err, f, sort_keys=False)
16+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../TOPAZ_SIA-PI_58GEV_EE-PISUM/filter_core.py
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
bins:
2+
- xi:
3+
min: null
4+
mid: 1.32
5+
max: null
6+
- xi:
7+
min: null
8+
mid: 1.62
9+
max: null
10+
- xi:
11+
min: null
12+
mid: 1.92
13+
max: null
14+
- xi:
15+
min: null
16+
mid: 2.62
17+
max: null
18+
- xi:
19+
min: null
20+
mid: 2.77
21+
max: null
22+
- xi:
23+
min: null
24+
mid: 3.41
25+
max: null
26+
- xi:
27+
min: null
28+
mid: 3.51
29+
max: null
30+
- xi:
31+
min: null
32+
mid: 3.61
33+
max: null
34+
- xi:
35+
min: null
36+
mid: 3.77
37+
max: null
38+
- xi:
39+
min: null
40+
mid: 3.96
41+
max: null
42+
- xi:
43+
min: null
44+
mid: 4.14
45+
max: null
46+
- xi:
47+
min: null
48+
mid: 4.42
49+
max: null
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
setname: 'TOPAZ_SIA-KA_58GEV_EE-KASUM'
2+
3+
nnpdf_metadata:
4+
nnpdf31_process: "SIA-KA"
5+
experiment: "TOPAZ"
6+
7+
arXiv:
8+
url: "https://arxiv.org/abs/hep-ex/9412015"
9+
iNSPIRE:
10+
url: "https://inspirehep.net/literature/381900"
11+
hepdata:
12+
url: "https://www.hepdata.net/record/ins381900"
13+
version: 1
14+
15+
version: 1
16+
version_comment: "Initial implementation"
17+
18+
implemented_observables:
19+
20+
- observable: {description: "normalized x-sec differential wrt $\xi$", label: '$\frac{1}{\sigma_{tot}}\frac{d\sigma^h}{d\xi}$', units: ''}
21+
observable_name: XI
22+
process_type: SIA_XI
23+
ndata: 12
24+
tables: [2]
25+
kinematics:
26+
variables:
27+
xi: {description: "ln(1/x_p)", label: '$\xi$', units: ''}
28+
file: kinematics.yaml
29+
data_central: data.yaml
30+
data_uncertainties:
31+
- uncertainties.yaml
32+
kinematic_coverage: [xi]
33+
plotting:
34+
dataset_label: 'TOPAZ 58 GEV SIA KA- + KA+ : $\frac{1}{\sigma_{tot}}\frac{d\sigma^h}{d\xi}$'
35+
x_scale: linear
36+
plot_x: xi
37+
y_label: '$\frac{1}{\sigma_{tot}}\frac{d\sigma^h}{d\xi}$'
38+
# theory:
39+
# FK_tables:
40+
# - -
41+
# operation: 'null'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
definitions:
2+
error:
3+
definition: all uncertainties added in quadrature
4+
treatment: ADD
5+
type: UNCORR
6+
bins:
7+
- error: 0.08
8+
- error: 0.1
9+
- error: 0.1
10+
- error: 0.19
11+
- error: 0.16
12+
- error: 0.08
13+
- error: 0.06
14+
- error: 0.06
15+
- error: 0.06
16+
- error: 0.04
17+
- error: 0.03
18+
- error: 0.02
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data_central:
2+
- 1.07
3+
- 1.5
4+
- 2.24
5+
- 2.75
6+
- 3.25
7+
- 3.75
8+
- 3.95
9+
- 3.84
10+
- 4.75
11+
- 4.86
12+
- 4.79
13+
- 4.53
14+
- 4.18
15+
- 3.82
16+
- 3.27
17+
- 2.27
18+
- 1.94
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from filter_core import magic
2+
import yaml
3+
4+
table = "rawdata/Table2.yaml"
5+
ndat = 17
6+
var_name = 'xi'
7+
8+
data, kin, err = magic(table, ndat, var_name, 0)
9+
10+
with open('data.yaml', 'w') as f:
11+
yaml.dump(data, f, sort_keys=False)
12+
with open('kinematics.yaml', 'w') as f:
13+
yaml.dump(kin, f, sort_keys=False)
14+
with open('uncertainties.yaml', 'w') as f:
15+
yaml.dump(err, f, sort_keys=False)
16+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import yaml
2+
3+
from nnpdf_data.filter_utils.utils import percentage_to_absolute as pta
4+
from nnpdf_data.filter_utils.utils import symmetrize_errors as se
5+
from nnpdf_data.filter_utils.utils import prettify_float
6+
7+
yaml.add_representer(float, prettify_float)
8+
9+
10+
def magic(table, ndat, var_name, index):
11+
with open(table, 'r') as f:
12+
input = yaml.safe_load(f)
13+
14+
data_central = []
15+
kin = []
16+
error = []
17+
18+
values = input['dependent_variables'][index]['values']
19+
total_bins = len(values)
20+
21+
for i in range(total_bins):
22+
if values[i]['value'] == '-':
23+
continue
24+
else:
25+
kin_mid = input['independent_variables'][0]['values'][i]['value']
26+
27+
kin_value = {var_name: {'min': None, 'mid': kin_mid, 'max': None}}
28+
29+
data_central_value = values[i]['value']
30+
error_value = {}
31+
error_value['error'] = values[i]['errors'][0]['symerror']
32+
33+
kin.append(kin_value)
34+
data_central.append(data_central_value)
35+
error.append(error_value)
36+
37+
if len(data_central) != ndat:
38+
raise ValueError(f"Number of data points {len(data_central)} does not match expected {ndat}")
39+
40+
error_definition = {}
41+
error_definition['error'] = {
42+
'definition': 'all uncertainties added in quadrature',
43+
'treatment': 'ADD',
44+
'type': 'UNCORR',
45+
}
46+
47+
data_central_yaml = {'data_central': data_central}
48+
kin_yaml = {'bins': kin}
49+
uncertainties_yaml = {'definitions': error_definition, 'bins': error}
50+
51+
return data_central_yaml, kin_yaml, uncertainties_yaml
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
bins:
2+
- xi:
3+
min: null
4+
mid: 1.32
5+
max: null
6+
- xi:
7+
min: null
8+
mid: 1.62
9+
max: null
10+
- xi:
11+
min: null
12+
mid: 1.92
13+
max: null
14+
- xi:
15+
min: null
16+
mid: 2.22
17+
max: null
18+
- xi:
19+
min: null
20+
mid: 2.47
21+
max: null
22+
- xi:
23+
min: null
24+
mid: 2.62
25+
max: null
26+
- xi:
27+
min: null
28+
mid: 2.77
29+
max: null
30+
- xi:
31+
min: null
32+
mid: 2.98
33+
max: null
34+
- xi:
35+
min: null
36+
mid: 3.41
37+
max: null
38+
- xi:
39+
min: null
40+
mid: 3.51
41+
max: null
42+
- xi:
43+
min: null
44+
mid: 3.61
45+
max: null
46+
- xi:
47+
min: null
48+
mid: 3.77
49+
max: null
50+
- xi:
51+
min: null
52+
mid: 3.96
53+
max: null
54+
- xi:
55+
min: null
56+
mid: 4.14
57+
max: null
58+
- xi:
59+
min: null
60+
mid: 4.42
61+
max: null
62+
- xi:
63+
min: null
64+
mid: 4.71
65+
max: null
66+
- xi:
67+
min: null
68+
mid: 4.83
69+
max: null

0 commit comments

Comments
 (0)