Re: Computing integral errors

From: Alberto Pulvirenti <alberto.pulvirenti_at_ct.infn.it>
Date: Fri, 28 May 2010 17:17:34 +0200


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:
>
>> Dear ROOTers,
>>
>> I have the following problem, to which I don't see an easy solution.
>> I have a histogram, which contains a peak signal plus some background.
>>
>> I want to extract the signal counts in the peak.
>>
>> Then, I do the following:
>> 1) define a function which should reproduce the background
>> 2) create a TF1 whose expression is Background + Gaussian
>> 3) fit the whole histogram with that TF1
>> 4) create two new TF1 objects containing the Background only and the Gaussian only
>> 5) compute the integral of the Background TF1 in the peak
>> 6) compute the integral of the histogram in the peak
>> 7) obtain my counts from the subtraction of value (6) from value (7).
>> 8) as a cross-check, compute the integral of the Gaussian in the peak.
>>
>> Now, for what concerns computing the integrals, I have no problem. Problems appear if I want to compute the error on those integrals.
>> In fact, I have seen that apparently the computation of an integral error works only if I work with the TF1 object which I have used for the real fitting, but if I 'split' that global TF1 into its two components, I cannot obtain an integral error even if I initialize these components TF1 with the same parameters (with their errors) as I obtained in the fit done at point (3).
>>
>> Is there a way to overcome this difficulty, and compute the integral error on a component of this function?
>>
>> Hope I explained clearly the problem.
>>
>> Cheers
>>
>> Alberto
>>
>
Received on Fri May 28 2010 - 17:17:47 CEST

This archive was generated by hypermail 2.2.0 : Fri May 28 2010 - 17:50:01 CEST