Gauss and Pol1 Fitting Results

In your 2nd code, what exactly this part :" dx = (g2->GetX()[ch_max] - g2->GetX()[ch_min]) / (ch_max - ch_min);" adjusting? It looks like the slope of energy vs channel plot. First integral you find is divided by the dx, then the numbers are too different. You go 5sigma from the mean on both side to get the integral, do you take the portion in to account to retrieve the whole count. Let’s say if you used 1sigma, it would have covered 68.3% of the actual data.

In the first code, integral is taken from gauss+background, but in the second one it is taken from gauss only. My question is still the same: why we dont take the integral from gauss-background?

Fits look perfect, by the way.