Skip to content
Snippets Groups Projects
Commit 8883eac0 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

tracking_performance.py: direction.{theta,phi} to {theta,phi}

parent 66ac5bf4
No related branches found
No related tags found
1 merge request!239tracking_performance.py: direction.{theta,phi} to {theta,phi}
......@@ -136,8 +136,6 @@ if __name__ == '__main__':
dfm = thrown_particles_figure(rdf_rec, save=os.path.join(args.outdir, '{}_thrown_particles.png'.format(args.nametag)), mcbranch=args.mc)
df = flatten_collection(rdf_rec, args.coll)
df.rename(columns={c: c.replace(args.coll + '.', '') for c in df.columns}, inplace=True)
df['theta'] = df['direction.theta']
df['phi'] = df['direction.phi']
fig, axs = plt.subplots(3, 2, figsize=(16, 18), dpi=120)
for ax in axs.flat:
......@@ -215,7 +213,7 @@ if __name__ == '__main__':
# 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.))
rec_eta = -np.log(np.tan(df.groupby('event')['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
......@@ -226,7 +224,7 @@ if __name__ == '__main__':
# 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
rec_th_deg = df.groupby('event')['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")
......
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