Temperature measurement by optical beam deflection method