Maximum number of parameters in a user defined fit

hi
i have a problem conserning the maximum number of parameters possible in a fit with a user defined function. I m trying to fit many gaussian functions heaped on top of each other in this way

Double_t fitf2g(Double_t *x, Double_t *p)
{
return p[0]*TMath::Gaus(*x,p[1],SIGMA)+p[2]*TMath::Gaus(*x,p[3],SIGMA)+p[4]*TMath::Gaus(*x,p[5],SIGMA)+
p[6]*TMath::Gaus(*x,p[7],SIGMA)+p[8]*TMath::Gaus(*x,p[9],SIGMA);
}

As i understand there is a maximum of 10 parameters possible in this kind of fit.the same applies if you combine functions. Is there any way to increase this number?

thanks in advance

see an example for ftting multiple gaussians in $ROOTSYS/tutorials/spectrum/peaks.C

Rene

thank you for your anwser Rene it was very helpfull. I have one question about the peaks c. example. I don t see where the noise is coming from. Is it the FillRandom line?

Primoz

As indicated in the comments at the top of the script:

// This script generates a random number of gaussian peaks // on top of a linear background.
Rene