Skip to content

Commit

Permalink
Added function to produce data_CF.yaml and added rawdata tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ecole41 committed Nov 10, 2024
1 parent fabfb23 commit 1a7a803
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nnpdf_data/nnpdf_data/commondata/ATLAS_Z0_7TEV_46FB/data_CF.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
data_central:
- 7710.0
- 17930.0
- 3.25200000e+04
- 50550.0
- 68880.0
- 86590.0
- 86210.0
- 40690.0
- 10950.0
- 300.0
- 548.0
- 925.0
- 937.0
- 437.0
- 70.4
27 changes: 27 additions & 0 deletions nnpdf_data/nnpdf_data/commondata/ATLAS_Z0_7TEV_46FB/filter_CF.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
When running `python filter.py` the relevant data yaml
file will be created in the `nnpdf_data/commondata/ATLAS_WPWM_7TEV_46FB` directory.
"""

import yaml
from filter_utils_CF import get_data_values
from nnpdf_data.filter_utils.utils import prettify_float

yaml.add_representer(float, prettify_float)


def filter_ATLAS_Z0_7TEV_46FB_CF_data_central():
"""
This function writes the central values to yaml files.
"""
central_values = list(get_data_values())

data_central_yaml = {"data_central": central_values}

# write central values and kinematics to yaml file
with open("data_CF.yaml", "w") as file:
yaml.dump(data_central_yaml, file, sort_keys=False)


if __name__ == "__main__":
filter_ATLAS_Z0_7TEV_46FB_CF_data_central()
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""
This module contains helper functions that are used to extract the data values
from the rawdata files.
"""

import yaml

import pandas as pd
import numpy as np


def get_data_values():
"""
returns the central data values in the form of a list.
"""

data_central = []

hepdata_table_1 = f"rawdata/HEPData-ins1502620-v1-Table_14.yaml"
hepdata_table_2 = f"rawdata/HEPData-ins1502620-v1-Table_15.yaml"

with open(hepdata_table_1, 'r') as file:
input_1 = yaml.safe_load(file)

with open(hepdata_table_2, 'r') as file:
input_2 = yaml.safe_load(file)

values_1 = input_1['dependent_variables'][0]['values']
values_2 = input_2['dependent_variables'][0]['values']

values = values_1 + values_2

for value in values:
# store data central and convert the units
data_central.append(value['value'] * 1000)

return data_central


if __name__ == "__main__":
get_data_values()
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

independent_variables:
- header: {name: absolute dilepton y}
values:
- {low: 1.20, high: 1.40}
- {low: 1.40, high: 1.60}
- {low: 1.60, high: 1.80}
- {low: 1.80, high: 2.00}
- {low: 2.00, high: 2.20}
- {low: 2.20, high: 2.40}
- {low: 2.40, high: 2.80}
- {low: 2.80, high: 3.20}
- {low: 3.20, high: 3.60}

