Skip to content
Snippets Groups Projects
Commit a96f4670 authored by Tooba Ali's avatar Tooba Ali Committed by Wouter Deconinck
Browse files

Truth reconstruction error

parent 25ae90f0
No related branches found
No related tags found
1 merge request!205Truth reconstruction error
......@@ -224,13 +224,11 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom
if i == 0: # for momentum
ax1.set_ylim(1-(Y_error[0][4]*10),1+(Y_error[0][4]*10))
center = 1
shift = 0
else: # for angles
ax1.set_ylim(0-(Y_error[0][4]*10),0+(Y_error[0][4]*10))
center = 0
shift = 0.1
for each_bin in range(len(Y_error[0][0])):
ax1.text(x=Y_error[0][0][each_bin]-shift,y=center + Y_error[0][4]*7, s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[0][1][each_bin],Y_error[0][3][each_bin]),size=text_size)
ax1.text(x=Y_error[0][0][each_bin],y=center + Y_error[0][4]*7, s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[0][1][each_bin],Y_error[0][3][each_bin]),size=text_size,horizontalalignment='center',verticalalignment='top')
ax1.set_title('%s %s with error bars %s %s events\n DETECTOR_CONFIG: %s'%(title_list[i],title,config,Nevents,Dconfig))
plt.savefig(os.path.join(r_path, '%s_%s_error_%s.png' % (title_list[i],title,config)))
......@@ -294,7 +292,7 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom
ax1.set_ylim(0-(Y_error[0][4]*10),0+(Y_error[0][4]*10))
for each_bin in range(len(Y_error[0][0])):
ax1.text(x=Y_error[0][0][each_bin],y=0 + Y_error[0][4]*7,
s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[0][1][each_bin],Y_error[0][3][each_bin]),size=text_size)
s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[0][1][each_bin],Y_error[0][3][each_bin]),size=text_size,horizontalalignment='center',verticalalignment='top')
ax1.set_title('%s %s with error bars %s %s events\n DETECTOR_CONFIG: %s'%(title_list[i],title,config,Nevents,Dconfig))
plt.savefig(os.path.join(r_path, '%s_difference_vs_momentum_error_%s.png' % (title_list[i],config)))
else:
......@@ -398,13 +396,14 @@ def particle_plots(boolean_particle):
ax2.errorbar(-Y_error[1][0], Y_error[1][1], yerr=Y_error[1][3], xerr=Y_error[1][2] ,fmt='None', ecolor = 'orange', elinewidth = 1)
ax3.errorbar(-Y_error[0][0], Y_error[0][1], yerr=Y_error[0][3], xerr=Y_error[0][2] ,fmt='None', ecolor = 'orange', elinewidth = 1)
ax4.errorbar(-Y_error[1][0], Y_error[1][1], yerr=Y_error[1][3], xerr=Y_error[1][2] ,fmt='None', ecolor = 'orange', elinewidth = 1)
y_limits = ax3.get_ylim()
for each_bin in range(len(Y_error[0][0])):
if not np.isnan(Y_error[0][1][each_bin]):
ax3.text(x=-Y_error[0][0][each_bin]-0.1,y=0 - Y_error[0][4]*50,
s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[0][1][each_bin],Y_error[0][3][each_bin]),size=text_size)
ax3.text(x=-Y_error[0][0][each_bin],y=y_limits[1],
s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[0][1][each_bin],Y_error[0][3][each_bin]),size=text_size,horizontalalignment='center',verticalalignment='top')
if not np.isnan(Y_error[1][1][each_bin]):
ax4.text(x=-Y_error[1][0][each_bin]-0.1,y=0 - Y_error[1][4]*50,
s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[1][1][each_bin],Y_error[1][3][each_bin]),size=text_size)
ax4.text(x=-Y_error[1][0][each_bin],y=y_limits[1],
s= '\u03BC = %.3f\n\u03C3 = %.3f' % (Y_error[1][1][each_bin],Y_error[1][3][each_bin]),size=text_size,horizontalalignment='center',verticalalignment='top')
if not np.isnan(Y_error[0][4]):
ax1.set_ylim(0-(Y_error[1][4]*10),0+(Y_error[1][4]*10))
ax2.set_ylim(0-(Y_error[1][4]*10),0+(Y_error[1][4]*10))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment