The law prohibits driving while impaired on account of alcohol or drugs. That includes legal drugs for which you have a valid prescription. You can legally take whatever meds you need and have an Rx for. But you can't drive while those meds are impairing your abilities.
My responses to questions on Avvo are never intended as legal advice and must not be relied upon as legal advice. I give legal advice only in the course of an attorney-client relationship. Exchange of information through Avvo's Questions forum does not establish an attorney-client relationship with me. That relationship is established only by individual consultation and execution of a written agreement for legal services.
The determination of whether or not you were impaired will be left to the arresting officer. Whether or not you had the ability to drive is a judmgent call determined by the police officer. This is an imperfect science. You should consult with a lawyer review the facts and circumstances of the case. The arresting report should have clues as to whether or not the officer conducted a fair evaluation of your ability. Also, an attorney should be able to determine whether or not the arresting officer had probable cause for either the stop or for the arrest.
The law does not have a per se illegal amount when it comes to driving with drugs in your system. For example, we all know that if you drive with a .08 blood alcohol content and are arrested, you can be prosecuted as such. But the legislature in California has not come up with an illegal per se level for Xanax. I agree with the other attorneys that you should hire an attorney to defend you that specializes in DUI defense. Be prepared to go to trial if it is not reduced to what you deem satisfactory. The prosecution experts are weary about rendering an opinion as to whether or not you are under the influence when there is no real statutory level that presumes you under the influence. Much will depend on the facts in your case. Be sure to obtain any video that was recorded of the officer's investigation. Good luck!