Barry Friedman is a professor at New York University School of Law and the director of its policing project. His latest book is “Unwarranted: Policing Without Permission.”

D.C. Police got a federal grant to help equip officers with body cameras. (Brendan Smialowski/AFP/Getty Images)

Watching the debate in this country over public safety, you’d think some people wish to live securely, while others welcome Armageddon. Conservative pundit Bill O’Reilly recently went after “liberal politicians” in Chicago and San Francisco, noting crime in those cities and saying, “The situation is out of control and a disgrace, and that’s what happens when incompetent politicians demand the police stop enforcing laws.”

The truth is, we all want to be safe. The struggle isn’t about outcomes, it’s about methods. Should law enforcement have ready access to everyone’s phone location-tracking data? Should police be required to undergo deescalation training before being authorized to use force?

These aren’t questions to be resolved by free-for-alls on cable news channels. They require facts and analysis. And yet, although the United States shells out well over $100 billion each year for public safety, we have remarkably little idea whether that money is well spent. It’s possible that any given policing tactic or technology — from Tasers to facial-recognition systems to body cameras — is a fine or poor idea. But we really don’t have much sense of which tactics and tools work, or whether they are worth the cost. We don’t know how much money we may be wasting, or whether we are compromising civil liberties, or harming people or property, without good reason.

Throughout the rest of government, we use cost-benefit analysis to answer these sorts of questions. (Many economists prefer to call it benefit-cost analysis, or BCA, rightly asking: Why worry about the costs until we know if there are any benefits?) Whether it is environmental regulation, workplace safety, financial rules or the provision of health care, BCA is pervasive. But as a 2014 report by the Vera Institute of Justice pointed out, BCA has not been widely taught or used in criminal justice. That’s a stark understatement when it comes to policing.

Take ShotSpotter, a technology that uses sound waves to pinpoint where a gun has been fired. The product is marketed as allowing police to know about gunshots and respond quickly, especially in neighborhoods where people aren’t inclined to call the cops. ShotSpotter leases the technology to cities at a cost of $65,000 to $95,000 per square mile per year. (The District of Columbia is one of ShotSpotter’s major clients; it installed sensors in 2005 with the help of a $2 million federal grant and spent $3.5 million maintaining and expanding the system through 2013, according to a Washington Post investigation published that year.) This is serious money for cash-strapped cities, so the question naturally is: Is it worth it? To answer this, we’d want to see good data on whether the technology is helping cops nab shooters, whether there are fewer shots fired when it is in place or whether gun violence is down. And we’d then want to know if the technology is more effective than an alternative, such as hiring more officers.

Unfortunately, it is harder than it should be even to get data for BCA around policing. The reasons for this are many. An unnecessary cloak of secrecy envelops too much policing. Law enforcement’s instinct is to give no information beyond what is necessary, making democratic engagement with policing extremely difficult. Additionally, the technologies for police data collection are in many ways primitive, as anyone who has watched a police officer filling out incident reports in duplicate on the back of a cruiser knows. There are about 18,000 departments, and aggregated data would be useful, but we often don’t have it.

In ShotSpotter’s case, though, the problem is different. Much of policing technology is being privatized, and private vendors — claiming trade secret protection — shield data from the public and researchers. The Post investigation obtained data from the D.C. police department through a public-records request and found that ShotSpotter sensors logged 39,000 incidents of gunfire in the District over eight years. Yet while D.C. police say that ShotSpotter is “a valuable tool,” helping to establish crime trends, the department told The Post that it didn’t track arrests made as a result of ShotSpotter alerts. We can’t evaluate policing technologies unless we can connect the use of those technologies with results.

In the modern era of deterrent-based policing, assessing the benefits of law enforcement has become both more important and more difficult. Rather than simply chasing bad guys, policing has put more focus on discouraging crime in the first place. Take airport security: Anyone who carries a bomb through a checkpoint will be arrested. But the point of the fortune we spend on airport security is to prevent people from even contemplating such an attack. The same may be said of closed-circuit TV cameras that peer down at us all over our cities and the deployment of many other technologies. The goal is to deter crime entirely.

It is one thing to count crimes that did happen; it is quite another to count crimes that didn’t. We can, of course, compare crime rates before and after a new technology or tactic is put in place, but it is hard to establish the cause of any trends. Did crime go down because of that new tactic, or did it decline for other reasons? For low-incident crimes such as terrorism, we can’t measure a meaningful before-and-after anyway.

