Skip to content

Commit aacb455

Browse files
committed
Finalising the documentation
1 parent 5d6d4bc commit aacb455

File tree

1 file changed

+67
-44
lines changed

1 file changed

+67
-44
lines changed

doc/sphinx/source/tutorials/run-qed-fit.rst

Lines changed: 67 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ Setting up the runcard
1111
----------------------
1212

1313
It is possible to perform a QED fit by adding a ``fiatlux`` block to the
14-
runcard. The following code snippet shows an example of a QED fit configuration:
14+
runcard. The following code snippet shows all the available options to set up
15+
a QED fit:
1516

1617
.. code-block:: yaml
1718
1819
fiatlux:
19-
luxset: 251127-jcm-lh-qed-001
20+
luxset: NNPDF40_nnlo_as_01180_qcd
2021
additional_errors: true
2122
luxseed: 1234567890
23+
compute_in_setupfit: false
24+
eps_base: 1e-5
2225
2326
The parameters contained in the ``fiatlux`` block are:
2427

@@ -27,8 +30,8 @@ The parameters contained in the ``fiatlux`` block are:
2730
<https://github.com/scarrazza/fiatlux/>`_. The code will use as many
2831
photon replicas as the number of replicas contained in the ``luxset``. If
2932
the user tries to generate a replica with ID higher than the maximum ID of
30-
the ``luxset``, the code will start reusing photon replica from the first.
31-
Being the LuxQED approach an iterated procedure, and given that some
33+
the ``luxset``, the code will start reusing photon replica from the first
34+
replica. Being the LuxQED approach an iterated procedure, and that some
3235
replicas do not pass the ``postfit`` selection criteria, the user should
3336
make sure that the number of replicas in the ``luxset`` is high enough
3437
such that in the final iteration there will be a number of replicas higher
@@ -45,14 +48,27 @@ The parameters contained in the ``fiatlux`` block are:
4548
* ``luxseed``
4649
The seed used to generate the additional errors of the LuxQED as in ``additional_errors``.
4750

48-
The code uses both the ``fiatlux`` block and the ``theoryid`` specified in the
49-
runcard to identify the photon PDF set. As explained below, the code searches
50-
for precomputed photon PDF sets using the pair of ``luxset`` and ``theoryid``
51-
parameters, first locally and then on the NNPDF server (see
52-
:ref:`photon-resources` for details). The photon PDF set will be named
53-
``photon_theoryID_<theoryid>_fit_<luxset>``.
51+
* ``compute_in_setupfit``
52+
Boolean flag to trigger the computation of the photon PDF set during
53+
``vp-setupfit``. By default, it is set to `false`. This is not required if
54+
the photon PDF set is already available locally or on the NNPDF server.
55+
See the :ref:`section below <running-with-photon-sets>` for more details.
5456

55-
.. _photon-resources:
57+
* ``eps_base``
58+
(optional) The base precision of the FiatLux computation, which controls
59+
the precision on final integration of double integral. By default, it is
60+
set to ``1e-5``. This parameter is used only if the photon PDF set is
61+
generated on the fly, either during ``vp-setupfit`` or ``n3fit``. See
62+
:ref:`Generating new Photon sets <generating-photon-sets>` for more
63+
details.
64+
65+
The code uses information contained in both the ``fiatlux`` block and the
66+
``theoryid`` specified in the runcard to identify the photon PDF set, which will
67+
be assigned the name ``photon_theoryID_<theoryid>_fit_<luxset>``. This name will
68+
be used to either look for existing photon PDF sets or to store newly generated
69+
ones, as explained below.
70+
71+
.. _running-with-photon-sets:
5672

5773
Running with Photon PDF sets
5874
-----------------------------
@@ -63,6 +79,8 @@ minimize the overhead due to the generation of photon PDF sets and avoid
6379
redundant computations, the code looks for precomputed photon resources either
6480
locally or on the NNPDF server. If a desired photon PDF set does not exist in
6581
either of the two locations, it will be computed on the fly and stored locally.
82+
If the user is satisfied with the new local photon PDF set, they can upload it to
83+
the NNPDF server following the instructions in :ref:`this section <generating-photon-sets>`.
6684
The following sections describe how to use existing photon PDF sets or generate
6785
new ones.
6886

