Basically what happened was I went through an intersection and it had a green light going around 35 in a 40, I downshifted to 3rd seconds before but was going 40 for the last 2 miles cause that's the posted speed limit and there's always cops so I don't speed down that road. There were like 4 or 5 cop cars parked in the intersection to the left but I was going straight and it looked like the left was blocked but straight was clear and it was a green light with no cars in front of me so I was going 40 downshifted to 3rd going 35 in a posted 40 mph zone went through the light, all the cops standing by they're cars to the left started screaming STOP, then I saw a guy sweeping dirt in the middle of my lane 50 feet ahead, it scared the s**t outta me and I slammed on my brakes stopping like 15-20 feet from hitting him straight on. I was in mild shock so I started to turn to go around him and 5 cops sprinted at me and yelled to get out of my car, so I jumped out with my hands up, they asked for my ID, I gave it to them, they were pissed and yelled that I almost killed that guy and asked if I was drunk, I wasn't and told them no, a cop got in my car and drove it to the side without my permission( I wasn't under arrest or in handcuffs, I think that might be illegal) they made me sit on the curb for 10 mins, then told me to get back in my car. Then a cop gave me the ticket for going 45 mph in a 0mph(zero mph) area, but no other tickets and they didn't give me a sobriety test even though they believed that I almost killed that guy sweeping in the street. After replaying it in my mind a bunch of times, I honestly believe the cops didn't properly block the intersection, they said they had someone blocking traffic for my lane and I honestly didn't f**kin see anyone so that why I went through the green light like normal.