Skip to content

Commit

Permalink
insert_neutron: ignore failed fit (flaky) (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl authored Jan 10, 2025
1 parent 6de018e commit d87ae97
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions benchmarks/insert_neutron/analysis/neutron_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ def gauss(x, A,mu, sigma):
fnc=gauss
sigma=np.sqrt(y[slc])+(y[slc]==0)
p0=(100, 0, 5)
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
xx=np.linspace(-5,5,100)
plt.plot(xx,fnc(xx,*coeff))
# except:
# pass
try:
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
xx=np.linspace(-5,5,100)
plt.plot(xx,fnc(xx,*coeff))
except RuntimeError:
print("fit failed")
plt.xlabel("$\\theta_{rec}-\\theta_{truth}$ [mrad]")
plt.ylabel("events")
plt.title(f"$p={p}$ GeV, ${eta_min}<\\eta<{eta_max}$")
Expand Down

0 comments on commit d87ae97

Please sign in to comment.