14 #include "sPhenixStyle.C"
28 bool toymodel =
false;
30 static const int NPLOTS = 2;
35 char label[NPLOTS][500];
50 fin[0] =
new TFile(
"root_files/look_purity_out_100pions_80ns_baseline_noMVTX.root");
51 fin[1] =
new TFile(
"root_files/look_purity_out_central_167khz_80ns_1-5");
52 sprintf(label[0],
"100pions");
53 sprintf(label[1],
"Central+store average lumi+100pions");
60 TGraph *gdcaZ[NPLOTS];
62 TGraph *grdpt[NPLOTS];
64 int col[3] = {kRed, kBlue, kBlack};
66 for(
int i=0;
i<NPLOTS;
i++)
70 cout <<
"Did not find file " << i <<
" quit!" << endl;
74 fin[
i]->GetObject(
"single_track_efficiency",geff[i]);
75 fin[
i]->GetObject(
"dca2d_resolution",gdca[i]);
76 fin[
i]->GetObject(
"dcaZ_resolution",gdcaZ[i]);
77 fin[
i]->GetObject(
"pt_resolution",grdpt[i]);
81 cout <<
"Failed to find geff for " << i << endl;
87 cout <<
"Failed to find gdca for " << i << endl;
92 cout <<
"Failed to find gdcaZ for " << i << endl;
97 cout <<
"Failed to find grdpt for " << i << endl;
106 sprintf(lab,
"100 pion events");
109 TCanvas *ceff =
new TCanvas(
"ceff",
"ceff",50,50,800,800);
112 TH1F *hd =
new TH1F(
"hd",
"hd",100, 0.0, hptmax);
115 hd->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
116 hd->GetXaxis()->SetTitleOffset(1.15);
117 hd->GetYaxis()->SetTitle(
"Single track efficiency");
118 hd->GetYaxis()->SetTitleOffset(1.3);
121 for(
int i=0;
i<NPLOTS;
i++)
123 geff[
i]->SetMarkerColor(col[
i]);
128 geff[
i]->Draw(
"same p");
131 TLegend *lpd =
new TLegend(0.30, 0.45, 0.95, 0.65,
"",
"NDC");
132 lpd->SetBorderSize(0);
133 lpd->SetFillColor(0);
134 lpd->SetFillStyle(0);
135 for(
int i=0;
i<NPLOTS;
i++)
137 lpd->AddEntry(geff[
i],label[i],
"p");
141 TLine *unit =
new TLine(0,1.0,40,1.0);
142 unit->SetLineStyle(3);
143 unit->SetLineWidth(1);
149 TCanvas *cdca =
new TCanvas(
"cdca",
"cdca",50,50,800,800);
153 TH1F *hdca =
new TH1F(
"hdca",
"hdca",100, 0.0, hptmax);
154 hdca->SetMinimum(0.0003);
155 hdca->SetMaximum(0.02);
156 hdca->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
157 hdca->GetXaxis()->SetTitleOffset(1.25);
158 hdca->GetYaxis()->SetTitle(
"DCA(r#phi) resolution (cm)");
159 hdca->GetYaxis()->SetTitleOffset(1.4);
164 for(
int i=0;
i<NPLOTS;
i++)
166 gdca[
i]->SetMarkerColor(col[
i]);
171 gdca[
i]->Draw(
"same p");
174 TLegend *lpd1 =
new TLegend(0.30, 0.7, 0.95, 0.92,
"",
"NDC");
175 lpd1->SetBorderSize(0);
176 lpd1->SetFillColor(0);
177 lpd1->SetFillStyle(0);
178 for(
int i=0;
i<NPLOTS;
i++)
180 lpd1->AddEntry(gdca[
i],label[i],
"p");
185 TCanvas *cdcaz =
new TCanvas(
"cdcaz",
"cdcaz",50,50,800,800);
188 TH1F *hdcaz =
new TH1F(
"hdcaz",
"hdcaz",100, 0.0, hptmax);
189 hdcaz->SetMinimum(0.0003);
190 hdcaz->SetMaximum(0.02);
191 hdcaz->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
192 hdcaz->GetXaxis()->SetTitleOffset(1.25);
193 hdcaz->GetYaxis()->SetTitle(
"DCA(Z) resolution (cm)");
194 hdcaz->GetYaxis()->SetTitleOffset(1.4);
199 for(
int i=0;
i<NPLOTS;
i++)
201 gdcaZ[
i]->SetMarkerColor(col[
i]);
206 gdcaZ[
i]->Draw(
"same p");
209 TLegend *lpd1z =
new TLegend(0.30, 0.70, 0.95, 0.92,
"",
"NDC");
210 lpd1z->SetBorderSize(0);
211 lpd1z->SetFillColor(0);
212 lpd1z->SetFillStyle(0);
213 lpd1z->AddEntry(geff[0],label[0],
"p");
214 lpd1z->AddEntry(geff[1], label[1],
"p");
218 double hdptmax = 40.0;
221 TCanvas *crdpt =
new TCanvas(
"crdpt",
"crdpt",50,50,800,800);
224 TH1F *hrdpt =
new TH1F(
"hrdpt",
"hrdpt",100, 0.0, hdptmax);
225 hrdpt->SetMinimum(0.0);
226 hrdpt->SetMaximum(0.11);
227 hrdpt->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
228 hrdpt->GetXaxis()->SetTitleOffset(1.25);
229 hrdpt->GetYaxis()->SetTitle(
"#Delta p_{T} / p_{T}");
230 hrdpt->GetYaxis()->SetTitleOffset(1.5);
233 for(
int i=0;
i<NPLOTS;
i++)
235 grdpt[
i]->SetMarkerColor(col[
i]);
240 grdpt[
i]->Draw(
"same p");
243 TLegend *lpd2 =
new TLegend(0.15, 0.72, 0.85, 0.87,
"",
"NDC");
244 lpd2->SetBorderSize(0);
245 lpd2->SetFillColor(0);
246 lpd2->SetFillStyle(0);
247 lpd2->AddEntry(grdpt[0], label[0],
"p");
248 lpd2->AddEntry(grdpt[1], label[1],
"p");