]>
Commit | Line | Data |
---|---|---|
e10611f0 | 1 | // |
2 | // This macro reads comparison files and makes plots. | |
3 | // | |
4 | ||
5 | void DrawComparison | |
6 | (const char *fileName = "match-comparison.root") | |
7 | { | |
8 | TH1D *hg = new TH1D("hg", "Good matches / true matches", 20, 0.0, 10.0); | |
9 | TH1D *hf = new TH1D("hf", "Fake matches / found matches", 20, 0.0, 10.0); | |
10 | ||
11 | // | |
12 | // Open file | |
13 | // | |
14 | TFile *file = TFile::Open(fileName); | |
15 | if (!file) return; | |
16 | ||
17 | TH1D *hgood = (TH1D*)file->Get("hgood"); | |
18 | TH1D *hfake = (TH1D*)file->Get("hfake"); | |
19 | TH1D *htrue = (TH1D*)file->Get("htrue"); | |
20 | TH1D *hfound = (TH1D*)file->Get("hfound"); | |
21 | ||
22 | gROOT->SetStyle("Plain"); | |
23 | gStyle->SetOptStat(0); | |
24 | ||
25 | hg->Divide(hgood, htrue, 100.0, 1.0, "b"); | |
26 | hf->Divide(hfake, hfound, 100.0, 1.0, "b"); | |
27 | ||
28 | TCanvas *c = new TCanvas("c", "", 0, 0, 800, 600); | |
29 | ||
30 | hg->SetMarkerStyle(21); | |
31 | hf->SetMarkerStyle(25); | |
32 | ||
33 | hg->SetXTitle("p_{T} (GeV/c)"); | |
34 | ||
35 | hg->GetXaxis()->SetRangeUser(0.0, 6.0); | |
36 | hf->GetXaxis()->SetRangeUser(0.0, 6.0); | |
37 | ||
38 | hg->SetMaximum(120.0); | |
39 | hg->SetMinimum(0.0); | |
40 | hg->Draw("PE1"); | |
41 | hf->Draw("PE1same"); | |
42 | } |