diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b94887f..e910c2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: - id: pydocstyle files: ^src/ additional_dependencies: - - toml + - tomli - repo: https://github.com/pre-commit/pre-commit rev: v4.3.0 hooks: diff --git a/extras/theories/theory_nnlo.yaml b/extras/theories/theory_nnlo.yaml index 0ef0f0a..8c3dc2a 100644 --- a/extras/theories/theory_nnlo.yaml +++ b/extras/theories/theory_nnlo.yaml @@ -1,44 +1,44 @@ ID: NNLO Comments: Example of NNLO theory -CKM: 0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152 +CKM: 0.97367 0.22431 3.82e-3 0.221 0.975 41.1e-3 8.6e-3 41.5e-3 1.010 DAMP: 0 EScaleVar: 1 FNS: FONLL-C -GF: 1.1663787e-05 +GF: 1.1663788e-5 HQ: POLE IC: 1 IB: 0 MP: 0.938 -MW: 80.398 -MZ: 91.1876 +MZ: 91.1880 +MW: 80.3692 MaxNfAs: 5 MaxNfPdf: 5 -ModEv: TRN +ModEv: EXA +IterEv: 60 ModSV: expanded NfFF: 4 PTO: 2 Q0: 1.65 QED: 0 -Qedref: 1.777 -Qmb: 4.92 -Qmc: 1.51 -Qmt: 172.5 -Qref: 91.2 -SIN2TW: 0.23126 +Qedref: 91.1880 +Qref: 91.1880 +alphas: 0.118 +alphaqed: 0.0075700 +SIN2TW: 0.22348 SxOrd: LL SxRes: 0 TMC: 1 XIF: 1.0 XIR: 1.0 -alphaqed: 0.007496252 -alphas: 0.118 global_nx: 0 -kbThr: 1.0 +mc: 1.502 +Qmc: 1.502 kcThr: 1.0 -ktThr: 1.0 -mb: 4.92 -mc: 1.51 +mb: 4.936 +Qmb: 4.936 +kbThr: 1.0 mt: 172.5 +Qmt: 172.5 nfref: null nf0: null fact_to_ren_scale_ratio: 1.0 diff --git a/src/pinefarm/cli/autogen.py b/src/pinefarm/cli/autogen.py index cd92f77..7fe754c 100644 --- a/src/pinefarm/cli/autogen.py +++ b/src/pinefarm/cli/autogen.py @@ -31,10 +31,12 @@ def runcards(dataset, target, select_obs=None, name=None): output = configs.configs["paths"]["runcards"] / f"{target}_{name}" - if target == "NNLOJET": + if target.upper() == "NNLOJET": output_runcards = generate_pinecard_from_nnpdf( dataset, output_path=output, observables=select_obs ) + else: + raise ValueError(f"Target {target} not recognized") rich.print("Pinecards written to: ") rich.print(" " + "\n".join(str(i) for i in output_runcards)) diff --git a/src/pinefarm/external/__init__.py b/src/pinefarm/external/__init__.py index 3423915..5d3d9de 100644 --- a/src/pinefarm/external/__init__.py +++ b/src/pinefarm/external/__init__.py @@ -27,7 +27,7 @@ def decide_external_tool(dsname: str): """ # The decisions are usually based on the existence of a `.yaml` file with a specific name # or a prefix in the pinecard - if dsname.startswith("NNLOJET"): + if dsname.upper().startswith("NNLOJET"): from .nnlojet import NNLOJET return NNLOJET, "blue" diff --git a/src/pinefarm/external/nnlojet/runcardgen.py b/src/pinefarm/external/nnlojet/runcardgen.py index 1ecc2fc..452d3eb 100755 --- a/src/pinefarm/external/nnlojet/runcardgen.py +++ b/src/pinefarm/external/nnlojet/runcardgen.py @@ -225,11 +225,12 @@ def _fill_process(process): """Fill process options.""" process_name = process["proc"] sqrts = process["sqrts"] + jet = process.get("jet", "none[0]") # Can be None """Fill process block given the metadata for the process""" return f""" PROCESS {process_name} collider = pp sqrts = {sqrts} - jet = none[0] + jet = {jet} decay_type = 1 END_PROCESS """ @@ -239,6 +240,7 @@ def _fill_run(runname, pdf, mode_line, techcut=1e-7, multi_channel=3): """Fil run options.""" if multi_channel == 0: multi_channel = ".false." + # Note, scale coefficients need to be set to true to fill the grid return f""" RUN {runname.upper()} PDF = {pdf}[0] diff --git a/src/pinefarm/external/nnlojet/runner.py b/src/pinefarm/external/nnlojet/runner.py index 2bb089a..7f7105a 100644 --- a/src/pinefarm/external/nnlojet/runner.py +++ b/src/pinefarm/external/nnlojet/runner.py @@ -24,6 +24,11 @@ def __init__(self, pinecard, theorycard, *args, **kwargs): # Save the yaml dictionary from the NNLOJET pinecard self._yaml_dict = safe_load(yaml_card.open("r")) + @staticmethod + def install(): + """NNLOJET should be installed manually.""" + pass + def preparation(self): """Run the preparation step for NNLOJET.""" # Update the yaml card according to the theory