Skip to content
Snippets Groups Projects
Commit fad7d667 authored by Shujie Li's avatar Shujie Li Committed by Wouter Deconinck
Browse files

added eta and theta distribution to performance plot

parent f74c53a7
No related branches found
No related tags found
1 merge request!184added eta and theta distribution to performance plot
......@@ -139,7 +139,7 @@ if __name__ == '__main__':
df['theta'] = df['direction.theta']
df['phi'] = df['direction.phi']
fig, axs = plt.subplots(2, 2, figsize=(16, 12), dpi=120)
fig, axs = plt.subplots(3, 2, figsize=(16, 18), dpi=120)
for ax in axs.flat:
ax.tick_params(direction='in', which='both', labelsize=20)
ax.grid(linestyle=':')
......@@ -170,7 +170,7 @@ if __name__ == '__main__':
ax.errorbar(eta_centers, track_eff, xerr=eta_binsize/2., yerr=[track_eff_lower, track_eff_upper],
fmt='o', capsize=3)
ax.set_ylim(0., 1.)
ax.set_ylim(0., 1.1)
ax.set_xlim(-4.5, 4.5)
ax.set_ylabel('Tracking Efficiency', fontsize=20)
ax.set_xlabel('$\eta$', fontsize=20)
......@@ -212,6 +212,32 @@ if __name__ == '__main__':
ax.set_ylabel('Normalized Counts / {:d} Bins'.format(nbins), fontsize=20)
ax.set_xlabel(r'$d\phi$ (rad)', fontsize=20)
fig.text(0.5, 0.95, 'Barrel Tracker Benchmark (Truth Init.)', fontsize=22, ha='center')
# eta distribution
ax = axs.flat[4]
sim_eta = dfm.groupby('event')['eta'].first().values
rec_eta = -np.log(np.tan(df.groupby('event')['direction.theta'].first().values/2.))
hval, hbins, _ = ax.hist(sim_eta, bins=np.linspace(-4, 4, 41), ec='k',alpha=0.3,label="Generated")
hval, hbins, _ = ax.hist(rec_eta, bins=np.linspace(-4, 4, 41), ec='k',alpha=0.3, label="Reconstructed")
nbins = hbins.shape[0] - 1
ax.set_ylabel('Normalized Counts / {:d} Bins'.format(nbins), fontsize=20)
ax.set_xlabel(r'$\eta$', fontsize=20)
ax.legend(loc="upper right")
# theta distribution
ax = axs.flat[5]
sim_th_deg = dfm.groupby('event')['theta'].first().values*180/np.pi
rec_th_deg = df.groupby('event')['direction.theta'].first().values*180/np.pi
hval, hbins, _ = ax.hist(sim_th_deg, bins=np.linspace(-0, 180,61),
ec='k',alpha=0.3,label="Generated")
hval, hbins, _ = ax.hist(rec_th_deg, bins=np.linspace(-0,180, 61),
ec='k',alpha=0.3, label="Reconstructed")
nbins = hbins.shape[0] - 1
ax.set_ylabel('Normalized Counts / {:d} Bins'.format(nbins), fontsize=20)
ax.set_xlabel(r'$\theta (degree)$', fontsize=20)
fig.text(0.5, 0.95, 'Tracker Benchmark (Truth Init.)', fontsize=22, ha='center')
fig.savefig(os.path.join(args.outdir, '{}_performance.png'.format(args.nametag)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment