NNPDF / pineappl

PineAPPL is not an extension of APPLgrid
https://nnpdf.github.io/pineappl/
GNU General Public License v3.0
12 stars 3 forks source link

PDF sets that cannot be extrapolated beyond a given max value #104

Closed Radonirinaunimi closed 2 years ago

Radonirinaunimi commented 2 years ago

There are LHAPDF sets that cannot be extrapolated beyond a certain maximum value xMax (not actually sure if this a pathology). An example of error that is raised by LHAPDF during such a scenario is given below:

RuntimeError: Error in LHAPDF::ContinuationExtrapolator, x > xMax (last x knot): 9.960752e-01 > 9.926200e-01

This causes pineappl to fail when say performing convolute. What would be the appropriate way to deal with this?

cschwan commented 2 years ago

That should be considered a bug, and I suppose I can fix it by simply setting the PDF to zero outside the valid range for x.

cschwan commented 2 years ago

@Radonirinaunimi can you tell me a PDF for which this happens? I'd like to test it myself.

Radonirinaunimi commented 2 years ago

@Radonirinaunimi can you tell me a PDF for which this happens? I'd like to test it myself.

@cschwan Thanks for having a look at this. Here is an example.

cschwan commented 2 years ago

Is there a type in the PDF4LHC21_40.info file? I see a Particle: 2312 there, but for a proton it should be 2212.

cschwan commented 2 years ago

Commit c0144e4505fda1f4a835d3a0428b4acefe371197 should fix the problem. Please close the Issue if you can confirm that.

Radonirinaunimi commented 2 years ago

Is there a type in the PDF4LHC21_40.info file? I see a Particle: 2312 there, but for a proton it should be 2212.

Yes! This is a typo.

Commit c0144e4 should fix the problem. Please close the Issue if you can confirm that.

Let me try this now.

Radonirinaunimi commented 2 years ago

So, after cargo install --path pineappl_cli, pineappl convolute GRID PDF4LHC21_40 still fails. Running with RUST_BACKTRACE=full gives the following:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', pineappl/src/grid.rs:501:36
stack backtrace:
   0:     0x555ee6718005 - std::backtrace_rs::backtrace::libunwind::trace::hdee71ab8389d1a85
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x555ee6718005 - std::backtrace_rs::backtrace::trace_unsynchronized::hb87d1848acf53db4
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x555ee6718005 - std::sys_common::backtrace::_print_fmt::hdc3c002df42eb2a8
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x555ee6718005 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7e7c5f80320a5555
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x555ee667214c - core::fmt::write::hc2943c27b07a73ca
                               at /build/rust/src/rustc-1.55.0-src/library/core/src/fmt/mod.rs:1115:17
   5:     0x555ee6715d54 - std::io::Write::write_fmt::hb7f935476897f155
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/io/mod.rs:1665:15
   6:     0x555ee6716f8b - std::sys_common::backtrace::_print::hb66bd912df539f1a
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x555ee6716f8b - std::sys_common::backtrace::print::hc4b23a5c9cc2f820
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x555ee6716f8b - std::panicking::default_hook::{{closure}}::h0a3927c9f62688b2
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/panicking.rs:208:50
   9:     0x555ee6715959 - std::panicking::default_hook::h0e16f7372c7d097b
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/panicking.rs:225:9
  10:     0x555ee6715959 - std::panicking::rust_panic_with_hook::h4e2752775b3d350d
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/panicking.rs:622:17
  11:     0x555ee67307c8 - std::panicking::begin_panic_handler::{{closure}}::hfb4a3e2dde3b8c71
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/panicking.rs:519:13
  12:     0x555ee673073c - std::sys_common::backtrace::__rust_end_short_backtrace::h6a002c3bf329dba7
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x555ee67306ed - rust_begin_unwind
                               at /build/rust/src/rustc-1.55.0-src/library/std/src/panicking.rs:515:5
  14:     0x555ee65d2530 - core::panicking::panic_fmt::h684942b93bd34e24
                               at /build/rust/src/rustc-1.55.0-src/library/core/src/panicking.rs:92:14
  15:     0x555ee65d2862 - core::result::unwrap_failed::hacdd61d4daa430ed
                               at /build/rust/src/rustc-1.55.0-src/library/core/src/result.rs:1599:5
  16:     0x555ee6687e1e - pineappl::grid::Grid::convolute::hdb21b40502214eb8
  17:     0x555ee66c8329 - pineappl::helpers::convolute::h38cffc62452e6acd
  18:     0x555ee66f2538 - <pineappl::convolute::Opts as pineappl::helpers::Subcommand>::run::h3b50d82488398ab2
  19:     0x555ee65ef73a - pineappl::main::hfdff89d7b10e06f9
  20:     0x555ee66df823 - std::sys_common::backtrace::__rust_begin_short_backtrace::h50b795027d045170
  21:     0x555ee6621075 - main
  22:     0x7f79fb964b25 - __libc_start_main
  23:     0x555ee65dd4be - _start
  24:                0x0 - <unknown>

Did it work for you?

cschwan commented 2 years ago

That's because of the PDF set doesn't contain a proton:

Is there a type in the PDF4LHC21_40.info file? I see a Particle: 2312 there, but for a proton it should be 2212.

You should edit the .info file so that you have Particle: 2212. I admit that the error message doesn't reflect that.

Radonirinaunimi commented 2 years ago

Silly me! I have changed it but then overwrote it again when unzipping (stupid form my side). That said, the error messages would have would have they been more descriptive. There was no clear indication whether the error is coming from LHAPDF or pineappl.

Closing as solved.