]>
Commit | Line | Data |
---|---|---|
338d12a4 | 1 | /////////////////////////////////////////// |
2 | // | |
3 | // Macro to plot comparison of different | |
4 | // distributions (spectra, correlations) | |
5 | // produced in QA trains but different data | |
6 | // Based on the plots provided by DrawAnaCaloTrackQA.C | |
7 | // | |
8 | // To execute: root -q -b -l DrawProductionComparison.C'("Pi0IM_GammaTrackCorr_EMCAL_default","AnalysisResults.root")' | |
9 | // The input files must be placed in different directoried, | |
10 | // each one defined in the string array "prod" | |
11 | // TString prod[] = {"AOD142","AOD115","ESD"}; | |
12 | // that has to be modified inside the macro. | |
13 | // The number of productions has to be specified | |
14 | // const Int_t nProd = 3; | |
15 | // There is no limitation to the amount of productions | |
16 | // | |
17 | // Author: Gustavo.Conesa.Balbastre@cern.ch | |
18 | // | |
19 | // | |
20 | ||
21 | // Some global variables | |
22 | const Int_t nProd = 3; | |
23 | TString prod[] = {"AOD142","AOD115","ESD"}; | |
24 | ||
25 | TList *list[nProd]; | |
26 | TFile *file[nProd]; | |
27 | TString histoTag = ""; | |
28 | Int_t color[]={kBlack,kRed,kBlue,kOrange+1,kYellow+1,kGreen+2,kCyan+1,kViolet,kMagenta+2,kGray}; | |
29 | ||
30 | Float_t nEvents[nProd] = 0; | |
31 | ||
32 | //_______________________________________________________________________ | |
33 | void DrawProductionComparison(TString listName = "Pi0IM_GammaTrackCorr_EMCAL_default", | |
34 | TString fileName = "AnalysisResults.root") | |
35 | { | |
36 | ||
37 | printf("Open <%s>; Get List : <%s>\n",fileName.Data(),listName.Data()); | |
38 | ||
39 | histoTag = listName; | |
40 | ||
41 | //Access the file and list of histograms, global variables | |
42 | GetFileAndList(fileName, listName); | |
43 | ||
44 | gStyle->SetOptTitle(1); | |
45 | gStyle->SetOptStat(0); | |
46 | gStyle->SetOptFit(000000); | |
47 | gStyle->SetPadRightMargin(0.15); | |
48 | //gStyle->SetPadTopMargin(0.02); | |
49 | //gStyle->SetPadLeftMargin(0.15); | |
50 | gStyle->SetTitleFontSize(0.06); | |
51 | ||
52 | // Declare the different histograms, arrays input is production | |
53 | TH1F* hRaw [nProd]; | |
54 | TH1F* hCorr[nProd]; | |
55 | TH1F* hTM [nProd]; | |
56 | TH1F* hShSh[nProd]; | |
57 | ||
58 | TH1F* hRatRaw [nProd-1]; | |
59 | TH1F* hRatCorr[nProd-1]; | |
60 | TH1F* hRatTM [nProd-1]; | |
61 | TH1F* hRatShSh[nProd-1]; | |
62 | ||
63 | TH1F* hCen [nProd]; | |
64 | TH1F* hRatCen[nProd-1]; | |
65 | ||
66 | TH1F* hVertex[3][nProd]; | |
67 | TH1F* hRatVertex[3][nProd-1]; | |
68 | ||
69 | TH2F* h2TrackMatchResEtaNeg[nProd]; | |
70 | TH2F* h2TrackMatchResEtaPos[nProd]; | |
71 | TH2F* h2TrackMatchResPhiNeg[nProd]; | |
72 | TH2F* h2TrackMatchResPhiPos[nProd]; | |
73 | ||
74 | TH1F* hTrackMatchResEtaNeg[nProd]; | |
75 | TH1F* hTrackMatchResEtaPos[nProd]; | |
76 | TH1F* hTrackMatchResPhiNeg[nProd]; | |
77 | TH1F* hTrackMatchResPhiPos[nProd]; | |
78 | ||
79 | TH1F* hRatTrackMatchResEtaNeg[nProd-1]; | |
80 | TH1F* hRatTrackMatchResEtaPos[nProd-1]; | |
81 | TH1F* hRatTrackMatchResPhiNeg[nProd-1]; | |
82 | TH1F* hRatTrackMatchResPhiPos[nProd-1]; | |
83 | ||
84 | TH1F * hTrackPt[nProd] ; | |
85 | TH1F * hTrackPtSPD[nProd] ; | |
86 | TH1F * hTrackPtNoSPD[nProd] ; | |
87 | TH1F * hRatTrackPt[nProd-1] ; | |
88 | TH1F * hRatTrackPtSPD[nProd-1] ; | |
89 | TH1F * hRatTrackPtNoSPD[nProd-1] ; | |
90 | ||
91 | TH2F * hTrackEtaPhi[nProd] ; | |
92 | TH2F * hTrackEtaPhiSPD[nProd] ; | |
93 | TH2F * hTrackEtaPhiNoSPD[nProd] ; | |
94 | TH1F * hTrackPhi[nProd] ; | |
95 | TH1F * hTrackPhiSPD[nProd] ; | |
96 | TH1F * hTrackPhiNoSPD[nProd] ; | |
97 | TH1F * hRatTrackPhi[nProd-1] ; | |
98 | TH1F * hRatTrackPhiSPD[nProd-1] ; | |
99 | TH1F * hRatTrackPhiNoSPD[nProd-1] ; | |
100 | ||
101 | TH2F* h2XE[nProd]; | |
102 | TH2F* h2XEUE[nProd]; | |
103 | TH1F* hXE[nProd]; | |
104 | TH1F* hXEUE[nProd]; | |
105 | TH1F* hRatXE[nProd-1]; | |
106 | TH1F* hRatXEUE[nProd-1]; | |
107 | ||
108 | ||
109 | // Fill the histograms array for each of the productions, do the comparison ratios | |
110 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
111 | { | |
112 | // Calorimeter Clusters | |
113 | { | |
114 | hRaw [iprod] = (TH1F*) GetHisto("AnaPhoton_hCut_0_Open" ,iprod); | |
115 | hCorr[iprod] = (TH1F*) GetHisto("AnaPhoton_hCut_4_NCells" ,iprod); | |
116 | hTM [iprod] = (TH1F*) GetHisto("AnaPhoton_hCut_7_Matching",iprod); | |
117 | hShSh[iprod] = (TH1F*) GetHisto("AnaPhoton_hCut_9_PID" ,iprod); | |
118 | ||
119 | hRaw [iprod]->Sumw2(); | |
120 | hCorr[iprod]->Sumw2(); | |
121 | hTM [iprod]->Sumw2(); | |
122 | hShSh[iprod]->Sumw2(); | |
123 | ||
124 | hRaw [iprod]->Scale(1./nEvents[iprod]); | |
125 | hCorr[iprod]->Scale(1./nEvents[iprod]); | |
126 | hTM [iprod]->Scale(1./nEvents[iprod]); | |
127 | hShSh[iprod]->Scale(1./nEvents[iprod]); | |
128 | ||
129 | hRaw[iprod]->SetMarkerColor(color[iprod]); | |
130 | hRaw[iprod]->SetMarkerStyle(24); | |
131 | ||
132 | hCorr[iprod]->SetTitle("Cluster spectra with/out cuts"); | |
133 | hCorr[iprod]->SetYTitle("1/N_{events} dN/dp_{T}"); | |
134 | hCorr[iprod]->SetTitleOffset(1.5,"Y"); | |
135 | hCorr[iprod]->SetMarkerColor(color[iprod]); | |
136 | hCorr[iprod]->SetMarkerStyle(20); | |
137 | hCorr[iprod]->SetAxisRange(0.,30.,"X"); | |
138 | //hCorr[iprod]->SetMaximum(1.1); | |
139 | //hCorr[iprod]->SetMinimum(0); | |
140 | ||
141 | hTM [iprod]->SetMarkerColor(color[iprod]); | |
142 | hTM [iprod]->SetMarkerStyle(21); | |
143 | ||
144 | hShSh[iprod]->SetMarkerColor(color[iprod]); | |
145 | hShSh[iprod]->SetMarkerStyle(22); | |
146 | ||
147 | hRaw [iprod]->SetTitleOffset(1.5,"Y"); | |
148 | hTM [iprod]->SetTitleOffset(1.5,"Y"); | |
149 | hShSh[iprod]->SetTitleOffset(1.5,"Y"); | |
150 | hCorr[iprod]->SetTitleOffset(1.5,"Y"); | |
151 | ||
152 | if(iprod > 0) | |
153 | { | |
154 | hRatRaw [iprod-1] = (TH1F*)hRaw [iprod]->Clone(Form("hRatRaw%s" ,prod[iprod].Data())); | |
155 | hRatCorr[iprod-1] = (TH1F*)hCorr[iprod]->Clone(Form("hRatCorr%s",prod[iprod].Data())); | |
156 | hRatTM [iprod-1] = (TH1F*)hTM [iprod]->Clone(Form("hRatTM%s" ,prod[iprod].Data())); | |
157 | hRatShSh[iprod-1] = (TH1F*)hShSh[iprod]->Clone(Form("hRatShSh%s",prod[iprod].Data())); | |
158 | ||
159 | hRatRaw [iprod-1]->Divide(hRatRaw [iprod-1],hRaw [0],1.000,1,"B"); | |
160 | hRatCorr[iprod-1]->Divide(hRatCorr[iprod-1],hCorr[0],0.975,1,"B"); | |
161 | hRatTM [iprod-1]->Divide(hRatTM [iprod-1],hTM [0],0.950,1,"B"); | |
162 | hRatShSh[iprod-1]->Divide(hRatShSh[iprod-1],hShSh[0],0.925,1,"B"); | |
163 | } | |
164 | } | |
165 | ||
166 | // Cluster-Track Matching Residuals | |
167 | { | |
168 | h2TrackMatchResEtaNeg[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDEta" ,iprod); | |
169 | h2TrackMatchResEtaPos[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDEtaPos",iprod); | |
170 | h2TrackMatchResPhiNeg[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDPhi" ,iprod); | |
171 | h2TrackMatchResPhiPos[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDPhiPos",iprod); | |
172 | ||
173 | h2TrackMatchResEtaNeg[iprod]->Add(h2TrackMatchResEtaPos[iprod],-1); | |
174 | h2TrackMatchResPhiNeg[iprod]->Add(h2TrackMatchResPhiPos[iprod],-1); | |
175 | ||
176 | Float_t binMin = hCorr[iprod]->FindBin(0.5); | |
177 | Float_t binMax = hCorr[iprod]->FindBin(2); | |
178 | hTrackMatchResEtaNeg[iprod] = (TH1F*) h2TrackMatchResEtaNeg[iprod]->ProjectionY(Form("TMProjEtaNeg%s",prod[iprod].Data()),binMin, binMax); | |
179 | hTrackMatchResEtaPos[iprod] = (TH1F*) h2TrackMatchResEtaPos[iprod]->ProjectionY(Form("TMProjEtaPos%s",prod[iprod].Data()),binMin, binMax); | |
180 | hTrackMatchResPhiNeg[iprod] = (TH1F*) h2TrackMatchResPhiNeg[iprod]->ProjectionY(Form("TMProjPhiNeg%s",prod[iprod].Data()),binMin, binMax); | |
181 | hTrackMatchResPhiPos[iprod] = (TH1F*) h2TrackMatchResPhiPos[iprod]->ProjectionY(Form("TMProjPhiPos%s",prod[iprod].Data()),binMin, binMax); | |
182 | ||
183 | hTrackMatchResEtaNeg[iprod]->SetXTitle("#Delta #eta"); | |
184 | hTrackMatchResEtaNeg[iprod]->SetYTitle("entries / N events"); | |
185 | hTrackMatchResEtaNeg[iprod]->SetTitle("Track-cluster #eta residuals, 0.5 < E < 2 GeV"); | |
186 | hTrackMatchResEtaNeg[iprod]->SetAxisRange(-0.05,0.05,"X"); | |
187 | hTrackMatchResEtaNeg[iprod]->Sumw2(); | |
188 | hTrackMatchResEtaNeg[iprod]->SetMarkerStyle(24); | |
189 | hTrackMatchResEtaNeg[iprod]->SetMarkerColor(color[iprod]); | |
190 | ||
191 | hTrackMatchResEtaPos[iprod]->Sumw2(); | |
192 | hTrackMatchResEtaPos[iprod]->SetAxisRange(-0.05,0.05,"X"); | |
193 | hTrackMatchResEtaPos[iprod]->SetMarkerStyle(25); | |
194 | hTrackMatchResEtaPos[iprod]->SetMarkerColor(color[iprod]); | |
195 | ||
196 | hTrackMatchResPhiNeg[iprod]->SetXTitle("#Delta #phi"); | |
197 | hTrackMatchResPhiNeg[iprod]->SetTitle("Track-cluster #phi residuals, 0.5 < E < 2 GeV"); | |
198 | hTrackMatchResPhiNeg[iprod]->SetYTitle("entries / N events"); | |
199 | hTrackMatchResPhiNeg[iprod]->SetAxisRange(-0.05,0.05,"X"); | |
200 | hTrackMatchResPhiNeg[iprod]->Sumw2(); | |
201 | hTrackMatchResPhiNeg[iprod]->SetMarkerStyle(24); | |
202 | hTrackMatchResPhiNeg[iprod]->SetMarkerColor(color[iprod]); | |
203 | ||
204 | hTrackMatchResPhiPos[iprod]->Sumw2(); | |
205 | hTrackMatchResPhiPos[iprod]->SetAxisRange(-0.05,0.05,"X"); | |
206 | hTrackMatchResPhiPos[iprod]->SetMarkerStyle(25); | |
207 | hTrackMatchResPhiPos[iprod]->SetMarkerColor(color[iprod]); | |
208 | ||
209 | hTrackMatchResEtaNeg[iprod]->Scale(1./nEvents[iprod]); | |
210 | hTrackMatchResEtaPos[iprod]->Scale(1./nEvents[iprod]); | |
211 | hTrackMatchResPhiNeg[iprod]->Scale(1./nEvents[iprod]); | |
212 | hTrackMatchResPhiPos[iprod]->Scale(1./nEvents[iprod]); | |
213 | ||
214 | hTrackMatchResEtaNeg[iprod]->SetTitleOffset(1.5,"Y"); | |
215 | hTrackMatchResEtaPos[iprod]->SetTitleOffset(1.5,"Y"); | |
216 | hTrackMatchResPhiNeg[iprod]->SetTitleOffset(1.5,"Y"); | |
217 | hTrackMatchResPhiPos[iprod]->SetTitleOffset(1.5,"Y"); | |
218 | ||
219 | if(iprod > 0) | |
220 | { | |
221 | hRatTrackMatchResPhiPos[iprod-1] = (TH1F*)hTrackMatchResPhiPos[iprod]->Clone(Form("hRatPhiPos%s",prod[iprod].Data())); | |
222 | hRatTrackMatchResPhiNeg[iprod-1] = (TH1F*)hTrackMatchResPhiNeg[iprod]->Clone(Form("hRatPhiNeg%s",prod[iprod].Data())); | |
223 | hRatTrackMatchResEtaPos[iprod-1] = (TH1F*)hTrackMatchResEtaPos[iprod]->Clone(Form("hRatEtaPos%s",prod[iprod].Data())); | |
224 | hRatTrackMatchResEtaNeg[iprod-1] = (TH1F*)hTrackMatchResEtaNeg[iprod]->Clone(Form("hRatEtaNeg%s",prod[iprod].Data())); | |
225 | ||
226 | hRatTrackMatchResPhiPos[iprod-1]->Divide(hRatTrackMatchResPhiPos[iprod-1],hTrackMatchResPhiPos[0],1.000,1,"B"); | |
227 | hRatTrackMatchResPhiNeg[iprod-1]->Divide(hRatTrackMatchResPhiNeg[iprod-1],hTrackMatchResPhiNeg[0],1.000,1,"B"); | |
228 | hRatTrackMatchResEtaPos[iprod-1]->Divide(hRatTrackMatchResEtaPos[iprod-1],hTrackMatchResEtaPos[0],1.000,1,"B"); | |
229 | hRatTrackMatchResEtaNeg[iprod-1]->Divide(hRatTrackMatchResEtaNeg[iprod-1],hTrackMatchResEtaNeg[0],1.000,1,"B"); | |
230 | } | |
231 | } | |
232 | ||
233 | // Hybrid Tracks | |
234 | { | |
235 | hTrackPt [iprod] = (TH1F*) GetHisto("AnaHadrons_hPt" ,iprod); | |
236 | hTrackPtSPD [iprod] = (TH1F*) GetHisto("AnaHadrons_hPtSPDRefit" ,iprod); | |
237 | hTrackPtNoSPD [iprod] = (TH1F*) GetHisto("AnaHadrons_hPtNoSPDRefit" ,iprod); | |
238 | hTrackEtaPhiSPD [iprod] = (TH2F*) GetHisto("AnaHadrons_hEtaPhiSPDRefitPt02" ,iprod); | |
239 | hTrackEtaPhiNoSPD[iprod] = (TH2F*) GetHisto("AnaHadrons_hEtaPhiNoSPDRefitPt02",iprod); | |
240 | hTrackEtaPhi [iprod] = (TH2F*) GetHisto("AnaHadrons_hEtaPhiPositive" ,iprod); | |
241 | hTrackEtaPhi [iprod]->Add((TH2F*) GetHisto("AnaHadrons_hEtaPhiNegative" ,iprod)); | |
242 | ||
243 | hTrackPhiSPD [iprod] = (TH1F*)hTrackEtaPhiSPD [iprod]->ProjectionY(Form("hTrackPhiSPD%s" ,prod[iprod].Data()),0,1000); | |
244 | hTrackPhiNoSPD [iprod] = (TH1F*)hTrackEtaPhiNoSPD[iprod]->ProjectionY(Form("hTrackPhiNoSPD%s",prod[iprod].Data()),0,1000); | |
245 | hTrackPhi [iprod] = (TH1F*)hTrackEtaPhi [iprod]->ProjectionY(Form("hTrackPhi%s" ,prod[iprod].Data()),0,1000); | |
246 | ||
247 | hTrackPt [iprod]->Sumw2(); | |
248 | hTrackPtSPD [iprod]->Sumw2(); | |
249 | hTrackPtNoSPD[iprod]->Sumw2(); | |
250 | ||
251 | hTrackPt [iprod]->Scale(1./nEvents[iprod]); | |
252 | hTrackPtSPD [iprod]->Scale(1./nEvents[iprod]); | |
253 | hTrackPtNoSPD[iprod]->Scale(1./nEvents[iprod]); | |
254 | ||
255 | hTrackPhi [iprod]->Sumw2(); | |
256 | hTrackPhiSPD [iprod]->Sumw2(); | |
257 | hTrackPhiNoSPD[iprod]->Sumw2(); | |
258 | ||
259 | hTrackPhi [iprod]->Scale(1./nEvents[iprod]); | |
260 | hTrackPhiSPD [iprod]->Scale(1./nEvents[iprod]); | |
261 | hTrackPhiNoSPD[iprod]->Scale(1./nEvents[iprod]); | |
262 | ||
263 | hTrackPt[iprod]->SetTitle("Track spectra with/out SPD"); | |
264 | hTrackPt[iprod]->SetYTitle("1/N_{events} dN/dp_{T}"); | |
265 | hTrackPt[iprod]->SetTitleOffset(1.5,"Y"); | |
266 | hTrackPt[iprod]->SetMarkerColor(color[iprod]); | |
267 | hTrackPt[iprod]->SetMarkerStyle(20); | |
268 | hTrackPt[iprod]->SetAxisRange(0.,30.,"X"); | |
269 | //hTrackPt[iprod]->SetMaximum(1.1); | |
270 | //hTrackPt[iprod]->SetMinimum(0); | |
271 | ||
272 | hTrackPtSPD[iprod]->SetMarkerColor(color[iprod]); | |
273 | hTrackPtSPD[iprod]->SetMarkerStyle(26); | |
274 | ||
275 | hTrackPtNoSPD[iprod]->SetMarkerColor(color[iprod]); | |
276 | hTrackPtNoSPD[iprod]->SetMarkerStyle(25); | |
277 | ||
278 | hTrackPhi[iprod]->SetTitle("Track #phi with/out SPD"); | |
279 | hTrackPhi[iprod]->SetYTitle("1/N_{events} dN/d#phi"); | |
280 | hTrackPhi[iprod]->SetTitleOffset(1.5,"Y"); | |
281 | hTrackPhi[iprod]->SetMarkerColor(color[iprod]); | |
282 | hTrackPhi[iprod]->SetMarkerStyle(20); | |
283 | hTrackPhi[iprod]->SetAxisRange(0.,30.,"X"); | |
284 | //hTrackPhi[iprod]->SetMaximum(1.1); | |
285 | //hTrackPhi[iprod]->SetMinimum(0); | |
286 | ||
287 | hTrackPhiSPD[iprod]->SetMarkerColor(color[iprod]); | |
288 | hTrackPhiSPD[iprod]->SetMarkerStyle(26); | |
289 | ||
290 | hTrackPhiNoSPD[iprod]->SetMarkerColor(color[iprod]); | |
291 | hTrackPhiNoSPD[iprod]->SetMarkerStyle(25); | |
292 | ||
293 | if(iprod > 0) | |
294 | { | |
295 | hRatTrackPhi [iprod-1] = (TH1F*)hTrackPhi [iprod]->Clone(Form("hRatTrackPhi%s" ,prod[iprod].Data())); | |
296 | hRatTrackPhiNoSPD[iprod-1] = (TH1F*)hTrackPhiNoSPD[iprod]->Clone(Form("hRatTrackPhiNoSPD%s",prod[iprod].Data())); | |
297 | hRatTrackPhiSPD [iprod-1] = (TH1F*)hTrackPhiSPD [iprod]->Clone(Form("hRatTrackPhiSPD%s" ,prod[iprod].Data())); | |
298 | ||
299 | hRatTrackPhi [iprod-1]->Divide(hRatTrackPhi [iprod-1],hTrackPhi [0],1.000,1,"B"); | |
300 | hRatTrackPhiSPD [iprod-1]->Divide(hRatTrackPhiSPD [iprod-1],hTrackPhiSPD [0],1.000,1,"B"); | |
301 | hRatTrackPhiNoSPD[iprod-1]->Divide(hRatTrackPhiNoSPD[iprod-1],hTrackPhiNoSPD[0],1.000,1,"B"); | |
302 | ||
303 | hRatTrackPt [iprod-1] = (TH1F*)hTrackPt [iprod]->Clone(Form("hRatTrackPt%s" ,prod[iprod].Data())); | |
304 | hRatTrackPtNoSPD[iprod-1] = (TH1F*)hTrackPtNoSPD[iprod]->Clone(Form("hRatTrackPtNoSPD%s",prod[iprod].Data())); | |
305 | hRatTrackPtSPD [iprod-1] = (TH1F*)hTrackPtSPD [iprod]->Clone(Form("hRatTrackPtSPD%s" ,prod[iprod].Data())); | |
306 | ||
307 | hRatTrackPt [iprod-1]->Divide(hRatTrackPt [iprod-1],hTrackPt [0],1.000,1,"B"); | |
308 | hRatTrackPtSPD [iprod-1]->Divide(hRatTrackPtSPD [iprod-1],hTrackPtSPD [0],1.000,1,"B"); | |
309 | hRatTrackPtNoSPD[iprod-1]->Divide(hRatTrackPtNoSPD[iprod-1],hTrackPtNoSPD[0],1.000,1,"B"); | |
310 | } | |
311 | } | |
312 | ||
313 | // photon-track correlation | |
314 | { | |
315 | h2XE [iprod]= (TH2F*) GetHisto("AnaPhotonHadronCorr_hXECharged",iprod); | |
316 | h2XEUE [iprod]= (TH2F*) GetHisto("AnaPhotonHadronCorr_hXEUeCharged",iprod); | |
317 | ||
318 | Float_t minClusterE = 8; | |
bc8e4044 | 319 | TH1F * hTrigger = (TH1F*) GetHisto("AnaPhotonHadronCorr_hPtTrigger",iprod); |
320 | Int_t minClusterEBin = hTrigger->FindBin(minClusterE); | |
321 | Float_t nTrig = hTrigger->Integral(minClusterE,100000); | |
338d12a4 | 322 | |
323 | hXE [iprod] = (TH1F*)h2XE [iprod]->ProjectionY(Form("hXE%s" ,prod[iprod].Data()),minClusterEBin,1000); | |
324 | hXEUE[iprod] = (TH1F*)h2XEUE[iprod]->ProjectionY(Form("hXEUE%s",prod[iprod].Data()),minClusterEBin,1000); | |
325 | ||
326 | hXE [iprod]->Sumw2(); | |
327 | hXEUE[iprod]->Sumw2(); | |
328 | ||
329 | hXE [iprod]->Scale(1./nTrig); | |
330 | hXEUE[iprod]->Scale(1./nTrig); | |
331 | ||
332 | hXE[iprod]->SetTitle(Form("#gamma-hadron x_{E}, p_{T,Trig}>%2.1f GeV/c",minClusterE)); | |
333 | hXE[iprod]->SetYTitle("1/N_{trigger} dN/dx_{E}"); | |
334 | hXE[iprod]->SetTitleOffset(1.5,"Y"); | |
335 | hXE[iprod]->SetMarkerColor(color[iprod]); | |
336 | hXE[iprod]->SetMarkerStyle(20); | |
337 | hXE[iprod]->SetAxisRange(0.,1.,"X"); | |
338 | //hXE[iprod]->SetMaximum(1.1); | |
339 | //hXE[iprod]->SetMinimum(0); | |
340 | ||
341 | hXEUE[iprod]->SetMarkerColor(color[iprod]); | |
342 | hXEUE[iprod]->SetMarkerStyle(25); | |
343 | ||
344 | if(iprod > 0) | |
345 | { | |
346 | hRatXE [iprod-1] = (TH1F*)hXE [iprod]->Clone(Form("hRatXE%s" ,prod[iprod].Data())); | |
347 | hRatXEUE[iprod-1] = (TH1F*)hXEUE[iprod]->Clone(Form("hRatXEUE%s",prod[iprod].Data())); | |
348 | ||
349 | hRatXE [iprod-1]->Divide(hRatXE [iprod-1],hXE [0],1.000,1,"B"); | |
350 | hRatXEUE[iprod-1]->Divide(hRatXEUE[iprod-1],hXEUE[0],1.000,1,"B"); | |
351 | } | |
352 | } | |
353 | ||
354 | //Centrality | |
355 | { | |
356 | hCen[iprod] = (TH1F*) GetHisto("hCentrality",iprod); | |
357 | ||
358 | hCen[iprod]->Sumw2(); | |
359 | ||
360 | hCen[iprod]->Scale(1./nEvents[iprod]); | |
361 | ||
362 | hCen[iprod]->SetTitle("Centrality"); | |
363 | hCen[iprod]->SetYTitle("1/N_{events} dN/d centrality"); | |
364 | hCen[iprod]->SetTitleOffset(1.5,"Y"); | |
365 | hCen[iprod]->SetMarkerColor(color[iprod]); | |
366 | hCen[iprod]->SetMarkerStyle(20); | |
367 | //hCen[iprod]->SetAxisRange(0.,30.,"X"); | |
368 | //hCen[iprod]->SetMaximum(1.1); | |
369 | //hCen[iprod]->SetMinimum(0); | |
370 | ||
371 | if(iprod > 0) | |
372 | { | |
373 | hRatCen[iprod-1] = (TH1F*)hCen[iprod]->Clone(Form("hRatCen%s" ,prod[iprod].Data())); | |
374 | ||
375 | hRatCen[iprod-1]->Divide(hRatCen[iprod-1],hCen [0],1.000,1,"B"); | |
376 | } | |
377 | } | |
378 | ||
379 | //Vertex | |
380 | { | |
381 | hVertex[0][iprod] = (TH1F*) GetHisto("hZVertex",iprod); | |
382 | hVertex[1][iprod] = (TH1F*) GetHisto("hYVertex",iprod); | |
383 | hVertex[2][iprod] = (TH1F*) GetHisto("hXVertex",iprod); | |
384 | ||
385 | for(Int_t ivertex = 0; ivertex < 3; ivertex++) | |
386 | { | |
387 | //hVertex[ivertex][iprod]->Sumw2(); | |
388 | ||
389 | hVertex[ivertex][iprod]->Scale(1./nEvents[iprod]); | |
390 | ||
391 | //hVertex[ivertex][iprod]->SetTitle("Centrality"); | |
392 | hVertex[ivertex][iprod]->SetYTitle("1/N_{events} dN/ d vertex"); | |
393 | hVertex[ivertex][iprod]->SetTitleOffset(1.5,"Y"); | |
394 | hVertex[ivertex][iprod]->SetMarkerColor(color[iprod]); | |
395 | hVertex[ivertex][iprod]->SetLineColor(color[iprod]); | |
396 | hVertex[ivertex][iprod]->SetMarkerStyle(20); | |
397 | hVertex[ivertex][iprod]->SetAxisRange(-15,15.,"X"); | |
398 | //hVertex[ivertex][iprod]->SetMaximum(1.1); | |
399 | //hVertex[ivertex][iprod]->SetMinimum(0); | |
400 | ||
401 | if(iprod > 0) | |
402 | { | |
403 | hRatVertex[ivertex][iprod-1] = (TH1F*)hVertex[ivertex][iprod]->Clone(Form("hRatVertex%s_%d" ,prod[iprod].Data(),ivertex)); | |
404 | ||
405 | hRatVertex[ivertex][iprod-1]->Divide(hRatVertex[ivertex][iprod-1],hVertex[ivertex][0],1.000,1,"B"); | |
406 | } | |
407 | } | |
408 | } | |
409 | ||
410 | } | |
411 | ||
412 | ///////////////// | |
413 | // Make the plots | |
414 | ///////////////// | |
415 | ||
416 | //Legend for productions | |
417 | TLegend lprod(0.3,0.475,0.84,0.675); | |
418 | lprod.SetTextSize(0.04); | |
419 | lprod.SetBorderSize(0); | |
420 | lprod.SetFillColor(0); | |
421 | ||
422 | //Calimeter Cluster | |
423 | { | |
424 | TCanvas * ccalo = new TCanvas(Form("Cluster_%s",histoTag.Data()),"",1000,500); | |
425 | ccalo->Divide(2,1); | |
426 | ||
427 | ccalo->cd(1); | |
428 | gPad->SetLogy(); | |
429 | ||
430 | hCorr[0]->Draw(); | |
431 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
432 | { | |
433 | hRaw [iprod]->Draw("same"); | |
434 | hCorr[iprod]->Draw("same"); | |
435 | hTM [iprod]->Draw("same"); | |
436 | hShSh[iprod]->Draw("same"); | |
437 | ||
438 | lprod.AddEntry(hRaw[iprod],prod[iprod],"P"); | |
439 | } | |
440 | ||
441 | lprod.Draw(); | |
442 | ||
443 | TLegend lcl(0.35,0.7,0.84,0.89); | |
444 | lcl.SetTextSize(0.04); | |
445 | lcl.SetBorderSize(0); | |
446 | lcl.SetFillColor(0); | |
447 | lcl.AddEntry(hRaw [0],"Raw","P"); | |
448 | lcl.AddEntry(hCorr[0],"No Exotics + non lin.","P"); | |
449 | lcl.AddEntry(hTM [0], "+ Track matching","P"); | |
450 | lcl.AddEntry(hShSh[0],"+ #lambda^{2}_{0} < 0.4","P"); | |
451 | lcl.Draw(); | |
452 | ||
453 | ccalo->cd(2); | |
454 | //gPad->SetLogy(); | |
455 | ||
456 | hRatCorr[0]->SetTitle("Cluster spectra ratio"); | |
457 | hRatCorr[0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
458 | hRatCorr[0]->SetMinimum(0.850); | |
459 | hRatCorr[0]->SetMaximum(1.025); | |
460 | hRatCorr[0]->Draw(""); | |
461 | ||
462 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
463 | { | |
464 | hRatRaw [iprod]->Draw("same"); | |
465 | hRatCorr[iprod]->Draw("same"); | |
466 | hRatTM [iprod]->Draw("same"); | |
467 | hRatShSh[iprod]->Draw("same"); | |
468 | } | |
469 | ||
470 | TLine l1(0,1,30,1); | |
471 | TLine l2(0,0.975,30,0.975); | |
472 | TLine l3(0,0.95,30,0.95); | |
473 | TLine l4(0,0.925,30,0.925); | |
474 | ||
475 | l1.Draw("same"); | |
476 | l2.Draw("same"); | |
477 | l3.Draw("same"); | |
478 | l4.Draw("same"); | |
479 | ||
480 | ccalo->Print(Form("%s_ClusterSpectraComp.eps",histoTag.Data())); | |
481 | } | |
482 | ||
483 | //Cluster-Track Matching Residual | |
484 | { | |
485 | TLine l0(0,hTrackMatchResEtaNeg[0]->GetMinimum(),0,hTrackMatchResEtaNeg[0]->GetMaximum()*1.2); | |
486 | ||
487 | TLegend lres(0.6,0.75,0.84,0.89); | |
488 | lres.SetTextSize(0.04); | |
489 | //lres.SetBorderSize(0); | |
490 | lres.SetFillColor(0); | |
491 | lres.AddEntry(hTrackMatchResEtaNeg[0],"Negative","P"); | |
492 | lres.AddEntry(hTrackMatchResEtaPos[0],"Positive","P"); | |
493 | lres.Draw(); | |
494 | ||
495 | TCanvas * ccalo2 = new TCanvas(Form("MatchingResiduals_%s",histoTag.Data()),"",500,500); | |
496 | ccalo2->Divide(2,2); | |
497 | ||
498 | ccalo2->cd(1); | |
499 | //gPad->SetLogy(); | |
500 | ||
501 | hTrackMatchResEtaPos[0]->Draw(""); | |
502 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
503 | { | |
504 | hTrackMatchResEtaNeg[iprod]->Draw("same"); | |
505 | hTrackMatchResEtaPos[iprod]->Draw("same"); | |
506 | } | |
507 | ||
508 | l0.Draw("same"); | |
509 | lres.Draw(); | |
510 | lprod.Draw(); | |
511 | ccalo2->cd(2); | |
512 | ||
513 | hTrackMatchResPhiPos[0]->Draw(""); | |
514 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
515 | { | |
516 | hTrackMatchResPhiNeg[iprod]->Draw("same"); | |
517 | hTrackMatchResPhiPos[iprod]->Draw("same"); | |
518 | } | |
519 | ||
520 | l0.Draw("same"); | |
521 | ||
522 | ccalo2->cd(3); | |
523 | //gPad->SetLogy(); | |
524 | ||
525 | hRatTrackMatchResEtaPos[0]->SetMaximum(1.25); | |
526 | hRatTrackMatchResEtaPos[0]->SetMinimum(0.98); | |
527 | hRatTrackMatchResEtaPos[0]->Draw(""); | |
528 | hRatTrackMatchResEtaPos[0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
529 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
530 | { | |
531 | hRatTrackMatchResEtaNeg[iprod]->Draw("same"); | |
532 | hRatTrackMatchResEtaPos[iprod]->Draw("same"); | |
533 | } | |
534 | ||
535 | //l0.Draw("same"); | |
536 | ||
537 | ccalo2->cd(4); | |
538 | ||
539 | hRatTrackMatchResPhiPos[0]->SetMaximum(1.05); | |
540 | hRatTrackMatchResPhiPos[0]->SetMinimum(0.98); | |
541 | hRatTrackMatchResPhiPos[0]->Draw(""); | |
542 | hRatTrackMatchResPhiPos[0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
543 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
544 | { | |
545 | hRatTrackMatchResPhiNeg[iprod]->Draw("same"); | |
546 | hRatTrackMatchResPhiPos[iprod]->Draw("same"); | |
547 | } | |
548 | ||
549 | ccalo2->Print(Form("%s_MatchingResidualsComp.eps",histoTag.Data())); | |
550 | } | |
551 | ||
552 | // Hybrid tracks | |
553 | { | |
554 | TLegend ltrack(0.6,0.75,0.84,0.89); | |
555 | ltrack.SetTextSize(0.04); | |
556 | //ltrack.SetBorderSize(0); | |
557 | ltrack.SetFillColor(0); | |
558 | ltrack.AddEntry(hTrackPt [0],"All","P"); | |
559 | ltrack.AddEntry(hTrackPtSPD [0],"SPD","P"); | |
560 | ltrack.AddEntry(hTrackPtNoSPD[0],"No SPD","P"); | |
561 | ||
562 | TCanvas * ctrack = new TCanvas(Form("TrackHisto_%s",histoTag.Data()),"",1500,1500); | |
563 | ctrack->Divide(2,2); | |
564 | ctrack->cd(1); | |
565 | gPad->SetLogy(); | |
566 | hTrackPt[0]->Draw(""); | |
567 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
568 | { | |
569 | hTrackPt [iprod]->Draw("same"); | |
570 | hTrackPtSPD [iprod]->Draw("same"); | |
571 | hTrackPtNoSPD[iprod]->Draw("same"); | |
572 | } | |
573 | ||
574 | ltrack.Draw(); | |
575 | lprod.Draw(); | |
576 | ||
577 | ctrack->cd(2); | |
578 | ||
579 | hRatTrackPt[0]->SetMaximum(1.05); | |
580 | hRatTrackPt[0]->SetMinimum(0.95); | |
581 | hRatTrackPt[0]->Draw(""); | |
582 | hRatTrackPt[0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
583 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
584 | { | |
585 | hRatTrackPt [iprod]->Draw("same"); | |
586 | hRatTrackPtSPD [iprod]->Draw("same"); | |
587 | hRatTrackPtNoSPD[iprod]->Draw("same"); | |
588 | } | |
589 | ||
590 | ctrack->cd(3); | |
591 | hTrackPhi[0]->SetMaximum(3.); | |
592 | hTrackPhi[0]->SetMinimum(0.); | |
593 | hTrackPhi[0]->Draw(""); | |
594 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
595 | { | |
596 | hTrackPhi [iprod]->Draw("same"); | |
597 | hTrackPhiSPD [iprod]->Draw("same"); | |
598 | hTrackPhiNoSPD[iprod]->Draw("same"); | |
599 | } | |
600 | ||
601 | ctrack->cd(4); | |
602 | //gPad->SetLogy(); | |
603 | ||
604 | hRatTrackPhi[0]->SetMaximum(1.05); | |
605 | hRatTrackPhi[0]->SetMinimum(0.95); | |
606 | hRatTrackPhi[0]->Draw(""); | |
607 | hRatTrackPhi[0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
608 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
609 | { | |
610 | hRatTrackPhi [iprod]->Draw("same"); | |
611 | hRatTrackPhiSPD [iprod]->Draw("same"); | |
612 | hRatTrackPhiNoSPD[iprod]->Draw("same"); | |
613 | } | |
614 | ||
615 | ctrack->Print(Form("%s_TrackComp.eps",histoTag.Data())); | |
616 | } | |
617 | ||
618 | // XE | |
619 | { | |
620 | TLegend lxe(0.6,0.75,0.84,0.89); | |
621 | lxe.SetTextSize(0.04); | |
622 | //lxe.SetBorderSize(0); | |
623 | lxe.SetFillColor(0); | |
624 | lxe.AddEntry(hXE [0],"Signal+bkg","P"); | |
625 | lxe.AddEntry(hXEUE[0],"Und. Event","P"); | |
626 | ||
627 | TCanvas * cxe = new TCanvas(Form("XEHisto_%s",histoTag.Data()),"",1000,500); | |
628 | cxe->Divide(2,1); | |
629 | cxe->cd(1); | |
630 | gPad->SetLogy(); | |
631 | hXE[0]->Draw(""); | |
632 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
633 | { | |
634 | hXE [iprod]->Draw("same"); | |
635 | hXEUE[iprod]->Draw("same"); | |
636 | } | |
637 | ||
638 | lxe.Draw(); | |
639 | lprod.Draw(); | |
640 | ||
641 | cxe->cd(2); | |
642 | ||
643 | hRatXE[0]->SetMaximum(1.05); | |
644 | hRatXE[0]->SetMinimum(0.95); | |
645 | hRatXE[0]->Draw(""); | |
646 | hRatXE[0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
647 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
648 | { | |
649 | hRatXE [iprod]->Draw("same"); | |
650 | hRatXEUE[iprod]->Draw("same"); | |
651 | } | |
652 | ||
653 | cxe->Print(Form("%s_XEComp.eps",histoTag.Data())); | |
654 | } | |
655 | ||
656 | // Centrality | |
657 | { | |
658 | TCanvas * ccen = new TCanvas(Form("Centrality_%s",histoTag.Data()),"",1000,500); | |
659 | ccen->Divide(2,1); | |
660 | ||
661 | ccen->cd(1); | |
662 | //gPad->SetLogy(); | |
663 | ||
664 | hCen[0]->Draw(); | |
665 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
666 | { | |
667 | hCen[iprod]->Draw("same"); | |
668 | } | |
669 | ||
670 | lprod.Draw(); | |
671 | ||
672 | ccen->cd(2); | |
673 | //gPad->SetLogy(); | |
674 | ||
675 | hRatCen[0]->SetTitle("Centrality"); | |
676 | hRatCen[0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
677 | hRatCen[0]->SetMinimum(0.95); | |
678 | hRatCen[0]->SetMaximum(1.05); | |
679 | hRatCen[0]->Draw(""); | |
680 | ||
681 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
682 | { | |
683 | hRatCen [iprod]->Draw("same"); | |
684 | } | |
685 | ||
686 | TLine l1(0,1,100,1); | |
687 | ||
688 | l1.Draw("same"); | |
689 | ||
690 | ccen->Print(Form("%s_CentralityComp.eps",histoTag.Data())); | |
691 | } | |
692 | ||
693 | // Vertex | |
694 | { | |
695 | TCanvas * cvertex = new TCanvas(Form("Vertex_%s",histoTag.Data()),"",3*500,2*500); | |
696 | cvertex->Divide(3,2); | |
697 | Int_t npannel = 1; | |
698 | for(Int_t ivertex = 0; ivertex < 3; ivertex++) | |
699 | { | |
700 | cvertex->cd(npannel); | |
701 | //gPad->SetLogy(); | |
702 | ||
703 | hVertex[ivertex][0]->Draw(); | |
704 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
705 | { | |
706 | hVertex[ivertex][iprod]->Draw("same"); | |
707 | } | |
708 | ||
709 | lprod.Draw(); | |
710 | ||
711 | cvertex->cd(npannel+3); | |
712 | //gPad->SetLogy(); | |
713 | ||
714 | //hRatVertex[ivertex][0]->SetTitle(""); | |
715 | hRatVertex[ivertex][0]->SetYTitle(Form("data X / %s",prod[0].Data())); | |
716 | // hRatVertex[ivertex][0]->SetMinimum(0.95); | |
717 | // hRatVertex[ivertex][0]->SetMaximum(1.05); | |
718 | hRatVertex[ivertex][0]->Draw(""); | |
719 | ||
720 | for(Int_t iprod = 0; iprod < nProd-1; iprod++) | |
721 | { | |
722 | hRatVertex[ivertex][iprod]->Draw("same"); | |
723 | } | |
724 | ||
725 | npannel++; | |
726 | } | |
727 | cvertex->Print(Form("%s_VertexComp.eps",histoTag.Data())); | |
728 | } | |
729 | ||
730 | ||
731 | } | |
732 | ||
733 | //_____________________________________________________ | |
734 | void GetFileAndList(TString fileName, TString listName) | |
735 | { | |
736 | ||
737 | for(Int_t iprod = 0; iprod < nProd; iprod++) | |
738 | { | |
739 | file[iprod] = new TFile(Form("%s/%s",prod[iprod].Data(),fileName.Data()),"read"); | |
740 | if(file[iprod]->Get("hNEvents")) | |
741 | { | |
742 | nEvents[iprod] = ((TH1F*)file[iprod]->Get("hNEvents"))->GetEntries(); | |
743 | printf("%s: nEvents %e\n",prod[iprod].Data(),nEvents[iprod]); | |
744 | } | |
745 | ||
746 | TDirectory * dir = (TDirectory*) file[iprod]->Get(listName); | |
747 | if(dir) | |
748 | { | |
749 | list[iprod] = (TList*) dir->Get(listName); | |
750 | nEvents[iprod] = ((TH1F*)list[iprod]->FindObject("hNEvents"))->GetEntries(); | |
751 | printf("%s: nEvents %e\n",prod[iprod],nEvents[iprod]); | |
752 | } | |
753 | else list[iprod] = 0; | |
754 | } | |
755 | ||
756 | } | |
757 | ||
758 | //___________________________________ | |
759 | TObject * GetHisto(TString histoName, Int_t iprod) | |
760 | { | |
761 | // Check if the list is available, if not get the histo directly from file | |
762 | ||
763 | if(list[iprod]) return list[iprod]->FindObject(histoName); | |
764 | else return file[iprod]->Get (histoName); | |
765 | } |