I’m afraid 4.00/08 is the newest version currently available on my system.
Without emailing you the root files and scripts, I’m not sure how to make the example more concrete, but I’ll try to put the lines I included in context:
[i]{
TFile f1(“zewk0d-2j.root”);
TFile f2(“atop4z.root”);
f1.cd();
f1.cd(“Ana”);
f1.cd(“zewk0dAna”);
f1.cd(“Hist”);
TH1F zewk0d_met_0 = (TH1F) met_0->Clone();
zewk0d_met_0->Sumw2();
zewk0d_met_0->Scale(1.0/zewk0d_met_0->Integral());
zewk0d_met_0->SetXTitle(“Missing Et”);
zewk0d_met_0->SetTitle("");
zewk0d_met_0->SetStats(0);
f2.cd();
f2.cd(“Ana”);
f2.cd(“atop4zAna”);
f2.cd(“Hist”);
TH1F atop4z_met_0 = (TH1F) met_0->Clone();
atop4z_met_0->Sumw2();
atop4z_met_0->Scale(1.0/atop4z_met_0->Integral());
atop4z_met_0->SetXTitle(“Missing Et”);
atop4z_met_0->SetTitle("");
atop4z_met_0->SetStats(0);
cMEt = new TCanvas(“MEt”,“MEt”);
cMEt->Divide(1,1);
cMEt->cd(1);
zewk0d_met_0->SetLineColor(2);
zewk0d_met_0->Draw(“P”);
atop4z_met_0->SetLineColor(4);
atop4z_met_0->Draw(“SAMEHIST”);
Double_t EtAKSTest = atop4z_met_0->KolmogorovTest(zewk0d_met_0,“ND”);
Double_t EtAChiTest = atop4z_met_0->Chi2Test(zewk0d_met_0,“UOP”,1);
// The “1” is because since the two distributions are normalized to the
// same unit area, there’s a constraint on the fit
char fit[100];
sprintf(fit,“KS TEST = %lf Chi2 TEST=%lf”,EtAKSTest,EtAChiTest);
std::cout << fit << endl;
}[/i]
gives the result
[i]Kolmo Prob h1 = met_0, sum1=1
Kolmo Prob h2 = met_0, sum2=1
Kolmo Probabil = 1, Max Dist = 0.163579
Kolmo Probabil = 1.000000 for shape alone, =1.000000 for normalisation alone
the value of chi2 = 4.249898
the number of degrees of freedom = 25
KS TEST = 1.000000 Chi2 TEST=0.999189[/i]
…OK, so the Chi-squared probability isn’t always coming out as exactly one, but when comparing other pairs of histograms, it’s always 0.999xxx or 1.000000. The KS probability is always 1.000000.
The two histograms I’m comparing look like this:
Thanks,
Dan