From 39446628c769f28fe72398620167593d39238d21 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Tue, 5 Nov 2024 16:30:18 +0100 Subject: [PATCH] Allow varying the scales in `convolve` --- CHANGELOG.md | 3 +++ pineappl_cli/src/convolve.rs | 10 ++++++++-- pineappl_cli/tests/convolve.rs | 31 +++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8366423..e8f23492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - added new method `Grid::delete_orders` and the corresponding switch `--delete-orders` in the subcommand `write` of the CLI +- added the switches `--xir` and `--xif`, which allow varying the + renormalization and factorization scales with a custom factor in the + subcommand `convolve`. ### Changed diff --git a/pineappl_cli/src/convolve.rs b/pineappl_cli/src/convolve.rs index 5377abc5..b7a9d76a 100644 --- a/pineappl_cli/src/convolve.rs +++ b/pineappl_cli/src/convolve.rs @@ -38,6 +38,12 @@ pub struct Opts { value_parser = helpers::parse_order )] orders: Vec<(u32, u32)>, + /// Set the variation of the renormalization scale. + #[arg(default_value = "1.0", long, num_args = 1)] + xir: f64, + /// Set the variation of the factorization scale. + #[arg(default_value = "1.0", long, num_args = 1)] + xif: f64, /// Set the number of fractional digits shown for absolute numbers. #[arg(default_value_t = 7, long, value_name = "ABS")] digits_abs: usize, @@ -52,13 +58,13 @@ impl Subcommand for Opts { let mut conv_funs_0 = helpers::create_conv_funs(&self.conv_funs[0])?; let bins: Vec<_> = self.bins.iter().cloned().flatten().collect(); - let results = helpers::convolve( + let results = helpers::convolve_scales( &grid, &mut conv_funs_0, &self.orders, &bins, &[], - 1, + &[(self.xir, self.xif)], if self.integrated { ConvoluteMode::Integrated } else { diff --git a/pineappl_cli/tests/convolve.rs b/pineappl_cli/tests/convolve.rs index dbf0d107..8ea0e8b4 100644 --- a/pineappl_cli/tests/convolve.rs +++ b/pineappl_cli/tests/convolve.rs @@ -13,6 +13,8 @@ Options: -b, --bins Selects a subset of bins -i, --integrated Show integrated numbers (without bin widths) instead of differential ones -o, --orders Select orders manually + --xir Set the variation of the renormalization scale [default: 1.0] + --xif Set the variation of the factorization scale [default: 1.0] --digits-abs Set the number of fractional digits shown for absolute numbers [default: 7] --digits-rel Set the number of fractional digits shown for relative numbers [default: 2] -h, --help Print help @@ -171,6 +173,19 @@ const WRONG_ORDERS_STR: &str = "error: invalid value 'a2a2as2' for '--orders