dependent_variables:
- header: {name: '$d\sigma / d|y_{\ell\ell}|$', units: PB}
qualifiers:
- {name: SQRT(S), units: GEV, value: 7000}
- {name: RE, value: P P --> (Z0 + GAMMA*) X}
- {name: ABS(ETARAP(C=LEPTON1)), value: < 2.5}
- {name: ABS(ETARAP(C=LEPTON2)), value: '2.5-4.9'}
- {name: PT(C=LEPTON), units: GEV, value: '> 20'}
- {name: MLL, units: GEV, value: '66-116'}
values:
- value: 7.710
errors:
- {label: stat, symerror: 1.76%}
- {label: 'uncor', symerror: 1.84%}
- {label: 'cor', symerror: 3.10%}
- {label: 'lumi', symerror: 1.8%}
- value: 17.93
errors:
- {label: stat, symerror: 1.02%}
- {label: 'uncor', symerror: 1.11%}
- {label: 'cor', symerror: 2.93%}
- {label: 'lumi', symerror: 1.8%}
- value: 32.52
errors:
- {label: stat, symerror: 0.73%}
- {label: 'uncor', symerror: 0.70%}
- {label: 'cor', symerror: 2.68%}
- {label: 'lumi', symerror: 1.8%}
- value: 50.55
errors:
- {label: stat, symerror: 0.59%}
- {label: 'uncor', symerror: 1.77%}
- {label: 'cor', symerror: 2.52%}
- {label: 'lumi', symerror: 1.8%}
- value: 68.88
errors:
- {label: stat, symerror: 0.58%}
- {label: 'uncor', symerror: 2.66%}
- {label: 'cor', symerror: 2.14%}
- {label: 'lumi', symerror: 1.8%}
- value: 86.59
errors:
- {label: stat, symerror: 0.50%}
- {label: 'uncor', symerror: 1.90%}
- {label: 'cor', symerror: 1.90%}
- {label: 'lumi', symerror: 1.8%}
- value: 86.21
errors:
- {label: stat, symerror: 0.34%}
- {label: 'uncor', symerror: 3.03%}
- {label: 'cor', symerror: 1.68%}
- {label: 'lumi', symerror: 1.8%}
- value: 40.69
errors:
- {label: stat, symerror: 0.49%}
- {label: 'uncor', symerror: 0.64%}
- {label: 'cor', symerror: 5.49%}
- {label: 'lumi', symerror: 1.8%}
- value: 10.95
errors:
- {label: stat, symerror: 1.23%}
- {label: 'uncor', symerror: 3.69%}
- {label: 'cor', symerror: 6.40%}
- {label: 'lumi', symerror: 1.8%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

independent_variables:
- header: {name: absolute dilepton y}
values:
- {low: 1.20, high: 1.60}
- {low: 1.60, high: 2.00}
- {low: 2.00, high: 2.40}
- {low: 2.40, high: 2.80}
- {low: 2.80, high: 3.20}
- {low: 3.20, high: 3.60}

dependent_variables:
- header: {name: '$d\sigma / d|y_{\ell\ell}|$', units: PB}
qualifiers:
- {name: SQRT(S), units: GEV, value: 7000}
- {name: RE, value: P P --> (Z0 + GAMMA*) X}
- {name: ABS(ETARAP(C=LEPTON1)), value: < 2.5}
- {name: ABS(ETARAP(C=LEPTON2)), value: '2.5-4.9'}
- {name: PT(C=LEPTON), units: GEV, value: '> 20'}
- {name: MLL, units: GEV, value: '116-150'}
values:
- value: 0.3000
errors:
- {label: stat, symerror: 6.84%}
- {label: 'uncor', symerror: 6.58%}
- {label: 'cor', symerror: 8.96%}
- {label: 'lumi', symerror: 1.8%}
- value: 0.5480
errors:
- {label: stat, symerror: 5.21%}
- {label: 'uncor', symerror: 7.78%}
- {label: 'cor', symerror: 7.20%}
- {label: 'lumi', symerror: 1.8%}
- value: 0.9250
errors:
- {label: stat, symerror: 3.99%}
- {label: 'uncor', symerror: 13.52%}
- {label: 'cor', symerror: 4.26%}
- {label: 'lumi', symerror: 1.8%}
- value: 0.9370
errors:
- {label: stat, symerror: 3.87%}
- {label: 'uncor', symerror: 20.86%}
- {label: 'cor', symerror: 3.87%}
- {label: 'lumi', symerror: 1.8%}
- value: 0.4370
errors:
- {label: stat, symerror: 5.30%}
- {label: 'uncor', symerror: 14.40%}
- {label: 'cor', symerror: 6.59%}
- {label: 'lumi', symerror: 1.8%}
- value: 0.0704
errors:
- {label: stat, symerror: 14.49%}
- {label: 'uncor', symerror: 11.60%}
- {label: 'cor', symerror: 7.04%}
- {label: 'lumi', symerror: 1.8%}

0 comments on commit 1a7a803

Please sign in to comment.