Hire a lawyer, and whatever you do, don't forget to pay your lawyer! A lawyer will probably keep you from doing time, but you will have to admit you were wrong, and act like you're sorry. If you don't pay the lawyer, they'll have you revoked. I don't know your local laws, but you can count on getting probation.
Whether you had smoked again in your car isn't the issue. You're the owner of the car, and it's your responsibility to know there's no weed in your car. If you're too high to remember where all the dope is, you're too high. **** it up, and quit trying to find a reason it's not your fault. There's nothing that pisses a judge off quite like that lack of logic.
BTW, this can be the power of an attorney; My kid passed out while huffing last year, went through about 5 yards, and smashed into a brick mailbox. He totaled out his best friend's car, but fortunately nobody was hurt. He wasn't charged with DWI (which he should have been), didn't lose his license (which he should have), and didn't do any time. He worked out the damages with the owner of the mailbox. The same week, a girl his age, in our town, passed out while huffing and hit the corner of a restaurant. She's doing 90 days in jail, and won't be driving for a couple of years.
Get ready to have your license suspended except for school and work.
If I'd known exactly what had caused my son's "accident" when it happened, the law would have been the least of his worries.
I was working as a salesman at a big car dealership last year. I went out to check out a really nice old Camry we took in trade. The interior smelled a little funny, so I opened the ashtray. Yep, it was full of roaches, and there was a small bag of weed. The woman who traded it in was in her 50's, and an advertising executive. The point? I've never met anybody who burned in their car who could remember leaving weed in the car. That includes my mother.