Optical head as a gauge device in manufacturing