From 8883eac0316ca62430fb1e94893a549122a458ad Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Fri, 11 Feb 2022 02:40:38 +0000 Subject: [PATCH] tracking_performance.py: direction.{theta,phi} to {theta,phi} --- benchmarks/tracking/scripts/tracking_performance.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/benchmarks/tracking/scripts/tracking_performance.py b/benchmarks/tracking/scripts/tracking_performance.py index 6f582c74..813f4d93 100644 --- a/benchmarks/tracking/scripts/tracking_performance.py +++ b/benchmarks/tracking/scripts/tracking_performance.py @@ -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") -- GitLab