In a lawsuit filed this month in state court, CalPERS blamed the three major credit rating agencies, Moody's Investors Service, Standard & Poor's and Fitch Ratings, for its recent billion-dollar investment loss in three complex mortgage funds. The pension system says it got rooked because the firms gave the funds inflated AAA ratings.

The funds subsequently got liquidated at a fraction of their original value. CalPERS' share of the red ink could be more than $1 billion, the lawsuit says. (The rating firms all say the lawsuit is without merit.)

Winning this case requires CalPERS to paint itself as an innocent victim bobbing in a sea of Wall Street sharks, reliant for its investment judgments on the sagacity and integrity of Moody's and its brethren.

I know the feeling. I never invest in a stock before spending an edifying hour watching Jim Cramer on CNBC, equipped with a notebook and fortified with a bowl of Skittles.

But I'm not CalPERS, the biggest institutional investor in the country. In February 2006, when it plunged into these mortgage funds, its assets came to more than $200 billion. (It's considerably poorer now, but aren't we all?)

Before we examine this claim, let's recall why every California taxpayer should care about CalPERS, not just the employees whose retirement assets are in its hands.

A loss in the CalPERS portfolio has to be made up by public employers such as cities, counties and the state. For example, the 23.4% decline in its portfolio for the year that ended June 30 will necessitate an increase in public employer contributions to 19.7% of their payrolls, up from last year's 16.9%. That's a sizable hit for taxpayers.

So the pension fund's desire to stick the blame for its mortgage fiasco on someone else is understandable. Let's see if its argument holds water.

The investments at issue were "structured investment vehicles," or SIVs. As CalPERS describes them in its complaint, they were elaborately contrived pools of mortgages that made regular interest and principal distributions. The pools were supposed to comprise high-quality assets, CalPERS says, though it also says they held subprime mortgages, which are hardly the same thing.

Most of these structured pools were created by banks desiring to take mortgages off their books. In the investment world this was deemed to be a positive because if anything went wrong with the pools, the banks supposedly would have the liquidity to stand behind them.

CalPERS' SIVs weren't that kind of SIV. Their sponsors were a hedge fund and a couple of investment firms that specialized in marketing exotic paper to sophisticated investors -- such as CalPERS.

In fact, the investments were so risky that by law they could be marketed only to investors as sophisticated as CalPERS, which is always looking for "alternative" investments to even out the ups and downs of stocks and bonds.

In some businesses, this is known as seeing the mark coming a mile away.

CalPERS says it had no way of knowing what assets were owned by the structured investment pools -- "no access to any information on which to base a judgment of an SIV's creditworthiness," it says in the lawsuit. Consequently, it says, it had no choice but to rely on the rating firms, which did get to peek inside.

Unfortunately, the firms were paid to provide the ratings not by the investors such as CalPERS, which want objective judgments, but the promoters, who want anything but. Did this give the firms an incentive to rate every investment pool as gilt-edged whether it held gold or garbage? You make the call.

CalPERS' SIVs, in any case, held garbage. Naturally it's claiming that the rating firms were complicit in the debacle.

Even before then, the situation was no secret. CalPERS states in its lawsuit that in 2005 Moody's pocketed $715 million, or 41% of its revenue, from rating "structured" investments. The pension system didn't have to dig deep for this news: It's in the Moody’s annual report.

How about the issue of what CalPERS knew or didn't know about the assets held in the pools? CalPERS says "no amount of diligence" could have given it "actual knowledge" of what the pools contained.

This is slicing the baloney pretty thin. CalPERS knew its SIVs held mortgage assets. It knew that a bank's incentive would be to keep good mortgages on its balance sheet and dump the rest -- say, by offering them to an SIV.

In July 2007, a JPMorgan analyst reported that Cheyne Capital Management, the sponsor of one of the CalPERS pools, had the highest known concentration of real estate assets in the business. If JPMorgan knew, how come CalPERS didn't know?

More fundamentally, why would CalPERS put any money into an investment pool whose defining characteristic is that its investors can't know what it owns?

Many investors and financial analysts figured out the truth about these shady credit evaluations. The e-mails released by Congress and the SEC feature numerous investment executives telling Moody's and its cousins in mid-2007 that they didn't trust their ratings on exotic paper -- conclusions that had plainly originated months earlier, conceivably by late 2006.

Yet CalPERS claims to have been blindsided by the wave of credit downgrades the firms issued on the pools after mid-2007. It was then too late to extricate itself, as all three of its pools were headed for extinction.

The rating firms' complicity in the mortgage and financial meltdowns is a scandal -- that's true. But big investors including CalPERS played along.

They reasoned that no one would care that they had outsourced their due diligence to raters in cahoots with the ratees, as long as everyone was making money. If the money machine stopped, they figured, the rating firms would be convenient whipping boys.

The CalPERS lawsuit pulls the curtain back on this charade. Sure, CalPERS was a victim. The pension fund says it doesn't think the rating firms should be allowed "off the hook" and says it has "a duty to recover losses on behalf of our beneficiaries." But its case reminds me of a line by the great Russian author Nikolai Gogol: "There's no point blaming the mirror if it's your own mug that's crooked."