AliPhysics  cdeda5a (cdeda5a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotOutputMCCheck.C
Go to the documentation of this file.
1 #if !defined(__CINT__) || defined(__MAKECINT__)
2 #include <TCanvas.h>
3 #include <TH1.h>
4 #include <TH2.h>
5 #include <TH3.h>
6 #include <TStyle.h>
7 #include <TFile.h>
8 #include <TPaveStats.h>
9 #include <TLegend.h>
10 #include <TLegendEntry.h>
11 #include <TLatex.h>
12 #endif
13 
14 /* $Id$ */
15 
16 // Macro to plot the output of AliAnalysisTaskCheckHFMCProd
17 // Author: F. Prino, prino@to.infn.it
18 
19 TH1F* HistoPYTHIA7();
20 TH1F* HistoFONLL7TeV();
21 TH1F* HistoFONLL2_76TeV();
22 
24 
25  TFile *fil=new TFile("AnalysisResults.root");
26  TDirectoryFile* df=(TDirectoryFile*)fil->Get("HFMCCheck");
27  TList* l=(TList*)df->Get("clistHFMCCheck");
28 
29  TH1F* hNEvents=(TH1F*)l->FindObject("hNEvents");
30  Int_t nAnalEv=hNEvents->GetBinContent(1);
31  printf("Number of events= %d\n",nAnalEv);
32 
33  TCanvas* cv=new TCanvas("cv","Vertex");
34  cv->Divide(3,3);
35  cv->cd(1);
36  TH1F* hSPD3DvX=(TH1F*)l->FindObject("hSPD3DvX");
37  hSPD3DvX->Draw();
38  cv->cd(2);
39  TH1F* hSPD3DvY=(TH1F*)l->FindObject("hSPD3DvY");
40  hSPD3DvY->Draw();
41  cv->cd(3);
42  TH1F* hSPD3DvZ=(TH1F*)l->FindObject("hSPD3DvZ");
43  hSPD3DvZ->Draw();
44  cv->cd(4);
45  TH1F* hSPDZvX=(TH1F*)l->FindObject("hSPDZvX");
46  hSPDZvX->Draw();
47  cv->cd(5);
48  TH1F* hSPDZvY=(TH1F*)l->FindObject("hSPDZvY");
49  hSPDZvY->Draw();
50  cv->cd(6);
51  TH1F* hSPDZvZ=(TH1F*)l->FindObject("hSPDZvZ");
52  hSPDZvZ->Draw();
53  cv->cd(7);
54  TH1F* hTRKvX=(TH1F*)l->FindObject("hTRKvX");
55  hTRKvX->Draw();
56  cv->cd(8);
57  TH1F* hTRKvY=(TH1F*)l->FindObject("hTRKvY");
58  hTRKvY->Draw();
59  cv->cd(9);
60  TH1F* hTRKvZ=(TH1F*)l->FindObject("hTRKvZ");
61  hTRKvZ->Draw();
62 
63  TCanvas* c1=new TCanvas("c1","Multipl");
64  c1->Divide(2,2);
65  c1->cd(1);
66  gPad->SetLogy();
67  TH1F* hPhysPrim=(TH1F*)l->FindObject("hPhysPrim");
68  hPhysPrim->Draw();
69  c1->cd(2);
70  gPad->SetLogy();
71  TH1F* hTracklets=(TH1F*)l->FindObject("hTracklets");
72  hTracklets->Draw();
73  c1->cd(3);
74  gPad->SetLogy();
75  TH1F* hTracks=(TH1F*)l->FindObject("hTracks");
76  hTracks->Draw();
77  c1->cd(4);
78  gPad->SetLogy();
79  TH1F* hSelTracks=(TH1F*)l->FindObject("hSelTracks");
80  hSelTracks->Draw();
81 
82  // tracking efficiency
83  Double_t minEta=-0.8;
84  Double_t maxEta=0.8;
85  Double_t minPt=0.5;
86  Double_t maxPt=2.;
87  TH3F* hEtaPhiPtGenPi=(TH3F*)l->FindObject("hEtaPhiPtGenPi");
88  Int_t minEtaBin=hEtaPhiPtGenPi->GetXaxis()->FindBin(minEta+0.00001);
89  Int_t maxEtaBin=hEtaPhiPtGenPi->GetXaxis()->FindBin(maxEta-0.00001);
90  printf("minetabin=%d -- maxetabin=%d\n",minEtaBin,maxEtaBin);
91  Int_t minPtBin=hEtaPhiPtGenPi->GetZaxis()->FindBin(minPt+0.00001);
92  Int_t maxPtBin=hEtaPhiPtGenPi->GetZaxis()->FindBin(maxPt-0.00001);
93  printf("minptbin=%d -- maxptbin=%d\n",minPtBin,maxPtBin);
94  TH1D* hEtaGenPi=hEtaPhiPtGenPi->ProjectionX("hEtaGenPi",0,-1,minPtBin,maxPtBin);
95  TH1D* hPhiGenPi=hEtaPhiPtGenPi->ProjectionY("hPhiGenPi",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
96  TH1D* hPtGenPi=hEtaPhiPtGenPi->ProjectionZ("hPtGenPi",minEtaBin,maxEtaBin);
97  hEtaGenPi->Sumw2();
98  hPhiGenPi->Sumw2();
99  hPtGenPi->Sumw2();
100  hEtaGenPi->GetXaxis()->SetTitle("#eta");
101  hPhiGenPi->GetXaxis()->SetTitle("#varphi (rad)");
102  hPtGenPi->GetXaxis()->SetTitle("p_{T} (GeV/c)");
103  TH3F* hEtaPhiPtRecPi=(TH3F*)l->FindObject("hEtaPhiPtRecPi");
104  TH1D* hEtaRecPi=hEtaPhiPtRecPi->ProjectionX("hEtaRecPi",0,-1,minPtBin,maxPtBin);
105  TH1D* hPhiRecPi=hEtaPhiPtRecPi->ProjectionY("hPhiRecPi",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
106  TH1D* hPtRecPi=hEtaPhiPtRecPi->ProjectionZ("hPtRecPi",minEtaBin,maxEtaBin);
107  hEtaRecPi->Sumw2();
108  hPhiRecPi->Sumw2();
109  hPtRecPi->Sumw2();
110  hEtaRecPi->GetXaxis()->SetTitle("#eta");
111  hPhiRecPi->GetXaxis()->SetTitle("#varphi (rad)");
112  hPtRecPi->GetXaxis()->SetTitle("p_{T} (GeV/c)");
113  TH1D* hEtaEffPi=(TH1D*)hEtaRecPi->Clone("hEtaEffPi");
114  hEtaEffPi->Divide(hEtaRecPi,hEtaGenPi,1.,1.,"B");
115  TH1D* hPhiEffPi=(TH1D*)hPhiRecPi->Clone("hPhiEffPi");
116  hPhiEffPi->Divide(hPhiRecPi,hPhiGenPi,1.,1.,"B");
117  TH1D* hPtEffPi=(TH1D*)hPtRecPi->Clone("hPtEffPi");
118  hPtEffPi->Divide(hPtRecPi,hPtGenPi,1.,1.,"B");
119 
120  TH3F* hEtaPhiPtGenK=(TH3F*)l->FindObject("hEtaPhiPtGenK");
121  TH1D* hEtaGenK=hEtaPhiPtGenK->ProjectionX("hEtaGenK",0,-1,minPtBin,maxPtBin);
122  TH1D* hPhiGenK=hEtaPhiPtGenK->ProjectionY("hPhiGenK",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
123  TH1D* hPtGenK=hEtaPhiPtGenK->ProjectionZ("hPtGenK",minEtaBin,maxEtaBin);
124  hEtaGenK->Sumw2();
125  hPhiGenK->Sumw2();
126  hPtGenK->Sumw2();
127  hEtaGenK->GetXaxis()->SetTitle("#eta");
128  hPhiGenK->GetXaxis()->SetTitle("#varphi (rad)");
129  hPtGenK->GetXaxis()->SetTitle("p_{T} (GeV/c)");
130  TH3F* hEtaPhiPtRecK=(TH3F*)l->FindObject("hEtaPhiPtRecK");
131  TH1D* hEtaRecK=hEtaPhiPtRecK->ProjectionX("hEtaRecK",0,-1,minPtBin,maxPtBin);
132  TH1D* hPhiRecK=hEtaPhiPtRecK->ProjectionY("hPhiRecK",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
133  TH1D* hPtRecK=hEtaPhiPtRecK->ProjectionZ("hPtRecK",minEtaBin,maxEtaBin);
134  hEtaRecK->Sumw2();
135  hPhiRecK->Sumw2();
136  hPtRecK->Sumw2();
137  hEtaRecK->GetXaxis()->SetTitle("#eta");
138  hPhiRecK->GetXaxis()->SetTitle("#varphi (rad)");
139  hPtRecK->GetXaxis()->SetTitle("p_{T} (GeV/c)");
140  TH1D* hEtaEffK=(TH1D*)hEtaRecK->Clone("hEtaEffK");
141  hEtaEffK->Divide(hEtaRecK,hEtaGenK,1.,1.,"B");
142  TH1D* hPhiEffK=(TH1D*)hPhiRecK->Clone("hPhiEffK");
143  hPhiEffK->Divide(hPhiRecK,hPhiGenK,1.,1.,"B");
144  TH1D* hPtEffK=(TH1D*)hPtRecK->Clone("hPtEffK");
145  hPtEffK->Divide(hPtRecK,hPtGenK,1.,1.,"B");
146 
147  TH3F* hEtaPhiPtGenPro=(TH3F*)l->FindObject("hEtaPhiPtGenPro");
148  TH1D* hEtaGenPro=hEtaPhiPtGenPro->ProjectionX("hEtaGenPro",0,-1,minPtBin,maxPtBin);
149  TH1D* hPhiGenPro=hEtaPhiPtGenPro->ProjectionY("hPhiGenPro",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
150  TH1D* hPtGenPro=hEtaPhiPtGenPro->ProjectionZ("hPtGenPro",minEtaBin,maxEtaBin);
151  hEtaGenPro->Sumw2();
152  hPhiGenPro->Sumw2();
153  hPtGenPro->Sumw2();
154  hEtaGenPro->GetXaxis()->SetTitle("#eta");
155  hPhiGenPro->GetXaxis()->SetTitle("#varphi (rad)");
156  hPtGenPro->GetXaxis()->SetTitle("p_{T} (GeV/c)");
157  TH3F* hEtaPhiPtRecPro=(TH3F*)l->FindObject("hEtaPhiPtRecPro");
158  TH1D* hEtaRecPro=hEtaPhiPtRecPro->ProjectionX("hEtaRecPro",0,-1,minPtBin,maxPtBin);
159  TH1D* hPhiRecPro=hEtaPhiPtRecPro->ProjectionY("hPhiRecPro",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
160  TH1D* hPtRecPro=hEtaPhiPtRecPro->ProjectionZ("hPtRecPro",minEtaBin,maxEtaBin);
161  hEtaRecPro->Sumw2();
162  hPhiRecPro->Sumw2();
163  hPtRecPro->Sumw2();
164  hEtaRecPro->GetXaxis()->SetTitle("#eta");
165  hPhiRecPro->GetXaxis()->SetTitle("#varphi (rad)");
166  hPtRecPro->GetXaxis()->SetTitle("p_{T} (GeV/c)");
167  TH1D* hEtaEffPro=(TH1D*)hEtaRecPro->Clone("hEtaEffPro");
168  hEtaEffPro->Divide(hEtaRecPro,hEtaGenPro,1.,1.,"B");
169  TH1D* hPhiEffPro=(TH1D*)hPhiRecPro->Clone("hPhiEffPro");
170  hPhiEffPro->Divide(hPhiRecPro,hPhiGenPro,1.,1.,"B");
171  TH1D* hPtEffPro=(TH1D*)hPtRecPro->Clone("hPtEffPro");
172  hPtEffPro->Divide(hPtRecPro,hPtGenPro,1.,1.,"B");
173 
174  TH3F* hEtaPhiPtGenEle=(TH3F*)l->FindObject("hEtaPhiPtGenEle");
175  TH1D* hEtaGenEle=hEtaPhiPtGenEle->ProjectionX("hEtaGenEle",0,-1,minPtBin,maxPtBin);
176  TH1D* hPhiGenEle=hEtaPhiPtGenEle->ProjectionY("hPhiGenEle",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
177  TH1D* hPtGenEle=hEtaPhiPtGenEle->ProjectionZ("hPtGenEle",minEtaBin,maxEtaBin);
178  hEtaGenEle->Sumw2();
179  hPhiGenEle->Sumw2();
180  hPtGenEle->Sumw2();
181  hEtaGenEle->GetXaxis()->SetTitle("#eta");
182  hPhiGenEle->GetXaxis()->SetTitle("#varphi (rad)");
183  hPtGenEle->GetXaxis()->SetTitle("p_{T} (GeV/c)");
184  TH3F* hEtaPhiPtRecEle=(TH3F*)l->FindObject("hEtaPhiPtRecEle");
185  TH1D* hEtaRecEle=hEtaPhiPtRecEle->ProjectionX("hEtaRecEle",0,-1,minPtBin,maxPtBin);
186  TH1D* hPhiRecEle=hEtaPhiPtRecEle->ProjectionY("hPhiRecEle",minEtaBin,maxEtaBin,minPtBin,maxPtBin);
187  TH1D* hPtRecEle=hEtaPhiPtRecEle->ProjectionZ("hPtRecEle",minEtaBin,maxEtaBin);
188  hEtaRecEle->Sumw2();
189  hPhiRecEle->Sumw2();
190  hPtRecEle->Sumw2();
191  hEtaRecEle->GetXaxis()->SetTitle("#eta");
192  hPhiRecEle->GetXaxis()->SetTitle("#varphi (rad)");
193  hPtRecEle->GetXaxis()->SetTitle("p_{T} (GeV/c)");
194  TH1D* hEtaEffEle=(TH1D*)hEtaRecEle->Clone("hEtaEffEle");
195  hEtaEffEle->Divide(hEtaRecEle,hEtaGenEle,1.,1.,"B");
196  TH1D* hPhiEffEle=(TH1D*)hPhiRecEle->Clone("hPhiEffEle");
197  hPhiEffEle->Divide(hPhiRecEle,hPhiGenEle,1.,1.,"B");
198  TH1D* hPtEffEle=(TH1D*)hPtRecEle->Clone("hPtEffEle");
199  hPtEffEle->Divide(hPtRecEle,hPtGenEle,1.,1.,"B");
200 
201  for(Int_t iBin=1; iBin<=hPtGenPi->GetNbinsX(); iBin++){
202  Double_t w=hPtGenPi->GetBinWidth(iBin);
203  Double_t c=hPtGenPi->GetBinContent(iBin);
204  hPtGenPi->SetBinContent(iBin,c/w);
205  c=hPtGenK->GetBinContent(iBin);
206  hPtGenK->SetBinContent(iBin,c/w);
207  c=hPtGenPro->GetBinContent(iBin);
208  hPtGenPro->SetBinContent(iBin,c/w);
209  c=hPtGenEle->GetBinContent(iBin);
210  hPtGenEle->SetBinContent(iBin,c/w);
211 
212  }
213 
214  hEtaEffPi->SetStats(0);
215  hPtEffPi->SetStats(0);
216  hPhiEffPi->SetStats(0);
217  hEtaEffPi->SetMinimum(0.);
218  hPtEffPi->SetMinimum(0.);
219  hPhiEffPi->SetMinimum(0.);
220  hEtaEffPi->SetMaximum(1.05);
221  hPtEffPi->SetMaximum(1.05);
222  hPhiEffPi->SetMaximum(1.05);
223 
224  hPtGenPi->SetMarkerStyle(27);
225  hPtEffPi->SetMarkerStyle(27);
226  hEtaEffPi->SetMarkerStyle(27);
227  hPhiEffPi->SetMarkerStyle(27);
228  hPtGenK->SetMarkerStyle(22);
229  hPtEffK->SetMarkerStyle(22);
230  hEtaEffK->SetMarkerStyle(22);
231  hPhiEffK->SetMarkerStyle(22);
232  hPtGenK->SetMarkerColor(2);
233  hPtEffK->SetMarkerColor(2);
234  hEtaEffK->SetMarkerColor(2);
235  hPhiEffK->SetMarkerColor(2);
236  hPtGenPro->SetMarkerStyle(25);
237  hPtEffPro->SetMarkerStyle(25);
238  hEtaEffPro->SetMarkerStyle(25);
239  hPhiEffPro->SetMarkerStyle(25);
240  hPtGenPro->SetMarkerColor(4);
241  hPtEffPro->SetMarkerColor(4);
242  hEtaEffPro->SetMarkerColor(4);
243  hPhiEffPro->SetMarkerColor(4);
244  hPtGenEle->SetMarkerStyle(20);
245  hPtEffEle->SetMarkerStyle(20);
246  hEtaEffEle->SetMarkerStyle(20);
247  hPhiEffEle->SetMarkerStyle(20);
248  hPtGenEle->SetMarkerColor(kGreen+1);
249  hPtEffEle->SetMarkerColor(kGreen+1);
250  hEtaEffEle->SetMarkerColor(kGreen+1);
251  hPhiEffEle->SetMarkerColor(kGreen+1);
252 
253  TCanvas* ctref=new TCanvas("ctref","Track eff",1200,800);
254  ctref->Divide(2,2);
255  ctref->cd(1);
256  gPad->SetLogy();
257  hPtGenPi->Draw();
258  ctref->Update();
259  TPaveStats* st1=(TPaveStats*)hPtGenPi->GetListOfFunctions()->FindObject("stats");
260  st1->SetY2NDC(0.91);
261  st1->SetY1NDC(0.76);
262  st1->SetTextColor(1);
263  hPtGenK->Draw("sames");
264  ctref->Update();
265  TPaveStats* st2=(TPaveStats*)hPtGenK->GetListOfFunctions()->FindObject("stats");
266  st2->SetY2NDC(0.75);
267  st2->SetY1NDC(0.60);
268  st2->SetTextColor(2);
269  hPtGenPro->Draw("sames");
270  ctref->Update();
271  TPaveStats* st3=(TPaveStats*)hPtGenPro->GetListOfFunctions()->FindObject("stats");
272  st3->SetY2NDC(0.59);
273  st3->SetY1NDC(0.44);
274  st3->SetTextColor(4);
275  hPtGenEle->Draw("sames");
276  ctref->Update();
277  TPaveStats* st4=(TPaveStats*)hPtGenEle->GetListOfFunctions()->FindObject("stats");
278  st4->SetY2NDC(0.43);
279  st4->SetY1NDC(0.28);
280  st4->SetTextColor(kGreen+1);
281  gPad->Modified();
282  TLegend* leg=new TLegend(0.5,0.5,0.7,0.8);
283  leg->SetFillColor(0);
284  leg->SetBorderSize(0);
285  leg->AddEntry(hPtGenPi,"Pions","P")->SetTextColor(hPtGenPi->GetMarkerColor());
286  leg->AddEntry(hPtGenK,"Kaons","P")->SetTextColor(hPtGenK->GetMarkerColor());
287  leg->AddEntry(hPtGenPro,"Protons","P")->SetTextColor(hPtGenPro->GetMarkerColor());
288  leg->AddEntry(hPtGenEle,"Electrons","P")->SetTextColor(hPtGenEle->GetMarkerColor());
289  leg->Draw();
290 
291  gPad->Update();
292  ctref->cd(2);
293  hPtEffPi->Draw();
294  hPtEffPi->GetYaxis()->SetTitle("Efficiency");
295  hPtEffK->Draw("same");
296  hPtEffEle->Draw("same");
297  hPtEffPro->Draw("same");
298  TLatex* t1=new TLatex(0.62,0.18,Form("%.2f < #eta < %.2f",minEta,maxEta));
299  t1->SetNDC();
300  t1->Draw();
301  ctref->cd(3);
302  hPhiEffPi->Draw();
303  hPhiEffPi->GetYaxis()->SetTitle("Efficiency");
304  hPhiEffK->Draw("same");
305  hPhiEffEle->Draw("same");
306  hPhiEffPro->Draw("same");
307  TLatex* t2=new TLatex(0.18,0.18,Form("%.1f < p_{T} < %.1f GeV/c",minPt,maxPt));
308  t2->SetNDC();
309  t2->Draw();
310  t1->Draw();
311  ctref->cd(4);
312  hEtaEffPi->Draw();
313  hEtaEffPi->GetYaxis()->SetTitle("Efficiency");
314  hEtaEffK->Draw("same");
315  hEtaEffEle->Draw("same");
316  hEtaEffPro->Draw("same");
317  t2->Draw();
318 
319  TH1F* hncharmed=(TH1F*)l->FindObject("hncharmed");
320  TCanvas* cn=new TCanvas("cn","ncharm");
321  hncharmed->Draw("box");
322  hncharmed->GetXaxis()->SetTitle("dNch/dy");
323  hncharmed->GetYaxis()->SetTitle("N Charm hadrons in golden channels");
324  cn->Update();
325 
326  TH2F* hnbvsnc=(TH2F*)l->FindObject("hnbvsnc");
327  TCanvas* cnhf=new TCanvas("cnhf","nb/c");
328  hnbvsnc->Draw("colz");
329  hnbvsnc->GetXaxis()->SetTitle("Nc");
330  hnbvsnc->GetYaxis()->SetTitle("Nb");
331  cnhf->Update();
332  TH2F* hyptD0all=(TH2F*)l->FindObject("hyptD0AllDecay");
333  TH2F* hyptD0promptall=(TH2F*)l->FindObject("hyptD0promptAllDecay");
334  TH2F* hyptD0feeddownall=(TH2F*)l->FindObject("hyptD0feeddownAllDecay");
335  TH2F* hyptD0prompt=(TH2F*)l->FindObject("hyptD0prompt");
336  TH2F* hyptD0feeddown=(TH2F*)l->FindObject("hyptD0feeddown");
337  TH2F* hyptD02=(TH2F*)l->FindObject("hyptD02");
338  TH2F* hyptD04=(TH2F*)l->FindObject("hyptD04");
339  TH1D* hptD0all=hyptD0all->ProjectionX();
340  TH1D* hptD0promptall=hyptD0promptall->ProjectionX();
341  TH1D* hptD0feeddownall=hyptD0feeddownall->ProjectionX();
342  TH2F* hyptDplusall=(TH2F*)l->FindObject("hyptDplusAllDecay");
343  TH2F* hyptDpluspromptall=(TH2F*)l->FindObject("hyptDpluspromptAllDecay");
344  TH2F* hyptDplusfeeddownall=(TH2F*)l->FindObject("hyptDplusfeeddownAllDecay");
345  TH2F* hyptDplusprompt=(TH2F*)l->FindObject("hyptDplusprompt");
346  TH2F* hyptDplusfeeddown=(TH2F*)l->FindObject("hyptDplusfeeddown");
347  TH2F* hyptDplusnonreson=(TH2F*)l->FindObject("hyptDplusnonreson");
348  TH2F* hyptDplusreson=(TH2F*)l->FindObject("hyptDplusreson");
349  TH2F* hyptDsall=(TH2F*)l->FindObject("hyptDsAllDecay");
350  TH2F* hyptDsprompt=(TH2F*)l->FindObject("hyptDsprompt");
351  TH2F* hyptDsfeeddown=(TH2F*)l->FindObject("hyptDsfeedown");
352  TH2F* hyptDsphi=(TH2F*)l->FindObject("hyptDsphi");
353  TH2F* hyptDsK0st=(TH2F*)l->FindObject("hyptDsk0st");
354  TH2F* hyptDstarall=(TH2F*)l->FindObject("hyptDstarAllDecay");
355  TH2F* hyptDstarprompt=(TH2F*)l->FindObject("hyptDstarprompt");
356  TH2F* hyptDstarfeedown=(TH2F*)l->FindObject("hyptDstarfeedown");
357  TH2F* hyptLcprompt=(TH2F*)l->FindObject("hyptLcprompt");
358  TH2F* hyptLcfeedown=(TH2F*)l->FindObject("hyptLcfeedown");
359  TH2F* hyptLcall=(TH2F*)l->FindObject("hyptLcAllDecay");
360 
361  TH2F* hyptB0all=(TH2F*)l->FindObject("hyptB0AllDecay");
362  TH2F* hyptBplusall=(TH2F*)l->FindObject("hyptBplusAllDecay");
363  TH2F* hyptBsall=(TH2F*)l->FindObject("hyptBsAllDecay");
364  TH2F* hyptBstarall=(TH2F*)l->FindObject("hyptBstarAllDecay");
365  TH2F* hyptLball=(TH2F*)l->FindObject("hyptLbAllDecay");
366 
367 
368 
369  TH1F* hD0fonll7=HistoFONLL7TeV();
370  hD0fonll7->Scale(hptD0all->GetMaximum()/hD0fonll7->GetMaximum());
371  hD0fonll7->SetLineColor(kGreen+1);
372  hD0fonll7->SetLineWidth(2);
373 
374  TH1F* hD0fonll2=HistoFONLL2_76TeV();
375  hD0fonll2->Scale(hptD0all->GetMaximum()/hD0fonll2->GetMaximum());
376  hD0fonll2->SetLineColor(kBlue+1);
377  hD0fonll2->SetLineWidth(2);
378 
379  TH1F* hptD0pythia=HistoPYTHIA7();
380  hptD0pythia->Scale(hptD0all->GetMaximum()/hptD0pythia->GetMaximum());
381  hptD0pythia->SetLineColor(kRed+1);
382  hptD0pythia->SetLineWidth(2);
383 
384  hptD0all->SetLineWidth(2);
385  hptD0all->SetMarkerStyle(20);
386  hptD0all->SetTitle("");
387  hptD0all->GetYaxis()->SetTitle("D^{0} dN/dp_{T} (a.u.)");
388  hptD0all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
389  hptD0all->SetStats(0);
390  hptD0all->GetYaxis()->SetTitleOffset(1.2);
391  hptD0all->GetXaxis()->SetTitleOffset(1.2);
392 
393  TCanvas* cd0a=new TCanvas("cd0a","D0 spectra",700,700);
394  cd0a->SetLogy();
395  cd0a->SetLeftMargin(0.13);
396  cd0a->SetRightMargin(0.07);
397  hptD0all->Draw();
398  hD0fonll7->Draw("lsame");
399  hD0fonll2->Draw("lsame");
400  hptD0pythia->Draw("lsame");
401  TLegend* legp=new TLegend(0.45,0.6,0.89,0.85);
402  legp->SetFillStyle(0);
403  legp->SetBorderSize(0);
404  legp->AddEntry(hptD0all,"MC production","LP");
405  legp->AddEntry(hD0fonll7,"FONLL, #sqrt{s}=7 TeV","L");
406  legp->AddEntry(hD0fonll2,"FONLL, #sqrt{s}=2.76 TeV","L");
407  legp->AddEntry(hptD0pythia,"PYTHIA Perugia0, #sqrt{s}=7 TeV","L");
408  legp->Draw();
409 
410  // Prompt and Feeddown
411  TH1F* hOriginPrompt=(TH1F*)l->FindObject("hOriginPrompt");
412  TH1F* hOriginFeeddown=(TH1F*)l->FindObject("hOriginFeeddown");
413 
414  hptD0promptall->SetLineColor(4);
415  hptD0promptall->SetMarkerColor(4);
416  hptD0promptall->SetMarkerStyle(26);
417  hptD0feeddownall->SetLineColor(2);
418  hptD0feeddownall->SetMarkerColor(2);
419  hptD0feeddownall->SetMarkerStyle(23)
420 ;
421  TCanvas* cprf1=new TCanvas("cprf1","Prompt/Feeddown",700,700);
422  gPad->SetLogy();
423  gPad->SetLeftMargin(0.13);
424  gPad->SetRightMargin(0.07);
425  hptD0all->Draw();
426  hptD0promptall->Draw("same");
427  hptD0feeddownall->Draw("same");
428  TLegend* leg2=new TLegend(0.4,0.5,0.89,0.85);
429  leg2->SetFillStyle(0);
430  leg2->SetBorderSize(0);
431  leg2->AddEntry(hptD0all,"All D0","LP");
432  leg2->AddEntry("",Form("Entries=%.0f <pt>=%.2f GeV/c",hptD0all->Integral(),hptD0all->GetMean()),"");
433  leg2->AddEntry(hptD0promptall,"Prompt D0","LP");
434  leg2->AddEntry("",Form("Entries=%.0f <pt>=%.2f GeV/c",hptD0promptall->Integral(),hptD0promptall->GetMean()),"");
435  leg2->AddEntry(hptD0feeddownall,"Feeddown D0","LP");
436  leg2->AddEntry("",Form("Entries=%.0f <pt>=%.2f GeV/c",hptD0feeddownall->Integral(),hptD0feeddownall->GetMean()),"");
437  leg2->Draw();
438  hOriginPrompt->GetXaxis()->SetTitle("Distance of prompt D meson origin to vertex (cm)");
439  hOriginFeeddown->GetXaxis()->SetTitle("Distance of feed-down D meson origin to vertex (cm)");
440 
441  TCanvas* cprf2=new TCanvas("cprf2","Origin",1000,600);
442  cprf2->Divide(2,1);
443  cprf2->cd(1);
444  hOriginPrompt->Draw();
445  cprf2->cd(2);
446  hOriginFeeddown->Draw();
447 
448  // Hadrons
449  Double_t nev=hNEvents->GetBinContent(1);
450  Double_t nD0=hyptD0all->GetEntries();
451  Double_t nDp=hyptDplusall->GetEntries();
452  Double_t nDs=hyptDsall->GetEntries();
453  Double_t nDst=hyptDstarall->GetEntries();
454  Double_t nLc=hyptLcall->GetEntries();
455  Double_t nB0=hyptB0all->GetEntries();
456  Double_t nBp=hyptBplusall->GetEntries();
457  Double_t nBs=hyptBsall->GetEntries();
458  Double_t nBst=hyptBstarall->GetEntries();
459  Double_t nLb=hyptLball->GetEntries();
460 
461 
462  Double_t nccbar=0;
463  Double_t nbbbar=0;
464  for(Int_t iBinx=1; iBinx<=hnbvsnc->GetNbinsX(); iBinx++){
465  for(Int_t iBiny=1; iBiny<=hnbvsnc->GetNbinsY(); iBiny++){
466  Double_t bincentx=hnbvsnc->GetXaxis()->GetBinCenter(iBinx);
467  Double_t bincenty=hnbvsnc->GetYaxis()->GetBinCenter(iBiny);
468  Double_t bincont=hnbvsnc->GetBinContent(iBinx,iBiny);
469  nccbar+=(bincentx*bincont);
470  nbbbar+=(bincenty*bincont);
471  }
472  }
473 
474 
475  printf("Events =%f\n",nev);
476  printf("c+cbar =%f\n",nccbar);
477  printf("D0 =%f\n",nD0);
478  printf("D+ =%f\n",nDp);
479  printf("D*+ =%f\n",nDst);
480  printf("Ds =%f\n",nDs);
481  printf("Lc =%f\n",nLc);
482  printf("----------\n");
483  printf("b+bbar =%f\n",nbbbar);
484  printf("B0 =%f\n",nB0);
485  printf("B+ =%f\n",nBp);
486  printf("B*0 =%f\n",nBst);
487  printf("Bs =%f\n",nBs);
488  printf("Lb =%f\n",nLb);
489 
490  if(nccbar==0) nccbar=nD0+nDp+nDs+nLc;
491  if(nbbbar==0) nbbbar=nB0+nBp+nBs+nLb;
492 
493 
494  TH1F* hCharmHad=new TH1F("hCharmHad","",5,-0.5,4.5);
495  hCharmHad->GetXaxis()->SetBinLabel(1,"D0");
496  hCharmHad->SetBinContent(1,nD0/nccbar);
497  hCharmHad->GetXaxis()->SetBinLabel(2,"D+");
498  hCharmHad->SetBinContent(2,nDp/nccbar);
499  hCharmHad->GetXaxis()->SetBinLabel(3,"Ds");
500  hCharmHad->SetBinContent(3,nDs/nccbar);
501  hCharmHad->GetXaxis()->SetBinLabel(4,"Lc");
502  hCharmHad->SetBinContent(4,nLc/nccbar);
503  hCharmHad->GetXaxis()->SetBinLabel(5,"D*+");
504  hCharmHad->SetBinContent(5,nDst/nccbar);
505  hCharmHad->SetMinimum(0);
506  hCharmHad->SetStats(0);
507  hCharmHad->GetYaxis()->SetTitle("N(species)/N(c+#bar{c})");
508  hCharmHad->GetYaxis()->SetTitleOffset(1.3);
509 
510  TH1F* hBeautyHad=new TH1F("hBeautyHad","",5,-0.5,4.5);
511  hBeautyHad->GetXaxis()->SetBinLabel(1,"B0");
512  hBeautyHad->SetBinContent(1,nB0/nbbbar);
513  hBeautyHad->GetXaxis()->SetBinLabel(2,"B+");
514  hBeautyHad->SetBinContent(2,nBp/nbbbar);
515  hBeautyHad->GetXaxis()->SetBinLabel(3,"Bs");
516  hBeautyHad->SetBinContent(3,nBs/nbbbar);
517  hBeautyHad->GetXaxis()->SetBinLabel(4,"Lb");
518  hBeautyHad->SetBinContent(4,nLb/nbbbar);
519  hBeautyHad->GetXaxis()->SetBinLabel(5,"B*0");
520  hBeautyHad->SetBinContent(5,nBst/nbbbar);
521  hBeautyHad->SetMinimum(0);
522  hBeautyHad->SetStats(0);
523  hBeautyHad->GetYaxis()->SetTitle("N(species)/N(b+#bar{b})");
524  hBeautyHad->GetYaxis()->SetTitleOffset(1.3);
525 
526 
527 
528  TCanvas* chad=new TCanvas("chad","Hadrons",1200,600);
529  chad->Divide(2,1);
530  chad->cd(1);
531  hCharmHad->Draw();
532  chad->cd(2);
533  hBeautyHad->Draw();
534 
535 
536  TH1F* hDSpecies=(TH1F*)l->FindObject("hDSpecies");
537  TH1F* hBSpecies=(TH1F*)l->FindObject("hBSpecies");
538  hDSpecies->SetStats(0);
539  hBSpecies->SetStats(0);
540  TCanvas* chad2=new TCanvas("chad2","Hadrons2",800,900);
541  chad2->Divide(1,2);
542  chad2->cd(1);
543  hDSpecies->Draw();
544  hDSpecies->GetYaxis()->SetTitle("Entries");
545  chad2->cd(2);
546  hBSpecies->Draw();
547  hBSpecies->GetYaxis()->SetTitle("Entries");
548 
549  TCanvas* cd0=new TCanvas("cd0","D0");
550  cd0->Divide(2,2);
551  cd0->cd(1);
552  hyptD0prompt->Draw("colz");
553  cd0->cd(2);
554  hyptD0feeddown->Draw("colz");
555  cd0->cd(3);
556  hyptD02->Draw("colz");
557  cd0->cd(4);
558  hyptD04->Draw("colz");
559 
560 
561  TCanvas* cdplus=new TCanvas("cdplus","Dplus");
562  cdplus->Divide(2,2);
563  cdplus->cd(1);
564  hyptDplusprompt->Draw("colz");
565  cdplus->cd(2);
566  hyptDplusfeeddown->Draw("colz");
567  cdplus->cd(3);
568  hyptDplusnonreson->Draw("colz");
569  cdplus->cd(4);
570  hyptDplusreson->Draw("colz");
571 
572 
573  TCanvas* cds=new TCanvas("cds","Ds");
574  cds->Divide(2,2);
575  cds->cd(1);
576  hyptDsprompt->Draw("colz");
577  cds->cd(2);
578  hyptDsfeeddown->Draw("colz");
579  cds->cd(3);
580  hyptDsphi->Draw("colz");
581  cds->cd(4);
582  hyptDsK0st->Draw("colz");
583 
584 
585  TCanvas* cdstlc=new TCanvas("cdstls","Dstar LambdaC");
586  cdstlc->Divide(2,2);
587  cdstlc->cd(1);
588  hyptDstarprompt->Draw("colz");
589  cdstlc->cd(2);
590  hyptDstarfeedown->Draw("colz");
591  cdstlc->cd(3);
592  hyptLcprompt->Draw("colz");
593  cdstlc->cd(4);
594  hyptLcfeedown->Draw("colz");
595 
596 }
597 
598 
599 
601 
602  TH1F* hFONLL7=new TH1F("hFONLLD07TeV","",61,0.,30.5);
603  Float_t val[61]={
604  1390542.31,3512269.33,4572233.65,4116353.65,3104057.40,
605  2185147.21,1507632.40,1038687.03,721889.43,509311.55,
606  365094.01,265684.43,196609.08,147415.64,112019.94,
607  86170.85,66997.46,52651.54,41787.55,33458.64,
608  27012.62,21981.48,18020.69,14873.73,12354.91,
609  10324.90,8677.32,7331.56,6225.67,5311.74,
610  4552.30,3918.10,3385.73,2936.79,2556.52,
611  2233.25,1957.23,1720.64,1517.12,1341.44,
612  1189.32,1057.17,942.05,841.47,753.33,
613  675.89,607.68,547.45,494.14,446.87,
614  404.83,367.39,333.96,304.08,277.30,
615  253.25,231.62,212.13,194.55,178.66,
616  164.27};
617  for(Int_t i=0; i<61; i++) hFONLL7->SetBinContent(i+1,val[i]);
618  return hFONLL7;
619 }
620 
622  TH1F* hFONLL2=new TH1F("hFONLLD02_76TeV","",61,0.,30.5);
623  Float_t val[61]={
624  1154043.73,2596175.89,2995937.57,2442988.08,1701598.07,
625  1122452.81,732896.42,482314.10,322062.75,218493.05,
626  151653.77,107053.80,76999.08,56239.64,41687.89,
627  31322.25,23818.86,18326.64,14252.10,11192.03,
628  8869.29,7089.11,5711.50,4635.50,3788.31,
629  3116.19,2578.84,2146.51,1796.18,1510.67,
630  1276.72,1083.93,924.20,791.18,679.88,
631  586.36,507.49,440.73,383.99,335.54,
632  294.07,258.43,227.68,201.11,178.07,
633  158.04,140.58,125.32,111.95,100.20,
634  89.86,80.73,72.66,65.51,59.16,
635  53.51,48.48,43.98,39.96,36.36,
636  33.12};
637  for(Int_t i=0; i<61; i++) hFONLL2->SetBinContent(i+1,val[i]);
638  return hFONLL2;
639 }
640 
641 TH1F* HistoPYTHIA7(){
642  TH1F* hPYTHIA7=new TH1F("hPYTHIAD07TeV","",40,0.,20.);
643  Float_t val[40]={
644  826307.00,1753264.00,1877464.00,1634664.00,1278586.00,
645  959137.00,713389.00,535745.00,410250.00,316284.00,
646  249107.00,198235.00,158832.00,129936.00,106957.00,
647  89098.00,73690.00,62752.00,53247.00,45004.00,
648  38475.00,32691.00,28510.00,24516.00,21204.00,
649  18276.00,15890.00,13702.00,12326.00,10612.00,
650  9184.00,8028.00,7194.00,6384.00,5767.00,
651  5102.00,4505.00,3939.00,3578.00,3288.00
652  };
653  for(Int_t i=0; i<40; i++) hPYTHIA7->SetBinContent(i+1,val[i]);
654  return hPYTHIA7;
655 }
double Double_t
Definition: External.C:58
Definition: External.C:260
Definition: External.C:236
TCanvas * c
Definition: TestFitELoss.C:172
TH1F * HistoFONLL7TeV()
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Definition: External.C:212
TH1F * HistoPYTHIA7()
void PlotOutputMCCheck()
TH1F * HistoFONLL2_76TeV()