From 8116047447bcfa6aa493ea3dd4f6ab3e724b5c7f Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 7 Oct 2024 10:50:28 -0400 Subject: [PATCH] zdc_lyso: set maxfev=10000 for curve_fit (#77) --- benchmarks/zdc_lyso/analysis/analysis.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/zdc_lyso/analysis/analysis.py b/benchmarks/zdc_lyso/analysis/analysis.py index eace6112..8994fa24 100644 --- a/benchmarks/zdc_lyso/analysis/analysis.py +++ b/benchmarks/zdc_lyso/analysis/analysis.py @@ -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]) @@ -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]) @@ -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])