Created
September 10, 2014 03:06
-
-
Save pn11/0dae504b05ae9f7c2d1a to your computer and use it in GitHub Desktop.
ROOTのTH1:Chi2Test() (http://root.cern.ch/root/html/TH1.html#TH1:Chi2Test) がnormalizeしてるか確認した。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
TH1D *h1 = new TH1D("h1", "h1", 3, 0, 3); | |
h1->Fill(1); | |
h1->Fill(1); | |
h1->Fill(2); | |
h1->Fill(2); | |
h1->Fill(2); | |
h1->Fill(2); | |
h1->Fill(3); | |
h1->Fill(3); | |
h1->Draw(); | |
TH1D *h2 = new TH1D("h2", "h2", 3, 0, 3); | |
h2->Fill(1); | |
// h2->Fill(2); | |
h2->Fill(2); | |
h2->Fill(3); | |
h2->SetLineColor(kRed); | |
h2->Draw("same"); | |
double res[]; | |
cout << h1->Chi2Test(h2,"CHI2",res) << endl; | |
cout << res[0] << endl; | |
cout << res[1] << endl; | |
cout << res[2] << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment