Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Reimplement ATLAS_Z0_7TEV_46FB_CC #2204

Closed
wants to merge 6 commits into from

Conversation

ecole41
Copy link
Collaborator

@ecole41 ecole41 commented Nov 9, 2024

Added function to filter_utils.py to produce data.yaml.

Issues

There are three tables used in producing the central values, each of these data uses different sig.fig, also the legacy data has a higher sig.fig to the current HEP data available.
I am not sure what the procedure is in this case.

Compatibility Checks:

Covariance Matrices:

from validphys.api import API
import numpy as np
import os

def check_theory_exists(theory_id):
    theory_path = f"/Users/ellacole/miniconda3/envs/nnpdf_dev/share/NNPDF/theories/theory_{theory_id}"
    return os.path.exists(theory_path)

theory_id = 708 


if check_theory_exists(theory_id):
    inp1 = {"dataset_input": {"dataset": "ATLASZRAP11CC"}, "theoryid": theory_id, "use_cuts": "internal"}
    inp2 = {"dataset_input": {"dataset": "ATLASZRAP11CC", "variant": "legacy"}, "theoryid": theory_id, "use_cuts": "internal"}
    covmat1 = API.covmat_from_systematics(**inp1)
    covmat2 = API.covmat_from_systematics(**inp2)
    
    result = np.isclose(covmat1, covmat2)
    print(result)
else:
    print(f"Theory {theory_id} not found. ")
    
 [Out]:
[[ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
...
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]
 [ True  True  True  True  True  True  True  True  True  True  True  True
   True  True  True  True  True  True  True  True  True  True  True  True]]
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?d230cec4-3639-4cac-b0de-d4e2740e1964) or open in a [text editor](command:workbench.action.openLargeOutput?d230cec4-3639-4cac-b0de-d4e2740e1964). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

t0 Matrix:

from validphys.api import API
import numpy as np
 
inp1 = {"dataset_input": {"dataset": "ATLASZRAP11CC"}, "theoryid": 40_000_000, "use_cuts": "internal", "t0pdfset": "NNPDF40_nnlo_as_01180", "use_t0": True}
inp2 = {"dataset_input": {"dataset": "ATLASZRAP11CC", "variant": "legacy"}, "theoryid": 40_000_000, "use_cuts": "internal", "t0pdfset": "NNPDF40_nnlo_as_01180", "use_t0": True}
 
covmat1 = API.covmat_from_systematics(**inp1)
covmat2 = API.covmat_from_systematics(**inp2)
 
t0_covmat1 = API.t0_covmat_from_systematics(**inp1)
t0_covmat2 = API.t0_covmat_from_systematics(**inp2)
 
result = np.all(np.isclose(covmat1, covmat2))
result_2 = np.all(np.isclose(t0_covmat1, t0_covmat2))

print('covmat', result)
print('t0_covmat', result_2)

[Out]:covmat True
t0_covmat True

@@ -19,7 +19,7 @@ implemented_observables:
label: ATLAS $Z$ 7 TeV 2011 Central selection
units: ''
process_type: EWK_RAP
tables: []
tables: [11-13]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be [11, 12, 13]. Then you can use it to loop over in eg filter_utils/get_data_values instead of having to write three times

with open(...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, tables should be a Python list specifying the table ID. This will be crucial when we want to remove the rawdata from the remote repository (cc #2199).

Comment on lines +12 to +34
def get_data_values():
"""
returns the central data values in the form of a list.
"""

data_central = []

hepdata_table_1 = f"rawdata/HEPData-ins1502620-v1-Table_11.yaml"
hepdata_table_2 = f"rawdata/HEPData-ins1502620-v1-Table_12.yaml"
hepdata_table_3 = f"rawdata/HEPData-ins1502620-v1-Table_13.yaml"

with open(hepdata_table_1, 'r') as file:
input_1 = yaml.safe_load(file)

with open(hepdata_table_2, 'r') as file:
input_2 = yaml.safe_load(file)

with open(hepdata_table_3, 'r') as file:
input_3 = yaml.safe_load(file)

values_1 = input_1['dependent_variables'][0]['values']
values_2 = input_2['dependent_variables'][0]['values']
values_3 = input_3['dependent_variables'][0]['values']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be a good idea to have get_data_values take a tables list that is read from the metadata and passed from filter/filter_ATLAS_Z0_7TEV_46FB_CC_data_kinematics

Comment on lines +45 to +54
def get_kinematics():
"""
returns the kinematics in the form of a list of dictionaries.
"""
kin = []

hepdata_table_1 = f"rawdata/HEPData-ins1502620-v1-Table_11.yaml"
hepdata_table_2 = f"rawdata/HEPData-ins1502620-v1-Table_12.yaml"
hepdata_table_3 = f"rawdata/HEPData-ins1502620-v1-Table_13.yaml"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same idea here, I think that the function could be made simpler by adding a tables to the args

@scarlehoff
Copy link
Member

Same, should this be closed?

@ecole41 ecole41 closed this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants