Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
1a3f5d6
Initialize module for the computation of ph in validphys
niclaurenti Nov 9, 2022
0d4c17d
Modify compute_photon.py
niclaurenti Nov 11, 2022
d5462fd
Add replica id to compute_photon
niclaurenti Nov 14, 2022
10fe59b
Add layer AddPhoton
niclaurenti Nov 16, 2022
747f589
Implement module for the computation of DIS structure functions
niclaurenti Nov 19, 2022
86fadac
Remove path_to_grid from StructureFunction
niclaurenti Nov 21, 2022
d24d1d0
Fix computation of photon pdf
niclaurenti Nov 21, 2022
990745c
Modify AddPhoton
niclaurenti Dec 1, 2022
22ca1d1
Rename photon_1GeV -> photon_fitting_scale
niclaurenti Dec 1, 2022
418c027
Rename photon_1GeV -> photon_fitting_scale
niclaurenti Dec 2, 2022
e678d00
Comment unnecessary lines
niclaurenti Dec 2, 2022
14acd55
Merge branch 'separate_xgrid_from_model' into add-photon
niclaurenti Dec 5, 2022
03b247e
Restructure compute_photon
niclaurenti Dec 6, 2022
64d98d0
Modify layer AddPhoton
niclaurenti Dec 6, 2022
6ac7652
Remove ipdb
niclaurenti Dec 6, 2022
59d4639
Add theoryid and fiatlux_runcard to ModelTrainer
niclaurenti Dec 6, 2022
2118528
Add photon in model_trainer
niclaurenti Dec 6, 2022
c3b4aa8
Change calling of theory in Photon
niclaurenti Dec 9, 2022
383f2ba
Modify call in AddPhoton
niclaurenti Dec 9, 2022
0b565f9
Split rotation and photon layer
niclaurenti Dec 9, 2022
cfed0c4
Clean calling of fiatlux
niclaurenti Dec 9, 2022
26f0214
Use RectBivariateSpline instead of interp2d
niclaurenti Dec 9, 2022
d90ea4d
Refactor passing of xgrid
niclaurenti Dec 9, 2022
77667e6
Rename photon_pdf -> photon and compute_photon -> compute
niclaurenti Dec 10, 2022
d11f7eb
Remove test_structure_functions
niclaurenti Dec 11, 2022
373f96d
Remove temporarily replica_id from performfit
niclaurenti Dec 12, 2022
615405f
add a photon placeholder to n3fit
scarlehoff Dec 12, 2022
4c032a6
Merge branch 'master' into add-photon
niclaurenti Dec 12, 2022
c3531c9
Change xinput.input_l -> xinput.input
niclaurenti Dec 12, 2022
bbdfa39
Merge branch 'add-photon' into add_photon_fit
niclaurenti Dec 12, 2022
fd1803d
Merge pull request #1648 from NNPDF/add_photon_fit
niclaurenti Dec 12, 2022
c18b925
Implement photon_computer in n3fit
niclaurenti Dec 12, 2022
f84ac3f
Move lux initialization functions in __init__
niclaurenti Dec 13, 2022
73972fa
Add caching mechanism in class Photon
niclaurenti Dec 14, 2022
182fcea
Use lambert grid for integrating the photon msr
niclaurenti Dec 14, 2022
abe5e51
Also add trapezoidal rule to photon msr
niclaurenti Dec 14, 2022
3db6e63
Remove ipdb
niclaurenti Dec 14, 2022
fe6c134
Load precomputed eko instead of computing it
niclaurenti Dec 14, 2022
a3af93e
Use gen_integration_input in msr for photon
niclaurenti Dec 14, 2022
9253857
Add function compute_eko in photon class
niclaurenti Dec 15, 2022
7cb116d
Remove photon_computer and pass Photon to model gen
niclaurenti Dec 15, 2022
f4a674e
Rewrite function alpha_em
niclaurenti Dec 15, 2022
aabc9a1
Copmute photon grid on the output grid
niclaurenti Dec 16, 2022
ba413b3
Clean photon class
niclaurenti Dec 16, 2022
fed3221
Remove line used for debugging
niclaurenti Dec 16, 2022
b616523
Handle different replicas
niclaurenti Dec 16, 2022
36ad12d
Upgrade docstrings in photon class
niclaurenti Dec 16, 2022
59b2aec
Move different replicas inside Photon class
niclaurenti Dec 20, 2022
94acfc8
Clean Photon class
niclaurenti Dec 21, 2022
08255ec
Fix error in alphaem running
niclaurenti Jan 9, 2023
3641412
Precompute beta(nf) in the constructor
niclaurenti Jan 9, 2023
ee492ba
Rename set_thresholds_a_em -> set_thresholds_alpha_em
niclaurenti Jan 9, 2023
bcf788a
Adding init for photon module
niclaurenti Jan 12, 2023
d75ce5e
Modify convolution between eko and pdf
niclaurenti Jan 12, 2023
ba65557
Init tests for photon module
niclaurenti Jan 12, 2023
1c4f4d5
Add fiatlux to conda-recipe
niclaurenti Jan 13, 2023
a4a1554
Fix previous commit
niclaurenti Jan 13, 2023
a21afe8
Remove fiatlux from pin_run_as_build
niclaurenti Jan 13, 2023
25f99b2
Remove fiatlux from host
niclaurenti Jan 17, 2023
533719e
Remove fiatlux from conda recipe
niclaurenti Jan 17, 2023
1ff8b4c
Revert "Remove fiatlux from conda recipe"
niclaurenti Jan 17, 2023
eaa5ae9
Modify eko.output -> eko.io
niclaurenti Jan 17, 2023
e69dca3
Move import of fiatlux and eko and install fiatlux only for linux
niclaurenti Jan 18, 2023
2bb6263
Fix conda recipe
niclaurenti Jan 18, 2023
d2f7f62
Move exo.interpolation
niclaurenti Jan 18, 2023
62f63d9
Fix typo in xgrid_reshape
niclaurenti Jan 18, 2023
6919be3
Remove comment
niclaurenti Jan 18, 2023
b4efda9
Implement additional errors
niclaurenti Jan 23, 2023
0e7c2a5
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Jan 23, 2023
e6934f2
Upgrade eko to 0.12
niclaurenti Jan 24, 2023
9efaf70
Add tests
niclaurenti Feb 13, 2023
dcbf977
Add test for AddPhoton
niclaurenti Feb 13, 2023
11120e5
Start testing
niclaurenti Feb 14, 2023
92bf8c6
Remove commented line
niclaurenti Feb 15, 2023
37b6553
Generalize function set_thresholds_alpha_em
niclaurenti Feb 15, 2023
8591cf7
Remove parenthesis
niclaurenti Feb 15, 2023
6e17e63
Fix bug in generate_error_matrix
niclaurenti Feb 15, 2023
a8c80e1
add docstrings
niclaurenti Feb 15, 2023
e712984
Fix additional errors
niclaurenti Feb 22, 2023
1f3ec41
Merge branch 'master' into add-photon
niclaurenti Feb 22, 2023
5c61569
Merge branch 'master' into add-photon
niclaurenti Feb 22, 2023
42bc035
Revert "Merge branch 'master' into add-photon"
niclaurenti Feb 23, 2023
cfe7325
Add tests
niclaurenti Feb 27, 2023
fd0daf2
Add test on structurefunctions
niclaurenti Feb 27, 2023
7d92931
Move import fiatlux
niclaurenti Feb 27, 2023
05392d1
Restore RectBivariateSpline and remove interp2d
niclaurenti Feb 28, 2023
6d0bd23
Fix thresholds for photon
niclaurenti Mar 7, 2023
9b83aed
Fix test
niclaurenti Mar 7, 2023
5a22948
Fix test_compute
niclaurenti Mar 7, 2023
76a746c
Added theory 522 to db
niclaurenti Mar 15, 2023
0321635
Remove path_to_F2, L, eko from runcard
niclaurenti Mar 16, 2023
8b5b101
Revert "Revert "Merge branch 'master' into add-photon""
niclaurenti Mar 20, 2023
6780cac
Merge branch 'evolfit_w_eko_0.12' into add-photon
niclaurenti Mar 20, 2023
5366148
Import XGRID from n3fit.io.writer
niclaurenti Mar 20, 2023
92a5117
Fix test_compute
niclaurenti Mar 21, 2023
a2d7c4a
Fix test_structurefunctions.py
niclaurenti Mar 21, 2023
0843efd
Remove imports
niclaurenti Mar 21, 2023
882c980
Merge branch 'master' into add-photon
niclaurenti Mar 21, 2023
1211b60
Copy theory.db from master
niclaurenti Mar 21, 2023
b2ef659
Add theory 522 to theory.db
niclaurenti Mar 21, 2023
2a7bbfc
Update conda-recipe/meta.yaml
Zaharid Mar 22, 2023
49accc7
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Mar 23, 2023
c4b1c54
Merge branch 'master' into add-photon
niclaurenti Mar 23, 2023
5ab37a4
Make sure theory.db is the one from master + 522
niclaurenti Mar 23, 2023
3f2306a
Take meat.yaml from master + fiatlux
niclaurenti Mar 23, 2023
d35c557
Restore top level import of fiatlux
niclaurenti Mar 23, 2023
318e735
Change FxQ -> fxq
niclaurenti Mar 23, 2023
011df81
Use LHAPDFSet in compute
niclaurenti Mar 23, 2023
50cdb52
Fix tests and add docstrings
niclaurenti Mar 24, 2023
5da88a6
Fix tests
niclaurenti Mar 24, 2023
b8a95f6
Fix theory 522 in theory.db
niclaurenti Mar 24, 2023
ccd50de
add seed to random generator in compute
niclaurenti Mar 26, 2023
952156b
add abstract class StructureFunction
niclaurenti Mar 26, 2023
debb852
Fix tests
niclaurenti Mar 26, 2023
bcea688
Fix test_compute.py
niclaurenti Mar 26, 2023
d706cf4
Use different seeds for the different replicas
niclaurenti Mar 27, 2023
d9e3df4
Add qed to evolven3fit_new
niclaurenti Mar 27, 2023
1446965
Fix opcard for exa evolution in evolven3fit_new
niclaurenti Mar 28, 2023
ab9818a
Modify _register_photon
niclaurenti Mar 29, 2023
0baf9b9
Fix apply_pdf
niclaurenti Mar 30, 2023
ad8080a
Add Basic_runcard_qed.yml
niclaurenti Apr 3, 2023
4c709ef
Call black on modified files
niclaurenti Apr 3, 2023
703598b
Update n3fit/src/n3fit/model_gen.py
niclaurenti Apr 3, 2023
e2cc2bc
Fix again _register_photon
niclaurenti Apr 3, 2023
2eff55a
Update n3fit/src/n3fit/model_trainer.py
niclaurenti Apr 3, 2023
2329fe2
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Apr 3, 2023
ba091f6
Update n3fit/src/n3fit/model_trainer.py
niclaurenti Apr 3, 2023
5200393
Update n3fit/src/n3fit/vpinterface.py
niclaurenti Apr 3, 2023
3ffee28
Modify generate_error_matrix
niclaurenti Apr 3, 2023
b76bf28
Add docstrings in set_thresholds_alpha_em
niclaurenti Apr 3, 2023
d1ca414
Revert "Call black on modified files"
niclaurenti Apr 3, 2023
2f91a7b
Add control on number of replicas generated
niclaurenti Apr 3, 2023
42a6ab8
Move previous control in n3fit_exec
niclaurenti Apr 3, 2023
fe47937
Run black on the two files of photon module
niclaurenti Apr 3, 2023
1e53533
Update n3fit/runcards/examples/Basic_runcard_qed.yml
niclaurenti Apr 3, 2023
00dbee5
Update validphys2/src/validphys/tests/photon/test_structurefunctions.py
niclaurenti Apr 3, 2023
714366e
Update validphys2/src/validphys/photon/compute.py
niclaurenti Apr 4, 2023
ecc3cdb
Update validphys2/src/validphys/photon/compute.py
niclaurenti Apr 4, 2023
f1c6a7f
Rerun black
niclaurenti Apr 4, 2023
93e0041
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Apr 4, 2023
86bc19b
Update n3fit/src/n3fit/model_trainer.py
niclaurenti Apr 4, 2023
829f45b
Update n3fit/src/n3fit/scripts/n3fit_exec.py
niclaurenti Apr 4, 2023
05e81ce
Add log.info
niclaurenti Apr 4, 2023
061a59e
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Apr 4, 2023
1adff94
Update validphys2/src/validphys/photon/compute.py
niclaurenti Apr 4, 2023
dd924e4
Update validphys2/src/validphys/photon/compute.py
niclaurenti Apr 4, 2023
dd6e76b
Implement replica id control in n3fit.checks
niclaurenti Apr 4, 2023
cebf65a
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Apr 4, 2023
681a137
Fix check_fiatlux_pdfs_id
niclaurenti Apr 4, 2023
cf778b7
Update n3fit/src/n3fit/checks.py
niclaurenti Apr 4, 2023
f42ae77
Dump fiatlux_runcard in temporary directory
niclaurenti Apr 5, 2023
f0cf02c
Update n3fit/src/n3fit/model_trainer.py
niclaurenti Apr 5, 2023
5ee4f75
Update n3fit/src/n3fit/model_trainer.py
niclaurenti Apr 5, 2023
24c2982
Use temporary file
niclaurenti Apr 5, 2023
132f842
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Apr 5, 2023
e55a1ee
Update n3fit/src/n3fit/model_gen.py
niclaurenti Apr 5, 2023
2714164
Update validphys2/src/validphys/tests/photon/test_compute.py
niclaurenti Apr 5, 2023
b8cf0ad
Update n3fit/src/n3fit/model_gen.py
niclaurenti Apr 5, 2023
9c6b776
Update n3fit/src/n3fit/model_gen.py
niclaurenti Apr 5, 2023
4f2ca5b
Update n3fit/src/n3fit/layers/rotations.py
niclaurenti Apr 5, 2023
457fb36
Update n3fit/src/n3fit/layers/rotations.py
niclaurenti Apr 5, 2023
2b01732
Update n3fit/src/n3fit/layers/msr_normalization.py
niclaurenti Apr 5, 2023
d06513e
Update n3fit/src/n3fit/msr.py
niclaurenti Apr 5, 2023
a5aa945
Update validphys2/src/validphys/tests/photon/test_compute.py
niclaurenti Apr 5, 2023
0b2e2f4
Fix docstring
niclaurenti Apr 5, 2023
1502482
Use abc module in structure_functions
niclaurenti Apr 5, 2023
57aea8d
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Apr 5, 2023
7f12b71
Call black and isort on validphys/tests/photon
niclaurenti Apr 6, 2023
092e2aa
Fix bug in apply_photon
niclaurenti Apr 10, 2023
19f2dee
Remove produce_interpolators from structure functions
niclaurenti Apr 12, 2023
2652406
Update validphys2/src/validphys/photon/structure_functions.py
niclaurenti Apr 12, 2023
6249e29
Update validphys2/src/validphys/photon/structure_functions.py
niclaurenti Apr 12, 2023
3dd163e
Split alphaem running from Photon class
niclaurenti Apr 12, 2023
1e3303b
Add module constants
niclaurenti Apr 13, 2023
6934ba5
Update validphys2/src/validphys/photon/compute.py
niclaurenti Apr 13, 2023
00be444
Rename replicas_id -> replicas
niclaurenti Apr 13, 2023
1e66416
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti Apr 13, 2023
75fa590
Remove comment
niclaurenti Apr 13, 2023
cc74266
add constants
niclaurenti Apr 13, 2023
d3a6921
Use @property decorator for photon class
niclaurenti Apr 13, 2023
8da7059
Rename alpha_em_nlo
niclaurenti Apr 13, 2023
905dc8d
Rename qcd_pdfs -> luxpdfset
niclaurenti Apr 13, 2023
1f8232d
Add reference in generate_errors
niclaurenti Apr 13, 2023
8de6bac
Change Alpha class
niclaurenti Apr 14, 2023
fcb766b
Check if luxset is installed or not
niclaurenti Apr 14, 2023
bbc6d29
Fix bug in photon/compute
niclaurenti Apr 19, 2023
0381481
Remove parse_luxset
niclaurenti Apr 19, 2023
c446156
Fix tests and add basis LUX
niclaurenti May 2, 2023
2e5cf4d
Fix test_layers.py
niclaurenti May 2, 2023
3fda192
Parse luxset
niclaurenti May 4, 2023
4b2ea77
Fix test_compute
niclaurenti May 4, 2023
c25c51d
Parse additional_errors
niclaurenti May 5, 2023
9fae2ee
Change calling of alphaem running
niclaurenti May 5, 2023
eeb0683
Fix dumping of fiatlux runcard
niclaurenti May 5, 2023
1e4f609
Fix key in test
niclaurenti May 5, 2023
d10dc73
Fix theory 523 in theory.db
niclaurenti May 5, 2023
f987049
Update validphys2/src/validphys/pdfbases.py
niclaurenti May 10, 2023
217c598
Add empty line to runcard qed
niclaurenti May 10, 2023
106572c
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti May 10, 2023
54b365c
Fix some stuff
niclaurenti May 16, 2023
23c3600
Update n3fit/src/n3fit/checks.py
niclaurenti May 16, 2023
f1a2ce1
Do not remove folder for id>max_id
niclaurenti May 16, 2023
6812d2d
Fix string in check_fiatlux_pdfs_id
niclaurenti May 16, 2023
a1d129e
Fix else : -> else:
niclaurenti May 16, 2023
a40474a
Update n3fit/src/n3fit/layers/rotations.py
niclaurenti May 16, 2023
53e3fb0
Update n3fit/src/n3fit/model_trainer.py
niclaurenti May 16, 2023
38efd5e
Update n3fit/src/n3fit/performfit.py
niclaurenti May 16, 2023
4e32500
Restructure for loop in compute
niclaurenti May 16, 2023
74e85f0
Change constants.NC -> NC etc
niclaurenti May 16, 2023
5d9b9e8
CAll black and isort on the last commit
niclaurenti May 16, 2023
19c188b
Update n3fit/src/evolven3fit_new/evolve.py
niclaurenti May 17, 2023
3c56b7b
Add docstring to parse_additional_errors
niclaurenti May 17, 2023
3eafc70
Read q2_max from fktables without hardcoding it
niclaurenti May 17, 2023
c4984dc
Add qed runcard documentation
niclaurenti May 17, 2023
fbfd771
Call balck and isort to all changed files
niclaurenti May 17, 2023
09059e6
Revert "Call balck and isort to all changed files"
niclaurenti May 17, 2023
9e9be87
Add references to qed doc
niclaurenti May 17, 2023
9f0ff63
Merge branch 'master' into add-photon
niclaurenti May 17, 2023
ea97997
Move documentation in tutorials
niclaurenti May 17, 2023
3e54287
Run black and isort with pyproject.toml
niclaurenti May 17, 2023
f6f211e
Add run-qed-fit.rst
niclaurenti May 17, 2023
ffce850
Update n3fit/src/n3fit/scripts/n3fit_exec.py
niclaurenti May 17, 2023
e778bd6
Fix tests
niclaurenti May 17, 2023
af6dc83
Merge branch 'add-photon' of github.com:NNPDF/nnpdf into add-photon
niclaurenti May 17, 2023
0ba508c
Fix evolven3fit_new bug
niclaurenti May 18, 2023
c092d25
Update doc/sphinx/source/tutorials/run-qed-fit.rst
niclaurenti May 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ requirements:
- sphinxcontrib-bibtex
- curio >=1.0
- pineappl >=0.5.8
- eko >=0.12.0
- eko >=0.12.2
- banana-hep >=0.6.8

