Skip to content

Commit

Permalink
Merge pull request #2154 from NNPDF/sihp-data
Browse files Browse the repository at this point in the history
Sihp data
  • Loading branch information
Radonirinaunimi authored Sep 20, 2024
2 parents 1d0177b + 23298b7 commit 8b588b8
Show file tree
Hide file tree
Showing 32 changed files with 1,394 additions and 3 deletions.
5 changes: 3 additions & 2 deletions doc/sphinx/source/data/dataset-naming-convention.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ constructed following this [Backus–Naur form]::

<valid dataset name> ::= <set name> "_" <observable name>

<experiment> ::= "ATLAS" | "BCDMS" | "CDF" | "CHORUS" | "CMS" | "D0" | "DYE605" | "DYE866"
<experiment> ::= "ATLAS" | "BCDMS" | "CDF" | "CHORUS" | "CMS" | "D0" | "DYE605" | "DYE866"
| "DYE906" | "EMC" | "H1" | "HERA" | "LHCB" | "NMC" | "NNPDF" | "NUTEV" | "SLAC"
| "ZEUS"

<process> ::= "1JET" | "2JET" | "CC" | "DY" | "INTEG" | "NC" | "PH" | "POS" | "SINGLETOP"
<process> ::= "1JET" | "2JET" | "CC" | "DY" | "INTEG" | "NC" | "PH" | "POS" | "SHP" | "SINGLETOP"
| "TTBAR" | "WCHARM" | "WJ" | "WPWM" | "Z0" | "Z0J"

<energy> ::= <integer> <unit> | <integer> "P" <integer> <unit> | "NOTFIXED"
Expand Down Expand Up @@ -91,6 +91,7 @@ Processes
- `NC`: DIS neutral-current
- `POS`: auxiliary dataset for positivity constraints; only valid for
`NNPDF` experiment
- `SHP`: single hadron production
- `TTBAR`: top–anti-top production
- `WM`: production of a single negatively-charged lepton (charged current
off-shell Drell–Yan)
Expand Down
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
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)
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
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
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}
Loading

0 comments on commit 8b588b8

Please sign in to comment.