You had a traffic stop -- what were you stopped for? It is the officer's discretion whether to give you a ticket or not for any traffic violation.
As to throwing around words like probable cause. If the officer truly stopped you for a traffic violation, he has the right to search your car if his reasonable suspicion has been confirmed. Otherwise, if his stop was merely a pretext and he had no reasonable suspicion to stop you, then I would say three hours amount to more than just a stop, but an unreasonable detainment. As such, arguablly, you were falsely imprisoned because you were behaving under police authority and believed you were not free to leave.
Well, join the rank and file of many people who are suing police departments in California for just such horrible behavior.
call your attorney and see what can be done. Did you get a badge number? A name? A division?
http://www.attorneypages.com
____________________________________________________________
I am a law school graduate. What I offer is mere information, not to be construed as forming an attorney client relationship.