-
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 #2079 from NNPDF/DY_polarized_data
Polarized STAR and PHENIX A_L W
- Loading branch information
Showing
14 changed files
with
197 additions
and
228 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
85 changes: 85 additions & 0 deletions
85
nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/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,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") |
File renamed without changes.
File renamed without changes.
92 changes: 92 additions & 0 deletions
92
nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/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,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" |
File renamed without changes.
File renamed without changes.
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
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
60 changes: 0 additions & 60 deletions
60
nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/filter.py
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/metadata.yaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.