by detecting the scanned beam or a reference beam