Skip to content

Commit

Permalink
Added kinematics
Browse files Browse the repository at this point in the history
  • Loading branch information
ecole41 committed Dec 18, 2024
1 parent 1512d26 commit 6f023aa
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import yaml
from filter_utils import get_data_values
from filter_utils import get_data_values, get_kinematics

from nnpdf_data.filter_utils.utils import prettify_float

Expand All @@ -18,12 +18,19 @@ def filter_ATLAS_Z0_7TEV_36FB_data_kinematic():

central_values = get_data_values()

kin = get_kinematics()

data_central_yaml = {"data_central": central_values}

kinematics_yaml = {"bins": kin}

# write central values and kinematics to yaml file
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)


if __name__ == "__main__":
filter_ATLAS_Z0_7TEV_36FB_data_kinematic()
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,28 @@ def get_data_values():
return data_central


def get_kinematics():
"""
returns the kinematics in the form of a list of dictionaries.
"""
kin = []

hepdata_table = f"rawdata/HEPData-ins928289-v1-Table_1.yaml"

with open(hepdata_table, 'r') as file:
input = yaml.safe_load(file)

for i, M in enumerate(input["independent_variables"][0]['values']):
kin_value = {
'abs_eta': {'min': None, 'mid': (0.5 * (M['low'] + M['high'])), 'max': None},
'm_Z2': {'min': None, 'mid': 8315.17839376, 'max': None},
'sqrts': {'min': None, 'mid': 7000.0, 'max': None},
}
kin.append(kin_value)

return kin


if __name__ == "__main__":
get_data_values()
get_kinematics()
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
bins:
- abs_eta:
min: null
mid: 0.2
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 6.00000000e-01
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.0
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.4
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.8
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 2.2
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 2.60000000e+00
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 3.2
max: null
m_Z2:
min: null
mid: 8.31517839e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null

0 comments on commit 6f023aa

Please sign in to comment.