- fiatlux

test:
requires:
Expand Down
3 changes: 2 additions & 1 deletion doc/sphinx/source/n3fit/runcard_detailed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,5 @@ It is however possible to disable them by setting to false the ``sum_rules`` fla


It is also possible to impose just the valence or the momentum sum rules by using the
``VSR`` or ``MSR`` flags, respectively (``True`` is equal to ``All``).
``VSR`` or ``MSR`` flags, respectively (``True`` is equal to ``All``).

29 changes: 29 additions & 0 deletions doc/sphinx/source/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,32 @@ @article{Carrazza:2016htc
pages = "205",
year = "2016"
}

@article{Manohar:2017eqh,
author = "Manohar, Aneesh V. and Nason, Paolo and Salam, Gavin P. and Zanderighi, Giulia",
title = "{The Photon Content of the Proton}",
eprint = "1708.01256",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
reportNumber = "CERN-TH-2017-141",
doi = "10.1007/JHEP12(2017)046",
journal = "JHEP",
volume = "12",
pages = "046",
year = "2017"
}

@article{Manohar:2016nzj,
author = "Manohar, Aneesh and Nason, Paolo and Salam, Gavin P. and Zanderighi, Giulia",
title = "{How bright is the proton? A precise determination of the photon parton distribution function}",
eprint = "1607.04266",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
reportNumber = "CERN-TH-2016-155",
doi = "10.1103/PhysRevLett.117.242002",
journal = "Phys. Rev. Lett.",
volume = "117",
number = "24",
pages = "242002",
year = "2016"
}
5 changes: 5 additions & 0 deletions doc/sphinx/source/tutorials/run-fit.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,8 @@ Iterate the fit

