Skip to content

Commit f6e24cd

Browse files
Add tests to SIHP for fix_convolution
1 parent 6229c94 commit f6e24cd

1 file changed

Lines changed: 93 additions & 25 deletions

File tree

pineappl_cli/tests/write.rs

Lines changed: 93 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,58 @@ Arguments:
1212
<OUTPUT> Path of the modified PineAPPL file
1313
1414
Options:
15-
--cc <IDX> Charge conjugate the convolution with the specified index
16-
--dedup-channels[=<ULPS>] Deduplicate channels assuming numbers differing by ULPS are the same
17-
--delete-bins <BIN1-BIN2,...> Delete bins with the specified indices
18-
--delete-channels <CH1-CH2,...> Delete channels with the specified indices
19-
--delete-orders <O1-O2,...> Delete orders with the specified indices
20-
--delete-key <KEY> Delete an internal key-value pair
21-
--div-bin-norm-dims <DIM1,...> Divide each bin normalizations by the bin lengths for the given dimensions
22-
--merge-bins <BIN1-BIN2,...> Merge specific bins together
23-
--merge-channel-factors[=<ON>] Merge channel factors into the grid [possible values: true, false]
24-
--mul-bin-norm <NORM> Multiply all bin normalizations with the given factor
25-
--optimize[=<ENABLE>] Optimize internal data structure to minimize memory and disk usage [possible values: true, false]
26-
--optimize-fk-table <OPTIMI> Optimize internal data structure of an FkTable to minimize memory and disk usage [possible values: Nf6Ind, Nf6Sym, Nf5Ind, Nf5Sym, Nf4Ind, Nf4Sym, Nf3Ind, Nf3Sym]
27-
--repair[=<ENABLE>] Repair bugs saved in the grid [possible values: true, false]
28-
--rewrite-channel <IDX> <CHAN> Rewrite the definition of the channel with index IDX
29-
--rewrite-order <IDX> <ORDER> Rewrite the definition of the order with index IDX
30-
--rotate-pid-basis <BASIS> Rotate the PID basis for this grid [possible values: PDG, EVOL]
31-
-s, --scale <SCALE> Scales all grids with the given factor
32-
--scale-by-bin <BIN1,BIN2,...> Scale each bin with a different factor
33-
--scale-by-order <FAC1,FAC2,...> Scale subgrids with order-dependent factors
34-
--set-bins <LIMITS> Set the bin limits
35-
--set-key-value <KEY> <VALUE> Set an internal key-value pair
36-
--set-key-file <KEY> <FILE> Set an internal key-value pair, with value being read from a file
37-
--split-channels[=<ENABLE>] Split the grid such that each channel contains only a single PID combination [possible values: true, false]
38-
--upgrade[=<ENABLE>] Convert the file format to the most recent version [possible values: true, false]
39-
-h, --help Print help
15+
--cc <IDX>
16+
Charge conjugate the convolution with the specified index
17+
--dedup-channels[=<ULPS>]
18+
Deduplicate channels assuming numbers differing by ULPS are the same
19+
--delete-bins <BIN1-BIN2,...>
20+
Delete bins with the specified indices
21+
--delete-channels <CH1-CH2,...>
22+
Delete channels with the specified indices
23+
--delete-orders <O1-O2,...>
24+
Delete orders with the specified indices
25+
--delete-key <KEY>
26+
Delete an internal key-value pair
27+
--div-bin-norm-dims <DIM1,...>
28+
Divide each bin normalizations by the bin lengths for the given dimensions
29+
--fix-convolution <XCONV> <PDF_SET>
30+
Fix one of the convolutions with a PDF set
31+
--merge-bins <BIN1-BIN2,...>
32+
Merge specific bins together
33+
--merge-channel-factors[=<ON>]
34+
Merge channel factors into the grid [possible values: true, false]
35+
--mul-bin-norm <NORM>
36+
Multiply all bin normalizations with the given factor
37+
--optimize[=<ENABLE>]
38+
Optimize internal data structure to minimize memory and disk usage [possible values: true, false]
39+
--optimize-fk-table <OPTIMI>
40+
Optimize internal data structure of an FkTable to minimize memory and disk usage [possible values: Nf6Ind, Nf6Sym, Nf5Ind, Nf5Sym, Nf4Ind, Nf4Sym, Nf3Ind, Nf3Sym]
41+
--repair[=<ENABLE>]
42+
Repair bugs saved in the grid [possible values: true, false]
43+
--rewrite-channel <IDX> <CHAN>
44+
Rewrite the definition of the channel with index IDX
45+
--rewrite-order <IDX> <ORDER>
46+
Rewrite the definition of the order with index IDX
47+
--rotate-pid-basis <BASIS>
48+
Rotate the PID basis for this grid [possible values: PDG, EVOL]
49+
-s, --scale <SCALE>
50+
Scales all grids with the given factor
51+
--scale-by-bin <BIN1,BIN2,...>
52+
Scale each bin with a different factor
53+
--scale-by-order <FAC1,FAC2,...>
54+
Scale subgrids with order-dependent factors
55+
--set-bins <LIMITS>
56+
Set the bin limits
57+
--set-key-value <KEY> <VALUE>
58+
Set an internal key-value pair
59+
--set-key-file <KEY> <FILE>
60+
Set an internal key-value pair, with value being read from a file
61+
--split-channels[=<ENABLE>]
62+
Split the grid such that each channel contains only a single PID combination [possible values: true, false]
63+
--upgrade[=<ENABLE>]
64+
Convert the file format to the most recent version [possible values: true, false]
65+
-h, --help
66+
Print help
4067
";
4168

