Skip to content

Commit 45ff9ca

Browse files
committed
tpc all impl
1 parent 7d24a7d commit 45ff9ca

18 files changed

Lines changed: 645 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
data_central:
2+
- 5.56
3+
- 7.21
4+
- 7.6
5+
- 9.3
6+
- 8.55
7+
- 8.73
8+
- 8.48
9+
- 9.2
10+
- 8.8
11+
- 5.6
12+
- 6.32
13+
- 5.13
14+
- 5.13
15+
- 5.0
16+
- 1.73
17+
- 1.161
18+
- 0.842
19+
- 0.47
20+
- 0.249
21+
- 0.09
22+
- 0.0225
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_1 = "rawdata/Table1.yaml"
5+
ndat = 21
6+
var_name = 'z'
7+
8+
data, kin, err = magic(table_1, 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+
../TPC_SIA-PI_29GEV_EE-PISUM/filter_core.py
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
bins:
2+
- z:
3+
min: 0.025
4+
mid: null
5+
max: 0.03
6+
- z:
7+
min: 0.03
8+
mid: null
9+
max: 0.035
10+
- z:
11+
min: 0.035
12+
mid: null
13+
max: 0.04
14+
- z:
15+
min: 0.04
16+
mid: null
17+
max: 0.045
18+
- z:
19+
min: 0.045
20+
mid: null
21+
max: 0.05
22+
- z:
23+
min: 0.05
24+
mid: null
25+
max: 0.055
26+
- z:
27+
min: 0.055
28+
mid: null
29+
max: 0.06
30+
- z:
31+
min: 0.06
32+
mid: null
33+
max: 0.065
34+
- z:
35+
min: 0.065
36+
mid: null
37+
max: 0.07
38+
- z:
39+
min: 0.09
40+
mid: null
41+
max: 0.1
42+
- z:
43+
min: 0.1
44+
mid: null
45+
max: 0.11
46+
- z:
47+
min: 0.11
48+
mid: null
49+
max: 0.12
50+
- z:
51+
min: 0.12
52+
mid: null
53+
max: 0.13
54+
- z:
55+
min: 0.13
56+
mid: null
57+
max: 0.14
58+
- z:
59+
min: 0.25
60+
mid: null
61+
max: 0.3
62+
- z:
63+
min: 0.3
64+
mid: null
65+
max: 0.35
66+
- z:
67+
min: 0.35
68+
mid: null
69+
max: 0.4
70+
- z:
71+
min: 0.4
72+
mid: null
73+
max: 0.5
74+
- z:
75+
min: 0.5
76+
mid: null
77+
max: 0.6
78+
- z:
79+
min: 0.6
80+
mid: null
81+
max: 0.7
82+
- z:
83+
min: 0.7
84+
mid: null
85+
max: 0.9
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
setname: 'TPC_SIA-KA_29GEV_EE-KASUM'
2+
3+
nnpdf_metadata:
4+
nnpdf31_process: "SIA-KA"
5+
experiment: "TPC"
6+
7+
arXiv:
8+
url: "N/A"
9+
iNSPIRE:
10+
url: "https://inspirehep.net/literature/262143"
11+
hepdata:
12+
url: "https://www.hepdata.net/record/ins262143"
13+
version: 1
14+
15+
version: 1
16+
version_comment: "Initial implementation"
17+
18+
implemented_observables:
19+
20+
- observable: {description: "normalized differential x-sec wrt z", label: '$\frac{1}{\beta\sigma_{tot}}\frac{d\sigma}{dz}$', units: '$$'}
21+
observable_name: Z
22+
process_type: SIA_Z
23+
ndata: 21
24+
tables: [1]
25+
kinematics:
26+
variables:
27+
z: {description: "fractional hadron momentum", label: '$z$', units: ''}
28+
file: kinematics.yaml
29+
data_central: data.yaml
30+
data_uncertainties:
31+
- uncertainties.yaml
32+
kinematic_coverage: [z]
33+
plotting:
34+
dataset_label: 'TPC SIA 29 GeV KA- + KA+ production: $\frac{1}{\beta\sigma_{tot}}\frac{d\sigma}{dz}$'
35+
x_scale: linear
36+
plot_x: z
37+
y_label: '$\frac{1}{\beta\sigma_{tot}}\frac{d\sigma}{dz}$'
38+
# theory:
39+
# FK_tables:
40+
# - -
41+
# operation: 'null'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
definitions:
2+
error:
3+
definition: all uncertainties added in quadrature
4+
treatment: ADD
5+
type: UNCORR
6+
bins:
7+
- error: 0.49
8+
- error: 0.56
9+
- error: 0.59
10+
- error: 1.2
11+
- error: 0.96
12+
- error: 0.65
13+
- error: 0.74
14+
- error: 1.3
15+
- error: 2.3
16+
- error: 1.5
17+
- error: 0.92
18+
- error: 0.61
19+
- error: 0.49
20+
- error: 0.38
21+
- error: 0.11
22+
- error: 0.073
23+
- error: 0.055
24+
- error: 0.03
25+
- error: 0.02
26+
- error: 0.012
27+
- error: 0.0048
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
data_central:
2+
- 88.4
3+
- 138.3
4+
- 149.5
5+
- 144.2
6+
- 130.9
7+
- 112.9
8+
- 104.6
9+
- 93.8
10+
- 83.8
11+
- 76.0
12+
- 68.2
13+
- 60.9
14+
- 36.0
15+
- 29.9
16+
- 12.48
17+
- 10.77
18+
- 7.95
19+
- 6.13
20+
- 4.09
21+
- 2.61
22+
- 1.581
23+
- 0.874
24+
- 0.37
25+
- 0.19
26+
- 0.0466
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_1 = "rawdata/Table1.yaml"
5+
ndat = 25
6+
var_name = 'z'
7+
8+
data, kin, err = magic(table_1, 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: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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_min = input['independent_variables'][0]['values'][i]['low']
26+
kin_max = input['independent_variables'][0]['values'][i]['high']
27+
28+
kin_value = {var_name: {'min': kin_min, 'mid': None, 'max': kin_max}}
29+
30+
data_central_value = values[i]['value']
31+
error_value = {}
32+
error_value['error'] = values[i]['errors'][0]['symerror']
33+
34+
kin.append(kin_value)
35+
data_central.append(data_central_value)
36+
error.append(error_value)
37+
38+
if len(data_central) != ndat:
39+
raise ValueError(f"Number of data points {len(data_central)} does not match expected {ndat}")
40+
41+
error_definition = {}
42+
error_definition['error'] = {
43+
'definition': 'all uncertainties added in quadrature',
44+
'treatment': 'ADD',
45+
'type': 'UNCORR',
46+
}
47+
48+
data_central_yaml = {'data_central': data_central}
49+
kin_yaml = {'bins': kin}
50+
uncertainties_yaml = {'definitions': error_definition, 'bins': error}
51+
52+
return data_central_yaml, kin_yaml, uncertainties_yaml
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
bins:
2+
- z:
3+
min: 0.01
4+
mid: null
5+
max: 0.015
6+
- z:
7+
min: 0.015
8+
mid: null
9+
max: 0.02
10+
- z:
11+
min: 0.02
12+
mid: null
13+
max: 0.025
14+
- z:
15+
min: 0.025
16+
mid: null
17+
max: 0.03
18+
- z:
19+
min: 0.03
20+
mid: null
21+
max: 0.035
22+
- z:
23+
min: 0.035
24+
mid: null
25+
max: 0.04
26+
- z:
27+
min: 0.04
28+
mid: null
29+
max: 0.045
30+
- z:
31+
min: 0.045
32+
mid: null
33+
max: 0.05
34+
- z:
35+
min: 0.05
36+
mid: null
37+
max: 0.055
38+
- z:
39+
min: 0.055
40+
mid: null
41+
max: 0.06
42+
- z:
43+
min: 0.06
44+
mid: null
45+
max: 0.065
46+
- z:
47+
min: 0.065
48+
mid: null
49+
max: 0.07
50+
- z:
51+
min: 0.09
52+
mid: null
53+
max: 0.1
54+
- z:
55+
min: 0.1
56+
mid: null
57+
max: 0.11
58+
- z:
59+
min: 0.16
60+
mid: null
61+
max: 0.18
62+
- z:
63+
min: 0.18
64+
mid: null
65+
max: 0.2
66+
- z:
67+
min: 0.2
68+
mid: null
69+
max: 0.22
70+
- z:
71+
min: 0.22
72+
mid: null
73+
max: 0.25
74+
- z:
75+
min: 0.25
76+
mid: null
77+
max: 0.3
78+
- z:
79+
min: 0.3
80+
mid: null
81+
max: 0.35
82+
- z:
83+
min: 0.35
84+
mid: null
85+
max: 0.4
86+
- z:
87+
min: 0.4
88+
mid: null
89+
max: 0.5
90+
- z:
91+
min: 0.5
92+
mid: null
93+
max: 0.6
94+
- z:
95+
min: 0.6
96+
mid: null
97+
max: 0.7
98+
- z:
99+
min: 0.7
100+
mid: null
101+
max: 0.9

0 commit comments

Comments
 (0)