diff --git a/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter.py b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter.py index a2d33e62a9..b64f06a0d2 100644 --- a/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter.py +++ b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter.py @@ -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() diff --git a/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter_utils.py b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter_utils.py index 090fbf7bc9..ab2ad1affc 100644 --- a/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter_utils.py +++ b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter_utils.py @@ -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" @@ -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() \ No newline at end of file + get_data_values() + get_kinematics() diff --git a/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/kinematics.yaml b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/kinematics.yaml new file mode 100644 index 0000000000..d058f7e862 --- /dev/null +++ b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/kinematics.yaml @@ -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 diff --git a/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/metadata.yaml b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/metadata.yaml index 706a9a52fc..103d53ac7d 100644 --- a/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/metadata.yaml +++ b/nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/metadata.yaml @@ -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