XRF analysis directly measures the elemental concentrations of potassium(K), uranium(U), and thorium(Th) in a given rock sample. These amounts are then converted to a synthetic total gamma (XRF GR). Wireline and MWD tools measure natural gamma rays from a volume of rock in-situ, then back calculate how much K, U and Th are present. By comparing the results of down hole readings with XRF gamma, the cuttings or core can be depth shifted to their correct locations of origin. In horizontal wells, the XRF can provide a spectral gamma from drill cuttings to compliment MWD, and potentially identify if a downhole gamma tool has malfunctioned.