Good Afternoon everyone,
I’m trying to perform some fit of a generated histogram, the function is a sum of two gaussians and an exponential.
To perform the fit I define the function
TF1 my_func("my_func","[0]*([1] * TMath::Gaus(x,[2],[3], true) + [4] * TMath::Gaus(x,[5],[6],true) + (1-[1]-[4]) * TMath::Exp(x*[7]))",0,2);
my_func.SetParNames("Norm", "alpha", "mean1", "sigma1", "beta", "mean2", "sigma2", "tau");
my_func.SetParameters(2000, 0.3, 1, 0.2, 0.2, 1.5, 0.1, -3);
Now, because I know the number of events I generate in the histogram, I should know the value of the parameter [0], being it the number of the generated eventrs multiplied by the width of the bin.
But, if I do
my_func->FixParameter(0, 2500);
And then I fit the histogram I obtain a different value of the parameter [0]
How may I make it work?
Thank you for your attention
Riccardo