pinefarm.external.nnlojet package

NNLOJET interface.

Submodules

pinefarm.external.nnlojet.nnpdf_interface module

Read up all important information form an NNPDF dataset.

The selector generation is very flaky and is (mostly) up to the user for now.

Some examples:

```yaml
  • histogram with selectors

histograms:

name: test observable: ptz bins: [10, 20, 40] extra_selectors:

  • “reject abs_ylp min = 1.37 max = 1.52”

  • “reject abs_ylm min = 1.37 max = 1.52”

```

pinefarm.external.nnlojet.nnpdf_interface.generate_pinecard_from_nnpdf(nnpdf_dataset, scale='etz', output_path='.', observables=None)[source]

Generate a NNLOJET pinecard from an NNPDF dataset.

Takes as input an NNPDF dataset, which will be loaded with the nnpdf_data package.

If a list of observables is provided, only those in the list will be loaded from the dataframe.

pinefarm.external.nnlojet.nnpdf_interface.select_selectors(experiment, process)[source]

A selection of default selectors to be selected depending on the selected experiment.

The experiment defines the cuts to be applied to each variable. The process defines the name of the variables in NNLOJET

pinefarm.external.nnlojet.runcardgen module

Autogeneration of NNLOJET runcards.

Module for the autogeneration of NNLOJET runcards using as input yaml files containing the NNPDF dataset information.

class pinefarm.external.nnlojet.runcardgen.Histogram(name: str, observable: str, bins: list, extra_selectors: dict | None = None, pineappl: bool = True, fac: int | None = None, compositions: list[dict] = <factory>)[source]

Bases: object

Holds histogram information.

bins: list
compositions: list[dict]
extra_selectors: dict = None
fac: int = None
histogram_selectors_to_str(base_indentation='  ')[source]

Make the histogram selectors into a single string.

name: str
observable: str
pineappl: bool = True
to_str()[source]

Turn the histogram into a NNLOJET-compatible string.

class pinefarm.external.nnlojet.runcardgen.Selector(observable: str, min: float | None = None, max: float | None = None)[source]

Bases: object

Holds selector information.

max: float = None
min: float = None
observable: str
to_str()[source]
class pinefarm.external.nnlojet.runcardgen.YamlLOJET(runname: str, process: dict, channels: dict, scales: dict = <factory>, parameters: dict = <factory>, selectors: list | None = None, histograms: list | None = None, multi_channel: int = 3, techcut: float = 1e-07, pdf: str = 'NNPDF40_nnlo_as_01180', manual: bool = False)[source]

Bases: object

Definition of the yaml runcard for sending NNLOJET jobs.

active_channels(active_channels=None)[source]

Digest active channels.

Loop over all channels in the yamlcard and check whether it correspond to one of the channels in the list active_channels e.g., if active_channels = [RR, RV], all RRa_n, RRb_n, and RV_n will be accepted If active_channels is None, return the whole thing for [LO, R, V, RR, RV, VV]

Returns a dict {channel_name: list_of_channels}

property channel_names_list

List of channels.

channels: dict
get_channel_list(channel)[source]

Generate list of channels.

histogram_definitions()[source]

Return a string with the definition of all the histograms.

In general the histogram is defined in the yaml file as a dict with:
  • name observable bins extra_selectors: dict

histograms: list = None
manual: bool = False
multi_channel: int = 3
parameters: dict
pdf: str = 'NNPDF40_nnlo_as_01180'
process: dict
property process_name

Get process name.

runname: str
scales: dict
selector_definitions()[source]

Get definition of selectors.

selectors: list = None
techcut: float = 1e-07
pinefarm.external.nnlojet.runcardgen.generate_combine_ini(metadata, channels, output=PosixPath('.'))[source]

Generate a NNLOJET combine config file.

pinefarm.external.nnlojet.runcardgen.generate_runcard(metadata: YamlLOJET, channel: str, runcard_name: str = 'runcard', is_warmup: bool = False, events: int = 10000, iterations: int = 1, output=PosixPath('.'), runcard_path=None)[source]

Generate a NNLOJET runcard given the metadata of the run in the folder defined by che channel name.

The output path of the runcard will be ./channel/runcard_name_{warmup/production}.run.

pinefarm.external.nnlojet.runcardgen.parse_input_yaml(yaml_path)[source]

Parse the yaml runcard into a YamlLOJET object.

pinefarm.external.nnlojet.runcardgen.region_str_generator(channel_name)[source]

Given the name of the channel, set up the region.

pinefarm.external.nnlojet.runner module

Provides a runner for NNLOJET.

class pinefarm.external.nnlojet.runner.NNLOJET(pinecard, theorycard, *args, **kwargs)[source]

Bases: External

Interface provider for NNLOJET.

collect_versions() dict[source]

NNLOJET version.

generate_pineappl()[source]

Not implemented.

preparation()[source]

Run the preparation step for NNLOJET.

results()[source]

Not implemented.

run()[source]

Run the corresponding NNLOJET runcard.