]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FLOW/papers/arXiv_1306.4145/Figure2.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / FLOW / papers / arXiv_1306.4145 / Figure2.C
1 // contact: Ilya Selyuzhenkov (ilya.selyuzhenkov@gmail.com)
2 //
3 // Macro to reproduce Fig. 2 of the directed flow paper http://arxiv.org/abs/1306.4145
4 //
5 #include "STAR_v1_PRL_v101_i25_e252301_y2008.C"
6
7 float myMarkerSize=1.8;
8 const int xRes=600, yRes=800;
9 int fillStyle = 1001;
10 float mainFont = 20;
11 const int nSystOpt = 4;
12 float rangeYa = 0.99e-3;
13 float rangeYb = 0.99e-3;
14 float scale62=0.12;
15 float scale200=0.37;
16 int SystlineWidth =6;
17
18 TGraphErrors *v1_odd_eta_syst_10_20;
19 TGraphErrors *v1_odd_eta_syst_30_40;
20 TGraphErrors *v1_odd_eta_stat_10_20;
21 TGraphErrors *v1_odd_eta_stat_30_40;
22
23 TGraphErrors *px_even_eta_syst_10_60;
24 TGraphErrors *px_even_eta_stat_10_60;
25 TGraphErrors *px_odd_eta_syst_10_60;
26 TGraphErrors *px_odd_eta_stat_10_60;
27
28 TGraphErrors *v1_even_eta_syst_10_60;
29 TGraphErrors *v1_even_eta_stat_10_60;
30 TGraphErrors *v1_odd_eta_syst_10_60;
31 TGraphErrors *v1_odd_eta_stat_10_60;
32
33 void Figure2(bool rWrite = false,TString dataFileName="ALICE_v1_arxiv_1306_4145.root")
34 {
35   TGaxis::SetMaxDigits(3);
36   myOptions();
37   gROOT->ForceStyle();
38   directedFlow_2008_STARdataEta(0.01*scale200, 0.01*scale62);
39   
40   float minPad[3]={0,0.36,0.665};
41   TCanvas *myCan = new TCanvas("myCan","Figure 3",xRes,yRes);
42   myCan->cd();
43   TPad *myPad1 = new TPad("myPad1","myPad1",0.,minPad[2],1,1);
44   myPadSetUp(myPad1,0.11, 0.09, 0.01, 0.00);
45   TPad *myPad2 = new TPad("myPad2","myPad2",0.,minPad[1],1,minPad[2]);
46   myPadSetUp(myPad2,0.11, 0.0, 0.01, 0.0);
47   TPad *myPad3 = new TPad("myPad3","myPad3",0.,minPad[0],1,minPad[1]);
48   myPadSetUp(myPad3,0.11, 0.00, 0.01, 0.16);
49   myPad1->Draw();
50   myPad2->Draw();
51   myPad3->Draw();
52   
53   TH1F *myBlankHisto1 = new TH1F("myBlankHisto1","Blank Histogram",10,-0.85,0.85);
54   myHistoSetUp(myBlankHisto1,"#eta","v_{1}",-rangeYb,rangeYb, 1, 2, 505, 305);
55   TH1F *myBlankHisto2 = new TH1F("myBlankHisto2","Blank Histogram",10,-0.85,0.85);
56   myHistoSetUp(myBlankHisto2,"#eta","#LTp_{x}#GT/#LTp_{T}#GT",-rangeYa,rangeYa, 1, 2, 505, 305);
57   TH1F *myBlankHisto3 = new TH1F("myBlankHisto3","Blank Histogram",100,-0.85,0.85);
58   myHistoSetUp(myBlankHisto3,"#eta","v_{1}",-rangeYb,rangeYb, 1, 2, 505, 305);
59   
60   // get graphs
61   TFile *dataFile = TFile::Open(dataFileName,"READ");
62   
63   v1_odd_eta_stat_10_20 = (TGraphErrors*)dataFile->Get("v1_odd_eta_stat_10_20");
64   v1_odd_eta_syst_10_20 = (TGraphErrors*)dataFile->Get("v1_odd_eta_syst_10_20");
65   v1_odd_eta_stat_30_40 = (TGraphErrors*)dataFile->Get("v1_odd_eta_stat_30_40");
66   v1_odd_eta_syst_30_40 = (TGraphErrors*)dataFile->Get("v1_odd_eta_syst_30_40");
67   v1_odd_eta_stat_30_60 = (TGraphErrors*)dataFile->Get("v1_odd_eta_stat_30_60");
68   v1_odd_eta_syst_30_60 = (TGraphErrors*)dataFile->Get("v1_odd_eta_syst_30_60");
69   
70   v1_even_eta_stat_10_20 = (TGraphErrors*)dataFile->Get("v1_even_eta_stat_10_20");
71   v1_even_eta_syst_10_20 = (TGraphErrors*)dataFile->Get("v1_even_eta_syst_10_20");
72   v1_even_eta_stat_30_40 = (TGraphErrors*)dataFile->Get("v1_even_eta_stat_30_40");
73   v1_even_eta_syst_30_40 = (TGraphErrors*)dataFile->Get("v1_even_eta_syst_30_40");
74   
75   v1_odd_eta_stat_10_60 = (TGraphErrors*)dataFile->Get("v1_odd_eta_stat_10_60");
76   v1_odd_eta_syst_10_60 = (TGraphErrors*)dataFile->Get("v1_odd_eta_syst_10_60");
77   v1_even_eta_stat_10_60 = (TGraphErrors*)dataFile->Get("v1_even_eta_stat_10_60");
78   v1_even_eta_syst_10_60 = (TGraphErrors*)dataFile->Get("v1_even_eta_syst_10_60");
79   
80   px_odd_eta_stat_10_60 = (TGraphErrors*)dataFile->Get("px_odd_eta_stat_10_60");
81   px_odd_eta_syst_10_60 = (TGraphErrors*)dataFile->Get("px_odd_eta_syst_10_60");
82   px_even_eta_stat_10_60 = (TGraphErrors*)dataFile->Get("px_even_eta_stat_10_60");
83   px_even_eta_syst_10_60 = (TGraphErrors*)dataFile->Get("px_even_eta_syst_10_60");
84   
85   // setup graphs
86   int colorStat = kBlue; int colorSyst = kBlue-10;
87   
88   myTGraphSetUp(v1_odd_eta_syst_30_40,kFullTriangleDown,colorSyst,0,1,colorSyst,SystlineWidth,fillStyle,colorSyst);
89   myTGraphSetUp(v1_odd_eta_stat_30_40,kFullTriangleDown,colorStat,myMarkerSize,1,colorStat,2,fillStyle,colorStat);
90   
91   myTGraphSetUp(v1_even_eta_syst_30_40,kOpenTriangleDown,colorSyst,0,1,colorSyst,SystlineWidth,fillStyle,colorSyst);
92   myTGraphSetUp(v1_even_eta_stat_30_40,kOpenTriangleDown,colorStat,myMarkerSize,1,colorStat,2,fillStyle,colorStat);
93   
94   myTGraphSetUp(px_even_eta_syst_10_60,kOpenSquare,colorSyst,0,1,colorSyst,SystlineWidth,1001,colorSyst);
95   myTGraphSetUp(px_even_eta_stat_10_60,kOpenSquare,colorStat,myMarkerSize,1,colorStat,2,1001,colorStat);
96   
97   colorStat = kGreen+2; colorSyst = kGreen-8;
98   
99   myTGraphSetUp(v1_odd_eta_syst_10_20,kFullTriangleUp,colorSyst,0,1,colorSyst,SystlineWidth,fillStyle,colorSyst);
100   myTGraphSetUp(v1_odd_eta_stat_10_20,kFullTriangleUp,colorStat,myMarkerSize,1,colorStat,2,fillStyle,colorStat);
101   
102   myTGraphSetUp(v1_even_eta_syst_10_20,kOpenTriangleUp,colorSyst,0,1,colorSyst,SystlineWidth,fillStyle,colorSyst);
103   myTGraphSetUp(v1_even_eta_stat_10_20,kOpenTriangleUp,colorStat,myMarkerSize,1,colorStat,2,fillStyle,colorStat);
104   
105   colorStat = kMagenta+2; colorSyst = kMagenta-8;
106   
107   myTGraphSetUp(v1_even_eta_syst_10_60,kOpenDiamond,colorSyst,0,1,colorSyst,SystlineWidth,1001,colorSyst);
108   myTGraphSetUp(v1_even_eta_stat_10_60,kOpenDiamond,colorStat,myMarkerSize*1.3,1,colorStat,2,1001,colorStat);
109   
110   myTGraphSetUp(px_odd_eta_syst_10_60,kFullSquare,colorSyst,0,1,colorSyst,SystlineWidth,1001,colorSyst);
111   myTGraphSetUp(px_odd_eta_stat_10_60,kFullSquare,colorStat,myMarkerSize,1,colorStat,2,1001,colorStat);
112   
113   myTGraphSetUp(v1_odd_eta_syst_10_60,kFullDiamond,colorSyst,0,1,colorSyst,SystlineWidth,1001,colorSyst);
114   myTGraphSetUp(v1_odd_eta_stat_10_60,kFullDiamond,colorStat,myMarkerSize*1.4,1,colorStat,2,1001,colorStat);
115   
116   myTGraphSetUp(v1_odd_eta_syst_30_60,kFullCircle,colorSyst,0,1,colorSyst,SystlineWidth,fillStyle,colorSyst);
117   myTGraphSetUp(v1_odd_eta_stat_30_60,kFullCircle,colorStat,myMarkerSize,1,colorStat,2,fillStyle,colorStat);
118   
119   myTGraphSetUp(v1_star_AuAu200_30_60_eta,kOpenCross,kGreen+2,myMarkerSize,1,kGreen+2,2,fillStyle,kGreen+2);
120   myTGraphSetUp(v1_star_AuAu62_30_60_eta,kOpenStar,kBlue+2,myMarkerSize*1.3,1,kBlue+2,2,fillStyle,kBlue+2);  
121   
122   TLatex *myText = new TLatex();
123   myText->SetNDC();
124   
125   // fitting
126   TF1*fit_px_odd_eta_stat_10_60 = new TF1("fit_v1eta_pTweight_odd_Stat_10_60", "[0]*x", -0.8,0.8);
127   px_odd_eta_stat_10_60->Fit(fit_px_odd_eta_stat_10_60,"0","",-0.78,0.78);
128   fit_px_odd_eta_stat_10_60 = (TF1*)px_odd_eta_stat_10_60->GetListOfFunctions()->At(0)->Clone();
129   fit_px_odd_eta_stat_10_60->SetLineColor(px_odd_eta_stat_10_60->GetLineColor());
130   fit_px_odd_eta_stat_10_60->SetLineStyle(1);
131   fit_px_odd_eta_stat_10_60->SetLineWidth(2);
132   
133   TF1*fit_px_even_eta_stat_10_60 = new TF1("fit_v1eta_pTweight_even_Stat_10_60", "[0]", -0.8,0.8);
134   px_even_eta_stat_10_60->Fit(fit_px_even_eta_stat_10_60,"0","",-0.78,0.78);
135   fit_px_even_eta_stat_10_60 = (TF1*)px_even_eta_stat_10_60->GetListOfFunctions()->At(0)->Clone();
136   fit_px_even_eta_stat_10_60->SetLineColor(px_even_eta_stat_10_60->GetLineColor());
137   fit_px_even_eta_stat_10_60->SetLineStyle(2);
138   fit_px_even_eta_stat_10_60->SetLineWidth(2);
139   
140   TF1*fit_v1_odd_eta_stat_10_60 = new TF1("fit_v1eta_odd_Stat_10_60", "[0]*x", -0.8,0.8);
141   v1_odd_eta_stat_10_60->Fit(fit_v1_odd_eta_stat_10_60,"0","",-0.78,0.78);
142   fit_v1_odd_eta_stat_10_60 = (TF1*)v1_odd_eta_stat_10_60->GetListOfFunctions()->At(0)->Clone();
143   fit_v1_odd_eta_stat_10_60->SetLineColor(v1_odd_eta_stat_10_60->GetLineColor());
144   fit_v1_odd_eta_stat_10_60->SetLineStyle(1);
145   fit_v1_odd_eta_stat_10_60->SetLineWidth(2);
146   
147   TF1*fit_v1_even_eta_stat_10_60 = new TF1("fit_v1eta_even_Stat_10_60", "[0]", -0.8,0.8);
148   v1_even_eta_stat_10_60->Fit(fit_v1_even_eta_stat_10_60,"0","",-0.78,0.78);
149   fit_v1_even_eta_stat_10_60 = (TF1*)v1_even_eta_stat_10_60->GetListOfFunctions()->At(0)->Clone();
150   fit_v1_even_eta_stat_10_60->SetLineColor(v1_even_eta_stat_10_60->GetLineColor());
151   fit_v1_even_eta_stat_10_60->SetLineStyle(2);
152   fit_v1_even_eta_stat_10_60->SetLineWidth(2);
153   
154   TF1*fit_v1_odd_eta_stat_30_60 = new TF1("fit_v1_odd_eta_stat_30_60", "[0]*x", -0.78,0.78);
155   v1_odd_eta_stat_30_60->Fit(fit_v1_odd_eta_stat_30_60,"0","",-0.78,0.78);
156   fit_v1_odd_eta_stat_30_60 = (TF1*)v1_odd_eta_stat_30_60->GetListOfFunctions()->At(0)->Clone();
157   fit_v1_odd_eta_stat_30_60->SetLineColor(v1_odd_eta_stat_30_60->GetLineColor());
158   fit_v1_odd_eta_stat_30_60->SetLineStyle(1);
159   fit_v1_odd_eta_stat_30_60->SetLineWidth(2);
160   
161   // clone histos for legend drawing
162   TGraphErrors *px_odd_eta_syst_10_60_clone=(TGraphErrors*)px_odd_eta_syst_10_60->Clone("px_odd_eta_syst_10_60_clone"); px_odd_eta_syst_10_60_clone->SetLineWidth(1);
163   TGraphErrors *px_even_eta_syst_10_60_clone=(TGraphErrors*)px_even_eta_syst_10_60->Clone("px_even_eta_syst_10_60_clone"); px_even_eta_syst_10_60_clone->SetLineWidth(1);
164   TGraphErrors *v1_odd_eta_syst_10_60_clone=(TGraphErrors*)v1_odd_eta_syst_10_60->Clone("v1_odd_eta_syst_10_60_clone"); v1_odd_eta_syst_10_60_clone->SetLineWidth(1);
165   TGraphErrors *v1_odd_eta_syst_10_20_clone=(TGraphErrors*)v1_odd_eta_syst_10_20->Clone("v1_odd_eta_syst_10_20_clone"); v1_odd_eta_syst_10_20_clone->SetLineWidth(1);
166   TGraphErrors *v1_odd_eta_syst_30_40_clone=(TGraphErrors*)v1_odd_eta_syst_30_40->Clone("v1_odd_eta_syst_30_40_clone"); v1_odd_eta_syst_30_40_clone->SetLineWidth(1);
167   TGraphErrors *v1_even_eta_syst_10_60_clone=(TGraphErrors*)v1_even_eta_syst_10_60->Clone("v1_even_eta_syst_10_60_clone"); v1_even_eta_syst_10_60_clone->SetLineWidth(1);
168   TGraphErrors *v1_even_eta_syst_10_20_clone=(TGraphErrors*)v1_even_eta_syst_10_20->Clone("v1_even_eta_syst_10_20_clone"); v1_even_eta_syst_10_20_clone->SetLineWidth(1);
169   TGraphErrors *v1_even_eta_syst_30_40_clone=(TGraphErrors*)v1_even_eta_syst_30_40->Clone("v1_even_eta_syst_30_40_clone"); v1_even_eta_syst_30_40_clone->SetLineWidth(1);
170   TGraphErrors *v1_odd_eta_syst_30_60_clone=(TGraphErrors*)v1_odd_eta_syst_30_60->Clone("v1_odd_eta_syst_30_60_clone"); v1_odd_eta_syst_30_60_clone->SetLineWidth(1);  
171   
172   // create and fill legends
173   TLegend *myLegend1SysA = new TLegend(0.59,0.52,0.86,0.82);
174   myLegendSetUp(myLegend1SysA,mainFont);
175   myLegend1SysA->AddEntry(v1_odd_eta_syst_10_20_clone," ","F");
176   myLegend1SysA->AddEntry(v1_odd_eta_syst_30_40_clone," ","F");
177   myLegend1SysA->AddEntry(v1_odd_eta_syst_10_60_clone," ","F");
178   
179   TLegend *myLegend1a = new TLegend(0.59,0.52,0.86,0.82);
180   myLegendSetUp(myLegend1a,mainFont);
181   myLegend1a->AddEntry(v1_odd_eta_stat_10_20," ","P");
182   myLegend1a->AddEntry(v1_odd_eta_stat_30_40," ","P");
183   myLegend1a->AddEntry(v1_odd_eta_stat_10_60," ","P");
184   
185   TLegend *myLegend1Sys1C = new TLegend(0.59,0.52,0.86,0.82);
186   myLegendSetUp(myLegend1Sys1C,mainFont);
187   myLegend1Sys1C->AddEntry("NULL"," ","");
188   myLegend1Sys1C->AddEntry("NULL"," ","");
189   myLegend1Sys1C->AddEntry(fit_v1_odd_eta_stat_10_60," ","L");
190   
191   TLegend *myLegend1b = new TLegend(0.69,0.52,0.95,0.82);
192   myLegendSetUp(myLegend1b,mainFont);
193   myLegend1b->AddEntry(v1_even_eta_syst_10_20_clone," ","F");
194   myLegend1b->AddEntry(v1_even_eta_syst_30_40_clone," ","F");
195   myLegend1b->AddEntry(v1_even_eta_syst_10_60_clone," ","F");
196   
197   TLegend *myLegend1SysB = new TLegend(0.69,0.52,0.95,0.82);
198   myLegendSetUp(myLegend1SysB,mainFont);
199   myLegend1SysB->AddEntry(v1_even_eta_stat_10_20,"  10-20%","P");
200   myLegend1SysB->AddEntry(v1_even_eta_stat_30_40,"  30-40%","P");
201   myLegend1SysB->AddEntry(v1_even_eta_stat_10_60,"  10-60% with fit","P");
202   
203   TLegend *myLegend1SysC = new TLegend(0.69,0.52,0.95,0.82);
204   myLegendSetUp(myLegend1SysC,mainFont);
205   myLegend1SysC->AddEntry("NULL"," ","");
206   myLegend1SysC->AddEntry("NULL"," ","");
207   myLegend1SysC->AddEntry(fit_v1_even_eta_stat_10_60," ","L");
208   
209   TLegend *myLegend1SysA2 = new TLegend(0.55,0.73,0.82,0.85);
210   myLegendSetUp(myLegend1SysA2,mainFont);
211   myLegend1SysA2->AddEntry(px_odd_eta_syst_10_60_clone," ","F");
212   
213   TLegend *myLegend1a2 = new TLegend(0.55,0.73,0.82,0.85);
214   myLegendSetUp(myLegend1a2,mainFont);
215   myLegend1a2->AddEntry(px_odd_eta_stat_10_60," ","P");
216   
217   TLegend *myLegend1c2 = new TLegend(0.55,0.73,0.82,0.85);
218   myLegendSetUp(myLegend1c2,mainFont);
219   myLegend1c2->AddEntry(fit_v1_odd_eta_stat_10_60," ","L");
220   
221   TLegend *myLegend1b2 = new TLegend(0.64,0.73,0.91,0.85);
222   myLegendSetUp(myLegend1b2,mainFont);
223   myLegend1b2->AddEntry(px_even_eta_syst_10_60_clone," ","F");
224   
225   TLegend *myLegend1SysB2 = new TLegend(0.64,0.73,0.91,0.85);
226   myLegendSetUp(myLegend1SysB2,mainFont);
227   myLegend1SysB2->AddEntry(px_even_eta_stat_10_60,"   10-60% with fit","P");
228   
229   TLegend *myLegend1SysC2 = new TLegend(0.64,0.73,0.91,0.85);
230   myLegendSetUp(myLegend1SysC2,mainFont);
231   myLegend1SysC2->AddEntry(fit_px_even_eta_stat_10_60," ","L");
232   
233   TLegend *myLegend1SysA3 = new TLegend(0.65,0.73,0.91,0.85);
234   myLegendSetUp(myLegend1SysA3,mainFont);
235   myLegend1SysA3->AddEntry(v1_odd_eta_syst_30_60_clone," ","F");
236   
237   TLegend *myLegend1a3 = new TLegend(0.65,0.73,0.91,0.85);
238   myLegendSetUp(myLegend1a3,mainFont);
239   myLegend1a3->AddEntry(v1_odd_eta_stat_30_60," ","P");
240   
241   TLegend *myLegend1c3 = new TLegend(0.65,0.73,0.91,0.85);
242   myLegendSetUp(myLegend1c3,mainFont);
243   myLegend1c3->AddEntry(fit_v1_odd_eta_stat_30_60," 30-60% with fit","L");
244   
245   TLegend *myLegend1Sys = new TLegend(0.78,0.5,1.06,0.8);
246   myLegendSetUp(myLegend1Sys,mainFont);
247   myLegend1Sys->AddEntry(v1_odd_eta_syst_10_20_clone," ","F");
248   myLegend1Sys->AddEntry(v1_odd_eta_syst_30_40_clone," ","F");
249   myLegend1Sys->AddEntry(v1_odd_eta_syst_30_60_clone," ","F");
250   
251   TLegend *myLegend1 = new TLegend(0.78,0.5,1.06,0.8);
252   myLegendSetUp(myLegend1,mainFont);
253   myLegend1->AddEntry(v1_odd_eta_stat_10_20,"  10-20%","P");
254   myLegend1->AddEntry(v1_odd_eta_stat_30_40,"  30-40%","P");
255   myLegend1->AddEntry(v1_odd_eta_stat_30_60,"  30-60%","P");
256   
257   TLegend *myLegend3 = new TLegend(0.135,0.3,0.43,0.5);
258   myLegendSetUp(myLegend3,0.95*mainFont);
259   myLegend3->AddEntry(v1_star_AuAu200_30_60_eta,"   #times 0.37  200GeV","P");
260   myLegend3->AddEntry(v1_star_AuAu62_30_60_eta,"   #times 0.12  62.4GeV","P");
261   
262   // shift points along x-axis for visibility
263   float shift =0.01;
264   
265   ShiftAlongXaxis(v1_odd_eta_stat_10_20, 4*shift);
266   ShiftAlongXaxis(v1_odd_eta_syst_10_20, 4*shift);
267   ShiftAlongXaxis(v1_odd_eta_stat_30_40, -4*shift);
268   ShiftAlongXaxis(v1_odd_eta_syst_30_40, -4*shift);
269   
270   ShiftAlongXaxis(v1_even_eta_stat_10_20, 4*shift);
271   ShiftAlongXaxis(v1_even_eta_syst_10_20, 4*shift);
272   ShiftAlongXaxis(v1_even_eta_stat_30_40, -4*shift);
273   ShiftAlongXaxis(v1_even_eta_syst_30_40, -4*shift);  
274   
275   //pad1
276   myPad1->cd();
277   myBlankHisto1->Draw();
278   myText->SetTextSize(1.5*mainFont);
279   myText->DrawLatex(0.93,0.81,"(a)");
280   myText->SetTextSize(mainFont);
281   myText->DrawLatex(0.6,0.84,"odd    even     v_{1}");
282   
283   myLegend1SysA->Draw();
284   myLegend1a->Draw();
285   myLegend1Sys1C->Draw();
286   myLegend1b->Draw();
287   myLegend1SysB->Draw();
288   myLegend1SysC->Draw();
289   
290   fit_v1_odd_eta_stat_10_60->Draw("same");
291   fit_v1_even_eta_stat_10_60->Draw("same");  
292   v1_odd_eta_syst_10_20->Draw("eZ");
293   v1_odd_eta_syst_30_40->Draw("eZ");
294   v1_odd_eta_syst_10_60->Draw("eZ");
295   v1_even_eta_syst_10_20->Draw("eZ");
296   v1_even_eta_syst_30_40->Draw("eZ");
297   v1_even_eta_syst_10_60->Draw("eZ");
298   v1_odd_eta_stat_10_20->Draw("P,eZ");
299   v1_odd_eta_stat_30_40->Draw("P,eZ");
300   v1_odd_eta_stat_10_60->Draw("P,eZ");
301   v1_even_eta_stat_10_20->Draw("P,eZ");
302   v1_even_eta_stat_30_40->Draw("P,eZ");
303   v1_even_eta_stat_10_60->Draw("P,eZ");
304   
305   //pad2
306   myPad2->cd();
307   myBlankHisto2->Draw();
308   myText->SetTextSize(1.5*mainFont);
309   myText->DrawLatex(0.93,0.88,"(b)");
310   myText->SetTextSize(mainFont);
311   myText->DrawLatex(0.15,0.1,"ALICE Pb-Pb@2.76TeV  p_{T}>0.15 GeV/c");
312   myText->SetTextSize(mainFont);
313   myText->DrawLatex(0.555,0.89,"odd    even   #LTp_{x}#GT/#LTp_{T}#GT");
314   
315   myLegend1SysA2->Draw();
316   myLegend1a2->Draw();
317   myLegend1b2->Draw();
318   myLegend1SysB2->Draw();
319   myLegend1SysC2->Draw();
320   myLegend1c2->Draw();
321   
322   fit_px_odd_eta_stat_10_60->Draw("same");
323   fit_px_even_eta_stat_10_60->Draw("same");  
324   px_even_eta_syst_10_60->Draw("eZ");
325   px_even_eta_stat_10_60->Draw("P,eZ");
326   px_odd_eta_syst_10_60->Draw("eZ");
327   px_odd_eta_stat_10_60->Draw("P,eZ");
328   
329   //pad3
330   myPad3->cd();
331   myBlankHisto3->Draw();
332   myText->SetTextSize(1.5*mainFont);
333   myText->DrawLatex(0.93,0.9,"(c)");  
334   myText->SetTextSize(mainFont);
335   myText->DrawLatex(0.655,0.89,"odd   v_{1}");
336   myText->SetTextSize(0.95*mainFont);
337   myText->DrawLatex(0.13,0.51,"STAR  (scaled)");
338   myText->SetTextSize(0.95*mainFont);
339   myText->DrawLatex(0.15,0.23,"Au-Au 30-60% p_{T}>0.15 GeV/c");
340   
341   myLegend1SysA3->Draw();
342   myLegend1a3->Draw();
343   myLegend1c3->Draw();
344   myLegend3->Draw();
345   
346   ShiftAlongXaxis(v1_star_AuAu200_30_60_eta, 2*shift);
347   ShiftAlongXaxis(v1_star_AuAu62_30_60_eta, -2*shift);
348   
349   fit_v1_odd_eta_stat_30_60->Draw("same");  
350   v1_star_AuAu62_30_60_eta->Draw("P,eZ");
351   v1_star_AuAu200_30_60_eta->Draw("P,eZ");
352   v1_odd_eta_syst_30_60->Draw("eZ");
353   v1_odd_eta_stat_30_60->Draw("P,eZ");
354   
355   // save output if option rWrite=true
356   TString fileName="Figure2";
357   myCan->Update();
358   if (rWrite)  
359   {
360     myCan->SaveAs(fileName+".png");
361     myCan->SaveAs(fileName+".eps");
362     myCan->SaveAs(fileName+".pdf");
363   }
364 }
365
366 // only helper functions below
367
368 void myLegendSetUp(TLegend *currentLegend=0,float currentTextSize=0.07){
369   currentLegend->SetBorderSize(0);
370   currentLegend->SetFillStyle(0);
371   currentLegend->SetFillColor(0);
372   currentLegend->SetMargin(0.25);
373   currentLegend->SetTextSize(currentTextSize);
374   currentLegend->SetEntrySeparation(0.5);
375   return;
376 }
377
378 void myPadSetUp(TPad *currentPad, float currentLeft=0.11, float currentTop=0.04, float currentRight=0.04, float currentBottom=0.15){
379   currentPad->SetLeftMargin(currentLeft);
380   currentPad->SetTopMargin(currentTop);
381   currentPad->SetRightMargin(currentRight);
382   currentPad->SetBottomMargin(currentBottom);
383   return;
384 }
385
386 void myGraphSetUp(TGraphErrors *currentGraph=0, Float_t currentMarkerSize = 1.0,
387                   int currentMarkerStyle=20, int currentMarkerColor=0,
388                   int currentLineStyle=1, int currentLineColor=0)
389 {
390   currentGraph->SetMarkerSize(currentMarkerSize);
391   currentGraph->SetMarkerStyle(currentMarkerStyle);
392   currentGraph->SetMarkerColor(currentMarkerColor);
393   currentGraph->SetLineStyle(currentLineStyle);
394   currentGraph->SetLineColor(currentLineColor);
395   return;
396 }
397
398 void myOptions(Int_t lStat=0){
399   int font = 43;
400   gStyle->SetFrameBorderMode(0);
401   gStyle->SetFrameFillColor(0);
402   gStyle->SetCanvasBorderMode(0);
403   gStyle->SetPadBorderMode(0);
404   gStyle->SetPadColor(10);
405   gStyle->SetCanvasColor(10);
406   gStyle->SetTitleFillColor(10);
407   gStyle->SetTitleBorderSize(1);
408   gStyle->SetStatColor(10);
409   gStyle->SetStatBorderSize(1);
410   gStyle->SetLegendBorderSize(1);
411   //
412   gStyle->SetDrawBorder(0);
413   gStyle->SetTextFont(font);
414   gStyle->SetStatFont(font);
415   gStyle->SetLegendFont(font);
416   gStyle->SetStatFontSize(20);
417   gStyle->SetStatX(0.97);
418   gStyle->SetStatY(0.98);
419   gStyle->SetStatH(0.03);
420   gStyle->SetStatW(0.3);
421   gStyle->SetTickLength(0.02,"y");
422   gStyle->SetEndErrorSize(3);
423   gStyle->SetLabelSize(20,"xyz");
424   gStyle->SetLabelFont(font,"xyz"); 
425   gStyle->SetLabelOffset(0.01,"xyz");
426   gStyle->SetTitleFont(font,"xyz");
427   gStyle->SetTitleOffset(1.7,"y");  
428   gStyle->SetTitleOffset(2,"xz");  
429   gStyle->SetTitleSize(24,"x");  
430   gStyle->SetTitleSize(24,"y");  
431   gStyle->SetMarkerSize(1); 
432   gStyle->SetPalette(1,0); 
433   
434   if (lStat){
435     gStyle->SetOptTitle(1);
436     gStyle->SetOptStat(1111);
437     gStyle->SetOptFit(1111);
438   }
439   else {
440     gStyle->SetOptTitle(0);
441     gStyle->SetOptStat(0);
442     gStyle->SetOptFit(0);
443   }
444 }
445
446 TGraphErrors* makeGraphH1(TH1* hist, TString name="")
447 {
448   name.ReplaceAll(" ","");
449   Int_t nbins = hist->GetNbinsX();
450   Double_t* x = new Double_t[nbins];
451   Double_t* y = new Double_t[nbins];
452   Double_t* xerr = new Double_t[nbins]; 
453   Double_t* yerr = new Double_t[nbins];
454   Int_t n=0;
455   for (Int_t i=0; i<nbins; i++)
456   {
457     x[n] = hist->GetXaxis()->GetBinCenter(i+1);
458     y[n] = hist->GetBinContent(i+1);
459     xerr[n] = 0.0;
460     yerr[n] = hist->GetBinError(i+1);
461     n++;
462   }
463   TGraphErrors* gr = new TGraphErrors(n,x,y,xerr,yerr);
464   delete [] x;
465   delete [] y;
466   delete [] xerr;
467   delete [] yerr;
468   return gr;
469 }
470
471 TGraphErrors* makeGraphPr(TProfile* hist, TString name="")
472 {
473   name.ReplaceAll(" ","");
474   TString title = name;
475   title.ReplaceAll("_"," ");
476   Int_t nbins = hist->GetNbinsX();
477   Double_t* x = new Double_t[nbins];
478   Double_t* y = new Double_t[nbins];
479   Double_t* xerr = new Double_t[nbins]; 
480   Double_t* yerr = new Double_t[nbins];
481   Int_t n=0;
482   for (Int_t i=0; i<nbins; i++)
483   {
484     x[n] = hist->GetXaxis()->GetBinCenter(i+1);
485     y[n] = hist->GetBinContent(i+1);
486     xerr[n] = 0.0;
487     yerr[n] = hist->GetBinError(i+1);
488     n++;
489   }
490   TGraphErrors* gr = new TGraphErrors(n,x,y,xerr,yerr);
491   gr->SetName(name);
492   gr->SetTitle(title);
493   delete [] x;
494   delete [] y;
495   delete [] xerr;
496   delete [] yerr;
497   return gr;
498 }
499
500 void myHistoSetUp
501 (
502   TH1F *hist=0, TString xTitle="xTitle", TString yTitle="yTitle", float minY=-1, float maxY=1, int lineColor=1, int lineStyle=2,
503  int nDivisionsX=305,int nDivisionsY=305
504 )
505 {
506   hist->GetXaxis()->SetTitle(xTitle);
507   hist->GetYaxis()->SetTitle(yTitle);
508   hist->SetMinimum(minY);
509   hist->SetMaximum(maxY);
510   hist->SetLineColor(lineColor);
511   hist->SetLineStyle(lineStyle);
512   hist->SetNdivisions(nDivisionsX,"x");
513   hist->SetNdivisions(nDivisionsY,"y");
514   return;
515 }
516
517 void ShiftAlongXaxis(TGraphErrors *ge, Double_t shift)
518 {
519   if(!ge)
520   {
521     printf("\n WARNING: ge is NULL in ShiftAlongXaxis() !!!! \n\n");
522     return;
523   }
524   Int_t nPoints = ge->GetN();
525   Double_t x = 0.;
526   Double_t y = 0.;
527   for(Int_t p=0;p<nPoints;p++)
528   {
529     ge->GetPoint(p,x,y);
530     x+=shift;
531     ge->SetPoint(p,x,y);
532   }
533 }
534
535 void ScaleXaxis(TGraphErrors *ge, Double_t scale)
536 {
537   if(!ge)
538   {
539     printf("\n WARNING: ge is NULL in ShiftAlongXaxis() !!!! \n\n");
540     return;
541   }
542   Int_t nPoints = ge->GetN();
543   Double_t x = 0.;
544   Double_t y = 0.;
545   for(Int_t p=0;p<nPoints;p++)
546   {
547     ge->GetPoint(p,x,y);
548     x*=scale;
549     ge->SetPoint(p,x,y);
550   }
551 }
552
553
554 void myTGraphSetUp
555 (
556   TGraphErrors *currentGraph=0,
557  int myMarkerStyle=8,
558  int myMarkerColor=1,
559  float myMarkerSize=1,
560  int myLineStyle=1,
561  int myLineColor=1,
562  float myLineWidth=1,
563  int myFillStyle =fillStyle,
564  int myFillColor =1 
565 )
566 {
567   currentGraph->SetMarkerStyle(myMarkerStyle);
568   currentGraph->SetMarkerColor(myMarkerColor);
569   currentGraph->SetMarkerSize(myMarkerSize);
570   currentGraph->SetLineColor(myLineColor);
571   currentGraph->SetLineStyle(myLineStyle);
572   currentGraph->SetLineWidth(myLineWidth);
573   currentGraph->SetFillStyle(myFillStyle);
574   currentGraph->SetFillColor(myFillColor);
575 }