Skip to content

Commit

Permalink
More scans and more prints
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryDayHall committed Nov 7, 2023
1 parent eb6a1d5 commit 31defbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jet_tools/CompareClusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,12 +1682,15 @@ def project_2d(show_params, best_slice, all_cols, variable_cols, score_cols,
mult_col = "AveSeperateJets"
# if we are taking the best slice remove all other table rows
if best_slice:
print(f"Value of best_slice={best_slice}")
bg_values = table[bg_col].values
sg_values = table[sg_col].values
combined = np.sqrt(0.53 * np.square(bg_values) + np.square(sg_values))
if isinstance(best_slice, bool):
print("Using the best slice as per the combined score")
best_idx = np.nanargmin(combined.tolist())
elif isinstance(best_slice, dict):
print("Using a set of hyperparameters as a best slice")
# then it is the values of the best slice
mask = filter_matching(all_cols, table, approx=best_slice)
possible = mask.index[mask].tolist()
Expand All @@ -1698,6 +1701,7 @@ def project_2d(show_params, best_slice, all_cols, variable_cols, score_cols,
distances += abs(table.loc[i, v] - best_slice[v])
best_idx = possible[np.argmin(distances)]
elif isinstance(best_slice, int):
print(f"Using index {best_slice} as the best slice")
best_idx = best_slice
else:
raise NotImplementedError
Expand Down
7 changes: 6 additions & 1 deletion jet_tools/ParallelFormJets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,8 @@ def run_list(eventWise_path, end_time, class_list, param_list, name_list):
'WeightExponent': 1.}

fix_CALEv2_3 = {'SeedGenerator': 'PtCenter',
'SeedIncrement': 3}
'SeedIncrement': 3,
'ToAffinity': 'exp'}

fix_CALEv2_4 = {'SeedGenerator': 'PtCenter',
'SeedIncrement': 3,
Expand All @@ -1241,6 +1242,10 @@ def run_list(eventWise_path, end_time, class_list, param_list, name_list):
'Cutoff': [0.02, 0.04, 0.06, 0.08, 0.1],
'WeightExponent': [0., 1.]}

scan_CALEv2_7 = {'Sigma': [0.2, 0.3, 0.4, 0.5],
'Cutoff': [0.0005, 0.001, 0.005, 0.01, 0.015],
'WeightExponent': [0., 1.]}

def tabulate_fragments(eventWise_paths):
""" Makes the assumption that jets with the same name are the same jet"""
if isinstance(eventWise_paths, Components.EventWise):
Expand Down

0 comments on commit 31defbc

Please sign in to comment.