]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/macros/Plot_plots.C
(For the train) small change in the macro with parameters.
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Plot_plots.C
1 #include <math.h>
2 #include <time.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <Riostream.h>
6
7 #include "TVector2.h"
8 #include "TFile.h"
9 #include "TString.h"
10 #include "TF1.h"
11 #include "TH1.h"
12 #include "TH2.h"
13 #include "TH3.h"
14 #include "TProfile.h"
15 #include "TProfile2D.h"
16 #include "TMath.h"
17 #include "TText.h"
18 #include "TRandom3.h"
19 #include "TArray.h"
20 #include "TLegend.h"
21 #include "TStyle.h"
22 #include "TMinuit.h"
23
24 #define BohrR 1963.6885
25 #define FmToGeV 0.19733 // conversion to fm
26 #define PI 3.1415926
27 #define masspiC 0.1395702 // pi+ mass (GeV/c^2)
28
29 using namespace std;
30
31 bool TherminatorC2=kFALSE;
32 const int BOI_1=0;// centrality bin (0-9)
33 const int BOI_2=9;// centrality of second bin for C2 fit parameter plot only
34 const int ChProdBOI=0;// 0=SameCharge, 1=MixedCharge
35 const int KT3Bin=0;// Kt3 bin. 0=low Kt3 bin.  1=high Kt3 bin
36 //
37 const int CoulChoice=0;// 0 for GRS (default), 1 for Omega0
38
39 double MIN[10]={0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97};// C2 y-axis min
40 double MAX[10]={1.39, 1.38, 1.38, 1.38, 1.38, 1.38, 1.38, 1.38, 1.38, 1.53};// C2 y-axis max
41 //
42 const int KTBINS = 6;
43 int KTINDEX;
44 bool ChargeConstraint=kFALSE;
45 bool LinkRadii=kFALSE;
46 //
47 int TextFont=42;// 63, or 42
48 float SizeLabel=0.1;// 20(63 font), 0.08(42 font)
49 float SizeLegend=0.1;// .08
50 float SizeTitle=0.12;// 
51 float SizeSpecif=0.075;// 
52 float SF1=2/3.*0.95;
53 float SF2=1/2.*0.95;
54
55 double RightMargin=0.004;// 0.002
56 //
57 double Chi2_C2global;
58 double NFitPoints_C2global;
59 TH1D *C2_ss[KTBINS][10];
60 TH1D *C2_os[KTBINS][10];
61 TH1D *C2_ss_MomSys[KTBINS][10];
62 TH1D *C2_ss_KSys[KTBINS][10];
63 TH1D *C2_os_MomSys[KTBINS][10];
64 TH1D *C2_os_KSys[KTBINS][10];
65 TH1D *hfitC2ss_noG[KTBINS][10];
66 TH1D *hfitC2os_noG[KTBINS][10];
67 TF1 *fitC2ss_noG[KTBINS][10];
68 TF1 *fitC2os_noG[KTBINS][10];
69 TF1 *fitC2ss_yesG[KTBINS][10];
70 TF1 *fitC2os_yesG[KTBINS][10];
71 TF1 *fitC2ss_noGEWfromTherm[KTBINS][10];
72 TF1 *fitC2os_noGEWfromTherm[KTBINS][10];
73 TF1 *fitC2ss_yesGEWfromTherm[KTBINS][10];
74 TF1 *fitC2os_yesGEWfromTherm[KTBINS][10];
75 TF1 *fitC2ss_noGEW[KTBINS][10];
76 TF1 *fitC2os_noGEW[KTBINS][10];
77 TH1D *hfitC2ss_noGEW[KTBINS][10];
78 TH1D *hfitC2os_noGEW[KTBINS][10];
79 TH1D *K2_ss[KTBINS][10];
80 TH1D *K2_os[KTBINS][10];
81 TH1D *C2Therm_ss[KTBINS][10];
82 TH1D *C2Therm_os[KTBINS][10];
83 TF1 *fitC2ss_Therm[KTBINS][10];
84 TF1 *fitC2os_Therm[KTBINS][10];
85 TF1 *fitC2ss_ThermGaus[KTBINS][10];
86 TF1 *fitC2os_ThermGaus[KTBINS][10];
87
88
89 void DrawALICELogo(Bool_t, Float_t, Float_t, Float_t, Float_t);
90
91 void Plot_plots(){
92
93   gStyle->SetOptStat(0);
94   gStyle->SetOptDate(0);
95   
96
97   TFile *files_2_noG[KTBINS][10];
98   TFile *files_2_yesG[KTBINS][10];
99   TFile *files_2_noGEWfromTherm[KTBINS][10];
100   TFile *files_2_yesGEWfromTherm[KTBINS][10];
101   TFile *files_2_noGEW[KTBINS][10];
102   TFile *files_3[2][2][2][2][10];// SC/MC, +/-, GRS/Omega0, Therm/Gauss, MBINS
103   //
104   double intercept1[10]={0};
105   double intercept1_e[10]={0};
106   double intercept2[10]={0};
107   double intercept2_e[10]={0};
108   double ChiNDF1[10]={0};
109   double ChiNDF2[10]={0};
110   double cent_mean[10]={0};
111   double cent_mean_e[10]={0};
112
113   
114   TH1D *Chi2NDF_yesG[KTBINS][10];
115   TH1D *Chi2NDF_yesGEWfromTherm[KTBINS][10];
116   TH1D *Chi2NDF_noG[KTBINS][10];
117   TH1D *Chi2NDF_noGEWfromTherm[KTBINS][10];
118   TH1D *Cterm1;
119   TH1D *C3[2][2][2][10];// SC/MC, GRS/Omega0, Therm/Gauss, cb
120   TH1D *c3[2][2][2][10];// SC/MC, GRS/Omega0, Therm/Gauss, cb
121   TH1D *r3_Q3[2][2][10];// GRS/Omega0, Therm/Gauss, cb
122   TH1D *C3EW[2][2][10];//  GRS/Omega0, Therm/Gauss, cb
123   TH1D *K3[2][2][2][10];// SC/MC, GRS/Omega0, Therm/Gauss, cb
124   //
125   TH1D *ParHisto_ch[4][10];
126   TH1D *ParHisto_coh[4][10];
127   TH1D *ParHisto_chEWfromTherm[4][10];
128   TH1D *ParHisto_cohEWfromTherm[4][10];
129   TH1D *ParHisto_chEW[4][10];
130
131   for(int ii=0; ii<10; ii++){
132     for(int par=1; par<=4; par++){
133       TString *name_ch = new TString("ParHisto_ch");
134       *name_ch += ii; *name_ch += par;
135       TString *name_coh = new TString("ParHisto_coh");
136       *name_coh += ii; *name_coh += par;
137       TString *name_EWfromThermch = new TString("ParHisto_EWfromThermch");
138       *name_EWfromThermch += ii; *name_EWfromThermch += par;
139       TString *name_EWch = new TString("ParHisto_EWch");
140       *name_EWch += ii; *name_EWch += par;
141       TString *name_EWcoh = new TString("ParHisto_EWcoh");
142       *name_EWcoh += ii; *name_EWcoh += par;
143       
144       int MStyle_ch, MStyle_coh;
145       if(ii==BOI_1) {MStyle_ch = 20; MStyle_coh = 24;}
146       else {MStyle_ch = 22; MStyle_coh = 26;}
147       
148       ParHisto_ch[par-1][ii] = new TH1D(name_ch->Data(),"",10,0,1);
149       ParHisto_ch[par-1][ii]->SetMarkerStyle(MStyle_ch);
150       ParHisto_ch[par-1][ii]->SetMarkerColor(1);
151       ParHisto_ch[par-1][ii]->SetLineColor(1);
152       ParHisto_ch[par-1][ii]->SetMarkerSize(1.5);
153       ParHisto_coh[par-1][ii] = new TH1D(name_coh->Data(),"",10,0,1);
154       ParHisto_coh[par-1][ii]->SetMarkerStyle(MStyle_coh);
155       ParHisto_coh[par-1][ii]->SetMarkerColor(4);
156       ParHisto_coh[par-1][ii]->SetLineColor(4);
157       ParHisto_coh[par-1][ii]->SetMarkerSize(1.5);
158       ParHisto_chEWfromTherm[par-1][ii] = new TH1D(name_EWfromThermch->Data(),"",10,0,1);
159       ParHisto_chEWfromTherm[par-1][ii]->SetMarkerStyle(MStyle_ch);
160       ParHisto_chEWfromTherm[par-1][ii]->SetMarkerColor(1);
161       ParHisto_chEWfromTherm[par-1][ii]->SetLineColor(1);
162       ParHisto_chEWfromTherm[par-1][ii]->SetMarkerSize(1.5);
163       ParHisto_chEW[par-1][ii] = new TH1D(name_EWch->Data(),"",10,0,1);
164       ParHisto_chEW[par-1][ii]->SetMarkerStyle(MStyle_coh);
165       ParHisto_chEW[par-1][ii]->SetMarkerColor(4);
166       ParHisto_chEW[par-1][ii]->SetLineColor(4);
167       ParHisto_chEW[par-1][ii]->SetMarkerSize(1.5);
168       ParHisto_cohEWfromTherm[par-1][ii] = new TH1D(name_EWcoh->Data(),"",10,0,1);
169       ParHisto_cohEWfromTherm[par-1][ii]->SetMarkerStyle(MStyle_coh);
170       ParHisto_cohEWfromTherm[par-1][ii]->SetMarkerColor(4);
171       ParHisto_cohEWfromTherm[par-1][ii]->SetLineColor(4);
172       ParHisto_cohEWfromTherm[par-1][ii]->SetMarkerSize(1.5);
173     }
174   }
175   //////////////////////////////
176
177   // Start File access
178   for(int cb=0; cb<10; cb++){
179     for(int ChComb=0; ChComb<2; ChComb++) {// SC or MC
180       for(int ch=0; ch<2; ch++) {// - or +
181         for(int KT3=0; KT3<2; KT3++) {// Kt3 bin
182           TString *name3 = new TString("OutFiles/OutFile");
183           if(ChComb==0) name3->Append("SC");
184           else name3->Append("MC");
185           if(ch==0) name3->Append("Neg");
186           else name3->Append("Pos");
187           TString *name3_Omega0=new TString(name3->Data());
188           name3->Append("NoGEWGRS");
189           name3_Omega0->Append("NoGEWOmega0");
190           name3->Append("Kt3_"); name3_Omega0->Append("Kt3_"); 
191           *name3 += KT3+1; *name3_Omega0 += KT3+1;
192           
193           name3->Append("_Kt10_M");
194           name3_Omega0->Append("_Kt10_M");
195           if(cb<10) {*name3 += cb; *name3_Omega0 += cb;}
196           else {*name3 += 0; *name3_Omega0 += 0;}
197           name3->Append(".root");
198           name3_Omega0->Append(".root");
199           files_3[ChComb][ch][0][KT3][cb] = new TFile(name3->Data(),"READ");
200           files_3[ChComb][ch][1][KT3][cb] = new TFile(name3_Omega0->Data(),"READ");
201           ///////////////////////////////
202           for(int Coul=0; Coul<2; Coul++){
203             if(ch==0) {
204               C3[ChComb][Coul][KT3][cb]=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("C3");
205               C3[ChComb][Coul][KT3][cb]->SetDirectory(0);
206               c3[ChComb][Coul][KT3][cb]=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("c3");
207               c3[ChComb][Coul][KT3][cb]->SetDirectory(0);
208               if(ChComb==0) C3EW[Coul][KT3][cb]=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("C3_EWexpectation");
209               if(ChComb==0) r3_Q3[Coul][KT3][cb]=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("r3_Q3");
210               C3EW[Coul][KT3][cb]->SetDirectory(0);
211               r3_Q3[Coul][KT3][cb]->SetDirectory(0);
212               
213               if(Coul==1){
214                 K3[ChComb][0][KT3][cb]=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("Coul_GRiverside");
215                 K3[ChComb][0][KT3][cb]->SetDirectory(0);
216                 K3[ChComb][1][KT3][cb]=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("Coul_Omega0");
217                 K3[ChComb][1][KT3][cb]->SetDirectory(0);
218               }
219             }else{
220               TH1D *tempC3=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("C3");
221               TH1D *tempc3=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("c3");
222               TH1D *tempC3EW=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("C3_EWexpectation");
223               TH1D *tempr3_Q3;
224               if(ChComb==0) tempr3_Q3=(TH1D*)files_3[ChComb][ch][Coul][KT3][cb]->Get("r3_Q3");
225               for(int bin=1; bin<=tempC3->GetNbinsX(); bin++){
226                 double valueC3 = (C3[ChComb][Coul][KT3][cb]->GetBinContent(bin) + tempC3->GetBinContent(bin))/2.;
227                 double valueC3_e = sqrt(pow(C3[ChComb][Coul][KT3][cb]->GetBinError(bin),2)+pow(tempC3->GetBinError(bin),2))/sqrt(2.);
228                 double valuec3 = (c3[ChComb][Coul][KT3][cb]->GetBinContent(bin) + tempc3->GetBinContent(bin))/2.;
229                 double valuec3_e = sqrt(pow(c3[ChComb][Coul][KT3][cb]->GetBinError(bin),2)+pow(tempc3->GetBinError(bin),2))/sqrt(2.);
230                 C3[ChComb][Coul][KT3][cb]->SetBinContent(bin, valueC3);
231                 C3[ChComb][Coul][KT3][cb]->SetBinError(bin, valueC3_e);
232                 c3[ChComb][Coul][KT3][cb]->SetBinContent(bin, valuec3);
233                 c3[ChComb][Coul][KT3][cb]->SetBinError(bin, valuec3_e);
234                 if(Coul==0) {c3[ChComb][Coul][KT3][cb]->SetMarkerStyle(20); c3[ChComb][Coul][KT3][cb]->SetMarkerColor(4); c3[ChComb][Coul][KT3][cb]->SetLineColor(4);}
235                 else {c3[ChComb][Coul][KT3][cb]->SetMarkerStyle(22); c3[ChComb][Coul][KT3][cb]->SetMarkerColor(2); c3[ChComb][Coul][KT3][cb]->SetLineColor(2);}
236                 c3[ChComb][Coul][KT3][cb]->GetYaxis()->SetTitleOffset(1.2);
237                 if(ChComb==1){
238                   c3[ChComb][Coul][KT3][cb]->SetMinimum(0.96);// 0.99
239                   c3[ChComb][Coul][KT3][cb]->SetMaximum(1.02);// 1.02
240                   c3[ChComb][Coul][KT3][cb]->GetXaxis()->SetRangeUser(0,0.13);
241                   c3[ChComb][Coul][KT3][cb]->GetYaxis()->SetTitleOffset(1.2);
242                   c3[ChComb][Coul][KT3][cb]->GetYaxis()->SetTitleSize(.05);
243                 }
244                 
245                 if(ChComb==0) {// only same-charge for r3
246                   double valuer3_Q3 = (r3_Q3[Coul][KT3][cb]->GetBinContent(bin) + tempr3_Q3->GetBinContent(bin))/2.;
247                   double valuer3_Q3_e = sqrt(pow(r3_Q3[Coul][KT3][cb]->GetBinError(bin),2) + pow(tempr3_Q3->GetBinError(bin),2))/sqrt(2.);
248                   double valueC3EW = (C3EW[Coul][KT3][cb]->GetBinContent(bin) + tempC3EW->GetBinContent(bin))/2.;
249                   double valueC3EW_e = sqrt(pow(C3EW[Coul][KT3][cb]->GetBinError(bin),2)+pow(tempC3EW->GetBinError(bin),2))/sqrt(2.);
250                   C3EW[Coul][KT3][cb]->SetBinContent(bin, valueC3EW);
251                   C3EW[Coul][KT3][cb]->SetBinError(bin, valueC3EW_e);
252                   r3_Q3[Coul][KT3][cb]->SetBinContent(bin, valuer3_Q3);
253                   r3_Q3[Coul][KT3][cb]->SetBinError(bin, valuer3_Q3_e);
254                   r3_Q3[Coul][KT3][cb]->GetXaxis()->SetRangeUser(0,0.14);
255                   if(cb<2) r3_Q3[Coul][KT3][cb]->SetMinimum(-3);
256                   else r3_Q3[Coul][KT3][cb]->SetMinimum(-0.5);
257                   r3_Q3[Coul][KT3][cb]->SetMaximum(2.6);
258                   if(Coul==0) {r3_Q3[Coul][KT3][cb]->SetMarkerStyle(20); r3_Q3[Coul][KT3][cb]->SetMarkerColor(4); r3_Q3[Coul][KT3][cb]->SetLineColor(4);}
259                   else {r3_Q3[Coul][KT3][cb]->SetMarkerStyle(22); r3_Q3[Coul][KT3][cb]->SetMarkerColor(2); r3_Q3[Coul][KT3][cb]->SetLineColor(2);}
260                 }
261               }
262             }
263             files_3[ChComb][ch][Coul][KT3][cb]->Close();
264           }// Coul
265         }
266       }
267     }
268   
269   
270     for(int kt=0; kt<KTBINS; kt++){
271       
272       TString *name = new TString("OutFiles/OutFileSCPosNoG"); 
273       TString *nameEWfromTherm = new TString(name->Data()); nameEWfromTherm->Append("EWfromThermGRS");
274       TString *nameEW = new TString(name->Data()); nameEW->Append("EWGRS");
275       name->Append("GRS");
276       name->Append("Kt3_1"); nameEWfromTherm->Append("Kt3_1"); nameEW->Append("Kt3_1");
277       name->Append("_Kt"); nameEWfromTherm->Append("_Kt"); nameEW->Append("_Kt");
278       *name += kt+1; *nameEWfromTherm += kt+1; *nameEW += kt+1;
279       name->Append("_M"); nameEWfromTherm->Append("_M"); nameEW->Append("_M");
280       if(cb<10) {*name += cb; *nameEWfromTherm += cb; *nameEW += cb;}
281       else {*name += 0; *nameEWfromTherm += 0; *nameEW += 0;}
282       name->Append(".root"); nameEWfromTherm->Append(".root"); nameEW->Append(".root");
283       files_2_noG[kt][cb] = new TFile(name->Data(),"READ");
284       files_2_noGEWfromTherm[kt][cb] = new TFile(nameEWfromTherm->Data(),"READ");
285       files_2_noGEW[kt][cb] = new TFile(nameEW->Data(),"READ");
286       //
287       
288       //
289       TString *nameYesG = new TString("OutFiles/OutFileSCPosYesG"); 
290       TString *nameYesGEWfromTherm = new TString(nameYesG->Data()); nameYesGEWfromTherm->Append("EWfromThermGRS");
291       nameYesG->Append("GRS");
292       nameYesG->Append("Kt3_1"); nameYesGEWfromTherm->Append("Kt3_1");
293       nameYesG->Append("_Kt"); nameYesGEWfromTherm->Append("_Kt");
294       *nameYesG += kt+1; *nameYesGEWfromTherm += kt+1;
295       nameYesG->Append("_M"); nameYesGEWfromTherm->Append("_M");
296       if(cb<10) {*nameYesG += cb; *nameYesGEWfromTherm += cb;}
297       else {*nameYesG += 0; *nameYesGEWfromTherm += 0;}
298       nameYesG->Append(".root"); nameYesGEWfromTherm->Append(".root");
299       files_2_yesG[kt][cb] = new TFile(nameYesG->Data(),"READ");
300       files_2_yesGEWfromTherm[kt][cb] = new TFile(nameYesGEWfromTherm->Data(),"READ");
301       //////////////////////////////////////////
302
303       TString *Centname = new TString("Centrality ");
304       *Centname += (cb)*5;
305       Centname->Append("-");
306       *Centname += (cb+1)*5;
307       Centname->Append("%");
308       
309       
310       C2_ss[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2_ss"); C2_ss[kt][cb]->SetDirectory(0);
311       C2_os[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2_os"); C2_os[kt][cb]->SetDirectory(0);
312       C2_ss_MomSys[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2_ss_Momsys"); C2_ss_MomSys[kt][cb]->SetDirectory(0);
313       C2_os_MomSys[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2_os_Momsys"); C2_os_MomSys[kt][cb]->SetDirectory(0);
314       C2_ss_KSys[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2_ss_Ksys"); C2_ss_KSys[kt][cb]->SetDirectory(0);
315       C2_os_KSys[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2_os_Ksys"); C2_os_KSys[kt][cb]->SetDirectory(0);
316       fitC2ss_noG[kt][cb] = (TF1*)files_2_noG[kt][cb]->Get("fitC2ss");
317       fitC2os_noG[kt][cb] = (TF1*)files_2_noG[kt][cb]->Get("fitC2os");
318       hfitC2ss_noG[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("fitC2ss_h"); hfitC2ss_noG[kt][cb]->SetDirectory(0);
319       hfitC2os_noG[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("fitC2os_h"); hfitC2os_noG[kt][cb]->SetDirectory(0);
320       fitC2ss_yesG[kt][cb] = (TF1*)files_2_yesG[kt][cb]->Get("fitC2ss");
321       fitC2os_yesG[kt][cb] = (TF1*)files_2_yesG[kt][cb]->Get("fitC2os");
322       fitC2ss_noGEW[kt][cb] = (TF1*)files_2_noGEW[kt][cb]->Get("fitC2ss");
323       fitC2os_noGEW[kt][cb] = (TF1*)files_2_noGEW[kt][cb]->Get("fitC2os");
324       hfitC2ss_noGEW[kt][cb] = (TH1D*)files_2_noGEW[kt][cb]->Get("fitC2ss_h"); hfitC2ss_noGEW[kt][cb]->SetDirectory(0);
325       hfitC2os_noGEW[kt][cb] = (TH1D*)files_2_noGEW[kt][cb]->Get("fitC2os_h"); hfitC2os_noGEW[kt][cb]->SetDirectory(0);
326       fitC2ss_noGEWfromTherm[kt][cb] = (TF1*)files_2_noGEWfromTherm[kt][cb]->Get("fitC2ss");
327       fitC2os_noGEWfromTherm[kt][cb] = (TF1*)files_2_noGEWfromTherm[kt][cb]->Get("fitC2os");
328       fitC2ss_yesGEWfromTherm[kt][cb] = (TF1*)files_2_yesGEWfromTherm[kt][cb]->Get("fitC2ss");
329       fitC2os_yesGEWfromTherm[kt][cb] = (TF1*)files_2_yesGEWfromTherm[kt][cb]->Get("fitC2os");
330       fitC2ss_Therm[kt][cb] = (TF1*)files_2_noGEWfromTherm[kt][cb]->Get("fitC2ssTherm");
331       fitC2os_Therm[kt][cb] = (TF1*)files_2_noGEWfromTherm[kt][cb]->Get("fitC2osTherm");
332       fitC2ss_ThermGaus[kt][cb] = (TF1*)files_2_noGEWfromTherm[kt][cb]->Get("fitC2ssThermGaus");
333       fitC2os_ThermGaus[kt][cb] = (TF1*)files_2_noGEWfromTherm[kt][cb]->Get("fitC2osThermGaus");
334       K2_ss[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("K2_ss"); K2_ss[kt][cb]->SetDirectory(0);
335       K2_os[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("K2_os"); K2_os[kt][cb]->SetDirectory(0);
336       C2Therm_ss[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2Therm_ss"); C2Therm_ss[kt][cb]->SetDirectory(0);
337       C2Therm_os[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("C2Therm_os"); C2Therm_os[kt][cb]->SetDirectory(0);
338       Chi2NDF_noG[kt][cb] = (TH1D*)files_2_noG[kt][cb]->Get("ChiSquaredNDF"); Chi2NDF_noG[kt][cb]->SetDirectory(0);
339       Chi2NDF_noGEWfromTherm[kt][cb] = (TH1D*)files_2_noGEWfromTherm[kt][cb]->Get("ChiSquaredNDF"); Chi2NDF_noGEWfromTherm[kt][cb]->SetDirectory(0);
340       Chi2NDF_yesG[kt][cb] = (TH1D*)files_2_yesG[kt][cb]->Get("ChiSquaredNDF"); Chi2NDF_yesG[kt][cb]->SetDirectory(0);
341       Chi2NDF_yesGEWfromTherm[kt][cb] = (TH1D*)files_2_yesGEWfromTherm[kt][cb]->Get("ChiSquaredNDF"); Chi2NDF_yesGEWfromTherm[kt][cb]->SetDirectory(0);
342       
343       //
344       for(int par=1; par<=4; par++){
345         //if(par!=4 && par!=2) 
346         ParHisto_ch[par-1][cb]->SetBinContent(kt+3, fitC2ss_noG[kt][cb]->GetParameter(par));
347         ParHisto_ch[par-1][cb]->SetBinError(kt+3, fitC2ss_noG[kt][cb]->GetParError(par));
348         ParHisto_coh[par-1][cb]->SetBinContent(kt+3, fitC2ss_yesG[kt][cb]->GetParameter(par));
349         ParHisto_coh[par-1][cb]->SetBinError(kt+3, fitC2ss_yesG[kt][cb]->GetParError(par));
350         //if(par!=4 && par!=2) 
351         ParHisto_chEWfromTherm[par-1][cb]->SetBinContent(kt+3, fitC2ss_noGEWfromTherm[kt][cb]->GetParameter(par));
352         ParHisto_chEWfromTherm[par-1][cb]->SetBinError(kt+3, fitC2ss_noGEWfromTherm[kt][cb]->GetParError(par));
353         ParHisto_cohEWfromTherm[par-1][cb]->SetBinContent(kt+3, fitC2ss_yesGEWfromTherm[kt][cb]->GetParameter(par));
354         ParHisto_cohEWfromTherm[par-1][cb]->SetBinError(kt+3, fitC2ss_yesGEWfromTherm[kt][cb]->GetParError(par));
355         ParHisto_chEW[par-1][cb]->SetBinContent(kt+3, fitC2ss_noGEW[kt][cb]->GetParameter(par));
356         ParHisto_chEW[par-1][cb]->SetBinError(kt+3, fitC2ss_noGEW[kt][cb]->GetParError(par));
357       }
358       //////////////////////////////////////
359       files_2_noG[kt][cb]->Close();
360       files_2_noGEWfromTherm[kt][cb]->Close();
361       files_2_noGEW[kt][cb]->Close();
362       files_2_yesG[kt][cb]->Close();
363       files_2_yesGEWfromTherm[kt][cb]->Close();
364     }// kt loop
365   }
366   
367  
368   TF1 *Unity = new TF1("Unity","1",0,100);
369   Unity->SetLineStyle(2);
370   Unity->SetLineColor(1);
371
372  
373  
374
375   // merge C3 histogram centralities
376   TH1D *C3merged[2][2][2][6];// SC/MC, GRS/Omega0, Therm/Gauss, cb_merged
377   TH1D *c3merged[2][2][2][6];// SC/MC, GRS/Omega0, Therm/Gauss, cb_merged
378   TH1D *r3merged[2][2][6];// GRS/Omega0, Therm/Gauss, cb_merged
379   for(int Coul=0; Coul<2; Coul++){// GRS or Omega0
380     for(int ChComb=0; ChComb<2; ChComb++) {
381       for(int KT3=0; KT3<2; KT3++) {// Therminator or Gaussian FSI source
382         for(int cb=0; cb<6; cb++){
383           C3merged[ChComb][Coul][KT3][cb]=(TH1D*)C3[ChComb][Coul][KT3][cb]->Clone();
384           c3merged[ChComb][Coul][KT3][cb]=(TH1D*)c3[ChComb][Coul][KT3][cb]->Clone();
385           if(ChComb==0) r3merged[Coul][KT3][cb]=(TH1D*)r3_Q3[Coul][KT3][cb]->Clone();
386         }      
387       }
388     }
389   }
390
391   for(int MergedBin=0; MergedBin<4; MergedBin++){
392     for(int Coul=0; Coul<2; Coul++){// GRS or Omega0
393       for(int ChComb=0; ChComb<2; ChComb++) {
394         for(int KT3=0; KT3<2; KT3++) {// Therminator or Gaussian FSI source
395           for(int bin=1; bin<=C3[0][Coul][KT3][0]->GetNbinsX(); bin++){
396             int startbin = MergedBin*2 + 2;
397          
398             double valueC3 = C3[ChComb][Coul][KT3][startbin]->GetBinContent(bin) + C3[ChComb][Coul][KT3][startbin+1]->GetBinContent(bin);
399             valueC3 /= 2.;
400             double valueC3_e = pow(C3[ChComb][Coul][KT3][startbin]->GetBinError(bin),2) + pow(C3[ChComb][Coul][KT3][startbin+1]->GetBinError(bin),2);
401             valueC3_e = sqrt(valueC3_e);
402             valueC3_e /= 2.;
403             double valuec3 = c3[ChComb][Coul][KT3][startbin]->GetBinContent(bin) + c3[ChComb][Coul][KT3][startbin+1]->GetBinContent(bin);
404             valuec3 /= 2.;
405             double valuec3_e = pow(c3[ChComb][Coul][KT3][startbin]->GetBinError(bin),2) + pow(c3[ChComb][Coul][KT3][startbin+1]->GetBinError(bin),2);
406             valuec3_e = sqrt(valuec3_e);
407             valuec3_e /= 2.;
408             //
409             C3merged[ChComb][Coul][KT3][MergedBin+2]->SetBinContent(bin, valueC3);
410             C3merged[ChComb][Coul][KT3][MergedBin+2]->SetBinError(bin, valueC3_e);
411             c3merged[ChComb][Coul][KT3][MergedBin+2]->SetBinContent(bin, valuec3);
412             c3merged[ChComb][Coul][KT3][MergedBin+2]->SetBinError(bin, valuec3_e);
413             if(ChComb==0){
414               double valueC3EW = C3EW[Coul][KT3][startbin]->GetBinContent(bin) + C3EW[Coul][KT3][startbin+1]->GetBinContent(bin);
415               valueC3EW /= 2.;
416               double valueC3EW_e = pow(C3EW[Coul][KT3][startbin]->GetBinError(bin),2) + pow(C3EW[Coul][KT3][startbin+1]->GetBinError(bin),2);
417               valueC3EW_e = sqrt(valueC3EW_e);
418               valueC3EW_e /= 2.;
419               double valuer3_Q3 = r3_Q3[Coul][KT3][startbin]->GetBinContent(bin) + r3_Q3[Coul][KT3][startbin+1]->GetBinContent(bin);
420               valuer3_Q3 /= 2.;
421               double valuer3_Q3_e = pow(r3_Q3[Coul][KT3][startbin]->GetBinError(bin),2) + pow(r3_Q3[Coul][KT3][startbin+1]->GetBinError(bin),2);
422               valuer3_Q3_e = sqrt(valuer3_Q3_e);
423               valuer3_Q3_e /= 2.;
424               r3merged[Coul][KT3][MergedBin+2]->SetBinContent(bin, valuer3_Q3);
425               r3merged[Coul][KT3][MergedBin+2]->SetBinError(bin, valuer3_Q3_e);
426               C3EW[Coul][KT3][MergedBin+2]->SetBinContent(bin, valueC3EW);
427               C3EW[Coul][KT3][MergedBin+2]->SetBinError(bin, valueC3EW_e);
428             }
429             //
430           }
431         }// KT3
432       }
433     }
434   }// Merged Bin
435
436
437
438   //////////////////////////////////////////////////////////////////////////
439   // Draw K3 factors
440   TCanvas *canK3 = new TCanvas("canK3", "canK3",10,0,600,900);// 11,53,700,500
441   canK3->SetHighLightColor(2);
442   //canK3->Range(-0.7838115,-1.033258,0.7838115,1.033258);
443   gStyle->SetOptFit(0111);
444   canK3->SetFillColor(0);//10
445   canK3->SetBorderMode(0);
446   canK3->SetBorderSize(2);
447   canK3->SetFrameFillColor(0);
448   canK3->SetFrameBorderMode(0);
449   canK3->SetFrameBorderMode(0);
450   
451   TPad *padK3 = new TPad("padK3","padK3",0.0,0.0,1.,1.);
452   gPad->SetGridx(0);
453   gPad->SetGridy(0);
454   gPad->SetTickx();
455   gPad->SetTicky();
456   padK3->SetTopMargin(0.02);//0.05
457   padK3->SetRightMargin(0.01);//1e-2
458   padK3->SetBottomMargin(0.07);//0.12
459   padK3->Divide(1,2,0,0);
460   padK3->Draw();
461   padK3->cd(1);
462   gPad->SetLeftMargin(0.14);
463   gPad->SetRightMargin(0.03);
464   //double Dim1=gPad->GetAbsHNDC();
465   //cout<<gPad->GetAbsHNDC()<<endl;
466   //cout<<gPad->GetAspectRatio()<<endl;
467   TLegend *legendK3 = new TLegend(.45,.05,.95,.3,NULL,"brNDC");
468   legendK3->SetBorderSize(0);
469   legendK3->SetTextSize(SizeLabel*SF1);// *2/3.*0.96
470   legendK3->SetFillColor(0);
471
472   K3[0][1][KT3Bin][BOI_1]->SetMinimum(0.48);
473   K3[0][1][KT3Bin][BOI_1]->SetMaximum(1.33);
474
475   K3[0][1][KT3Bin][BOI_1]->SetMarkerStyle(20);
476   K3[0][1][KT3Bin][BOI_1]->SetMarkerColor(2);
477   K3[0][0][KT3Bin][BOI_1]->SetMarkerStyle(24);
478   K3[0][0][KT3Bin][BOI_1]->SetMarkerColor(2);
479   K3[1][1][KT3Bin][BOI_1]->SetMarkerStyle(22);
480   K3[1][1][KT3Bin][BOI_1]->SetMarkerColor(4);
481   K3[1][0][KT3Bin][BOI_1]->SetMarkerStyle(26);
482   K3[1][0][KT3Bin][BOI_1]->SetMarkerColor(4);
483   //
484   K3[0][1][KT3Bin][BOI_1]->GetXaxis()->SetLabelFont(TextFont); K3[0][1][KT3Bin][BOI_1]->GetYaxis()->SetLabelFont(TextFont);
485   K3[0][1][KT3Bin][BOI_1]->GetXaxis()->SetLabelSize(SizeLabel*SF1); K3[0][1][KT3Bin][BOI_1]->GetYaxis()->SetLabelSize(SizeLabel*SF1);
486   K3[0][1][KT3Bin][BOI_1]->GetXaxis()->SetNdivisions(808); K3[0][1][KT3Bin][BOI_1]->GetYaxis()->SetNdivisions(909);
487   TGaxis::SetMaxDigits(3); 
488   K3[0][1][KT3Bin][BOI_1]->GetYaxis()->SetTitleFont(TextFont);
489   K3[0][1][KT3Bin][BOI_1]->GetYaxis()->SetTitleSize(SizeTitle*SF1);
490   K3[0][1][KT3Bin][BOI_1]->GetYaxis()->SetTitle("#font[12]{K_{3}}");
491   K3[0][1][KT3Bin][BOI_1]->GetYaxis()->SetTitleOffset(0.8);
492
493   //
494   K3[0][1][KT3Bin][BOI_1]->Draw();
495   K3[0][0][KT3Bin][BOI_1]->Draw("same");
496   K3[1][1][KT3Bin][BOI_1]->Draw("same");
497   K3[1][0][KT3Bin][BOI_1]->Draw("same");
498   Unity->Draw("same");
499   legendK3->AddEntry(K3[0][1][KT3Bin][BOI_1],"same-charge, #Omega_{0}","p");
500   legendK3->AddEntry(K3[0][0][KT3Bin][BOI_1],"same-charge, GRS","p");
501   legendK3->AddEntry(K3[1][1][KT3Bin][BOI_1],"mixed-charge, #Omega_{0}","p");
502   legendK3->AddEntry(K3[1][0][KT3Bin][BOI_1],"mixed-charge, GRS","p");
503   legendK3->Draw("same");
504   //TLatex *K3Label = new TLatex(0.02,1.25,"K_{3}");// -0.011,0.92 (ss), 1.26 (os)
505   //K3Label->SetTextFont(TextFont);
506   //K3Label->SetTextSize(SizeTitle*SF1);
507   //K3Label->SetTextAngle(90);
508   //K3Label->Draw();
509   //
510   padK3->cd(2);
511   double SF_correction=0.97;
512   gPad->SetLeftMargin(0.14);
513   gPad->SetRightMargin(0.03);
514   gPad->SetBottomMargin(0.16);
515   //double Dim2=gPad->GetAbsHNDC();
516   TLegend *legendK3comp = new TLegend(.45,.8,.95,.95,NULL,"brNDC");
517   legendK3comp->SetBorderSize(0);
518   legendK3comp->SetTextSize(SizeLabel*SF1*SF_correction);// small .03; large .06
519   legendK3comp->SetFillColor(0);
520
521   TH1D *K3sc_compOmega0 = (TH1D*)K3[0][1][KT3Bin][BOI_1]->Clone();
522   TH1D *K3sc_compGRS = (TH1D*)K3[0][0][KT3Bin][BOI_1]->Clone();
523   TH1D *K3mc_compOmega0 = (TH1D*)K3[1][1][KT3Bin][BOI_1]->Clone();
524   TH1D *K3mc_compGRS = (TH1D*)K3[1][0][KT3Bin][BOI_1]->Clone();
525   for(int ii=0; ii<K3sc_compOmega0->GetNbinsX(); ii++){ 
526     K3sc_compOmega0->SetBinContent(ii+1, K3sc_compOmega0->GetBinContent(ii+1)-1.0);
527     K3sc_compGRS->SetBinContent(ii+1, K3sc_compGRS->GetBinContent(ii+1)-1.0);
528     K3mc_compOmega0->SetBinContent(ii+1, K3mc_compOmega0->GetBinContent(ii+1)-1.0);
529     K3mc_compGRS->SetBinContent(ii+1, K3mc_compGRS->GetBinContent(ii+1)-1.0);
530   }
531   K3sc_compOmega0->Add(K3sc_compGRS,-1);
532   K3sc_compOmega0->Divide(K3sc_compGRS);
533   K3mc_compOmega0->Add(K3mc_compGRS,-1);
534   K3mc_compOmega0->Divide(K3mc_compGRS);
535   K3sc_compOmega0->SetMarkerStyle(20);
536   K3sc_compOmega0->SetMarkerColor(2);
537   K3sc_compOmega0->SetLineColor(2);
538   K3mc_compOmega0->SetMarkerStyle(24);
539   K3mc_compOmega0->SetMarkerColor(4);
540   K3mc_compOmega0->SetLineColor(4);
541   K3sc_compOmega0->SetMinimum(-0.12);// -0.021
542   K3sc_compOmega0->SetMaximum(0.12);// 0.021
543   K3sc_compOmega0->SetBinContent(1,-100); K3mc_compOmega0->SetBinContent(1,-100);
544   K3sc_compOmega0->GetYaxis()->SetNdivisions(404);
545   K3sc_compOmega0->GetYaxis()->SetTitleFont(TextFont); K3sc_compOmega0->GetYaxis()->SetTitleSize(SizeTitle*SF1*SF_correction);
546   //K3sc_compOmega0->GetXaxis()->SetTitleFont(TextFont); K3sc_compOmega0->GetXaxis()->SetTitleSize(SizeTitle*2/3.*.96);
547   //K3sc_compOmega0->GetXaxis()->SetTitle("Q_{3} (GeV/c)");
548   K3sc_compOmega0->GetYaxis()->SetTitle("#Delta#font[12]{K_{3} / (K_{3}}(#Omega_{0})-1)");
549   K3sc_compOmega0->GetXaxis()->SetTitleOffset(1.2); K3sc_compOmega0->GetYaxis()->SetTitleOffset(0.8);
550   K3sc_compOmega0->Draw();
551   K3mc_compOmega0->Draw("same");
552   TF1 *Zero=new TF1("Zero","0",0,1);
553   Zero->SetLineStyle(2); Zero->SetLineColor(1);
554   Zero->Draw("same");
555   legendK3comp->AddEntry(K3sc_compOmega0,"same-charge","p");
556   legendK3comp->AddEntry(K3mc_compOmega0,"mixed-charge","p");
557   legendK3comp->Draw("same");
558   //TLatex *RatioLabel = new TLatex(-.011,0.02,"#Delta K_{3}/(K_{3}(#Omega_{0})-1)");// -0.011,0.04
559   //RatioLabel->SetTextFont(TextFont);
560   //RatioLabel->SetTextSize(SizeTitle*SF1);
561   //RatioLabel->SetTextAngle(90);
562   //RatioLabel->Draw();
563
564   TLatex *Q3Label = new TLatex(.071,-0.155,"#font[12]{Q}_{3} (GeV/#font[12]{c})");//.065,-0.147
565   Q3Label->SetTextFont(TextFont);
566   Q3Label->SetTextSize(SizeTitle*SF1);// 0.08
567   Q3Label->Draw();
568
569
570
571  
572   
573   //////////////////////////////////////////
574   // print global fit values
575
576   // kappa3 and kappa4
577   cout<<"ALICE EW"<<endl;
578   cout<<"kappa3"<<endl;
579   for(int cb=0; cb<10; cb++){
580     if(cb!=0 && cb!=9) continue;
581     TString *Cname = new TString("$");
582     *Cname += cb*5; Cname->Append("-");
583     *Cname += (cb+1)*5; Cname->Append("\\%$");
584     cout<<Cname->Data()<<" & ";
585     cout.precision(2);
586     for(int kt=0; kt<KTBINS; kt++) {
587       cout<<fitC2ss_noGEW[kt][cb]->GetParameter(5)<<" ";
588       if((kt+1)!=KTBINS) cout<<"& ";
589       else cout<<" \\\\\ \\hline";
590     }
591     cout<<endl;
592   }
593   //
594   cout<<"kappa4"<<endl;
595   for(int cb=0; cb<10; cb++){
596     if(cb!=0 && cb!=9) continue;
597     TString *Cname = new TString("$");
598     *Cname += cb*5; Cname->Append("-");
599     *Cname += (cb+1)*5; Cname->Append("\\%$");
600     cout<<Cname->Data()<<" & ";
601     cout.precision(2);
602     for(int kt=0; kt<KTBINS; kt++) {
603       cout<<fitC2ss_noGEW[kt][cb]->GetParameter(6)<<" ";
604       if((kt+1)!=KTBINS) cout<<"& ";
605       else cout<<" \\\\\ \\hline";
606     }
607     cout<<endl;
608   }
609   // Therminator
610   cout<<"Therminator EW"<<endl;
611   cout<<"kappa3"<<endl;
612   for(int cb=0; cb<10; cb++){
613     if(cb!=0 && cb!=9) continue;
614     TString *Cname = new TString("$");
615     *Cname += cb*5; Cname->Append("-");
616     *Cname += (cb+1)*5; Cname->Append("\\%$");
617     cout<<Cname->Data()<<" & ";
618     cout.precision(2);
619     for(int kt=0; kt<KTBINS; kt++) {
620       cout<<fitC2ss_noGEWfromTherm[kt][cb]->GetParameter(5)<<" ";
621       if((kt+1)!=KTBINS) cout<<"& ";
622       else cout<<" \\\\\ \\hline";
623     }
624     cout<<endl;
625   }
626   //
627   cout<<"kappa4"<<endl;
628   for(int cb=0; cb<10; cb++){
629     if(cb!=0 && cb!=9) continue;
630     TString *Cname = new TString("$");
631     *Cname += cb*5; Cname->Append("-");
632     *Cname += (cb+1)*5; Cname->Append("\\%$");
633     cout<<Cname->Data()<<" & ";
634     cout.precision(2);
635     for(int kt=0; kt<KTBINS; kt++) {
636       cout<<fitC2ss_noGEWfromTherm[kt][cb]->GetParameter(6)<<" ";
637       if((kt+1)!=KTBINS) cout<<"& ";
638       else cout<<" \\\\\ \\hline";
639     }
640     cout<<endl;
641   }
642
643
644
645
646   // Chi2/NDF
647   /*cout<<"Chi2/NDF"<<endl;
648   cout<<"fits with Coherence"<<endl;
649   for(int cb=0; cb<10; cb++){
650     if(cb!=0 && cb!=9) continue;
651     TString *Cname = new TString("$");
652     *Cname += cb*5; Cname->Append("-");
653     *Cname += (cb+1)*5; Cname->Append("\\%$");
654     cout<<Cname->Data()<<" & ";
655     cout.precision(2);
656     for(int kt=0; kt<KTBINS; kt++) {
657       //cout<<fitC2ss_yesGEWfromTherm[kt][cb]->GetParameter(4)<<" ";
658       //cout<<fitC2ss_yesG[kt][cb]->GetParameter(4)<<" ";
659       //cout<<fitC2ss_noGEWfromTherm[kt][cb]->GetParameter(3)<<" ";
660       cout<<Chi2NDF_yesG[kt][cb]->GetBinContent(1)<<" ";// Chi^2/NDF
661       if((kt+1)!=KTBINS) cout<<"& ";
662       else cout<<" \\\\\ \\hline";
663     }
664     cout<<endl;
665   }
666   //
667   cout<<"fits with Therminator EW"<<endl;
668   for(int cb=0; cb<10; cb++){
669     if(cb!=0 && cb!=9) continue;
670     TString *Cname = new TString("$");
671     *Cname += cb*5; Cname->Append("-");
672     *Cname += (cb+1)*5; Cname->Append("\\%$");
673     cout<<Cname->Data()<<" & ";
674     cout.precision(2);
675     for(int kt=0; kt<KTBINS; kt++) {
676       cout<<Chi2NDF_noGEWfromTherm[kt][cb]->GetBinContent(1)<<" ";// Chi^2/NDF
677       if((kt+1)!=KTBINS) cout<<"& ";
678       else cout<<" \\\\\ \\hline";
679     }
680     cout<<endl;
681   }
682   */
683
684
685   
686   /////////////////////////////////////////////
687   // Draw C2 in 6 kt bins
688   TCanvas *canC2 = new TCanvas("canC2", "canC2",10,0,600,900);// 11,53,700,500
689   canC2->SetHighLightColor(2);
690   //canC2->Range(-0.7838115,-1.033258,0.7838115,1.033258);
691   gStyle->SetOptFit(0111);
692   canC2->SetFillColor(0);//10
693   canC2->SetBorderMode(0);
694   canC2->SetBorderSize(2);
695   canC2->SetFrameFillColor(0);
696   canC2->SetFrameBorderMode(0);
697   canC2->SetFrameBorderMode(0);
698   
699   
700   TPad *pad1 = new TPad("pad1","pad1",0.06,0.06,1.,1.);//0.05,0.05,1.,1.
701   gPad->SetGridx(0);
702   gPad->SetGridy(0);
703   gPad->SetTickx();
704   gPad->SetTicky();
705   pad1->SetTopMargin(0.02);//0.05
706   pad1->SetLeftMargin(0.12);//
707   pad1->SetRightMargin(0.01);//3e-2
708   pad1->SetBottomMargin(0.08);//0.12
709   pad1->Divide(2,3,0,0);
710   pad1->Draw();
711  
712
713   TLegend *legend1 = new TLegend(.2,.75,.99,.95,NULL,"brNDC");//.45 or .4 for x1
714   legend1->SetBorderSize(0);
715   //legend1->SetTextSize(.08);// small .03; large .036 
716   legend1->SetTextFont(TextFont);
717   legend1->SetTextSize(SizeLegend);
718   legend1->SetFillColor(0);
719   //
720   TLegend *legend2 = new TLegend(.35,.74, .99,.98,NULL,"brNDC");//.45 or .4 for x1
721   legend2->SetBorderSize(0);
722   //legend2->SetTextSize(.08);// small .03; large .036 
723   legend2->SetTextFont(TextFont);
724   legend2->SetTextSize(SizeLegend);
725   legend2->SetFillColor(0);
726
727
728   TGaxis::SetMaxDigits(4);
729   /////////////////////
730   for(int kt=0; kt<KTBINS; kt++) {
731     pad1->cd(kt+1);
732     gPad->SetRightMargin(RightMargin);
733     if(kt%2==0) gPad->SetRightMargin(0.001);
734     if(kt==4) SF_correction=0.92;
735     else if(kt==5) SF_correction=1.015;
736     else SF_correction=1.0;
737     //if(kt==0) Dim1=gPad->GetAbsWNDC()*gPad->GetAbsHNDC();
738     //Dim2=gPad->GetAbsWNDC()*gPad->GetAbsHNDC();
739     C2_ss[kt][BOI_1]->SetMinimum(MIN[BOI_1]);
740     C2_ss[kt][BOI_1]->SetMaximum(MAX[BOI_1]);
741     C2_ss[kt][BOI_1]->GetXaxis()->SetRangeUser(0,0.061);
742     C2_ss[kt][BOI_1]->GetXaxis()->SetTitleOffset(0.85);
743     C2_ss[kt][BOI_1]->GetYaxis()->SetTitleOffset(0.85);// 0.85
744     C2_ss[kt][BOI_1]->GetXaxis()->SetTitle(""); C2_ss[kt][BOI_1]->GetYaxis()->SetTitle("");
745     C2_ss[kt][BOI_1]->GetXaxis()->SetTitleFont(TextFont); C2_ss[kt][BOI_1]->GetYaxis()->SetTitleFont(TextFont);
746     C2_ss[kt][BOI_1]->GetXaxis()->SetLabelFont(TextFont); C2_ss[kt][BOI_1]->GetYaxis()->SetLabelFont(TextFont);
747     C2_ss[kt][BOI_1]->GetXaxis()->SetLabelSize(SizeLabel*SF_correction); C2_ss[kt][BOI_1]->GetYaxis()->SetLabelSize(SizeLabel*SF_correction);
748     if(kt%2==0) C2_ss[kt][BOI_1]->GetYaxis()->SetLabelSize(SizeLabel*SF_correction);
749     else {C2_ss[kt][BOI_1]->GetYaxis()->SetLabelSize(.0);}
750     if(kt<KTBINS-2) C2_ss[kt][BOI_1]->GetXaxis()->SetLabelSize(.0);
751     C2_ss[kt][BOI_1]->GetXaxis()->SetNdivisions(603); C2_ss[kt][BOI_1]->GetYaxis()->SetNdivisions(606);
752     
753     //
754     C2Therm_ss[kt][BOI_1]->SetMinimum(MIN[BOI_1]);
755     C2Therm_ss[kt][BOI_1]->SetMaximum(MAX[BOI_1]);
756     C2Therm_ss[kt][BOI_1]->GetXaxis()->SetRangeUser(0,0.061);
757     C2Therm_ss[kt][BOI_1]->GetXaxis()->SetTitleOffset(0.85);
758     C2Therm_ss[kt][BOI_1]->GetYaxis()->SetTitleOffset(0.85);
759     C2Therm_ss[kt][BOI_1]->GetXaxis()->SetTitle(""); C2Therm_ss[kt][BOI_1]->GetYaxis()->SetTitle("");
760     C2Therm_ss[kt][BOI_1]->GetXaxis()->SetLabelFont(TextFont); C2Therm_ss[kt][BOI_1]->GetYaxis()->SetLabelFont(TextFont); 
761     if(kt%2==0) C2Therm_ss[kt][BOI_1]->GetYaxis()->SetLabelSize(SizeLabel*SF_correction);
762     else {C2Therm_ss[kt][BOI_1]->GetYaxis()->SetLabelSize(.0);}
763     if(kt<KTBINS-2) C2Therm_ss[kt][BOI_1]->GetXaxis()->SetLabelSize(.0);
764     else {C2Therm_ss[kt][BOI_1]->GetXaxis()->SetLabelSize(SizeLabel*SF_correction);}
765     C2Therm_ss[kt][BOI_1]->GetXaxis()->SetNdivisions(606); C2Therm_ss[kt][BOI_1]->GetYaxis()->SetNdivisions(606);
766
767     if(BOI_1==9 && kt==5) {// Point with large statistical error
768       C2_ss[kt][BOI_1]->SetBinContent(3,-100);
769       C2_ss_MomSys[kt][BOI_1]->SetBinContent(3,-100);
770     }
771
772     if(TherminatorC2==kFALSE){
773       C2_ss[kt][BOI_1]->DrawCopy();
774       C2_ss_MomSys[kt][BOI_1]->SetFillColor(kRed-9); C2_os_MomSys[kt][BOI_1]->SetFillColor(kBlue-9);
775       C2_ss_MomSys[kt][BOI_1]->DrawCopy("E2 same");
776       C2_os_MomSys[kt][BOI_1]->DrawCopy("E2 same");
777       C2_ss[kt][BOI_1]->DrawCopy("same");
778       C2_os[kt][BOI_1]->DrawCopy("same");
779       hfitC2ss_noG[kt][BOI_1]->SetLineStyle(3); fitC2ss_noG[kt][BOI_1]->SetLineStyle(3); 
780       hfitC2os_noG[kt][BOI_1]->SetLineStyle(3); fitC2os_noG[kt][BOI_1]->SetLineStyle(3);
781       hfitC2ss_noG[kt][BOI_1]->DrawCopy("C same");
782       hfitC2os_noG[kt][BOI_1]->DrawCopy("C same");
783       hfitC2ss_noGEW[kt][BOI_1]->DrawCopy("C same");
784       hfitC2os_noGEW[kt][BOI_1]->DrawCopy("C same");
785       //fitC2ss_yesG[kt][BOI_1]->DrawCopy("same");
786       //fitC2os_yesG[kt][BOI_1]->DrawCopy("same");
787
788     }else{// Therminator
789       C2Therm_ss[kt][BOI_1]->DrawCopy();
790       C2Therm_os[kt][BOI_1]->DrawCopy("same");
791       fitC2ss_Therm[kt][BOI_1]->DrawCopy("same");
792       fitC2os_Therm[kt][BOI_1]->DrawCopy("same");
793       fitC2ss_ThermGaus[kt][BOI_1]->SetLineStyle(3);
794       fitC2os_ThermGaus[kt][BOI_1]->SetLineStyle(3);
795       fitC2ss_ThermGaus[kt][BOI_1]->DrawCopy("same");
796       fitC2os_ThermGaus[kt][BOI_1]->DrawCopy("same");
797     }
798     //
799     if(kt==0){
800       TLatex *Specif;
801       if(!TherminatorC2) Specif = new TLatex(0.007,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.91,"ALICE Pb-Pb #\sqrt{#font[12]{s}_{NN}}=2.76 TeV");// ALICE specifications
802       else Specif = new TLatex(0.0015,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.91,"Therminator");// Therminator
803       Specif->SetTextFont(TextFont);
804       Specif->SetTextSize(SizeSpecif*.9);
805       TString *CentName;
806       if(!TherminatorC2) {CentName = new TString(); *CentName += BOI_1*5; CentName->Append("-"); *CentName += (BOI_1+1)*5; CentName->Append("%");}
807       else {
808         if(BOI_1==0) CentName = new TString("0-5%");
809         if(BOI_1==9) CentName = new TString("40-50%");
810       }
811       TLatex *Specif2 = new TLatex(0.027,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.8,CentName->Data());
812       Specif2->SetTextFont(TextFont);
813       Specif2->SetTextSize(SizeSpecif);
814       Specif->Draw("same");
815       Specif2->Draw("same");
816     }
817     if(kt==1){
818       legend1->AddEntry(C2_ss[kt][BOI_1],"same-charge","p");
819       legend1->AddEntry(C2_os[kt][BOI_1],"mixed-charge","p");
820       legend1->Draw("same");
821     }
822     if(kt==2){
823       fitC2ss_noG[kt][BOI_1]->SetLineColor(1);
824       fitC2ss_yesG[kt][BOI_1]->SetLineColor(1);
825       fitC2ss_noGEW[kt][BOI_1]->SetLineColor(1);
826       fitC2ss_Therm[kt][BOI_1]->SetLineColor(1);
827       fitC2ss_ThermGaus[kt][BOI_1]->SetLineColor(1);
828       if(!TherminatorC2) {
829         legend2->AddEntry(fitC2ss_noG[kt][BOI_1],"Gauss","l");
830         legend2->AddEntry(fitC2ss_noGEW[kt][BOI_1],"Edgeworth","l");
831         //legend2->AddEntry(fitC2ss_yesG[kt][BOI_1],"Gauss, G#neq0","l");
832       }else {
833         legend2->AddEntry(fitC2ss_ThermGaus[kt][BOI_1],"Gauss","l");// Therminator
834         legend2->AddEntry(fitC2ss_Therm[kt][BOI_1],"Edgeworth","l");// Therminator
835       }      
836       legend2->Draw("same");
837     }
838     TLatex *KtLabel;
839     if(kt==0) KtLabel = new TLatex(0.028,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.68,"0.2<#font[12]{k}_{T}<0.3 GeV/#font[12]{c}");// 0.003,.988
840     else if(kt==1) KtLabel = new TLatex(0.028,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.68,"0.3<#font[12]{k}_{T}<0.4 GeV/#font[12]{c}");
841     else if(kt==2) KtLabel = new TLatex(0.028,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.68,"0.4<#font[12]{k}_{T}<0.5 GeV/#font[12]{c}");
842     else if(kt==3) KtLabel = new TLatex(0.028,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.68,"0.5<#font[12]{k}_{T}<0.6 GeV/#font[12]{c}");
843     else if(kt==4) KtLabel = new TLatex(0.028,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.68,"0.6<#font[12]{k}_{T}<0.7 GeV/#font[12]{c}");
844     else KtLabel = new TLatex(0.028,MIN[BOI_1]+(MAX[BOI_1]-MIN[BOI_1])*0.68,"0.7<#font[12]{k}_{T}<0.8 GeV/#font[12]{c}");
845     KtLabel->SetTextFont(TextFont);// 23
846     KtLabel->SetTextSize(SizeSpecif*SF_correction);// 24
847     KtLabel->Draw("same");
848   }
849  
850   canC2->cd();
851     
852   TPad *pad1_2 = new TPad("pad1_2","pad1_2",0.0,0.0,1.,1.);
853   pad1_2->SetFillStyle(0);
854   pad1_2->Draw();
855   pad1_2->cd();
856   TLatex *C2Label = new TLatex(.04,.94,"#font[12]{C}_{2}");// 0.04,.91
857   C2Label->SetTextFont(TextFont);
858   C2Label->SetTextSize(SizeTitle*SF2);
859   C2Label->SetTextAngle(90);
860   C2Label->Draw();
861   TLatex *Q2Label = new TLatex(.75,.015,"#font[12]{q} (GeV/#font[12]{c})");// .7,.02
862   Q2Label->SetTextFont(TextFont);
863   Q2Label->SetTextSize(SizeTitle*SF2);
864   Q2Label->Draw();
865   TBox *CoverUp = new TBox(0.554,0.05,0.58,.083);
866   CoverUp->SetFillColor(0);
867   CoverUp->Draw();
868   
869
870
871
872   ////////////////////////////////////////////////////
873   ////////////////////////////////////////////////////
874   // C2 fit parameters
875   TCanvas *can2 = new TCanvas("can2", "can2",680,0,600,900);// 680,0,600,900 with G
876   can2->SetHighLightColor(2);
877   gStyle->SetOptFit(0111);
878   can2->SetFillColor(0);//10
879   can2->SetBorderMode(0);
880   can2->SetBorderSize(2);
881   can2->SetFrameFillColor(0);
882   can2->SetFrameBorderMode(0);
883   can2->SetFrameBorderMode(0);
884   can2->cd();
885
886   TPad *pad2 = new TPad("pad2","pad2",0.,0.,1.,1.);
887   gPad->SetGridx(0);
888   gPad->SetGridy(0);
889   gPad->SetTickx();
890   gPad->SetTicky();
891   pad2->SetTopMargin(0.02);
892   pad2->SetLeftMargin(0.0);
893   pad2->SetRightMargin(0.0);
894   pad2->SetBottomMargin(0.07);
895   pad2->Divide(1,2,0,0);// 1,3,0,0 with G
896   pad2->Draw();
897   pad2->cd();
898   TLegend *legend3 = new TLegend(.44,.66, .96,.98,NULL,"brNDC");// .56,.6, .96,.98
899   legend3->SetBorderSize(0);
900   legend3->SetTextFont(TextFont);
901   legend3->SetTextSize(SizeLegend*SF1);
902   legend3->SetFillColor(0);
903     
904   double LowerLimits[4]={0.46, 0.32, 4.8, 0.08};// 0.46, 0.32, 4.8, 0.08
905   double UpperLimits[4]={0.87, 0.63, 13.2, 1.28};// 0.84, 0.63, 13.2, 1.28
906   for(int par=1; par<=3; par++){
907     //pad2->cd(par);
908     if(par!=1 && par!=3) continue;
909     if(par==1) pad2->cd(1);
910     else pad2->cd(2);
911     gPad->SetRightMargin(0.03); gPad->SetLeftMargin(0.14);
912     if(par==3) gPad->SetBottomMargin(0.16);// 0.22 with G
913     // settings applied to ParHisto_coh[par-1][BOI_1] to include G.  
914     ParHisto_ch[par-1][BOI_1]->SetMinimum(LowerLimits[par-1]);
915     ParHisto_ch[par-1][BOI_1]->SetMaximum(UpperLimits[par-1]);
916     ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetTitleFont(TextFont); ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetTitleFont(TextFont);
917     ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetLabelFont(TextFont); ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetLabelFont(TextFont);
918     if(par==3){
919       ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetLabelSize(SizeLabel*SF1);
920       ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetTitleSize(SizeTitle*SF1);
921       ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetLabelSize(SizeLabel*SF1);
922     }else{
923       ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetLabelSize(0);
924       ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetTitleSize(0);
925       ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetLabelSize(0);
926     }
927     if(par==1) SF_correction=1.0;
928     else SF_correction=0.97;
929     ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetTitleSize(SizeTitle*SF1*SF_correction);
930     ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetLabelSize(SizeLabel*SF1*SF_correction);
931     ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetTitle("#font[12]{k}_{T} (GeV/#font[12]{c})");
932     ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetRangeUser(0.2,0.79);
933     if(par==1) ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetTitle("#lambda");
934     if(par==2) ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetTitle("#font[12]{G}");
935     if(par==3) ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetTitle("#font[12]{R_{ch}} (fm)");
936     if(par==4) ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetTitle("#font[12]{R_{coh}} (fm)");
937     ParHisto_ch[par-1][BOI_1]->GetXaxis()->SetTitleOffset(0.9);// 2.0
938     ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetTitleOffset(0.8);// 1.4
939     ParHisto_ch[par-1][BOI_1]->GetYaxis()->SetNdivisions(505);
940    
941     // ParN=2 (lambda), 3(G), 4(Rch), 5(Rcoh)
942     ParHisto_ch[par-1][BOI_1]->Draw();
943     
944     
945     TH1D *ParHisto1_Sys=(TH1D*)ParHisto_ch[par-1][BOI_1]->Clone();
946     TH1D *ParHisto2_Sys=(TH1D*)ParHisto_ch[par-1][BOI_2]->Clone();
947     TH1D *ParHisto3_Sys=(TH1D*)ParHisto_chEW[par-1][BOI_1]->Clone();
948     TH1D *ParHisto4_Sys=(TH1D*)ParHisto_chEW[par-1][BOI_2]->Clone();
949     TF1 *RSys1=new TF1("RSys1","0.3",0,1);// M0, R Gauss Fit range syst in fm.
950     TF1 *RSys2=new TF1("RSys2","0.2",0,1);// M9, R Gauss Fit range syst in fm.
951     TF1 *RSys3=new TF1("RSys3","0.2",0,1);// M0, R EW Fit range syst in fm.
952     TF1 *RSys4=new TF1("RSys4","0.2",0,1);// M9, R EW Fit range syst in fm.
953     TF1 *LamSys1=new TF1("LamSys1","0.015",0,1);// M0, Lam Gauss Fit range syst in fm.
954     TF1 *LamSys2=new TF1("LamSys2","0.015",0,1);// M9, Lam Gauss Fit range syst in fm.
955     TF1 *LamSys3=new TF1("LamSys3","0.01",0,1);// M0, Lam EW Fit range syst in fm.
956     TF1 *LamSys4=new TF1("LamSys4","0.01",0,1);// M9, Lam EW Fit range syst in fm.
957
958     for(int bin=1; bin<=ParHisto1_Sys->GetNbinsX(); bin++){
959       double ktvalue=ParHisto1_Sys->GetXaxis()->GetBinCenter(bin);
960       if(par==1){// lambda Sys
961         ParHisto1_Sys->SetBinError(bin, LamSys1->Eval(ktvalue));
962         ParHisto2_Sys->SetBinError(bin, LamSys2->Eval(ktvalue));
963         ParHisto3_Sys->SetBinError(bin, LamSys3->Eval(ktvalue));
964         ParHisto4_Sys->SetBinError(bin, LamSys4->Eval(ktvalue));
965       }
966       if(par==3){// R sys
967         ParHisto1_Sys->SetBinError(bin, RSys1->Eval(ktvalue));
968         ParHisto2_Sys->SetBinError(bin, RSys2->Eval(ktvalue));
969         ParHisto3_Sys->SetBinError(bin, RSys3->Eval(ktvalue));
970         ParHisto4_Sys->SetBinError(bin, RSys4->Eval(ktvalue));
971       }
972     }
973     ParHisto1_Sys->SetMarkerSize(0); ParHisto1_Sys->SetFillStyle(1000); ParHisto1_Sys->SetFillColor(kGray);
974     ParHisto2_Sys->SetMarkerSize(0); ParHisto2_Sys->SetFillStyle(1000); ParHisto2_Sys->SetFillColor(kGray);
975     ParHisto3_Sys->SetMarkerSize(0); ParHisto3_Sys->SetFillStyle(1000); ParHisto3_Sys->SetFillColor(kBlue-10);
976     ParHisto4_Sys->SetMarkerSize(0); ParHisto4_Sys->SetFillStyle(1000); ParHisto4_Sys->SetFillColor(kBlue-10);
977
978     ParHisto1_Sys->Draw("E2 same"); ParHisto2_Sys->Draw("E2 same"); ParHisto3_Sys->Draw("E2 same"); ParHisto4_Sys->Draw("E2 same");
979     ParHisto_ch[par-1][BOI_1]->Draw("same");
980     ParHisto_ch[par-1][BOI_2]->Draw("same");
981     ParHisto_chEW[par-1][BOI_1]->Draw("same"); 
982     ParHisto_chEW[par-1][BOI_2]->Draw("same");
983     
984     if(par==1){
985       //legend3->AddEntry(ParHisto_chEWfromTherm[par-1][BOI_1],"E_{w}, 0-5%","p"); legend3->AddEntry(ParHisto_chEWfromTherm[par-1][BOI_2],"E_{w}, 45-50%","p");
986       //legend3->AddEntry(ParHisto_coh[par-1][BOI_1],"G#neq0, 0-5%","p"); legend3->AddEntry(ParHisto_coh[par-1][BOI_2],"G#neq0, 45-50%","p");
987       legend3->AddEntry(ParHisto_ch[par-1][BOI_1],"Gauss, 0-5%","p"); legend3->AddEntry(ParHisto_ch[par-1][BOI_2],"Gauss, 45-50%","p");
988       legend3->AddEntry(ParHisto_chEW[par-1][BOI_1],"Edgeworth, 0-5%","p"); legend3->AddEntry(ParHisto_chEW[par-1][BOI_2],"Edgeworth, 45-50%","p");
989     }
990     
991     if(par==3) legend3->Draw("same");// par==2 with G
992     if(par==1){
993       TLatex *Specif_2 = new TLatex(0.35,LowerLimits[par-1]+(UpperLimits[par-1]-LowerLimits[par-1])*.94,"ALICE Pb-Pb #\sqrt{#font[12]{s}_{NN}}=2.76 TeV");
994       Specif_2->SetTextFont(TextFont);
995       Specif_2->SetTextSize(SizeSpecif*SF1);
996       Specif_2->Draw();
997     }
998   }
999
1000   ////////////////////////////////////////////////////
1001   ////////////////////////////////////////////////////
1002   // C2(+-) Therminator comparisons
1003   
1004   TCanvas *can3 = new TCanvas("can3", "can3",1800,0,600,600);// 11,53,700,500
1005   can3->SetHighLightColor(2);
1006   gStyle->SetOptFit(0111);
1007   can3->SetFillColor(0);//10
1008   can3->SetBorderMode(0);
1009   can3->SetBorderSize(2);
1010   can3->SetFrameFillColor(0);
1011   can3->SetFrameBorderMode(0);
1012   can3->SetFrameBorderMode(0);
1013   can3->cd();
1014   TPad *pad3 = new TPad("pad3","pad3",0.0,0.0,1.,1.);
1015   gPad->SetGridx(0);
1016   gPad->SetGridy(0);
1017   gPad->SetTickx();
1018   gPad->SetTicky();
1019   pad3->SetTopMargin(0.02);//0.05
1020   pad3->SetRightMargin(0.01);//3e-2
1021   pad3->SetBottomMargin(0.07);//0.12
1022   //pad3->Divide(1,2,0,0);
1023   pad3->Draw();
1024   pad3->cd();
1025   TLegend *legend4 = new TLegend(.24,.78, .85,.97,NULL,"brNDC");//.45 or .4 for x1
1026   legend4->SetBorderSize(0);
1027   legend4->SetFillColor(0);
1028   
1029   gPad->SetRightMargin(0.01); gPad->SetLeftMargin(0.16); gPad->SetBottomMargin(0.11); gPad->SetTopMargin(0.01);
1030
1031   TH1D *C2_os_ktcompare[2][KTBINS];
1032   TH1D *C2Therm_os_ktcompare[2][KTBINS];
1033   float MIN_ktcomp=0.985, MAX_ktcomp=1.045;// MIN_ktcomp=0.92, MAX_ktcomp=2.04 (cumulant comparison)
1034   for(int type=0; type<2; type++){
1035     //pad3->cd(type+1);
1036     //gPad->SetRightMargin(RightMargin); gPad->SetLeftMargin(0.12);
1037     //gPad->SetBottomMargin(0.145);
1038     for(int kt=0; kt<KTBINS; kt++){
1039       C2_os_ktcompare[type][kt] = (TH1D*)C2_os[kt][BOI_1]->Clone();
1040       TH1D *FSIbase;
1041       if(type==0) {
1042         FSIbase = (TH1D*)C2Therm_os[0][BOI_1]->Clone();// diluted
1043         C2Therm_os_ktcompare[type][kt] = (TH1D*)C2Therm_os[kt][BOI_1]->Clone();// diluted
1044       }else{
1045         FSIbase = (TH1D*)K2_os[0][BOI_1]->Clone();// undiluted
1046         C2Therm_os_ktcompare[type][kt] = (TH1D*)K2_os[kt][BOI_1]->Clone();// undiluted
1047       }
1048       //
1049
1050       for(int qbin=2; qbin<=20; qbin++){
1051         if(C2_os[0][BOI_1]->GetBinContent(qbin)<=0) continue;
1052         if(C2Therm_os[0][BOI_1]->GetBinContent(qbin)<=0) continue;
1053         
1054         double value = C2_os_ktcompare[type][kt]->GetBinContent(qbin)/C2_os[0][BOI_1]->GetBinContent(qbin);
1055         double value_e = pow(C2_os_ktcompare[type][kt]->GetBinError(qbin)/C2_os[0][BOI_1]->GetBinContent(qbin),2);
1056         value_e += pow(C2_os[0][BOI_1]->GetBinError(qbin) * C2_os_ktcompare[type][kt]->GetBinContent(qbin)/pow(C2_os[0][BOI_1]->GetBinContent(qbin),2),2);
1057         value_e = sqrt(value_e);
1058         double valueC2Therm = C2Therm_os_ktcompare[type][kt]->GetBinContent(qbin)/FSIbase->GetBinContent(qbin);
1059         double valueC2Therm_e = pow(C2Therm_os_ktcompare[type][kt]->GetBinError(qbin)/FSIbase->GetBinContent(qbin),2);
1060         valueC2Therm_e += pow(FSIbase->GetBinError(qbin) * C2Therm_os_ktcompare[type][kt]->GetBinContent(qbin)/pow(FSIbase->GetBinContent(qbin),2),2);
1061         valueC2Therm_e = sqrt(valueC2Therm_e);
1062         // cumulant comparison
1063         //double value = (C2_os_ktcompare[type][kt]->GetBinContent(qbin)-1.)/(C2_os[0][BOI_1]->GetBinContent(qbin)-1.);
1064         //double value_e = pow(C2_os_ktcompare[type][kt]->GetBinError(qbin)/(C2_os[0][BOI_1]->GetBinContent(qbin)-1.),2);
1065         //value_e += pow(C2_os[0][BOI_1]->GetBinError(qbin) * (C2_os_ktcompare[type][kt]->GetBinContent(qbin)-1.)/pow((C2_os[0][BOI_1]->GetBinContent(qbin)-1.),2),2);
1066         //value_e = sqrt(value_e);
1067         //double valueC2Therm = (C2Therm_os_ktcompare[type][kt]->GetBinContent(qbin)-1.)/(FSIbase->GetBinContent(qbin)-1.);
1068         //double valueC2Therm_e = pow(C2Therm_os_ktcompare[type][kt]->GetBinError(qbin)/(FSIbase->GetBinContent(qbin)-1.),2);
1069         //valueC2Therm_e += pow(FSIbase->GetBinError(qbin) * (C2Therm_os_ktcompare[type][kt]->GetBinContent(qbin)-1.)/pow((FSIbase->GetBinContent(qbin)-1.),2),2);
1070         //valueC2Therm_e = sqrt(valueC2Therm_e);
1071         
1072         
1073         //
1074         C2_os_ktcompare[type][kt]->SetBinContent(qbin, value);
1075         C2_os_ktcompare[type][kt]->SetBinError(qbin, value_e);
1076         C2Therm_os_ktcompare[type][kt]->SetBinContent(qbin, valueC2Therm);
1077         if(type==0) C2Therm_os_ktcompare[type][kt]->SetBinError(qbin, valueC2Therm_e);
1078         else C2Therm_os_ktcompare[type][kt]->SetBinError(qbin, C2Therm_os_ktcompare[0][kt]->GetBinError(qbin));
1079         if(kt==0) {C2_os_ktcompare[type][kt]->SetBinError(qbin, 0);}
1080       }
1081       C2_os_ktcompare[type][kt]->SetBinContent(1,-10); C2Therm_os_ktcompare[type][kt]->SetBinContent(1,-10);
1082       C2_os_ktcompare[type][kt]->SetMinimum(MIN_ktcomp);
1083       C2_os_ktcompare[type][kt]->SetMaximum(MAX_ktcomp);
1084       C2_os_ktcompare[type][kt]->GetXaxis()->SetRangeUser(0,0.09);
1085       int MarkerStyle=20;
1086       if(kt==1) MarkerStyle=24;
1087       if(kt==5) MarkerStyle=21;
1088       C2_os_ktcompare[type][kt]->SetMarkerStyle(MarkerStyle);
1089       C2Therm_os_ktcompare[type][kt]->SetMarkerStyle(24);// MarkerStyle
1090       C2Therm_os_ktcompare[type][kt]->SetMarkerColor(1); C2Therm_os_ktcompare[type][kt]->SetLineColor(1); 
1091       C2Therm_os_ktcompare[type][kt]->SetMarkerSize(C2_os_ktcompare[type][kt]->GetMarkerSize());
1092       C2_os_ktcompare[type][kt]->GetXaxis()->SetTitleOffset(20); C2_os_ktcompare[type][kt]->GetYaxis()->SetTitleOffset(20);
1093       
1094       C2_os_ktcompare[type][kt]->GetXaxis()->SetNdivisions(606);
1095
1096       //if(kt!=5 && kt!=1 ) continue;// old way
1097       if(kt!=5) continue;
1098       if(kt==5) {
1099         C2_os_ktcompare[type][kt]->GetXaxis()->SetTitleFont(TextFont); C2_os_ktcompare[type][kt]->GetYaxis()->SetTitleFont(TextFont);
1100         C2_os_ktcompare[type][kt]->GetXaxis()->SetTitleSize(SizeTitle*SF2); 
1101         C2_os_ktcompare[type][kt]->GetYaxis()->SetTitleSize(SizeTitle*SF2);
1102         C2_os_ktcompare[type][kt]->GetXaxis()->SetTitle("#font[12]{q} (GeV/#font[12]{c})");
1103         C2_os_ktcompare[type][kt]->GetXaxis()->SetTitleOffset(0.8);
1104         C2_os_ktcompare[type][kt]->GetXaxis()->SetLabelFont(TextFont); C2_os_ktcompare[type][kt]->GetYaxis()->SetLabelFont(TextFont);
1105         C2_os_ktcompare[type][kt]->GetXaxis()->SetLabelSize(SizeLabel*SF2); 
1106         C2_os_ktcompare[type][kt]->GetYaxis()->SetLabelSize(SizeLabel*SF2); 
1107         if(type==1) C2Therm_os_ktcompare[type][kt]->SetMarkerStyle(25);
1108
1109         if(type==0) C2_os_ktcompare[type][kt]->DrawCopy(); 
1110         C2Therm_os_ktcompare[type][kt]->DrawCopy("same");
1111       }
1112       //else {
1113       //C2_os_ktcompare[type][kt]->DrawCopy("same");
1114       //}
1115       TString *ktname = new TString("#font[12]{k}_{T,");
1116       *ktname += kt+1;
1117       ktname->Append("}/#font[12]{k}_{T,1}");
1118       TString *nameReal=new TString(ktname->Data());
1119       nameReal->Append(", ALICE");
1120       TString *nameTherm=new TString(ktname->Data());
1121       nameTherm->Append(", Therminator");
1122       if(type==0) {
1123         nameTherm->Append(" (diluted)");
1124         legend4->AddEntry(C2_os_ktcompare[type][kt],nameReal->Data(),"p");
1125         legend4->AddEntry(C2Therm_os_ktcompare[type][kt],nameTherm->Data(),"p");
1126       }else {
1127         TString *nameTherm2=new TString(nameTherm->Data());
1128         //nameTherm2->Append(", r*<80 fm");
1129         nameTherm2->Append(" (undiluted)");
1130         legend4->AddEntry(C2Therm_os_ktcompare[type][kt],nameTherm2->Data(),"p");
1131       }
1132       
1133     }
1134     
1135     if(type==1) {
1136       TLatex *Specif_3 = new TLatex(0.4,0.15,"ALICE Pb-Pb #\sqrt{#font[12]{s}_{NN}}=2.76 TeV");
1137       Specif_3->SetNDC();
1138       Specif_3->SetTextFont(TextFont);
1139       Specif_3->SetTextSize(SizeSpecif*SF2);
1140       TLatex *Specif2_3 = new TLatex(0.55,0.22,"0-5%");
1141       Specif2_3->SetNDC();
1142       Specif2_3->SetTextFont(TextFont);
1143       Specif2_3->SetTextSize(SizeLegend*SF2);
1144       Specif_3->Draw();
1145       Specif2_3->Draw();
1146       legend4->SetTextFont(TextFont);
1147       legend4->SetTextSize(SizeLegend*SF2);
1148       legend4->Draw("same");
1149     }
1150
1151     TF1 *Unity = new TF1("Unity","1",0,100);
1152     Unity->SetLineStyle(2);
1153     Unity->Draw("same");
1154   
1155   }
1156   can3->cd();
1157   TPad *pad3_2 = new TPad("pad3_2","pad3_2",0.0,0.0,1.,1.);
1158   pad3_2->SetFillStyle(0);
1159   pad3_2->Draw();
1160   pad3_2->cd();
1161   TLatex *DthLabel = new TLatex(.044,.58,"#font[12]{C}_{2}^{+-}(#font[12]{k}_{T,6}) / #font[12]{C}_{2}^{+-}(#font[12]{k}_{T,1})");// .04,.96, "D^{+-}_{Th}"
1162   DthLabel->SetTextFont(TextFont);
1163   DthLabel->SetTextSize(SizeTitle*SF2);
1164   DthLabel->SetTextAngle(90);
1165   DthLabel->Draw();
1166   
1167
1168   ////////////////////////////////////////////////////
1169   ////////////////////////////////////////////////////
1170   // Three-pion correlations
1171
1172   
1173   TCanvas *can4 = new TCanvas("can4", "can4",10,300,600,900);// 11,53,700,500
1174   can4->SetHighLightColor(2);
1175   gStyle->SetOptFit(0111);
1176   can4->SetFillColor(0);//10
1177   can4->SetBorderMode(0);
1178   can4->SetBorderSize(2);
1179   can4->SetFrameFillColor(0);
1180   can4->SetFrameBorderMode(0);
1181   can4->SetFrameBorderMode(0);
1182   
1183   
1184   TPad *pad4 = new TPad("pad4","pad4",0.06,0.06,1.,1.);
1185   gPad->SetGridx(0);
1186   gPad->SetGridy(0);
1187   gPad->SetTickx();
1188   gPad->SetTicky();
1189   pad4->SetTopMargin(0.02);//0.05
1190   pad4->SetLeftMargin(0.12);
1191   pad4->SetRightMargin(0.01);//3e-2
1192   pad4->SetBottomMargin(0.08);//0.12
1193   pad4->Divide(2,3,0,0);
1194   pad4->Draw();
1195
1196
1197   TLegend *legend5 = new TLegend(.55,.6,.99,.99,NULL,"brNDC");//.55,.6,.99,.95
1198   legend5->SetBorderSize(0);
1199   legend5->SetTextFont(TextFont);
1200   legend5->SetTextSize(SizeLegend);
1201   legend5->SetFillColor(0);
1202
1203
1204   TF1 *BaseLine = new TF1("BaseLine","1.0",0,1);
1205   BaseLine->SetLineStyle(3);
1206   BaseLine->SetLineColor(1);
1207
1208
1209   TF1 *GaussFit[6];
1210   for(int ii=0; ii<6; ii++) {
1211     TString *nameFit=new TString("GaussFit_");
1212     *nameFit += ii;
1213     GaussFit[ii] = new TF1(nameFit->Data(),"[0]+[1]*exp(-pow([2]*x,2))",0,0.2);
1214     GaussFit[ii]->SetParameter(0, 1.);
1215     GaussFit[ii]->SetParameter(1, 2.);
1216     GaussFit[ii]->SetParameter(2, 10./FmToGeV);
1217   }
1218   
1219   TF1 *C3_SysFit=new TF1("C3_SysFit","sqrt(pow(pol3,2)+pow(0.003,2))",0,0.15);// MRC + PID
1220   C3_SysFit->FixParameter(0, -0.01354);
1221   C3_SysFit->FixParameter(1, 0.2948);
1222   C3_SysFit->FixParameter(2, -2.237);
1223   C3_SysFit->FixParameter(3, 5.697);
1224   TH1D *C3Sys[6];// cb
1225   TH1D *c3Sys[6];// cb
1226   TF1 *c3_Coul_SysFit=new TF1("c3_Coul_SysFit","pol1",0,0.15);
1227   TH1D *c3Sys_Coul[6];
1228   float C3MAX=2.3;
1229   if(ChProdBOI==1) C3MAX=2.1;
1230
1231   for(int cb=0; cb<6; cb++) {
1232     pad4->cd(cb+1);
1233     gPad->SetRightMargin(RightMargin);
1234     if(cb%2==0) gPad->SetRightMargin(0.001);
1235     if(cb==4) SF_correction=0.92;
1236     else if(cb==5) SF_correction=1.015;
1237     else SF_correction=1.0;
1238     //if(cb==0) Dim1=gPad->GetAbsWNDC()*gPad->GetAbsHNDC()*gPad->PixeltoX(10)*gPad->PixeltoY(10);
1239     //Dim2=gPad->GetAbsWNDC()*gPad->GetAbsHNDC()*gPad->PixeltoX(10)*gPad->PixeltoY(10);
1240     
1241     C3merged[0][CoulChoice][KT3Bin][cb]->SetMarkerSize(1.5); C3merged[1][CoulChoice][KT3Bin][cb]->SetMarkerSize(1.5); c3merged[0][CoulChoice][KT3Bin][cb]->SetMarkerSize(1.5); c3merged[1][CoulChoice][KT3Bin][cb]->SetMarkerSize(1.5);
1242     C3merged[0][CoulChoice][KT3Bin][cb]->SetMarkerStyle(20); C3merged[1][CoulChoice][KT3Bin][cb]->SetMarkerStyle(21);
1243     c3merged[0][CoulChoice][KT3Bin][cb]->SetMarkerStyle(24); c3merged[1][CoulChoice][KT3Bin][cb]->SetMarkerStyle(25);
1244     C3EW[CoulChoice][KT3Bin][cb]->SetMarkerStyle(22);
1245     C3EW[CoulChoice][KT3Bin][cb]->SetMarkerColor(1);
1246     C3EW[CoulChoice][KT3Bin][cb]->SetLineColor(1);
1247     C3merged[0][CoulChoice][KT3Bin][cb]->SetMarkerColor(2); C3merged[0][CoulChoice][KT3Bin][cb]->SetLineColor(2); c3merged[0][CoulChoice][KT3Bin][cb]->SetMarkerColor(2); c3merged[0][CoulChoice][KT3Bin][cb]->SetLineColor(2); 
1248     C3merged[1][CoulChoice][KT3Bin][cb]->SetMarkerColor(4); C3merged[1][CoulChoice][KT3Bin][cb]->SetLineColor(4); c3merged[1][CoulChoice][KT3Bin][cb]->SetMarkerColor(4); c3merged[1][CoulChoice][KT3Bin][cb]->SetLineColor(4); 
1249     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetXaxis()->SetTitle(""); C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetYaxis()->SetTitle("");
1250     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetXaxis()->SetLabelFont(TextFont);
1251     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetYaxis()->SetLabelFont(TextFont);
1252     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetXaxis()->SetLabelSize(SizeLabel*SF_correction);
1253     if(cb%2==0) C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetYaxis()->SetLabelSize(SizeLabel*SF_correction);
1254     else {C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetYaxis()->SetLabelSize(.0);}
1255     if(cb<4) C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetXaxis()->SetLabelSize(.0);
1256     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetXaxis()->SetRangeUser(0,0.11);
1257     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->SetMinimum(0.9);//0.9
1258     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->SetMaximum(C3MAX);
1259     if(ChProdBOI==0) c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->Fit(GaussFit[cb],"IMEQN","",0.02,0.1);
1260     //
1261     if(cb>2 && ChProdBOI==0) {
1262       C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->SetBinContent(2,-100);
1263       c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->SetBinContent(2,-100);
1264     }
1265     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetXaxis()->SetNdivisions(404);
1266     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetYaxis()->SetNdivisions(505);
1267     //TGaxis::SetMaxDigits(3);
1268     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->DrawCopy();
1269     c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->DrawCopy("same");
1270         
1271     C3Sys[cb] = (TH1D*)C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->Clone();
1272     c3Sys[cb] = (TH1D*)c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->Clone();
1273     c3Sys_Coul[cb] = (TH1D*)c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->Clone();// Coulomb choice
1274     c3Sys_Coul[cb]->Add(c3merged[ChProdBOI][1-int(CoulChoice)][KT3Bin][cb],-1);// Alternate Coulomb
1275     c3Sys_Coul[cb]->Fit(c3_Coul_SysFit,"MENQ","",0,0.1);
1276     for(int ii=1; ii<=11; ii++){
1277       double Q3=(ii-0.5)*0.01;
1278       C3Sys[cb]->SetBinError(ii, C3_SysFit->Eval(Q3) * C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetBinContent(ii));// MRC + PID
1279       //
1280       double err = pow(0.2 * C3_SysFit->Eval(Q3) * c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetBinContent(ii),2);// MRC + PID (1/5 that of C3)
1281       err += pow(c3_Coul_SysFit->Eval(Q3),2);// Coulomb
1282       c3Sys[cb]->SetBinError(ii, sqrt(err));
1283     }
1284     C3Sys[cb]->SetMarkerSize(0); c3Sys[cb]->SetMarkerSize(0);
1285     C3Sys[cb]->SetFillStyle(1000); c3Sys[cb]->SetFillStyle(1000);
1286     if(ChProdBOI==0) { C3Sys[cb]->SetFillColor(kRed-9); c3Sys[cb]->SetFillColor(kRed-9);}
1287     else {C3Sys[cb]->SetFillColor(kBlue-9); c3Sys[cb]->SetFillColor(kBlue-9);}
1288     C3Sys[cb]->Draw("E2 same");
1289     c3Sys[cb]->Draw("E2 same");
1290     C3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->DrawCopy("same");// redraw
1291     c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->DrawCopy("same");// redraw
1292     BaseLine->Draw("same");
1293     //ResidueFit->Draw("same");
1294    
1295
1296     if(cb==0){
1297       if(ChProdBOI==0){
1298         legend5->AddEntry(C3merged[ChProdBOI][CoulChoice][KT3Bin][cb],"#font[12]{C}_{3}^{#pm#pm#pm}","p");
1299         legend5->AddEntry(c3merged[ChProdBOI][CoulChoice][KT3Bin][cb],"#font[12]{#bf{c}}_{3}^{#pm#pm#pm}","p");
1300       }else{
1301         legend5->AddEntry(C3merged[ChProdBOI][CoulChoice][KT3Bin][cb],"#font[12]{C}_{3}^{#pm#pm#mp}","p");
1302         legend5->AddEntry(c3merged[ChProdBOI][CoulChoice][KT3Bin][cb],"#font[12]{#bf{c}}_{3}^{#pm#pm#mp}","p");
1303       }
1304       legend5->Draw("same");
1305     }
1306     TLatex *Specif_3 = new TLatex(0.007,0.9+(C3MAX-0.9)*0.91,"ALICE Pb-Pb #\sqrt{#font[12]{s}_{NN}}=2.76 TeV");// ALICE specifications
1307     Specif_3->SetTextFont(TextFont);
1308     Specif_3->SetTextSize(SizeSpecif*SF_correction);
1309     if(cb==3) Specif_3->Draw("same");
1310
1311     TString *KTString = new TString("");
1312     if(KT3Bin==0) KTString->Append("0.16<#font[12]{K}_{T,3}<0.3 GeV/#font[12]{c}");
1313     else KTString->Append("0.3<#font[12]{K}_{T,3}<1.0 GeV/#font[12]{c}");
1314     TLatex *Kt3Name_1 = new TLatex(0.016,0.9+(C3MAX-0.9)*0.91,KTString->Data());
1315     Kt3Name_1->SetTextFont(TextFont);
1316     Kt3Name_1->SetTextSize(SizeLabel*SF_correction);
1317     if(cb==1) Kt3Name_1->Draw("same");
1318
1319     TLatex *CentLabel_1;
1320     if(cb==0) CentLabel_1 = new TLatex(0.07,C3MAX-0.75,"0-5%");// ALICE specifications
1321     else if(cb==1) CentLabel_1 = new TLatex(0.07,C3MAX-0.75,"5-10%");
1322     else if(cb==2) CentLabel_1 = new TLatex(0.07,C3MAX-0.75,"10-20%");
1323     else if(cb==3) CentLabel_1 = new TLatex(0.07,C3MAX-0.75,"20-30%");
1324     else if(cb==4) CentLabel_1 = new TLatex(0.07,C3MAX-0.75,"30-40%");
1325     else CentLabel_1 = new TLatex(0.07,C3MAX-0.75,"40-50%");
1326     
1327     CentLabel_1->SetTextFont(TextFont);
1328     CentLabel_1->SetTextSize(SizeLabel*SF_correction);//.1
1329     CentLabel_1->Draw("same");
1330
1331     if(ChProdBOI==1){
1332       TF1 *ResidueFit=new TF1("ResidueFit","pol0",0,0.1);
1333       c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->Fit(ResidueFit,"NME","",0,0.1);
1334       double Chi2=0;
1335       for(int q3bin=2; q3bin<=10; q3bin++){
1336         Chi2 += pow(c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetBinContent(q3bin)-1.0,2)/pow(c3merged[ChProdBOI][CoulChoice][KT3Bin][cb]->GetBinError(q3bin),2);
1337       }
1338       cout<<"Chi2/NDF MC from baseline: "<<Chi2/9.<<endl;
1339     }
1340     
1341   }
1342   
1343   can4->cd();
1344   TPad *pad4_2 = new TPad("pad4_2","pad4_2",0.0,0.0,1.,1.);
1345   pad4_2->SetFillStyle(0);
1346   pad4_2->Draw();
1347   pad4_2->cd();
1348   TLatex *C3Label = new TLatex(.04,.86,"#font[12]{C}_{3} or #font[12]{#bf{c}}_{3}");// 0.05,0.9
1349   C3Label->SetTextFont(TextFont);
1350   C3Label->SetTextSize(SizeTitle*SF2);
1351   C3Label->SetTextAngle(90);
1352   C3Label->Draw();
1353   TLatex *Q3Label = new TLatex(.72,.02,"#font[12]{Q}_{3} (GeV/#font[12]{c})");// 0.05,0.9
1354   Q3Label->SetTextFont(TextFont);
1355   Q3Label->SetTextSize(SizeTitle*SF2);
1356   Q3Label->Draw();
1357   CoverUp->Draw();
1358
1359   if(ChProdBOI==1) return;
1360
1361   /////////////////////////////////////////////////////////////////////////////
1362   /////////////////////////////////////////////////////////////////////////////
1363   // r3
1364
1365   TF1 *ChaoticLimit = new TF1("ChaoticLimit","2.0",0,1);
1366   ChaoticLimit->SetLineStyle(3);
1367   
1368   TF1 *QuarticFit[4][6];// Stat/Det/Coul1/Coul2, cb
1369   TF1 *QuadraticFit[4][6];// Stat/Det/Coul1/Coul2, cb
1370   TF1 *QuadQuarticFit[4][6];// Stat/Det/Coul1/Coul2, cb
1371   for(int ii=0; ii<6; ii++){
1372     for(int jj=0; jj<4; jj++){
1373       TString *nameFit=new TString("Quartic_");
1374       *nameFit += ii;
1375       nameFit->Append("_E");
1376       *nameFit += jj;
1377       QuarticFit[jj][ii] = new TF1(nameFit->Data(),"[0]*(1-[1]*pow(x,4))",0,0.2);
1378       QuarticFit[jj][ii]->SetParameter(0,2.0);
1379       QuarticFit[jj][ii]->SetParameter(1,0);
1380       QuarticFit[jj][ii]->SetLineColor(4);
1381       TString *nameFit2=new TString("Quadratic_");
1382       *nameFit2 += ii;
1383       nameFit2->Append("_E");
1384       *nameFit2 += jj;
1385       QuadraticFit[jj][ii] = new TF1(nameFit2->Data(),"[0]*(1-[1]*pow(x,2))",0,0.2);
1386       QuadraticFit[jj][ii]->SetParameter(0,2.0);
1387       QuadraticFit[jj][ii]->SetParameter(1,0);
1388       QuadraticFit[jj][ii]->SetLineColor(1);
1389       QuadraticFit[jj][ii]->SetLineStyle(4);
1390       TString *nameFit3=new TString("QuadQuartic_");
1391       *nameFit3 += ii;
1392       nameFit3->Append("_E");
1393       *nameFit3 += jj;
1394       QuadQuarticFit[jj][ii] = new TF1(nameFit3->Data(),"[0]*(1-[1]*pow(x,2)-[2]*pow(x,4))",0,0.2);
1395       QuadQuarticFit[jj][ii]->SetParameter(0,2.0);
1396       QuadQuarticFit[jj][ii]->SetParameter(1,50);
1397       QuadQuarticFit[jj][ii]->SetParameter(2,5000);
1398       QuadQuarticFit[jj][ii]->SetLineColor(6);
1399       QuadQuarticFit[jj][ii]->SetLineStyle(3);
1400
1401     }
1402   }
1403   
1404   TCanvas *can5 = new TCanvas("can5", "can5",680,300,600,900);// 11,53,700,500
1405   can5->SetHighLightColor(2);
1406   gStyle->SetOptFit(0111);
1407   can5->SetFillColor(0);//10
1408   can5->SetBorderMode(0);
1409   can5->SetBorderSize(2);
1410   can5->SetFrameFillColor(0);
1411   can5->SetFrameBorderMode(0);
1412   can5->SetFrameBorderMode(0);
1413   
1414   
1415   TPad *pad5 = new TPad("pad5","pad5",0.06,0.06,1.,1.);
1416   gPad->SetGridx(0);
1417   gPad->SetGridy(0);
1418   gPad->SetTickx();
1419   gPad->SetTicky();
1420   pad5->SetTopMargin(0.02);//0.05
1421   pad5->SetLeftMargin(0.12);//.14 for wide title, .10 for narrow title, 0.08 for DeltaQ
1422   pad5->SetRightMargin(0.01);//3e-2
1423   pad5->SetBottomMargin(0.08);//0.12
1424   pad5->Divide(2,3,0,0);
1425   pad5->Draw();
1426   
1427   TLegend *legend6 = new TLegend(.18,.72, .53,.98,NULL,"brNDC");// .25,.16, .6,.46
1428   legend6->SetBorderSize(0);
1429   legend6->SetTextFont(TextFont);
1430   legend6->SetTextSize(SizeLegend);
1431   legend6->SetFillColor(0);
1432   
1433   
1434   double LambdaSysPar0[6]={0.0143, 0.014, 0.01294, 0.00204, 0.001227, 0.00999};
1435   double LambdaSysPar1[6]={-0.857, -0.741, -0.6655, -0.3516, -0.2327, -0.3325};
1436   double r3MIN = 1.45;// 0.3
1437   double r3MAX = 2.45;// 2.68
1438   r3merged[CoulChoice][1][5]->SetBinContent(3,100);  r3merged[CoulChoice][1][5]->SetBinError(3,1000);// remove high stat error point
1439  
1440   for(int cb=0; cb<6; cb++) {
1441     pad5->cd(cb+1);
1442     gPad->SetRightMargin(RightMargin);
1443     if(cb%2==0) gPad->SetRightMargin(0.001);
1444     if(cb==4) SF_correction=0.92;
1445     else if(cb==5) SF_correction=1.015;
1446     else SF_correction=1.0;
1447     r3merged[CoulChoice][KT3Bin][cb]->SetMarkerSize(1.5);
1448     r3merged[CoulChoice][KT3Bin][cb]->SetMarkerStyle(20);
1449     r3merged[CoulChoice][KT3Bin][cb]->SetMarkerColor(2); r3merged[CoulChoice][KT3Bin][cb]->SetLineColor(2); 
1450     r3merged[CoulChoice][KT3Bin][cb]->GetXaxis()->SetTitle(""); 
1451     r3merged[CoulChoice][KT3Bin][cb]->GetYaxis()->SetTitle(""); 
1452     r3merged[CoulChoice][KT3Bin][cb]->GetXaxis()->SetLabelFont(TextFont);
1453     r3merged[CoulChoice][KT3Bin][cb]->GetYaxis()->SetLabelFont(TextFont);
1454     r3merged[CoulChoice][KT3Bin][cb]->GetXaxis()->SetLabelSize(SizeLabel*SF_correction);
1455     if(cb%2==0) r3merged[CoulChoice][KT3Bin][cb]->GetYaxis()->SetLabelSize(SizeLabel*SF_correction);
1456     else {r3merged[CoulChoice][KT3Bin][cb]->GetYaxis()->SetLabelSize(.0);}
1457     if(cb<4) r3merged[CoulChoice][KT3Bin][cb]->GetXaxis()->SetLabelSize(.0);
1458     r3merged[CoulChoice][KT3Bin][cb]->GetXaxis()->SetRangeUser(0,0.071);// was 0,0.11
1459     r3merged[CoulChoice][KT3Bin][cb]->SetMinimum(r3MIN);
1460     r3merged[CoulChoice][KT3Bin][cb]->SetMaximum(r3MAX);
1461     if(cb>2 || KT3Bin==1) r3merged[CoulChoice][KT3Bin][cb]->SetBinContent(2,-100);// 10-20 MeV bin is insignificant
1462     r3merged[CoulChoice][KT3Bin][cb]->GetXaxis()->SetNdivisions(502);// was 404
1463     r3merged[CoulChoice][KT3Bin][cb]->GetYaxis()->SetNdivisions(505);// was absent
1464     r3merged[CoulChoice][KT3Bin][cb]->DrawCopy();
1465     //ChaoticLimit->Draw("same");
1466
1467     ///////////////
1468     // Systematics
1469     TF1 *ResidueFit=new TF1("ResidueFit","[0]+[1]*exp(-[2]*x)",0,0.2);
1470     ResidueFit->SetParameter(0,1);
1471     ResidueFit->SetParameter(1,0.001);
1472     ResidueFit->SetParameter(2,1);
1473     ResidueFit->SetParLimits(0,.9,1.1); ResidueFit->SetParLimits(1,-.2,.2); ResidueFit->SetParLimits(2,-40,200);
1474     c3merged[1][CoulChoice][KT3Bin][cb]->Fit(ResidueFit,"IMNQ","",0.01,0.14);// Remove "N" to see residue fits
1475     //cout<<setprecision(5)<<ResidueFit->Eval(0.08)<<endl;
1476     TH1D *r3MethSys = (TH1D*)r3merged[CoulChoice][KT3Bin][cb]->Clone();
1477     r3MethSys->SetBinContent(1,-10);
1478     r3MethSys->SetMarkerSize(0);
1479     r3MethSys->SetFillStyle(1000);
1480     r3MethSys->SetFillColor(kRed-10);
1481     TH1D *r3DetSys = (TH1D*)r3merged[CoulChoice][KT3Bin][cb]->Clone();
1482     r3DetSys->SetBinContent(1,-10);
1483     r3DetSys->SetBinContent(1,-10);
1484     r3DetSys->SetMarkerSize(0);
1485     r3DetSys->SetFillStyle(1000);
1486     r3DetSys->SetFillColor(kGray+2);
1487     TH1D *r3MethDetSys = (TH1D*)r3merged[CoulChoice][KT3Bin][cb]->Clone();// for fitting systematics
1488     TH1D *r3Coul1 = (TH1D*)r3merged[CoulChoice][KT3Bin][cb]->Clone();
1489     r3Coul1->SetMarkerSize(0);
1490     TH1D *r3Coul2 = (TH1D*)r3merged[1-int(CoulChoice)][KT3Bin][cb]->Clone();
1491     
1492     TF1 *r3LambdaSysFit = new TF1("r3LambdaSysFit","pol1",0,0.15);
1493     r3LambdaSysFit->FixParameter(0,LambdaSysPar0[cb]);
1494     r3LambdaSysFit->FixParameter(1,LambdaSysPar1[cb]);
1495     const int Nb = 20;
1496     double x[Nb]={0};
1497     double y[Nb]={0};
1498     double exL[Nb]={0};
1499     double exH[Nb]={0};
1500     double eyL[Nb]={0};
1501     double eyH[Nb]={0};
1502     for(int ii=0; ii<Nb; ii++){
1503       x[ii] = r3merged[CoulChoice][KT3Bin][cb]->GetXaxis()->GetBinCenter(ii+1);
1504       y[ii] = r3merged[CoulChoice][KT3Bin][cb]->GetBinContent(ii+1);
1505       double ey = r3merged[CoulChoice][KT3Bin][cb]->GetBinContent(ii+1)-r3merged[1-int(CoulChoice)][KT3Bin][cb]->GetBinContent(ii+1);
1506       if(ey>0) eyL[ii] = fabs(ey);
1507       else eyH[ii] = fabs(ey);
1508     }
1509     
1510     TGraphAsymmErrors *r3CoulSys = new TGraphAsymmErrors(Nb,x,y,exL,exH,eyL,eyH);
1511     r3CoulSys->SetLineStyle(2);
1512     for(int bin=1; bin<=11; bin++){
1513       double Q3 = (bin-0.5)*0.01;
1514       double SysMeth=0;
1515       if(C3merged[1][CoulChoice][KT3Bin][cb]->GetBinContent(bin)>0) {
1516         //SysMeth = pow(2 * (fabs(ResidueFit->Eval(Q3)-1.0) + 0.002)/(c3merged[0][CoulChoice][KT3Bin][cb]->GetBinContent(bin)-1.0),2);// mixed-charge baseline (new).  Includes 0.002 as allowed variation through lambda powers
1517         SysMeth = pow((fabs(ResidueFit->Eval(Q3)-1.0)+0.002)/(c3merged[0][CoulChoice][KT3Bin][cb]->GetBinContent(bin)-1.0) * r3merged[CoulChoice][KT3Bin][cb]->GetBinContent(bin),2);// factional error determined from MC residue fit divided by SC cumulant.  Error = Fraction * r3
1518       }
1519       SysMeth += pow(r3LambdaSysFit->Eval(Q3,2)*r3merged[CoulChoice][KT3Bin][cb]->GetBinContent(bin),2);// Lambda 0.7 vs 0.6
1520       double SysDet = pow(0.01*r3merged[CoulChoice][KT3Bin][cb]->GetBinContent(bin),2);// MRC
1521       SysDet += pow(0.01*r3merged[CoulChoice][KT3Bin][cb]->GetBinContent(bin),2);// PID
1522       
1523       r3MethSys->SetBinError(bin, sqrt(SysMeth));
1524       r3DetSys->SetBinError(bin, sqrt(SysDet));
1525       r3MethDetSys->SetBinError(bin, sqrt(pow(r3merged[CoulChoice][KT3Bin][cb]->GetBinError(bin),2) + SysMeth + SysDet));// was SysDet + SysDet by mistake
1526       r3Coul1->SetBinError(bin, sqrt(pow(r3merged[CoulChoice][KT3Bin][cb]->GetBinError(bin),2) + SysMeth + SysDet));
1527       r3Coul2->SetBinError(bin, sqrt(pow(r3merged[CoulChoice][KT3Bin][cb]->GetBinError(bin),2) + SysMeth + SysDet));
1528     }
1529
1530     r3MethSys->Draw("E2 same");
1531     r3DetSys->Draw("E2 same");
1532     r3CoulSys->Draw("P");
1533     //
1534     float MinQ3Fit=0.01;//0.01
1535     float MaxQ3Fit=0.08;//0.1
1536     if(r3merged[CoulChoice][KT3Bin][cb]->GetBinContent(2)<-10) MinQ3Fit=0.02;
1537
1538     r3merged[CoulChoice][KT3Bin][cb]->Fit(QuarticFit[0][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// Stat only
1539     r3MethDetSys->Fit(QuarticFit[1][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// Meth + Det Sys
1540     r3Coul1->Fit(QuarticFit[2][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// GRS
1541     r3Coul2->Fit(QuarticFit[3][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// Omega0
1542     //
1543     r3merged[CoulChoice][KT3Bin][cb]->Fit(QuadraticFit[0][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// Stat only
1544     r3MethDetSys->Fit(QuadraticFit[1][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// Meth + Det Sys
1545     r3Coul1->Fit(QuadraticFit[2][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// GRS
1546     r3Coul2->Fit(QuadraticFit[3][cb],"IMENQ","",MinQ3Fit,MaxQ3Fit);// Omega0
1547     //
1548     //if(cb==1){
1549     //for(int i=0; i<10; i++){
1550     //  cout<<r3MethDetSys->GetBinError(i+1)<<endl;
1551     //}
1552     //}
1553     //
1554     QuarticFit[2][cb]->Draw("same");
1555     QuadraticFit[2][cb]->Draw("same");
1556     r3merged[CoulChoice][KT3Bin][cb]->Draw("same");
1557     //QuadQuarticFit[1][cb]->Draw("same");
1558     //cout<<"Quartic Chi^2/NDF = "<<QuarticFit[cb]->GetChisquare()/QuarticFit[cb]->GetNDF()<<endl;
1559     //cout<<"Quadratic Chi^2/NDF = "<<QuadraticFit[cb]->GetChisquare()/QuadraticFit[cb]->GetNDF()<<endl;
1560     
1561     TLatex *Specif_4 = new TLatex(0.007,r3MIN+(r3MAX-r3MIN)*0.91,"ALICE Pb-Pb #\sqrt{#font[12]{s}_{NN}}=2.76 TeV");// 0.005,2.1
1562     Specif_4->SetTextFont(TextFont);
1563     Specif_4->SetTextSize(SizeSpecif*SF_correction);
1564     if(cb==3) Specif_4->Draw("same");
1565    
1566     
1567     TString *KTString = new TString("");
1568     if(KT3Bin==0) KTString->Append("0.16<#font[12]{K}_{T,3}<0.3 GeV/#font[12]{c}");
1569     else KTString->Append("0.3<#font[12]{K}_{T,3}<1.0 GeV/#font[12]{c}");
1570     TLatex *Kt3Name_2 = new TLatex(0.002,r3MIN+(r3MAX-r3MIN)*0.91,KTString->Data());//
1571     Kt3Name_2->SetTextFont(TextFont);
1572     Kt3Name_2->SetTextSize(SizeLabel*SF_correction);
1573     if(cb==1) Kt3Name_2->Draw("same");
1574     
1575     TLatex *CentLabel_2;
1576     //TString *CentLabel2;
1577     if(cb==0) {CentLabel_2 = new TLatex(0.03,1.52,"0-5%"); }//CentLabel2 = new TString("0-5\\%");}// was 0.04,0.4
1578     else if(cb==1) {CentLabel_2 = new TLatex(0.03,1.52,"5-10%");}// CentLabel2 = new TString("5-10\\%");}
1579     else if(cb==2) {CentLabel_2 = new TLatex(0.03,1.52,"10-20%");}// CentLabel2 = new TString("10-20\\%");}
1580     else if(cb==3) {CentLabel_2 = new TLatex(0.03,1.52,"20-30%");}// CentLabel2 = new TString("20-30\\%");}
1581     else if(cb==4) {CentLabel_2 = new TLatex(0.03,1.52,"30-40%");}// CentLabel2 = new TString("30-40\\%");}
1582     else {CentLabel_2 = new TLatex(0.03,1.52,"40-50%");}// CentLabel2 = new TString("40-50\\%");}
1583     
1584     CentLabel_2->SetTextFont(TextFont);
1585     CentLabel_2->SetTextSize(SizeLabel*SF_correction);
1586     CentLabel_2->Draw("same");
1587     
1588     if(cb==0){
1589       legend6->AddEntry(QuarticFit[1][cb],"Quartic","l");
1590       legend6->AddEntry(QuadraticFit[1][cb],"Quadratic","l");
1591       legend6->Draw("same");
1592     }
1593
1594     ChaoticLimit->Draw("same");
1595   }// cb bin
1596   can5->cd();
1597   TPad *pad5_2 = new TPad("pad5_2","pad5_2",0.0,0.0,1.,1.);
1598   pad5_2->SetFillStyle(0);
1599   pad5_2->Draw();
1600   pad5_2->cd();
1601   TLatex *r3Label = new TLatex(.035,.96,"#font[12]{r}_{3}");// 0.035,0.88
1602   r3Label->SetTextFont(TextFont);
1603   r3Label->SetTextSize(SizeTitle*SF2);
1604   r3Label->SetTextAngle(90);
1605   r3Label->Draw();
1606   CoverUp->Draw();
1607   Q3Label->Draw();
1608   
1609   
1610   ////////////////////////////
1611   // Print Quartic r3 fit values
1612   double I_quartic_Avg=0, I_quadratic_Avg=0;
1613   double I_quartic_AvgErr1=0, I_quadratic_AvgErr1=0;
1614   double I_quartic_AvgErr2=0, I_quadratic_AvgErr2=0;
1615   double a_quartic_Avg=0, a_quadratic_Avg=0;
1616   double a_quartic_AvgErr1=0, a_quadratic_AvgErr1=0;
1617   double a_quartic_AvgErr2=0, a_quadratic_AvgErr2=0;
1618   
1619   cout<<"Quartic"<<endl;
1620   for(int cb=0; cb<6; cb++) {
1621     TString *CentLabel2;
1622     if(cb==0) {CentLabel2 = new TString("0-5\\%");}
1623     else if(cb==1) {CentLabel2 = new TString("5-10\\%");}
1624     else if(cb==2) {CentLabel2 = new TString("10-20\\%");}
1625     else if(cb==3) {CentLabel2 = new TString("20-30\\%");}
1626     else if(cb==4) {CentLabel2 = new TString("30-40\\%");}
1627     else {CentLabel2 = new TString("40-50\\%");}
1628
1629     double SF=1000.;
1630     double I_Sys1=fabs(QuarticFit[1][cb]->GetParameter(0)-QuarticFit[0][cb]->GetParameter(0));// Meth+Det Sys
1631     double I_Sys2=fabs(QuarticFit[2][cb]->GetParameter(0)-QuarticFit[3][cb]->GetParameter(0));// Coulomb Sys
1632     double I_SysTotal = sqrt(pow(I_Sys1,2)+pow(I_Sys2,2));
1633     double a_Sys1=fabs(QuarticFit[1][cb]->GetParameter(1)-QuarticFit[0][cb]->GetParameter(1));
1634     double a_Sys2=fabs(QuarticFit[2][cb]->GetParameter(1)-QuarticFit[3][cb]->GetParameter(1));
1635     a_Sys1 /= SF; a_Sys2 /= SF;
1636     double a_SysTotal = sqrt(pow(a_Sys1,2)+pow(a_Sys2,2));
1637     I_quartic_Avg += QuarticFit[1][cb]->GetParameter(0);// [1] has both Stat+Sys errors
1638     I_quartic_AvgErr1 += pow(QuarticFit[0][cb]->GetParError(0),2);// [0] has only Stat errors
1639     I_quartic_AvgErr2 += I_SysTotal;
1640     a_quartic_Avg += QuarticFit[1][cb]->GetParameter(1)/SF;
1641     a_quartic_AvgErr1 += pow(QuarticFit[0][cb]->GetParError(1)/SF,2);
1642     a_quartic_AvgErr2 += sqrt(pow(a_Sys1,2) + pow(a_Sys2,2));
1643
1644     cout.precision(3);
1645     cout<<"$"<<setprecision(2)<<fixed<<CentLabel2->Data()<<"$ & $"<<QuarticFit[1][cb]->GetParameter(0)<<" \\pm "<<QuarticFit[0][cb]->GetParError(0)<<" \\pm "<<I_SysTotal<<"$ & $"<<setprecision(1)<<fixed<<QuarticFit[1][cb]->GetParameter(1)/SF<<" \\pm "<<QuarticFit[0][cb]->GetParError(1)/SF<<" \\pm "<<a_SysTotal<<"$ \\\\ \\hline"<<endl;
1646   }
1647   I_quartic_Avg /= 6.; I_quartic_AvgErr1 = sqrt(I_quartic_AvgErr1)/6.; I_quartic_AvgErr2 = I_quartic_AvgErr2/6.;
1648   a_quartic_Avg /= 6.; a_quartic_AvgErr1 = sqrt(a_quartic_AvgErr1)/6.; a_quartic_AvgErr2 = a_quartic_AvgErr2/6.;
1649   cout<<"$"<<setprecision(2)<<fixed<<"0-50\\%"<<"$ & $"<<I_quartic_Avg<<" \\pm "<<I_quartic_AvgErr1<<" \\pm "<<I_quartic_AvgErr2<<"$ & $"<<setprecision(1)<<fixed<<a_quartic_Avg<<" \\pm "<<a_quartic_AvgErr1<<" \\pm "<<a_quartic_AvgErr2<<"$ \\\\ \\hline"<<endl;
1650   
1651   /*TCanvas *can5_5 = new TCanvas("can5_5", "can5_5",680,300,600,600);// 11,53,700,500
1652   can5_5->SetHighLightColor(2);
1653   gStyle->SetOptFit(0111);
1654   can5_5->SetFillColor(0);//10
1655   can5_5->SetBorderMode(0);
1656   can5_5->SetBorderSize(2);
1657   can5_5->SetFrameFillColor(0);
1658   can5_5->SetFrameBorderMode(0);
1659   can5_5->SetFrameBorderMode(0);
1660   can5_5->Draw();
1661   double Iold_K1[6]={1.84,1.84,1.82,1.84,1.79,1.73};
1662   double Iold_K2[6]={1.94,1.92,2.02,1.98,2.01,2.03};
1663   double aold_K1[6]={13.8,10.6,6.9,6.7,3.7,4.9};
1664   double aold_K2[6]={8.7,4.6,4.4,1.8,-0.2,-1.8};
1665
1666   TH1D *ratioMuonCorr=new TH1D("ratioMuonCorr","",6,0.5,6.5);
1667   ratioMuonCorr->GetXaxis()->SetBinLabel(1,"0-5%");
1668   ratioMuonCorr->GetXaxis()->SetBinLabel(2,"5-10%");
1669   ratioMuonCorr->GetXaxis()->SetBinLabel(3,"10-20%");
1670   ratioMuonCorr->GetXaxis()->SetBinLabel(4,"20-30%");
1671   ratioMuonCorr->GetXaxis()->SetBinLabel(5,"30-40%");
1672   ratioMuonCorr->GetXaxis()->SetBinLabel(6,"40-50%");
1673   ratioMuonCorr->GetYaxis()->SetTitle("New/Old"); ratioMuonCorr->GetYaxis()->SetTitleOffset(1.8);
1674   ratioMuonCorr->SetTitle("Quartic coefficient");
1675   for(int i=0; i<6; i++){
1676     ratioMuonCorr->SetBinContent(i+1, QuarticFit[1][i]->GetParameter(1)/SF/aold_K1[i]);
1677     ratioMuonCorr->SetBinError(i+1, 1000./QuarticFit[1][i]->GetParameter(1));// 0.015/1.8 for I_K1, 0.03/1.8 for I_K2, 
1678   }
1679   ratioMuonCorr->Draw();
1680   */
1681   
1682   ////////////////////////////
1683   cout<<"Quadratic"<<endl;
1684   for(int cb=0; cb<6; cb++) {
1685     TString *CentLabel2;
1686     if(cb==0) {CentLabel2 = new TString("0-5\\%");}
1687     else if(cb==1) {CentLabel2 = new TString("5-10\\%");}
1688     else if(cb==2) {CentLabel2 = new TString("10-20\\%");}
1689     else if(cb==3) {CentLabel2 = new TString("20-30\\%");}
1690     else if(cb==4) {CentLabel2 = new TString("30-40\\%");}
1691     else {CentLabel2 = new TString("40-50\\%");}
1692     double SF=10.;
1693     cout.precision(4);
1694     double I_Sys1 = fabs(QuadraticFit[1][cb]->GetParameter(0)-QuadraticFit[0][cb]->GetParameter(0));// Meth+Det Sys
1695     double I_Sys2 = fabs(QuadraticFit[2][cb]->GetParameter(0)-QuadraticFit[3][cb]->GetParameter(0));// Coulomb Sys
1696     double I_SysTotal = sqrt(pow(I_Sys1,2)+pow(I_Sys2,2));
1697     double a_Sys1=fabs(QuadraticFit[1][cb]->GetParameter(1)-QuadraticFit[0][cb]->GetParameter(1));
1698     double a_Sys2 = fabs(QuadraticFit[2][cb]->GetParameter(1)-QuadraticFit[3][cb]->GetParameter(1));
1699     a_Sys1 /= SF; a_Sys2 /= SF;
1700     double a_SysTotal = sqrt(pow(a_Sys1,2)+pow(a_Sys2,2));
1701     I_quadratic_Avg += QuadraticFit[1][cb]->GetParameter(0);
1702     I_quadratic_AvgErr1 += pow(QuadraticFit[0][cb]->GetParError(0),2);
1703     I_quadratic_AvgErr2 += I_SysTotal;
1704     a_quadratic_Avg += QuadraticFit[1][cb]->GetParameter(1)/SF;
1705     a_quadratic_AvgErr1 += pow(QuadraticFit[0][cb]->GetParError(1)/SF,2);
1706     a_quadratic_AvgErr2 += sqrt(pow(a_Sys1,2) + pow(a_Sys2,2));
1707     cout.precision(3);
1708     cout<<"$"<<setprecision(2)<<fixed<<CentLabel2->Data()<<"$ & $"<<QuadraticFit[1][cb]->GetParameter(0)<<" \\pm "<<QuadraticFit[0][cb]->GetParError(0)<<" \\pm "<<I_SysTotal<<"$ & $"<<setprecision(1)<<fixed<<QuadraticFit[1][cb]->GetParameter(1)/SF<<" \\pm "<<QuadraticFit[0][cb]->GetParError(1)/SF<<" \\pm "<<a_SysTotal<<"$ \\\\ \\hline"<<endl;
1709   }
1710   I_quadratic_Avg /= 6.; I_quadratic_AvgErr1 = sqrt(I_quadratic_AvgErr1)/6.; I_quadratic_AvgErr2 = I_quadratic_AvgErr2/6.;
1711   a_quadratic_Avg /= 6.; a_quadratic_AvgErr1 = sqrt(a_quadratic_AvgErr1)/6.; a_quadratic_AvgErr2 = a_quadratic_AvgErr2/6.;
1712   cout<<"$"<<setprecision(2)<<fixed<<"0-50\\%"<<"$ & $"<<I_quadratic_Avg<<" \\pm "<<I_quadratic_AvgErr1<<" \\pm "<<I_quadratic_AvgErr2<<"$ & $"<<setprecision(1)<<fixed<<a_quadratic_Avg<<" \\pm "<<a_quadratic_AvgErr1<<" \\pm "<<a_quadratic_AvgErr2<<"$ \\\\ \\hline"<<endl;
1713   
1714  
1715
1716
1717   
1718   ////////////////////////////////////////////////////////////////////////////////
1719   // Coulomb Variation
1720   
1721   int CBOI_SS=1;// 1=5-10%
1722   TCanvas *can6 = new TCanvas("can6", "can6",1800,300,600,900);// 680,300,600,600
1723   can6->SetHighLightColor(2);
1724   gStyle->SetOptFit(0111);
1725   can6->SetFillColor(0);//10
1726   can6->SetBorderMode(0);
1727   can6->SetBorderSize(2);
1728   can6->SetFrameFillColor(0);
1729   can6->SetFrameBorderMode(0);
1730   can6->SetFrameBorderMode(0);
1731   
1732   TPad *pad6 = new TPad("pad6","pad6",0.0,0.0,1.,1.);
1733   gPad->SetGridx(0);
1734   gPad->SetGridy(0);
1735   gPad->SetTickx();
1736   gPad->SetTicky();
1737   pad6->SetBottomMargin(0.07);//0.12
1738   pad6->SetTopMargin(0.02);//0.05
1739   pad6->SetRightMargin(0.01);//1e-2
1740   pad6->Divide(1,2,0,0);
1741   pad6->Draw();
1742   pad6->cd(1);
1743   TLegend *legend7 = new TLegend(.8,.05, .98,.2,NULL,"brNDC");//c3
1744   legend7->SetBorderSize(0);
1745   legend7->SetTextFont(TextFont);
1746   legend7->SetTextSize(SizeLegend*SF1);
1747   legend7->SetFillColor(0);
1748   
1749   //
1750   r3merged[1][KT3Bin][CBOI_SS]->SetMarkerStyle(24); r3merged[1][KT3Bin][CBOI_SS]->SetMarkerColor(2); r3merged[1][KT3Bin][CBOI_SS]->SetLineColor(2);// Omega0, Kt3_1
1751   r3merged[0][KT3Bin][CBOI_SS]->SetMinimum(1.1); r3merged[0][KT3Bin][CBOI_SS]->SetMaximum(2.35); 
1752   c3merged[1][1][KT3Bin][CBOI_SS]->SetMarkerStyle(21); c3merged[1][1][KT3Bin][CBOI_SS]->SetMarkerColor(4); c3merged[1][1][KT3Bin][CBOI_SS]->SetLineColor(4);// Omega0, Kt3_1
1753   c3merged[1][0][KT3Bin][CBOI_SS]->SetMinimum(0.995); c3merged[1][0][KT3Bin][CBOI_SS]->SetMaximum(1.065); 
1754   //
1755   gPad->SetRightMargin(RightMargin); gPad->SetLeftMargin(0.13);
1756   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetLabelFont(TextFont); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetLabelFont(TextFont); 
1757   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetLabelSize(0); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetLabelSize(SizeLabel*SF1);
1758   //
1759   r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleOffset(0.8);
1760   r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleFont(TextFont);
1761   r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleSize(SizeTitle*SF1);
1762   r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitle("#font[12]{r}_{3}");
1763   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetRangeUser(0,0.08);
1764   //
1765   r3merged[0][KT3Bin][CBOI_SS]->SetMinimum(0.9); r3merged[0][KT3Bin][CBOI_SS]->SetMaximum(2.4);
1766   r3merged[0][KT3Bin][CBOI_SS]->SetMarkerSize(1.5);
1767   r3merged[1][KT3Bin][CBOI_SS]->SetMarkerSize(1.7);
1768   r3merged[0][KT3Bin][CBOI_SS]->DrawCopy();
1769   r3merged[1][KT3Bin][CBOI_SS]->DrawCopy("same");
1770   ChaoticLimit->Draw("same");
1771   legend7->AddEntry(r3merged[0][KT3Bin][CBOI_SS],"GRS","p");
1772   legend7->AddEntry(r3merged[1][KT3Bin][CBOI_SS],"#Omega_{0}","p");
1773   legend7->Draw("same");
1774   TLatex *Specif_5 = new TLatex(0.36,0.94,"ALICE Pb-Pb #\sqrt{#font[12]{s}_{NN}}=2.76 TeV");
1775   Specif_5->SetNDC();
1776   Specif_5->SetTextFont(TextFont);
1777   Specif_5->SetTextSize(SizeSpecif*SF1);
1778   TLatex *Specif2_5 = new TLatex(0.5,0.1,"5-10%");
1779   Specif2_5->SetNDC();
1780   Specif2_5->SetTextFont(TextFont);
1781   Specif2_5->SetTextSize(SizeLabel*SF1);
1782   Specif_5->Draw();
1783   Specif2_5->Draw();
1784   TString *KTString = new TString("");
1785   if(KT3Bin==0) KTString->Append("0.16<#font[12]{K}_{T,3}<0.3 GeV/#font[12]{c}");
1786   else KTString->Append("0.3<#font[12]{K}_{T,3}<1.0 GeV/#font[12]{c}");
1787   TLatex *Kt3Name_3 = new TLatex(0.36,0.22,KTString->Data());
1788   Kt3Name_3->SetNDC();
1789   Kt3Name_3->SetTextFont(TextFont);
1790   Kt3Name_3->SetTextSize(SizeLabel*SF1);
1791   Kt3Name_3->Draw("same");
1792   
1793   //
1794   //
1795   pad6->cd(2);
1796   SF_correction=0.97;
1797   gPad->SetRightMargin(RightMargin); gPad->SetLeftMargin(0.13); gPad->SetBottomMargin(0.16);
1798   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetLabelFont(TextFont); c3merged[1][0][KT3Bin][CBOI_SS]->GetYaxis()->SetLabelFont(TextFont);
1799   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetLabelSize(SizeLabel*SF1*SF_correction); c3merged[1][0][KT3Bin][CBOI_SS]->GetYaxis()->SetLabelSize(SizeLabel*SF1*SF_correction);
1800   c3merged[1][0][KT3Bin][CBOI_SS]->SetMarkerStyle(21);
1801   c3merged[1][1][KT3Bin][CBOI_SS]->SetMarkerStyle(25);
1802   c3merged[1][0][KT3Bin][CBOI_SS]->SetMarkerSize(1.5);
1803   c3merged[1][1][KT3Bin][CBOI_SS]->SetMarkerSize(1.7);
1804   //
1805   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitleOffset(0.9); c3merged[1][0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleOffset(0.8);
1806   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitleFont(TextFont); c3merged[1][0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleFont(TextFont);
1807   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitleSize(SizeTitle*SF1); c3merged[1][0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleSize(SizeTitle*SF1);
1808   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitle("#font[12]{Q}_{3} (GeV/#font[12]{c})"); 
1809   c3merged[1][0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitle("#font[12]{#bf{c}}_{3}^{#pm#pm#mp}");
1810   c3merged[1][0][KT3Bin][CBOI_SS]->GetYaxis()->SetNdivisions(504);
1811   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetNdivisions(503);
1812   //
1813   c3merged[1][0][KT3Bin][CBOI_SS]->GetXaxis()->SetRangeUser(0,0.08);
1814   c3merged[1][0][KT3Bin][CBOI_SS]->SetMaximum(1.08);
1815   TLegend *legend8 = new TLegend(.8,.8, .98,.95,NULL,"brNDC");//c3
1816   legend8->SetBorderSize(0);
1817   legend8->SetTextFont(TextFont);
1818   legend8->SetTextSize(SizeLegend*SF1);
1819   legend8->SetFillColor(0);
1820   c3merged[1][0][KT3Bin][CBOI_SS]->DrawCopy();
1821   c3merged[1][1][KT3Bin][CBOI_SS]->DrawCopy("same");
1822   legend8->AddEntry(c3merged[1][0][KT3Bin][CBOI_SS],"GRS","p");
1823   legend8->AddEntry(c3merged[1][1][KT3Bin][CBOI_SS],"#Omega_{0}","p");
1824   legend8->Draw("same");
1825   BaseLine->Draw("same");
1826   
1827   
1828   //can6->SaveAs("SaveFigs/Fig_r3c3_CoulVar.eps");
1829   ///////////////////////////////////////////////////
1830   // Lambda variation
1831   
1832   TCanvas *can7 = new TCanvas("can7", "can7",1800,300,600,600);// 680,300,600,600
1833   can7->SetHighLightColor(2);
1834   gStyle->SetOptFit(0111);
1835   can7->SetFillColor(0);//10
1836   can7->SetBorderMode(0);
1837   can7->SetBorderSize(2);
1838   can7->SetFrameFillColor(0);
1839   can7->SetFrameBorderMode(0);
1840   can7->SetFrameBorderMode(0);
1841   
1842   TPad *pad7 = new TPad("pad7","pad7",0.0,0.0,1.,1.);
1843   gPad->SetGridx(0);
1844   gPad->SetGridy(0);
1845   //gPad->SetTickx();
1846   //gPad->SetTicky();
1847   pad7->SetBottomMargin(0.07);//0.12
1848   pad7->SetTopMargin(0.02);//0.05
1849   pad7->SetRightMargin(0.01);//1e-2
1850   pad7->Draw();
1851   TLegend *legend9 = new TLegend(.75,.7, .95,.85,NULL,"brNDC");//c3
1852   legend9->SetBorderSize(0);
1853   legend9->SetTextFont(TextFont);
1854   legend9->SetTextSize(SizeLegend*SF2);
1855   legend9->SetFillColor(0);
1856   
1857   gPad->SetRightMargin(0.01); gPad->SetLeftMargin(0.13); gPad->SetBottomMargin(0.13); gPad->SetTopMargin(0.01);
1858   r3merged[0][KT3Bin][CBOI_SS]->SetMinimum(r3MIN); r3merged[0][KT3Bin][CBOI_SS]->SetMaximum(r3MAX);
1859   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetLabelFont(TextFont); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetLabelFont(TextFont);
1860   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetLabelSize(SizeLabel*SF2); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetLabelSize(SizeLabel*SF2);
1861   //
1862   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitleFont(TextFont); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleFont(TextFont); 
1863   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitleSize(SizeTitle*SF2); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleSize(SizeTitle*SF2);
1864   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitle("#font[12]{Q}_{3} (GeV/#font[12]{c})"); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitle("#font[12]{r}_{3}");
1865   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetTitleOffset(0.9); r3merged[0][KT3Bin][CBOI_SS]->GetYaxis()->SetTitleOffset(1.05); 
1866   TH1D *r3LambdaVaried = (TH1D*)r3merged[0][KT3Bin][CBOI_SS]->Clone();
1867   r3LambdaVaried->SetMarkerStyle(25);
1868   TF1 *r3LambdaSysFit = new TF1("r3LambdaSysFit","pol1",0,0.1);
1869   r3LambdaSysFit->FixParameter(0,LambdaSysPar0[CBOI_SS]);
1870   r3LambdaSysFit->FixParameter(1,LambdaSysPar1[CBOI_SS]);
1871   for(int bin=1; bin<=11; bin++){
1872     double Q3 = (bin-0.5)*0.01;
1873     r3LambdaVaried->SetBinContent(bin, (1-r3LambdaSysFit->Eval(Q3)) * r3LambdaVaried->GetBinContent(bin));
1874   }
1875   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetNdivisions(503);
1876   r3merged[0][KT3Bin][CBOI_SS]->GetXaxis()->SetRangeUser(0,0.08);
1877
1878   r3merged[0][KT3Bin][CBOI_SS]->DrawCopy();
1879   r3LambdaVaried->DrawCopy("same");
1880   ChaoticLimit->Draw("same");
1881   legend9->AddEntry(r3merged[0][KT3Bin][CBOI_SS],"#lambda=0.7","p");
1882   legend9->AddEntry(r3LambdaVaried,"#lambda=0.6","p");
1883   legend9->Draw("same");
1884   
1885   TLatex *Specif_6 = new TLatex(0.36,0.94,"ALICE Pb-Pb #\sqrt{#font[12]{s}_{NN}}=2.76 TeV");
1886   Specif_6->SetNDC();
1887   Specif_6->SetTextFont(TextFont);
1888   Specif_6->SetTextSize(SizeSpecif*SF2);
1889   TLatex *Specif2_6 = new TLatex(0.5,0.2,"5-10%");
1890   Specif2_6->SetNDC();
1891   Specif2_6->SetTextFont(TextFont);
1892   Specif2_6->SetTextSize(SizeLegend*SF2);
1893   Specif_6->Draw();
1894   Specif2_6->Draw();
1895   TString *KTString = new TString("");
1896   if(KT3Bin==0) KTString->Append("0.16<#font[12]{K}_{T,3}<0.3 GeV/#font[12]{c}");
1897   else KTString->Append("0.3<#font[12]{K}_{T,3}<1.0 GeV/#font[12]{c}");
1898   TLatex *Kt3Name_4 = new TLatex(0.36,0.28,KTString->Data());
1899   Kt3Name_4->SetNDC();
1900   Kt3Name_4->SetTextFont(TextFont);
1901   Kt3Name_4->SetTextSize(SizeLabel*SF2);
1902   Kt3Name_4->Draw("same");
1903
1904   //can7->SaveAs("SaveFigs/Fig_r3_LamVar.eps");
1905
1906   //TString *OutName=new TString("r3_M");
1907   //TString *OutName=new TString("c3mc_M");
1908   //TString *OutName=new TString("c3mc_GaussK3_M");
1909   //*OutName += BOI_1;
1910   //OutName->Append(".png");
1911   //can6->SaveAs(OutName->Data());
1912   
1913
1914   
1915  
1916   /*
1917   // digitized from Wilson's Thesis
1918   double Wilson_Q3[18]={0};
1919   double Wilson_Q3_e[18]={0};
1920   double Wilson_C3[18]={2.02, 1.345, 1.51, 1.514, 1.51, 1.453, 1.394, 1.329, 1.277, 1.228, 1.188, 1.16, 1.132, 1.116, 1.092, 1.076, 1.064, 1.052};
1921   double Wilson_C3_eh[18]={2.97, 1.445, 1.54, 1.53, 1.518, 0,0,0,0,0,0,0,0,0,0,0,0,0};
1922   double Wilson_C3_e[18]={0};
1923   for(int i=0; i<18; i++){
1924     Wilson_Q3[i] = (i+0.5)*0.005 + .010;
1925     Wilson_C3_e[i] = Wilson_C3_eh[i]-Wilson_C3[i];
1926     if(Wilson_C3_e[i] > 1) Wilson_C3_e[i]=0;
1927   }
1928   TGraphErrors *gr_Wilson = new TGraphErrors(18, Wilson_Q3, Wilson_C3, Wilson_Q3_e, Wilson_C3_e);
1929   gr_Wilson->SetMarkerStyle(20);
1930   gr_Wilson->SetMarkerColor(2);
1931   gr_Wilson->SetLineColor(2);
1932   //gr_Wilson->Draw("P");
1933   //legend1->AddEntry(gr_Wilson,"STAR 0-12%: 130 GeV","p");
1934   
1935   // digitized from Phys. Rev. Lett. 87 (2001) 82301
1936   double STAR_130GeV_C2[20]={1.21, 1.211, 1.182, 1.135, 1.095, 1.064, 1.0389, 1.023, 1.014, 1.0047, 1.0016, 1.001, 1,1,1,1,1,1,1,1};
1937   double STAR_130GeV_C2_e[20]={0};
1938   double STAR_130GeV_C2_qinv[20]={0};
1939   for(int i=0; i<20; i++) STAR_130GeV_C2_qinv[i] = (i+0.5)*0.005;
1940   TGraphErrors *gr_STAR_C2_130 = new TGraphErrors(20,STAR_130GeV_C2_qinv, STAR_130GeV_C2, 0,0);
1941   gr_STAR_C2_130->SetMarkerStyle(20);
1942   gr_STAR_C2_130->SetMarkerColor(2);
1943   //gr_STAR_C2_130->Draw("P");
1944   //legend1->AddEntry(gr_STAR_C2_130,"STAR 0-12%: 130 GeV","p");
1945   
1946   TF1 *line=new TF1("line","3",0,100);
1947   line->SetLineStyle(1);
1948   //line->Draw("same");
1949   //legend1->AddEntry(line,"Chaotic limit #font[12]{c}_{3}","l");
1950   TF1 *line2=new TF1("line2","6",0,100);
1951   line2->SetLineStyle(1);
1952   line2->SetLineColor(4);
1953   //line2->Draw("same");
1954   //legend1->AddEntry(line2,"Chaotic limit C_{3}","l");
1955   TF1 *line3=new TF1("line3","1",0,100);
1956   line3->SetLineStyle(1);
1957   //line3->Draw("same");
1958   //legend1->AddEntry(line3,"Chaotic limit","l");
1959   */
1960   /*
1961   //TLatex *tex = new TLatex(0.001,0.09,"q_{ij} > 0.01 GeV/c");//1.54,2300
1962   //TLatex *tex = new TLatex(0.05,4,"#\lambda=0.4#pm0.04, R=7#pm0.5 fm");// for C3
1963   //TLatex *tex = new TLatex(0.05,1.17,"#\lambda=0.4#pm0.04, R=7#pm0.5 fm");// for C2(+-) 0-5%
1964   //TLatex *tex = new TLatex(0.05,1.17,"#\lambda=0.4#pm0.04, R=4#pm0.5 fm");// for C2(+-) 45-50%
1965   TLatex *tex = new TLatex(0.0005,-.9,"#\lambda=0.4#pm0.04, R=7#pm0.5 fm");// for r3
1966   
1967   tex->SetTextSize(.04);
1968   //tex->Draw("same");
1969
1970   TLatex *tex2 = new TLatex(0.002,5.75,"Chaotic Limit C_{3}");
1971   tex2->SetTextSize(.04);
1972   tex2->SetTextColor(4);
1973   //tex2->Draw("same");
1974
1975   TLatex *tex3 = new TLatex(0.002,2.75,"Chaotic Limit #font[12]{c}_{3}");
1976   tex3->SetTextSize(.04);
1977   tex3->SetTextColor(2);
1978   //tex3->Draw("same");
1979   
1980   TLatex *tex4 = new TLatex(0.0005,-0.5,"Spherical Gaussian Coulomb WF");
1981   tex4->SetTextSize(.05);
1982   tex4->SetTextColor();
1983   //tex4->Draw("same");
1984
1985   TLatex *tex5 = new TLatex(0.0005,.5,"Pb-Pb #sqrt{#font[12]{s}_{NN}}=2.76 TeV: 0-10% Centrality");
1986   tex5->SetTextSize(.04);
1987   tex5->SetTextColor();
1988   //tex5->Draw("same");
1989   */
1990   //
1991   /*
1992   TF1 *C2noConstraint=new TF1("C2noConstraint","2-pow(x,2)",0,1);
1993   C2noConstraint->SetLineColor(2);
1994   TF1 *C2Constraint=new TF1("C2Constraint","2-4/5.*pow(x,2)",0,1);
1995   C2Constraint->SetLineColor(4);
1996   C2Constraint->GetXaxis()->SetTitle("G");
1997   C2Constraint->GetYaxis()->SetTitle("C_{2}^{++} Intercept");
1998   C2Constraint->GetXaxis()->SetTitleSize(0.06);
1999   C2Constraint->GetYaxis()->SetTitleSize(0.06);
2000   C2Constraint->GetXaxis()->SetTitleOffset(.8);
2001   C2Constraint->GetYaxis()->SetTitleOffset(.7);
2002   C2Constraint->SetTitle("");
2003   TF1 *C3noConstraint=new TF1("C3noConstraint","6-9*pow(x,2)+4*pow(x,3)",0,1);
2004   C3noConstraint->SetLineColor(2);
2005   //C3noConstraint->SetLineStyle(2);
2006   TF1 *C3Constraint=new TF1("C3Constraint","6-36/5.*pow(x,2)+96/35.*pow(x,3)",0,1);
2007   C3Constraint->SetLineColor(4);
2008   //C3Constraint->SetLineStyle(2);
2009   C3Constraint->GetXaxis()->SetTitle("G");
2010   C3Constraint->GetYaxis()->SetTitle("C_{3}^{+++} Intercept");
2011   C3Constraint->GetXaxis()->SetTitleSize(0.06);
2012   C3Constraint->GetYaxis()->SetTitleSize(0.06);
2013   C3Constraint->GetXaxis()->SetTitleOffset(.8);
2014   C3Constraint->GetYaxis()->SetTitleOffset(.7);
2015   C3Constraint->SetTitle("");
2016   C3Constraint->Draw();
2017   legend1->AddEntry(C3Constraint,"C_{3}^{+++} Charge-Constrained","l");
2018   C3noConstraint->Draw("same");
2019   legend1->AddEntry(C3noConstraint,"C_{3}^{+++} Charge-Unconstrained","l");
2020   //C2Constraint->Draw();
2021   //legend1->AddEntry(C2Constraint,"C_{2}^{++} Charge-Constrained","l");
2022   //C2noConstraint->Draw("same");
2023   //legend1->AddEntry(C2noConstraint,"C_{2}^{++} Charge-Unconstrained","l");
2024   legend1->SetTextSize(.03);
2025   */
2026   
2027   /*TF1 *r3noConstraint = new TF1("r3noConstraint","(2-6*pow(x,2)+4*pow(x,3))/pow(1-pow(x,2),1.5)",0,1);
2028   r3noConstraint->SetLineColor(2);
2029   r3noConstraint->GetXaxis()->SetTitle("G");
2030   r3noConstraint->GetYaxis()->SetTitle("r_{3} Intercept");
2031   r3noConstraint->GetXaxis()->SetTitleSize(0.06);
2032   r3noConstraint->GetYaxis()->SetTitleSize(0.06);
2033   r3noConstraint->GetXaxis()->SetTitleOffset(.8);
2034   r3noConstraint->GetYaxis()->SetTitleOffset(.7);
2035   r3noConstraint->SetTitle("");
2036   TF1 *r3Constraint = new TF1("r3Constraint","(2-24/5.*pow(x,2)+96/35.*pow(x,3))/pow(1-4/5.*pow(x,2),1.5)",0,1);
2037   r3Constraint->SetLineColor(4);
2038   r3Constraint->GetXaxis()->SetTitle("G");
2039   r3Constraint->GetYaxis()->SetTitle("r_{3} Intercept");
2040   r3Constraint->GetXaxis()->SetTitleSize(0.06);
2041   r3Constraint->GetYaxis()->SetTitleSize(0.06);
2042   r3Constraint->GetXaxis()->SetTitleOffset(.8);
2043   r3Constraint->GetYaxis()->SetTitleOffset(.7);
2044   r3Constraint->SetTitle("");
2045   r3Constraint->Draw();
2046   //legend1->AddEntry(r3Constraint,"Charge-Constrained","l");
2047   r3noConstraint->Draw("same");
2048   //legend1->AddEntry(r3noConstraint,"Charge-Unconstrained","l");
2049   //cout<<setprecision(5)<<r3noConstraint->Eval(0.3)<<"  "<<r3Constraint->Eval(0.3)<<endl;
2050   */
2051   //legend1->Draw("same");
2052
2053   //DrawALICELogo(kTRUE, 0.82,0.24,1.12,0.44);// C3(+++)
2054   //DrawALICELogo(kTRUE, 0.32,0.47,0.65,0.7);// C2(+-)
2055   //DrawALICELogo(kTRUE, 0.3,0.18,0.63,0.36);// r3
2056   //can1->SaveAs("test.eps");
2057
2058 }
2059 //____________________________________________________________________________________________________
2060 void DrawALICELogo(Bool_t prel, Float_t x1, Float_t y1, Float_t x2, Float_t y2)
2061 {
2062   // revision on July 24th or 25th 2012
2063   // correct for aspect ratio of figure plus aspect ratio of pad (coordinates are NDC!)
2064   x2 = x1 + (y2 - y1) * (466. / 523) * gPad->GetWh() * gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetWw());
2065   // Printf("%f %f %f %f", x1, x2, y1, y2);
2066   
2067   TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo", x1, y1, x2, y2);
2068   myPadLogo->SetLeftMargin(0);
2069   myPadLogo->SetTopMargin(0);
2070   myPadLogo->SetRightMargin(0);
2071   myPadLogo->SetBottomMargin(0);
2072   myPadLogo->Draw();
2073   myPadLogo->cd();
2074   TASImage *myAliceLogo = new TASImage((prel) ? "~/Pictures/alice_logo_preliminary.eps" : "~/Pictures/alice_logo_performance.eps");
2075   myAliceLogo->Draw();
2076 }
2077