Optics optimizer for g2p experiment