Control of temperature in thin samples during ion beam analysis