@@ -75,52 +93,48 @@ The desired photon PDF is specified by the ``luxset`` parameter in the
7593
``fiatlux`` block and the ``theoryid``, as explained above. The code will first
7694
look for the photon PDF set in the local directory specified in the
7795
:ref:`profile file <nnprofile>`. If the set is not found locally, it will try to
78-
download it from the NNPDF server. The following is an example of running
79-
``vp-setupfit`` using the ``fiatlux`` block shown above:
96+
download it from the NNPDF server. If the photon PDF set is not found on the
97+
server either, and the user has not requested to compute it during
98+
``vp-setupfit`` through the flag ``compute_in_setupfit``, the photon replica
99+
will be computed as needed for the replica fitted during the execution of
100+
``n3fit`` (see :ref:`here <photon_n3fit>` for more details).
101+
102+
The following is an example of running ``vp-setupfit`` using the
103+
``fiatlux`` block shown above and setting ``compute_in_setupfit: false``:
80104

81105
.. code-block:: bash
82106
83107
$ vp-setupfit qed_example_runcard.yml
84-
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_702_fit_251127-jcm-lh-qed-001 in theory: 702. Attempting to download it.
85-
[INFO]: Downloading https://data.nnpdf.science/photons/photon_theoryID_702_fit_251127-jcm-lh-qed-001.tar.
108+
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qed in theory: 40000100. Attempting to download it.
109+
[INFO]: Downloading https://data.nnpdf.science/photons/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qed.tar.
86110
[==================================================] (100%)
87111
[INFO]: Extracting archive to /opt/homebrew/Caskroom/miniconda/base/envs/nnpdf/share/NNPDF/photons_qed
88-
[INFO]: Photon QED set found for 702 with luxset 251127-jcm-lh-qed-001.
112+
[INFO]: Photon QED set found for 40000100 with luxset NNPDF40_nnlo_as_01180_qed.
89113
[WARNING]: Using q2min from runcard
90114
[WARNING]: Using w2min from runcard
91115
Using Keras backend
92116
[INFO]: All requirements processed and checked successfully. Executing actions.
93117
...
94118
95-
This will download and extract the photon PDF set in the local
119+
In this case, the desired photon PDF set was already stored and precomputed on
120+
the server. This is downloaded and extracted in the local
96121
``photons_qed_path`` specified in the :ref:`profile file <nnprofile>`.
97122

98123
The ``vp-list`` utility tool can be used to list all the available photon PDF
99124
sets locally and on the NNPDF server. To list the available photon PDF sets,
100-
just run:
101-
102-
.. code-block:: bash
103-
104-
$ vp-list photons
105-
[INFO]: The following photons are available locally:
106-
- theoryID_702_fit_251127-jcm-lh-qed-001
107-
[INFO]: The following photons are downloadable:
108-
- theoryID_702_fit_251127-jcm-lh-qed-002
109-
110-
In this example, there is one photon PDF set available locally, and one photon
111-
resource available on the NNPDF server precomputed with theory ID 702 and
112-
``251127-jcm-lh-qed-002`` as input PDF. The user can manually download a photon
113-
PDF set using the ``vp-get`` tool as explained :ref:`here <download>`. For
114-
example:
125+
just run `vp-list photons` to see which photon PDF sets are available locally
126+
and which ones can be downloaded from the server. The user can manually download
127+
a photon PDF set using the ``vp-get`` tool as explained :ref:`here <download>`.
128+
For example:
115129

116130
.. code-block:: bash
117131
118-
$ vp-get photonQED 702 251127-jcm-lh-qed-002
119-
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_702_fit_251127-jcm-lh-qed-002 in theory: 702. Attempting to download it.
120-
[INFO]: Downloading https://data.nnpdf.science/photons/photon_theoryID_702_fit_251127-jcm-lh-qed-002.tar.
132+
$ vp-get photonQED 40000100 NNPDF40_nnlo_as_01180_qed
133+
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qed in theory: 40000100. Attempting to download it.
134+
[INFO]: Downloading https://data.nnpdf.science/photons/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qed.tar.
121135
[==================================================] (100%)
122136
[INFO]: Extracting archive to /user/envs/nnpdf/share/NNPDF/photons_qed
123-
PosixPath('/user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_702_fit_251127-jcm-lh-qed-002')
137+
PosixPath('/user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qed')
124138
125139
As in the case of ``vp-setupfit``, this will download and extract the photon PDF
126140
set in the local ``photons_qed_path`` specified in the :ref:`profile file <nnprofile>`.
@@ -135,6 +149,7 @@ fit with ``n3fit`` as usual.
135149
more details.
136150

