1 #include "../CommonTools.h"
16 gStyle->SetOptStat(0);
17 TFile *
df = TFile::Open(file1.c_str());
19 TFile *
nf = TFile::Open(file2.c_str());
21 TNtuple *dt = (TNtuple*)df->Get(
"ntp_gtrack");
22 TNtuple *nt = (TNtuple*)nf->Get(
"ntp_gtrack");
24 dt->Draw(
"gpt>>dtruth(40,0,20)");
25 nt->Draw(
"gpt>>ntruth(40,0,20)");
26 dt->Draw(
"gpt>>dreco(40,0,20)",
"quality<10 && ntpc>30");
27 nt->Draw(
"gpt>>nreco(40,0,20)",
"quality<10 && ntpc>30");
28 dt->Draw(
"gpt>>drecomaps(40,0,20)",
"quality<10 && nmaps>2 && ntpc>30");
29 nt->Draw(
"gpt>>nrecomaps(40,0,20)",
"quality<10 && nmaps>2 && ntpc>30");
31 TH1* dtruth = (TH1F*)gDirectory->Get(
"dtruth");
32 TH1 *ntruth = (TH1F*)gDirectory->Get(
"ntruth");
33 TH1 *dreco = (TH1F*)gDirectory->Get(
"dreco");
34 TH1 *nreco = (TH1F*)gDirectory->Get(
"nreco");
35 TH1 *drecomaps = (TH1F*)gDirectory->Get(
"drecomaps");
36 TH1 *nrecomaps = (TH1F*)gDirectory->Get(
"nrecomaps");
38 dt->Draw(
"pt/gpt:gpt>>dpt(40,0,40,400,0.5,1.5)",
"quality<10",
"colz");
39 nt->Draw(
"pt/gpt:gpt>>npt(40,0,40,400,0.5,1.5)",
"quality<10",
"colz");
41 TH2* dpt = (TH2F*)gDirectory->Get(
"dpt");
42 TH2* npt = (TH2F*)gDirectory->Get(
"npt");
47 TH1* dptw = (TH1F*)gDirectory->Get(
"dpt_2");
48 TH1* dpts = (TH1F*)gDirectory->Get(
"dpt_1");
49 TH1* nptw = (TH1F*)gDirectory->Get(
"npt_2");
50 TH1 *npts = (TH1F*)gDirectory->Get(
"npt_1");
52 dt->Draw(
"dca3dxy:gpt>>ddcax(60,0,20,50,-0.01,0.01)",
"quality<10",
"colz");
53 nt->Draw(
"dca3dxy:gpt>>ndcax(60,0,20,50,-0.01,0.01)",
"quality<10",
"colz");
54 dt->Draw(
"dca3dz:gpt>>ddcaz(60,0,20,50,-0.01,0.01)",
"quality<10",
"colz");
55 nt->Draw(
"dca3dz:gpt>>ndcaz(60,0,20,50,-0.01,0.01)",
"quality<10",
"colz");
57 dt->Draw(
"ntpc:gpt>>dntpc(20,0,20,60,0,60)",
"quality<10",
"colz");
58 dt->Draw(
"nintt:gpt>>dnintt(20,0,20,8,0,8)",
"quality<10",
"colz");
59 dt->Draw(
"nmaps:gpt>>dnmaps(20,0,20,5,0,5)",
"quality<10",
"colz");
60 nt->Draw(
"ntpc:gpt>>nntpc(20,0,20,60,0,60)",
"quality<10",
"colz");
61 nt->Draw(
"nintt:gpt>>nnintt(20,0,20,8,0,8)",
"quality<10",
"colz");
62 nt->Draw(
"nmaps:gpt>>nnmaps(20,0,20,5,0,5)",
"quality<10",
"colz");
64 dt->Draw(
"ntpc>>dntpc1(60,0,60)",
"quality<10",
"colz");
65 dt->Draw(
"nintt>>dnintt1(6,0,6)",
"quality<10",
"colz");
66 dt->Draw(
"nmaps>>dnmaps1(6,0,6)",
"quality<10",
"colz");
67 nt->Draw(
"ntpc>>nntpc1(60,0,60)",
"quality<10",
"colz");
68 nt->Draw(
"nintt>>nnintt1(6,0,6)",
"quality<10",
"colz");
69 nt->Draw(
"nmaps>>nnmaps1(6,0,6)",
"quality<10",
"colz");
71 TH1 *dntpc1 = (TH1F*)gDirectory->Get(
"dntpc1");
72 TH1 *dnintt1 = (TH1F*)gDirectory->Get(
"dnintt1");
73 TH1 *dnmaps1 = (TH1F*)gDirectory->Get(
"dnmaps1");
74 TH1 *nntpc1 = (TH1F*)gDirectory->Get(
"nntpc1");
75 TH1 *nnintt1 = (TH1F*)gDirectory->Get(
"nnintt1");
76 TH1 *nnmaps1 = (TH1F*)gDirectory->Get(
"nnmaps1");
78 TH2 *dntpc = (TH2F*)gDirectory->Get(
"dntpc");
79 TH2 *dnintt = (TH2F*)gDirectory->Get(
"dnintt");
80 TH2 *dnmaps = (TH2F*)gDirectory->Get(
"dnmaps");
81 TH2 *nntpc = (TH2F*)gDirectory->Get(
"nntpc");
82 TH2 *nnintt = (TH2F*)gDirectory->Get(
"nnintt");
83 TH2 *nnmaps = (TH2F*)gDirectory->Get(
"nnmaps");
85 TCanvas *tpc1can =
new TCanvas(
"tpc1can",
"tpc1can",200,200,600,600);
86 nntpc1->SetLineColor(kRed);
87 dntpc1->Scale(1./dntpc1->GetEntries());
88 nntpc1->Scale(1./nntpc1->GetEntries());
90 nntpc1->Draw(
"histsame");
92 TCanvas *intt1can =
new TCanvas(
"intt1can",
"intt1can",200,200,600,600);
93 nnintt1->SetLineColor(kRed);
94 dnintt1->Scale(1./dnintt1->GetEntries());
95 nnintt1->Scale(1./nnintt1->GetEntries());
96 dnintt1->Draw(
"hist");
97 nnintt1->Draw(
"histsame");
99 TCanvas *maps1can =
new TCanvas(
"maps1can",
"maps1can",200,200,600,600);
100 nnmaps1->SetLineColor(kRed);
101 dnmaps1->Scale(1./dnmaps1->GetEntries());
102 nnmaps1->Scale(1./nnmaps1->GetEntries());
103 dnmaps1->Draw(
"hist");
104 nnmaps1->Draw(
"histsame");
106 TCanvas *tpccan =
new TCanvas(
"tpccan",
"tpccan",200,200,600,600);
109 dntpc->GetYaxis()->SetTitle(
"ntpc");
110 dntpc->GetXaxis()->SetTitle(
"gpt");
115 TCanvas *inttcan =
new TCanvas(
"inttcan",
"inttcan",200,200,600,600);
116 inttcan->Divide(2,1);
118 dnintt->GetYaxis()->SetTitle(
"nintt");
119 dnintt->GetXaxis()->SetTitle(
"gpt");
120 dnintt->Draw(
"colz");
122 nnintt->Draw(
"colz");
124 TCanvas *mapscan =
new TCanvas(
"mapscan",
"mapscan",200,200,600,600);
125 mapscan->Divide(2,1);
127 dnmaps->GetYaxis()->SetTitle(
"nmaps");
128 dnmaps->GetXaxis()->SetTitle(
"gpt");
129 dnmaps->Draw(
"colz");
131 nnmaps->Draw(
"colz");
133 TH2 *ddcax = (TH2F*)gDirectory->Get(
"ddcax");
134 TH2 *ddcaz = (TH2F*)gDirectory->Get(
"ddcaz");
135 TH2 *ndcax = (TH2F*)gDirectory->Get(
"ndcax");
136 TH2 *ndcaz = (TH2F*)gDirectory->Get(
"ndcaz");
143 TH1 *ddcaxw = (TH1F*)gDirectory->Get(
"ddcax_2");
144 TH1 *ddcazw = (TH1F*)gDirectory->Get(
"ddcaz_2");
145 TH1 *ndcaxw = (TH1F*)gDirectory->Get(
"ndcax_2");
146 TH1 *ndcazw = (TH1F*)gDirectory->Get(
"ndcaz_2");
148 nptw->SetMarkerColor(kRed); nptw->SetLineColor(kRed);
149 npts->SetMarkerColor(kRed); npts->SetLineColor(kRed);
150 ndcaxw->SetMarkerColor(kRed); ndcaxw->SetLineColor(kRed);
151 ndcazw->SetMarkerColor(kRed); ndcazw->SetLineColor(kRed);
153 TCanvas *ptcan =
new TCanvas(
"ptcan",
"ptcan",200,200,600,600);
157 myText(0.1,0.03,kBlack,
"File 1");
160 myText(0.1,0.03,kBlack,
"File 2");
162 TCanvas *dcaxcan2 =
new TCanvas(
"dcaxcan2",
"dcaxcan2",200,200,600,600);
163 dcaxcan2->Divide(2,1);
167 myText(0.1,0.03,kBlack,
"File 1");
170 myText(0.1,0.03,kBlack,
"File 2");
172 TCanvas *dcazcan2 =
new TCanvas(
"dcazcan2",
"dcazcan2",200,200,600,600);
173 dcazcan2->Divide(2,1);
176 myText(0.1,0.03,kBlack,
"File 1");
179 myText(0.1,0.03,kBlack,
"File 2");
181 TCanvas *ptwcan =
new TCanvas(
"ptwcan",
"ptwcan",200,200,600,600);
182 nptw->GetYaxis()->SetTitle(
"#sigma(p_{T})/p_{T}");
183 nptw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
186 dptw->Draw(
"epsame");
187 myText(0.21,0.85,kBlack,
"File 1");
188 myText(0.21,0.77,kRed,
"File 2");
191 TCanvas *ptscan =
new TCanvas(
"ptscan",
"ptscan",200,200,600,600);
192 npts->GetYaxis()->SetTitle(
"#LTp_{T}^{true}/p_{T}^{reco}#GT");
193 npts->GetXaxis()->SetTitle(
"p_{T} [GeV]");
195 dpts->Draw(
"epsame");
196 myText(0.21,0.85,kBlack,
"File 1");
197 myText(0.21,0.77,kRed,
"File 2");
200 TCanvas *dcaxcan =
new TCanvas(
"dcaxcan",
"dcaxcan",200,200,600,600);
201 ndcaxw->GetYaxis()->SetTitle(
"#sigma(DCA_{xy}) [cm]");
202 ndcaxw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
204 ddcaxw->Draw(
"epsame");
205 myText(0.21,0.85,kBlack,
"File 1");
206 myText(0.21,0.77,kRed,
"File 2");
209 TCanvas *dcazcan =
new TCanvas(
"dcazcan",
"dcazcan",200,200,600,600);
210 ndcazw->GetYaxis()->SetTitle(
"#sigma(DCA_{z}) [cm]");
211 ndcazw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
213 ddcazw->Draw(
"epsame");
214 myText(0.21,0.85,kBlack,
"File 1");
215 myText(0.21,0.77,kRed,
"File 2");
219 dtruth->GetYaxis()->SetTitle(
"Eff");
220 dtruth->GetXaxis()->SetTitle(
"p_{T} [GeV]");
221 dtruth->GetYaxis()->SetRangeUser(0,1);
222 TEfficiency *deff =
new TEfficiency(*dreco,*dtruth);
223 TEfficiency *neff =
new TEfficiency(*nreco,*ntruth);
224 TEfficiency *deffmaps =
new TEfficiency(*drecomaps,*dtruth);
225 TEfficiency *neffmaps =
new TEfficiency(*nrecomaps,*ntruth);
228 TCanvas *effcan =
new TCanvas(
"effcan",
"effcan",200,200,600,600);
229 neff->SetMarkerColor(kRed); neff->SetLineColor(kRed);
230 neffmaps->SetMarkerColor(kRed); neffmaps->SetLineColor(kRed);
231 neffmaps->SetMarkerStyle(24); deffmaps->SetMarkerStyle(24);
235 deffmaps->Draw(
"psame");
236 neffmaps->Draw(
"psame");
237 TLegend *effleg =
new TLegend(0.4,0.4,0.6,0.7);
238 effleg->AddEntry(deff,
"File 1 qual<10",
"P");
239 effleg->AddEntry(neff,
"File 2 qual<10",
"p");
240 effleg->AddEntry(deffmaps,
"File 1 nmaps>2",
"P");
241 effleg->AddEntry(neffmaps,
"File 2 nmaps>2",
"P");
243 effleg->Draw(
"same");
248 TFile *
outfile =
new TFile(
"compoutfile.root",
"recreate");