NNPDF / pineappl

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

Merge grids with different xgrids #94

Closed felixhekhorn closed 2 years ago

felixhekhorn commented 2 years ago
thread '<unnamed>' panicked at 'assertion failed: self.x1_grid() == other_grid.x1_grid()', /media/FK/pineappl/pineappl/src/import_only_subgrid.rs:288:17

ERROR in CMSZDIFF12: wanted to merge PineAPPL grids
[PosixPath('/media/FK/fktables/data/appl_subgrids/CMSZDIFF12-CMSZDIFF12-BIN1_ptZ.pineappl.lz4'), PosixPath('/media/FK/fktables/data/appl_subgrids/CMSZDIFF12-CMSZDIFF12-BIN2_ptZ.pineappl.lz4'), PosixPath('/media/FK/fktables/data/appl_subgrids/CMSZDIFF12-CMSZDIFF12-BIN3_ptZ.pineappl.lz4'), PosixPath('/media/FK/fktables/data/appl_subgrids/CMSZDIFF12-CMSZDIFF12-BIN4_ptZ.pineappl.lz4'), PosixPath('/media/FK/fktables/data/ap
pl_subgrids/CMSZDIFF12-CMSZDIFF12-BIN5_ptZ.pineappl.lz4')]
but                                                                                                      
assertion failed: self.x1_grid() == other_grid.x1_grid()

likewise (and easier to reproduce)

$ pineappl merge bla.pineappl.lz4 data/appl_subgrids/CMSZDIFF12-CMSZDIFF12-BIN1_ptZ.pineappl.lz4 data/appl_subgrids/CMSZDIFF12-CMSZDIFF12-BIN2_ptZ.pineappl.lz4                               
thread 'main' panicked at 'assertion failed: self.x1_grid() == other_grid.x1_grid()', pineappl/src/import_only_subgrid.rs:288:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

this is also the case for some other dataset, but unfortunately I'm no longer able to reconstruct ...

cschwan commented 2 years ago

These two files have the same bin limits and in that case merge tries to add the grids together - but you want the files append the files, basically. To do that you have to use first use remap, see https://github.com/N3PDF/fktables/commit/e2c0b351121dabed336415901bad18b6417355bf how to do that. I've modified the convert_applgrids.sh of https://github.com/N3PDF/fktables, which now generates CMSZDIFF12-CMSZDIFF12-ALLBINS_ptZ.pineappl.lz4. Feel free to rename it, and the file is already generated on dom.