With much of the nation in mourning, President Obama will fly to Newtown, Conn., on Sunday afternoon to play an unfortunately all-too-customary role: healer-in-chief.
The president will meet with the families of the 27 victims of Friday’s mass shooting, then speak at an interfaith vigil in the evening.

The appearance marks the fourth time Obama has appeared in a city devastated by a high-profile shooting spree. He delivered remarks in Fort Hood, Texas, after an Army psychiatrist killed 13 and wounded two dozen; spoke at a large memorial service in Tucson in January 2011, after a gunman killed six and wounded 12, including former Rep. Gabrielle Giffords; and visited Aurora, Colo., in July after a man killed 12 and injured 58 with multiple firearms during a midnight movie screening.

But in other cases, Obama did not visit after mass shootings. In August, a gunman killed six and wounded four at a Sikh temple in Oak Creek, Wis. Obama offered condolences, saying he was “heartbroken, and ordered flags flown at half staff on federal buildings. He sent Attorney General Eric Holder to speak at the memorial service, and first lady Michelle Obama visited with the victims’ families after attending a campaign event in nearby Milwaukee.

In April 2009, a naturalized immigrant killed 13 and wounded four in an immigration center in Binghamton, N.Y., prompting Obama, who was traveling in Europe at the time, to label the shooting a “senseless act of violence” and offer sympathy to the victims and their families. But he did not go there.

The president’s varying responses to the shootings have at times drawn criticism. Valerie Kaur, an activist who produced a documentary about violence against Sikh communities after the Sept. 11, 2001 terror attacks, wrote an editorial on cnn.com imploring Obama to visit Oak Creek.

“President Obama, you flew to Aurora, Colorado, to mourn publicly with the families before the dead were buried. You hugged your daughters closer that night, imagining them in that theater,” she wrote. “In response to the massacre of Sikhs in Oak Creek, you and Mitt Romney issued statements of support, but did not suspend campaigning in Wisconsin, as you did in Colorado.”

White House aides have said several factors weigh into the president’s response. Foremost, they said he is mindful that his visit does not complicate ongoing investigations by taking away law enforcement resources from local jurisdictions at a time of crisis.

In Aurora, for example, Obama visited with victims in the hospital and made brief remarks to reporters, but he did not attend a large outdoor prayer vigil. Aides explained that his appearance would have required far greater security, which would have made attendance difficult for the estimated 1,000 people who would have had to be screened by Secret Service.

Other factors also weigh on the White House. In Tucson, Obama visited Giffords in the hospital and delivered a moving, nationally televised address before thousands at the University of Arizona’s basketball arena. The fact that Giffords was the first member of Congress shot in 38 years focused enormous attention on the shooting, including on Capitol Hill, where Obama had been a senator just a few years earliers. At Fort Hood, the shooting took place at a military installation, and Obama is the nation’s commander-in-chief.

Of course, whether the president visits a wounded city isn’t the only signal people look for after a tragedy. What he says during his appearance also is parsed by viewers across the country.

In the wake of the Fort Hood shooting, some found Obama’s 13-minute address to be a “small masterpiece” because it was “so modest,” in the words of Slate’s John Dickerson

Others, though, found it “largely unemotional” and noted he did not speak much about the wars in Iraq and Afghanistan while talking to the troops.