Hi Alberto,
for the Gaussian the integral is not complicated, just need to use the cumulative distribution :
normalized gaussian for x in [a,b] = ROOT::Math::normal_pdf(x, sigma, mu) / (ROOT::Math::normal_cdf(b,sigma,mu)- ROOT::Math::normal_cdf(a,sigma,mu) );
For the background function it could be more complicated, but, if CPU time is not really an issue, you could still use the numerical integration, for example using TF1::Integral(a,b)
Ciao
Lorenzo
On May 28, 2010, at 5:17 PM, Alberto Pulvirenti wrote:
> Hi Lorenzo, > > the problem here is that it is easy to add a normalized Gaussian, if one intends the integral between -infty and +infty but this is not so easy if the integral is to be computed in a fixed and finite range, for both functions. Maybe for Gaussian is easier, but since I need at the end the integral of the background below the peak of the signal, this is somewhat more difficult to be defined in the integral without implementing the function in a very complicate way, unless there is some trick I don't know or think to in this moment. > > Ciao > Alberto > > On 05/28/2010 04:26 PM, Lorenzo Moneta wrote: >> Hi Alberto, >> >> it is true that the error on the integral does not work now on the function components. It requires the covariance matrix of the fit for the parameter correlations, and this one is obtained only for the global fitted function. >> I should probably re-implement the method with the option to pass a correlation matrix for the parameters. >> >> However, your simple solution is to fit directly for this integral (i.e. signal counts). >> You should re-define the functions of your fit as normalized functions (for example use the normalized Gaussian function) and use then N as fit parameters. >> In this way you get directly from the fit the values and the errors (no need to call IntegralError) >> >> Best Regards >> >> Lorenzo >> >> On May 28, 2010, at 1:41 PM, Alberto Pulvirenti wrote: >>
This archive was generated by hypermail 2.2.0 : Fri May 28 2010 - 17:50:01 CEST