Skip to content
Snippets Groups Projects
Commit 8added84 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

fix improper variable path

parent e6189c59
Branches
Tags
1 merge request!183Resolve "tracking/scripts/tracking_performance.py fails (but gitlab doesn't catch it)"
This commit is part of merge request !183. Comments created here will be created in the context of that merge request.
...@@ -47,7 +47,6 @@ def flatten_collection(rdf, collection, cols=None): ...@@ -47,7 +47,6 @@ def flatten_collection(rdf, collection, cols=None):
dfp.loc[:, 'event'] = evns dfp.loc[:, 'event'] = evns
return dfp return dfp
def thrown_particles_figure(rdf, save, mcbranch="mcparticles2"): def thrown_particles_figure(rdf, save, mcbranch="mcparticles2"):
# define truth particle info # define truth particle info
dft = flatten_collection(rdf, mcbranch, ['genStatus', 'pdgID', 'ps.x', 'ps.y', 'ps.z', 'mass']) dft = flatten_collection(rdf, mcbranch, ['genStatus', 'pdgID', 'ps.x', 'ps.y', 'ps.z', 'mass'])
...@@ -137,6 +136,8 @@ if __name__ == '__main__': ...@@ -137,6 +136,8 @@ if __name__ == '__main__':
dfm = thrown_particles_figure(rdf_rec, save=os.path.join(args.outdir, '{}_thrown_particles.png'.format(args.nametag)), mcbranch=args.mc) 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 = flatten_collection(rdf_rec, args.coll)
df.rename(columns={c: c.replace(args.coll + '.', '') for c in df.columns}, inplace=True) 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(2, 2, figsize=(16, 12), dpi=120) fig, axs = plt.subplots(2, 2, figsize=(16, 12), dpi=120)
for ax in axs.flat: for ax in axs.flat:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment