Skip to content

Commit

Permalink
Change artificial uncertainties from MUL to ADD
Browse files Browse the repository at this point in the history
  • Loading branch information
achiefa committed Dec 13, 2024
1 parent 5f47df3 commit 5bc8d02
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 34 deletions.
10 changes: 6 additions & 4 deletions nnpdf_data/nnpdf_data/commondata/CMS_WCHARM_7TEV/filter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __build_unc_definitions(self, variant='default'):
for idx in range(self.ndata):
unc_definitions[f'{ART_LABEL}_{idx+1}'] = {
'description': f'Correlated systematic uncertainty {idx+1}',
'treatment': 'MULT',
'treatment': 'ADD',
'type': 'CORR',
}

Expand All @@ -205,15 +205,15 @@ def __build_unc_definitions(self, variant='default'):

return unc_definitions

def generate_covmat(self, diag_stat_uncs=None):
def generate_covmat(self, diag_uncs=None):
table = self.metadata["tables"][1]
tab_dict = self.__retrieve_table(table)
matlist = tab_dict['dependent_variables'][0]['values']
matlist = [d['value'] for d in matlist]
covmat = np.zeros((self.ndata, self.ndata))
for i in range(self.ndata):
for j in range(self.ndata):
covmat[i, j] = matlist[i + self.ndata * j] * diag_stat_uncs[i] * diag_stat_uncs[j]
covmat[i, j] = matlist[i + self.ndata * j] * diag_uncs[i] * diag_uncs[j]
return covmat

def generate_data(self, variant='default', save_to_yaml=False, path='./'):
Expand All @@ -226,7 +226,7 @@ def generate_data(self, variant='default', save_to_yaml=False, path='./'):
sys_artificial = [] # Initialize vector of artificial uncertainties

if self.observable == 'WPWM-TOT':
covmat = self.generate_covmat(stat_unc)
covmat = self.generate_covmat(sys_unc)
eigvals, eigvecs = np.linalg.eig(covmat)
art_unc = np.sqrt(eigvals) * eigvecs

Expand All @@ -242,6 +242,8 @@ def generate_data(self, variant='default', save_to_yaml=False, path='./'):
for data_idx, data in enumerate(central_data):
# Statistical uncertainty
unc_dict = {STAT_LABEL: stat_unc[data_idx]}

# Systematic uncertainty
unc_dict[f'{ART_LABEL}'] = sys_unc[data_idx]
sys_artificial.append(unc_dict)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,52 @@ definitions:
type: UNCORR
art_corr_1:
description: Correlated systematic uncertainty 1
treatment: MULT
treatment: ADD
type: CORR
art_corr_2:
description: Correlated systematic uncertainty 2
treatment: MULT
treatment: ADD
type: CORR
art_corr_3:
description: Correlated systematic uncertainty 3
treatment: MULT
treatment: ADD
type: CORR
art_corr_4:
description: Correlated systematic uncertainty 4
treatment: MULT
treatment: ADD
type: CORR
art_corr_5:
description: Correlated systematic uncertainty 5
treatment: MULT
treatment: ADD
type: CORR
bins:
- stat_uncorr: 2700.0
art_corr_1: -2.50638824e+03
art_corr_2: -7.95697332e+02
art_corr_3: 5.18818026e+02
art_corr_4: 3.24524090e+02
art_corr_5: 1.98921572e+01
art_corr_1: -4.30085960e+03
art_corr_2: 1.48958525e+02
art_corr_3: -1.49014534e+03
art_corr_4: -3.33760715e+02
art_corr_5: 5.55417584e+02
- stat_uncorr: 2500.0
art_corr_1: -2.26430174e+03
art_corr_2: 9.54417285e+02
art_corr_3: 3.80750387e+02
art_corr_4: 2.58001370e+02
art_corr_5: 2.21295434e+01
art_corr_1: -3.61128670e+03
art_corr_2: 1.46245103e+02
art_corr_3: 1.37172210e+03
art_corr_4: -3.95171209e+02
art_corr_5: 9.48387525e+02
- stat_uncorr: 2400.0
art_corr_1: -2.16891682e+03
art_corr_2: -4.98172990e+01
art_corr_3: -9.87453634e+02
art_corr_4: 2.78677305e+02
art_corr_5: 2.43385786e+01
art_corr_1: -3.42032648e+03
art_corr_2: 1.58201894e+02
art_corr_3: 2.94011007e+02
art_corr_4: -5.54441014e+02
art_corr_5: -1.52397231e+03
- stat_uncorr: 1900.0
art_corr_1: -1.64250437e+03
art_corr_2: -1.68762567e+01
art_corr_3: -1.03617739e+01
art_corr_4: -6.53762602e+02
art_corr_5: -6.95975341e+02
art_corr_1: -2.77487954e+03
art_corr_2: 3.53874801e+02
art_corr_3: 1.26728625e+02
art_corr_4: 1.53882437e+03
art_corr_5: -1.75429767e+02
- stat_uncorr: 1700.0
art_corr_1: -1.39269626e+03
art_corr_2: -2.22542263e+01
art_corr_3: -2.70634325e+00
art_corr_4: -6.66474311e+02
art_corr_5: 7.11130479e+02
art_corr_1: -1.94086828e+03
art_corr_2: -1.38692811e+03
art_corr_3: 5.04690564e+01
art_corr_4: 2.51872601e+02
art_corr_5: -5.89390783e+01

0 comments on commit 5bc8d02

Please sign in to comment.