create a function that selects hits/pmts within a certain distance from 3D point
After discussing with @tgal, I would propose to include in km3pipe a function like:
point = np.array([x, y, z])
def get_selected_items(point, item, d_min, d_max):
item_pos = np.array([item.pos_x, item.pos_y, item.pos_z]).T
distances = kp.math.dist(point, item_pos, axis=1)
mask = (distances >= d_min) & (distances <= d_max)
selected_items = item[mask]
return selected_items
where item can be a hit or a pmt. Probably the naming of the function is not optimal.