Skip to content

Commit

Permalink
zdc_sigma: ignore failed fit (flaky)
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Jan 16, 2025
1 parent a713d31 commit a457afa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions benchmarks/zdc_sigma/analysis/sigma_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,13 @@ def gauss(x, A,mu, sigma):
slc=abs(bc)<0.6
fnc=gauss
p0=[100, 0, 0.5]
coeff, var_matrix = curve_fit(fnc, bc[slc], y[slc], p0=p0,
sigma=np.sqrt(y[slc])+(y[slc]==0), maxfev=10000)
x=np.linspace(-1, 1)
plt.plot(x, gauss(x, *coeff), color='tab:orange')
try:
coeff, var_matrix = curve_fit(fnc, bc[slc], y[slc], p0=p0,
sigma=np.sqrt(y[slc])+(y[slc]==0), maxfev=10000)
x=np.linspace(-1, 1)
plt.plot(x, gauss(x, *coeff), color='tab:orange')
except RuntimeError:
print("fit failed")
plt.xlabel("$\\theta^{*\\rm recon}_{\\Sigma}-\\theta^{*\\rm truth}_{\\Sigma}$ [mrad]")
plt.ylabel("events")

Expand Down

0 comments on commit a457afa

Please sign in to comment.