It may be desirable to iterate a fit to achieve a higher degree of convergence/stability in the fit.
To read more about this, see [How to run an iterated fit](run-iterated-fit).

QED fit
-------

In order to run a QED fit see [How to run a QED fit](run-qed-fit)
Comment thread
niclaurenti marked this conversation as resolved.
30 changes: 30 additions & 0 deletions doc/sphinx/source/tutorials/run-qed-fit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. _run-qed-fit:

==========================
How to run a QED fit
==========================

It is possible to perform a QED fit adding the key `fiatlux` to the runcard. In this way
a photon PDF will be generated using the `FiatLux` public library that implements the `LuxQED`
(see :cite:p:`Manohar:2016nzj` and :cite:p:`Manohar:2017eqh`) approach.
The parameters to be added are the following:

.. code-block:: yaml

fiatlux:
luxset: NNPDF40_nnlo_as_01180
additional_errors: true
luxseed: 1234567890

`luxset` is the PDF set used to generate the photon PDF with `FiatLux <https://github.com/scarrazza/fiatlux/>`.
The code will generate as many photon replicas as the number of replicas contained in the `luxset`. Therefore, if the user
tries to generate a replica with ID higher than the maximum ID of the `luxset`, the code will
raise an error. Moreover, being the `LuxQED` approach an iterated prcedure, and given that some replicas
do not pass the `postfit` selection criteria, the user should make sure that the number of replicas in
the `luxset` is high enough such that in the final iteration there will be a number of replicas
higher than the final replicas desired.
`additional_errors` is the parameter that switches on and off the additional errors of the `LuxQED` approach,
while `luxseed` is the seed used to generate such errors.
This errors should be switched on only in the very last iteration of the procedure.

