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

FkTable.table raises unexpected error #77

Closed alecandido closed 2 years ago

alecandido commented 2 years ago

As reported by @scarlehoff running the following on the attached FkTable does not work, and it raises.

In [2]: from pineappl.fk_table import FkTable
  ...: pine_file = "fktables/213-HERA_NC_318GEV_EP_SIGMARED.pineappl"
  ...: pine_fk = FkTable.read(pine_file)
  ...: pine_fk.table()
---------------------------------------------------------------------------
PanicException                            Traceback (most recent call last)
<ipython-input-2-b66371a3a195> in <module>
     2 pine_file = "fktables/213-HERA_NC_318GEV_EP_SIGMARED.pineappl"
     3 pine_fk = FkTable.read(pine_file)
----> 4 pine_fk.table()

PanicException: ndarray: index [0, 1, 2, 0] is out of bounds for array of shape [485, 14, 0, 0]

Most likely we have a subgrid(0, 0, 0) empty, and then the subgrid allocated has dimension (#bins, #lumis, 0, 0), and it fails as soon as it iterates over the following subgrids.

https://github.com/N3PDF/pineappl/blob/ad6073b15bba36971e8475b7fb637b1f75464d47/pineappl/src/fk_table.rs#L55-L72

cschwan commented 2 years ago

@scarlehoff @AleCandido commit eb2af60a69fd9e979a77d822fef904397e46d816 should fix this problem in the general case. Could you please let me know if it works?

cschwan commented 2 years ago

@scarlehoff @AleCandido to clarify: with the mentioned commit it should work even if the grid isn't optimized.

scarlehoff commented 2 years ago

General case means I can use it also with the non-optimized ones?

Also, it would be nice to also optimize away the numerical zeros (so that it is exactly equivalent to the NNPDF flavour list)

cschwan commented 2 years ago

Also, it would be nice to also optimize away the numerical zeros (so that it is exactly equivalent to the NNPDF flavour list)

That's part of https://github.com/N3PDF/pineappl/issues/45 now.

scarlehoff commented 2 years ago

Yes, it works with some of the unoptimized grids as well.

One problem though is that the convolute method is not working any more. I'll try to write a MWE and open an new issue.

cschwan commented 2 years ago

One problem though is that the convolute method is not working any more. I'll try to write a MWE and open an new issue.

I think the problem is commit 4e40743929483f9e670069238e7368b77634ba76, which now requires the PDFs that you pass to PineAPPL to be in the flavour basis, irrespectively of what basis the grid is in.

scarlehoff commented 2 years ago

oh, ok. Then I don't have to use pineko's evol_xfxQ2. Perfect. Then everything's working.

cschwan commented 2 years ago

Great!