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

zdc_lyso: set maxfev=10000 for curve_fit (#77)

parent cff85abc
No related branches found
No related tags found
No related merge requests found
Pipeline #104128 failed
......@@ -82,7 +82,7 @@ for i in range(6):
hist, x = np.histogram(temp,bins=np.linspace(min(temp),max(temp)+np.std(abs(temp)),2*int(np.sqrt(len(temp)))))
x = x[1:]/2 + x[:-1]/2
plt.errorbar(x,hist,yerr=np.sqrt(hist),fmt='-o',label='Cluster')
coeff, covar = curve_fit(gaussian,x[1:],hist[1:],p0=(max(hist[x>=np.std(abs(temp))]),np.mean(temp[temp!=0]),np.std(temp[temp!=0])))
coeff, covar = curve_fit(gaussian,x[1:],hist[1:],p0=(max(hist[x>=np.std(abs(temp))]),np.mean(temp[temp!=0]),np.std(temp[temp!=0])),maxfev=10000)
#plt.plot(np.linspace(coeff[1]-3*coeff[2],coeff[1]+3*coeff[2],50),gaussian(np.linspace(coeff[1]-3*coeff[2],coeff[1]+3*coeff[2],50),*coeff))
mu.append(coeff[1])
sigma.append(coeff[2])
......@@ -91,7 +91,7 @@ for i in range(6):
hist, x = np.histogram(temp,bins=np.linspace(min(temp),max(temp)+np.std(abs(temp)),2*int(np.sqrt(len(temp)))))
x = x[1:]/2 + x[:-1]/2
plt.errorbar(x,hist,yerr=np.sqrt(hist),fmt='-o',label='Digitization')
coeff, covar = curve_fit(gaussian,x[1:],hist[1:],p0=(max(hist[x>=np.std(abs(temp))]),np.mean(temp[temp!=0]),np.std(temp[temp!=0])))
coeff, covar = curve_fit(gaussian,x[1:],hist[1:],p0=(max(hist[x>=np.std(abs(temp))]),np.mean(temp[temp!=0]),np.std(temp[temp!=0])),maxfev=10000)
#plt.plot(np.linspace(coeff[1]-3*coeff[2],coeff[1]+3*coeff[2],50),gaussian(np.linspace(coeff[1]-3*coeff[2],coeff[1]+3*coeff[2],50),*coeff))
mu.append(coeff[1])
sigma.append(coeff[2])
......@@ -100,7 +100,7 @@ for i in range(6):
hist, x = np.histogram(temp,bins=np.linspace(min(temp),max(temp)+np.std(abs(temp)),2*int(np.sqrt(len(temp)))))
x = x[1:]/2 + x[:-1]/2
plt.errorbar(x,hist,yerr=np.sqrt(hist),fmt='-o',label='Simulation')
coeff, covar = curve_fit(gaussian,x[1:],hist[1:],p0=(max(hist[x>=np.std(abs(temp))]),np.mean(temp[temp!=0]),np.std(temp[temp!=0])))
coeff, covar = curve_fit(gaussian,x[1:],hist[1:],p0=(max(hist[x>=np.std(abs(temp))]),np.mean(temp[temp!=0]),np.std(temp[temp!=0])),maxfev=10000)
#plt.plot(np.linspace(coeff[1]-3*coeff[2],coeff[1]+3*coeff[2],50),gaussian(np.linspace(coeff[1]-3*coeff[2],coeff[1]+3*coeff[2],50),*coeff))
mu.append(coeff[1])
sigma.append(coeff[2])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment