Skip to content

Commit

Permalink
Fix back scale variations for pineappl convolve CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Dec 2, 2024
1 parent dddf825 commit ecb8ef5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pineappl_cli/src/convolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ pub struct Opts {
value_parser = helpers::parse_order
)]
orders: Vec<(u8, u8)>,
/// 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 variation of the fragmentation scale.
#[arg(default_value = "1.0", long, num_args = 1)]
xia: f64,
/// Set the number of fractional digits shown for absolute numbers.
#[arg(default_value_t = 7, long, value_name = "ABS")]
digits_abs: usize,
Expand All @@ -52,13 +61,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, self.xia)],
if self.integrated {
ConvoluteMode::Integrated
} else {
Expand Down
32 changes: 32 additions & 0 deletions pineappl_cli/tests/convolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Options:
-b, --bins <BINS> Selects a subset of bins
-i, --integrated Show integrated numbers (without bin widths) instead of differential ones
-o, --orders <ORDERS> Select orders manually
--xir <XIR> Set the variation of the renormalization scale [default: 1.0]
--xif <XIF> Set the variation of the factorization scale [default: 1.0]
--xia <XIA> Set the variation of the fragmentation scale [default: 1.0]
--digits-abs <ABS> Set the number of fractional digits shown for absolute numbers [default: 7]
--digits-rel <REL> Set the number of fractional digits shown for relative numbers [default: 2]
-h, --help Print help
Expand Down Expand Up @@ -170,6 +173,19 @@ const WRONG_ORDERS_STR: &str = "error: invalid value 'a2a2as2' for '--orders <OR
For more information, try '--help'.
";

const XIR_XIF_STR: &str = "b etal dsig/detal
[] [pb]
-+----+----+-----------
0 2 2.25 7.6241231e2
1 2.25 2.5 6.9755130e2
2 2.5 2.75 6.0636076e2
3 2.75 3 4.9019741e2
4 3 3.25 3.6518490e2
5 3.25 3.5 2.4783934e2
6 3.5 4 1.1656958e2
7 4 4.5 2.7565811e1
";

#[test]
fn help() {
Command::cargo_bin("pineappl")
Expand Down Expand Up @@ -377,3 +393,19 @@ fn wrong_orders() {
.failure()
.stderr(WRONG_ORDERS_STR);
}

#[test]
fn xir_xif() {
Command::cargo_bin("pineappl")
.unwrap()
.args([
"convolve",
"--xir=2.34",
"--xif=1.79",
"../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
"NNPDF31_nlo_as_0118_luxqed",
])
.assert()
.success()
.stdout(XIR_XIF_STR);
}

0 comments on commit ecb8ef5

Please sign in to comment.