]>
Commit | Line | Data |
---|---|---|
948b38b2 | 1 | /********************************************************* |
2 | processJETrackQA: | |
3 | Post processing macro for the JET Track QA | |
4 | ||
5 | ||
6 | *********************************************************/ | |
7 | ||
8 | ||
9 | const Float_t ptmin = 0.0 ; | |
d9605cca | 10 | void processJETrackQA(TString strFileIn = "AnalysisResults.root", |
11 | TString strFileIn2 = "", | |
948b38b2 | 12 | TString suffix = "eps", |
13 | Int_t cent = 10, | |
14 | Int_t trig = 1, | |
15 | Bool_t bESD = kFALSE, | |
16 | Int_t run = 0, | |
17 | const char *outfile ="JETrackQA_output.root") { | |
18 | ||
19 | gStyle->SetOptStat(0); | |
20 | gStyle->SetOptTitle(0); | |
21 | ||
22 | TString prefix = "fig_je_TrackQA_"; | |
23 | ||
24 | TString strTrigger = ""; | |
25 | if(trig==1) strTrigger = "kCentral"; | |
26 | if(trig==2) strTrigger = "kSemiCentral"; | |
27 | if(trig==3) strTrigger = "kMBkCentralkSemiCentral"; | |
28 | if(trig==4) strTrigger = "kEMCEJE"; | |
29 | if(trig==5) strTrigger = "kINT7"; | |
f6cacedb | 30 | if(trig==6) strTrigger = "kMB"; |
948b38b2 | 31 | |
32 | TString strTrigger2 = ""; | |
33 | if(trig==1) strTrigger2 = "kCentral"; | |
34 | if(trig==2) strTrigger2 = "kSemiCentral"; | |
35 | if(trig==3) strTrigger2 = "kMBkCentralSemiCentral"; | |
36 | if(trig==4) strTrigger2 = "kEMCEJE"; | |
37 | if(trig==5) strTrigger2 = "kINT7"; | |
f6cacedb | 38 | if(trig==6) strTrigger2 = "kMB"; |
948b38b2 | 39 | |
40 | Int_t globStTrackType = 0; | |
41 | Int_t globStCuts = 5; | |
42 | Int_t globCnoSPDTrackType = 7; | |
43 | Int_t globCnoSPDCuts = 5; | |
44 | ||
45 | TFile * f1 = TFile::Open(strFileIn.Data()); | |
d9605cca | 46 | TFile * f2; Bool_t drawComp = kFALSE; |
47 | if(strFileIn2!="") { | |
48 | f2 = TFile::Open(strFileIn2.Data()); | |
49 | drawComp = kTRUE; | |
50 | } | |
f6cacedb | 51 | |
948b38b2 | 52 | //Load histograms |
53 | TList *histsGlobSt = 0x0; | |
54 | histsGlobSt = (TList*)f1->Get(Form("PWG4_HighPtTrackQACent%dTrackType%dCuts%d%s/qa_histsQAtrackCent%dType%dcuts%d%s",cent,globStTrackType,globStCuts,strTrigger.Data(),cent,globStTrackType,globStCuts,strTrigger2.Data())); | |
55 | ||
56 | if(!histsGlobSt) { | |
57 | Printf(">>>> ERROR: histsGlobSt is not Available"); | |
58 | return; | |
59 | } | |
60 | ||
61 | TH1F *fNEventSelGlobSt = histsGlobSt->FindObject("fNEventSel"); | |
62 | float NEventsGlobSt = fNEventSelGlobSt->GetEntries(); | |
63 | ||
64 | TList *histsGlobCnoSPD = 0x0; | |
65 | histsGlobCnoSPD = (TList*)f1->Get(Form("PWG4_HighPtTrackQACent%dTrackType%dCuts%d%s/qa_histsQAtrackCent%dType%dcuts%d%s",cent,globCnoSPDTrackType,globCnoSPDCuts,strTrigger.Data(),cent,globCnoSPDTrackType,globCnoSPDCuts,strTrigger2.Data())); | |
66 | //histsGlobCnoSPD->Print(); | |
67 | TH1F *fNEventSelGlobCnoSPD = histsGlobCnoSPD->FindObject("fNEventSel"); | |
68 | float NEventsGlobCnoSPD = fNEventSelGlobCnoSPD->GetEntries(); | |
69 | ||
f6cacedb | 70 | if(NEventsGlobSt==0) |
71 | NEventsGlobSt=0.1; | |
72 | if(NEventsGlobCnoSPD==0) | |
73 | NEventsGlobCnoSPD=0.1; | |
74 | ||
d9605cca | 75 | // Perform the same actions for the comparisongraphs |
76 | TList *histsGlobSt2 = 0x0; TList *histsGlobCnoSPD2 = 0x0; TH1F *fNEventSelGlobSt2; float NEventsGlobSt2; TH1F *fNEventSelGlobCnoSPD2; float NEventsGlobCnoSPD2; | |
77 | if(drawComp) { | |
78 | histsGlobSt2 = (TList*)f2->Get(Form("PWG4_HighPtTrackQACent%dTrackType%dCuts%d%s/qa_histsQAtrackCent%dType%dcuts%d%s",cent,globStTrackType,globStCuts,strTrigger.Data(),cent,globStTrackType,globStCuts,strTrigger2.Data())); | |
79 | fNEventSelGlobSt2 = (TH1F*)histsGlobSt2->FindObject("fNEventSel"); | |
80 | NEventsGlobSt2 = fNEventSelGlobSt2->GetEntries(); | |
81 | ||
82 | histsGlobCnoSPD2 = (TList*)f1->Get(Form("PWG4_HighPtTrackQACent%dTrackType%dCuts%d%s/qa_histsQAtrackCent%dType%dcuts%d%s",cent,globCnoSPDTrackType,globCnoSPDCuts,strTrigger.Data(),cent,globCnoSPDTrackType,globCnoSPDCuts,strTrigger2.Data())); | |
83 | //histsGlobCnoSPD->Print(); | |
84 | fNEventSelGlobCnoSPD2 = (TH1F*)histsGlobCnoSPD2->FindObject("fNEventSel"); | |
85 | NEventsGlobCnoSPD2 = fNEventSelGlobCnoSPD2->GetEntries(); | |
86 | ||
87 | if(NEventsGlobSt2==0) | |
88 | NEventsGlobSt2=0.1; | |
89 | if(NEventsGlobCnoSPD2==0) | |
90 | NEventsGlobCnoSPD2=0.1; | |
91 | } | |
92 | ||
948b38b2 | 93 | //--------------------------------------------------------------------------------------------------- |
94 | // phi distribution of hybrid tracks | |
95 | //--------------------------------------------------------------------------------------------------- | |
96 | ||
97 | TH2F *fPtPhiGlobSt = histsGlobSt->FindObject("fPtPhi"); | |
98 | TH2F *fPtPhiGlobCnoSPD = histsGlobCnoSPD->FindObject("fPtPhi"); | |
d9605cca | 99 | fPtPhiGlobSt->SetXTitle("p_{T,track} [GeV/c]"); |
948b38b2 | 100 | fPtPhiGlobSt->SetYTitle("#varphi"); |
d9605cca | 101 | fPtPhiGlobCnoSPD->SetXTitle("p_{T,track} [GeV/c]"); |
948b38b2 | 102 | fPtPhiGlobCnoSPD->SetYTitle("#varphi"); |
103 | ||
d9605cca | 104 | TH2F* fPtPhiGlobSt2; TH2F* fPtPhiGlobCnoSPD2; |
105 | if(drawComp) { | |
106 | fPtPhiGlobSt2 = (TH2F*) histsGlobSt2->FindObject("fPtPhi"); | |
107 | fPtPhiGlobCnoSPD2 = (TH2F*) histsGlobCnoSPD2->FindObject("fPtPhi"); | |
108 | fPtPhiGlobSt2->SetXTitle("p_{T,track} [GeV/c]"); | |
109 | fPtPhiGlobSt2->SetYTitle("#varphi"); | |
110 | fPtPhiGlobCnoSPD2->SetXTitle("p_{T,track} [GeV/c]"); | |
111 | fPtPhiGlobCnoSPD2->SetYTitle("#varphi"); | |
112 | } | |
113 | ||
948b38b2 | 114 | TCanvas *c2 =new TCanvas("c2","c2: Phi",600,450); |
115 | Int_t binMin = 1; | |
116 | if(ptmin>0.) binMin = fPtPhiGlobSt->GetXaxis()->FindBin(ptmin+0.00001); | |
117 | TH1D *fPhiGlobSt = fPtPhiGlobSt->ProjectionY("fPhiGlobSt",binMin,fPtPhiGlobSt->GetNbinsX()); | |
118 | TH1D *fPhiGlobCnoSPD = fPtPhiGlobCnoSPD->ProjectionY("fPhiGlobCnoSPD",binMin,fPtPhiGlobSt->GetNbinsX()); | |
119 | ||
120 | fPhiGlobSt->SetLineColor(2); | |
121 | fPhiGlobSt->SetLineWidth(3); | |
122 | ||
123 | fPhiGlobCnoSPD->SetLineStyle(1); | |
124 | fPhiGlobCnoSPD->SetLineColor(4); | |
125 | fPhiGlobCnoSPD->SetLineWidth(3); | |
126 | ||
127 | TH1D *fPhiGlobSum = fPhiGlobSt->Clone(); | |
128 | fPhiGlobSum->SetTitle("fPhiGlobSum"); | |
129 | fPhiGlobSum->SetName("fPhiGlobSum"); | |
130 | fPhiGlobSum->Add(fPhiGlobCnoSPD); | |
d9605cca | 131 | |
132 | fPhiGlobSum->SetLineColor(1); | |
133 | fPhiGlobSum->SetMarkerColor(1); | |
948b38b2 | 134 | |
135 | fPhiGlobSt->Scale(1./NEventsGlobSt,"width"); | |
136 | fPhiGlobCnoSPD->Scale(1./NEventsGlobSt,"width"); | |
137 | fPhiGlobSum->Scale(1./NEventsGlobSt,"width"); | |
138 | ||
d9605cca | 139 | if(drawComp) { |
140 | TH1D *fPhiGlobSt2 = fPtPhiGlobSt2->ProjectionY("fPhiGlobSt_old",binMin,fPtPhiGlobSt->GetNbinsX()); | |
141 | TH1D *fPhiGlobCnoSPD2 = fPtPhiGlobCnoSPD2->ProjectionY("fPhiGlobCnoSPD_old",binMin,fPtPhiGlobSt->GetNbinsX()); | |
142 | ||
143 | fPhiGlobSt2->SetLineStyle(2); | |
144 | fPhiGlobSt2->SetLineColor(2); | |
145 | fPhiGlobSt2->SetLineWidth(5); | |
146 | ||
147 | fPhiGlobCnoSPD2->SetLineStyle(2); | |
148 | fPhiGlobCnoSPD2->SetLineColor(4); | |
149 | fPhiGlobCnoSPD2->SetLineWidth(5); | |
150 | ||
151 | TH1D *fPhiGlobSum2 = fPhiGlobSt2->Clone(); | |
152 | fPhiGlobSum2->SetTitle("fPhiGlobSum_old"); | |
153 | fPhiGlobSum2->SetName("fPhiGlobSum_old"); | |
154 | fPhiGlobSum2->Add(fPhiGlobCnoSPD2); | |
155 | ||
156 | fPhiGlobSum2->SetLineStyle(2); | |
157 | fPhiGlobSum2->SetLineWidth(5); | |
158 | fPhiGlobSum2->SetLineColor(1); | |
159 | fPhiGlobSum2->SetMarkerColor(1); | |
160 | ||
161 | fPhiGlobSt2->Scale(1./NEventsGlobSt2,"width"); | |
162 | fPhiGlobCnoSPD2->Scale(1./NEventsGlobSt2,"width"); | |
163 | fPhiGlobSum2->Scale(1./NEventsGlobSt2,"width"); | |
164 | } | |
165 | ||
948b38b2 | 166 | gPad->SetLeftMargin(0.2); |
167 | gPad->SetRightMargin(0.02); | |
168 | gPad->SetBottomMargin(0.12); | |
169 | ||
170 | TH1F *frame2 = gPad->DrawFrame(0.,0.,2.*TMath::Pi(),fPhiGlobSum->GetBinContent(fPhiGlobSum->GetMaximumBin())*1.5); | |
171 | frame2->SetXTitle("#varphi"); | |
172 | frame2->SetYTitle("#frac{1}{N_{evts}} #frac{dN}{d#varphi}"); | |
173 | frame2->GetXaxis()->SetTitleSize(0.06); | |
174 | frame2->GetYaxis()->SetTitleSize(0.06); | |
175 | frame2->GetXaxis()->SetTitleOffset(0.75); | |
176 | frame2->GetYaxis()->SetTitleOffset(1.4); | |
177 | ||
178 | fPhiGlobSt->DrawCopy("same"); | |
179 | fPhiGlobCnoSPD->DrawCopy("same"); | |
948b38b2 | 180 | fPhiGlobSum->DrawCopy("same"); |
d9605cca | 181 | if(drawComp) { |
182 | fPhiGlobSt2->DrawCopy("same"); | |
183 | fPhiGlobCnoSPD2->DrawCopy("same"); | |
184 | fPhiGlobSum2->DrawCopy("same"); | |
185 | } | |
948b38b2 | 186 | |
187 | TLegend *leg2 = NULL; | |
188 | if(run>0) leg2 = new TLegend(0.22,0.65,0.88,0.88,Form("Hybrid tracks. run:%d",run)); | |
189 | else leg2 = new TLegend(0.22,0.65,0.88,0.88,"Hybrid tracks"); | |
190 | leg2->SetFillColor(10); | |
191 | leg2->SetBorderSize(0); | |
192 | leg2->SetFillStyle(0); | |
193 | leg2->SetTextSize(0.06); | |
9ee72c38 | 194 | leg2->AddEntry(fPhiGlobSt,"Restricted Tracks","l"); |
195 | leg2->AddEntry(fPhiGlobCnoSPD,"Complementary Tracks","l"); | |
196 | leg2->AddEntry(fPhiGlobSum,"Sum","l"); | |
d9605cca | 197 | if(drawComp) |
198 | leg2->AddEntry(fPhiGlobSum2, "Previous production", "l"); | |
948b38b2 | 199 | leg2->Draw(); |
200 | ||
201 | TLatex textNEvents; | |
202 | textNEvents.SetNDC(); | |
203 | textNEvents.DrawLatex(0.52,0.42,Form("#it{N}_{events} = %.0f",NEventsGlobSt)); | |
204 | ||
205 | c2->SaveAs(Form("%sPhiCent%d%sRun%d.%s",prefix.Data(),cent,strTrigger.Data(),run,suffix.Data())); | |
206 | ||
207 | //--------------------------------------------------------------------------------------------------- | |
208 | // pt distribution of hybrid tracks | |
209 | //--------------------------------------------------------------------------------------------------- | |
210 | ||
211 | TCanvas *c1 =new TCanvas("c1","c1: Phi",600,450); | |
212 | Int_t binMin = 1; | |
213 | if(ptmin>0.) binMin = fPtPhiGlobSt->GetXaxis()->FindBin(ptmin+0.00001); | |
214 | TH1D *fPtGlobSt = fPtPhiGlobSt->ProjectionX("fPtGlobSt"); | |
215 | TH1D *fPtGlobCnoSPD = fPtPhiGlobCnoSPD->ProjectionX("fPtGlobCnoSPD"); | |
216 | ||
217 | fPtGlobSt->SetLineColor(2); | |
218 | fPtGlobSt->SetLineWidth(3); | |
219 | ||
220 | fPtGlobCnoSPD->SetLineStyle(1); | |
221 | fPtGlobCnoSPD->SetLineColor(4); | |
222 | fPtGlobCnoSPD->SetLineWidth(3); | |
223 | ||
224 | TH1D *fPtGlobSum = fPtGlobSt->Clone(); | |
225 | fPtGlobSum->SetTitle("fPtGlobSum"); | |
226 | fPtGlobSum->SetName("fPtGlobSum"); | |
227 | fPtGlobSum->Add(fPtGlobCnoSPD); | |
228 | ||
d9605cca | 229 | fPtGlobSum->SetLineColor(1); |
230 | fPtGlobSum->SetMarkerColor(1); | |
231 | ||
948b38b2 | 232 | fPtGlobSt->Scale(1./NEventsGlobSt,"width"); |
233 | fPtGlobCnoSPD->Scale(1./NEventsGlobSt,"width"); | |
234 | fPtGlobSum->Scale(1./NEventsGlobSt,"width"); | |
235 | ||
d9605cca | 236 | |
237 | if(drawComp) { | |
238 | TH1D *fPtGlobSt2 = fPtPhiGlobSt2->ProjectionX("fPtGlobSt_old"); | |
239 | TH1D *fPtGlobCnoSPD2 = fPtPhiGlobCnoSPD2->ProjectionX("fPtGlobCnoSPD_old"); | |
240 | ||
241 | fPtGlobSt2->SetLineStyle(2); | |
242 | fPtGlobSt2->SetLineColor(2); | |
243 | fPtGlobSt2->SetLineWidth(5); | |
244 | ||
245 | fPtGlobCnoSPD2->SetLineStyle(2); | |
246 | fPtGlobCnoSPD2->SetLineColor(4); | |
247 | fPtGlobCnoSPD2->SetLineWidth(5); | |
248 | ||
249 | TH1D *fPtGlobSum2 = fPtGlobSt2->Clone(); | |
250 | fPtGlobSum2->SetTitle("fPtGlobSum_old"); | |
251 | fPtGlobSum2->SetName("fPtGlobSum_old"); | |
252 | fPtGlobSum2->Add(fPtGlobCnoSPD2); | |
253 | ||
254 | fPtGlobSum2->SetLineStyle(2); | |
255 | fPtGlobSum2->SetLineColor(1); | |
256 | fPtGlobSum2->SetMarkerColor(1); | |
257 | fPtGlobSum2->SetLineWidth(5); | |
258 | ||
259 | fPtGlobSt2->Scale(1./NEventsGlobSt2,"width"); | |
260 | fPtGlobCnoSPD2->Scale(1./NEventsGlobSt2,"width"); | |
261 | fPtGlobSum2->Scale(1./NEventsGlobSt2,"width"); | |
262 | } | |
263 | ||
948b38b2 | 264 | gPad->SetLeftMargin(0.2); |
265 | gPad->SetRightMargin(0.02); | |
266 | gPad->SetBottomMargin(0.12); | |
267 | ||
268 | TH1F *frame1 = gPad->DrawFrame(0.,1e-7,100.,fPtGlobSum->GetBinContent(fPtGlobSum->GetMaximumBin())*1.5); | |
d9605cca | 269 | frame1->SetXTitle("p_{T} [GeV/c]"); |
270 | frame1->SetYTitle("#frac{1}{N_{evts}}#frac{dN}{dp_{T}} [(GeV/c)^{-1}]"); | |
948b38b2 | 271 | frame1->GetXaxis()->SetTitleSize(0.06); |
272 | frame1->GetYaxis()->SetTitleSize(0.06); | |
273 | frame1->GetXaxis()->SetTitleOffset(0.75); | |
274 | frame1->GetYaxis()->SetTitleOffset(1.4); | |
275 | ||
276 | gPad->SetLogy(); | |
277 | ||
278 | fPtGlobSt->DrawCopy("same"); | |
279 | fPtGlobCnoSPD->DrawCopy("same"); | |
948b38b2 | 280 | fPtGlobSum->DrawCopy("same"); |
d9605cca | 281 | if(drawComp) { |
282 | fPtGlobSt2->DrawCopy("same"); | |
283 | fPtGlobCnoSPD2->DrawCopy("same"); | |
284 | fPtGlobSum2->DrawCopy("same"); | |
285 | } | |
948b38b2 | 286 | |
287 | TLegend *leg1 = NULL; | |
288 | if(run>0) leg1 = new TLegend(0.35,0.65,0.88,0.88,Form("Hybrid tracks. run:%d",run)); | |
289 | else leg1 = new TLegend(0.35,0.65,0.88,0.88,"Hybrid tracks"); | |
290 | leg1->SetFillColor(10); | |
291 | leg1->SetBorderSize(0); | |
292 | leg1->SetFillStyle(0); | |
293 | leg1->SetTextSize(0.06); | |
9ee72c38 | 294 | leg1->AddEntry(fPtGlobSt,"Restricted Tracks","l"); |
295 | leg1->AddEntry(fPtGlobCnoSPD,"Complementary Tracks","l"); | |
296 | leg1->AddEntry(fPtGlobSum,"Sum","l"); | |
d9605cca | 297 | if(drawComp) |
298 | leg1->AddEntry(fPtGlobSum2,"Previous production","l"); | |
948b38b2 | 299 | leg1->Draw(); |
300 | ||
301 | TLatex textNEvents; | |
302 | textNEvents.SetNDC(); | |
303 | textNEvents.DrawLatex(0.55,0.45,Form("#it{N}_{events} = %.0f",NEventsGlobSt)); | |
304 | ||
305 | c1->SaveAs(Form("%sPtCent%d%sRun%d.%s",prefix.Data(),cent,strTrigger.Data(),run,suffix.Data())); | |
306 | ||
307 | //--------------------------------------------------------------------------------------------------- | |
308 | // pT resolution | |
309 | //--------------------------------------------------------------------------------------------------- | |
310 | ||
948b38b2 | 311 | TProfile *fProfPtPtSigma1PtGlobSt = histsGlobSt->FindObject("fProfPtPtSigma1Pt"); |
312 | TProfile *fProfPtPtSigma1PtGlobCnoSPD = histsGlobCnoSPD->FindObject("fProfPtPtSigma1Pt"); | |
313 | ||
314 | fProfPtPtSigma1PtGlobSt->SetTitle("fProfPtPtSigma1PtGlobSt"); | |
315 | fProfPtPtSigma1PtGlobSt->SetName("fProfPtPtSigma1PtGlobSt"); | |
316 | fProfPtPtSigma1PtGlobCnoSPD->SetTitle("fProfPtPtSigma1PtGlobCnoSPD"); | |
317 | fProfPtPtSigma1PtGlobCnoSPD->SetName("fProfPtPtSigma1PtGlobCnoSPD"); | |
318 | ||
319 | for(Int_t i =1 ; i<fProfPtPtSigma1PtGlobSt->GetNbinsX(); i++) { | |
320 | if(fProfPtPtSigma1PtGlobSt->GetBinEffectiveEntries(i)<10.) { | |
321 | fProfPtPtSigma1PtGlobSt->SetBinContent(i,0); | |
322 | fProfPtPtSigma1PtGlobSt->SetBinError(i,0); | |
323 | } | |
324 | if(fProfPtPtSigma1PtGlobCnoSPD->GetBinEffectiveEntries(i)<10.) { | |
325 | fProfPtPtSigma1PtGlobCnoSPD->SetBinContent(i,0); | |
326 | fProfPtPtSigma1PtGlobCnoSPD->SetBinError(i,0); | |
327 | } | |
328 | } | |
329 | ||
d9605cca | 330 | if(drawComp) { |
331 | TProfile *fProfPtPtSigma1PtGlobSt2 = histsGlobSt2->FindObject("fProfPtPtSigma1Pt"); | |
332 | TProfile *fProfPtPtSigma1PtGlobCnoSPD2 = histsGlobCnoSPD2->FindObject("fProfPtPtSigma1Pt"); | |
333 | ||
334 | fProfPtPtSigma1PtGlobSt2->SetTitle("fProfPtPtSigma1PtGlobSt_old"); | |
335 | fProfPtPtSigma1PtGlobSt2->SetName("fProfPtPtSigma1PtGlobSt_old"); | |
336 | fProfPtPtSigma1PtGlobCnoSPD2->SetTitle("fProfPtPtSigma1PtGlobCnoSPD_old"); | |
337 | fProfPtPtSigma1PtGlobCnoSPD2->SetName("fProfPtPtSigma1PtGlobCnoSPD_old"); | |
338 | ||
339 | for(Int_t i =1 ; i<fProfPtPtSigma1PtGlobSt2->GetNbinsX(); i++) { | |
340 | if(fProfPtPtSigma1PtGlobSt2->GetBinEffectiveEntries(i)<10.) { | |
341 | fProfPtPtSigma1PtGlobSt2->SetBinContent(i,0); | |
342 | fProfPtPtSigma1PtGlobSt2->SetBinError(i,0); | |
343 | } | |
344 | if(fProfPtPtSigma1PtGlobCnoSPD2->GetBinEffectiveEntries(i)<10.) { | |
345 | fProfPtPtSigma1PtGlobCnoSPD2->SetBinContent(i,0); | |
346 | fProfPtPtSigma1PtGlobCnoSPD2->SetBinError(i,0); | |
347 | } | |
348 | } | |
349 | } | |
350 | ||
948b38b2 | 351 | TCanvas *c3 =new TCanvas("c3","c3: pT resolution",600,450); |
352 | gPad->SetLeftMargin(0.12); | |
353 | gPad->SetRightMargin(0.02); | |
354 | gPad->SetBottomMargin(0.12); | |
355 | TH1F *frame3 = gPad->DrawFrame(0.,0.,100.,0.3); | |
356 | frame3->SetXTitle("#it{p}_{T,track} [GeV/c]"); | |
357 | frame3->SetYTitle("#it{p}_{T,track}#sigma(1/#it{p}_{T,track})"); | |
358 | frame3->GetXaxis()->SetTitleSize(0.06); | |
359 | frame3->GetYaxis()->SetTitleSize(0.06); | |
360 | frame3->GetXaxis()->SetTitleOffset(0.8); | |
361 | frame3->GetYaxis()->SetTitleOffset(0.8); | |
362 | ||
363 | fProfPtPtSigma1PtGlobSt->SetLineColor(2); | |
364 | fProfPtPtSigma1PtGlobSt->SetLineWidth(3); | |
d9605cca | 365 | fProfPtPtSigma1PtGlobSt->SetMarkerStyle(26); |
948b38b2 | 366 | fProfPtPtSigma1PtGlobSt->SetMarkerColor(2); |
367 | ||
368 | fProfPtPtSigma1PtGlobCnoSPD->SetLineColor(4); | |
369 | fProfPtPtSigma1PtGlobCnoSPD->SetLineWidth(3); | |
d9605cca | 370 | fProfPtPtSigma1PtGlobCnoSPD->SetMarkerStyle(26); |
948b38b2 | 371 | fProfPtPtSigma1PtGlobCnoSPD->SetMarkerColor(4); |
372 | ||
373 | fProfPtPtSigma1PtGlobSt->DrawCopy("same"); | |
374 | fProfPtPtSigma1PtGlobCnoSPD->DrawCopy("same"); | |
375 | ||
d9605cca | 376 | if(drawComp) { |
377 | fProfPtPtSigma1PtGlobSt2->SetLineColor(2); | |
378 | fProfPtPtSigma1PtGlobSt2->SetLineWidth(3); | |
379 | fProfPtPtSigma1PtGlobSt2->SetMarkerStyle(32); | |
380 | fProfPtPtSigma1PtGlobSt2->SetMarkerColor(2); | |
381 | ||
382 | fProfPtPtSigma1PtGlobCnoSPD2->SetLineColor(4); | |
383 | fProfPtPtSigma1PtGlobCnoSPD2->SetLineWidth(3); | |
384 | fProfPtPtSigma1PtGlobCnoSPD2->SetMarkerStyle(32); | |
385 | fProfPtPtSigma1PtGlobCnoSPD2->SetMarkerColor(4); | |
386 | ||
387 | fProfPtPtSigma1PtGlobSt2->DrawCopy("same"); | |
388 | fProfPtPtSigma1PtGlobCnoSPD2->DrawCopy("same"); | |
389 | } | |
390 | ||
948b38b2 | 391 | TLegend *leg3 = NULL; |
392 | if(run>0) leg3 = new TLegend(0.16,0.6,0.88,0.88,Form("Hybrid tracks. run:%d",run)); | |
393 | else leg3 = new TLegend(0.16,0.6,0.88,0.88,"Hybrid tracks"); | |
394 | leg3->SetFillColor(10); | |
395 | leg3->SetBorderSize(0); | |
396 | leg3->SetFillStyle(0); | |
397 | leg3->SetTextSize(0.06); | |
9ee72c38 | 398 | leg3->AddEntry(fProfPtPtSigma1PtGlobSt,"Restricted Tracks","lp"); |
399 | leg3->AddEntry(fProfPtPtSigma1PtGlobCnoSPD,"Complementary Tracks","lp"); | |
d9605cca | 400 | if(drawComp) |
401 | leg3->AddEntry(fProfPtPtSigma1PtGlobSt2, "Previous production", "lp"); | |
948b38b2 | 402 | leg3->Draw(); |
403 | ||
404 | c3->SaveAs(Form("%sPtResolutionCent%d%sRun%d.%s",prefix.Data(),cent,strTrigger.Data(),run,suffix.Data())); | |
405 | ||
406 | //--------------------------------------------------------------------------------------------------- | |
407 | // WRITE OUTPUT TO ROOT FILE | |
408 | //--------------------------------------------------------------------------------------------------- | |
409 | ||
410 | // Modifed by satya to have unique name of objects and same name of file | |
411 | // | |
412 | // TFile *histOut = new TFile(Form("%sHybridCent%d%sRun%d.root",prefix.Data(),cent,strTrigger.Data(),run),"RECREATE"); | |
413 | ||
414 | ||
415 | ||
416 | // Added by sjena | |
417 | TFile *fout = TFile::Open(outfile,"UPDATE"); | |
418 | fout->ls(); | |
419 | ||
420 | TDirectoryFile *cdd = NULL; | |
421 | cdd = (TDirectoryFile*)fout->Get("JE"); | |
422 | if(!cdd) { | |
423 | Printf("Warning: JE <dir> doesn't exist, creating a new one"); | |
424 | cdd = (TDirectoryFile*)fout->mkdir("JE"); | |
425 | } | |
426 | cdd->cd(); | |
427 | cdd->ls(); | |
428 | ||
429 | fPtGlobSt->SetName(Form("%s%s",prefix.Data(), fPtGlobSt->GetName())); | |
430 | fPtGlobSt->Write(); | |
431 | fPtGlobCnoSPD->SetName(Form("%s%s",prefix.Data(), fPtGlobCnoSPD->GetName())); | |
432 | fPtGlobCnoSPD->Write(); | |
433 | fPtGlobSum->SetName(Form("%s%s",prefix.Data(), fPtGlobSum->GetName())); | |
434 | fPtGlobSum->Write(); | |
435 | fPhiGlobSt->SetName(Form("%s%s",prefix.Data(), fPhiGlobSt->GetName())); | |
436 | fPhiGlobSt->Write(); | |
437 | fPhiGlobCnoSPD->SetName(Form("%s%s",prefix.Data(), fPhiGlobCnoSPD->GetName())); | |
438 | fPhiGlobCnoSPD->Write(); | |
439 | fPhiGlobSum->SetName(Form("%s%s",prefix.Data(), fPhiGlobSum->GetName())); | |
440 | fPhiGlobSum->Write(); | |
441 | fProfPtPtSigma1PtGlobSt->SetName(Form("%s%s",prefix.Data(), fProfPtPtSigma1PtGlobSt->GetName())); | |
442 | fProfPtPtSigma1PtGlobSt->Write(); | |
443 | fProfPtPtSigma1PtGlobCnoSPD->SetName(Form("%s%s",prefix.Data(), fProfPtPtSigma1PtGlobCnoSPD->GetName())); | |
444 | fProfPtPtSigma1PtGlobCnoSPD->Write(); | |
445 | ||
446 | fout->Close(); | |
447 | ||
448 | ||
449 | } |