Creating effective magnetic field for photons : principles and applications