Whenever the photon PDF is generated, it will remain constant during the fit and will enter in the `MSR`.
171 changes: 171 additions & 0 deletions n3fit/runcards/examples/Basic_runcard_qed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#
# Configuration file for n3fit
#
############################################################
description: Basic runcard qed

############################################################
# frac: training fraction
# ewk: apply ewk k-factors
# sys: systematics treatment (see systypes)
dataset_inputs:
# - {dataset: NMCPD_dw_ite, frac: 0.75}
- {dataset: NMC, frac: 0.75}
- {dataset: SLACP_dwsh, frac: 0.75}
# - {dataset: SLACD_dw_ite, frac: 0.75}
# - {dataset: BCDMSP_dwsh, frac: 0.75}
# - {dataset: BCDMSD_dw_ite, frac: 0.75}
# - {dataset: CHORUSNUPb_dw_ite, frac: 0.75}
# - {dataset: CHORUSNBPb_dw_ite, frac: 0.75}
# - {dataset: NTVNUDMNFe_dw_ite, frac: 0.75, cfac: [MAS]}
# - {dataset: NTVNBDMNFe_dw_ite, frac: 0.75, cfac: [MAS]}
# - {dataset: HERACOMBNCEM, frac: 0.75}
# - {dataset: HERACOMBNCEP460, frac: 0.75}
# - {dataset: HERACOMBNCEP575, frac: 0.75}
# - {dataset: HERACOMBNCEP820, frac: 0.75}
# - {dataset: HERACOMBNCEP920, frac: 0.75}
# - {dataset: HERACOMBCCEM, frac: 0.75}
# - {dataset: HERACOMBCCEP, frac: 0.75}
# - {dataset: HERACOMB_SIGMARED_C, frac: 0.75}
# - {dataset: HERACOMB_SIGMARED_B, frac: 0.75}
# - {dataset: DYE886R_dw_ite, frac: 0.75, cfac: [QCD]}
# - {dataset: DYE886P, frac: 0.75, cfac: [QCD]}
# - {dataset: DYE605_dw_ite, frac: 0.75, cfac: [QCD]}
# - {dataset: DYE906R_dw_ite, frac: 0.75, cfac: [ACC, QCD]}
# - {dataset: CDFZRAP_NEW, frac: 0.75, cfac: [QCD]}
# - {dataset: D0ZRAP_40, frac: 0.75, cfac: [QCD]}
# - {dataset: D0WMASY, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASWZRAP36PB, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASZHIGHMASS49FB, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASLOMASSDY11EXT, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASWZRAP11CC, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASWZRAP11CF, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASDY2D8TEV, frac: 0.75, cfac: [QCDEWK]}
# - {dataset: ATLAS_DY_2D_8TEV_LOWMASS, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_WZ_TOT_13TEV, frac: 0.75, cfac: [NRM, QCD]}
# - {dataset: ATLAS_WP_JET_8TEV_PT, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_WM_JET_8TEV_PT, frac: 0.75, cfac: [QCD]}
- {dataset: ATLASZPT8TEVMDIST, frac: 0.75, cfac: [QCD], sys: 10}
# - {dataset: ATLASZPT8TEVYDIST, frac: 0.75, cfac: [QCD], sys: 10}
# - {dataset: ATLASTTBARTOT7TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASTTBARTOT8TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_TTBARTOT_13TEV_FULLLUMI, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_TTB_DIFF_8TEV_LJ_TRAPNORM, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_TTB_DIFF_8TEV_LJ_TTRAPNORM, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_TOPDIFF_DILEPT_8TEV_TTRAPNORM, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_1JET_8TEV_R06_DEC, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_2JET_7TEV_R06, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLASPHT15_SF, frac: 0.75, cfac: [QCD, EWK]}
# - {dataset: ATLAS_SINGLETOP_TCH_R_7TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_SINGLETOP_TCH_R_13TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_SINGLETOP_TCH_DIFF_7TEV_T_RAP_NORM, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_SINGLETOP_TCH_DIFF_7TEV_TBAR_RAP_NORM, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_SINGLETOP_TCH_DIFF_8TEV_T_RAP_NORM, frac: 0.75, cfac: [QCD]}
# - {dataset: ATLAS_SINGLETOP_TCH_DIFF_8TEV_TBAR_RAP_NORM, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSWEASY840PB, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSWMASY47FB, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSDY2D11, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSWMU8TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSZDIFF12, frac: 0.75, cfac: [QCD, NRM], sys: 10}
# - {dataset: CMS_2JET_7TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMS_1JET_8TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSTTBARTOT7TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSTTBARTOT8TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSTTBARTOT13TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSTOPDIFF8TEVTTRAPNORM, frac: 0.75, cfac: [QCD]}
# - {dataset: CMSTTBARTOT5TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMS_TTBAR_2D_DIFF_MTT_TRAP_NORM, frac: 0.75, cfac: [QCD]}
# - {dataset: CMS_TTB_DIFF_13TEV_2016_2L_TRAP, frac: 0.75, cfac: [QCD]}
# - {dataset: CMS_TTB_DIFF_13TEV_2016_LJ_TRAP, frac: 0.75, cfac: [QCD]}
# - {dataset: CMS_SINGLETOP_TCH_TOT_7TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMS_SINGLETOP_TCH_R_8TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: CMS_SINGLETOP_TCH_R_13TEV, frac: 0.75, cfac: [QCD]}
# - {dataset: LHCBZ940PB, frac: 0.75, cfac: [QCD]}
# - {dataset: LHCBZEE2FB_40, frac: 0.75, cfac: [QCD]}
# - {dataset: LHCBWZMU7TEV, frac: 0.75, cfac: [NRM, QCD]}
# - {dataset: LHCBWZMU8TEV, frac: 0.75, cfac: [NRM, QCD]}
# - {dataset: LHCB_Z_13TEV_DIMUON, frac: 0.75, cfac: [QCD]}
# - {dataset: LHCB_Z_13TEV_DIELECTRON, frac: 0.75, cfac: [QCD]}

