]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/macros/trackMatching/DrawComparison.C
raw ana t0 calc. updates
[u/mrichter/AliRoot.git] / EMCAL / macros / trackMatching / DrawComparison.C
1 //
2 // This macro reads comparison files and makes plots.
3 //
4
5 void DrawComparison(const char *fileName = "match-comparison.root")
6 {
7         
8         gROOT->SetStyle("Plain");
9         gStyle->SetOptStat(0);
10         // 
11         // Open file
12         //
13         TFile *file = TFile::Open(fileName);
14         if (!file) return;
15         
16         TH1D *hgood  = (TH1D*)file->Get("hgood");
17         TH1D *hfake  = (TH1D*)file->Get("hfake");
18         TH1D *htrue  = (TH1D*)file->Get("htrue");
19         TH1D *hfound = (TH1D*)file->Get("hfound");
20
21         TH1D *hg = (TH1D*)hgood->Clone("hg");
22         TH1D *hf = (TH1D*)hfake->Clone("hf");
23         
24         hg->Divide( htrue );
25         hf->Divide( hfound);
26         hg->Scale(100);
27         hf->Scale(100);
28         hg->SetMarkerStyle(21);
29         hf->SetMarkerStyle(25);
30         
31         TCanvas *c = new TCanvas("c", "", 0, 0, 800, 600);
32
33         TLegend* leg = new TLegend(0.6,0.8,0.88,0.88);
34         leg->SetFillColor(10);
35         leg->AddEntry(hg,"Good/True","p");
36         leg->AddEntry(hf,"Fake/Found","p");
37                         
38         hg->SetXTitle("p_{T} (GeV/c)");
39         hg->SetYTitle("efficiency (%)");
40         hg->SetTitle("Track-EMCAL Cluster Matching");
41         hg->SetMaximum(120.0);
42         hg->SetMinimum(0.0);
43         hg->Draw("PE1");
44         hf->Draw("PE1same");
45         leg->Draw();
46         
47 }