Fit problem with multi histograms

I have 12 histograms and put them in 12 pads in the same canvas. I fit each of them with a defined function. However, after fitting, the fit parameters from last histogram will overwrite all the previous 11 ones. Could someone give me a suggestion? Thanks a lot.

Could you post teh shortest possible RUNNING script reproducing this problem?

Rene

I attach my root file and marco file. Just run this marco in root and get a ps file which saves all the fitted histograms. But last fit parameters overwrite previous ones.
etaplotbsa_MM2.C (3.31 KB)
allhists_MM2.root (1.88 MB)

Could you send #include ā€œ/home/zhaobo/top_dir/include/histerror.Cā€

Rene

sorry, I forgot this file.
histerror.C (2.53 KB)

I cannot reproduce this problem. See resulting ps file

Rene
etafitMM2.ps (167 KB)

In this ps file, the green curve and blue curve are right only for last histogram.
For other 11 histograms, green curve and blue curve are not drawn correctly.
It seems that the parameters from last histogram overwrite all the previous 11 ones so that green curve and blue curve are not drawn correctly.

Thanks a lot