I am new to the list, and I have the following which I coud not figure out
how to do it under root. I’m fitting my J/psi peaks by a Gaussian function :
f=NExp[-(x-\bar{x})^2/2 sigma^2]. Then I utilized the function
Integral(min,max) to find the area or the number of counts under this fit.
.
.
.
n[j]->Fit(“Gaus”,“R”);
G->SetParameters(par[0],par[1],par[2]);
float mean = par[1];
float sigma = par[2];
float mlo = mean-3.0sigma;
float mhi = mean+3.0*sigma;
cout <<mean<<" and “<<sigma<<” and " <<mlo<<"and "<<mhi<<endl;
float binw = n[j]->GetBinWidth(1);
double COUNTS = G->Integral(mlo,mhi)/binw;
.
.
.
I need to know how to find the statistical error of the integral, i.e. "COUNTS"
in root.
integral is area under the curve, so the statistical error of your integral
is sum of all bins statistical errors multiplied by bin width ( assuming all bins are same width).
Your are correct ardashev. But, I need to deal with my fit functions and not the bin contents.
I did the following to avoid this:
[1]. I re-define my Gaussian function so that the norm is just the number of J/psis:
F(x)= norm exp(bla bla bla);
norm = (sqrt[2*psi] * sigma * N ) / binwidth
where N is the peak. Then the statistical error of J/psi will be calculated directly by root and will be shown on the statistical window on the Canvas. Does this sound Ok for you?