move some code into helper functions for iterating over segments on a branch and for sampling poisson events on a single track given an initial time, a final time, and a rate