Geometry of the generalized geodesic flow and inverse spectral problems. (2016)