I would like to ask you a question about the possibility to set some “logical” constraints in ROOT on the fit parameters. Let’s make an example, I have the following function:
y(x) = Aexp(-Bx) + Cexp(-Dx)
where I want to fix A and C, and have B and D as fit parameters. Let’s assume that I don’t know which values to expect for B and D, but I know that D cannot be greater than B. Is it possible to set this kind of limit in ROOT?
[code]Double_t func(Double_t *x, Double_t *par) {
Double_t x = x[0];
Double_t A = par[0];
Double_t B = par[1];
Double_t C = par[2];
Double_t D = par[3];
if(D>B) return 1000000; //put here a very big number (the fit function will diverge when D will be greater than B
return Aexp(-Bx) + Cexp(-Dx);
}[/code]