]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/ChargedHadrons/dNdPt/macros/plots/makeCompYield.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / macros / plots / makeCompYield.C
CommitLineData
2803ac99 1//------------------------------------------------------------------------------
2// makeCompYield.C
3//
4// create figure with ALICE vs. UA1 data
5//------------------------------------------------------------------------------
6
7
8void makeCompYield()
9{
10using namespace std;
11
12TGraphErrors *graphYieldUa1 = new TGraphErrors(binsUa1,ptUa1,yieldUa1,errPtUa1,err2YieldUa1);
13graphYieldUa1->SetMarkerColor(colorUa1);
14graphYieldUa1->SetLineColor(colorUa1);
15graphYieldUa1->SetMarkerStyle(26);
16
17TGraphErrors *graphYieldAlice = new TGraphErrors(binsYieldAlice,ptYieldAlice,yieldAlice,0,err2YieldAlice);
18graphYieldAlice->SetMarkerColor(colorAliceFit);
19graphYieldAlice->SetLineColor(colorAliceFit);
20graphYieldAlice->SetLineWidth(1);
21graphYieldAlice->SetMarkerStyle(20);
22
23
24TMultiGraph *all = new TMultiGraph("all","");
25
26
27all->Add(graphYieldUa1);
28//all->Add(graphCms);
29//all->Add(graphAlice);
30all->Add(graphYieldAlice);
31//all->Draw("AP");
32
33Double_t one[binsYieldAlice];
34for (Int_t i=0; i < binsYieldAlice; i++) {
35 one[i] = 1.0;
36}
37
38TGraphErrors *ratioUa1Alice = divide(graphYieldUa1,graphYieldAlice);
39ratioUa1Alice->SetFillColor(colorUa1);
40ratioUa1Alice->SetLineColor(colorUa1);
41ratioUa1Alice->SetFillStyle(3345);
42
43
44TGraphErrors *ratioAliceAlice = new TGraphErrors(binsYieldAlice,ptYieldAlice,one,0,relErr2YieldAlice);
45ratioAliceAlice->SetFillColor(colorAliceErrors);
46ratioAliceAlice->SetLineColor(20);
47
48TCanvas *can4 = new TCanvas("can4","CompYield",520,700);
49
50TPad *pad4_1 = new TPad("pad4_1","pad4_1",0.0,0.35,1.0,1.0);
51setAttrib(pad4_1);
52
53TPad *pad4_2 = new TPad("pad4_2","pad4_2",0.0,0.0,1.0,0.35);
54setAttrib(pad4_2);
55
56//
57can4->cd();
58
59pad4_1->Draw();
60pad4_1->cd();
61pad4_1->SetLogx();
62pad4_1->SetLogy();
63//all->Draw("AE4");
64all->Draw("APZ");
65all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
66all->GetXaxis()->SetTitleOffset(1.6);
67all->GetYaxis()->SetTitleOffset(1.6);
68all->GetYaxis()->SetTitle("1/N_{evt} 1/(2#pi p_{T}) (d^{2}N_{ch})/(dy dp_{T}) (GeV/c)^{-2}");
69all->GetXaxis()->SetLimits(minPt,maxPt);
70setAttrib(all);
71
72
73graphYieldAlice->SetFillColor(2);
74
75TLegend *l4_1 = new TLegend(0.200,0.03,0.65,0.203);
76//TLegend *l4_1 = new TLegend(0.200,0.031,0.302,0.137);
77l4_1->SetHeader("#sqrt{s} = 900 GeV");
78l4_1->AddEntry(graphYieldAlice,"ALICE pp, NSD, | #eta | < 0.8","LP");
79l4_1->AddEntry(graphYieldUa1,"UA1 p#bar{p}, NSD, | #eta | < 2.5","LP");
80//l1->AddEntry(graphCms,"CMS |#eta|<2.4","LP");
81//la->AddEntry(graphUA1,"UA1","p");
82//la->AddEntry(graphCMS,"CMS","p");
83//la->AddEntry(graphCMSred,"CMS, #eta<0.8","p");
84//la->AddEntry(graphATLAS,"ATLAS","p");
85l4_1->SetFillColor(0);
86l4_1->SetLineColor(0);
87l4_1->SetTextSize(legendTextSize);
88l4_1->Draw();
89
90
91//histo1->GetXaxis()->SetNdivisions(405);
92
93can4->cd();
94pad4_2->Draw();
95pad4_2->cd();
96pad4_2->SetLogx();
97
98TMultiGraph *ratios = new TMultiGraph("ratios","");
99
100
101ratios->Add(ratioAliceAlice);
102//ratios->Add(ratioAtlasAlice);
103ratios->Add(ratioUa1Alice);
104
105
106//ratio->SetTitle("ratio ALICE/ATLAS (different #eta)");
107ratios->Draw("AE3");
108ratios->GetXaxis()->SetLimits(minPt,maxPt);
109ratios->GetXaxis()->SetTitle("p_{T} (GeV/c)");
110ratios->GetXaxis()->SetTitleOffset(1.4);
111ratios->GetYaxis()->SetTitleOffset(0.9);
112ratios->GetYaxis()->SetTitle("ratio");
113ratios->GetYaxis()->SetLabelSize(0.07);
114ratios->GetXaxis()->SetLabelSize(0.07);
115ratios->GetXaxis()->SetTitleSize(0.07);
116ratios->GetYaxis()->SetTitleSize(0.07);
117ratios->GetYaxis()->CenterTitle();
118setAttrib(ratios);
119//ratios->GetYaxis()->SetRangeUser(0.2,1.5);
120//ratios->GetYaxis()->SetLimits(0.2,1.5);
121
122ratios->GetYaxis()->SetLabelOffset(0.023);
123
124graphYieldAlice->SetFillColor(2);
125
126TLegend *l4_2 = new TLegend(0.200,0.323,0.65,0.537);
127l4_2->AddEntry(ratioAliceAlice,"ALICE uncertainties","F");
128l4_2->AddEntry(ratioUa1Alice,"UA1 / ALICE","F");
129//l2->AddEntry(ratioCmsAlice,"CMS / ALICE","F");
130l4_2->SetFillColor(0);
131l4_2->SetLineColor(0);
132l4_2->SetTextSize(legendTextSize);
133l4_2->Draw();
134
135
136//aliceData->Draw("AE4");
137TF1 *fOne = new TF1("one","1",0.1,20);
138fOne->SetRange(0.1,20);
139fOne->SetLineWidth(1);
140fOne->Draw("SAME");
141//ratio->GetYaxis()->SetTitle("ratio ALICE/ATLAS");
142/*
143histo1c->Draw();
144histo1c->GetXaxis()->SetLabelSize(0.08);
145histo1c->GetYaxis()->SetLabelSize(0.08);
146histo1c->GetXaxis()->SetNdivisions(405);
147histo1c->GetYaxis()->SetNdivisions(405);
148*/
149
150logoPrelim(can4);
151}