-
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.
Merge pull request #2154 from NNPDF/sihp-data
Sihp data
- Loading branch information
Showing
32 changed files
with
1,394 additions
and
3 deletions.
There are no files selected for viewing
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
13 changes: 13 additions & 0 deletions
13
nnpdf_data/nnpdf_data/commondata/PHENIX-2009_SHP_200GEV_PI0/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,13 @@ | ||
data_central: | ||
- 0.00051 | ||
- 0.00096 | ||
- 0.00039 | ||
- -0.00023 | ||
- 0.0006 | ||
- 0.0002 | ||
- 0.0013 | ||
- 0.0026 | ||
- -0.0039 | ||
- 0.0096 | ||
- 0.008 | ||
- 0.061 |
93 changes: 93 additions & 0 deletions
93
nnpdf_data/nnpdf_data/commondata/PHENIX-2009_SHP_200GEV_PI0/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,93 @@ | ||
from pathlib import Path | ||
|
||
import pandas as pd | ||
import yaml | ||
|
||
|
||
def read_data(path_rawdata: str) -> pd.DataFrame: | ||
data = yaml.safe_load(Path(path_rawdata).read_text()) | ||
|
||
ptvals = data["independent_variables"][0]["values"] | ||
asym_obs = data["dependent_variables"][0]["values"] | ||
|
||
concatenated_table = [] | ||
for i in range(len(ptvals)): | ||
# Compute pT mid-value if not given | ||
pt_mid = (float(ptvals[i]["high"]) + float(ptvals[i]["low"])) / 2 | ||
pt_midval = ptvals[i].get("value", pt_mid) | ||
|
||
concatenated_table.append( | ||
pd.DataFrame( | ||
{ | ||
"pT_low": [ptvals[i]["low"]], | ||
"pT": [pt_midval], | ||
"pT_high": [ptvals[i]["high"]], | ||
"asym": [asym_obs[i]["value"]], | ||
"stat_err": [asym_obs[i]["errors"][0]["symerror"]], | ||
"lumi_err": [asym_obs[i]["errors"][1]["symerror"]], | ||
"spol_err": [asym_obs[i]["errors"][2]["symerror"].removesuffix("%")], | ||
} | ||
) | ||
) | ||
|
||
return pd.concat(concatenated_table, ignore_index=True) | ||
|
||
|
||
def dump_data(df_table: pd.DataFrame) -> None: | ||
# Dump central data into Yaml file | ||
data_central = [] | ||
for i in range(len(df_table["asym"])): | ||
data_central.append(float(df_table.loc[i, "asym"])) | ||
|
||
with open("data.yaml", "w") as file: | ||
yaml.dump({"data_central": data_central}, file, sort_keys=False) | ||
|
||
# Dump the kinematics into Yaml file | ||
kinematics = [] | ||
for i in range(len(df_table["asym"])): | ||
kin_value = { | ||
"pT": { | ||
"min": float(df_table.loc[i, "pT_low"]), | ||
"mid": float(df_table.loc[i, "pT"]), | ||
"max": float(df_table.loc[i, "pT_high"]), | ||
}, | ||
"eta": {"min": -0.35, "mid": 0.0, "max": 0.35}, | ||
} | ||
kinematics.append(kin_value) | ||
|
||
with open("kinematics.yaml", "w") as file: | ||
yaml.dump({"bins": kinematics}, file, sort_keys=False) | ||
|
||
# Dump the uncertainties into Yaml file | ||
errors = [] | ||
for i in range(len(df_table)): | ||
error_per_bin = { | ||
"stat": float(df_table.loc[i, "stat_err"]), | ||
"sys_lumi": float(df_table.loc[i, "lumi_err"]), | ||
"sys_pol": abs(data_central[i]) * float(df_table.loc[i, "spol_err"]) / 100.0, | ||
} | ||
errors.append(error_per_bin) | ||
|
||
error_definition = { | ||
"stat": {"description": "Statistical uncertainty", "treatment": "ADD", "type": "UNCORR"}, | ||
"sys_lumi": { | ||
"description": "Systematic uncertainties due to luminosity", | ||
"treatment": "MULT", | ||
"type": "CORR", | ||
}, | ||
"sys_pol": { | ||
"description": "Systematic uncertainties due to polarization", | ||
"treatment": "MULT", | ||
"type": "CORR", | ||
}, | ||
} | ||
|
||
with open("uncertainties.yaml", "w") as file: | ||
yaml.dump({"definitions": error_definition, "bins": errors}, file, sort_keys=False) | ||
|
||
return | ||
|
||
|
||
if __name__ == "__main__": | ||
df_table = read_data("./rawdata/HEPData-ins1282448-v1-Table_7.yaml") | ||
dump_data(df_table=df_table) |
97 changes: 97 additions & 0 deletions
97
nnpdf_data/nnpdf_data/commondata/PHENIX-2009_SHP_200GEV_PI0/kinematics.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,97 @@ | ||
bins: | ||
- pT: | ||
min: 1.0 | ||
mid: 1.3 | ||
max: 1.5 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 1.5 | ||
mid: 1.75 | ||
max: 2.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 2.0 | ||
mid: 2.23 | ||
max: 2.5 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 2.5 | ||
mid: 2.72 | ||
max: 3.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 3.0 | ||
mid: 3.22 | ||
max: 3.5 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 3.5 | ||
mid: 3.72 | ||
max: 4.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 4.0 | ||
mid: 4.39 | ||
max: 5.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 5.0 | ||
mid: 5.4 | ||
max: 6.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 6.0 | ||
mid: 6.41 | ||
max: 7.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 7.0 | ||
mid: 7.74 | ||
max: 9.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 9.0 | ||
mid: 10.0 | ||
max: 12.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 | ||
- pT: | ||
min: 12.0 | ||
mid: 13.1 | ||
max: 15.0 | ||
eta: | ||
min: -0.35 | ||
mid: 0.0 | ||
max: 0.35 |
45 changes: 45 additions & 0 deletions
45
nnpdf_data/nnpdf_data/commondata/PHENIX-2009_SHP_200GEV_PI0/metadata.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,45 @@ | ||
# Generalia | ||
setname: "PHENIX-2009_SHP_200GEV_PI0" | ||
|
||
version: 1 | ||
version_comment: "Initial implementation" | ||
|
||
# References | ||
iNSPIRE: | ||
url: "https://inspirehep.net/literature/1282448" | ||
hepdata: | ||
url: "https://www.hepdata.net/record/ins1282448" | ||
version: 1 | ||
|
||
nnpdf_metadata: | ||
nnpdf31_process: "SHP" # Single Hadron Production | ||
experiment: "PHENIX" | ||
|
||
implemented_observables: | ||
- observable_name: "ALL" | ||
observable: | ||
description: "Double helicity asymmetry in inclusive pi^0 production in polarized p+p collisions at sqrt(s)=200 GeV" | ||
label: "$A_{LL}$" | ||
units: "" | ||
process_type: "SHP_ASY" | ||
ndata: 12 | ||
tables: [7] | ||
npoints: [12] # List of datapoints per table | ||
|
||
# Plotting information | ||
plotting: | ||
kinematics_override: identity # TODO | ||
dataset_label: "PHENIX ALL" | ||
y_label: "$A_{LL}(p_T)$" | ||
plot_x: pT | ||
kinematic_coverage: [pT, eta] | ||
|
||
kinematics: | ||
variables: | ||
pT: { description: "Transverse momentum", label: "$p_T$", units: "GeV" } | ||
eta: { description: "pi^0 pseudorapidity", label: r"$\eta$", units: "" } | ||
file: kinematics.yaml | ||
|
||
data_central: data.yaml | ||
data_uncertainties: | ||
- uncertainties.yaml |
81 changes: 81 additions & 0 deletions
81
...pdf_data/commondata/PHENIX-2009_SHP_200GEV_PI0/rawdata/HEPData-ins1282448-v1-Table_7.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,81 @@ | ||
dependent_variables: | ||
- header: {name: ASYM(LL)} | ||
qualifiers: | ||
- {name: RE, value: P P --> PI0 < GAMMA GAMMA > X} | ||
- {name: SQRT(S), units: GeV, value: '200.0'} | ||
values: | ||
- errors: | ||
- {label: stat, symerror: 0.00085} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00035} | ||
- {label: 'sys,pol.', symerror: 3.4%} | ||
value: 0.00051 | ||
- errors: | ||
- {label: stat, symerror: 0.00055} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00033} | ||
- {label: 'sys,pol.', symerror: 3.5%} | ||
value: 0.00096 | ||
- errors: | ||
- {label: stat, symerror: 0.00058} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00034} | ||
- {label: 'sys,pol.', symerror: 3.5%} | ||
value: 0.00039 | ||
- errors: | ||
- {label: stat, symerror: 0.00074} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00036} | ||
- {label: 'sys,pol.', symerror: 3.4%} | ||
value: -0.00023 | ||
- errors: | ||
- {label: stat, symerror: 0.0011} | ||
- {label: 'sys,rel.lumi.', symerror: 0.0004} | ||
- {label: 'sys,pol.', symerror: 3.2%} | ||
value: 0.0006 | ||
- errors: | ||
- {label: stat, symerror: 0.0015} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00041} | ||
- {label: 'sys,pol.', symerror: 3.1%} | ||
value: 0.0002 | ||
- errors: | ||
- {label: stat, symerror: 0.0018} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00043} | ||
- {label: 'sys,pol.', symerror: 3.1%} | ||
value: 0.0013 | ||
- errors: | ||
- {label: stat, symerror: 0.0035} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00045} | ||
- {label: 'sys,pol.', symerror: 3.0%} | ||
value: 0.0026 | ||
- errors: | ||
- {label: stat, symerror: 0.0061} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00045} | ||
- {label: 'sys,pol.', symerror: 2.9%} | ||
value: -0.0039 | ||
- errors: | ||
- {label: stat, symerror: 0.0085} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00045} | ||
- {label: 'sys,pol.', symerror: 2.9%} | ||
value: 0.0096 | ||
- errors: | ||
- {label: stat, symerror: 0.018} | ||
- {label: 'sys,rel.lumi.', symerror: 0.00058} | ||
- {label: 'sys,pol.', symerror: 3.3%} | ||
value: 0.008 | ||
- errors: | ||
- {label: stat, symerror: 0.069} | ||
- {label: 'sys,rel.lumi.', symerror: 0.001} | ||
- {label: 'sys,pol.', symerror: 3.0%} | ||
value: 0.061 | ||
independent_variables: | ||
- header: {name: PT(PI0), units: GEV} | ||
values: | ||
- {high: 1.5, low: 1.0, value: 1.3} | ||
- {high: 2.0, low: 1.5} | ||
- {high: 2.5, low: 2.0, value: 2.23} | ||
- {high: 3.0, low: 2.5, value: 2.72} | ||
- {high: 3.5, low: 3.0, value: 3.22} | ||
- {high: 4.0, low: 3.5, value: 3.72} | ||
- {high: 5.0, low: 4.0, value: 4.39} | ||
- {high: 6.0, low: 5.0, value: 5.4} | ||
- {high: 7.0, low: 6.0, value: 6.41} | ||
- {high: 9.0, low: 7.0, value: 7.74} | ||
- {high: 12.0, low: 9.0, value: 10.0} | ||
- {high: 15.0, low: 12.0, value: 13.1} |
Oops, something went wrong.