Gantry rotation order?

Hi, I am currently writing my own code for coordinate transformations which will involve Gantry rotation around Y and Gantry pitch rotation around X. So I was wondering what is the standard order of rotations, is it pitch rotation followed the Gantry rotation or visa versa?
Thanks!