Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# To ignore
*.*~
**/*.*~
git_push.sh
git_push.sh
__pycache__
outputs/
tmp_lhapdf
16 changes: 10 additions & 6 deletions README
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
Readme (under construction) for fixpar_nnpdf code

Requires NNPDF code from https://docs.nnpdf.science via conda installation. Tested for:
Requires NNPDF code from https://docs.nnpdf.science either from source or conda

conda install nnpdf python=3.9

(I think python version may be needed for lhapdf to run though need to double check that)
```
conda install nnpdf -c https://packages.nnpdf.science/conda -c conda-forge
```

To run simply execute:

python fixpar_nnpdf.py --config=configs/**.yaml

for the corresponding .yaml file. Some explanation of the various flags is provided in the example .yaml files but clearly this needs better documentation + some specific example cases to be provided.
for the corresponding .yaml file. Some explanation of the various flags is provided in the example .yaml files but clearly this needs better documentation + some specific example cases to be provided. Adding to this, to run:

- A fixed chi^2 output. Set fixpar to False.
- A fit. Set fixpar to True. The second column of 0/1's in the input file (in input/) specify whether a given parmeter is free (1) or fixed (0). If all are fixed this will be as if fixpar is set to True. The parameters for the best fit will be output to outputs/pars/$label.dat and the covariance matrix to outputs/cov/$label.dat.
- An eigenvector scan. Set readcov to True, with the 'cov input file' given by the output of a previous fit. Then specify if dynamic tolerance is used (dynamic_tol) and if not the size of the fixed tolerance (t2_err).

The outputs are in the outputs/ folder:

/evgrids : the output pdf grids which can then be evolved using the NNPDF evolution (to be tided/documented)
/buffer : outputs from running code
/cov : covariance matrix (used for error calculation)
/evscans: outputs if eigenvector scan is done
/pars : the PDF parameters
/pars : the PDF parameters
68 changes: 68 additions & 0 deletions configs/fit_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# input files
inputs:
# PDF parameter inputs:
input file: inputdef_2parfree.dat
# input covariance matrix file (if used)
cov input file: newmin_final_remin_out.dat
# if true then read in covariance matrix and evaluate PDF errors
readcov: False

# output files
outputs:
# label for output files
label: fitout_jcm

basis pars:
# If true then two term gluon parameterisation uesd
g_second_term: True
# if true and g_second_term=False then includes 7th Chebyshev for gluon
g_cheb7: False
# If true then delta_S+ set to that of sea
asp_fix: True
# If true thedelta_d=delta_u for d_V and u_V (need to set delta_d fixed or will crash!)
dvd_eq_uvd: False

pdf pars:
# use external LHAPDF grid as input
lhin: False
# if true then use lhapdf grids for theory evaluation
# (for PDF pd fits can use parameterisation directly instead, otherwise has to be true)
uselha: True
# if lhin=true, name of set input
PDFlabel_lhin: NNPDF40_nnlo_pch_as_01180

pdf closure:
# if true then scatters when doing direct PDF pd fit
pdfscat: False
# label of pseudodata used
pdlabel: 'NNPDF40pch_gl_l0'
# if true then do direct fit to PDF pseudodata
pdpdf: False

pseudodata flags:
# if true then write pseudodata out to file
pdout: False
# if true then write pseudodata out to file
pdin: False

fit pars:
# Only use t0 for chi2i and chi2o in levmar (i.e. no derivative at all)
t0_noderivin: True
# run with fixed input parameters (override input card flags)
fixpar: False
# NNPDF theory id (211 = NNLO pch)
theoryidi: 40001000
# impose NNPDF positivity in fit
nnpdf_pos: False
# if true then impose 4.0 positivity constraint, if pos_const=True
pos_40: True
# if true impose weight to prefer delta_d > 0.25
deld_const: False
# if true then generates a replica from baseline dataset with seed irep
pseud: False
# irep number - also used when generating error grids
irep: 0
# NMC PD data - set covariance matrix to be diagonal
nmcpd_diag: False
# dataset flag - global, HERAonly, noHERA, noLHC
dset_type: 'global_new'
72 changes: 72 additions & 0 deletions configs/fit_mshtfit_publication_longmin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# input files
inputs:
# PDF parameter inputs:
input file: input_mshtfit_publication_longmin.dat
# input covariance matrix file (if used)
cov input file: newmin_final_remin_out.dat
# if true then read in covariance matrix and evaluate PDF errors
readcov: False

# output files
outputs:
# label for output files
label: mshtfit_publication_longmin_out

basis pars:
# If true then two term gluon parameterisation uesd
g_second_term: True
# if true and g_second_term=False then includes 7th Chebyshev for gluon
g_cheb7: False
# If true then delta_S+ set to that of sea
asp_fix: True
# If true thedelta_d=delta_u for d_V and u_V (need to set delta_d fixed or will crash!)
dvd_eq_uvd: False

pdf pars:
# use external LHAPDF grid as input
lhin: False
# if true then use lhapdf grids for theory evaluation
# (for PDF pd fits can use parameterisation directly instead, otherwise has to be true)
uselha: True
# if lhin=true, name of set input
PDFlabel_lhin: NNPDF40_nnlo_pch_as_01180

pdf closure:
# if true then scatters when doing direct PDF pd fit
pdfscat: False
# label of pseudodata used
pdlabel: 'NNPDF40pch_gl_l0'
# if true then do direct fit to PDF pseudodata
pdpdf: False

pseudodata flags:
# if true then write pseudodata out to file
pdout: False
# if true then write pseudodata out to file
pdin: False

fit pars:
# Use dynamic tolerance in error calc
dynamic_tol: False
# T value for error calculation
t2_err: 1.
# Only use t0 for chi2i and chi2o in levmar (i.e. no derivative at all)
t0_noderivin: True
# run with fixed input parameters (override input card flags)
fixpar: False
# NNPDF theory id (211 = NNLO pch)
theoryidi: 40001000
# impose NNPDF positivity in fit
nnpdf_pos: False
# if true then impose 4.0 positivity constraint, if pos_const=True
pos_40: True
# if true impose weight to prefer delta_d > 0.25
deld_const: False
# if true then generates a replica from baseline dataset with seed irep
pseud: False
# irep number - also used when generating error grids
irep: 0
# NMC PD data - set covariance matrix to be diagonal
nmcpd_diag: False
# dataset flag - global, HERAonly, noHERA, noLHC
dset_type: 'global_new'
72 changes: 72 additions & 0 deletions configs/fit_mshtfit_publication_shortmin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# input files
inputs:
# PDF parameter inputs:
input file: input_mshtfit_publication_shortmin.dat
# input covariance matrix file (if used)
cov input file: newmin_final_remin_out.dat
# if true then read in covariance matrix and evaluate PDF errors
readcov: False

# output files
outputs:
# label for output files
label: mshtfit_publication_shortmin_out

basis pars:
# If true then two term gluon parameterisation uesd
g_second_term: True
# if true and g_second_term=False then includes 7th Chebyshev for gluon
g_cheb7: False
# If true then delta_S+ set to that of sea
asp_fix: True
# If true thedelta_d=delta_u for d_V and u_V (need to set delta_d fixed or will crash!)
dvd_eq_uvd: False

pdf pars:
# use external LHAPDF grid as input
lhin: False
# if true then use lhapdf grids for theory evaluation
# (for PDF pd fits can use parameterisation directly instead, otherwise has to be true)
uselha: True
# if lhin=true, name of set input
PDFlabel_lhin: NNPDF40_nnlo_pch_as_01180

pdf closure:
# if true then scatters when doing direct PDF pd fit
pdfscat: False
# label of pseudodata used
pdlabel: 'NNPDF40pch_gl_l0'
# if true then do direct fit to PDF pseudodata
pdpdf: False

pseudodata flags:
# if true then write pseudodata out to file
pdout: False
# if true then write pseudodata out to file
pdin: False

fit pars:
# Use dynamic tolerance in error calc
dynamic_tol: False
# T value for error calculation
t2_err: 1.
# Only use t0 for chi2i and chi2o in levmar (i.e. no derivative at all)
t0_noderivin: True
# run with fixed input parameters (override input card flags)
fixpar: False
# NNPDF theory id (211 = NNLO pch)
theoryidi: 40001000
# impose NNPDF positivity in fit
nnpdf_pos: False
# if true then impose 4.0 positivity constraint, if pos_const=True
pos_40: True
# if true impose weight to prefer delta_d > 0.25
deld_const: False
# if true then generates a replica from baseline dataset with seed irep
pseud: False
# irep number - also used when generating error grids
irep: 0
# NMC PD data - set covariance matrix to be diagonal
nmcpd_diag: False
# dataset flag - global, HERAonly, noHERA, noLHC
dset_type: 'global_new'
Loading