Trapped Bose–Einstein condensates in synthetic magnetic field