The system includes a focal optics configured to focus an electromagnetic radiation (EMR) beam into a focal region located along the optical axis. The system also includes a detector configured to detect signal emission emitted from a predetermined position along the optical axis. The system further includes a controller configured to adjust the parameters of the EMR beam based in part on the signal emission detected by the detector. The system also includes a window located at a predetermined depth away from the focal region between the focal region and the focal optical system along the optical axis, and the window is configured to contact the tissue surface. [Selection diagram] Fig. 5