Hi,
please see the following piece of code using 5.15/08 that creates two histograms with 10 bins of which all are empty except the first one. Running Chi2TestX on this results in chi2=0 and ndf=0:
{
TH1F h1("h1","",10,1,10);
TH1F h2("h2","",10,1,10);
h1.SetBinContent(1,10);
h2.SetBinContent(1,5);
Double_t chi2;
Int_t ndf, igood;
h1.Chi2TestX(&h2,chi2,ndf,igood);
cout << "chi2 = " << chi2 << endl
<< "ndf = " << ndf << endl;
}
Isn’t the ndf calculation wrong? Shouldn’t there be 1 degree of freedom?
-Frank