From 89b30a6dfda41eb224158585d91daab059c87ab5 Mon Sep 17 00:00:00 2001 From: Mark Nestor Costantini Date: Tue, 27 Feb 2024 17:34:09 +0100 Subject: [PATCH 1/3] added some docs on metadata to be stored in matrix pineappl grids --- docs/source/external/matrix.rst | 45 +++++++++++++++++++++++++++++++++ docs/source/index.rst | 1 + 2 files changed, 46 insertions(+) create mode 100644 docs/source/external/matrix.rst diff --git a/docs/source/external/matrix.rst b/docs/source/external/matrix.rst new file mode 100644 index 0000000..def6ce3 --- /dev/null +++ b/docs/source/external/matrix.rst @@ -0,0 +1,45 @@ +MATRIX +================== + + +Metadata to store in PineAPPL grid +---------------------------------- +The following is a more or less complete list of the metadata that should be +stored in a PineAPPL grid file. The list is not exhaustive, and some of the +metadata might not be relevant for all grids. However, it is a good starting +point for what to store in a grid file. + +The commands below can all be performed simultaneously, +however we break them down here for the sake of readability. + + +- **Optimise and scale** (if needed) the pineappl grid, this can be done using pineappl’s CLI: an example would be + + ``pineappl write —optimize —scale 0.001 name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4``` + + In this case we have generated a new pineappl grid called + name_new_grid.pineappl.lz4. This grid has been optimised so as not to contain + useless zeros and rescaled by a factor ``0.001`` eg to go from pb to fb. + +- **Delete useless keys** + Again, this can be done using pineappl write + + ``pineappl write —delete_key “y_label_unit” —delete_key “xlabel” “x_label-tex” name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4`` + + Here we have removed some unwanted keys. Note that the available keys can be listed with: + ``pineappl read --keys abseta_lep_NLO.QCD.pineappl.lz4`` + +- **Set Key values** to useful names: + In the example below, for instance, we are setting the y unit to the wanted unit, + the y label to be a differential cross section and the lumi id type so as to be compatible with LHAPDF + + ``pineappl write —set-key-value ‘y-unit’ ‘pb/GeV’ —set-key-value ‘y-label’ ‘differential x-sec’ —set-key-value ‘lumi_id_types’ ‘pdg_mc_ids’ name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4`` + + Another key that should be added is the arXiv number. + +- **Add output log of MATRIX**, + + it was decided that the MATRIX output log should be added to pineappl grids for the sake of readability. To do so just run: + + ``pineappl write —set-key-value ‘output_log’ ‘’ name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4`` + diff --git a/docs/source/index.rst b/docs/source/index.rst index 4e1aceb..a6655ee 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -62,6 +62,7 @@ and the program will, if necessary, install the required external program and la external/index external/mg5 external/yadism + external/matrix external/vrap external/pos external/int From 74dbe17ad2f0cb94046320eb6407786d0e550506 Mon Sep 17 00:00:00 2001 From: Mark Nestor Costantini Date: Tue, 27 Feb 2024 17:35:03 +0100 Subject: [PATCH 2/3] minor modification --- docs/source/external/matrix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/external/matrix.rst b/docs/source/external/matrix.rst index def6ce3..bd07924 100644 --- a/docs/source/external/matrix.rst +++ b/docs/source/external/matrix.rst @@ -1,5 +1,5 @@ MATRIX -================== +====== Metadata to store in PineAPPL grid From 0dc01e4611098406fa3fe7be41027cac1f445c20 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Fri, 1 Mar 2024 17:30:29 +0200 Subject: [PATCH 3/3] Reshuffle MATRIX stub --- docs/source/external/matrix.rst | 74 +++++++++++++++------------------ 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/docs/source/external/matrix.rst b/docs/source/external/matrix.rst index bd07924..22213a3 100644 --- a/docs/source/external/matrix.rst +++ b/docs/source/external/matrix.rst @@ -2,44 +2,36 @@ MATRIX ====== -Metadata to store in PineAPPL grid ----------------------------------- -The following is a more or less complete list of the metadata that should be -stored in a PineAPPL grid file. The list is not exhaustive, and some of the -metadata might not be relevant for all grids. However, it is a good starting -point for what to store in a grid file. - -The commands below can all be performed simultaneously, -however we break them down here for the sake of readability. - - -- **Optimise and scale** (if needed) the pineappl grid, this can be done using pineappl’s CLI: an example would be - - ``pineappl write —optimize —scale 0.001 name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4``` - - In this case we have generated a new pineappl grid called - name_new_grid.pineappl.lz4. This grid has been optimised so as not to contain - useless zeros and rescaled by a factor ``0.001`` eg to go from pb to fb. - -- **Delete useless keys** - Again, this can be done using pineappl write - - ``pineappl write —delete_key “y_label_unit” —delete_key “xlabel” “x_label-tex” name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4`` - - Here we have removed some unwanted keys. Note that the available keys can be listed with: - ``pineappl read --keys abseta_lep_NLO.QCD.pineappl.lz4`` - -- **Set Key values** to useful names: - In the example below, for instance, we are setting the y unit to the wanted unit, - the y label to be a differential cross section and the lumi id type so as to be compatible with LHAPDF - - ``pineappl write —set-key-value ‘y-unit’ ‘pb/GeV’ —set-key-value ‘y-label’ ‘differential x-sec’ —set-key-value ‘lumi_id_types’ ‘pdg_mc_ids’ name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4`` - - Another key that should be added is the arXiv number. - -- **Add output log of MATRIX**, - - it was decided that the MATRIX output log should be added to pineappl grids for the sake of readability. To do so just run: - - ``pineappl write —set-key-value ‘output_log’ ‘’ name_old_grid.pineappl.lz4 name_new_grid.pineappl.lz4`` - +Post-processing grids +--------------------- + +We need to post-process the raw grids outputted by MATRIX - +use one of the available interfaces (including the CLI) to do so. + + +- **Optimize and scale:** apply the built-in optimization and rescaled by a factor if needed to go e.g. from pb to fb. + +- **Delete keys:** delete `y_label_unit`, `xlabel` and `x_label-tex` + +- **Add keys:** + .. list-table:: Additional keys + :widths: 25 25 50 + :header-rows: 1 + + * - key + - value + - comment + * - y-unit + - pb/GeV + - + * - y-label + - differential x-sec + - + * - lumi_id_types + - pdg_mc_ids + - needed for compatibility with LHAPDF + * - arxiv + - + - put the original paper + +- **Add output log of MATRIX:** put the original MATRIX output log under the `results` key as usual