-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from NNPDF/docs-delivery
Add delivery page to docs
- Loading branch information
Showing
9 changed files
with
207 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,45 @@ | ||
<h1 align="center">NνSF</h1> | ||
|
||
NνSF is a python module that provides predictions for neutrino structure functions. It relies on [Yadism](https://github.com/N3PDF/yadism) for the large-$Q^2$ region while the low-$Q^2$ regime is modelled in terms of a Neural Network (NN). | ||
|
||
## Installation & Development | ||
|
||
The package can be installed from source using the following commands: | ||
|
||
```bash | ||
git clone https://github.com/NNPDF/nnusf.git --depth 1 | ||
cd nnusf | ||
poetry install | ||
<h1 align="center">NNSFν</h1> | ||
<p align="center"> | ||
<img alt="Zenodo" src="https://zenodo.org/badge/DOI/10.1101/2023.02.15.204701.svg"> | ||
<img alt="arXiv" src="https://img.shields.io/badge/arXiv-2223.04638-b31b1b?labelColor=222222"> | ||
<img alt="Docs" src="https://assets.readthedocs.org/static/projects/badges/passing-flat.svg"> | ||
<img alt="Status" src="https://www.repostatus.org/badges/latest/active.svg"> | ||
<img alt="License" src="https://img.shields.io/badge/License-MIT-yellow.svg"> | ||
</p> | ||
|
||
NNSFν is a python module that provides predictions for neutrino structure functions. | ||
It relies on [Yadism](https://github.com/N3PDF/yadism) for the large $Q^2$ region | ||
while the low $Q^2$ regime is modelled in terms of a Neural Network (NN). The NNSFν | ||
determination is also made available in terms of fast interpolation | ||
[LHAPDF](https://lhapdf.hepforge.org/) grids that can be accessed through an independent | ||
driver code and directly interfaced to the [GENIE](http://www.genie-mc.org/) neutrino | ||
event generators. | ||
|
||
# Quick links | ||
|
||
- [Installation instructions](https://nnpdf.github.io/nnusf/quickstart/installation.html) | ||
- [Tutorials](https://nnpdf.github.io/nnusf/tutorials/datasets.html) | ||
- [Delivery & Usage](https://nnpdf.github.io/nnusf/delivery/lhapdf.html) | ||
|
||
# Citation | ||
|
||
To refer to NNSFν in a scientific publication, please use the following: | ||
```bibtex | ||
@article {reference_id, | ||
author = {Alessandro Candido, Alfonso Garcia, Giacomo Magni, Tanjona Rabemananjara, Juan Rojo, Roy Stegeman}, | ||
title = {Neutrino Structure Functions from GeV to EeV Energies}, | ||
year = {2023}, | ||
doi = {10.1101/2020.07.15.204701}, | ||
eprint = {https://arxiv.org/list/hep-ph/}, | ||
journal = {aRxiv} | ||
} | ||
``` | ||
|
||
This also provides the user the ability to develop on the codes. | ||
|
||
## Usage | ||
|
||
NνSF provides an extensive Command Line Interface (CLI) that permits the user to perform various classes of tasks. To know more about all the available options, just run `nnu --help`. For convenience, below we provide details on how the fitting part of the codes can be run. | ||
|
||
#### Perform a fit | ||
|
||
To run a fit, one can simplify type the following commands: | ||
|
||
```bash | ||
nnu fit run <runcard> <replica> -d <output_path> | ||
And if NNSFν proved to be useful in your work, consider also to reference the codes: | ||
```bibtex | ||
@article {reference_id, | ||
author = {Alessandro Candido, Alfonso Garcia, Giacomo Magni, Tanjona Rabemananjara, Juan Rojo, Roy Stegeman}, | ||
title = {Neutrino Structure Functions from GeV to EeV Energies}, | ||
year = {2023}, | ||
doi = {10.1101/2020.07.15.204701}, | ||
} | ||
``` | ||
An example of a runcard to perform a fit is [./runcards/fit_runcard.yml](./runcards/fit_runcard.yml). | ||
|
||
This will generate inside the folder `<output_path>` a folder named `replica_<replica>` which in turn contains a tensorflow model that can be used to generate predictions. In general, one needs to run the above command for `replica={1, ..., n}`. | ||
|
||
#### Perform a Postfit | ||
|
||
If needed, one can perform a post-selection on the replicas generated from the fit. For instance, one can only select the replicas whose $\chi^2$ values are below some thresholds. Below is an example in which we only select replicas with $\chi^2_{\rm tr}$ and $\chi^2_{\rm vl}$ below `10`: | ||
```bash | ||
nnu fit postfit <output_path> -t '{"tr_max": 10, "vl_max": 10}' | ||
``` | ||
This will generate inside `<output_path>` a folder named `postfit` which contains the replicas that satisfy the selection criteria. | ||
|
||
#### Generate a report & Predictions | ||
|
||
To generate a report from a fit, one can simply run: | ||
```bash | ||
nnu report generate <output_path>/postfit -t "<Title>" -a "<author>" -k "<keyword>" | ||
``` | ||
This will generate a folder called `output` inside `<output_path>` which contains an `index.html` summarizing the results. If `postfit` was not run in the previous step, simply remove `/postfit` in the command above. | ||
|
||
Finally, to generate predictions using the trained models, just run the following commands: | ||
|
||
```bash | ||
nnu plot fit <output_path> <runcard> | ||
``` | ||
An example of such a runcard is [./runcards/generate_predictions.yml](./runcards/generate_predictions.yml). | ||
|
||
This will generate a `.txt` file containing the NN predictions for the different structure functions. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
Grids & Usage | ||
============= | ||
|
||
LHAPDF grids | ||
------------ | ||
|
||
The NNSFν structure function grids are available in the LHAPDF format | ||
for various nuclear targets. For a given nuclear target, the grids is | ||
split into small- and large-:math:`Q`, which could be combined according | ||
to a prescription described below. | ||
|
||
.. list-table:: LHAPDF GRIDS | ||
:widths: 30 60 60 | ||
:header-rows: 1 | ||
|
||
* - :math:`(Z, A)` [target] | ||
- Low-:math:`Q` Grid | ||
- High-:math:`Q` Grid | ||
* - :math:`(1, 2)` | ||
- `NNSFnu\_D\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_D_lowQ.tar.gz>`_ | ||
- `NNSFnu\_D\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_D_highQ.tar.gz>`_ | ||
* - :math:`(2, 4)` | ||
- `NNSFnu\_He\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_He_lowQ.tar.gz>`_ | ||
- `NNSFnu\_He\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_He_highQ.tar.gz>`_ | ||
* - :math:`(3, 6)` | ||
- `NNSFnu\_Li\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Li_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Li\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Li_highQ.tar.gz>`_ | ||
* - :math:`(4, 9)` | ||
- `NNSFnu\_Be\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Be_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Be\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Be_highQ.tar.gz>`_ | ||
* - :math:`(6, 12)` | ||
- `NNSFnu\_C\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_C_lowQ.tar.gz>`_ | ||
- `NNSFnu\_C\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_C_highQ.tar.gz>`_ | ||
* - :math:`(7, 14)` | ||
- `NNSFnu\_N\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_N_lowQ.tar.gz>`_ | ||
- `NNSFnu\_N\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_N_highQ.tar.gz>`_ | ||
* - :math:`(8, 16)` | ||
- `NNSFnu\_O\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_O_lowQ.tar.gz>`_ | ||
- `NNSFnu\_O\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_O_highQ.tar.gz>`_ | ||
* - :math:`(13, 27)` | ||
- `NNSFnu\_Al\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Al_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Al\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Al_highQ.tar.gz>`_ | ||
* - :math:`(15, 31)` | ||
- `NNSFnu\_Ea\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Ea_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Ea\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Ea_highQ.tar.gz>`_ | ||
* - :math:`(20, 40)` | ||
- `NNSFnu\_Ca\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Ca_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Ca\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Ca_highQ.tar.gz>`_ | ||
* - :math:`(26, 56)` | ||
- `NNSFnu\_Fe\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Fe_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Fe\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Fe_highQ.tar.gz>`_ | ||
* - :math:`(29, 64)` | ||
- `NNSFnu\_Cu\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Cu_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Cu\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Cu_highQ.tar.gz>`_ | ||
* - :math:`(47, 108)` | ||
- `NNSFnu\_Ag\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Ag_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Ag\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Ag_highQ.tar.gz>`_ | ||
* - :math:`(50, 119)` | ||
- `NNSFnu\_Sn\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Sn_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Sn\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Sn_highQ.tar.gz>`_ | ||
* - :math:`(54, 131)` | ||
- `NNSFnu\_Xe\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Xe_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Xe\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Xe_highQ.tar.gz>`_ | ||
* - :math:`(74, 184)` | ||
- `NNSFnu\_W\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_W_lowQ.tar.gz>`_ | ||
- `NNSFnu\_W\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_W_highQ.tar.gz>`_ | ||
* - :math:`(79, 197)` | ||
- `NNSFnu\_Au\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Au_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Au\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Au_highQ.tar.gz>`_ | ||
* - :math:`(82, 208)` | ||
- `NNSFnu\_Pb\_lowQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Pb_lowQ.tar.gz>`_ | ||
- `NNSFnu\_Pb\_highQ <https://data.nnpdf.science/NNSFnu/NNSFnu_Pb_highQ.tar.gz>`_ | ||
|
||
The structure function grids can then be used to compute the | ||
double differential cross-sections using the following command: | ||
|
||
.. code-block:: bash | ||
nnu extra compute_xsecs ${SET_NAME} [-q '{"min": 1e-3, "max": 400, "num": 100}]' [-q ${type}] | ||
where :mod:`type` can be either :mod:`neutrino` or :mod:`antineutrino`, if not | ||
specified the default value is chosen to be :mod:`neutrino`. | ||
One can also from a given structure function set compute the integrated | ||
cross-sections via the command: | ||
.. code-block:: bash | ||
nnu extra integrated_xsecs ${SET_NAME} [-q '{"min": 1e-3, "max": 400, "num": 100}]' [-q ${type}] | ||
NNSFν pre-trained model | ||
----------------------- | ||
We also make publicly available the pre-trained NNSFν model used to generate | ||
the predictions published in the paper. The model can be downloaded at the | ||
following `link <https://data.nnpdf.science/NNUSF/Models/nnsfnu.tar.gz>`_. | ||
Such a model can be used for various purposes but as explained in the | ||
tutorial part it can be mainly used to generate structure function grids: | ||
.. code-block:: bash | ||
nnu fit dump_grids nnsfnu/postfit -a ${A_VALUE} -o ${SET_NAME} [-q '{"min": 1e-3, "max": 500, "num": 100}]' | ||
.. note:: | ||
If one encouters the issue that the git version does not match, one just | ||
needs to checkout to the commit from which the fit was generated. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters