Skip to content

Commit

Permalink
add --min_as option to convolute
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlehoff committed May 8, 2024
1 parent 742288b commit c7540de
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pineko/cli/convolute.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@click.argument("max_al", type=int)
@click.option("--xir", default=1.0, help="renormalization scale variation")
@click.option("--xif", default=1.0, help="factorization scale variation")
@click.option("--min_as", type=int, help="Minimum exponent of as")
@click.option(
"--pdf", default=None, help="if given, print comparison table", show_default=True
)
Expand All @@ -26,14 +27,18 @@
help="the flavor assumptions to be used",
show_default=True,
)
def subcommand(grid_path, op_path, fktable, max_as, max_al, xir, xif, pdf, assumptions):
def subcommand(
grid_path, op_path, fktable, max_as, max_al, xir, xif, pdf, assumptions, min_as
):
"""Convolute PineAPPL grid and EKO into an FK table.
GRID_PATH and OP_PATH are the path to the respective elements to convolute, and
FKTABLE is the path where to dump the output.
MAX_AS and MAX_AL are used to specify the order in QCD and QED
couplings (i.e. the maximum power allowed for each correction).
couplings (i.e. the maximum power allowed for each correction)
e.g., max_as = 1, max_al = 0 would select LO QCD only
max_as = 3 instead would select LO, NLO, NNLO QCD
XIR and XIF represent the renormalization and factorization scale in the grid respectively.
Expand All @@ -49,6 +54,7 @@ def subcommand(grid_path, op_path, fktable, max_as, max_al, xir, xif, pdf, assum
f"+ {op_path}\n",
f"= {fktable}\n",
f"with max_as={max_as}, max_al={max_al}, xir={xir}, xif={xif}",
f"min_as: {min_as}" if min_as is not None else "",
)
_grid, _fk, comp = evolve.evolve_grid(
grid,
Expand All @@ -60,6 +66,7 @@ def subcommand(grid_path, op_path, fktable, max_as, max_al, xir, xif, pdf, assum
xif,
assumptions=assumptions,
comparison_pdf=pdf,
min_as=min_as,
)
if comp:
print(comp.to_string())
11 changes: 11 additions & 0 deletions src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def evolve_grid(
assumptions="Nf6Ind",
comparison_pdf=None,
meta_data=None,
min_as=None,
):
"""Convolute grid with EKO from file paths.
Expand All @@ -215,8 +216,18 @@ def evolve_grid(
if given, a comparison table (with / without evolution) will be printed
meta_data : None or dict
if given, additional meta data written to the FK table
min_as: None or int
minimum power of strong coupling
"""
order_mask = pineappl.grid.Order.create_mask(grid.orders(), max_as, max_al, True)
if min_as is not None and min_as > 1:
# If using min_as, we want to ignore only orders below that (e.g., if min_as=2
# and max_as=3, we want NNLO and NLO)
ignore_orders = pineappl.grid.Order.create_mask(
grid.orders(), min_as - 1, max_al, True
)
order_mask ^= ignore_orders

evol_info = grid.evolve_info(order_mask)
x_grid = evol_info.x1
mur2_grid = evol_info.ren1
Expand Down

0 comments on commit c7540de

Please sign in to comment.