With the San Francisco Giants surging, last week I was able to catch the first three innings against the Cubs with the rest of Oracle Park’s knothole gang. Tucked under the right field arcade, through many iterations of ballpark name changes, the Giants have continued the tradition of allowing fans to watch three innings of a game for free.

What was unusual about my choosing to watch with the knothole gang is that I am a season ticket-holder and I had tickets to this game. And, I was not alone.

As the third inning came to a close, the security guard overseeing the knothole section advised the fans they were going to have to rotate out to let a new crop of fans in. Many of the fans voiced a protest that they also had tickets, but the security lines were still so long, they couldn’t get inside the ballpark.

Consider the irony of how the Giants are treating their customers:It is faster and easier for a freeloading fan to access viewing the game than a paying fan or even a season ticket-holder. And while the glacial lines are imposed upon paying customers in the name of enhanced security, the oversight among the non-paying crowd is far more lax. And yet, an ill-intentioned person could inflict just as much damage here — to the folks watching for free from behind the fence, to the folks within the stadium, and even to the players.

As a former longtime San Francisco police officer, I appreciate and accept the security the Giants intend for their fans. I fail, however, to understand is if there is any thought process behind both the security plan and the treatment of the Giants’ most loyal customers.

The “security theater” starts off as soon as I arrive at the ballpark with the bicycle parking. The Giants allow the San Francisco Bicycle Coalition to valet-park fans’ bicycles. I have attended major league baseball games in 45 different ballparks (some of them have long since had their date with the wrecking ball), which allows me to state that no baseball team offers anything close to what the SF Bicycle Coalition provides in terms of service and also allowing bicyclists to circumvent game-day automotive gridlock. Fans’ bicycles are stored in a large, attended cement room built under the right-field stands.

When I turned over my bike last week, the Giants used a contracted security guard with a bomb-smelling (or narcotics-smelling) dog to sniff my bicycle before it was rolled into the cement room filled with stored bikes. Our query to the Giants asking just what that dog is searching for was not answered. Nor were any of our other questions about team security practices.

“We don’t discuss specifics regarding our security program,” wrote Staci Slaughter, the team’s vice president of communications, via email. “However I can say that the security measures at Oracle Park and other Bay Area public assembly avenues are implemented with fan safety as the top priority. There are incidents almost every single day that provide real examples of why we continue to prioritize fan safety in and around the park.”

A meeting with a guard and a dog was not first experience with security theater for even bike-riding Giants fans. At the beginning of the season, security guards at the bike valet demanded cyclists open their bicycle seat packs. These six-inch by three-inch by three-inch packs are strapped below bike seats and hold approximately two compressed inner tubes, or the equivalent of two thin wallets.

After a mandatory snooping into my seat pack, I sent a photo to my season ticket representative of myself passing the very same seat pack through the wide bars of the fence that separates the ballpark from the outside, without any scrutiny at all from security guards.

Sneak a suspicious item into a room full of bikes: Bad. Sneak the same suspicious item into a ballpark with 40,000 fans: Who cares?

So, where is the thought process?

Last week, after getting rotated out of the knothole gang area in the fourth inning, I went to the still-20-plus-person line to get into the ballpark (yes, this line was still that long in the fourth inning). The bottleneck for entering Oracle Park is largely due to the onerous, manual searching of backpacks fans bring in.

My backpack contained three layers of clothing that I gradually don as the frigid summer cold descends during the later innings of the game. I emptied my backpack, put on my layers of clothes to walk through the metal detector, and handed my empty and ultra-light, 1.5-pound Osprey pack to the security guard. I assumed that the obvious lack of weight would expedite my entry.

I also told the security guard there was no metal in my backpack, and inquired whether I could prove the fact by walking it through the metal detector. The security guard declined my offer and, with dozens of people still waiting behind me and the ballgame nearly half done, proceeded to unzip every compartment of my backpack — even the sections that were too small to contain a wallet.

It seems perverse that the Giants organization creates gigantic funnels of fans because they are concerned that those fans might be sneaking nonmetallic items smaller than a wallet into the ballpark, while alternatively allowing any potential terrorist to walk that same object through the metal detector in his or her pocket — but the backpack is not allowed to go through the metal detector. Them’s the rules.

One needn’t be a security expert, of course, to note that long lines leading to hundreds, thousands, or even tens of thousands of fans massed outside a stadium is antithetical to any notion of “security.” But just in case you were wondering, security experts have noticed this, and think it’s bad.

“They created a perfect crowd scene for killing the maximum amount of people,” said Ohio State professor John Mueller, co-author of Terror, Security, and Money, after the Giants in 2013 beefed up security and created a bottleneck of thousands of fans spilling into Willie Mays Plaza. “It’s basically absurd.”

As a security measure, there’s no doubt about that. But, as the guard checked every nook of my bag, I asked him what he was looking for and he said, “glass.”

Well, huh. This raises the question of whether the Giants are making thousands of fans wait in Disneyland-length lines and using security theater just to prevent people from sneaking in alcohol to avoid $14.50 beers.

With the exception of the Giants’ ongoing July surge, there’s been little joy in Mudville for the past three seasons. And, in that time, the team — and everyone else — has learned just what fair market value is for a Giants ticket.

That’s thanks to the Stubhub phenomenon. This online brokerage service provides real-time ticket values to the Giants organization, which was used to drastically increase prices. But that’s only if you pay face value, and do so before the season.

That’s what the Giants’ most loyal fans, the season ticket-holders, do. And then they get to chat with the fan next to them, who paid 75 percent less on Stubhub. Barring the July miracle leading to a postseason berth, the Giants will have to make an offseason decision to either lower season ticket prices, or risk more of their loyal fans defecting to Stubhub’s cheaper tickets.

Many Major League parks, perhaps cognizant of this, have special entrances, similar to TSA Precheck, to reward their most loyal customers, the season ticket-holders. Security theater is never pleasant, and it grows less so when one is subjected to it on multiple occasions per week, and dozens of times per season.

But the Giants continue to treat the season ticket-holder in Seat A, paying face value, no different than the fair-weather Stubhub fan paying 25 percent of face value for Seat B. A 20-percent season-ticket-holder discount on a $14.50 beer hardly begins to make up for that.

Alienating and making suckers out of your most loyal customers would appear to be the very worst thing a business could do. “People being shepherded into large, concentrated groups, making them even more vulnerable” is, as University of Nebraska engineering professor Kevin Grosskopf put it in 2013, quite definitely the worst security practice a business could undertake.

Better luck to the Giants on the field. See you with the knothole gang.

Additional reporting by Joe Eskenazi.