############################################################
datacuts:
t0pdfset: NNPDF40_nnlo_as_01180 # PDF set to generate t0 covmat
q2min: 3.49 # Q2 minimum
w2min: 12.5 # W2 minimum

############################################################
theory:
theoryid: 522 # database id

############################################################
trvlseed: 1551864071
nnseed: 676150632
mcseed: 619859729
save: false
genrep: true # true = generate MC replicas, false = use real data

parameters: # This defines the parameter dictionary that is passed to the Model Trainer
nodes_per_layer: [25, 20, 8]
activation_per_layer: [tanh, tanh, linear]
initializer: glorot_normal
optimizer:
clipnorm: 6.073e-6
learning_rate: 2.621e-3
optimizer_name: Nadam
epochs: 900
positivity:
initial: 184.8
multiplier:
integrability:
initial: 10
multiplier:
stopping_patience: 0.1
layer_type: dense
dropout: 0.0
threshold_chi2: 3.5

fitting:
fitbasis: EVOL # EVOL (7), EVOLQED (8), etc.
basis:
- {fl: sng, trainable: false, smallx: [1.089, 1.117], largex: [1.462, 3.008]}
- {fl: g, trainable: false, smallx: [0.7542, 1.105], largex: [2.826, 5.407]}
- {fl: v, trainable: false, smallx: [0.4715, 0.7253], largex: [1.564, 3.48]}
- {fl: v3, trainable: false, smallx: [0.1372, 0.4205], largex: [1.755, 3.451]}
- {fl: v8, trainable: false, smallx: [0.5641, 0.7702], largex: [1.513, 3.433]}
- {fl: t3, trainable: false, smallx: [-0.4942, 0.9992], largex: [1.751, 3.383]}
- {fl: t8, trainable: false, smallx: [0.532, 0.8572], largex: [1.541, 3.349]}
- {fl: t15, trainable: false, smallx: [1.052, 1.14], largex: [1.487, 3.09]}

