]>
Commit | Line | Data |
---|---|---|
8312043c | 1 | #if !defined(__CINT__) || defined(__MAKECINT__) |
2 | #include <TMath.h> | |
3 | #include <TROOT.h> | |
4 | #include <Riostream.h> | |
5 | #include <TCanvas.h> | |
6 | #include <TColor.h> | |
7 | #include <TLatex.h> | |
8 | #include <TLegend.h> | |
9 | ||
10 | #include <TStyle.h> | |
11 | #include <TString.h> | |
12 | #include <TASImage.h> | |
13 | ||
14 | #include <TFile.h> | |
15 | #include <TList.h> | |
16 | #include <TH1F.h> | |
17 | #include <TH1D.h> | |
18 | #include <TF2.h> | |
19 | #include <TFitResult.h> | |
20 | #include <TFitResultPtr.h> | |
21 | #include <TH2F.h> | |
22 | #include <TH3F.h> | |
23 | #endif | |
24 | ||
25 | extern TStyle *gStyle; | |
26 | ||
27 | static Double_t xBins[]={ | |
28 | 0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9, | |
29 | 1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0, | |
30 | 2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0, | |
31 | 4.5,5.0,5.5,6.5,8.0,10.0,12.0 | |
32 | //4.5,5.0,5.5,6.5,8.0,12.0 | |
33 | }; | |
34 | static Int_t nBins=sizeof(xBins)/sizeof(Double_t) - 1; | |
35 | ||
36 | static Bool_t gFlag=kFALSE; | |
37 | ||
e9829c0a | 38 | //*** The systematic uncertainties for combining |
276ae8a8 | 39 | // TPC crossed/findable |
e9829c0a | 40 | // cos(PA) |
41 | // DCA between V0 daughters | |
276ae8a8 | 42 | // TPC crossed pad rows |
e9829c0a | 43 | static Double_t sysErrK0s[]={ |
44 | 0.0, | |
45 | 0.05,0.05,0.04,0.03, //Dominated by cos(PA) | |
46 | 0.04,0.05,0.06,0.07,0.08,0.09, //Dominated by TPC crossed/findable | |
47 | 0.10,0.10,0.11,0.12,0.12,0.13,0.13,0.13,0.14,0.14,0.14, | |
48 | 0.14,0.13,0.13,0.12,0.11,0.11,0.11,0.10,0.09,0.08, | |
49 | 0.08,0.05,0.04,0.03, | |
50 | 0.3,0.3,0.3 // "trailers" | |
8312043c | 51 | }; |
276ae8a8 | 52 | static Double_t sysErrLam[]={ |
53 | 0.0,0.0,0.0, | |
54 | 0.20,0.12,0.05,0.04, //Dominated by cos(PA)+FD | |
55 | 0.03,0.03,0.04,0.05,0.06,0.06, //Dominated by TPC crossed/findable | |
56 | 0.07,0.09,0.09,0.10,0.10,0.11,0.11,0.11,0.10,0.10,0.09, | |
57 | 0.08,0.08,0.07,0.07,0.07,0.06,0.07,0.06,0.07,0.05, | |
58 | 0.06,0.08,0.04, | |
59 | 0.3,0.3,0.3 // "trailers" | |
60 | }; | |
e9829c0a | 61 | const Double_t sysPID=0.02; //PID |
62 | const Double_t sysSig=0.03; //Signal extraction | |
63 | const Double_t sysArm=0.01; //Armenteros cut | |
8312043c | 64 | |
65 | ||
66 | TH1 *MapHisto(const TH1 *h) { | |
67 | const Double_t eps=0.0001; | |
68 | TString name("m"); | |
69 | name = name + h->GetName(); | |
70 | TH1F *mh=new TH1F(name.Data(),h->GetTitle(),nBins,xBins); | |
71 | mh->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
72 | mh->GetYaxis()->SetTitle("1/N_{ev}dN/dp_{T}/dy (GeV/c)^{-1}"); | |
73 | ||
74 | Double_t xh=h->GetBinCenter(1), xmh=0.; | |
75 | ||
76 | Int_t n=1; | |
77 | for (; n<=nBins; n++) { | |
78 | xmh=mh->GetBinCenter(n); | |
79 | if (TMath::Abs(xh-xmh)<eps) break; | |
80 | } | |
81 | ||
82 | Int_t iii=h->GetNbinsX(); | |
83 | if (gFlag) iii--; | |
84 | for (Int_t i=1; i<=iii; i++) { | |
85 | Int_t ni1=n+i-1; | |
86 | ||
87 | if (ni1 > nBins) { | |
88 | cerr<<"Input number of bins is larger than the output number of bins!\n"; | |
89 | delete mh; | |
90 | return 0; | |
91 | } | |
92 | ||
93 | xh = h->GetBinCenter(i); | |
94 | xmh=mh->GetBinCenter(ni1); | |
95 | if (TMath::Abs(xh-xmh)>eps) { | |
96 | cerr<<"Wrong binning !\n"; | |
97 | delete mh; | |
98 | return 0; | |
99 | } | |
100 | ||
101 | Double_t c=h->GetBinContent(i); | |
102 | Double_t e=h->GetBinError(i); | |
103 | mh->SetBinContent(ni1,c); | |
104 | mh->SetBinError(ni1,e); | |
105 | } | |
106 | ||
107 | return mh; | |
108 | } | |
109 | ||
110 | Bool_t | |
111 | GetHistos(const Char_t *rName[], const Char_t *eName[], TH1 *&raw, TH1 *&eff) { | |
112 | ||
113 | /*TFile *fr=*/TFile::Open(rName[0]); | |
114 | TList *lst=(TList*)gFile->Get("c1DataYields"); | |
115 | raw=(TH1F*)lst->FindObject(rName[1]); | |
116 | if (!raw) { | |
117 | cerr<<"No raw yield !"<<eName[0]<<' '<<eName[1]<<endl; | |
118 | return kFALSE; | |
119 | } | |
120 | /*TFile *fe=*/TFile::Open(eName[0]); | |
121 | eff=(TH1F*)gFile->Get(eName[1]); | |
122 | if (!eff) { | |
123 | cerr<<"No efficiency ! "<<eName[0]<<' '<<eName[1]<<endl; | |
124 | return kFALSE; | |
125 | } | |
126 | return kTRUE; | |
127 | } | |
128 | ||
129 | void SetAttributes(TH1 *h,const Char_t *tit,Int_t col,Int_t mar,Float_t siz) { | |
130 | h->SetTitle(tit); | |
131 | h->SetLineColor(col); | |
132 | h->SetMarkerColor(col); | |
133 | h->SetMarkerStyle(mar); | |
134 | h->SetMarkerSize(siz); | |
135 | h->SetMaximum(1000); | |
136 | h->SetMinimum(1e-5); | |
137 | } | |
138 | ||
e9829c0a | 139 | void DrawHisto(TH1 *h, const Option_t *option, Double_t *sysErr) { |
8312043c | 140 | TH1F *hh=new TH1F(*((TH1F*)h)); |
141 | Int_t nb=hh->GetNbinsX(); | |
142 | for (Int_t i=1; i<=nb; i++) { | |
143 | Double_t c=hh->GetBinContent(i); | |
144 | Double_t e=hh->GetBinError(i); | |
e9829c0a | 145 | e = c*TMath::Sqrt(sysErr[i]*sysErr[i] + |
146 | sysPID*sysPID + | |
147 | sysSig*sysSig + | |
148 | sysArm*sysArm); | |
8312043c | 149 | hh->SetBinError(i,e); |
150 | } | |
151 | hh->SetFillColor(17); | |
152 | TString opt("E5"); opt+=option; | |
153 | //TString opt("E2"); opt+=option; | |
154 | hh->Draw(opt.Data()); | |
155 | h->Draw("e x0 same"); | |
156 | } | |
157 | ||
158 | void DrawALICELogo(Float_t x1, Float_t y1, Float_t x2, Float_t y2) | |
159 | { | |
160 | // Correct for aspect ratio of figure plus aspect ratio of pad. | |
161 | // Coordinates are NDC! | |
162 | ||
163 | x2 = x1 + (y2 - y1)*0.891*gPad->GetCanvas()->GetWindowHeight()*gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetCanvas()->GetWindowWidth()); | |
164 | ||
165 | TPad *myPadLogo = new TPad("myPadLogo","Pad for ALICE Logo", x1, y1, x2, y2); | |
166 | myPadLogo->SetLeftMargin(0); | |
167 | myPadLogo->SetTopMargin(0); | |
168 | myPadLogo->SetRightMargin(0); | |
169 | myPadLogo->SetBottomMargin(0); | |
170 | myPadLogo->Draw(); | |
171 | myPadLogo->cd(); | |
172 | TASImage *myAliceLogo = | |
173 | new TASImage("alice_logo_preliminary.eps"); | |
174 | myAliceLogo->Draw("same"); | |
175 | } | |
176 | ||
177 | ||
178 | void DrawSpectraAndRatios() { | |
179 | ||
180 | const Int_t nCent=5; | |
181 | ||
182 | const Char_t *title[nCent]={ | |
183 | "00-05 %", | |
184 | "20-40 %", | |
185 | "40-60 %", | |
186 | "60-80 %", | |
187 | "80-90 %" | |
188 | }; | |
189 | const Int_t colour[nCent]={2 , 419, 4 , 6 , 1 }; | |
190 | const Int_t marker[nCent]={22 , 21 , 23 , 33, 20 }; | |
191 | const Float_t masize[nCent]={1.6, 1.3, 1.6, 2 , 1.3}; | |
192 | ||
193 | const Char_t *rNameL[2*nCent]={ // file name, histo name | |
194 | "luke/DataYields_5sigCubic_070512.root", "YieldLambda0005", | |
195 | "luke/DataYields_200312.root", "YieldLambda2040", | |
196 | "luke/DataYields_5sigCubic_070512.root", "YieldLambda4060", | |
197 | "luke/DataYields_200312.root", "YieldLambda6080", | |
198 | "luke/DataYields_200312.root", "YieldLambda8090" | |
199 | }; | |
200 | const Char_t *eNameL[2*nCent]={ // file name, histo name | |
201 | "marian/combined/EFF_Lambda_PbPb_00_05.root", "Efficiency", | |
202 | "marian/combined/EFF_Lambda_PbPb_20_40.root", "Efficiency", | |
203 | "marian/combined/EFF_Lambda_PbPb_40_60.root", "Efficiency", | |
204 | "marian/combined/EFF_Lambda_PbPb_60_80.root", "Efficiency", | |
205 | "marian/combined/EFF_Lambda_PbPb_80_90.root", "Efficiency" | |
206 | }; | |
207 | /* | |
208 | const Char_t *rNameL[2*nCent]={ // file name, histo name | |
209 | "luke/DataYields_5sigCubic_070512.root", "YieldAntiLambda0005", | |
210 | "luke/DataYields_200312.root", "YieldAntiLambda2040", | |
211 | "luke/DataYields_5sigCubic_070512.root", "YieldAntiLambda4060", | |
212 | "luke/DataYields_200312.root", "YieldAntiLambda6080", | |
213 | "luke/DataYields_200312.root", "YieldAntiLambda8090" | |
214 | }; | |
215 | const Char_t *eNameL[2*nCent]={ // file name, histo name | |
216 | "marian/combined/EFF_AntiLambda_PbPb_00_05.root", "Efficiency", | |
217 | "marian/combined/EFF_AntiLambda_PbPb_20_40.root", "Efficiency", | |
218 | "marian/combined/EFF_AntiLambda_PbPb_40_60.root", "Efficiency", | |
219 | "marian/combined/EFF_AntiLambda_PbPb_60_80.root", "Efficiency", | |
220 | "marian/combined/EFF_AntiLambda_PbPb_80_90.root", "Efficiency" | |
221 | }; | |
222 | */ | |
223 | const Char_t *rNameK[2*nCent]={ // file name, histo name | |
224 | "luke/DataYields_5sigCubic_070512.root", "YieldK0Short0005", | |
225 | "luke/DataYields_5sigCubic_070512.root", "YieldK0Short2040", | |
226 | "luke/DataYields_5sigCubic_070512.root", "YieldK0Short4060", | |
227 | "luke/DataYields_5sigCubic_070512.root", "YieldK0Short6080", | |
228 | "luke/DataYields_5sigCubic_070512.root", "YieldK0Short8090" | |
229 | }; | |
230 | const Char_t *eNameK[2*nCent]={ // file name, histo name | |
231 | "marian/combined/EFF_K0s_PbPb_00_05.root", "Efficiency", | |
232 | "marian/combined/EFF_K0s_PbPb_20_40.root", "Efficiency", | |
233 | "marian/combined/EFF_K0s_PbPb_40_60.root", "Efficiency", | |
234 | "marian/combined/EFF_K0s_PbPb_60_80.root", "Efficiency", | |
235 | "marian/combined/EFF_K0s_PbPb_80_90.root", "Efficiency" | |
236 | }; | |
237 | ||
238 | // const Char_t *fdName[nCent]={ | |
239 | // "fd_0005", "fd_2040", "fd_4060", "fd_6080", "fd_8090" | |
240 | // }; | |
241 | // TFile *fdFile=TFile::Open("lambda_fd.root"); | |
242 | ||
243 | gStyle->SetOptStat(0); | |
244 | gStyle->SetOptTitle(0); | |
245 | gStyle->SetLegendFillColor(0); | |
246 | ||
247 | TH1 *raw=0; | |
248 | TH1 *eff=0; | |
249 | TString option(""), ratio("ratio"); | |
250 | ||
251 | TCanvas *c1=new TCanvas; c1->SetLogy(); | |
252 | c1->SetLeftMargin(0.13); c1->SetBottomMargin(0.13); | |
253 | ||
254 | TCanvas *c2=new TCanvas; c2->SetLogy(); | |
255 | c2->SetLeftMargin(0.13); c2->SetBottomMargin(0.13); | |
256 | ||
257 | TCanvas *c3=new TCanvas; | |
258 | //TCanvas *c4=new TCanvas; | |
e9829c0a | 259 | |
260 | ||
8312043c | 261 | for (Int_t cent=0; cent<nCent; cent++) { |
262 | // Lambda | |
263 | if (!GetHistos(rNameL+2*cent, eNameL+2*cent, raw, eff)) return; | |
264 | TH1 *rawHl=MapHisto(raw); | |
265 | TH1 *effHl=MapHisto(eff); | |
266 | rawHl->Divide(effHl); | |
267 | SetAttributes(rawHl,title[cent],colour[cent],marker[cent],masize[cent]); | |
268 | c1->cd(); | |
269 | //rawHl->Draw(option.Data()); | |
276ae8a8 | 270 | DrawHisto(rawHl, option.Data(), sysErrLam); |
8312043c | 271 | |
272 | // K0s | |
273 | if (cent==nCent-1) gFlag=kTRUE; | |
274 | if (!GetHistos(rNameK+2*cent, eNameK+2*cent, raw, eff)) return; | |
275 | TH1 *rawHk=MapHisto(raw); | |
276 | TH1 *effHk=MapHisto(eff); | |
277 | rawHk->Divide(effHk); | |
278 | SetAttributes(rawHk,title[cent],colour[cent],marker[cent],masize[cent]); | |
279 | c2->cd(); | |
280 | //rawHk->Draw(option.Data()); | |
e9829c0a | 281 | DrawHisto(rawHk, option.Data(), sysErrK0s); |
8312043c | 282 | |
283 | // Lambda/K0s | |
284 | TH1 *rawHlk=(TH1*)rawHl->Clone(); | |
285 | //FD | |
286 | rawHlk->Scale(0.8); | |
287 | // fdFile->cd(); | |
288 | // TH1 *fd=(TH1*)gFile->Get(fdName[cent]); | |
289 | // TH1 *fdM=MapHisto(fd); | |
290 | // SetAttributes(fdM,title[cent],colour[cent],marker[cent],masize[cent]); | |
291 | // c4->cd(); | |
292 | // fdM->Draw(option.Data()); | |
293 | // rawHlk->Add(fdM,-1); | |
294 | // | |
295 | TString name=ratio+rawHlk->GetName(); | |
296 | rawHlk->SetName(name.Data()); | |
297 | rawHlk->Divide(rawHk); | |
298 | c3->cd(); | |
299 | rawHlk->Draw(option.Data()); | |
300 | ||
301 | option+="same"; | |
302 | } | |
303 | ||
304 | Float_t offx=0.15, offy=0.16, sizx=0.22, sizy=0.22; | |
305 | TLegend *leg=c1->BuildLegend(0.68,0.52,0.88,0.88,"Centrality:"); | |
306 | leg->SetFillColor(0); | |
307 | c1->cd(); | |
308 | TLatex * tex = new TLatex(5.5,19.,"#Lambda"); | |
309 | tex->SetTextFont(42); | |
310 | tex->SetTextSize(0.11); | |
311 | tex->SetLineWidth(2); | |
312 | tex->Draw(); | |
313 | DrawALICELogo(offx,offy,offx+sizx,offy+sizy); | |
314 | ||
315 | //c2->BuildLegend(0.74,0.62,0.88,0.88); | |
316 | leg=c2->BuildLegend(0.68,0.52,0.88,0.88,"Centrality:"); | |
317 | leg->SetFillColor(0); | |
318 | c2->cd(); | |
319 | tex = new TLatex(5.5,19.,"K^{0}_{S}"); | |
320 | tex->SetTextFont(42); | |
321 | tex->SetTextSize(0.089); | |
322 | tex->SetLineWidth(2); | |
323 | tex->Draw(); | |
324 | DrawALICELogo(offx,offy,offx+sizx,offy+sizy); | |
325 | ||
326 | c3->BuildLegend(0.74,0.62,0.88,0.88); | |
327 | ||
328 | return; | |
329 | } | |
330 |