Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions buildmaster/E605_DY_38P8GEV/data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
data_central:
- 364.0
- 209.0
- 220.0
- 243.0
- 119.0
- 176.0
- 174.0
- 140.0
- 105.0
- 123.0
- 34.9
- 28.9
- 27.4
- 16.2
- 10.7
- 3.57
- 1.7
- 399.0
- 315.0
- 277.0
- 244.0
- 237.0
- 192.0
- 166.0
- 161.0
- 145.0
- 127.0
- 45.6
- 28.9
- 30.9
- 19.9
- 12.5
- 5.8
- 1.79
- 0.474
- 424.0
- 350.0
- 363.0
- 248.0
- 208.0
- 212.0
- 148.0
- 144.0
- 143.0
- 114.0
- 39.7
- 33.1
- 27.4
- 21.6
- 15.1
- 6.05
- 1.86
- 0.404
- 431.0
- 347.0
- 386.0
- 274.0
- 294.0
- 223.0
- 169.0
- 137.0
- 137.0
- 126.0
- 46.0
- 37.0
- 30.2
- 23.1
- 14.7
- 7.0
- 2.24
- 0.495
- 560.0
- 405.0
- 315.0
- 274.0
- 318.0
- 214.0
- 162.0
- 159.0
- 135.0
- 133.0
- 57.1
- 41.1
- 34.5
- 25.1
- 16.4
- 6.43
- 2.2
- 0.56
- 419.0
- 396.0
- 331.0
- 377.0
- 401.0
- 193.0
- 153.0
- 151.0
- 134.0
- 149.0
- 59.5
- 40.3
- 31.3
- 23.2
- 15.9
- 6.3
- 2.38
- 0.607
- 198.0
- 173.0
- 149.0
- 98.6
- 71.1
- 28.7
- 36.8
- 24.7
- 14.6
- 6.14
- 1.95
- 0.423
93 changes: 93 additions & 0 deletions buildmaster/E605_DY_38P8GEV/filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import yaml


def filter_E605():
with open("metadata.yaml", "r") as file:
metadata = yaml.safe_load(file)


version = metadata["hepdata"]["version"]

obs = metadata["implemented_observables"][0]
tables = obs["tables"]
npoints = obs["npoints"]

data_central = []
kin = []
error = []
for i, n in zip(tables, npoints):
hepdata_tables = (
"rawdata/HEPData-ins302822-v" + str(version) + "-Table_" + str(i) + ".yaml"
)
with open(hepdata_tables, "r") as file:
input = yaml.safe_load(file)

y = float(input["dependent_variables"][0]["qualifiers"][2]["value"])
sqrts = float(input["dependent_variables"][0]["qualifiers"][1]["value"])

for j in range(n):

data_central_value = input["dependent_variables"][0]["values"][j]["value"]
data_central.append(data_central_value)
sqrttau = input["independent_variables"][0]["values"][j]["value"]
m2 = (sqrttau*sqrts)**2
kin_value = {
"sqrts": {"min": None, "mid": sqrts, "max": None},
"m2": {"min": None, "mid": m2, "max": None},
"y": {"min": None, "mid": y, "max": None},
}
kin.append(kin_value)
error_value = {
"stat_1": input["dependent_variables"][0]["values"][j]["errors"][0][
"symerror"
],
"syst_1": float(
input["dependent_variables"][0]["values"][j]["errors"][1][
"symerror"
].rstrip("%")
)
* data_central_value
* 1e-2,
"syst_2": float(
input["dependent_variables"][0]["values"][j]["errors"][2][
"symerror"
].rstrip("%")
)
* data_central_value
* 1e-2,
}
error.append(error_value)

error_definition = {
"stat_1": {
"description": "total statistical uncertainty",
"treatment": "ADD",
"type": "UNCORR",
},
"syst_1": {
"description": "normalization systematic uncertainty",
"treatment": "MULT",
"type": "CORR",
},
"syst_2": {
"description": "total systematic uncertainty",
"treatment": "ADD",
"type": "UNCORR",
},
}

data_central_yaml = {"data_central": data_central}
kinematics_yaml = {"bins": kin}
uncertainties_yaml = {"definitions": error_definition, "bins": error}

with open("data.yaml", "w") as file:
yaml.dump(data_central_yaml, file, sort_keys=False)

with open("kinematics.yaml", "w") as file:
yaml.dump(kinematics_yaml, file, sort_keys=False)

with open("uncertainties.yaml", "w") as file:
yaml.dump(uncertainties_yaml, file, sort_keys=False)


filter_E605()
Loading