As far as I know you only get a ticket if you're actually parked there when the sweeper comes by. There's a parking cop car following the sweeper and ticketing the cars. You're allowed to re-park in the street after the sweeper has done its job, even if it's still technically street sweeping time.
So if you've got a ticket, there almost certainly was a sweeper that came by at that time.