I am calculating the integral of the fitting function, but I have found that the integral of fitting function has a large gap compared with the experimental data in the intagral limits. This is the fitting function and the histogram and another plot is the fitting parameters.
The integral of fitting function is 133591; while the sum of experimental data is 16570.

I am sure that the parameters of the function is right, and this is the code I used. The sum of the experimental data is calculate by the histogram:3300+3240+3420+3270+3340=16570

You need to take the “bin width” into account, e.g., assuming that the “histogram” has “fix bin sizes”: function->Integral(xmin, xmax) / histogram->GetBinWidth(histogram->FindFixBin(xmin));

No, the sum is 3300+3240+3420+3270+3340=16570, and the integral is when you multiply this sum by the bin width (8 in your case): (3300+3240+3420+3270+3340)*8= 132560≈133591

The previous remarks explain the large discrepancy but in general there can be more subtle issues. Normally a fit tries to minimize the distance between the histogram bin height and the value of the fitting function in the center of the bin. The resulting fit function will also deliver the optimal integral as long as the fit function is linear across the bin. In order to make sure that your fit has the correct integral, you should specify the fit option “I”