Skip to content

Commit ecb8ef5

Browse files
Fix back scale variations for pineappl convolve CLI
1 parent dddf825 commit ecb8ef5

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

pineappl_cli/src/convolve.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ pub struct Opts {
3838
value_parser = helpers::parse_order
3939
)]
4040
orders: Vec<(u8, u8)>,
41+
/// Set the variation of the renormalization scale.
42+
#[arg(default_value = "1.0", long, num_args = 1)]
43+
xir: f64,
44+
/// Set the variation of the factorization scale.
45+
#[arg(default_value = "1.0", long, num_args = 1)]
46+
xif: f64,
47+
/// Set the variation of the fragmentation scale.
48+
#[arg(default_value = "1.0", long, num_args = 1)]
49+
xia: f64,
4150
/// Set the number of fractional digits shown for absolute numbers.
4251
#[arg(default_value_t = 7, long, value_name = "ABS")]
4352
digits_abs: usize,
@@ -52,13 +61,13 @@ impl Subcommand for Opts {
5261
let mut conv_funs_0 = helpers::create_conv_funs(&self.conv_funs[0])?;
5362
let bins: Vec<_> = self.bins.iter().cloned().flatten().collect();
5463

55-
let results = helpers::convolve(
64+
let results = helpers::convolve_scales(
5665
&grid,
5766
&mut conv_funs_0,
5867
&self.orders,
5968
&bins,
6069
&[],
61-
1,
70+
&[(self.xir, self.xif, self.xia)],
6271
if self.integrated {
6372
ConvoluteMode::Integrated
6473
} else {

pineappl_cli/tests/convolve.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Options:
1515
-b, --bins <BINS> Selects a subset of bins
1616
-i, --integrated Show integrated numbers (without bin widths) instead of differential ones
1717
-o, --orders <ORDERS> Select orders manually
18+
--xir <XIR> Set the variation of the renormalization scale [default: 1.0]
19+
--xif <XIF> Set the variation of the factorization scale [default: 1.0]
20+
--xia <XIA> Set the variation of the fragmentation scale [default: 1.0]
1821
--digits-abs <ABS> Set the number of fractional digits shown for absolute numbers [default: 7]
1922
--digits-rel <REL> Set the number of fractional digits shown for relative numbers [default: 2]
2023
-h, --help Print help
@@ -170,6 +173,19 @@ const WRONG_ORDERS_STR: &str = "error: invalid value 'a2a2as2' for '--orders <OR
170173
For more information, try '--help'.
171174
";
172175

176+
const XIR_XIF_STR: &str = "b etal dsig/detal
177+
[] [pb]
178+
-+----+----+-----------
179+
0 2 2.25 7.6241231e2
180+
1 2.25 2.5 6.9755130e2
181+
2 2.5 2.75 6.0636076e2
182+
3 2.75 3 4.9019741e2
183+
4 3 3.25 3.6518490e2
184+
5 3.25 3.5 2.4783934e2
185+
6 3.5 4 1.1656958e2
186+
7 4 4.5 2.7565811e1
187+
";
188+
173189
#[test]
174190
fn help() {
175191
Command::cargo_bin("pineappl")
@@ -377,3 +393,19 @@ fn wrong_orders() {
377393
.failure()
378394
.stderr(WRONG_ORDERS_STR);
379395
}
396+
397+
#[test]
398+
fn xir_xif() {
399+
Command::cargo_bin("pineappl")
400+
.unwrap()
401+
.args([
402+
"convolve",
403+
"--xir=2.34",
404+
"--xif=1.79",
405+
"../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
406+
"NNPDF31_nlo_as_0118_luxqed",
407+
])
408+
.assert()
409+
.success()
410+
.stdout(XIR_XIF_STR);
411+
}

0 commit comments

Comments
 (0)