############################################################
positivity:
posdatasets:
- {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier
# - {dataset: POSF2DW, maxlambda: 1e6}
# - {dataset: POSF2S, maxlambda: 1e6}
- {dataset: POSFLL, maxlambda: 1e6}
# - {dataset: POSDYU, maxlambda: 1e10}
# - {dataset: POSDYD, maxlambda: 1e10}
# - {dataset: POSDYS, maxlambda: 1e10}
# - {dataset: POSF2C, maxlambda: 1e6}
# - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs
# - {dataset: POSXUB, maxlambda: 1e6}
# - {dataset: POSXDQ, maxlambda: 1e6}
# - {dataset: POSXDB, maxlambda: 1e6}
# - {dataset: POSXSQ, maxlambda: 1e6}
# - {dataset: POSXSB, maxlambda: 1e6}
# - {dataset: POSXGL, maxlambda: 1e6}

############################################################
integrability:
integdatasets:
# - {dataset: INTEGXT8, maxlambda: 1e2}
- {dataset: INTEGXT3, maxlambda: 1e2}

############################################################
debug: True
maxcores: 8

fiatlux:
luxset: NNPDF40_nnlo_as_01180
additional_errors: true # should be set to true only for the last iteration
luxseed: 1234567890
15 changes: 13 additions & 2 deletions n3fit/src/evolven3fit_new/eko_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@

_logger = logging.getLogger(__name__)

EVOLVEN3FIT_CONFIGS_DEFAULTS = {
EVOLVEN3FIT_CONFIGS_DEFAULTS_TRN = {
"ev_op_iterations": 1,
"ev_op_max_order": (1, 0),
"evolution_method": "truncated",
"inversion_method": "expanded",
"n_integration_cores": 1,
}

EVOLVEN3FIT_CONFIGS_DEFAULTS_EXA = {
"ev_op_iterations": 10,
"ev_op_max_order": (1, 0),
"evolution_method": "iterate-exact",
"inversion_method": "exact",
"n_integration_cores": 1,
}

NFREF_DEFAULT = 5
NF0_DEFAULT = 4

Expand Down Expand Up @@ -68,7 +76,10 @@ def construct_eko_cards(
)
op_card["rotations"]["xgrid"] = x_grid
# Specific defaults for evolven3fit evolution
op_card["configs"].update(EVOLVEN3FIT_CONFIGS_DEFAULTS)
if theory["ModEv"] == "TRN":
op_card["configs"].update(EVOLVEN3FIT_CONFIGS_DEFAULTS_TRN)
if theory["ModEv"] == "EXA":
op_card["configs"].update(EVOLVEN3FIT_CONFIGS_DEFAULTS_EXA)
# User can still change the configs via op_card_dict

# Note that every entry that is not a dictionary should not be
Expand Down
18 changes: 11 additions & 7 deletions n3fit/src/evolven3fit_new/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import eko
from eko import basis_rotation
from eko import runner
from ekobox import genpdf, info_file
from ekomark import apply
from ekobox import genpdf, info_file, apply
from reportengine.compat import yaml
from validphys.loader import Loader

Expand Down Expand Up @@ -69,7 +68,7 @@ def evolve_fit(
stdout_log = logging.StreamHandler(sys.stdout)
for log in [log_file, stdout_log]:
log.setLevel(LOGGING_SETTINGS["level"])
log.setFormatter(logging.Formatter(LOGGING_SETTINGS["formatter"]))
log.setFormatter(LOGGING_SETTINGS["formatter"])
for logger in (_logger, *[logging.getLogger("eko")]):
logger.handlers = []
logger.setLevel(LOGGING_SETTINGS["level"])
Expand All @@ -85,6 +84,7 @@ def evolve_fit(
theory, op = eko_utils.construct_eko_cards(
theoryID, q_fin, q_points, x_grid, op_card_dict, theory_card_dict
)
qed = theory.order[1] > 0
if eko_path is not None:
eko_path = pathlib.Path(eko_path)
_logger.info(f"Loading eko from : {eko_path}")
Expand All @@ -105,10 +105,12 @@ def evolve_fit(
info["XMin"] = float(x_grid[0])
info["XMax"] = float(x_grid[-1])
with eko.EKO.read(eko_path) as eko_op:
info["AlphaS_Qs"] = eko_op.mu2grid.tolist()
if eko.__version__ >= "0.13":
raise ModuleNotFoundError("Please, fix evolven3fit np.sqrt(Q) hack")
info["AlphaS_Qs"] = np.sqrt(info["AlphaS_Qs"]).tolist()
dump_info_file(usr_path, info)
for replica in initial_PDFs_dict.keys():
evolved_block = evolve_exportgrid(initial_PDFs_dict[replica], eko_op, x_grid)
evolved_block = evolve_exportgrid(initial_PDFs_dict[replica], eko_op, x_grid, qed)
dump_evolved_replica(
evolved_block, usr_path, int(replica.removeprefix("replica_"))
)
Expand Down Expand Up @@ -142,7 +144,7 @@ def load_fit(usr_path):
return pdf_dict


def evolve_exportgrid(exportgrid, eko, x_grid):
def evolve_exportgrid(exportgrid, eko, x_grid, qed):
Comment thread
niclaurenti marked this conversation as resolved.
"""
Evolves the provided exportgrid for the desired replica with the eko and returns the evolved block

Expand All @@ -154,6 +156,8 @@ def evolve_exportgrid(exportgrid, eko, x_grid):
eko operator for evolution
xgrid: list
xgrid to be used as the targetgrid
qed: bool
whether qed is activated or not
Returns
-------
: np.array
Expand All @@ -163,7 +167,7 @@ def evolve_exportgrid(exportgrid, eko, x_grid):
pdf_grid = np.array(exportgrid["pdfgrid"]).transpose()
pdf_to_evolve = utils.LhapdfLike(pdf_grid, exportgrid["q20"], x_grid)
# evolve pdf
evolved_pdf = apply.apply_pdf(eko, pdf_to_evolve)
evolved_pdf = apply.apply_pdf(eko, pdf_to_evolve, qed=qed)
# generate block to dump
targetgrid = eko.rotations.targetgrid.tolist()

Expand Down
Loading