Ray tracing code for determining dynamical masses