Dear Francesca,
(1) why did you comment out h->GetBinContent>0 (2) chi=chi+( ( (observed-expected)*(observed-expected) )/observed);
With those two modifications, I get the same chi2 & NDF as calculated by
ROOT.
Best regards,
Francois-Xavier
On Sat, Nov 12, 2011 at 09:38, <francesca.belloni_at_ts.infn.it> wrote:
> Hi all.
> I made a simple routine to fit a histogram with a 2D Gaussian function and
> implemented the formula for calculating the ChiSquare. But when comparing
> this ChiSquare with the one given by ROOT, the value is totally different.
> The same holds for the number of degrees of freedom.
> Could anyone tell me what I am making wrong, please?
>
> Thank you,
> Francesca
>
> P.S.
> I am using ROOT 5.28.00g on Ubuntu 10.10
Received on Sat Nov 12 2011 - 18:45:16 CET
This archive was generated by hypermail 2.2.0 : Sun Nov 13 2011 - 05:50:02 CET