Project 2D histogram to diagonal line

Hi,

I have a 2D histogram and am wondering how I can project it to the diagonal line in ROOT.

Best regards,
Ming