Law enforcement agencies often are unclear about the specific crime-fighting benefits they hope to achieve when adopting technologies. Those technologies tend to spread by word of mouth: If Department A has a new tool, then Agency B wants it, too — officials don’t always put much thought into the precise purpose of a tool or whether something else (maybe something they already have or something cheaper) could achieve the same thing.

A good example is the curious case of automatic license plate readers: fixed cameras, or cameras installed on police cars, that capture and digitize images of license plates. Initially, LPR technology was sold as a way to reduce car theft. But with auto theft declining anyway, and at $10,000 or more for each mobile unit and $100,000 per fixed unit — not including maintenance, upgrades, and data storage and retrieval systems — it was hard to justify the cost. Then it occurred to departments that they could store the data and call it up in investigations; if they are looking for a van with a certain plate number, stored records may indicate where that van travels frequently or even where it parks. One hears anecdotes about LPR helpfully deployed this way. And yet, success stories tend to rely on randomness: A police car happened to drive by the van at some point and dumped that data into the system. The benefits of what is basically random enforcement are likely to be small.

The latest emerging justification for LPR is as part of policing for profit. A private vendor, Vigilant Solutions, gives LPR technology to departments for “free” and incorporates all plate captures into its database. Vigilant then uses that data to create an extensive “hot list,” composed, in particular, of vehicles with outstanding traffic fines. When cops get a ping they can pull a car over; police cruisers in some jurisdictions even are being equipped with credit card machines for instant payment. What’s in this for Vigilant? It gets a 25 percent “processing fee.”

Even if the benefits of certain policing tactics can be assessed, figuring out the full costs of any given tactic or technology is essential, albeit difficult. We can calculate the price tag of the technology itself, or perhaps the cost of more officers or new training. But what about the curtailing of civil liberties? What about the social costs? How do you put a price on public dissatisfaction with the way the police are doing their jobs? What about a potential loss of community trust?

Use of stop-and-frisk has been on the decline in some major cities, in part because of litigation (a cost in and of itself), but Donald Trump revived the debate with a shout-out during his presidential campaign. The evidence on whether stop-and-frisk works is thin. A 2008 study found that more police stops led to fewer robberies, burglaries, vehicle thefts and homicides — but did not reduce assaults, rapes or grand larceny. A 2014 study took the earlier study’s methodology to task and called into question the robbery and burglary results. One review of the empirical evidence suggested that during the height of stop-and-frisk in New York, fewer youth were carrying guns. Still, that study’s author conceded that the “strongest argument that New York City’s aggressive policing strategies . . . contributed to its plummeting crime rate ” was “the absence of alternative explanations.” That’s not social science, it’s conjecture. And, of course, New York has since dramatically reduced stop-and-frisk, and crime continues to fall.

Even if stop-and-frisk were effective in curtailing gun violence (putting constitutional arguments to one side), we would still have to look at the social costs of the practice. We’d want to put a value on a loss of trust in the police, contributing to an environment in which some people in some neighborhoods don’t call the cops when shots are fired. That’s why ShotSpotter is appealing in the first place. We should also consider the physical violation, the loss of time and liberty, the psychological costs of stop-and-frisk. Suppose the cost of being stopped out of the blue, put against a wall and having hands run over your body is equivalent to $100, which does not seem entirely unreasonable. In New York in 2011 there were more than 300,000 stop-and-frisks, at a cost of more than $30,000,000, using this estimate. That gives a sense of what the benefits would have to be in order to justify those costs.

The challenges of calculating the costs and benefits of policing should not dissuade us. If BCA can be applied to complicated and controversial subjects such as environmental regulation, such calculations can be applied to public safety.

It would help if public safety agencies and contractors were more forthcoming with their data. When trade secrets are a concern, private companies such as ShotSpotter and Vigilant could make their data available for researchers but require nondisclosure agreements. A ShotSpotter board member was quoted in Forbes as saying it would be beneficial to have an independent study. Companies that believe in their products should be willing to undergo outside testing. Tech companies could also lend their expertise to help police departments modernize their data collection and analysis efforts.

Government could play a big role here. Indeed, although there is debate and confusion over the role of the federal government in local law enforcement, dollars spent by the federal government in assessing what keeps us safe, and what is plain wasteful, are likely to be dollars well spent.

Not-for-profits have a part, too. They can team up with policing agencies to run BCA evaluations on tactics and tools, such as vehicle pursuits and deescalation training.

Public safety is foundational in society. We spend a fortune on it. It seems that it’s not too much to ask that we devote resources to figuring out what works and what does not, and whether we could do better.

Twitter: @barryfriedman1