]>
Commit | Line | Data |
---|---|---|
22d1b439 | 1 | /////////////////////////////////////////////////////////// |
2 | // PlotAndSave.C (called by AODQAChecks.C) // | |
3 | // // | |
4 | // Written by John Groh // | |
5 | /////////////////////////////////////////////////////////// | |
6 | ||
7 | void PlotAndSave(Int_t runs[], | |
8 | const Int_t nRuns, | |
9 | Bool_t useMC, | |
10 | TFile*& fout, | |
11 | ||
12 | TH1F*& TPCnsigMeanTrendPion, | |
13 | TH1F*& TPCnsigMeanTrendKaon, | |
14 | TH1F*& TPCnsigMeanTrendProton, | |
15 | TH1F*& TPCnsigSigmaTrendPion, | |
16 | TH1F*& TPCnsigSigmaTrendKaon, | |
17 | TH1F*& TPCnsigSigmaTrendProton, | |
18 | TH1F*& TOFnsigMeanTrendPion, | |
19 | TH1F*& TOFnsigMeanTrendKaon, | |
20 | TH1F*& TOFnsigMeanTrendProton, | |
21 | TH1F*& TOFnsigSigmaTrendPion, | |
22 | TH1F*& TOFnsigSigmaTrendKaon, | |
23 | TH1F*& TOFnsigSigmaTrendProton, | |
24 | ||
25 | TH1F*& IntegRawYieldAll, | |
26 | TH1F*& IntegRawYieldPiPlus, | |
27 | TH1F*& IntegRawYieldKPlus, | |
28 | TH1F*& IntegRawYieldProton, | |
29 | TH1F*& IntegRawYieldPiMinus, | |
30 | TH1F*& IntegRawYieldKMinus, | |
31 | TH1F*& IntegRawYieldAntiproton, | |
32 | ||
33 | TH1F*& EfficiencyPiPlus, | |
34 | TH1F*& EfficiencyKPlus, | |
35 | TH1F*& EfficiencyProton, | |
36 | TH1F*& EfficiencyPiMinus, | |
37 | TH1F*& EfficiencyKMinus, | |
38 | TH1F*& EfficiencyAntiproton, | |
39 | ||
40 | TH1F*& MatchEffPos, | |
41 | TH1F*& MatchEffNeg) | |
42 | { | |
43 | Printf("\n\n\n--- Entering funtion PlotAndSave() ---\n\n\n"); | |
44 | ||
45 | // this gets rid of scientific notation for run numbers on the axes below | |
46 | TGaxis::SetMaxDigits(7); | |
47 | ||
48 | //----------------------------------------------------------------------------------------- | |
49 | // Draw the trends in the means and sigmas of the fits to the peaks of the projections at - | |
50 | // fixed Pt as a function of the run number - | |
51 | //----------------------------------------------------------------------------------------- | |
52 | TCanvas * cNSigmaStability = new TCanvas("cNSigmaStability","cNSigmaStability",100,50,700,500); | |
53 | cNSigmaStability->Divide(2,2); | |
54 | // TPC means | |
55 | cNSigmaStability->cd(1); | |
56 | TH2F * hAxesTPCnsigMeans = new TH2F("hAxesTPCnsigMeans","",nRuns,0,nRuns,100,-2,2); | |
57 | hAxesTPCnsigMeans->GetYaxis()->SetTitle("TPC nsigma particle peak means"); | |
58 | hAxesTPCnsigMeans->SetStats(kFALSE); | |
59 | for (Int_t irun=0; irun<nRuns; irun++) | |
60 | hAxesTPCnsigMeans->GetXaxis()->SetBinLabel(irun+1, Form("%i",runs[irun])); | |
61 | hAxesTPCnsigMeans->DrawCopy(); | |
62 | TLegend * lTPCMeans = new TLegend(0.7,0.15,0.85,0.35); | |
63 | TPCnsigMeanTrendPion->SetMarkerStyle(Marker[0]); | |
64 | TPCnsigMeanTrendPion->SetMarkerColor(Color[0]); | |
65 | TPCnsigMeanTrendPion->SetLineColor(Color[0]); | |
66 | TPCnsigMeanTrendPion->SetStats(kFALSE); | |
67 | TPCnsigMeanTrendPion->DrawCopy("E1X0Psame"); | |
68 | lTPCMeans->AddEntry(TPCnsigMeanTrendPion,"#pi^{+}, #pi^{-}","lpe"); | |
69 | TPCnsigMeanTrendKaon->SetMarkerStyle(Marker[1]); | |
70 | TPCnsigMeanTrendKaon->SetMarkerColor(Color[1]); | |
71 | TPCnsigMeanTrendKaon->SetLineColor(Color[1]); | |
72 | TPCnsigMeanTrendKaon->SetStats(kFALSE); | |
73 | TPCnsigMeanTrendKaon->DrawCopy("E1X0Psame"); | |
74 | lTPCMeans->AddEntry(TPCnsigMeanTrendKaon,"K^{+}, K^{-}","lpe"); | |
75 | TPCnsigMeanTrendProton->SetMarkerStyle(Marker[2]); | |
76 | TPCnsigMeanTrendProton->SetMarkerColor(Color[2]); | |
77 | TPCnsigMeanTrendProton->SetLineColor(Color[2]); | |
78 | TPCnsigMeanTrendProton->SetStats(kFALSE); | |
79 | TPCnsigMeanTrendProton->DrawCopy("E1X0Psame"); | |
80 | lTPCMeans->AddEntry(TPCnsigMeanTrendProton,"p, #bar{p}","lpe"); | |
81 | lTPCMeans->SetFillColor(0); | |
82 | lTPCMeans->DrawClone(); | |
83 | // TPC sigmas | |
84 | cNSigmaStability->cd(3); | |
85 | TH2F * hAxesTPCnsigSigmas = new TH2F("hAxesTPCnsigSigmas","",nRuns,0,nRuns,100,-1,3); | |
86 | hAxesTPCnsigSigmas->GetYaxis()->SetTitle("TPC nsigma particle peak sigmas"); | |
87 | hAxesTPCnsigSigmas->SetStats(kFALSE); | |
88 | for (Int_t irun=0; irun<nRuns; irun++) | |
89 | hAxesTPCnsigSigmas->GetXaxis()->SetBinLabel(irun+1, Form("%i",runs[irun])); | |
90 | hAxesTPCnsigSigmas->DrawCopy(); | |
91 | TPCnsigSigmaTrendPion->SetMarkerStyle(Marker[0]); | |
92 | TPCnsigSigmaTrendPion->SetMarkerColor(Color[0]); | |
93 | TPCnsigSigmaTrendPion->SetLineColor(Color[0]); | |
94 | TPCnsigSigmaTrendPion->SetStats(kFALSE); | |
95 | TPCnsigSigmaTrendPion->DrawCopy("X0E1Psame"); | |
96 | TPCnsigSigmaTrendKaon->SetMarkerStyle(Marker[1]); | |
97 | TPCnsigSigmaTrendKaon->SetMarkerColor(Color[1]); | |
98 | TPCnsigSigmaTrendKaon->SetLineColor(Color[1]); | |
99 | TPCnsigSigmaTrendKaon->SetStats(kFALSE); | |
100 | TPCnsigSigmaTrendKaon->DrawCopy("X0E1Psame"); | |
101 | TPCnsigSigmaTrendProton->SetMarkerStyle(Marker[2]); | |
102 | TPCnsigSigmaTrendProton->SetMarkerColor(Color[2]); | |
103 | TPCnsigSigmaTrendProton->SetLineColor(Color[2]); | |
104 | TPCnsigSigmaTrendProton->SetStats(kFALSE); | |
105 | TPCnsigSigmaTrendProton->DrawCopy("X0E1Psame"); | |
106 | TLegend * lTPCSigmas = new TLegend(0.7,0.15,0.85,0.35); | |
107 | lTPCSigmas->AddEntry(TPCnsigSigmaTrendPion,"#pi^{+}, #pi^{-}","lpe"); | |
108 | lTPCSigmas->AddEntry(TPCnsigSigmaTrendKaon,"K^{+}, K^{-}","lpe"); | |
109 | lTPCSigmas->AddEntry(TPCnsigSigmaTrendProton,"p, #bar{p}","lpe"); | |
110 | lTPCSigmas->SetFillColor(0); | |
111 | lTPCSigmas->DrawClone(); | |
112 | // TOF means | |
113 | cNSigmaStability->cd(2); | |
114 | TH2F * hAxesTOFnsigMeans = new TH2F("hAxesTOFnsigMeans","",nRuns,0,nRuns,100,-2,2); | |
115 | hAxesTOFnsigMeans->GetYaxis()->SetTitle("TOF nsigma particle peak means"); | |
116 | hAxesTOFnsigMeans->SetStats(kFALSE); | |
117 | for (Int_t irun=0; irun<nRuns; irun++) | |
118 | hAxesTOFnsigMeans->GetXaxis()->SetBinLabel(irun+1, Form("%i",runs[irun])); | |
119 | hAxesTOFnsigMeans->DrawCopy(); | |
120 | TOFnsigMeanTrendPion->SetMarkerStyle(Marker[0]); | |
121 | TOFnsigMeanTrendPion->SetMarkerColor(Color[0]); | |
122 | TOFnsigMeanTrendPion->SetLineColor(Color[0]); | |
123 | TOFnsigMeanTrendPion->SetStats(kFALSE); | |
124 | TOFnsigMeanTrendPion->DrawCopy("X0E1Psame"); | |
125 | TOFnsigMeanTrendKaon->SetMarkerStyle(Marker[1]); | |
126 | TOFnsigMeanTrendKaon->SetMarkerColor(Color[1]); | |
127 | TOFnsigMeanTrendKaon->SetLineColor(Color[1]); | |
128 | TOFnsigMeanTrendKaon->SetStats(kFALSE); | |
129 | TOFnsigMeanTrendKaon->DrawCopy("X0E1Psame"); | |
130 | TOFnsigMeanTrendProton->SetMarkerStyle(Marker[2]); | |
131 | TOFnsigMeanTrendProton->SetMarkerColor(Color[2]); | |
132 | TOFnsigMeanTrendProton->SetLineColor(Color[2]); | |
133 | TOFnsigMeanTrendProton->SetStats(kFALSE); | |
134 | TOFnsigMeanTrendProton->DrawCopy("X0E1Psame"); | |
135 | TLegend * lTOFMeans = new TLegend(0.7,0.15,0.85,0.35); | |
136 | lTOFMeans->AddEntry(TOFnsigMeanTrendPion,"#pi^{+}, #pi^{-}","lpe"); | |
137 | lTOFMeans->AddEntry(TOFnsigMeanTrendKaon,"K^{+}, K^{-}","lpe"); | |
138 | lTOFMeans->AddEntry(TOFnsigMeanTrendProton,"p, #bar{p}","lpe"); | |
139 | lTOFMeans->SetFillColor(0); | |
140 | lTOFMeans->DrawClone(); | |
141 | // TOF sigmas | |
142 | cNSigmaStability->cd(4); | |
143 | TH2F * hAxesTOFnsigSigmas = new TH2F("hAxesTOFnsigSigmas","",nRuns,0,nRuns,100,-1,2); | |
144 | hAxesTOFnsigSigmas->GetYaxis()->SetTitle("TOF nsigma particle peak sigmas"); | |
145 | hAxesTOFnsigSigmas->SetStats(kFALSE); | |
146 | for (Int_t irun=0; irun<nRuns; irun++) | |
147 | hAxesTOFnsigSigmas->GetXaxis()->SetBinLabel(irun+1, Form("%i",runs[irun])); | |
148 | hAxesTOFnsigSigmas->DrawCopy(); | |
149 | TOFnsigSigmaTrendPion->SetMarkerStyle(Marker[0]); | |
150 | TOFnsigSigmaTrendPion->SetMarkerColor(Color[0]); | |
151 | TOFnsigSigmaTrendPion->SetLineColor(Color[0]); | |
152 | TOFnsigSigmaTrendPion->SetStats(kFALSE); | |
153 | TOFnsigSigmaTrendPion->DrawCopy("X0E1Psame"); | |
154 | TOFnsigSigmaTrendKaon->SetMarkerStyle(Marker[1]); | |
155 | TOFnsigSigmaTrendKaon->SetMarkerColor(Color[1]); | |
156 | TOFnsigSigmaTrendKaon->SetLineColor(Color[1]); | |
157 | TOFnsigSigmaTrendKaon->SetStats(kFALSE); | |
158 | TOFnsigSigmaTrendKaon->DrawCopy("X0E1Psame"); | |
159 | TOFnsigSigmaTrendProton->SetMarkerStyle(Marker[2]); | |
160 | TOFnsigSigmaTrendProton->SetMarkerColor(Color[2]); | |
161 | TOFnsigSigmaTrendProton->SetLineColor(Color[2]); | |
162 | TOFnsigSigmaTrendProton->SetStats(kFALSE); | |
163 | TOFnsigSigmaTrendProton->DrawCopy("X0E1Psame"); | |
164 | TLegend * lTOFSigmas = new TLegend(0.7,0.15,0.85,0.35); | |
165 | lTOFSigmas->AddEntry(TOFnsigSigmaTrendPion,"#pi^{+}, #pi^{-}","lpe"); | |
166 | lTOFSigmas->AddEntry(TOFnsigSigmaTrendKaon,"K^{+}, K^{-}","lpe"); | |
167 | lTOFSigmas->AddEntry(TOFnsigSigmaTrendProton,"p, #bar{p}","lpe"); | |
168 | lTOFSigmas->SetFillColor(0); | |
169 | lTOFSigmas->DrawClone(); | |
170 | // write the canvas to the file | |
171 | fout->cd(); | |
172 | cNSigmaStability->Write(); | |
173 | ||
174 | //------------------------------------------------------------------------------ | |
175 | // Draw the trends in the integrated raw yield as a function of the run number - | |
176 | //------------------------------------------------------------------------------ | |
177 | TCanvas * cIntegRawYieldStability = new TCanvas("cIntegRawYieldStability","cIntegRawYieldStability",150,75,700,500); | |
178 | gPad->SetLogy(); | |
179 | TLegend * lIntegRawYield = new TLegend(0.75,0.4,0.85,0.6); | |
180 | lIntegRawYield->SetFillColor(0); | |
181 | // all particles | |
182 | for (Int_t irun=0; irun<nRuns; irun++) | |
183 | IntegRawYieldAll->GetXaxis()->SetBinLabel(irun+1, Form("%i",runs[irun])); | |
184 | IntegRawYieldAll->SetTitle("Raw Yield, Integrated over all p_{T}"); | |
185 | IntegRawYieldAll->SetStats(kFALSE); | |
186 | IntegRawYieldAll->SetMarkerStyle(34); | |
187 | IntegRawYieldAll->SetMarkerColor(kGreen); | |
188 | IntegRawYieldAll->SetLineColor(kGreen); | |
189 | IntegRawYieldAll->GetYaxis()->SetRangeUser(50,10000); | |
190 | IntegRawYieldAll->DrawCopy("E1X0P"); | |
191 | lIntegRawYield->AddEntry(IntegRawYieldAll,"All Particles","p"); | |
192 | // pi+ | |
193 | IntegRawYieldPiPlus->SetMarkerStyle(Marker[0]); | |
194 | IntegRawYieldPiPlus->SetMarkerColor(Color[0]); | |
195 | IntegRawYieldPiPlus->SetLineColor(Color[0]); | |
196 | IntegRawYieldPiPlus->DrawCopy("E1X0Psame"); | |
197 | lIntegRawYield->AddEntry(IntegRawYieldPiPlus,"#pi^{+}","p"); | |
198 | // K+ | |
199 | IntegRawYieldKPlus->SetMarkerStyle(Marker[1]); | |
200 | IntegRawYieldKPlus->SetMarkerColor(Color[1]); | |
201 | IntegRawYieldKPlus->SetLineColor(Color[1]); | |
202 | IntegRawYieldKPlus->DrawCopy("E1X0Psame"); | |
203 | lIntegRawYield->AddEntry(IntegRawYieldKPlus,"K^{+}","p"); | |
204 | // Proton | |
205 | IntegRawYieldProton->SetMarkerStyle(Marker[2]); | |
206 | IntegRawYieldProton->SetMarkerColor(Color[2]); | |
207 | IntegRawYieldProton->SetLineColor(Color[2]); | |
208 | IntegRawYieldProton->DrawCopy("E1X0Psame"); | |
209 | lIntegRawYield->AddEntry(IntegRawYieldProton,"p","p"); | |
210 | // pi- | |
211 | IntegRawYieldPiMinus->SetMarkerStyle(Marker[3]); | |
212 | IntegRawYieldPiMinus->SetMarkerColor(Color[0]); | |
213 | IntegRawYieldPiMinus->SetLineColor(Color[0]); | |
214 | IntegRawYieldPiMinus->DrawCopy("E1X0Psame"); | |
215 | lIntegRawYield->AddEntry(IntegRawYieldPiMinus,"#pi^{-}","p"); | |
216 | // K- | |
217 | IntegRawYieldKMinus->SetMarkerStyle(Marker[4]); | |
218 | IntegRawYieldKMinus->SetMarkerColor(Color[1]); | |
219 | IntegRawYieldKMinus->SetLineColor(Color[1]); | |
220 | IntegRawYieldKMinus->DrawCopy("E1X0Psame"); | |
221 | lIntegRawYield->AddEntry(IntegRawYieldKMinus,"K^{-}","p"); | |
222 | // Antiproton | |
223 | IntegRawYieldAntiproton->SetMarkerStyle(Marker[5]); | |
224 | IntegRawYieldAntiproton->SetMarkerColor(Color[2]); | |
225 | IntegRawYieldAntiproton->SetLineColor(Color[2]); | |
226 | IntegRawYieldAntiproton->SetTitle("Raw Yield, Integrated over all p_{T}"); | |
227 | IntegRawYieldAntiproton->DrawCopy("E1X0Psame"); | |
228 | lIntegRawYield->AddEntry(IntegRawYieldAntiproton,"#bar{p}","p"); | |
229 | // write the canvas to the file | |
230 | lIntegRawYield->DrawClone(); | |
231 | fout->cd(); | |
232 | cIntegRawYieldStability->Write(); | |
233 | ||
234 | //------------------------------------------------------ | |
235 | // Plot the efficiency as a function of the run number - | |
236 | //------------------------------------------------------ | |
237 | if (useMC) | |
238 | { | |
239 | TCanvas * cEfficiencyRun = new TCanvas("cEfficiencyRun","cEfficiencyRun",200,100,700,500); | |
240 | TH2F * hAxesEfficiency = new TH2F("hAxesEfficiency","MC Correction Factor at p_{T} = 0.9 GeV/c",nRuns,0,nRuns,100,0,1); | |
241 | for (Int_t irun=0; irun<nRuns; irun++) | |
242 | hAxesEfficiency->GetXaxis()->SetBinLabel(irun+1, Form("%i",runs[irun])); | |
243 | hAxesEfficiency->SetStats(kFALSE); | |
244 | hAxesEfficiency->DrawCopy(); | |
245 | TLegend * lEfficiency = new TLegend(.79,.69,.99,.99); | |
246 | // pi+ | |
247 | EfficiencyPiPlus->SetMarkerStyle(Marker[0]); | |
248 | EfficiencyPiPlus->SetMarkerColor(Color[0]); | |
249 | EfficiencyPiPlus->SetLineColor(Color[0]); | |
250 | EfficiencyPiPlus->DrawCopy("E1X0Psame"); | |
251 | lEfficiency->AddEntry(EfficiencyPiPlus,"#pi^{+}","lpe"); | |
252 | // K+ | |
253 | EfficiencyKPlus->SetMarkerStyle(Marker[1]); | |
254 | EfficiencyKPlus->SetMarkerColor(Color[1]); | |
255 | EfficiencyKPlus->SetLineColor(Color[1]); | |
256 | EfficiencyKPlus->DrawCopy("E1X0Psame"); | |
257 | lEfficiency->AddEntry(EfficiencyKPlus,"K^{+}","p"); | |
258 | // Proton | |
259 | EfficiencyProton->SetMarkerStyle(Marker[2]); | |
260 | EfficiencyProton->SetMarkerColor(Color[2]); | |
261 | EfficiencyProton->SetLineColor(Color[2]); | |
262 | EfficiencyProton->DrawCopy("E1X0Psame"); | |
263 | lEfficiency->AddEntry(EfficiencyProton,"p","lpe"); | |
264 | // pi- | |
265 | EfficiencyPiMinus->SetMarkerStyle(Marker[3]); | |
266 | EfficiencyPiMinus->SetMarkerColor(Color[0]); | |
267 | EfficiencyPiMinus->SetLineColor(Color[0]); | |
268 | EfficiencyPiMinus->DrawCopy("E1X0Psame"); | |
269 | lEfficiency->AddEntry(EfficiencyPiMinus,"#pi^{-}","lpe"); | |
270 | // K- | |
271 | EfficiencyKMinus->SetMarkerStyle(Marker[4]); | |
272 | EfficiencyKMinus->SetMarkerColor(Color[1]); | |
273 | EfficiencyKMinus->SetLineColor(Color[1]); | |
274 | EfficiencyKMinus->DrawCopy("E1X0Psame"); | |
275 | lEfficiency->AddEntry(EfficiencyKMinus,"K^{-}","lpe"); | |
276 | // Antiproton | |
277 | EfficiencyAntiproton->SetMarkerStyle(Marker[5]); | |
278 | EfficiencyAntiproton->SetMarkerColor(Color[2]); | |
279 | EfficiencyAntiproton->SetLineColor(Color[2]); | |
280 | EfficiencyAntiproton->DrawCopy("E1X0Psame"); | |
281 | lEfficiency->AddEntry(EfficiencyAntiproton,"#bar{p}","lpe"); | |
282 | // draw legend | |
283 | lEfficiency->SetFillColor(0); | |
284 | lEfficiency->DrawClone(); | |
285 | // write the canvas to file | |
286 | fout->cd(); | |
287 | cEfficiencyRun->Write(); | |
288 | ||
289 | // write the last remaining canvas - cEfficienciesAllRuns - to file | |
290 | fout->cd(); | |
291 | cEfficienciesAllRuns->Write(); | |
292 | } | |
293 | ||
294 | //--------------------------------------------------------------- | |
295 | // Plot the matching efficiency as a function of the run number - | |
296 | //--------------------------------------------------------------- | |
297 | TCanvas * cMatchingEfficiency = new TCanvas("cMatchingEfficiency","cMatchingEfficiency",250,125,700,500); | |
298 | cMatchingEfficiency->cd(); | |
299 | TH2F * hAxesMatchEff = new TH2F("hAxesMatchEff","",nRuns,0,nRuns,100,0,1); | |
300 | hAxesMatchEff->SetTitle("TOF Matching Efficiency at p_{T} = 0.9 GeV/c;;"); | |
301 | for (Int_t irun=0; irun<nRuns; irun++) | |
302 | hAxesMatchEff->GetXaxis()->SetBinLabel(irun+1, Form("%i",runs[irun])); | |
303 | hAxesMatchEff->SetStats(kFALSE); | |
304 | hAxesMatchEff->DrawCopy(); | |
305 | TLegend * lMatchEff = new TLegend(.7,.75,.85,.85); | |
306 | lMatchEff->SetFillColor(0); | |
307 | // positive particles | |
308 | MatchEffPos->SetMarkerStyle(Marker[0]); | |
309 | MatchEffPos->SetMarkerColor(kBlue); | |
310 | MatchEffPos->SetLineColor(kBlue); | |
311 | MatchEffPos->DrawCopy("E1X0Psame"); | |
312 | lMatchEff->AddEntry(MatchEffPos,"Positive Particles","pe"); | |
313 | // negative particles | |
314 | MatchEffNeg->SetMarkerStyle(Marker[1]); | |
315 | MatchEffNeg->SetMarkerColor(kRed); | |
316 | MatchEffNeg->SetLineColor(kRed); | |
317 | MatchEffNeg->DrawCopy("E1X0Psame"); | |
318 | lMatchEff->AddEntry(MatchEffNeg,"Negative Particles","pe"); | |
319 | // write to file | |
320 | lMatchEff->DrawClone(); | |
321 | fout->cd(); | |
322 | cMatchingEfficiency->Write(); | |
323 | ||
324 | /* | |
325 | //------------------------- | |
326 | // nsigma Projection fits - | |
327 | //------------------------- | |
328 | TH1F * TPCnsigMeanPionProj = new TH1F("TPCnsigMeanPionProj","",100,-1,1); | |
329 | TH1F * TPCnsigMeanKaonProj = new TH1F("TPCnsigMeanKaonProj","",100,-1,1); | |
330 | TH1F * TPCnsigMeanProtonProj = new TH1F("TPCnsigMeanProtonProj","",100,-1,1); | |
331 | TH1F * TPCnsigSigmaPionProj = new TH1F("TPCnsigSigmaPionProj","",100,0,2); | |
332 | TH1F * TPCnsigSigmaKaonProj = new TH1F("TPCnsigSigmaKaonProj","",100,0,2); | |
333 | TH1F * TPCnsigSigmaProtonProj = new TH1F("TPCnsigSigmaProtonProj","",100,0,2); | |
334 | TH1F * TOFnsigMeanPionProj = new TH1F("TOFnsigMeanPionProj","",100,-1,1); | |
335 | TH1F * TOFnsigMeanKaonProj = new TH1F("TOFnsigMeanKaonProj","",100,-1,1); | |
336 | TH1F * TOFnsigMeanProtonProj = new TH1F("TOFnsigMeanProtonProj","",100,-1,1); | |
337 | TH1F * TOFnsigSigmaPionProj = new TH1F("TOFnsigSigmaPionProj","",100,0,2); | |
338 | TH1F * TOFnsigSigmaKaonProj = new TH1F("TOFnsigSigmaKaonProj","",100,0,2); | |
339 | TH1F * TOFnsigSigmaProtonProj = new TH1F("TOFnsigSigmaProtonProj","",100,0,2); | |
340 | for (Int_t irun=0; irun<nRuns; irun++) | |
341 | { | |
342 | TPCnsigMeanPionProj->Fill(TPCnsigMeanTrendPion->GetBinContent(irun+1)); | |
343 | TPCnsigMeanKaonProj->Fill(TPCnsigMeanTrendKaon->GetBinContent(irun+1)); | |
344 | TPCnsigMeanProtonProj->Fill(TPCnsigMeanTrendProton->GetBinContent(irun+1)); | |
345 | TPCnsigSigmaPionProj->Fill(TPCnsigSigmaTrendPion->GetBinContent(irun+1)); | |
346 | TPCnsigSigmaKaonProj->Fill(TPCnsigSigmaTrendKaon->GetBinContent(irun+1)); | |
347 | TPCnsigSigmaProtonProj->Fill(TPCnsigSigmaTrendProton->GetBinContent(irun+1)); | |
348 | TOFnsigMeanPionProj->Fill(TOFnsigMeanTrendPion->GetBinContent(irun+1)); | |
349 | TOFnsigMeanKaonProj->Fill(TOFnsigMeanTrendKaon->GetBinContent(irun+1)); | |
350 | TOFnsigMeanProtonProj->Fill(TOFnsigMeanTrendProton->GetBinContent(irun+1)); | |
351 | TOFnsigSigmaPionProj->Fill(TOFnsigSigmaTrendPion->GetBinContent(irun+1)); | |
352 | TOFnsigSigmaKaonProj->Fill(TOFnsigSigmaTrendKaon->GetBinContent(irun+1)); | |
353 | TOFnsigSigmaProtonProj->Fill(TOFnsigSigmaTrendProton->GetBinContent(irun+1)); | |
354 | } | |
355 | TCanvas * cNSigTrendProj = new TCanvas("cNSigTrendProj","cNSigTrendProj",300,150,700,500); | |
356 | cNSigTrendProj->Divide(2,2); | |
357 | // TPC Means | |
358 | cNSigTrendProj->cd(1); | |
359 | TH2F * hAxesTPCNSigMeanProj = new TH2F("hAxesTPCNSigMeanProj","",100,-1,1,100,0,80); | |
360 | hAxesTPCNSigMeanProj->SetStats(kFALSE); | |
361 | hAxesTPCNSigMeanProj->GetXaxis()->SetTitle("TPC nsigma Means"); | |
362 | hAxesTPCNSigMeanProj->GetYaxis()->SetTitle("Number of Runs"); | |
363 | hAxesTPCNSigMeanProj->DrawCopy(); | |
364 | TPCnsigMeanPionProj->SetMarkerStyle(Marker[0]); | |
365 | TPCnsigMeanPionProj->SetMarkerColor(Color[0]); | |
366 | TPCnsigMeanPionProj->SetLineColor(Color[0]); | |
367 | TPCnsigMeanPionProj->SetStats(kFALSE); | |
368 | TPCnsigMeanPionProj->DrawCopy("LPsame"); | |
369 | TPCnsigMeanKaonProj->SetMarkerStyle(Marker[1]); | |
370 | TPCnsigMeanKaonProj->SetMarkerColor(Color[1]); | |
371 | TPCnsigMeanKaonProj->SetLineColor(Color[1]); | |
372 | TPCnsigMeanKaonProj->SetStats(kFALSE); | |
373 | TPCnsigMeanKaonProj->DrawCopy("LPsame"); | |
374 | TPCnsigMeanProtonProj->SetMarkerStyle(Marker[1]); | |
375 | TPCnsigMeanProtonProj->SetMarkerColor(Color[2]); | |
376 | TPCnsigMeanProtonProj->SetLineColor(Color[2]); | |
377 | TPCnsigMeanProtonProj->SetStats(kFALSE); | |
378 | TPCnsigMeanProtonProj->DrawCopy("LPsame"); | |
379 | TLegend * lTPCNSigMeanProj = new TLegend(.65,.65,.85,.85); | |
380 | lTPCNSigMeanProj->AddEntry(TPCnsigMeanPionProj,"#pi^{+}, #pi^{-}","lp"); | |
381 | lTPCNSigMeanProj->AddEntry(TPCnsigMeanKaonProj,"K^{+}, K^{-}","lp"); | |
382 | lTPCNSigMeanProj->AddEntry(TPCnsigMeanProtonProj,"p, #bar{p}","lp"); | |
383 | lTPCNSigMeanProj->SetFillColor(0); | |
384 | lTPCNSigMeanProj->DrawClone(); | |
385 | // TPC Sigmas | |
386 | cNSigTrendProj->cd(3); | |
387 | TH2F * hAxesTPCNSigSigmaProj = new TH2F("hAxesTPCNSigSigmaProj","",100,0,2,100,0,80); | |
388 | hAxesTPCNSigSigmaProj->SetStats(kFALSE); | |
389 | hAxesTPCNSigSigmaProj->GetXaxis()->SetTitle("TPC nsigma Sigmas"); | |
390 | hAxesTPCNSigSigmaProj->GetYaxis()->SetTitle("Number of Runs"); | |
391 | hAxesTPCNSigSigmaProj->DrawCopy(); | |
392 | TPCnsigSigmaPionProj->SetMarkerStyle(Marker[0]); | |
393 | TPCnsigSigmaPionProj->SetMarkerColor(Color[0]); | |
394 | TPCnsigSigmaPionProj->SetLineColor(Color[0]); | |
395 | TPCnsigSigmaPionProj->SetStats(kFALSE); | |
396 | TPCnsigSigmaPionProj->DrawCopy("LPsame"); | |
397 | TPCnsigSigmaKaonProj->SetMarkerStyle(Marker[1]); | |
398 | TPCnsigSigmaKaonProj->SetMarkerColor(Color[1]); | |
399 | TPCnsigSigmaKaonProj->SetLineColor(Color[1]); | |
400 | TPCnsigSigmaKaonProj->SetStats(kFALSE); | |
401 | TPCnsigSigmaKaonProj->DrawCopy("LPsame"); | |
402 | TPCnsigSigmaProtonProj->SetMarkerStyle(Marker[2]); | |
403 | TPCnsigSigmaProtonProj->SetMarkerColor(Color[2]); | |
404 | TPCnsigSigmaProtonProj->SetLineColor(Color[2]); | |
405 | TPCnsigSigmaProtonProj->SetStats(kFALSE); | |
406 | TPCnsigSigmaProtonProj->DrawCopy("LPsame"); | |
407 | TLegend * lTPCNSigSigmaProj = new TLegend(.65,.65,.85,.85); | |
408 | lTPCNSigSigmaProj->AddEntry(TPCnsigSigmaPionProj,"#pi^{+}, #pi^{-}","lp"); | |
409 | lTPCNSigSigmaProj->AddEntry(TPCnsigSigmaKaonProj,"K^{+}, K^{-}","lp"); | |
410 | lTPCNSigSigmaProj->AddEntry(TPCnsigSigmaProtonProj,"p, #bar{p}","lp"); | |
411 | lTPCNSigSigmaProj->SetFillColor(0); | |
412 | lTPCNSigSigmaProj->DrawClone(); | |
413 | // TOF Means | |
414 | cNSigTrendProj->cd(2); | |
415 | TH2F * hAxesTOFNSigMeanProj = new TH2F("hAxesTOFNSigMeanProj","",100,-1,1,100,0,80); | |
416 | hAxesTOFNSigMeanProj->SetStats(kFALSE); | |
417 | hAxesTOFNSigMeanProj->GetXaxis()->SetTitle("TOF nsigma Means"); | |
418 | hAxesTOFNSigMeanProj->GetYaxis()->SetTitle("Number of Runs"); | |
419 | hAxesTOFNSigMeanProj->DrawCopy(); | |
420 | TOFnsigMeanPionProj->SetMarkerStyle(Marker[0]); | |
421 | TOFnsigMeanPionProj->SetMarkerColor(Color[0]); | |
422 | TOFnsigMeanPionProj->SetLineColor(Color[0]); | |
423 | TOFnsigMeanPionProj->SetStats(kFALSE); | |
424 | TOFnsigMeanPionProj->DrawCopy("LPsame"); | |
425 | TOFnsigMeanKaonProj->SetMarkerStyle(Marker[1]); | |
426 | TOFnsigMeanKaonProj->SetMarkerColor(Color[1]); | |
427 | TOFnsigMeanKaonProj->SetLineColor(Color[1]); | |
428 | TOFnsigMeanKaonProj->SetStats(kFALSE); | |
429 | TOFnsigMeanKaonProj->DrawCopy("LPsame"); | |
430 | TOFnsigMeanProtonProj->SetMarkerStyle(Marker[2]); | |
431 | TOFnsigMeanProtonProj->SetMarkerColor(Color[2]); | |
432 | TOFnsigMeanProtonProj->SetLineColor(Color[2]); | |
433 | TOFnsigMeanProtonProj->SetStats(kFALSE); | |
434 | TOFnsigMeanProtonProj->DrawCopy("LPsame"); | |
435 | TLegend * lTOFNSigMeanProj = new TLegend(.65,.65,.85,.85); | |
436 | lTOFNSigMeanProj->AddEntry(TOFnsigMeanPionProj,"#pi^{+}, #pi^{-}","lp"); | |
437 | lTOFNSigMeanProj->AddEntry(TOFnsigMeanKaonProj,"K^{+}, K^{-}","lp"); | |
438 | lTOFNSigMeanProj->AddEntry(TOFnsigMeanProtonProj,"p, #bar{p}","lp"); | |
439 | lTOFNSigMeanProj->SetFillColor(0); | |
440 | lTOFNSigMeanProj->DrawClone(); | |
441 | // TOF Sigmas | |
442 | cNSigTrendProj->cd(4); | |
443 | TH2F * hAxesTOFNSigSigmaProj = new TH2F("hAxesTOFNSigSigmaProj","",100,0,2,100,0,80); | |
444 | hAxesTOFNSigSigmaProj->SetStats(kFALSE); | |
445 | hAxesTOFNSigSigmaProj->GetXaxis()->SetTitle("TOF nsigma Sigmas"); | |
446 | hAxesTOFNSigSigmaProj->GetYaxis()->SetTitle("Number of Runs"); | |
447 | hAxesTOFNSigSigmaProj->DrawCopy(); | |
448 | TOFnsigSigmaPionProj->SetMarkerStyle(Marker[0]); | |
449 | TOFnsigSigmaPionProj->SetMarkerColor(Color[0]); | |
450 | TOFnsigSigmaPionProj->SetLineColor(Color[0]); | |
451 | TOFnsigSigmaPionProj->SetStats(kFALSE); | |
452 | TOFnsigSigmaPionProj->DrawCopy("LPsame"); | |
453 | TOFnsigSigmaKaonProj->SetMarkerStyle(Marker[1]); | |
454 | TOFnsigSigmaKaonProj->SetMarkerColor(Color[1]); | |
455 | TOFnsigSigmaKaonProj->SetLineColor(Color[1]); | |
456 | TOFnsigSigmaKaonProj->SetStats(kFALSE); | |
457 | TOFnsigSigmaKaonProj->DrawCopy("LPsame"); | |
458 | TOFnsigSigmaProtonProj->SetMarkerStyle(Marker[2]); | |
459 | TOFnsigSigmaProtonProj->SetMarkerColor(Color[2]); | |
460 | TOFnsigSigmaProtonProj->SetLineColor(Color[2]); | |
461 | TOFnsigSigmaProtonProj->SetStats(kFALSE); | |
462 | TOFnsigSigmaProtonProj->DrawCopy("LPsame"); | |
463 | TLegend * lTOFNSigSigmaProj = new TLegend(.65,.65,.85,.85); | |
464 | lTOFNSigSigmaProj->AddEntry(TOFnsigSigmaPionProj,"#pi^{+}, #pi^{-}","lp"); | |
465 | lTOFNSigSigmaProj->AddEntry(TOFnsigSigmaKaonProj,"K^{+}, K^{-}","lp"); | |
466 | lTOFNSigSigmaProj->AddEntry(TOFnsigSigmaProtonProj,"p, #bar{p}","lp"); | |
467 | lTOFNSigSigmaProj->SetFillColor(0); | |
468 | lTOFNSigSigmaProj->DrawClone(); | |
469 | // write to file | |
470 | fout->cd(); | |
471 | cNSigTrendProj->Write(); | |
472 | ||
473 | //----------------------- | |
474 | // Integrated Raw Yield - | |
475 | //----------------------- | |
476 | TH1F * IntegRawYieldProj = new TH1F("IntegRawYieldProj","",50,7500,9000); | |
477 | for (Int_t irun=0; irun<nRuns; irun++) | |
478 | { | |
479 | IntegRawYieldProj->Fill(IntegRawYieldAll->GetBinContent(irun+1)); | |
480 | } | |
481 | TCanvas * cIntegRawYieldProj = new TCanvas("cIntegRawYieldProj","cIntegRawYieldProj",350,175,700,500); | |
482 | cIntegRawYieldProj->cd(); | |
483 | IntegRawYieldProj->SetMarkerStyle(20); | |
484 | IntegRawYieldProj->SetMarkerColor(kBlack); | |
485 | IntegRawYieldProj->SetLineColor(kBlack); | |
486 | IntegRawYieldProj->SetStats(kFALSE); | |
487 | IntegRawYieldProj->GetXaxis()->SetTitle("Integrated Raw Yield (all particles)"); | |
488 | IntegRawYieldProj->GetYaxis()->SetTitle("Number of Runs"); | |
489 | IntegRawYieldProj->DrawCopy("hist"); | |
490 | // write to file | |
491 | fout->cd(); | |
492 | cIntegRawYieldProj->Write(); | |
493 | ||
494 | //--------------- | |
495 | // Efficiencies - | |
496 | //--------------- | |
497 | if (useMC) | |
498 | { | |
499 | TH1F * EffPiPlusProj = new TH1F("EffPiPlusProj","",100,0,1); | |
500 | TH1F * EffKPlusProj = new TH1F("EffKPlusProj","",100,0,1); | |
501 | TH1F * EffProtonProj = new TH1F("EffProtonProj","",100,0,1); | |
502 | TH1F * EffPiMinusProj = new TH1F("EffPiMinusProj","",100,0,1); | |
503 | TH1F * EffKMinusProj = new TH1F("EffKMinusProj","",100,0,1); | |
504 | TH1F * EffAntiprotonProj = new TH1F("EffAntiprotonProj","",100,0,1); | |
505 | for (Int_t irun=0; irun<nRuns; irun++) | |
506 | { | |
507 | EffPiPlusProj->Fill(EfficiencyPiPlus->GetBinContent(irun+1)); | |
508 | EffKPlusProj->Fill(EfficiencyKPlus->GetBinContent(irun+1)); | |
509 | EffProtonProj->Fill(EfficiencyProton->GetBinContent(irun+1)); | |
510 | EffPiMinusProj->Fill(EfficiencyPiMinus->GetBinContent(irun+1)); | |
511 | EffKMinusProj->Fill(EfficiencyKMinus->GetBinContent(irun+1)); | |
512 | EffAntiprotonProj->Fill(EfficiencyAntiproton->GetBinContent(irun+1)); | |
513 | } | |
514 | TCanvas * cEffProj = new TCanvas("cEffProj","cEffProj",400,200,700,500); | |
515 | cEffProj->cd(); | |
516 | TH2F * hAxesEffProj = new TH2F("hAxesEffProj","",100,0.35,1,100,0,60); | |
517 | hAxesEffProj->SetStats(kFALSE); | |
518 | hAxesEffProj->GetXaxis()->SetTitle("Efficiency"); | |
519 | hAxesEffProj->GetYaxis()->SetTitle("Number of Runs"); | |
520 | hAxesEffProj->DrawCopy(); | |
521 | EffPiPlusProj->SetLineColor(Color[0]); | |
522 | EffPiPlusProj->SetMarkerStyle(Marker[0]); | |
523 | EffPiPlusProj->SetMarkerColor(Color[0]); | |
524 | EffPiPlusProj->SetStats(kFALSE); | |
525 | EffPiPlusProj->DrawCopy("LPSame"); | |
526 | EffKPlusProj->SetLineColor(Color[1]); | |
527 | EffKPlusProj->SetMarkerStyle(Marker[1]); | |
528 | EffKPlusProj->SetMarkerColor(Color[1]); | |
529 | EffKPlusProj->SetStats(kFALSE); | |
530 | EffKPlusProj->DrawCopy("LPSame"); | |
531 | EffProtonProj->SetLineColor(Color[2]); | |
532 | EffProtonProj->SetMarkerStyle(Marker[2]); | |
533 | EffProtonProj->SetMarkerColor(Color[2]); | |
534 | EffProtonProj->SetStats(kFALSE); | |
535 | EffProtonProj->DrawCopy("LPSame"); | |
536 | EffPiMinusProj->SetLineColor(Color[0]); | |
537 | EffPiMinusProj->SetMarkerStyle(Marker[3]); | |
538 | EffPiMinusProj->SetMarkerColor(Color[0]); | |
539 | EffPiMinusProj->SetStats(kFALSE); | |
540 | EffPiMinusProj->DrawCopy("LPSame"); | |
541 | EffKMinusProj->SetLineColor(Color[1]); | |
542 | EffKMinusProj->SetMarkerStyle(Marker[4]); | |
543 | EffKMinusProj->SetMarkerColor(Color[1]); | |
544 | EffKMinusProj->SetStats(kFALSE); | |
545 | EffKMinusProj->DrawCopy("LPSame"); | |
546 | EffAntiprotonProj->SetLineColor(Color[2]); | |
547 | EffAntiprotonProj->SetMarkerStyle(Marker[5]); | |
548 | EffAntiprotonProj->SetMarkerColor(Color[2]); | |
549 | EffAntiprotonProj->SetStats(kFALSE); | |
550 | EffAntiprotonProj->DrawCopy("LPSame"); | |
551 | TLegend * lEffProj = new TLegend(.65,.65,.85,.85); | |
552 | lEffProj->AddEntry(EffPiPlusProj,"#pi^{+}","lp"); | |
553 | lEffProj->AddEntry(EffKPlusProj,"K^{+}","lp"); | |
554 | lEffProj->AddEntry(EffProtonProj,"lp","lp"); | |
555 | lEffProj->AddEntry(EffPiMinusProj,"#pi^{-}","lp"); | |
556 | lEffProj->AddEntry(EffKMinusProj,"K^{-}","lp"); | |
557 | lEffProj->AddEntry(EffAntiprotonProj,"#bar{p}","lp"); | |
558 | lEffProj->SetFillColor(0); | |
559 | lEffProj->DrawClone(); | |
560 | // save to file | |
561 | fout->cd(); | |
562 | cEffProj->Write(); | |
563 | } | |
564 | ||
565 | //------------------------ | |
566 | // Matching Efficiencies - | |
567 | //------------------------ | |
568 | // project the matching efficiency histograms onto the y-axis | |
569 | TH1F * MatchEffPosProj = new TH1F("MatchEffPosProj","",100,0.54,0.68); | |
570 | TH1F * MatchEffNegProj = new TH1F("MatchEffNegProj","",100,0.54,0.68); | |
571 | for (Int_t irun=0; irun<nRuns; irun++) | |
572 | { | |
573 | MatchEffPosProj->Fill(MatchEffPos->GetBinContent(irun+1)); | |
574 | MatchEffNegProj->Fill(MatchEffNeg->GetBinContent(irun+1)); | |
575 | } | |
576 | TCanvas * cMatchEffProj = new TCanvas("cMatchEffProj","cMatchEffProj",450,225,700,500); | |
577 | cMatchEffProj->cd(); | |
578 | MatchEffPosProj->SetMarkerStyle(20); | |
579 | MatchEffPosProj->SetMarkerColor(kBlue); | |
580 | MatchEffPosProj->SetLineColor(kBlue); | |
581 | MatchEffPosProj->SetStats(kFALSE); | |
582 | MatchEffPosProj->GetXaxis()->SetTitle("Matching Efficiency"); | |
583 | MatchEffPosProj->GetYaxis()->SetTitle("Number of Runs"); | |
584 | MatchEffPosProj->GetYaxis()->SetRangeUser(0,50); | |
585 | MatchEffPosProj->DrawCopy("LP"); | |
586 | MatchEffNegProj->SetMarkerStyle(21); | |
587 | MatchEffNegProj->SetMarkerColor(kRed); | |
588 | MatchEffNegProj->SetLineColor(kRed); | |
589 | MatchEffNegProj->SetStats(kFALSE); | |
590 | MatchEffNegProj->DrawCopy("LPsame"); | |
591 | TLegend * lMatchEffProj = new TLegend(0.75,0.75,0.85,0.85); | |
592 | lMatchEffProj->AddEntry(MatchEffPosProj,"Pos","lp"); | |
593 | lMatchEffProj->AddEntry(MatchEffNegProj,"Neg","lp"); | |
594 | lMatchEffProj->SetFillColor(0); | |
595 | lMatchEffProj->DrawClone(); | |
596 | // save to file | |
597 | fout->cd(); | |
598 | cMatchEffProj->Write(); | |
599 | */ | |
600 | ||
601 | Printf("\n\n\n--- Leaving function PlotAndSave() ---\n\n\n"); | |
602 | } |