-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added data central function and added hep link to metadata
- Loading branch information
Showing
6 changed files
with
266 additions
and
2 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/data.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
data_central: | ||
- 6.13257400e+05 | ||
- 6.13939929e+05 | ||
- 6.31746805e+05 | ||
- 6.26184703e+05 | ||
- 6.52630155e+05 | ||
- 6.59312827e+05 | ||
- 6.42534838e+05 | ||
- 6.40935479e+05 | ||
- 6.60983495e+05 | ||
- 6.39876031e+05 | ||
- 5.89205893e+05 | ||
- 4.54666184e+05 | ||
- 4.48492862e+05 | ||
- 4.63569622e+05 | ||
- 4.48034447e+05 | ||
- 4.36074909e+05 | ||
- 4.26723243e+05 | ||
- 3.94511949e+05 | ||
- 3.91211361e+05 | ||
- 3.82307923e+05 | ||
- 3.64073193e+05 | ||
- 3.37179513e+05 |
29 changes: 29 additions & 0 deletions
29
nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
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 import get_data_values | ||
|
||
from nnpdf_data.filter_utils.utils import prettify_float | ||
|
||
yaml.add_representer(float, prettify_float) | ||
|
||
|
||
def filter_ATLAS_WPWM_7TEV_36FB_data_central(): | ||
""" | ||
This function writes the central data to yaml files. | ||
""" | ||
|
||
central_values= get_data_values() | ||
|
||
data_central_yaml= {"data_central": central_values} | ||
|
||
# write central values and kinematics to yaml file | ||
with open("data.yaml", "w") as file: | ||
yaml.dump(data_central_yaml, file, sort_keys=False) | ||
|
||
|
||
if __name__ == "__main__": | ||
filter_ATLAS_WPWM_7TEV_36FB_data_central() |
36 changes: 36 additions & 0 deletions
36
nnpdf_data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/filter_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
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 = [] | ||
|
||
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) | ||
|
||
values = input['dependent_variables'][0]['values'] | ||
|
||
for value in values: | ||
# store data central and convert the units and apply the correction factor | ||
data_central.append(value['value'] * 1000 * 1.0187) | ||
|
||
return data_central | ||
|
||
|
||
if __name__ == "__main__": | ||
get_data_values() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/rawdata/HEPData-ins928289-v1-Table_3.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
dependent_variables: | ||
- header: {name: D(SIG)/DABS(ETARAP), units: PB} | ||
qualifiers: | ||
- {name: MT, units: GEV, value: '> 40'} | ||
- {name: PT(C=LEPTON-), units: GEV, value: '> 20'} | ||
- {name: PT(C=NU), units: GEV, value: '> 25'} | ||
- {name: RE, value: P P --> W- < LEPTON- NUBAR > X} | ||
values: | ||
- errors: | ||
- {label: stat, symerror: 5.16} | ||
- {label: sys, symerror: 5.75} | ||
- {label: sys, symerror: 5.78} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 446.32 | ||
- errors: | ||
- {label: stat, symerror: 4.75} | ||
- {label: sys, symerror: 4.96} | ||
- {label: sys, symerror: 5.68} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 440.26 | ||
- errors: | ||
- {label: stat, symerror: 4.71} | ||
- {label: sys, symerror: 5.0} | ||
- {label: sys, symerror: 5.95} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 455.06 | ||
- errors: | ||
- {label: stat, symerror: 4.93} | ||
- {label: sys, symerror: 5.71} | ||
- {label: sys, symerror: 5.92} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 439.81 | ||
- errors: | ||
- {label: stat, symerror: 4.79} | ||
- {label: sys, symerror: 5.57} | ||
- {label: sys, symerror: 5.83} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 428.07 | ||
- errors: | ||
- {label: stat, symerror: 3.75} | ||
- {label: sys, symerror: 4.0} | ||
- {label: sys, symerror: 5.76} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 418.89 | ||
- errors: | ||
- {label: stat, symerror: 6.94} | ||
- {label: sys, symerror: 5.23} | ||
- {label: sys, symerror: 6.46} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 387.27 | ||
- errors: | ||
- {label: stat, symerror: 4.27} | ||
- {label: sys, symerror: 3.56} | ||
- {label: sys, symerror: 5.64} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 384.03 | ||
- errors: | ||
- {label: stat, symerror: 4.38} | ||
- {label: sys, symerror: 3.88} | ||
- {label: sys, symerror: 5.56} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 375.29 | ||
- errors: | ||
- {label: stat, symerror: 4.05} | ||
- {label: sys, symerror: 3.49} | ||
- {label: sys, symerror: 5.36} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 357.39 | ||
- errors: | ||
- {label: stat, symerror: 3.9} | ||
- {label: sys, symerror: 3.65} | ||
- {label: sys, symerror: 5.43} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 330.99 | ||
independent_variables: | ||
- header: {name: ABS(ETARAP)} | ||
values: | ||
- {high: 0.21, low: 0.0} | ||
- {high: 0.42, low: 0.21} | ||
- {high: 0.63, low: 0.42} | ||
- {high: 0.84, low: 0.63} | ||
- {high: 1.05, low: 0.84} | ||
- {high: 1.37, low: 1.05} | ||
- {high: 1.52, low: 1.37} | ||
- {high: 1.74, low: 1.52} | ||
- {high: 1.95, low: 1.74} | ||
- {high: 2.18, low: 1.95} | ||
- {high: 2.5, low: 2.18} |
88 changes: 88 additions & 0 deletions
88
...data/nnpdf_data/commondata/ATLAS_WPWM_7TEV_36PB/rawdata/HEPData-ins928289-v1-Table_5.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
dependent_variables: | ||
- header: {name: D(SIG)/DABS(ETARAP), units: PB} | ||
qualifiers: | ||
- {name: MT, units: GEV, value: '> 40'} | ||
- {name: PT(C=LEPTON+), units: GEV, value: '> 20'} | ||
- {name: PT(C=NU), units: GEV, value: '> 25'} | ||
- {name: RE, value: P P --> W+ < LEPTON+ NU > X} | ||
values: | ||
- errors: | ||
- {label: stat, symerror: 6.03} | ||
- {label: sys, symerror: 7.01} | ||
- {label: sys, symerror: 8.02} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 602.0 | ||
- errors: | ||
- {label: stat, symerror: 5.59} | ||
- {label: sys, symerror: 5.95} | ||
- {label: sys, symerror: 7.06} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 602.67 | ||
- errors: | ||
- {label: stat, symerror: 5.5} | ||
- {label: sys, symerror: 5.99} | ||
- {label: sys, symerror: 7.26} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 620.15 | ||
- errors: | ||
- {label: stat, symerror: 5.82} | ||
- {label: sys, symerror: 6.88} | ||
- {label: sys, symerror: 7.37} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 614.69 | ||
- errors: | ||
- {label: stat, symerror: 6.01} | ||
- {label: sys, symerror: 6.89} | ||
- {label: sys, symerror: 8.06} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 640.65 | ||
- errors: | ||
- {label: stat, symerror: 4.67} | ||
- {label: sys, symerror: 5.37} | ||
- {label: sys, symerror: 7.68} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 647.21 | ||
- errors: | ||
- {label: stat, symerror: 8.63} | ||
- {label: sys, symerror: 8.2} | ||
- {label: sys, symerror: 10.91} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 630.74 | ||
- errors: | ||
- {label: stat, symerror: 5.31} | ||
- {label: sys, symerror: 4.92} | ||
- {label: sys, symerror: 7.24} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 629.17 | ||
- errors: | ||
- {label: stat, symerror: 5.69} | ||
- {label: sys, symerror: 5.69} | ||
- {label: sys, symerror: 8.37} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 648.85 | ||
- errors: | ||
- {label: stat, symerror: 5.32} | ||
- {label: sys, symerror: 5.46} | ||
- {label: sys, symerror: 7.57} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 628.13 | ||
- errors: | ||
- {label: stat, symerror: 5.17} | ||
- {label: sys, symerror: 5.68} | ||
- {label: sys, symerror: 8.01} | ||
- {label: 'sys,luminosity uncertainty', symerror: 3.4%} | ||
value: 578.39 | ||
independent_variables: | ||
- header: {name: ABS(ETARAP)} | ||
values: | ||
- {high: 0.21, low: 0.0} | ||
- {high: 0.42, low: 0.21} | ||
- {high: 0.63, low: 0.42} | ||
- {high: 0.84, low: 0.63} | ||
- {high: 1.05, low: 0.84} | ||
- {high: 1.37, low: 1.05} | ||
- {high: 1.52, low: 1.37} | ||
- {high: 1.74, low: 1.52} | ||
- {high: 1.95, low: 1.74} | ||
- {high: 2.18, low: 1.95} | ||
- {high: 2.5, low: 2.18} |