Fitting 2D gaussian in a root plot

If you have the latest version of ROOT, you do not need to define the gaussian 2D equation by yourself, there is a predefined one:

bigaus

See 2-D Gaussian fit to a data file