Could best_track return array of indices for whole run
Currently, best_track
returns the whole branch and carrying all data from the track. I only want to find the indices for the best track for each event, such that I can call e.g. f.events.trks.E[indices][:,0]
to get the energy of each best track. A clear example is as follows:
import km3io
import matplotlib.pyplot as plt
import numpy as np
f = km3io.offline.OfflineReader(file)
fig, axe = plt.subplots()
inds = np.where(f.events.n_trks != 0) #return indices of all events with no tracks
cuts = np.where(f.events.trks.E[inds][:,0]> 10) #for each non-empty event.trks, apply filter on track energy
axe.hist(f.events.trks.dir_z[inds][cuts][:,0] , bins = np.linspace(-1,1,101), histtype='step')
plt.show()
Now, I want to do the exact same with the indices for the best tracks.