Wherever Britain's Queen Elizabeth II went on her tour of California this week, the key occupation for a chosen few was keeping up with the Windsors. To be invited to dinner aboard the royal yacht Britannia was indeed what "arriving" is all about.

Tonight President and Mrs. Reagan went aboard tonight for dinner to celebrate their 31st wedding anniversary, and as an added touch of royal gratitude for their hospitality, the queen invited them to spend the night. Entertainment for the dinner by the British marine band, which travels on the Britannia, included the "Anniversary Waltz."

The president and Mrs. Reagan, who wore a gray gown glittering with rhinestones, were greeted by a uniformed Prince Philip as they arrived aboard.

The 412-foot yacht was ablaze with lights, while pennants and the flags of all 50 states snapped in a 10 mph breeze and four U.S. Marines and a pair of British sailors guarded the gangway.

Stories about others less favored, however, abound from Los Angeles to San Francisco. One involves Frank Sinatra, who when his invitation for the queen's Monday night dinner aboard the yacht failed to arrive, reportedly sought out an intermediary to deal with Buckingham Palace.

"The palace said no, but Frank said he'd pull out as producer of Nancy Reagan's 20th Century-Fox dinner for the queen if he didn't get invited," said one source close to the White House. "Unfortunately, they caved in and invited him."

In San Diego, the emphasis was naval aboard the Britannia as the queen wined and dined the brass entrusted with her safe passage. In Los Angeles, it was the entrepreneurial elite of the oil, aerospace and entertainment industries. In San Francisco tonight, it was a mixture of Cabinet members and a few local government and high-tech business leaders. They included W.A. Hass Jr., chairman of Levi Strauss; Jane Harvey, head of Transamerica Corp., George Keller, Standard Oil of California's chief executive officer, and John Place, head of Crocker National Corp. The secretaries of State, Treasury and Defense and the attorney general joined White House senior aides William Clark, Michael Deaver, James Baker and Edwin Meese in the select lineup of 47 Americans. Also present were Senate Majority Leader Howard Baker of Tennessee, and Wyoming Republican Sen. Malcolm Wallop.

Monday night in Los Angeles, the Hollywood crowd found out that the way it does things isn't always the last word.

One guest at the Los Angeles shipboard dinner said that when 20th Century-Fox chairman Marvin Davis arrived with two bodyguards, he was politely informed the Britannia had plenty of its own people to guard the queen.

Some Californians thought the contrast between Northern and Southern California never more evident than in the Hollywood approach to entertaining the queen--which they labeled "tacky"--and the way the San Franciscans welcomed her--which was dubbed "wacky," but tasteful.

Revising the mobile "court" calendar to suit the elements, the queen seemed to have every reason to revise Louis XV's fatalistic motto to read, "Apre's le deluge, moi." Instead, she donned her rain gear, even carried her own umbrella on one occasion and showed her hosts how obliging the noble can be.

In San Diego, Sen. Pete Wilson (R-Calif.) found himself the ranking politico seated on the queen's right.

"She had an endless curiosity about all things," said Wilson, who talked to her mostly about NATO. "You can tell if someone is paying attention by the next question they ask."

Elizabeth II pays considerable attention to her shipboard guests. At her place at the table is a sterling silver case with pencil and pad that was a 25th wedding anniversary present from friends.

"If she suddenly has an idea or somebody tells her something interesting, she can jot it down," said Vice Adm. Sir Peter Ashmore, otherwise known as the Master of Her Majesty's Household. "She tears it off herself and puts it in her purse."

It is Ashmore who issues the royal invitations about a month ahead of each event. But, he says, "The queen tells me who she wants to invite."

When she is traveling, she gets assistance from her embassy and her consulate. They tell her--or Ashmore--whom it's important to invite and why. The San Diego guest list, while heavy with Navy brass, took notice of local civic leaders. The Los Angeles list was heavy with members of the Reagan crowd.

Elizabeth's bread-and-butter party also took note of the hands that fed her the night before at 20th Century-Fox's Soundstage 9. They included Davis and Atlantic Richfield's Robert Anderson. Then there were some palace insiders like Walter Annenberg, the former ambassador to Great Britain, and Occidental Petroleum's Armand Hammer, whose wife had held the royal baby, Prince William, on her lap in London only the week before, according to a newspaper report.

