Skip to content

Commit

Permalink
Merge pull request #2079 from NNPDF/DY_polarized_data
Browse files Browse the repository at this point in the history
Polarized STAR and PHENIX A_L W
  • Loading branch information
Radonirinaunimi committed Jun 27, 2024
2 parents 961eac5 + fdf2abf commit 840927e
Show file tree
Hide file tree
Showing 14 changed files with 197 additions and 228 deletions.
85 changes: 85 additions & 0 deletions nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"""This script provides the common filer to the DY, WP, WM combined STAR 2011-2013 datasets.
NOTE:
* The beam polarization uncertainty are not included in the systematics,
so it is added manually.
* Correlation are provided only for the 20213 data, so are not included.
"""
import pandas as pd
import yaml

ECM = 510
MW = 80.398
POL_UNC = 0.033


def read_data(fname):
df = pd.read_csv(fname, delimiter=",", skiprows=10)
df["M2"] = MW**2
df["sqrts"] = ECM
df["pol"] = abs(POL_UNC * df["$A_L$"])
return df


def write_data(df, boson):
data_central = df["$A_L$"].tolist()
data_central_yaml = {"data_central": data_central}
with open(f"data_{boson}.yaml", "w", encoding="utf-8") as file:
yaml.dump(data_central_yaml, file, sort_keys=False)

# Write kin file
kin = []
for i in range(len(df)):
kin_value = {
"eta": {"min": None, "mid": float(df.loc[i, "$\eta_e$"]), "max": None},
"M2": {"min": None, "mid": float(df.loc[i, "M2"]), "max": None},
"sqrts": {"min": None, "mid": float(df.loc[i, "sqrts"]), "max": None},
}
kin.append(kin_value)
kinematics_yaml = {"bins": kin}

with open(f"kinematics_{boson}.yaml", "w", encoding="utf-8") as file:
yaml.dump(kinematics_yaml, file, sort_keys=False)

# Write unc file
error = []
for i in range(len(df)):
# here uncertainties are symmetric
e = {
"stat": float(df.loc[i, "stat +"]),
"sys": float(df.loc[i, "syst +"]),
"pol": float(df.loc[i, "pol"]),
}
error.append(e)

error_definition = {
"stat": {
"description": "statistical uncertainty",
"treatment": "ADD",
"type": "UNCORR",
},
"sys": {
"description": "systematic uncertainty",
"treatment": "ADD",
"type": "UNCORR",
},
"pol": {
"description": "beam polarization uncertainty",
"treatment": "MULT",
"type": "STARWMWPPOL",
},
}

uncertainties_yaml = {"definitions": error_definition, "bins": error}

with open(f"uncertainties_{boson}.yaml", "w", encoding="utf-8") as file:
yaml.dump(uncertainties_yaml, file, sort_keys=False)


if __name__ == "__main__":
# Wp
df = read_data("rawdata/Figure5,A_LforW^+rightarrowe^+,combineddatasamples.csv")
write_data(df, boson="wp")
# Wm
df = read_data("rawdata/Figure5,A_LforW^-rightarrowe^-,combineddatasamples.csv")
write_data(df, boson="wm")
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Generalia
setname: "STAR_WMWP_510GEV"

version: 1
version_comment: "Initial implementation"

# References
arXiv:
url: "https://arxiv.org/abs/1812.04817"
iNSPIRE:
url: "https://inspirehep.net/literature/1708793"
hepdata:
url: "https://www.hepdata.net/record/ins1708793"

nnpdf_metadata:
nnpdf31_process: "DY CC"
experiment: "STAR"

implemented_observables:
- observable_name: "WM-AL"
observable:
description: Longitudinal single-spin asymmetry $A_L$ for $W^-$ production as a function of the lepton pseudorapidity, $\eta_e$
label: $A_L$
units: ""
process_type: "EWK_RAP_ASY"
ndata: 6
tables: [5]
npoints: [6]

# Plotting information
plotting:
kinematics_override: ewk_rap_sqrt_scale
dataset_label: STAR $W^{-} \rightarrow e^{-}$
y_label: $A_L(\eta_{e})$
plot_x: eta
line_by: []
figure_by: []
kinematic_coverage: [eta, M2, sqrts]

kinematics:
variables:
eta: { description: "Lepton pseudorapidity", label: $\eta$, units: "" }
M2: { description: "W boson Mass", label: "$M^2$", units: "$GeV^2$" }
sqrts: { description: "Center of Mass Energy", label: '$\sqrt{s}$', units: "$GeV$" }
file: kinematics_wm.yaml

data_central: data_wm.yaml
data_uncertainties:
- uncertainties_wm.yaml

theory:
FK_tables:
- - STAR_WMWP_510GEV_WM-AL-POL
- - STAR_WMWP_510GEV_WM-AL-UNPOL
operation: "ratio"

- observable_name: "WP-AL"
observable:
description: Longitudinal single-spin asymmetry $A_L$ for $W^+$ production as a function of the lepton pseudorapidity, $\eta_e$
label: $A_L$
units: ""
process_type: "EWK_RAP_ASY"
ndata: 6
tables: [5]
npoints: [6]

# Plotting information
plotting:
kinematics_override: ewk_rap_sqrt_scale
dataset_label: STAR $W^{+} \rightarrow e^{+}$
y_label: $A_L(\eta_{e})$
plot_x: eta
line_by: []
figure_by: []
kinematic_coverage: [eta, M2, sqrts]

kinematics:
variables:
eta: { description: "Lepton pseudorapidity", label: '$\eta$', units: "" }
M2: { description: "W boson Mass", label: "$M^2$", units: "$GeV^2$" }
sqrts: { description: "Center of Mass Energy", label: '$\sqrt{s}$', units: "$GeV$" }
file: kinematics_wp.yaml

data_central: data_wp.yaml
data_uncertainties:
- uncertainties_wp.yaml

theory:
FK_tables:
- - STAR_WMWP_510GEV_WP-AL-POL
- - STAR_WMWP_510GEV_WP-AL-UNPOL
operation: "ratio"
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,26 @@ definitions:
description: systematic uncertainty
treatment: ADD
type: UNCORR
pol:
description: beam polarization uncertainty
treatment: MULT
type: STARWMWPPOL
bins:
- stat: 0.146
sys: 0.002
pol: 0.007953
- stat: 0.051
sys: 0.004
pol: 0.00858
- stat: 0.056
sys: 0.001
pol: 0.009273000000000002
- stat: 0.056
sys: 0.002
pol: 0.007887
- stat: 0.051
sys: 0.004
pol: 0.012705000000000001
- stat: 0.148
sys: 0.002
pol: 0.006765
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,26 @@ definitions:
description: systematic uncertainty
treatment: ADD
type: UNCORR
pol:
description: beam polarization uncertainty
treatment: MULT
type: STARWMWPPOL
bins:
- stat: 0.145
sys: 0.012
pol: 0.010296000000000001
- stat: 0.03
sys: 0.011
pol: 0.008283
- stat: 0.023
sys: 0.007
pol: 0.010923
- stat: 0.023
sys: 0.005
pol: 0.013596
- stat: 0.029
sys: 0.013
pol: 0.017622000000000002
- stat: 0.14
sys: 0.014
pol: 0.015906
60 changes: 0 additions & 60 deletions nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/filter.py

This file was deleted.

54 changes: 0 additions & 54 deletions nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/metadata.yaml

This file was deleted.

Loading

0 comments on commit 840927e

Please sign in to comment.