Skip to content

Commit

Permalink
zdc_lyso: set maxfev=10000 for curve_fit (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl authored Oct 7, 2024
1 parent cff85ab commit 8116047
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions benchmarks/zdc_lyso/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def rotateY(xdata, zdata, angle):
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])
Expand All @@ -91,7 +91,7 @@ def rotateY(xdata, zdata, angle):
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])
Expand All @@ -100,7 +100,7 @@ def rotateY(xdata, zdata, angle):
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])
Expand Down

0 comments on commit 8116047

Please sign in to comment.