Hi, I need some help on retrieving a value from a fit performed. The value I want is where a straight line crosses the x-axis.
The fit to the attached histogram was found with the following function which is a convolution of a straight line and a gaussian:
Double_t function(Double_t x, Double_t par)
{
Double_t gConst = par[0]sqrt((par[1]**2)/(2TMath::pi()));
Double_t gauss = exp(-0.5((x[0]-par[2])**2)/(par[1]**2));
Double_t eConst = 0.5par[3](x[0]-par[2]);
Double_t erf = 1- (TMath::Erf((x[0]-par[2])/(sqrt(2par[1]**2))));
Double_t fit = (gConst * gauss) - (eConst* erf);
return fit;
}
void prettyTemp3()
{
TFile *f =new TFile (“fullAODHisto.root”);
TCanvas * canvas1 = new TCanvas(“min1”);
TF1 *fitting = new TF1 (“function”,function,0,100,4);
fitting->SetRange(300,850);
fitting->SetParNames(“gradient1”,“sigma”,“mean”,“gradient2”);
fitting->SetParameters(1.0,minima1->GetRMS(),minima1->GetMean(),-2.0);
minima1->Fit(“function”,“R”);
canvas1->SaveAs (“min1.ps”);
}
I get the print out:
FCN=42.0818 FROM MIGRAD STATUS=CONVERGED 198 CALLS 199 TOTAL
EDM=4.84596e-10 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 2.4 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 gradient1 9.25886e+00 3.17850e-01 -2.44253e-04 1.30779e-04
2 sigma 1.02028e+02 2.17455e+00 8.67626e-04 3.82347e-05
3 mean 4.97528e+02 3.30523e+00 6.48408e-04 1.57537e-05
4 gradient2 -3.97329e-02 7.33060e-02 2.42743e-06 -3.52323e-04
Info in TCanvas::Print: ps file min1.ps has been created
What I need to know is where the right side of the gaussian if it were a straight line would cross the x-axis which i have drawn on using the red line. So the variable I want to retrieve from the fit is 720 in this case.
I do not know how to do this with the parameters given. I thought if I could get the gradient of that side of the fit (which i thought was par[3]) I could calculate where the x axis is crossed, but the value for par[3]= 0.0397 which is not the gradient and its error is huge.
any ideas how i can retrieve this value of 720 systematically or have I made an error somewhere??
Thanks.
minima1.ps (12.7 KB)