Skip to content

Commit 32314ea

Browse files
committed
Jets with single parameters
1 parent 7641576 commit 32314ea

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

validphys2/src/validphys/theorycovariance/higher_twist_functions.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ def jets_pc_func(
246246
return PC
247247

248248

249+
def jet_single_par(delta_h: float, pT: npt.ArrayLike, rap: npt.ArrayLike) -> npt.ArrayLike:
250+
ret = [delta_h for _ in range(rap.size)]
251+
return np.array(ret) / pT
252+
253+
249254
def JET_pc(dataset_sp, pdf, pc_nodes, pT, rap, pc_func_type: str = "step"):
250255
"""
251256
Returns the function that computes the shift for the ratio for single
@@ -271,6 +276,26 @@ def func(y_values):
271276
return func
272277

273278

279+
def JET_pc_single_par(dataset_sp, pdf, pc_nodes, pT, rap, pc_func_type: str = "step"):
280+
"""
281+
As JET_pc, but with one single shift for all rapidity bins.
282+
283+
This function is meant to be for development purposes only. It will either substitute
284+
JET_pc or be deleted in the future."""
285+
cuts = dataset_sp.cuts
286+
(fkspec,) = dataset_sp.fkspecs
287+
fk = fkspec.load_with_cuts(cuts)
288+
xsec = central_fk_predictions(fk, pdf)
289+
290+
def func(y_values):
291+
assert y_values.size == 1
292+
ret = [y_values[0] for _ in range(rap.size)]
293+
ret = np.array(ret) / pT
294+
return np.multiply(ret, xsec.to_numpy()[:, 0])
295+
296+
return func
297+
298+
274299
# TODO Maybe we want to treat the function that parametrizes the PC
275300
# as argument?
276301
def DIS_F2_pc(pc2_nodes, x, q2, pc_func_type: str = "step"):
@@ -1046,7 +1071,7 @@ def average(y_values_pc2_p, y_values_pcL_p, y_values_pc3_p):
10461071
eta = dataset_sp.commondata.metadata.load_kinematics()['y'].to_numpy().reshape(-1)[cuts]
10471072
pT = dataset_sp.commondata.metadata.load_kinematics()['pT'].to_numpy().reshape(-1)[cuts]
10481073

1049-
pc_func = JET_pc(dataset_sp, pdf, pc_jet_nodes, pT, eta, pc_func_type)
1074+
pc_func = JET_pc_single_par(dataset_sp, pdf, pc_jet_nodes, pT, eta, pc_func_type)
10501075
for pars_pc in pars_combs:
10511076
deltas[pars_pc['label']] = pc_func(pars_pc['comb']['Hj'])
10521077

@@ -1064,7 +1089,7 @@ def average(y_values_pc2_p, y_values_pcL_p, y_values_pc3_p):
10641089
.to_numpy()
10651090
.reshape(-1)[cuts]
10661091
)
1067-
pc_func = JET_pc(dataset_sp, pdf, pc_jet_nodes, m_jj, eta_star, pc_func_type)
1092+
pc_func = JET_pc_single_par(dataset_sp, pdf, pc_jet_nodes, m_jj, eta_star, pc_func_type)
10681093
for pars_pc in pars_combs:
10691094
deltas[pars_pc['label']] = pc_func(pars_pc['comb']['H2j_ATLAS'])
10701095

@@ -1080,7 +1105,7 @@ def average(y_values_pc2_p, y_values_pcL_p, y_values_pc3_p):
10801105
.to_numpy()
10811106
.reshape(-1)[cuts]
10821107
)
1083-
pc_func = JET_pc(dataset_sp, pdf, pc_jet_nodes, m_jj, eta_diff, pc_func_type)
1108+
pc_func = JET_pc_single_par(dataset_sp, pdf, pc_jet_nodes, m_jj, eta_diff, pc_func_type)
10841109
for pars_pc in pars_combs:
10851110
deltas[pars_pc['label']] = pc_func(pars_pc['comb']['H2j_CMS'])
10861111

0 commit comments

Comments
 (0)