Skip to content

Commit 1fba4b5

Browse files
committed
Added try except to multitrial script
1 parent 97dfa80 commit 1fba4b5

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

PWGHF/D2H/Macros/multitrial.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,17 @@ def main():
166166
plot_pt_string = f"${pt_bin_min} < p_\\mathrm{{T}}/(\\mathrm{{GeV}}/c) < {pt_bin_max}$"
167167
pt_string = f"{pt_bin_min}_{pt_bin_max}"
168168

169-
central_trial_ind = trials[pt_string].index(cfg["central_trial"])
170-
central_yield = yields[pt_string][central_trial_ind]
171-
172-
plot_yields_trials(yields[pt_string], yields_err[pt_string], trials[pt_string], cfg,
173-
pt_string, plot_pt_string, central_trial_ind, central_yield)
174-
plot_yields_distr(yields[pt_string], cfg, pt_string, plot_pt_string,
175-
central_trial_ind, central_yield)
176-
plot_chis(chis[pt_string], cfg, pt_string, plot_pt_string)
169+
try:
170+
central_trial_ind = trials[pt_string].index(cfg["central_trial"])
171+
central_yield = yields[pt_string][central_trial_ind]
172+
173+
plot_yields_trials(yields[pt_string], yields_err[pt_string], trials[pt_string], cfg,
174+
pt_string, plot_pt_string, central_trial_ind, central_yield)
175+
plot_yields_distr(yields[pt_string], cfg, pt_string, plot_pt_string,
176+
central_trial_ind, central_yield)
177+
plot_chis(chis[pt_string], cfg, pt_string, plot_pt_string)
178+
except:
179+
pass
177180

178181
with open(f'{cfg["outdir"]}/{cfg["outfile"]}_trials_{pt_string}.txt',
179182
"w", encoding="utf-8") as ftext:

0 commit comments

Comments
 (0)