California motorists have long complained about high prices at the pump, but few drivers are aware of all the factors that push gasoline prices so high.

Consumer Watchdog’s report offers a big piece of the puzzle. It alleges that California’s largest oil refiners “calibrated” imports and exports of gasoline to artificially inflate gas prices in the wake of a February 2015 explosion at the ExxonMobil refinery in Torrance that left the facility largely offline for gasoline production.

That resulted in lost production of 800 million gallons of gas at the Torrance refinery during the first nine months of 2015, according to the report.

But a variety of other factors also play into the mix.

It starts with the 30 cents-per-gallon gas tax California drivers pay. While not the highest in the nation, it ranks near the top, according to figures released last month from the American Petroleum Institute.

North Carolina boasts the highest gas tax of 35 cents per gallon, followed by Rhode Island (33 cents), Idaho (32 cents), Iowa (31 cents), and Maine and Oregon, which each match California’s 30 cents-per-gallon fee.

But it doesn’t end there.

Additional state taxes and fees that average 10.6 cents per gallon are also figured into California’s mix, bumping that 30 cents-per-gallon cost up to 40.6 cents per gallon. Those include city and county taxes, an environmental transport fee, a gasoline inspection fee and an environmental assurance fee that applies to underground storage tanks.

And when a federal excise tax of 18.4 cents per gallon is added in, California’s total fees amount to an average of 59.02 cents per gallon.

California has the fifth highest overall per-gallon fee of any state in the nation. Pennsylvania topped the list at a whopping 68.8 cents per gallon, followed by Washington (62.9 cents), New York (61.04 cents) and Hawaii (60.8 cents)

The U.S. average for total state and federal fees is 47.9 cents per gallon.

Other factors have conspired to boost Golden State prices even higher.

California drivers see periodic price spikes when one or more of the state’s 20 refineries experiences a problem. Each year the refineries make a switch from their winter blend of gas to a more stringent summer blend that’s designed to reduce greenhouse gas emissions.

Refineries sometimes opt to do routine maintenance during that transition, which means they could be partially offline for a while. If they encounter unexpected problems they could be out of commission longer than planned. All of this reduces the state’s available inventory of gas.

That’s bad enough, but California refineries weathered far worse problems last year.

Tesoro’s Golden Eagle refinery in Martinez shut down in early February when steelworkers at the facility joined in a nationwide strike. The facility was later restarted, but a processing unit was briefly shut down the following month as well.

Chevron’s refinery in Richmond also did an unplanned shutdown in April for flaring, which occurs when too much pressure builds up due to over-pressurizing of equipment and flammable gas is released through pressure-relief valves.

California’s worst setback occurred in mid-February of 2015 when an equipment failure caused an explosion at the ExxonMobil refinery in Torrance, injuring four people. The facility, which typically produces about 10 percent of the state’s specially formulated gasoline, has been mostly offline for gas production since the accident happened.

California gas prices are particularly frustrating in light of the fact that oil prices have plummeted.

On Monday, the average price for a gallon of regular gas in Los Angeles County was $2.65 a gallon while Brent crude — a benchmark for international oils — closed at $32.88 a barrel.

The county’s average price for gas a year ago was just 2 cents higher, but Brent crude closed at $58 a barrel.

It’s a massive disconnect.

“When it comes to gas prices we’ve been beaten into submission,” said Cody Rosenfield, who authored Consumer Watchdog’s report. “People know that California prices are arbitrarily raised compared to the rest of the country. But we’ve had high prices for so long … everyone is just glad we’re under $4 a gallon.”