See the RSL rayinfo() function in the RenderMan documentation.

VOP nodes