瀏覽代碼

Minor bugfix

Blaz Leban 2 年之前
父節點
當前提交
04b7f67870
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      1-naloga-razpadi-higgsovega-bozona/final_fit.py

+ 2 - 2
1-naloga-razpadi-higgsovega-bozona/final_fit.py

@@ -186,13 +186,13 @@ def scale_signal(x, scale, popt_CB=popt_CB):
     return scale * CB(x, *popt_CB)
 
 
-popt, pcov = curve_fit(scale_signal, bin_centers, extracted_signal, sigma=bin_errors, p0=[1.])
+popt, pcov = curve_fit(scale_signal, bin_centers, extracted_signal, sigma=pldict['Data'][3], p0=[1.])
 NHiggs = int(popt_CB[0] * popt[0])
 
 plt.figure(figsize=(12, 8))
 plt.title('Fitted signal', fontsize=22)
 plt.plot(xs, scale_signal(xs, popt), color='r', label='Fitted signal')
-plt.scatter(bin_centers, extracted_signal, color='k', label='Extracted signal')
+plt.errorbar(bin_centers, extracted_signal, pldict['Data'][3], xerrs, marker='o', markersize=5, color='k', ecolor='k', ls='', label='Extracted signal')
 plt.text(130, -200, r'$\alpha_{{scale}} = {:.3f}$'.format(*popt) + '\n' + r'$N_{{Higgs}} = {:d}$'.format(NHiggs), size=20, bbox=dict(facecolor='w', edgecolor='gray', boxstyle='round,pad=0.5'))
 plt.xlabel(r'$m_{\mu \mu}$', fontsize=20)
 plt.ylabel('Number of events', fontsize=20)