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