15 gROOT->SetStyle(
"Plain");
16 gStyle->SetOptStat(0);
18 gStyle->SetOptTitle(0);
21 double slice_low = 30.0;
22 double slice_high = 31.0;
24 std::vector<std::string> finvec;
25 std::vector<std::string> legvec;
31 finvec.push_back(
"root_files/ntp_track_out_acts_MB_50khz_nomapscut.root");
32 legvec.push_back(
"TpcTracker+stub matcher+ActsTrkFit (MB+50, nomapscut)");
35 finvec.push_back(
"root_files/ntp_track_out_acts_MB_50khz_withmapscut.root");
36 legvec.push_back(
"TpcTracker+stub matcher+ActsTrkFit (MB+50, nmaps>1)");
111 unsigned int nfiles = finvec.size();
113 TCanvas *ctemp0 =
new TCanvas(
"ctemp0",
"ctemp0",5,5,1600,800);
114 ctemp0->Divide(nfiles,1);
115 TCanvas *cslice =
new TCanvas(
"cslice",
"cslice",5,5,1600,800);
116 cslice->Divide(nfiles,1);
117 TCanvas *cpt =
new TCanvas(
"cpt",
"cpt",5,5,1500,800);
119 cpt->cd(1); gPad->SetLeftMargin(0.2);
120 cpt->cd(2); gPad->SetLeftMargin(0.2);
121 TCanvas *ceff =
new TCanvas(
"ceff",
"ceff",5,5,1200,800);
122 ceff->SetLeftMargin(0.18);
123 TCanvas *ctemp1 =
new TCanvas(
"ctemp1",
"ctemp1",5,5,1200,800);
124 ctemp1->Divide(nfiles,1);
125 TCanvas *cslicexy =
new TCanvas(
"cslicexy",
"cslicexy",5,5,1600,800);
126 cslicexy->Divide(nfiles,1);
127 TCanvas *cdcaxy =
new TCanvas(
"cdcaxy",
"cdcaxy",5,5,1200,800);
128 cdcaxy->SetLeftMargin(0.2);
130 TCanvas *ctemp2 =
new TCanvas(
"ctemp2",
"ctemp2",5,5,1200,800);
131 ctemp2->Divide(nfiles,1);
132 TCanvas *csliceZ =
new TCanvas(
"csliceZ",
"csliceZ",5,5,1600,800);
133 csliceZ->Divide(nfiles,1);
134 TCanvas *cdcaZ =
new TCanvas(
"cdcaZ",
"cdcaZ",5,5,1200,800);
135 cdcaZ->SetLeftMargin(0.2);
137 TCanvas *cmvtx=
new TCanvas(
"cmvtx",
"cmvtx",5,5,1200,800);
138 cmvtx->SetLeftMargin(0.2);
139 TCanvas *ccomb=
new TCanvas(
"ccomb",
"ccomb",5,5,1200,800);
140 ccomb->SetLeftMargin(0.2);
142 TLegend *lpd =
new TLegend(0.25, 0.6, 0.85, 0.75,
"",
"NDC");
143 lpd->SetBorderSize(1);
144 lpd->SetFillColor(kWhite);
145 lpd->SetFillStyle(1001);
147 TF1 *fz =
new TF1(
"fz",
"gaus");
148 fz->SetRange(-0.02, 0.02);
150 for(
unsigned int i=0;
i<finvec.size();++
i)
152 TFile *fin =
new TFile(finvec[
i].c_str());
157 fin->GetObject(
"h1",hpt2d);
158 std::cout << hpt2d->GetEntries() << std::endl;
160 TH1D *hptres = (TH1D*)gDirectory->Get(
"h1_2");
161 TH1D *hptcent = (TH1D*)gDirectory->Get(
"h1_1");
165 int binlow = hpt2d->GetXaxis()->FindBin(slice_low);
166 int binhigh = hpt2d->GetXaxis()->FindBin(slice_high);
168 sprintf(hname,
"hptslice%i",
i);
169 TH1D *hptslice = hpt2d->ProjectionY(hname,binlow, binhigh);
171 hptslice->DrawCopy();
172 hptslice->Fit(
"gaus");
175 hptres->GetYaxis()->SetTitleOffset(2.1);
176 hptres->GetXaxis()->SetTitleOffset(1.2);
177 hptres->SetMarkerStyle(20);
178 hptres->SetMarkerSize(1.2);
179 hptres->SetMarkerColor(col[
i]);
180 hptres->GetXaxis()->SetRangeUser(0, ptmax);
181 hptres->GetYaxis()->SetRangeUser(0.0, 0.08);
182 hptres->SetTitle(
";p_{T} [GeV/c];#frac{#Delta p_{T}}{p_{T}} (resolution)");
184 hptres->DrawCopy(
"p");
186 hptres->DrawCopy(
"p same");
188 lpd->AddEntry(hptres, legvec[i].c_str());
191 hptcent->GetYaxis()->SetTitleOffset(2.1);
192 hptcent->GetXaxis()->SetTitleOffset(1.2);
193 hptcent->SetMarkerStyle(20);
194 hptcent->SetMarkerSize(1.2);
195 hptcent->SetMarkerColor(col[i]);
196 hptcent->GetXaxis()->SetRangeUser(0, ptmax);
197 hptcent->GetYaxis()->SetRangeUser(-0.1, 0.1);
198 hptcent->SetTitle(
";p_{T} [GeV/c];#frac{#Delta p_{T}}{p_{T}} (offset)");
200 hptcent->DrawCopy(
"p");
202 hptcent->DrawCopy(
"p same");
208 fin->GetObject(
"h3_num",hnum);
209 fin->GetObject(
"h3_den",hden);
211 TH1D* heff = (TH1D*)hden->Clone(
"heff");;
213 for(
int i=1;i<=hden->GetNbinsX();++
i)
215 double pass = hnum->GetBinContent(i);
216 double all = hden->GetBinContent(i);
222 heff->SetBinContent(i, eff);
225 heff->GetYaxis()->SetTitle(
"Efficiency");
226 heff->GetYaxis()->SetTitleOffset(1.5);
227 heff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
228 heff->GetXaxis()->SetTitleOffset(1.2);
229 heff->SetMarkerStyle(20);
230 heff->SetMarkerSize(1.2);
231 heff->SetMarkerColor(col[i]);
232 heff->GetXaxis()->SetRangeUser(0.0, ptmax);
233 heff->GetYaxis()->SetRangeUser(0.0, 1.05);
237 heff->DrawCopy(
"p same");
239 TLine *unit =
new TLine(0,1.0,40,1.0);
245 fin->GetObject(
"h2",hdca2d);
247 hdca2d->Draw(
"colz");
249 binlow = hdca2d->GetXaxis()->FindBin(slice_low);
250 binhigh = hdca2d->GetXaxis()->FindBin(slice_high);
251 TH1D* hdcaxyslice = hdca2d->ProjectionY(
"hdcaxyslice",binlow, binhigh);
252 hdcaxyslice->SetLineColor(col[i]);
255 hdcaxyslice->Fit(
"gaus");
258 hdca2d->FitSlicesY();
259 TH1D*hdcares = (TH1D*)gDirectory->Get(
"h2_2");
260 hdcares->GetYaxis()->SetTitleOffset(2.1);
261 hdcares->GetYaxis()->SetTitle(
"DCA(r#phi) (cm)");
262 hdcares->GetXaxis()->SetTitleOffset(1.2);
263 hdcares->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
264 hdcares->SetMarkerStyle(20);
265 hdcares->SetMarkerSize(1.2);
266 hdcares->SetMarkerColor(col[i]);
267 hdcares->GetYaxis()->SetRangeUser(0, 0.008);
269 hdcares->DrawCopy(
"p");
271 hdcares->DrawCopy(
"p same");
275 fin->GetObject(
"h3",hdcaZ2d);
277 hdcaZ2d->Draw(
"colz");
279 binlow = hdcaZ2d->GetXaxis()->FindBin(slice_low);
280 binhigh = hdcaZ2d->GetXaxis()->FindBin(slice_high);
281 TH1D* hdcazslice = hdcaZ2d->ProjectionY(
"hdcazslice",binlow, binhigh);
282 hdcazslice->SetLineColor(col[i]);
285 hdcazslice->Fit(
"gaus");
288 hdcaZ2d->FitSlicesY(fz);
289 TH1D* hdcaZres = (TH1D*)gDirectory->Get(
"h3_2");
291 hdcaZres->GetYaxis()->SetTitleOffset(2.1);
292 hdcaZres->GetYaxis()->SetTitle(
"DCA(Z) (cm)");
293 hdcaZres->GetXaxis()->SetTitleOffset(1.2);
294 hdcaZres->GetXaxis()->SetTitle(
"p_{T} (GeV/c");
295 hdcaZres->SetMarkerStyle(20);
296 hdcaZres->SetMarkerSize(1.2);
297 hdcaZres->SetMarkerColor(col[i]);
298 hdcaZres->GetYaxis()->SetRangeUser(0, 0.015);
300 hdcaZres->DrawCopy(
"p");
302 hdcaZres->DrawCopy(
"p same");
307 fin->GetObject(
"h6",hnmvtx);
308 if(!hnmvtx) cout <<
" Did not get hnmvtx" << endl;
312 binlow = hnmvtx->GetYaxis()->FindBin(0.5);
313 binhigh = hnmvtx->GetYaxis()->FindBin(3.5);
314 cout <<
"binlow " << binlow <<
" binhigh " << binhigh << endl;
315 TH1D *hnmaps_hit = hnmvtx->ProjectionX(
"hnmaps_hit",binlow, binhigh);;
317 binlow = hnmvtx->GetYaxis()->FindBin(-0.5);
318 binhigh = hnmvtx->GetYaxis()->FindBin(3.5);
319 cout <<
"binlow " << binlow <<
" binhigh " << binhigh << endl;
320 TH1D *hnmaps_all = hnmvtx->ProjectionX(
"hnmaps_all",binlow, binhigh);;
322 TH1D *hnmaps = (TH1D*) hnmaps_all->Clone();
323 for(
int i=1;i<=hnmaps_hit->GetNbinsX();++
i)
325 double hit = hnmaps_hit->GetBinContent(i);
326 double all = hnmaps_all->GetBinContent(i);
332 hnmaps->SetBinContent(i, eff);
335 hnmaps->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
336 hnmaps->GetYaxis()->SetTitle(
"MVTX association efficiency");
337 hnmaps->GetYaxis()->SetTitleOffset(1.5);
338 hnmaps->GetXaxis()->SetTitleOffset(1.2);
339 hnmaps->SetMinimum(0);
340 hnmaps->SetMaximum(1.1);
341 hnmaps->SetMarkerStyle(20);
342 hnmaps->SetMarkerSize(1.5);
343 hnmaps->SetMarkerColor(col[i]);
347 hnmaps->DrawCopy(
"p");
351 hnmaps->DrawCopy(
"p same");
357 cout <<
" hnmaps bins " << hnmaps->GetNbinsX() <<
" heff bins " << heff->GetNbinsX() << endl;
359 cout << heff->GetNbinsX() << endl;
361 TH1D *hcomb = (TH1D*) hnmaps->Clone();
362 for(
int icomb=1; icomb< hnmaps->GetNbinsX(); ++icomb)
364 double vmaps = hnmaps->GetBinContent(icomb);
365 double vtrack = heff->GetBinContent(icomb) / 3;
367 eff = vmaps * vtrack;
369 hcomb->SetBinContent(icomb, eff);
372 hcomb->GetXaxis()->SetRangeUser(0,39);
373 hcomb->GetYaxis()->SetTitle(
"Efficincy of MVTX associated tracks");
375 TLine *unit2 =
new TLine(0,1.0,39,1.0);
379 hcomb->DrawCopy(
"p");
383 hcomb->DrawCopy(
"p same");
387 cpt->cd(2); lpd->Draw();
389 cdcaxy->cd(); lpd->Draw();
391 cdcaZ->cd(); lpd->Draw();
393 ceff->cd(); lpd->Draw();
395 cmvtx->cd(); lpd->Draw();
397 ccomb->cd(); lpd->Draw();