Hello,
I am trying to fit a Gaussian to some MC data. The fitter says it converges but the fit does not visually look like it converges. The MC data I am fitting is the mass of the Bs meson and I would expect that it would be gaussian. I have attached the code I am using to fit it, the output of root when the code is ran and a image of the data with the poor fit. Please let me know what I can do to improve this fit.

Why are you not using the RooGaussian pdf ? Your defined gaussian is ill defined. You have set a constant A=120 that is fixed in the fit, so as you see in the plot this is the best you can get.
Try to use a RooGaussian.

Still this better fit does not seem to optimize the value of sigma and mean, but instead just plots a Gaussian with those parameters. Is there a way for RooFit to take my initial parameters and optimize them based on the provided histogram?

First of all if you define the RooRealVar without passing a min and max value, like you are doing in the given example for sigma, the variables is by default defined as constant. So you need to do later sigma1.setConstant(kFALSE) to get a better fit.

Your second plot is then probably the best you can get with a gaussian fit to your data. It is clear the data have a larger tails, so you should use a more elaborated model, e.g. a second gaussian or a polynomial (quadratic ?) for the background .

.
It looks like the fit is improving, but still not quite there. You also mentioned trying to add a polynomial to model the background. The thing is that this data I am trying to fit is generated with no backgrounds so I can’t imagine that a polynomial would model this. Do you have any other ideas?