137151
.. _generating-photon-sets:
152+
138153
Generating new Photon PDF sets
139154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140155
If the desired photon PDF set is not available locally nor on the NNPDF server, the
@@ -162,8 +177,16 @@ prior to the evolution through EKO.
162177

163178
Automatic upload to the NNPDF server through ``vp-upload`` is **not**
164179
supported at the moment. The user should manually create a ``tar`` archive
165-
file containing the photon replicas and upload it to server. Refer to the
166-
:ref:`profile file <nnprofile>` to find the remote URL where photon PDF sets are stored.
180+
file containing the photon replicas
181+
182+
.. code-block:: bash
183+
184+
$ cd my_photon_folder
185+
$ tar -czf my_photon.tgz *.npz
186+
187+
Once the archive file is created, the user can upload it to the server. Refer
188+
to the :ref:`profile file <nnprofile>` to find the remote URL where photon PDF
189+
sets are stored.
167190

168191

169192
Using ``vp-setupfit`` (preferred)
@@ -177,9 +200,9 @@ Using ``vp-setupfit`` (preferred)
177200
.. code-block:: bash
178201
179202
$ vp-setupfit qed_example_runcard.yml
180-
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_703_fit_251127-jcm-lh-qed-001 in theory: 703. Attempting to download it.
181-
[ERROR]: Resource not in the remote repository: Photon QED set for TheoryID 703 and luxset 251127-jcm-lh-qed-001 is not available in the remote server.
182-
[WARNING]: Photon QED set for theory 703 with luxset 251127-jcm-lh-qed-001 not found. It will be computed in vp-setupfit.
203+
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qcd in theory: 40000100. Attempting to download it.
204+
[ERROR]: Resource not in the remote repository: Photon QED set for TheoryID 40000100 and luxset NNPDF40_nnlo_as_01180_qcd is not available in the remote server.
205+
[WARNING]: Photon QED set for theory 40000100 with luxset NNPDF40_nnlo_as_01180_qcd not found. It will be computed in vp-setupfit.
183206
[INFO]: Forcing photon computation with FiatLux during setupfit.
184207
[WARNING]: Using q2min from runcard
185208
[WARNING]: Using w2min from runcard
@@ -206,6 +229,7 @@ Using ``vp-setupfit`` (preferred)
206229
Once the preparation step is completed, and the photon PDF set is generated and stored
207230
locally, the user can proceed to run the fit with ``n3fit`` as usual.
208231
232+
.. _photon_n3fit:
209233
Using ``n3fit`` (discouraged)
210234
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211235
If the user prefers to compute the photon PDF set during the fitting step with
@@ -222,9 +246,8 @@ Using ``n3fit`` (discouraged)
222246
$ n3fit qed_example_runcard.yml 1
223247
[INFO]: Creating replica output folder in /user/runcards/qed_example_runcard/nnfit/replica_1
224248
[WARNING]: Using q2min from runcard
225-
[WARNING]: Using w2min from runcard
226-
Using Keras backend
227-
[WARNING]: No Photon QED set found for Theory 703 with luxset 251127-jcm-lh-qed-001. It will be computed using FiatLux. This may impact performance. It is recommended to precompute the photon set before running the fit. Refer to https://docs.nnpdf.science/tutorials/run-qed-fit.html for more details on precomputing photon PDF sets.
249+
[WARNING]: Using w2min from runcard Using Keras backend
250+
[WARNING]: No Photon QED set found for Theory 40000100 with luxset NNPDF40_nnlo_as_01180_qed. It will be computed using FiatLux. This may impact performance. It is recommended to precompute the photon set before running the fit. Refer to https://docs.nnpdf.science/tutorials/run-qed-fit.html for more details on precomputing photon PDF sets.
228251
[INFO]: All requirements processed and checked successfully. Executing actions.
229252
230253
.. warning::

0 commit comments

Comments
 (0)