4269
const CHANNEL_STR: &str = "c entry entry
@@ -444,6 +471,17 @@ const DELETE_ORDERS_STR: &str = "o order
444471
1 O(as^1 a^2 lf^1)
445472
";
446473

474+
const THREE_CONVOLUTIONS_STR: &str = "b pT dsig/dpT (pol)
475+
[GeV] [pb/GeV]
476+
-+-----------------+------------------+--------------
477+
0 5.108395099639893 6.045444965362549 2.2605116e3
478+
1 6.045444965362549 6.982494831085205 1.0361301e3
479+
2 6.982494831085205 7.992245197296143 4.8947508e2
480+
3 7.992245197296143 8.960753917694092 2.4023939e2
481+
4 8.960753917694092 9.929026126861572 1.2464463e2
482+
5 9.929026126861572 11.660773754119873 5.2680349e1
483+
";
484+
447485
#[test]
448486
fn help() {
449487
Command::cargo_bin("pineappl")
@@ -1138,3 +1176,33 @@ fn delete_orders() {
11381176
.success()
11391177
.stdout(DELETE_ORDERS_STR);
11401178
}
1179+
1180+
#[test]
1181+
fn fix_convolution() {
1182+
let output = NamedTempFile::new("fix_convolution.pineappl.lz4").unwrap();
1183+
1184+
Command::cargo_bin("pineappl")
1185+
.unwrap()
1186+
.args([
1187+
"write",
1188+
"--fix-convolution",
1189+
"x3", // convolve the final-state hadron (FF)
1190+
"MAPFF10NLOPIsum",
1191+
"../test-data/SIHP-PP-POLARIZED-STAR-NLO.pineappl.lz4",
1192+
output.path().to_str().unwrap(),
1193+
])
1194+
.assert()
1195+
.success()
1196+
.stdout("");
1197+
1198+
Command::cargo_bin("pineappl")
1199+
.unwrap()
1200+
.args([
1201+
"convolve",
1202+
output.path().to_str().unwrap(),
1203+
"NNPDFpol11_100+p",
1204+
])
1205+
.assert()
1206+
.success()
1207+
.stdout(THREE_CONVOLUTIONS_STR);
1208+
}

0 commit comments

Comments
 (0)