Skip to content
Snippets Groups Projects

Analysis of truth/reconstruction associations

Merged Tooba Ali requested to merge truth_reconstruction into master
1 file
+ 41
0
Compare changes
  • Side-by-side
  • Inline
@@ -311,6 +311,47 @@ for i in range(1,len(MC_list),1):
plt.savefig(os.path.join(args.outdir, '%gon%g/minQ2=%g/truth_reconstruction/%s_ratio_vs_momentum_%gx%g_minQ2=%g.png' % (k,p,minq2,title_list[i],k,p,minq2)))
################
theta_mc_fil = ak.Array(theta_mc[simID][booll])[boolean_photon]
theta_rc_fil = ak.Array(theta_rc[recID][booll])[boolean_photon]
phi_mc_fil = ak.Array(phi_mc[simID][booll])[boolean_photon]
phi_rc_fil = ak.Array(phi_rc[recID][booll])[boolean_photon]
theta_mc_fil_len = ak.count(theta_mc_fil,axis=None)
theta_rc_fil_len = ak.count(theta_rc_fil,axis=None)
if theta_mc_fil_len > theta_rc_fil_len:
F_boolean = np.ones_like(theta_rc_fil) == 1
else:
F_boolean = np.ones_like(theta_mc_fil) == 1
theta_mc_F = np.array(ak.flatten(theta_mc_fil[F_boolean]))
theta_rc_F = np.array(ak.flatten(theta_rc_fil[F_boolean]))
phi_mc_F = np.array(ak.flatten(phi_mc_fil[F_boolean]))
phi_rc_F = np.array(ak.flatten(phi_rc_fil[F_boolean]))
ratio = np.array((ak.Array(theta_rc_F)-(ak.Array(theta_mc_F))))
fig = plt.figure()
gs = fig.add_gridspec(2, 2, wspace=0.03)
(ax1, ax2), (ax3, ax4) = gs.subplots(sharex=True, sharey=True)
fig.suptitle('Photons in (%g x %g)GeV %gGeV minQ2 %s events'%(k,p,minq2,Nevents))
ax1.scatter(-theta_mc_F, ratio, s = 0.01)
ax2.scatter(-theta_rc_F, ratio, s = 0.01)
ax3.scatter(-theta_mc_F, phi_mc_F, s = 0.01)
ax4.scatter(-theta_rc_F, phi_rc_F, s = 0.01)
ax1.set_ylabel('rc-mc')
ax2.set_ylabel('rc-mc')
ax3.set_ylabel('Phi mc')
ax4.set_ylabel('Phi rc')
ax3.set_xlabel('Theta mc')
ax4.set_xlabel('Theta rc')
fig.set_figwidth(20)
fig.set_figheight(20)
plt.savefig(os.path.join(args.outdir, '%gon%g/minQ2=%g/truth_reconstruction/photons_%gx%g_minQ2=%g.png' % (k,p,minq2,title_list[i],k,p,minq2)))
Loading