There are few long faces in Longmont, the smiles are bolder in Boulder and Lafayette may have the last laugh yet.

At least that’s the conclusion of the University of Vermont’s Department of Math and Statistics, which looked at 10 million geo-tagged posts from 190 metropolitan areas on the Twitter social network.

The premise of the study, titled “The Geography of Happiness,” was that the frequency of positive words in an area’s 140-character tweets indicated that that area must be a pretty happy place — while swearing brought a city’s score down.

When these glee-hunting geeks — gleeks? — from the land where sweetness grows on trees ran their numbers, they discovered that Longmont was the nation’s second-happiest city. Lafayette came in ninth, Boulder 12th and Fort Collins 13th. Wine-soaked Napa, California, was ranked the happiest city, while hot and humid Beaumont, Texas, finished last.

The six happiest states in the survey were Hawaii, Maine, Nevada, Utah, Vermont and Colorado. The saddest were Louisiana, Mississippi, Maryland, Delaware, Georgia and Alabama.

The researchers did not factor in climate, scenic vistas or the ratio of microbreweries per unit of population — all of which might explain the cheerful tweets emanating from this area.

The study’s methodology is outlined here — http://arxiv.org/pdf/1302.3299.pdf — if it’ll make you happy.