]>
Commit | Line | Data |
---|---|---|
07b2bcd3 | 1 | /************************************************************************ |
2 | ||
3 | V0 QA Post-processing Macro | |
4 | --------------------------- | |
5 | ||
6 | To be used in conjunction with AliAnalysisTaskQAV0.cxx, .h | |
7 | Designed for visualization of the QA output from this task. | |
8 | ||
9 | Creates a "summary pdf" file with several pages, each referring to | |
10 | some aspect of the QA, including: | |
11 | ||
12 | --- Event Counters | |
13 | --- Topological Variables | |
14 | --- Invariant Mass Peak Widths (resolution) | |
15 | --- TPC dE/dx for daughters | |
16 | ||
17 | ************************************************************************/ | |
18 | ||
19 | ||
20 | PostProcessQAV0(Bool_t lAttemptInvMassFit = kTRUE){ | |
21 | CustomGStyleSettings(); | |
22 | ||
23 | //============================================================== | |
24 | //Open Output File | |
25 | TFile* file = TFile::Open("AnalysisResults.root", "READ"); | |
26 | if (!file){ | |
27 | cout<<"Output file not found!"<<endl; | |
28 | return; | |
29 | } | |
30 | file->cd("PWGLFQAV0_QA"); | |
31 | TList* clist = (TList*)file->FindObjectAny("clist"); | |
32 | if (!clist){ | |
33 | cout<<"File does not seem to hold QA list output!"<<endl; | |
34 | return; | |
35 | } | |
36 | //============================================================== | |
37 | ||
38 | //============================================================== | |
39 | //Open Event Histogram: first canvas | |
40 | TH1D* fHistEvent = (TH1D*)clist->FindObject("fHistEvent"); | |
41 | TCanvas *cHistEvent = new TCanvas("cHistEvent","",800,670); | |
42 | cHistEvent->SetTopMargin(0.15); | |
43 | cHistEvent->SetGridx(); | |
44 | cHistEvent->SetGridy(); | |
45 | fHistEvent->Draw(); | |
46 | ||
47 | fHistEvent->SetMarkerSize(1.35); | |
48 | fHistEvent->GetXaxis()->SetTitleOffset(1.2); | |
49 | fHistEvent->GetYaxis()->SetTitleOffset(1.2); | |
50 | fHistEvent->Draw("same text00"); | |
51 | ||
52 | TLatex Tl; | |
53 | Tl.SetNDC(); | |
54 | Tl.SetTextSize(0.05); | |
55 | Tl.DrawLatex(.35, .9277, "Event Counters") ; | |
56 | cHistEvent->SaveAs("V0_QA.pdf("); | |
57 | //============================================================== | |
58 | ||
59 | //============================================================== | |
60 | //Invariant Mass Plots: Base, no dE/dx | |
61 | /* | |
62 | TH2D *f2dHistInvMassK0Short = (TH2D*)clist->FindObject("f2dHistInvMassK0Short"); | |
63 | TH2D *f2dHistInvMassLambda = (TH2D*)clist->FindObject("f2dHistInvMassLambda"); | |
64 | TH2D *f2dHistInvMassAntiLambda = (TH2D*)clist->FindObject("f2dHistInvMassAntiLambda"); | |
65 | ||
66 | f2dHistInvMassK0Short -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
67 | f2dHistInvMassLambda -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
68 | f2dHistInvMassAntiLambda -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
69 | ||
70 | TCanvas *cInvMassK0Short = new TCanvas ( "cInvMassK0Short", "", 1200,800); | |
71 | cInvMassK0Short->Divide(1,2); | |
72 | cInvMassK0Short->cd(2)->Divide(3,1); | |
73 | cInvMassK0Short->cd(1); | |
74 | cInvMassK0Short->cd(1)->SetLogz(); | |
75 | cInvMassK0Short->cd(1)->SetLeftMargin(0.065); | |
76 | cInvMassK0Short->cd(1)->SetTopMargin(0.13); | |
77 | cInvMassK0Short->cd(1)->SetBottomMargin(0.11); | |
78 | ||
79 | f2dHistInvMassK0Short->GetYaxis()->SetTitleSize(0.05); | |
80 | f2dHistInvMassK0Short->GetYaxis()->SetTitleOffset(0.6); | |
81 | f2dHistInvMassK0Short->GetXaxis()->SetTitleSize(0.05); | |
82 | f2dHistInvMassK0Short->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
83 | f2dHistInvMassK0Short->GetZaxis()->SetTitle("Counts / Event"); | |
84 | f2dHistInvMassK0Short->GetZaxis()->SetTitleOffset(0.7); | |
85 | f2dHistInvMassK0Short->GetZaxis()->SetRangeUser( f2dHistInvMassK0Short->GetMinimum(1e-10)*0.9, f2dHistInvMassK0Short->GetMaximum()*1.2 ); | |
86 | f2dHistInvMassK0Short->Draw("colz"); | |
87 | Tl.DrawLatex(.35, .9277, "Mass under K^{0}_{S} hypothesis, no TPC dE/dx") ; | |
88 | ||
89 | TH1D *fLowPtK0ShortSample = (TH1D*) f2dHistInvMassK0Short->ProjectionY( "fLowPtK0ShortSample", | |
90 | f2dHistInvMassK0Short->GetXaxis()->FindBin(0.5001), | |
91 | f2dHistInvMassK0Short->GetXaxis()->FindBin(0.9999) ); | |
92 | ||
93 | TH1D *fMidPtK0ShortSample = (TH1D*) f2dHistInvMassK0Short->ProjectionY( "fMidPtK0ShortSample", | |
94 | f2dHistInvMassK0Short->GetXaxis()->FindBin(1.5001), | |
95 | f2dHistInvMassK0Short->GetXaxis()->FindBin(2.4999) ); | |
96 | ||
97 | TH1D *fHiPtK0ShortSample = (TH1D*) f2dHistInvMassK0Short->ProjectionY( "fHiPtK0ShortSample", | |
98 | f2dHistInvMassK0Short->GetXaxis()->FindBin(5.0001), | |
99 | f2dHistInvMassK0Short->GetXaxis()->FindBin(9.9999) ); | |
100 | ||
101 | for(Int_t ic = 1; ic<4; ic++){ | |
102 | cInvMassK0Short->cd(2)->cd(ic)->SetTopMargin(0.14); | |
103 | cInvMassK0Short->cd(2)->cd(ic)->SetLeftMargin(0.15); | |
104 | cInvMassK0Short->cd(2)->cd(ic)->SetBottomMargin(0.11); | |
105 | cInvMassK0Short->cd(2)->cd(ic)->SetGridx(); | |
106 | cInvMassK0Short->cd(2)->cd(ic)->SetGridy(); | |
107 | } | |
108 | ||
109 | cInvMassK0Short->cd(2)->cd(1); | |
110 | fLowPtK0ShortSample->GetXaxis()->SetTitleOffset(1.1); | |
111 | fLowPtK0ShortSample->GetYaxis()->SetTitleOffset(2.33); | |
112 | fLowPtK0ShortSample->GetYaxis()->SetTitle("Counts/Event"); | |
113 | fLowPtK0ShortSample->Draw(); | |
114 | Tl.DrawLatex(.25, .9277, "0.5 < p_{T} (GeV/c^{2}) < 1.0"); | |
115 | ||
116 | cInvMassK0Short->cd(2)->cd(2); | |
117 | fMidPtK0ShortSample->GetXaxis()->SetTitleOffset(1.1); | |
118 | fMidPtK0ShortSample->GetYaxis()->SetTitleOffset(2.33); | |
119 | fMidPtK0ShortSample->GetYaxis()->SetTitle("Counts/Event"); | |
120 | fMidPtK0ShortSample->Draw(); | |
121 | Tl.DrawLatex(.25, .9277, "1.5 < p_{T} (GeV/c^{2}) < 2.5"); | |
122 | ||
123 | cInvMassK0Short->cd(2)->cd(3); | |
124 | fHiPtK0ShortSample->GetXaxis()->SetTitleOffset(1.1); | |
125 | fHiPtK0ShortSample->GetYaxis()->SetTitleOffset(2.33); | |
126 | fHiPtK0ShortSample->GetYaxis()->SetTitle("Counts/Event"); | |
127 | fHiPtK0ShortSample->Draw(); | |
128 | Tl.DrawLatex(.25, .9277, "5 < p_{T} (GeV/c^{2}) < 10"); | |
129 | cInvMassK0Short->SaveAs("V0_QA.pdf"); | |
130 | */ | |
131 | //============================================================== | |
132 | ||
133 | //============================================================== | |
134 | //Invariant Mass Plots: WITH dE/dx | |
135 | TH2D *f2dHistInvMassWithdEdxK0Short = (TH2D*)clist->FindObject("f2dHistInvMassWithdEdxK0Short"); | |
136 | TH2D *f2dHistInvMassWithdEdxLambda = (TH2D*)clist->FindObject("f2dHistInvMassWithdEdxLambda"); | |
137 | TH2D *f2dHistInvMassWithdEdxAntiLambda = (TH2D*)clist->FindObject("f2dHistInvMassWithdEdxAntiLambda"); | |
138 | ||
139 | f2dHistInvMassWithdEdxK0Short -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
140 | f2dHistInvMassWithdEdxLambda -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
141 | f2dHistInvMassWithdEdxAntiLambda -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
142 | ||
143 | TCanvas *cInvMassK0ShortWithdEdx = new TCanvas ( "cInvMassK0ShortWithdEdx", "", 1200,800); | |
144 | cInvMassK0ShortWithdEdx->Divide(1,2); | |
145 | cInvMassK0ShortWithdEdx->cd(2)->Divide(3,1); | |
146 | cInvMassK0ShortWithdEdx->cd(1); | |
147 | cInvMassK0ShortWithdEdx->cd(1)->SetLogz(); | |
148 | cInvMassK0ShortWithdEdx->cd(1)->SetLeftMargin(0.065); | |
149 | cInvMassK0ShortWithdEdx->cd(1)->SetTopMargin(0.13); | |
150 | cInvMassK0ShortWithdEdx->cd(1)->SetBottomMargin(0.11); | |
151 | ||
152 | f2dHistInvMassWithdEdxK0Short->GetYaxis()->SetTitleSize(0.05); | |
153 | f2dHistInvMassWithdEdxK0Short->GetYaxis()->SetTitleOffset(0.6); | |
154 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->SetTitleSize(0.05); | |
155 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
156 | f2dHistInvMassWithdEdxK0Short->GetZaxis()->SetTitle("Counts / Event"); | |
157 | f2dHistInvMassWithdEdxK0Short->GetZaxis()->SetTitleOffset(0.7); | |
158 | f2dHistInvMassWithdEdxK0Short->GetZaxis()->SetRangeUser( f2dHistInvMassWithdEdxK0Short->GetMinimum(1e-10)*0.9, f2dHistInvMassWithdEdxK0Short->GetMaximum()*1.2 ); | |
159 | f2dHistInvMassWithdEdxK0Short->Draw("colz"); | |
160 | Tl.DrawLatex(.35, .9277, "Mass under K^{0}_{S} hypothesis, With TPC dE/dx") ; | |
161 | ||
162 | TH1D *fLowPtK0ShortSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxK0Short->ProjectionY( "fLowPtK0ShortSampleWithdEdx", | |
163 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->FindBin(0.5001), | |
164 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->FindBin(0.9999) ); | |
165 | ||
166 | TH1D *fMidPtK0ShortSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxK0Short->ProjectionY( "fMidPtK0ShortSampleWithdEdx", | |
167 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->FindBin(1.5001), | |
168 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->FindBin(2.4999) ); | |
169 | ||
170 | TH1D *fHiPtK0ShortSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxK0Short->ProjectionY( "fHiPtK0ShortSampleWithdEdx", | |
171 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->FindBin(5.0001), | |
172 | f2dHistInvMassWithdEdxK0Short->GetXaxis()->FindBin(9.9999) ); | |
173 | ||
174 | for(Int_t ic = 1; ic<4; ic++){ | |
175 | cInvMassK0ShortWithdEdx->cd(2)->cd(ic)->SetTopMargin(0.14); | |
176 | cInvMassK0ShortWithdEdx->cd(2)->cd(ic)->SetLeftMargin(0.15); | |
177 | cInvMassK0ShortWithdEdx->cd(2)->cd(ic)->SetBottomMargin(0.11); | |
178 | cInvMassK0ShortWithdEdx->cd(2)->cd(ic)->SetGridx(); | |
179 | cInvMassK0ShortWithdEdx->cd(2)->cd(ic)->SetGridy(); | |
180 | } | |
181 | ||
182 | cInvMassK0ShortWithdEdx->cd(2)->cd(1); | |
183 | fLowPtK0ShortSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
184 | fLowPtK0ShortSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
185 | fLowPtK0ShortSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
186 | fLowPtK0ShortSampleWithdEdx->Draw(); | |
187 | Tl.DrawLatex(.25, .9277, "0.5 < p_{T} (GeV/c^{2}) < 1.0"); | |
188 | ||
189 | cInvMassK0ShortWithdEdx->cd(2)->cd(2); | |
190 | fMidPtK0ShortSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
191 | fMidPtK0ShortSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
192 | fMidPtK0ShortSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
193 | fMidPtK0ShortSampleWithdEdx->Draw(); | |
194 | Tl.DrawLatex(.25, .9277, "1.5 < p_{T} (GeV/c^{2}) < 2.5"); | |
195 | ||
196 | cInvMassK0ShortWithdEdx->cd(2)->cd(3); | |
197 | fHiPtK0ShortSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
198 | fHiPtK0ShortSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
199 | fHiPtK0ShortSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
200 | fHiPtK0ShortSampleWithdEdx->Draw(); | |
201 | Tl.DrawLatex(.25, .9277, "5 < p_{T} (GeV/c^{2}) < 10"); | |
202 | ||
203 | TLatex Tli; | |
204 | Tli.SetNDC(); | |
205 | Tli.SetTextSize(0.05); | |
206 | ||
207 | if( lAttemptInvMassFit ){ | |
208 | //Attempt rough signal extraction | |
209 | TF1 *f1 = new TF1("f1","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",0.435, 0.565); | |
210 | //Reasonable first guess | |
211 | f1->SetParameter(0, fLowPtK0ShortSampleWithdEdx -> GetBinContent( fLowPtK0ShortSampleWithdEdx->FindBin(0.497-0.01) ) ); | |
212 | f1->SetParameter(1, 0 ); | |
213 | f1->SetParameter(2, 0 ); | |
214 | f1->SetParameter(3, 0.5*fLowPtK0ShortSampleWithdEdx->GetMaximum() ); | |
215 | f1->SetParameter(4, 0.497); | |
216 | f1->SetParameter(5, 0.0045); | |
217 | cout<<"Will now fit, please wait!"<<endl; | |
218 | fLowPtK0ShortSampleWithdEdx->Fit("f1","REM0"); | |
219 | cInvMassK0ShortWithdEdx->cd(2)->cd(1); | |
220 | f1->Draw("same"); | |
221 | //Peak Position, Width: printout | |
222 | fLowPtK0ShortSampleWithdEdx->GetYaxis()->SetRangeUser(0,fLowPtK0ShortSampleWithdEdx->GetMaximum() * 1.2); | |
223 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",f1->GetParameter(4),f1->GetParameter(5)) ) ; | |
224 | ||
225 | //Attempt rough signal extraction | |
226 | TF1 *f2 = new TF1("f2","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",0.375, 0.635); | |
227 | //Reasonable first guess | |
228 | f2->SetParameter(0, fMidPtK0ShortSampleWithdEdx -> GetBinContent( fMidPtK0ShortSampleWithdEdx->FindBin(0.497-0.01) ) ); | |
229 | f2->SetParameter(1, 0 ); | |
230 | f2->SetParameter(2, 0 ); | |
231 | f2->SetParameter(3, 0.5*fMidPtK0ShortSampleWithdEdx->GetMaximum() ); | |
232 | f2->SetParameter(4, 0.497); | |
233 | f2->SetParameter(5, 0.0045); | |
234 | cout<<"Will now fit, please wait!"<<endl; | |
235 | fMidPtK0ShortSampleWithdEdx->Fit("f2","REM0"); | |
236 | cInvMassK0ShortWithdEdx->cd(2)->cd(2); | |
237 | f2->Draw("same"); | |
238 | //Peak Position, Width: printout | |
239 | fMidPtK0ShortSampleWithdEdx->GetYaxis()->SetRangeUser(0,fMidPtK0ShortSampleWithdEdx->GetMaximum() * 1.2); | |
240 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",f2->GetParameter(4),f2->GetParameter(5)) ) ; | |
241 | ||
242 | //Attempt rough signal extraction | |
243 | TF1 *f3 = new TF1("f3","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",0.375, 0.665); | |
244 | //Reasonable first guess | |
245 | f3->SetParameter(0, fHiPtK0ShortSampleWithdEdx -> GetBinContent( fHiPtK0ShortSampleWithdEdx->FindBin(0.497-0.01) ) ); | |
246 | f3->SetParameter(1, 0 ); | |
247 | f3->SetParameter(2, 0 ); | |
248 | f3->SetParameter(3, 0.5*fHiPtK0ShortSampleWithdEdx->GetMaximum() ); | |
249 | f3->SetParameter(4, 0.497); | |
250 | f3->SetParameter(5, 0.0045); | |
251 | cout<<"Will now fit, please wait!"<<endl; | |
252 | fHiPtK0ShortSampleWithdEdx->Fit("f3","REM0"); | |
253 | cInvMassK0ShortWithdEdx->cd(2)->cd(3); | |
254 | f3->Draw("same"); | |
255 | //Peak Position, Width: printout | |
256 | fHiPtK0ShortSampleWithdEdx->GetYaxis()->SetRangeUser(0,fHiPtK0ShortSampleWithdEdx->GetMaximum() * 1.2); | |
257 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",f3->GetParameter(4),f3->GetParameter(5)) ) ; | |
258 | } | |
259 | ||
260 | cInvMassK0ShortWithdEdx->SaveAs("V0_QA.pdf"); | |
261 | //============================================================== | |
262 | ||
263 | ||
264 | //============================================================== | |
265 | //Invariant Mass Plots: Base, no dE/dx | |
266 | /* | |
267 | TCanvas *cInvMassLambda = new TCanvas ( "cInvMassLambda", "", 1200,800); | |
268 | cInvMassLambda->Divide(1,2); | |
269 | cInvMassLambda->cd(2)->Divide(3,1); | |
270 | cInvMassLambda->cd(1); | |
271 | cInvMassLambda->cd(1)->SetLogz(); | |
272 | cInvMassLambda->cd(1)->SetLeftMargin(0.065); | |
273 | cInvMassLambda->cd(1)->SetTopMargin(0.13); | |
274 | cInvMassLambda->cd(1)->SetBottomMargin(0.11); | |
275 | ||
276 | f2dHistInvMassLambda->GetYaxis()->SetTitleSize(0.05); | |
277 | f2dHistInvMassLambda->GetYaxis()->SetTitleOffset(0.6); | |
278 | f2dHistInvMassLambda->GetXaxis()->SetTitleSize(0.05); | |
279 | f2dHistInvMassLambda->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
280 | f2dHistInvMassLambda->GetZaxis()->SetTitle("Counts / Event"); | |
281 | f2dHistInvMassLambda->GetZaxis()->SetTitleOffset(0.7); | |
282 | f2dHistInvMassLambda->GetZaxis()->SetRangeUser( f2dHistInvMassLambda->GetMinimum(1e-10)*0.9, f2dHistInvMassLambda->GetMaximum()*1.2 ); | |
283 | f2dHistInvMassLambda->Draw("colz"); | |
284 | Tl.DrawLatex(.35, .9277, "Mass under #Lambda hypothesis, no TPC dE/dx") ; | |
285 | ||
286 | TH1D *fLowPtLambdaSample = (TH1D*) f2dHistInvMassLambda->ProjectionY( "fLowPtLambdaSample", | |
287 | f2dHistInvMassLambda->GetXaxis()->FindBin(0.5001), | |
288 | f2dHistInvMassLambda->GetXaxis()->FindBin(0.9999) ); | |
289 | ||
290 | TH1D *fMidPtLambdaSample = (TH1D*) f2dHistInvMassLambda->ProjectionY( "fMidPtLambdaSample", | |
291 | f2dHistInvMassLambda->GetXaxis()->FindBin(1.5001), | |
292 | f2dHistInvMassLambda->GetXaxis()->FindBin(2.4999) ); | |
293 | ||
294 | TH1D *fHiPtLambdaSample = (TH1D*) f2dHistInvMassLambda->ProjectionY( "fHiPtLambdaSample", | |
295 | f2dHistInvMassLambda->GetXaxis()->FindBin(5.0001), | |
296 | f2dHistInvMassLambda->GetXaxis()->FindBin(9.9999) ); | |
297 | ||
298 | for(Int_t ic = 1; ic<4; ic++){ | |
299 | cInvMassLambda->cd(2)->cd(ic)->SetTopMargin(0.14); | |
300 | cInvMassLambda->cd(2)->cd(ic)->SetLeftMargin(0.15); | |
301 | cInvMassLambda->cd(2)->cd(ic)->SetBottomMargin(0.11); | |
302 | cInvMassLambda->cd(2)->cd(ic)->SetGridx(); | |
303 | cInvMassLambda->cd(2)->cd(ic)->SetGridy(); | |
304 | } | |
305 | ||
306 | cInvMassLambda->cd(2)->cd(1); | |
307 | fLowPtLambdaSample->GetXaxis()->SetTitleOffset(1.1); | |
308 | fLowPtLambdaSample->GetYaxis()->SetTitleOffset(2.33); | |
309 | fLowPtLambdaSample->GetYaxis()->SetTitle("Counts/Event"); | |
310 | fLowPtLambdaSample->Draw(); | |
311 | Tl.DrawLatex(.25, .9277, "0.5 < p_{T} (GeV/c^{2}) < 1.0"); | |
312 | ||
313 | cInvMassLambda->cd(2)->cd(2); | |
314 | fMidPtLambdaSample->GetXaxis()->SetTitleOffset(1.1); | |
315 | fMidPtLambdaSample->GetYaxis()->SetTitleOffset(2.33); | |
316 | fMidPtLambdaSample->GetYaxis()->SetTitle("Counts/Event"); | |
317 | fMidPtLambdaSample->Draw(); | |
318 | Tl.DrawLatex(.25, .9277, "1.5 < p_{T} (GeV/c^{2}) < 2.5"); | |
319 | ||
320 | cInvMassLambda->cd(2)->cd(3); | |
321 | fHiPtLambdaSample->GetXaxis()->SetTitleOffset(1.1); | |
322 | fHiPtLambdaSample->GetYaxis()->SetTitleOffset(2.33); | |
323 | fHiPtLambdaSample->GetYaxis()->SetTitle("Counts/Event"); | |
324 | fHiPtLambdaSample->Draw(); | |
325 | Tl.DrawLatex(.25, .9277, "5 < p_{T} (GeV/c^{2}) < 10"); | |
326 | cInvMassLambda->SaveAs("V0_QA.pdf"); | |
327 | */ | |
328 | //============================================================== | |
329 | ||
330 | //============================================================== | |
331 | //Invariant Mass Plots: WITH dE/dx | |
332 | TCanvas *cInvMassLambdaWithdEdx = new TCanvas ( "cInvMassLambdaWithdEdx", "", 1200,800); | |
333 | cInvMassLambdaWithdEdx->Divide(1,2); | |
334 | cInvMassLambdaWithdEdx->cd(2)->Divide(3,1); | |
335 | cInvMassLambdaWithdEdx->cd(1); | |
336 | cInvMassLambdaWithdEdx->cd(1)->SetLogz(); | |
337 | cInvMassLambdaWithdEdx->cd(1)->SetLeftMargin(0.065); | |
338 | cInvMassLambdaWithdEdx->cd(1)->SetTopMargin(0.13); | |
339 | cInvMassLambdaWithdEdx->cd(1)->SetBottomMargin(0.11); | |
340 | ||
341 | f2dHistInvMassWithdEdxLambda->GetYaxis()->SetTitleSize(0.05); | |
342 | f2dHistInvMassWithdEdxLambda->GetYaxis()->SetTitleOffset(0.6); | |
343 | f2dHistInvMassWithdEdxLambda->GetXaxis()->SetTitleSize(0.05); | |
344 | f2dHistInvMassWithdEdxLambda->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
345 | f2dHistInvMassWithdEdxLambda->GetZaxis()->SetTitle("Counts / Event"); | |
346 | f2dHistInvMassWithdEdxLambda->GetZaxis()->SetTitleOffset(0.7); | |
347 | f2dHistInvMassWithdEdxLambda->GetZaxis()->SetRangeUser( f2dHistInvMassWithdEdxLambda->GetMinimum(1e-10)*0.9, f2dHistInvMassWithdEdxLambda->GetMaximum()*1.2 ); | |
348 | f2dHistInvMassWithdEdxLambda->Draw("colz"); | |
349 | Tl.DrawLatex(.35, .9277, "Mass under #Lambda hypothesis, With TPC dE/dx") ; | |
350 | ||
351 | TH1D *fLowPtLambdaSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxLambda->ProjectionY( "fLowPtLambdaSampleWithdEdx", | |
352 | f2dHistInvMassWithdEdxLambda->GetXaxis()->FindBin(0.5001), | |
353 | f2dHistInvMassWithdEdxLambda->GetXaxis()->FindBin(0.9999) ); | |
354 | ||
355 | TH1D *fMidPtLambdaSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxLambda->ProjectionY( "fMidPtLambdaSampleWithdEdx", | |
356 | f2dHistInvMassWithdEdxLambda->GetXaxis()->FindBin(1.5001), | |
357 | f2dHistInvMassWithdEdxLambda->GetXaxis()->FindBin(2.4999) ); | |
358 | ||
359 | TH1D *fHiPtLambdaSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxLambda->ProjectionY( "fHiPtLambdaSampleWithdEdx", | |
360 | f2dHistInvMassWithdEdxLambda->GetXaxis()->FindBin(5.0001), | |
361 | f2dHistInvMassWithdEdxLambda->GetXaxis()->FindBin(9.9999) ); | |
362 | ||
363 | for(Int_t ic = 1; ic<4; ic++){ | |
364 | cInvMassLambdaWithdEdx->cd(2)->cd(ic)->SetTopMargin(0.14); | |
365 | cInvMassLambdaWithdEdx->cd(2)->cd(ic)->SetLeftMargin(0.15); | |
366 | cInvMassLambdaWithdEdx->cd(2)->cd(ic)->SetBottomMargin(0.11); | |
367 | cInvMassLambdaWithdEdx->cd(2)->cd(ic)->SetGridx(); | |
368 | cInvMassLambdaWithdEdx->cd(2)->cd(ic)->SetGridy(); | |
369 | } | |
370 | ||
371 | cInvMassLambdaWithdEdx->cd(2)->cd(1); | |
372 | fLowPtLambdaSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
373 | fLowPtLambdaSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
374 | fLowPtLambdaSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
375 | fLowPtLambdaSampleWithdEdx->Draw(); | |
376 | Tl.DrawLatex(.25, .9277, "0.5 < p_{T} (GeV/c^{2}) < 1.0"); | |
377 | ||
378 | cInvMassLambdaWithdEdx->cd(2)->cd(2); | |
379 | fMidPtLambdaSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
380 | fMidPtLambdaSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
381 | fMidPtLambdaSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
382 | fMidPtLambdaSampleWithdEdx->Draw(); | |
383 | Tl.DrawLatex(.25, .9277, "1.5 < p_{T} (GeV/c^{2}) < 2.5"); | |
384 | ||
385 | cInvMassLambdaWithdEdx->cd(2)->cd(3); | |
386 | fHiPtLambdaSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
387 | fHiPtLambdaSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
388 | fHiPtLambdaSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
389 | fHiPtLambdaSampleWithdEdx->Draw(); | |
390 | Tl.DrawLatex(.25, .9277, "5 < p_{T} (GeV/c^{2}) < 10"); | |
391 | ||
392 | if( lAttemptInvMassFit ){ | |
393 | //Attempt rough signal extraction | |
394 | TF1 *fl1 = new TF1("fl1","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",1.095, 1.14); | |
395 | //Reasonable first guess | |
396 | fl1->SetParameter(0, fLowPtLambdaSampleWithdEdx -> GetBinContent( fLowPtLambdaSampleWithdEdx->FindBin(1.116+0.01) ) ); | |
397 | fl1->SetParameter(1, 0 ); | |
398 | fl1->SetParameter(2, 0 ); | |
399 | fl1->SetParameter(3, 0.35*fLowPtLambdaSampleWithdEdx->GetMaximum() ); | |
400 | fl1->SetParameter(4, 1.115683); | |
401 | fl1->SetParLimits(4,1.116-0.01,1.116+0.01); | |
402 | fl1->SetParameter(5, 0.002); | |
403 | fl1->SetParLimits(5,0.0005,0.01); | |
404 | cout<<"Will now fit, please wait!"<<endl; | |
405 | fLowPtLambdaSampleWithdEdx->Fit("fl1","REM0"); | |
406 | cInvMassLambdaWithdEdx->cd(2)->cd(1); | |
407 | fl1->Draw("same"); | |
408 | //Peak Position, Width: printout | |
409 | fLowPtLambdaSampleWithdEdx->GetYaxis()->SetRangeUser(0,fLowPtLambdaSampleWithdEdx->GetMaximum() * 1.2); | |
410 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",fl1->GetParameter(4),fl1->GetParameter(5)) ) ; | |
411 | ||
412 | //Attempt rough signal extraction | |
413 | TF1 *fl2 = new TF1("fl2","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",1.085, 1.15); | |
414 | //Reasonable first guess | |
415 | fl2->SetParameter(0, fMidPtLambdaSampleWithdEdx -> GetBinContent( fMidPtLambdaSampleWithdEdx->FindBin(1.116+0.01) ) ); | |
416 | fl2->SetParameter(1, 0 ); | |
417 | fl2->SetParameter(2, 0 ); | |
418 | fl2->SetParameter(3, 0.6*fMidPtLambdaSampleWithdEdx->GetMaximum() ); | |
419 | fl2->SetParLimits(4,1.116-0.01,1.116+0.01); | |
420 | fl2->SetParameter(4, 1.116); | |
421 | fl2->SetParameter(5, 0.0025); | |
422 | fl2->SetParLimits(5,0.0005,0.01); | |
423 | cout<<"Will now fit, please wait!"<<endl; | |
424 | fMidPtLambdaSampleWithdEdx->Fit("fl2","REM0"); | |
425 | cInvMassLambdaWithdEdx->cd(2)->cd(2); | |
426 | fl2->Draw("same"); | |
427 | //Peak Position, Width: printout | |
428 | fMidPtLambdaSampleWithdEdx->GetYaxis()->SetRangeUser(0,fMidPtLambdaSampleWithdEdx->GetMaximum() * 1.2); | |
429 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",fl2->GetParameter(4),fl2->GetParameter(5)) ) ; | |
430 | ||
431 | //Attempt rough signal extraction | |
432 | TF1 *fl3 = new TF1("fl3","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",1.095, 1.15); | |
433 | //Reasonable first guess | |
434 | fl3->SetParameter(0, fHiPtLambdaSampleWithdEdx -> GetBinContent( fHiPtLambdaSampleWithdEdx->FindBin(1.116+0.01) ) ); | |
435 | fl3->SetParameter(1, 0 ); | |
436 | fl3->SetParameter(2, 0 ); | |
437 | fl3->SetParameter(3, 0.6*fHiPtLambdaSampleWithdEdx->GetMaximum() ); | |
438 | fl3->SetParameter(4, 1.116); | |
439 | fl3->SetParLimits(4,1.116-0.005,1.116+0.005); | |
440 | fl3->SetParameter(5, 0.0035); | |
441 | fl3->SetParLimits(5,0.0005,0.01); | |
442 | cout<<"Will now fit, please wait!"<<endl; | |
443 | fHiPtLambdaSampleWithdEdx->Fit("fl3","REM0"); | |
444 | cInvMassLambdaWithdEdx->cd(2)->cd(3); | |
445 | fl3->Draw("same"); | |
446 | //Peak Position, Width: printout | |
447 | fHiPtLambdaSampleWithdEdx->GetYaxis()->SetRangeUser(0,fHiPtLambdaSampleWithdEdx->GetMaximum() * 1.2); | |
448 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",fl3->GetParameter(4),fl3->GetParameter(5)) ) ; | |
449 | } | |
450 | ||
451 | ||
452 | ||
453 | ||
454 | ||
455 | cInvMassLambdaWithdEdx->SaveAs("V0_QA.pdf"); | |
456 | //============================================================== | |
457 | ||
458 | //============================================================== | |
459 | //Invariant Mass Plots: Base, no dE/dx | |
460 | /* | |
461 | TCanvas *cInvMassAntiLambda = new TCanvas ( "cInvMassAntiLambda", "", 1200,800); | |
462 | cInvMassAntiLambda->Divide(1,2); | |
463 | cInvMassAntiLambda->cd(2)->Divide(3,1); | |
464 | cInvMassAntiLambda->cd(1); | |
465 | cInvMassAntiLambda->cd(1)->SetLogz(); | |
466 | cInvMassAntiLambda->cd(1)->SetLeftMargin(0.065); | |
467 | cInvMassAntiLambda->cd(1)->SetTopMargin(0.13); | |
468 | cInvMassAntiLambda->cd(1)->SetBottomMargin(0.11); | |
469 | ||
470 | f2dHistInvMassAntiLambda->GetYaxis()->SetTitleSize(0.05); | |
471 | f2dHistInvMassAntiLambda->GetYaxis()->SetTitleOffset(0.6); | |
472 | f2dHistInvMassAntiLambda->GetXaxis()->SetTitleSize(0.05); | |
473 | f2dHistInvMassAntiLambda->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
474 | f2dHistInvMassAntiLambda->GetZaxis()->SetTitle("Counts / Event"); | |
475 | f2dHistInvMassAntiLambda->GetZaxis()->SetTitleOffset(0.7); | |
476 | f2dHistInvMassAntiLambda->GetZaxis()->SetRangeUser( f2dHistInvMassAntiLambda->GetMinimum(1e-10)*0.9, f2dHistInvMassAntiLambda->GetMaximum()*1.2 ); | |
477 | f2dHistInvMassAntiLambda->Draw("colz"); | |
478 | Tl.DrawLatex(.35, .9277, "Mass under #bar{#Lambda} hypothesis, no TPC dE/dx") ; | |
479 | ||
480 | TH1D *fLowPtAntiLambdaSample = (TH1D*) f2dHistInvMassAntiLambda->ProjectionY( "fLowPtAntiLambdaSample", | |
481 | f2dHistInvMassAntiLambda->GetXaxis()->FindBin(0.5001), | |
482 | f2dHistInvMassAntiLambda->GetXaxis()->FindBin(0.9999) ); | |
483 | ||
484 | TH1D *fMidPtAntiLambdaSample = (TH1D*) f2dHistInvMassAntiLambda->ProjectionY( "fMidPtAntiLambdaSample", | |
485 | f2dHistInvMassAntiLambda->GetXaxis()->FindBin(1.5001), | |
486 | f2dHistInvMassAntiLambda->GetXaxis()->FindBin(2.4999) ); | |
487 | ||
488 | TH1D *fHiPtAntiLambdaSample = (TH1D*) f2dHistInvMassAntiLambda->ProjectionY( "fHiPtAntiLambdaSample", | |
489 | f2dHistInvMassAntiLambda->GetXaxis()->FindBin(5.0001), | |
490 | f2dHistInvMassAntiLambda->GetXaxis()->FindBin(9.9999) ); | |
491 | ||
492 | for(Int_t ic = 1; ic<4; ic++){ | |
493 | cInvMassAntiLambda->cd(2)->cd(ic)->SetTopMargin(0.14); | |
494 | cInvMassAntiLambda->cd(2)->cd(ic)->SetLeftMargin(0.15); | |
495 | cInvMassAntiLambda->cd(2)->cd(ic)->SetBottomMargin(0.11); | |
496 | cInvMassAntiLambda->cd(2)->cd(ic)->SetGridx(); | |
497 | cInvMassAntiLambda->cd(2)->cd(ic)->SetGridy(); | |
498 | } | |
499 | ||
500 | cInvMassAntiLambda->cd(2)->cd(1); | |
501 | fLowPtAntiLambdaSample->GetXaxis()->SetTitleOffset(1.1); | |
502 | fLowPtAntiLambdaSample->GetYaxis()->SetTitleOffset(2.33); | |
503 | fLowPtAntiLambdaSample->GetYaxis()->SetTitle("Counts/Event"); | |
504 | fLowPtAntiLambdaSample->Draw(); | |
505 | Tl.DrawLatex(.25, .9277, "0.5 < p_{T} (GeV/c^{2}) < 1.0"); | |
506 | ||
507 | cInvMassAntiLambda->cd(2)->cd(2); | |
508 | fMidPtAntiLambdaSample->GetXaxis()->SetTitleOffset(1.1); | |
509 | fMidPtAntiLambdaSample->GetYaxis()->SetTitleOffset(2.33); | |
510 | fMidPtAntiLambdaSample->GetYaxis()->SetTitle("Counts/Event"); | |
511 | fMidPtAntiLambdaSample->Draw(); | |
512 | Tl.DrawLatex(.25, .9277, "1.5 < p_{T} (GeV/c^{2}) < 2.5"); | |
513 | ||
514 | cInvMassAntiLambda->cd(2)->cd(3); | |
515 | fHiPtAntiLambdaSample->GetXaxis()->SetTitleOffset(1.1); | |
516 | fHiPtAntiLambdaSample->GetYaxis()->SetTitleOffset(2.33); | |
517 | fHiPtAntiLambdaSample->GetYaxis()->SetTitle("Counts/Event"); | |
518 | fHiPtAntiLambdaSample->Draw(); | |
519 | Tl.DrawLatex(.25, .9277, "5 < p_{T} (GeV/c^{2}) < 10"); | |
520 | cInvMassAntiLambda->SaveAs("V0_QA.pdf"); | |
521 | */ | |
522 | //============================================================== | |
523 | ||
524 | //============================================================== | |
525 | //Invariant Mass Plots: WITH dE/dx | |
526 | TCanvas *cInvMassAntiLambdaWithdEdx = new TCanvas ( "cInvMassAntiLambdaWithdEdx", "", 1200,800); | |
527 | cInvMassAntiLambdaWithdEdx->Divide(1,2); | |
528 | cInvMassAntiLambdaWithdEdx->cd(2)->Divide(3,1); | |
529 | cInvMassAntiLambdaWithdEdx->cd(1); | |
530 | cInvMassAntiLambdaWithdEdx->cd(1)->SetLogz(); | |
531 | cInvMassAntiLambdaWithdEdx->cd(1)->SetLeftMargin(0.065); | |
532 | cInvMassAntiLambdaWithdEdx->cd(1)->SetTopMargin(0.13); | |
533 | cInvMassAntiLambdaWithdEdx->cd(1)->SetBottomMargin(0.11); | |
534 | ||
535 | f2dHistInvMassWithdEdxAntiLambda->GetYaxis()->SetTitleSize(0.05); | |
536 | f2dHistInvMassWithdEdxAntiLambda->GetYaxis()->SetTitleOffset(0.6); | |
537 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->SetTitleSize(0.05); | |
538 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
539 | f2dHistInvMassWithdEdxAntiLambda->GetZaxis()->SetTitle("Counts / Event"); | |
540 | f2dHistInvMassWithdEdxAntiLambda->GetZaxis()->SetTitleOffset(0.7); | |
541 | f2dHistInvMassWithdEdxAntiLambda->GetZaxis()->SetRangeUser( f2dHistInvMassWithdEdxAntiLambda->GetMinimum(1e-10)*0.9, f2dHistInvMassWithdEdxAntiLambda->GetMaximum()*1.2 ); | |
542 | f2dHistInvMassWithdEdxAntiLambda->Draw("colz"); | |
543 | Tl.DrawLatex(.35, .9277, "Mass under #bar{#Lambda} hypothesis, With TPC dE/dx") ; | |
544 | ||
545 | TH1D *fLowPtAntiLambdaSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxAntiLambda->ProjectionY( "fLowPtAntiLambdaSampleWithdEdx", | |
546 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->FindBin(0.5001), | |
547 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->FindBin(0.9999) ); | |
548 | ||
549 | TH1D *fMidPtAntiLambdaSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxAntiLambda->ProjectionY( "fMidPtAntiLambdaSampleWithdEdx", | |
550 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->FindBin(1.5001), | |
551 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->FindBin(2.4999) ); | |
552 | ||
553 | TH1D *fHiPtAntiLambdaSampleWithdEdx = (TH1D*) f2dHistInvMassWithdEdxAntiLambda->ProjectionY( "fHiPtAntiLambdaSampleWithdEdx", | |
554 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->FindBin(5.0001), | |
555 | f2dHistInvMassWithdEdxAntiLambda->GetXaxis()->FindBin(9.9999) ); | |
556 | ||
557 | for(Int_t ic = 1; ic<4; ic++){ | |
558 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(ic)->SetTopMargin(0.14); | |
559 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(ic)->SetLeftMargin(0.15); | |
560 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(ic)->SetBottomMargin(0.11); | |
561 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(ic)->SetGridx(); | |
562 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(ic)->SetGridy(); | |
563 | } | |
564 | ||
565 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(1); | |
566 | fLowPtAntiLambdaSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
567 | fLowPtAntiLambdaSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
568 | fLowPtAntiLambdaSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
569 | fLowPtAntiLambdaSampleWithdEdx->Draw(); | |
570 | Tl.DrawLatex(.25, .9277, "0.5 < p_{T} (GeV/c^{2}) < 1.0"); | |
571 | ||
572 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(2); | |
573 | fMidPtAntiLambdaSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
574 | fMidPtAntiLambdaSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
575 | fMidPtAntiLambdaSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
576 | fMidPtAntiLambdaSampleWithdEdx->Draw(); | |
577 | Tl.DrawLatex(.25, .9277, "1.5 < p_{T} (GeV/c^{2}) < 2.5"); | |
578 | ||
579 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(3); | |
580 | fHiPtAntiLambdaSampleWithdEdx->GetXaxis()->SetTitleOffset(1.1); | |
581 | fHiPtAntiLambdaSampleWithdEdx->GetYaxis()->SetTitleOffset(2.33); | |
582 | fHiPtAntiLambdaSampleWithdEdx->GetYaxis()->SetTitle("Counts/Event"); | |
583 | fHiPtAntiLambdaSampleWithdEdx->Draw(); | |
584 | Tl.DrawLatex(.25, .9277, "5 < p_{T} (GeV/c^{2}) < 10"); | |
585 | ||
586 | if( lAttemptInvMassFit ){ | |
587 | //Attempt rough signal extraction | |
588 | TF1 *fal1 = new TF1("fal1","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",1.095, 1.14); | |
589 | //Reasonable first guess | |
590 | fal1->SetParameter(0, fLowPtAntiLambdaSampleWithdEdx -> GetBinContent( fLowPtAntiLambdaSampleWithdEdx->FindBin(1.116+0.01) ) ); | |
591 | fal1->SetParameter(1, 0 ); | |
592 | fal1->SetParameter(2, 0 ); | |
593 | fal1->SetParameter(3, 0.35*fLowPtAntiLambdaSampleWithdEdx->GetMaximum() ); | |
594 | fal1->SetParameter(4, 1.115683); | |
595 | fal1->SetParLimits(4,1.116-0.01,1.116+0.01); | |
596 | fal1->SetParameter(5, 0.002); | |
597 | fal1->SetParLimits(5,0.0005,0.01); | |
598 | cout<<"Will now fit, please wait!"<<endl; | |
599 | fLowPtAntiLambdaSampleWithdEdx->Fit("fal1","REM0"); | |
600 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(1); | |
601 | fal1->Draw("same"); | |
602 | //Peak Position, Width: printout | |
603 | fLowPtAntiLambdaSampleWithdEdx->GetYaxis()->SetRangeUser(0,fLowPtAntiLambdaSampleWithdEdx->GetMaximum() * 1.2); | |
604 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",fal1->GetParameter(4),fal1->GetParameter(5)) ) ; | |
605 | ||
606 | //Attempt rough signal extraction | |
607 | TF1 *fal2 = new TF1("fal2","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",1.085, 1.15); | |
608 | //Reasonable first guess | |
609 | fal2->SetParameter(0, fMidPtAntiLambdaSampleWithdEdx -> GetBinContent( fMidPtAntiLambdaSampleWithdEdx->FindBin(1.116+0.01) ) ); | |
610 | fal2->SetParameter(1, 0 ); | |
611 | fal2->SetParameter(2, 0 ); | |
612 | fal2->SetParameter(3, 0.6*fMidPtAntiLambdaSampleWithdEdx->GetMaximum() ); | |
613 | fal2->SetParLimits(4,1.116-0.01,1.116+0.01); | |
614 | fal2->SetParameter(4, 1.116); | |
615 | fal2->SetParameter(5, 0.0025); | |
616 | fal2->SetParLimits(5,0.0005,0.01); | |
617 | cout<<"Will now fit, please wait!"<<endl; | |
618 | fMidPtAntiLambdaSampleWithdEdx->Fit("fal2","REM0"); | |
619 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(2); | |
620 | fal2->Draw("same"); | |
621 | //Peak Position, Width: printout | |
622 | fMidPtAntiLambdaSampleWithdEdx->GetYaxis()->SetRangeUser(0,fMidPtAntiLambdaSampleWithdEdx->GetMaximum() * 1.2); | |
623 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",fal2->GetParameter(4),fal2->GetParameter(5)) ) ; | |
624 | ||
625 | //Attempt rough signal extraction | |
626 | TF1 *fal3 = new TF1("fal3","[0]+[1]*x+[2]*x*x+[3]*TMath::Gaus(x,[4],[5])",1.095, 1.15); | |
627 | //Reasonable first guess | |
628 | fal3->SetParameter(0, fHiPtAntiLambdaSampleWithdEdx -> GetBinContent( fHiPtAntiLambdaSampleWithdEdx->FindBin(1.116+0.01) ) ); | |
629 | fal3->SetParameter(1, 0 ); | |
630 | fal3->SetParameter(2, 0 ); | |
631 | fal3->SetParameter(3, 0.6*fHiPtAntiLambdaSampleWithdEdx->GetMaximum() ); | |
632 | fal3->SetParameter(4, 1.116); | |
633 | fal3->SetParLimits(4,1.116-0.005,1.116+0.005); | |
634 | fal3->SetParameter(5, 0.0035); | |
635 | fal3->SetParLimits(5,0.0005,0.01); | |
636 | cout<<"Will now fit, please wait!"<<endl; | |
637 | fHiPtAntiLambdaSampleWithdEdx->Fit("fal3","REM0"); | |
638 | cInvMassAntiLambdaWithdEdx->cd(2)->cd(3); | |
639 | fal3->Draw("same"); | |
640 | //Peak Position, Width: printout | |
641 | fHiPtAntiLambdaSampleWithdEdx->GetYaxis()->SetRangeUser(0,fHiPtAntiLambdaSampleWithdEdx->GetMaximum() * 1.2); | |
642 | Tli.DrawLatex(0.2,0.8,Form("peak = %.4f #pm %.4f MeV/c^{2}",fal3->GetParameter(4),fal3->GetParameter(5)) ) ; | |
643 | } | |
644 | ||
645 | ||
646 | cInvMassAntiLambdaWithdEdx->SaveAs("V0_QA.pdf"); | |
647 | //============================================================== | |
648 | ||
649 | //============================================================== | |
650 | // Strict Lambda Analysis for dE/dx Calibration Check | |
651 | TH2D *f2dHistdEdxSignalPionFromLambda = (TH2D*)clist->FindObject("f2dHistdEdxSignalPionFromLambda"); | |
652 | TH2D *f2dHistdEdxSignalProtonFromLambda = (TH2D*)clist->FindObject("f2dHistdEdxSignalProtonFromLambda"); | |
653 | TH2D *f2dHistResponsePionFromLambda = (TH2D*)clist->FindObject("f2dHistResponsePionFromLambda"); | |
654 | TH2D *f2dHistResponseProtonFromLambda = (TH2D*)clist->FindObject("f2dHistResponseProtonFromLambda"); | |
655 | ||
656 | f2dHistdEdxSignalPionFromLambda->Rebin2D(2,10); | |
657 | f2dHistdEdxSignalProtonFromLambda->Rebin2D(2,10); | |
658 | ||
659 | ||
660 | TH1D *fLowPtPionResponse = (TH1D*) f2dHistResponsePionFromLambda->ProjectionY( "fLowPtPionResponse", | |
661 | f2dHistResponsePionFromLambda->GetXaxis()->FindBin(0.5001), | |
662 | f2dHistResponsePionFromLambda->GetXaxis()->FindBin(0.9999) ); | |
663 | ||
664 | TH1D *fMidPtPionResponse = (TH1D*) f2dHistResponsePionFromLambda->ProjectionY( "fMidPtPionResponse", | |
665 | f2dHistResponsePionFromLambda->GetXaxis()->FindBin(1.5001), | |
666 | f2dHistResponsePionFromLambda->GetXaxis()->FindBin(2.4999) ); | |
667 | ||
668 | TH1D *fLowPtProtonResponse = (TH1D*) f2dHistResponseProtonFromLambda->ProjectionY( "fLowPtProtonResponse", | |
669 | f2dHistResponseProtonFromLambda->GetXaxis()->FindBin(0.5001), | |
670 | f2dHistResponseProtonFromLambda->GetXaxis()->FindBin(0.9999) ); | |
671 | ||
672 | TH1D *fMidPtProtonResponse = (TH1D*) f2dHistResponseProtonFromLambda->ProjectionY( "fMidPtProtonResponse", | |
673 | f2dHistResponseProtonFromLambda->GetXaxis()->FindBin(1.5001), | |
674 | f2dHistResponseProtonFromLambda->GetXaxis()->FindBin(2.4999) ); | |
675 | ||
676 | ||
677 | ||
678 | TCanvas *cdEdxPure = new TCanvas("cdEdxPure","",1500,800); | |
679 | cdEdxPure->Divide(4,2); | |
680 | ||
681 | for(Int_t ic = 1; ic<9; ic++){ | |
682 | cdEdxPure->SetLeftMargin(0.15); | |
683 | cdEdxPure->cd(ic)->SetLogz(); | |
684 | //cdEdxPure->cd(ic)->SetTopMargin(0.133); | |
685 | if( ic%4 == 1 || ic%4 == 2){ | |
686 | cdEdxPure->cd(ic)->SetRightMargin(0.133); | |
687 | } | |
688 | if( ic%4 != 1 && ic%4 != 2){ | |
689 | cdEdxPure->cd(ic)->SetGridx(); | |
690 | cdEdxPure->cd(ic)->SetGridy(); | |
691 | } | |
692 | } | |
693 | ||
694 | ||
695 | ||
696 | cdEdxPure->cd(1); | |
697 | f2dHistdEdxSignalPionFromLambda->Draw("colz"); | |
698 | cdEdxPure->cd(2); | |
699 | f2dHistResponsePionFromLambda->Draw("colz"); | |
700 | cdEdxPure->cd(3); | |
701 | fLowPtPionResponse->Draw(); | |
702 | cdEdxPure->cd(4); | |
703 | fMidPtPionResponse->Draw(); | |
704 | ||
705 | cdEdxPure->cd(5); | |
706 | f2dHistdEdxSignalProtonFromLambda->Draw("colz"); | |
707 | cdEdxPure->cd(6); | |
708 | f2dHistResponseProtonFromLambda->Draw("colz"); | |
709 | cdEdxPure->cd(7); | |
710 | fLowPtProtonResponse->Draw(); | |
711 | cdEdxPure->cd(8); | |
712 | fMidPtProtonResponse->Draw(); | |
713 | ||
714 | ||
715 | ||
716 | //Write explanations on canvases | |
717 | cdEdxPure->cd(1); Tl.DrawLatex(.25, .9277, "#pi^{-} from #Lambda: TPC Signal"); | |
718 | cdEdxPure->cd(2); Tl.DrawLatex(.15, .9277, "#pi^{-} from #Lambda: AliPIDResponse Value"); | |
719 | cdEdxPure->cd(3); Tl.DrawLatex(.21, .9277, "#pi^{-} N#sigma, 0.5 < p_{T} (GeV/c) < 1.0"); | |
720 | cdEdxPure->cd(4); Tl.DrawLatex(.21, .9277, "#pi^{-} N#sigma, 1.5 < p_{T} (GeV/c) < 2.5"); | |
721 | ||
722 | cdEdxPure->cd(5); Tl.DrawLatex(.25, .9277, "p from #Lambda: TPC Signal"); | |
723 | cdEdxPure->cd(6); Tl.DrawLatex(.15, .9277, "p from #Lambda: AliPIDResponse Value"); | |
724 | cdEdxPure->cd(7); Tl.DrawLatex(.21, .9277, "p N#sigma, 0.5 < p_{T} (GeV/c) < 1.0"); | |
725 | cdEdxPure->cd(8); Tl.DrawLatex(.21, .9277, "p N#sigma, 1.5 < p_{T} (GeV/c) < 2.5"); | |
726 | ||
727 | Double_t lLowPtPeakPion = fLowPtPionResponse->GetBinCenter( fLowPtPionResponse->GetMaximumBin() ); | |
728 | Double_t lMidPtPeakPion = fMidPtPionResponse->GetBinCenter( fMidPtPionResponse->GetMaximumBin() ); | |
729 | Double_t lLowPtPeakProton = fLowPtProtonResponse->GetBinCenter( fLowPtProtonResponse->GetMaximumBin() ); | |
730 | Double_t lMidPtPeakProton = fMidPtProtonResponse->GetBinCenter( fMidPtProtonResponse->GetMaximumBin() ); | |
731 | ||
732 | //List Maximal Values | |
733 | cout<<"Maximal Value for pion from Lambda at low pt...............: " <<lLowPtPeakPion<<endl; | |
734 | cout<<"Maximal Value for pion from Lambda at mid pt...............: " <<lMidPtPeakPion<<endl; | |
735 | cout<<"Maximal Value for proton from Lambda at low pt.............: " <<lLowPtPeakProton<<endl; | |
736 | cout<<"Maximal Value for proton from Lambda at mid pt.............: " <<lMidPtPeakProton<<endl; | |
737 | ||
738 | if( TMath::Abs( lLowPtPeakPion ) > 0.3) cout<<"*** WARNING: Check Low Pt pion PID Response! ***"<<endl; | |
739 | if( TMath::Abs( lMidPtPeakPion ) > 0.3) cout<<"*** WARNING: Check Mid Pt pion PID Response! ***"<<endl; | |
740 | if( TMath::Abs( lLowPtPeakProton ) > 0.3) cout<<"*** WARNING: Check Low Pt proton PID Response! ***"<<endl; | |
741 | if( TMath::Abs( lMidPtPeakProton ) > 0.3) cout<<"*** WARNING: Check Mid Pt proton PID Response! ***"<<endl; | |
742 | ||
743 | TLatex Tlq; | |
744 | Tlq.SetNDC(); | |
745 | Tlq.SetTextSize(0.06); | |
746 | ||
747 | //Draw Arrows to be sure! | |
748 | Double_t lFractionHeight = 0.33; | |
749 | cdEdxPure->cd(3); | |
750 | TArrow *ar1 = new TArrow(lLowPtPeakPion,lFractionHeight * fLowPtPionResponse->GetMaximum(),lLowPtPeakPion,0.0, 0.008 ,"|>"); | |
751 | ar1->SetLineWidth(2); | |
752 | ar1->Draw(); | |
753 | if( TMath::Abs( lLowPtPeakPion ) < 0.3) { | |
754 | Tlq.SetTextColor(8); | |
755 | Tlq.DrawLatex ( 0.15,0.8, "OK!"); | |
756 | } else { | |
757 | Tlq.SetTextColor(kRed); | |
758 | Tlq.DrawLatex ( 0.15,0.8, "Prob.! Check dEd/x!"); | |
759 | } | |
760 | ||
761 | cdEdxPure->cd(4); | |
762 | TArrow *ar2 = new TArrow(lMidPtPeakPion,lFractionHeight * fMidPtPionResponse->GetMaximum(),lLowPtPeakPion,0.0, 0.008 ,"|>"); | |
763 | ar2->SetLineWidth(2); | |
764 | ar2->Draw(); | |
765 | if( TMath::Abs( lMidPtPeakPion ) < 0.3) { | |
766 | Tlq.SetTextColor(8); | |
767 | Tlq.DrawLatex ( 0.15,0.8, "OK!"); | |
768 | } else { | |
769 | Tlq.SetTextColor(kRed); | |
770 | Tlq.DrawLatex ( 0.15,0.8, "Prob.! Check dEd/x!"); | |
771 | } | |
772 | ||
773 | cdEdxPure->cd(7); | |
774 | TArrow *ar3 = new TArrow(lLowPtPeakProton,lFractionHeight * fLowPtProtonResponse->GetMaximum(),lLowPtPeakPion,0.0, 0.008 ,"|>"); | |
775 | ar3->SetLineWidth(2); | |
776 | ar3->Draw(); | |
777 | if( TMath::Abs( lLowPtPeakProton ) < 0.3) { | |
778 | Tlq.SetTextColor(8); | |
779 | Tlq.DrawLatex ( 0.15,0.8, "OK!"); | |
780 | } else { | |
781 | Tlq.SetTextColor(kRed); | |
782 | Tlq.DrawLatex ( 0.15,0.8, "Prob.! Check dEd/x!"); | |
783 | } | |
784 | ||
785 | cdEdxPure->cd(8); | |
786 | TArrow *ar4 = new TArrow(lMidPtPeakProton,lFractionHeight * fMidPtProtonResponse->GetMaximum(),lLowPtPeakPion,0.0, 0.008 ,"|>"); | |
787 | ar4->SetLineWidth(2); | |
788 | ar4->Draw(); | |
789 | if( TMath::Abs( lMidPtPeakProton ) < 0.3) { | |
790 | Tlq.SetTextColor(8); | |
791 | Tlq.DrawLatex ( 0.15,0.8, "OK!"); | |
792 | } else { | |
793 | Tlq.SetTextColor(kRed); | |
794 | Tlq.DrawLatex ( 0.15,0.8, "Prob.! Check dEd/x!"); | |
795 | } | |
796 | cdEdxPure->SaveAs("V0_QA.pdf"); | |
797 | ||
798 | //============================================================== | |
799 | ||
800 | //============================================================== | |
801 | //Topological variable QA | |
802 | // FIXME: This is still only a rough first version. | |
803 | // Adjustments will be required for easy / long-term operation. | |
804 | TH1D *fHistTopDCAPosToPV = (TH1D*)clist->FindObject("fHistSelectedTopDCAPosToPV"); | |
805 | TH1D *fHistTopDCANegToPV = (TH1D*)clist->FindObject("fHistSelectedTopDCANegToPV"); | |
806 | TH1D *fHistTopDCAV0Daughters = (TH1D*)clist->FindObject("fHistSelectedTopDCAV0Daughters"); | |
807 | TH1D *fHistTopCosinePA = (TH1D*)clist->FindObject("fHistSelectedTopCosinePA"); | |
808 | TH1D *fHistTopV0Radius = (TH1D*)clist->FindObject("fHistSelectedTopV0Radius"); | |
809 | ||
810 | //Zoom in on selection in Cosine of pointing angle... | |
811 | Int_t iLowBin=-1; | |
812 | Int_t iLowBin2 = -1; | |
813 | Int_t iLowBin3 = -1; | |
814 | ||
815 | //Normalize to per-event | |
816 | fHistTopDCAPosToPV -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
817 | fHistTopDCANegToPV -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
818 | fHistTopDCAV0Daughters -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
819 | fHistTopCosinePA -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
820 | fHistTopV0Radius -> Scale ( 1. / ((Double_t)fHistEvent->GetBinContent(4) ) ); | |
821 | ||
822 | fHistTopDCAPosToPV -> GetYaxis() -> SetTitle("Counts / Event"); | |
823 | fHistTopDCANegToPV -> GetYaxis() -> SetTitle("Counts / Event"); | |
824 | fHistTopDCAV0Daughters -> GetYaxis() -> SetTitle("Counts / Event"); | |
825 | fHistTopCosinePA -> GetYaxis() -> SetTitle("Counts / Event"); | |
826 | fHistTopV0Radius -> GetYaxis() -> SetTitle("Counts / Event"); | |
827 | ||
828 | fHistTopDCAPosToPV -> GetYaxis() -> SetTitleSize(0.05); | |
829 | fHistTopDCANegToPV -> GetYaxis() -> SetTitleSize(0.05); | |
830 | fHistTopDCAV0Daughters -> GetYaxis() -> SetTitleSize(0.05); | |
831 | fHistTopCosinePA -> GetYaxis() -> SetTitleSize(0.05); | |
832 | fHistTopV0Radius -> GetYaxis() -> SetTitleSize(0.05); | |
833 | ||
834 | fHistTopDCAPosToPV -> GetXaxis() -> SetTitleSize(0.05); | |
835 | fHistTopDCANegToPV -> GetXaxis() -> SetTitleSize(0.05); | |
836 | fHistTopDCAV0Daughters -> GetXaxis() -> SetTitleSize(0.05); | |
837 | fHistTopCosinePA -> GetXaxis() -> SetTitleSize(0.05); | |
838 | fHistTopV0Radius -> GetXaxis() -> SetTitleSize(0.05); | |
839 | ||
840 | Double_t lMinimumCosPADraw = 1.-1.25*(1.-GetXForMinValue ( fHistTopCosinePA ) ); //assumes monotonically increasing dist | |
841 | cout<<"Function test: "<< lMinimumCosPADraw <<endl; | |
842 | fHistTopCosinePA->GetXaxis()->SetRangeUser(lMinimumCosPADraw,1.001); | |
843 | ||
844 | Double_t lmin[5]; | |
845 | Double_t lminPrecision[5]; | |
846 | lmin[3] = GetXForMinValue ( fHistTopCosinePA ); | |
847 | lmin[4] = GetXForMinValue ( fHistTopV0Radius ); | |
848 | lmin[0] = GetXForMaxValue ( fHistTopDCAPosToPV ); | |
849 | lmin[1] = GetXForMaxValue ( fHistTopDCANegToPV ); | |
850 | lmin[2] = GetXForMinValue ( fHistTopDCAV0Daughters ); | |
851 | ||
852 | lminPrecision[3] = fHistTopCosinePA -> GetBinWidth(1); | |
853 | lminPrecision[4] = fHistTopV0Radius -> GetBinWidth(1); | |
854 | lminPrecision[0] = fHistTopDCAPosToPV -> GetBinWidth(1); | |
855 | lminPrecision[1] = fHistTopDCANegToPV -> GetBinWidth(1); | |
856 | lminPrecision[2] = fHistTopDCAV0Daughters -> GetBinWidth(1); | |
857 | ||
858 | cout<<"Minimum Values Found: "<<endl; | |
859 | cout<<"Cosine of Pointing Angle...........: "<<GetXForMinValue (fHistTopCosinePA )<<" precision = "<<lminPrecision[3]<<endl; | |
860 | cout<<"DCA Neg Daughter to PV.............: "<<GetXForMaxValue (fHistTopDCAPosToPV )<<" precision = "<<lminPrecision[1]<<endl; | |
861 | cout<<"DCA Pos Daughter to PV.............: "<<GetXForMaxValue (fHistTopDCANegToPV )<<" precision = "<<lminPrecision[0]<<endl; | |
862 | cout<<"DCA V0 Daughers....................: "<<GetXForMinValue (fHistTopDCAV0Daughters )<<" precision = "<<lminPrecision[2]<<endl; | |
863 | cout<<"V0 Decay Radius....................: "<<GetXForMinValue (fHistTopV0Radius )<<" precision = "<<lminPrecision[4]<<endl; | |
864 | ||
865 | ||
866 | TCanvas *cTopo = new TCanvas ("cTopo","",1200,800); | |
867 | cTopo->Divide(3,2); | |
868 | for(Int_t ic = 1; ic<7; ic++){ | |
869 | cTopo->cd(ic)->SetLeftMargin(0.15); | |
870 | cTopo->cd(ic)->SetGridx(); | |
871 | cTopo->cd(ic)->SetGridy(); | |
872 | } | |
873 | ||
874 | cTopo->cd(1); | |
875 | fHistTopDCAPosToPV->Draw(); | |
876 | cTopo->cd(2); | |
877 | fHistTopDCANegToPV->Draw(); | |
878 | cTopo->cd(3); | |
879 | fHistTopDCAV0Daughters->Draw(); | |
880 | cTopo->cd(4); | |
881 | fHistTopCosinePA->Draw(); | |
882 | cTopo->cd(5); | |
883 | fHistTopV0Radius->Draw(); | |
884 | ||
885 | TLatex Tlt; | |
886 | Tlt.SetNDC(); | |
887 | Tlt.SetTextSize(0.05); | |
888 | cTopo->cd(6); | |
889 | ||
890 | Tlt.DrawLatex(.22, .9, "Boundary Checks") ; | |
891 | ||
892 | ||
893 | ||
894 | TString lCut[5]; | |
895 | lCut [ 0 ] = "Min DCA Pos D. To PV (cm)"; | |
896 | lCut [ 1 ] = "Min DCA Neg D. To PV (cm)"; | |
897 | lCut [ 2 ] = "Max DCA V0 Daughters (#sigma)"; | |
898 | lCut [ 3 ] = "Min Cosine PA"; | |
899 | lCut [ 4 ] = "Min 2D Decay Radius (cm)"; | |
900 | ||
901 | TString lCutVal[5]; | |
902 | TString lCutValPrec[5]; | |
903 | ||
904 | Tlt.SetTextSize(0.04); | |
905 | Tlt.SetTextFont(42); | |
906 | ||
907 | Tlt.DrawLatex(.01, .80, "Topological Var.") ; | |
908 | Tlt.DrawLatex(.6, .80, "Value") ; | |
909 | Tlt.DrawLatex(.75, .80, "Precision") ; | |
910 | ||
911 | for (Int_t il=0;il<5;il++){ | |
912 | Tlt.DrawLatex(.01,0.72-((double)il)*0.075, lCut[il].Data() ); | |
913 | lCutVal[il] = Form( "%.4f", lmin[il] ); | |
914 | Tlt.DrawLatex(.5925,0.72-((double)il)*0.075, lCutVal[il].Data() ); | |
915 | lCutValPrec[il] = Form( "%.4f", lminPrecision[il] ); | |
916 | Tlt.DrawLatex(.7675,0.72-((double)il)*0.075, lCutValPrec[il].Data() ); | |
917 | } | |
918 | ||
919 | Tlt.SetTextSize(0.05); | |
920 | Tlt.SetTextFont(42); | |
921 | ||
922 | //Try to make a wild guess... | |
923 | if ( TMath::Abs( lmin[0] - 0.100 ) < 2*lminPrecision[0] && | |
924 | TMath::Abs( lmin[1] - 0.100 ) < 2*lminPrecision[1] && | |
925 | TMath::Abs( lmin[2] - 1.000 ) < 2*lminPrecision[2] && | |
926 | TMath::Abs( lmin[3] - 0.998 ) < 2*lminPrecision[3] && | |
927 | TMath::Abs( lmin[4] - 0.500 ) < 2*lminPrecision[4] ){ | |
928 | Tlt.DrawLatex( 0.17, 0.275, "#bf{Autodetect Interpretation}: "); | |
929 | Tlt.DrawLatex( 0.1, 0.2, "Typical #bf{Pb-Pb} Reconstruction Cuts"); | |
930 | } | |
931 | if ( TMath::Abs( lmin[0] - 0.020 ) < 2*lminPrecision[0] && | |
932 | TMath::Abs( lmin[1] - 0.020 ) < 2*lminPrecision[1] && | |
933 | TMath::Abs( lmin[2] - 1.500 ) < 2*lminPrecision[2] && | |
934 | TMath::Abs( lmin[3] - 0.98 ) < 2*lminPrecision[3] && | |
935 | TMath::Abs( lmin[4] - 0.500 ) < 2*lminPrecision[4] ){ | |
936 | Tlt.DrawLatex( 0.15, 0.29, "#bf{Autodetect Interpretation}: "); | |
937 | Tlt.DrawLatex( 0.1, 0.2, "Typical pp Reconstruction Cuts"); //To be checked | |
938 | } | |
939 | cTopo->SaveAs("V0_QA.pdf)"); | |
940 | ||
941 | ||
942 | } | |
943 | ||
944 | CustomGStyleSettings(){ | |
945 | gStyle->SetOptStat(0); | |
946 | gStyle->SetGridColor(kGray); | |
947 | ||
948 | } | |
949 | ||
950 | Double_t GetXForMaxValue( TH1D *lHist){ | |
951 | Double_t lMaximum = 1e-10; | |
952 | Double_t lMaximumX = 1000; | |
953 | Double_t lThisBin = -1; | |
954 | for(Long_t ib=1; ib<lHist->GetNbinsX()+1; ib++){ | |
955 | lThisBin = lHist->GetBinContent(ib); | |
956 | if ( lThisBin > lMaximum ){ | |
957 | lMaximum = lHist->GetBinContent(ib); | |
958 | lMaximumX = lHist->GetBinLowEdge(ib); | |
959 | } | |
960 | } | |
961 | return lMaximumX; | |
962 | } | |
963 | ||
964 | Double_t GetXForMinValue( TH1D *lHist){ | |
965 | Double_t lThreshold = 1e-7; | |
966 | Double_t lMinimum = 1e+10; | |
967 | Double_t lMinimumX = 1000; | |
968 | Double_t lThisBin = -1; | |
969 | for(Long_t ib=1; ib<lHist->GetNbinsX()+1; ib++){ | |
970 | lThisBin = lHist->GetBinContent(ib); | |
971 | if ( lThisBin < lMinimum && lThisBin>lThreshold ){ | |
972 | lMinimum = lHist->GetBinContent(ib); | |
973 | lMinimumX = lHist->GetBinLowEdge(ib); | |
974 | } | |
975 | } | |
976 | return lMinimumX; | |
977 | } | |
978 | ||
979 | //Trick for background fitting (pol2) | |
980 | Double_t MyBgPol2(const Double_t *x, const Double_t *par) | |
981 | { | |
982 | //par[0] and par[1] -> linear and angular coefficients | |
983 | //par[2] and par[3] -> lower and upper peak boundaries | |
984 | if ( x[0] > par[2] && x[0] < par[3]) { | |
985 | TF1::RejectPoint(); | |
986 | return 0; | |
987 | } | |
988 | return par[0] + par[1]*x[0]; | |
989 | } | |
990 | ||
991 | ||
992 |