diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/data.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/data_wm.yaml similarity index 100% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/data.yaml rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/data_wm.yaml diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/data.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/data_wp.yaml similarity index 100% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/data.yaml rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/data_wp.yaml diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/filter.py b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/filter.py new file mode 100644 index 0000000000..3e73c56d19 --- /dev/null +++ b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/filter.py @@ -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") diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/kinematics.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/kinematics_wm.yaml similarity index 100% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/kinematics.yaml rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/kinematics_wm.yaml diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/kinematics.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/kinematics_wp.yaml similarity index 100% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/kinematics.yaml rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/kinematics_wp.yaml diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/metadata.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/metadata.yaml new file mode 100644 index 0000000000..8f37e84988 --- /dev/null +++ b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/metadata.yaml @@ -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" \ No newline at end of file diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/rawdata/Figure5,A_LforW^+rightarrowe^+,combineddatasamples.csv b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/rawdata/Figure5,A_LforW^+rightarrowe^+,combineddatasamples.csv similarity index 100% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/rawdata/Figure5,A_LforW^+rightarrowe^+,combineddatasamples.csv rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/rawdata/Figure5,A_LforW^+rightarrowe^+,combineddatasamples.csv diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/rawdata/Figure5,A_LforW^-rightarrowe^-,combineddatasamples.csv b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/rawdata/Figure5,A_LforW^-rightarrowe^-,combineddatasamples.csv similarity index 100% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/rawdata/Figure5,A_LforW^-rightarrowe^-,combineddatasamples.csv rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/rawdata/Figure5,A_LforW^-rightarrowe^-,combineddatasamples.csv diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/uncertainties.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/uncertainties_wm.yaml similarity index 61% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/uncertainties.yaml rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/uncertainties_wm.yaml index f46e9f5933..9361ba7be4 100644 --- a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/uncertainties.yaml +++ b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/uncertainties_wm.yaml @@ -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 diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/uncertainties.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/uncertainties_wp.yaml similarity index 61% rename from nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/uncertainties.yaml rename to nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/uncertainties_wp.yaml index f6ac0e8f8c..b0904888ff 100644 --- a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/uncertainties.yaml +++ b/nnpdf_data/nnpdf_data/new_commondata/STAR_WMWP_510GEV/uncertainties_wp.yaml @@ -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 diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/filter.py b/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/filter.py deleted file mode 100644 index 55841646fc..0000000000 --- a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/filter.py +++ /dev/null @@ -1,60 +0,0 @@ -import glob - -import pandas as pd -import yaml - -ECM = 510 -MW = 80.398 - - -def read_data(fnames): - df = pd.DataFrame() - for fname in fnames: - df = pd.read_csv(fname, delimiter=",", skiprows=10) - df["M2"] = MW**2 - df["sqrts"] = ECM - return df - - -def write_data(df): - data_central = df["$A_L$"].tolist() - data_central_yaml = {"data_central": data_central} - with open("data.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("kinematics.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 +"])} - error.append(e) - - error_definition = { - "stat": {"description": "statistical uncertainty", "treatment": "ADD", "type": "UNCORR"}, - "sys": {"description": "systematic uncertainty", "treatment": "ADD", "type": "UNCORR"}, - } - - uncertainties_yaml = {"definitions": error_definition, "bins": error} - - with open("uncertainties.yaml", "w", encoding="utf-8") as file: - yaml.dump(uncertainties_yaml, file, sort_keys=False) - - -if __name__ == "__main__": - fnames = glob.glob("rawdata/*.csv") - df = read_data(fnames) - write_data(df) diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/metadata.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/metadata.yaml deleted file mode 100644 index eec81d1380..0000000000 --- a/nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/metadata.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Generalia -setname: "STAR_WM_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: "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" - 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.yaml - - data_central: data.yaml - data_uncertainties: - - uncertainties.yaml - - theory: - FK_tables: - - - STAR_WM_510GEV_AL - operation: "null" diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/filter.py b/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/filter.py deleted file mode 100644 index 55841646fc..0000000000 --- a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/filter.py +++ /dev/null @@ -1,60 +0,0 @@ -import glob - -import pandas as pd -import yaml - -ECM = 510 -MW = 80.398 - - -def read_data(fnames): - df = pd.DataFrame() - for fname in fnames: - df = pd.read_csv(fname, delimiter=",", skiprows=10) - df["M2"] = MW**2 - df["sqrts"] = ECM - return df - - -def write_data(df): - data_central = df["$A_L$"].tolist() - data_central_yaml = {"data_central": data_central} - with open("data.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("kinematics.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 +"])} - error.append(e) - - error_definition = { - "stat": {"description": "statistical uncertainty", "treatment": "ADD", "type": "UNCORR"}, - "sys": {"description": "systematic uncertainty", "treatment": "ADD", "type": "UNCORR"}, - } - - uncertainties_yaml = {"definitions": error_definition, "bins": error} - - with open("uncertainties.yaml", "w", encoding="utf-8") as file: - yaml.dump(uncertainties_yaml, file, sort_keys=False) - - -if __name__ == "__main__": - fnames = glob.glob("rawdata/*.csv") - df = read_data(fnames) - write_data(df) diff --git a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/metadata.yaml b/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/metadata.yaml deleted file mode 100644 index 67fb18f0f3..0000000000 --- a/nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/metadata.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Generalia -setname: "STAR_WP_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: "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" - 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.yaml - - data_central: data.yaml - data_uncertainties: - - uncertainties.yaml - - theory: - FK_tables: - - - STAR_WP_510GEV_AL - operation: "null"