Skip to content

Commit

Permalink
allow to pass point_prescription instead of jus tpoint_prescriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyStegeman committed Oct 31, 2024
1 parent 55902b7 commit ca257c1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion n3fit/runcards/examples/nnpdfpol20_dis_nlo_mhou.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ theory:
theoryid: 41_100_010

theorycovmatconfig:
point_prescription: '7 point'
point_prescriptions: ['7 point']
pdf: NNPDFpol11_100
unpolarized_bc: NNPDF40_nlo_pch_as_01180
use_thcovmat_in_fitting: true
Expand Down
2 changes: 1 addition & 1 deletion validphys2/examples/data_theory_comparison_w_sv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ meta:
use_cuts: "internal"

theoryid: 717 # define the central theory
point_prescription: "3 point"
point_prescriptions: "3 point"
use_theorycovmat: true

use_pdferr: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default_theory:
- theoryid: 163

theoryid: 163
point_prescription: '3 point'
point_prescriptions: '3 point'



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default_theory:
- theoryid: 163

theoryid: 163
point_prescription: '9 point'
point_prescriptions: '9 point'


dataspecs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ theoryconfig: # For generating theory covariance matrix
theoryid: 163


point_prescription: '3 point'
point_prescriptions: ['3 point']

use_cuts: fromfit
fit: 190315_ern_nlo_central_163_global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ theoryconfig: # For generating theory covariance matrix

theoryid: 163

point_prescription: '9 point'
point_prescriptions: ['9 point']

use_cuts: fromfit
fit: 190315_ern_nlo_central_163_global
Expand Down
17 changes: 14 additions & 3 deletions validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,17 @@ def parse_point_prescriptions(self, point_prescriptions):
return NSList(point_prescriptions, nskey="point_prescription")

def produce_inclusive_use_scalevar_uncertainties(
self, use_scalevar_uncertainties: bool = False, point_prescriptions: (str, None) = None
self,
use_scalevar_uncertainties: bool = False,
point_prescriptions: (list, None) = None,
point_prescription: (str, None) = None,
):
"""Whether to use a scale variation uncertainty theory covmat.
Checks whether a point prescription is included in the runcard and if so
assumes scale uncertainties are to be used."""
if (not use_scalevar_uncertainties) and (point_prescriptions is not None):
if (not use_scalevar_uncertainties) and (
point_prescriptions is not None or point_prescription is not None
):
use_scalevar_uncertainties = True
return use_scalevar_uncertainties

Expand Down Expand Up @@ -1631,7 +1636,9 @@ def produce_group_dataset_inputs_by_experiment(self, data_input):
def produce_group_dataset_inputs_by_process(self, data_input):
return self.produce_group_dataset_inputs_by_metadata(data_input, "nnpdf31_process")

def produce_point_prescriptions_theoryids(self, theoryid, point_prescriptions):
def produce_point_prescriptions_theoryids(
self, theoryid, point_prescription, point_prescriptions=None
):
"""Produces a list of theoryids given a theoryid at central scales and a point
prescription. The options for the latter are '3 point', '5 point', '5bar point', '7 point'
and '9 point'. Note that these are defined in arXiv:1906.10698. This hard codes the
Expand All @@ -1657,6 +1664,10 @@ def produce_point_prescriptions_theoryids(self, theoryid, point_prescriptions):
)

pp_thids = {}

if point_prescriptions == None:
point_prescriptions = [point_prescription]

for pp in point_prescriptions:
try:
scales = pp_scales_dict[pp]
Expand Down

0 comments on commit ca257c1

Please sign in to comment.