Skip to content

Commit

Permalink
Added kinematics function and edited metadata kinematics
Browse files Browse the repository at this point in the history
  • Loading branch information
ecole41 committed Dec 17, 2024
1 parent 6b51f05 commit c53fe29
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 22 deletions.
19 changes: 13 additions & 6 deletions nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
"""

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

yaml.add_representer(float, prettify_float)


def filter_ATLAS_WPWM_7TEV_36FB_data_central():
def filter_ATLAS_WPWM_7TEV_36FB_data_kinematic():
"""
This function writes the central data to yaml files.
This function writes the systematics to yaml files.
"""

central_values= get_data_values()
central_values = get_data_values()

data_central_yaml= {"data_central": central_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_WPWM_7TEV_36FB_data_central()
filter_ATLAS_WPWM_7TEV_36FB_data_kinematic()
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_data_values():

data_central = []

tables = [5,3]
tables = [5, 3]

for table in tables:
hepdata_table = f"rawdata/HEPData-ins928289-v1-Table_{table}.yaml"
Expand All @@ -32,5 +32,31 @@ def get_data_values():
return data_central


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

tables = [5, 3]

for table in tables:
hepdata_table = f"rawdata/HEPData-ins928289-v1-Table_{table}.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_W2': {'min': None, 'mid': 6463.838404, 'max': None},
'sqrts': {'min': None, 'mid': 7000.0, 'max': None},
}
kin.append(kin_value)

return kin


if __name__ == "__main__":
get_data_values()
get_data_values()
get_kinematics()
265 changes: 265 additions & 0 deletions nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/kinematics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
bins:
- abs_eta:
min: null
mid: 0.105
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 0.315
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 0.525
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 0.735
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 9.45000000e-01
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.21
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.445
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.63
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.845
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 2.065
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 2.34
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 0.105
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 0.315
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 0.525
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 0.735
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 9.45000000e-01
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.21
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.445
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.63
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 1.845
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 2.065
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
- abs_eta:
min: null
mid: 2.34
max: null
m_W2:
min: null
mid: 6.46383840e+03
max: null
sqrts:
min: null
mid: 7000.0
max: null
28 changes: 14 additions & 14 deletions nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ implemented_observables:
- $W^-$
plot_x: k1
kinematic_coverage:
- k1
- k2
- k3
- abs_eta
- m_W2
- sqrts
kinematics:
variables:
k1:
description: Variable k1
label: k1
units: ''
k2:
description: Variable k2
label: k2
units: ''
k3:
description: Variable k3
label: k3
abs_eta:
description: Absolute pseudo-rapidity of the W boson
label: abs_eta
units: ''
m_W2:
description: Squared invariant mass of the W boson
label: m_W2
units: 'GeV^2'
sqrts:
description: Square root of the center of mass energy
label: sqrts
units: 'GeV'
file: kinematics_ETA.yaml
theory:
conversion_factor: 1.0
Expand Down

0 comments on commit c53fe29

Please sign in to comment.