Gratings In Optical Waveguides And Lasers