Just as it's done back home at Windsor Castle, on board the Britannia the queen's place is the only one at the table that has no place card. "She knows where she sits," a royal aide said.

Shipboard dinners accommodate 56 at three tables, with the queen and the duke of Edinburgh sitting across from each other in the center. The china is an assortment of Minton, Crown Derby and Spode Copeland, some of it dating back to Edward VII and George V. The crystal, however, is hers--Royal Yacht Brierly--engraved with her cipher, "E II R." The dinner tables are set with military precision by a steward who leaves nothing to chance. The distance between each goblet and each dinner plate is carefully measured. Place mats are cork-backed, with scenes of Britain or British history, the kind that tourists bring back from London.

A multipurpose room used for receptions, movies, church services and even investitures, the Britannia dining room also showcases gifts the queen has received on the 700,000 miles of globetrotting she has done in 30 years on the throne.

Unlike American presidents, who are prohibited from doing so, she keeps her gifts and personally sees to their placement. On her 1979 tour of the Gulf States, potentates gave her jewels estimated to be worth $2 million. Some of them, such as a diamond- and ruby-encrusted sword from Qatar, are displayed in her Britannia dining room. If all else fails, guests can surely talk about them.

"What you hear about English cooking isn't true on the Britannia," said Mickey Ziffren, whose husband Paul is one of the organizers of the 1984 Los Angeles Olympic Games, of the Los Angeles dinner. "I'll never forget the chocolate mousse."

There are 16 servers plus six wine waiters who go through their paces with a smoothness that has inspired undisguised awe in some guests.

"You become aware of the quiet elegance all around you, and suddenly you feel you've experienced majesty. It isn't klieg lights. It has nothing to do with the Hollywood impression of what majesty is," a guest said.

"You have the feeling," said another, "that anyone who loses his temper there will never be seen again."

Each invitation includes a presentation card, and guests are expected to remain silent unless spoken to. This practice outraged some Americans this week, but generally they haven't been the ones who have been invited to the queen's parties.

"That has a practical side to it," said a British Embassy aide. "If it wasn't like that, everybody would rush towards her. If she initiates the conversation it makes it easier to control the event and keep it orderly."

Nobody knows what the queen talks about with President Reagan or the first lady, but bets are high that with the president, at least, it sometimes has to do with horses.

The duke of Edinburgh is described as "up on things" and also "a tease." And though the queen has been parsimonious with her public smiles, those who have seen her at close range at parties say she is considerably more relaxed.

Her staff, which includes the mistress of the robes, her lady-in-waiting, her private secretary and her press secretary, to name but a few, are so smooth that "you feel as if you are an intimate friend within a few minutes after you've met," according to one guest. The women around her wear tiny brooches with her picture and stay discreetly in the background.

The queen and Prince Philip visited the California Assembly and Gov. George Deukmejian today.

The royal couple drew cheers in Sacramento from about 5,000 persons, the biggest crowd that they met on their California trip when they stepped out from behind a bullet-proof shield outside the Capitol so they could be better seen.

Guests arrive on board the Britannia to be served cocktails from silver trays but, as in England, the drinks contain no ice cubes. It is one of the many subtleties of British hospitality. Another is how the queen's staff gets everybody to go home.

"In some ways it's very similar to being at the White House," says Katie Lowery, whose husband is Rep. Bill Lowery (R-Calif.). "Before you know it you're being eased out."

The weather cheated San Francisco out of its welcome to Britannia when it arrived. But Saturday morning, the same folks have been reinvited to say farewell. "We couldn't say 'Welcome' on the streamers that we're going to fly overhead," said the city's deputy chief of protocol, Charlotte Mailliard. "So we decided on 'Cheerio.' "

And as an added treat, to everybody waving goodbye when the queen leaves Saturday for Yosemite and later Seattle, there will be dockside servings of breakfast cereal, said Mailliard.

Which cereal? Cheerios, of course.