]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/macros/trackMatching/DrawComparison.C
raw ana t0 calc. updates
[u/mrichter/AliRoot.git] / EMCAL / macros / trackMatching / DrawComparison.C
CommitLineData
e10611f0 1//
2// This macro reads comparison files and makes plots.
3//
4
3a2a23e1 5void DrawComparison(const char *fileName = "match-comparison.root")
e10611f0 6{
e10611f0 7
3a2a23e1 8 gROOT->SetStyle("Plain");
9 gStyle->SetOptStat(0);
e10611f0 10 //
11 // Open file
12 //
13 TFile *file = TFile::Open(fileName);
14 if (!file) return;
15
3a2a23e1 16 TH1D *hgood = (TH1D*)file->Get("hgood");
17 TH1D *hfake = (TH1D*)file->Get("hfake");
18 TH1D *htrue = (TH1D*)file->Get("htrue");
e10611f0 19 TH1D *hfound = (TH1D*)file->Get("hfound");
20
3a2a23e1 21 TH1D *hg = (TH1D*)hgood->Clone("hg");
22 TH1D *hf = (TH1D*)hfake->Clone("hf");
e10611f0 23
3a2a23e1 24 hg->Divide( htrue );
25 hf->Divide( hfound);
26 hg->Scale(100);
27 hf->Scale(100);
e10611f0 28 hg->SetMarkerStyle(21);
29 hf->SetMarkerStyle(25);
30
3a2a23e1 31 TCanvas *c = new TCanvas("c", "", 0, 0, 800, 600);
e10611f0 32
3a2a23e1 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");
e10611f0 41 hg->SetMaximum(120.0);
42 hg->SetMinimum(0.0);
43 hg->Draw("PE1");
44 hf->Draw("PE1same");
3a2a23e1 45 leg->Draw();
46
e10611f0 47}