Skip to content
Snippets Groups Projects
Unverified Commit d87ae97d authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by GitHub
Browse files

insert_neutron: ignore failed fit (flaky) (#124)

parent 6de018e3
Branches
No related tags found
No related merge requests found
Pipeline #110170 passed
...@@ -79,11 +79,12 @@ slc=abs(bc)<3 ...@@ -79,11 +79,12 @@ slc=abs(bc)<3
fnc=gauss fnc=gauss
sigma=np.sqrt(y[slc])+(y[slc]==0) sigma=np.sqrt(y[slc])+(y[slc]==0)
p0=(100, 0, 5) p0=(100, 0, 5)
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000) try:
xx=np.linspace(-5,5,100) coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
plt.plot(xx,fnc(xx,*coeff)) xx=np.linspace(-5,5,100)
# except: plt.plot(xx,fnc(xx,*coeff))
# pass except RuntimeError:
print("fit failed")
plt.xlabel("$\\theta_{rec}-\\theta_{truth}$ [mrad]") plt.xlabel("$\\theta_{rec}-\\theta_{truth}$ [mrad]")
plt.ylabel("events") plt.ylabel("events")
plt.title(f"$p={p}$ GeV, ${eta_min}<\\eta<{eta_max}$") plt.title(f"$p={p}$ GeV, ${eta_min}<\\eta<{eta_max}$")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment