Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

from validphys.paramfits.config import ParamfitsConfig

from validphys.theorycovariance.theorycovarianceutils import process_lookup
from validphys.plotoptions import get_info

import validphys.scalevariations
Expand Down Expand Up @@ -763,9 +762,13 @@ def produce_matched_datasets_from_dataspecs(self, dataspecs):

with self.set_context(ns=self._curr_ns.new_child(spec)):
_, data_input = self.parse_from_(None, "data_input", write=False)
names = {
(process_lookup(dsin.name), dsin.name): dsin for dsin in data_input
}

names = {}
for dsin in data_input:
cd = self.produce_commondata(dataset_input=dsin)
proc = get_info(cd).nnpdf31_process
ds = dsin.name
names[(proc, ds)] = dsin

all_names.append(names)
used_set = set.intersection(*(set(d) for d in all_names))
Expand Down
74 changes: 8 additions & 66 deletions validphys2/src/validphys/theorycovariance/theorycovarianceutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import logging

from reportengine.checks import make_argcheck, check
from validphys.loader import Loader
from validphys.plotoptions import get_info

log = logging.getLogger(__name__)


Expand Down Expand Up @@ -90,72 +93,11 @@ def check_fit_dataset_order_matches_grouped(
"errors when running fits with theory covmat. Datasets should "
f"be ordered by {processed_metadata_group} in the runcard."
)

def process_lookup(name):
"""Produces a dictionary with keys corresponding to dataset names
and values corresponding to process types. Process types are
regrouped into the five categories 'Drell-Yan', 'Top', Jets',
'DIS NC' and 'DIS CC'.


The implementation relies on hardcoding the process type for
each dataset internally. If a dataset is not registered,
'UNKNOWN' is returned.
def process_lookup(name):
"""

process_dictionary = { "ATLASZPT8TEVMDIST": "DY",
"ATLASZPT8TEVYDIST": "DY",
"CMSZDIFF12": "DY",
"ATLAS1JET11": "JETS",
"CMSJETS11": "JETS",
"CDFR2KT": "JETS",
"CMSTOPDIFF8TEVTTRAPNORM": "TOP",
"ATLASTOPDIFF8TEVTRAPNORM": "TOP",
"ATLASTTBARTOT": "TOP",
"CMSTTBARTOT": "TOP",
"DYE605": "DY",
"DYE886P": "DY",
"DYE886R": "DY",
"ATLASWZRAP36PB": "DY",
"ATLASZHIGHMASS49FB": "DY",
"ATLASLOMASSDY11EXT": "DY",
"ATLASWZRAP11": "DY",
"CMSWEASY840PB": "DY",
"CMSWMASY47FB": "DY",
"CMSDY2D11": "DY",
"CMSWMU8TEV": "DY",
"CMSWCHARMRAT": "DY",
"LHCBZ940PB": "DY",
"LHCBZEE2FB": "DY",
"LHCBWZMU7TEV": "DY",
"LHCBWZMU8TEV": "DY",
"D0WEASY": "DY",
"D0WMASY": "DY",
"D0ZRAP": "DY",
"CDFZRAP": "DY",
"H1HERAF2B": "DIS NC",
"HERACOMBCCEM": "DIS CC",
"HERACOMBCCEP": "DIS CC",
"HERACOMBNCEM": "DIS NC",
"HERACOMBNCEP460": "DIS NC",
"HERACOMBNCEP575": "DIS NC",
"HERACOMBNCEP820": "DIS NC",
"HERACOMBNCEP920": "DIS NC",
"HERAF2CHARM": "DIS NC",
"ZEUSHERAF2B": "DIS NC",
"NMCPD": "DIS NC",
"NMC": "DIS NC",
"SLACP": "DIS NC",
"SLACD": "DIS NC",
"BCDMSP": "DIS NC",
"BCDMSD": "DIS NC",
"CHORUSNU": "DIS CC",
"CHORUSNB": "DIS CC",
"NTVNUDMN": "DIS CC",
"NTVNBDMN": "DIS CC" }

proc = process_dictionary.get(name)
if not proc:
log.warn(f'Unknown process type for dataset {name}')
return 'UNKNOWN'
Returns the `nnpdf31_process` of the corresponding dataset.
"""
cd = Loader().check_commondata(setname=name)
proc = get_info(cd).nnpdf31_process
return proc