Skip to content

Commit

Permalink
init renaming of DY star datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed May 15, 2024
1 parent d1f827b commit 533afec
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 185 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
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
def read_data(fname):
df = pd.read_csv(fname, delimiter=",", skiprows=10)
df["M2"] = MW**2
df["sqrts"] = ECM
return df


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

# Write kin file
Expand All @@ -33,7 +29,7 @@ def write_data(df):
kin.append(kin_value)
kinematics_yaml = {"bins": kin}

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

# Write unc file
Expand All @@ -44,17 +40,28 @@ def write_data(df):
error.append(e)

error_definition = {
"stat": {"description": "statistical uncertainty", "treatment": "ADD", "type": "UNCORR"},
"sys": {"description": "systematic uncertainty", "treatment": "ADD", "type": "UNCORR"},
"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:
with open(f"uncertainties_{boson}.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)
# 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,90 @@
# 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"
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
operation: "null"

- 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"
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
operation: "null"
54 changes: 0 additions & 54 deletions nnpdf_data/nnpdf_data/new_commondata/STAR_WM_510GEV/metadata.yaml

This file was deleted.

60 changes: 0 additions & 60 deletions nnpdf_data/nnpdf_data/new_commondata/STAR_WP_510GEV/filter.py

This file was deleted.

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

This file was deleted.

0 comments on commit 533afec

Please sign in to comment.