a3e3ff14cd155bab2f79062f71e46b6e614adbe6
[u/mrichter/AliRoot.git] / PWG2 / FLOW / macros / CompareFlowResults.C
1 //type of analysis can be: ESD, AOD, MC, ESDMC0, ESDMC1
2 //const TString type = "ESD"; 
3 void CompareFlowResults(TString type="ESD")
4 {
5   //load needed libraries:
6   gSystem->AddIncludePath("-I$ROOTSYS/include");
7   gSystem->Load("libTree.so");
8
9   // for AliRoot
10   gSystem->AddIncludePath("-I$ALICE_ROOT/include");
11   gSystem->Load("libANALYSIS.so");
12   gSystem->Load("libPWG2flow.so");
13   cerr<<"libPWG2flow.so loaded ..."<<endl;
14   
15   // for root load histrogram classes
16   // output histosgrams
17   //  gROOT->LoadMacro("code/AliFlowCommonHist.cxx+");
18   //  gROOT->LoadMacro("code/AliFlowCommonHistResults.cxx+");
19   //  gROOT->LoadMacro("code/AliFlowLYZHist1.cxx+");
20   //  gROOT->LoadMacro("code/AliFlowLYZHist2.cxx+");  
21   
22   
23   //==================================================================================
24   //             set here which plots will be shown by default
25   //==================================================================================
26   //RP = particles used to determine the reaction plane
27   Bool_t plotIntFlowRP = kFALSE;     //integrated flow RP
28   Bool_t plotDiffFlowPtRP = kFALSE;  //differential flow (Pt,RP)
29   Bool_t plotDiffFlowEtaRP = kFALSE; //differential flow (Eta,RP)
30   //POI = particle of interest
31   Bool_t plotIntFlowPOI = kTRUE;     //integrated flow POI
32   Bool_t plotDiffFlowPtPOI = kTRUE;   //differential flow (Pt,POI)
33   Bool_t plotDiffFlowEtaPOI = kTRUE;  //differential flow (Eta,POI)
34   //==================================================================================
35   
36   
37   
38   
39   //==================================================================================
40   //                         accessing output files
41   //==================================================================================
42   
43   //open the output files:
44   TString inputFileNameMCEP = "outputMCEPanalysis";
45   TFile* fileMCEP = NULL;
46   fileMCEP = TFile::Open(((inputFileNameMCEP.Append(type)).Append(".root")).Data(), "READ"); 
47   
48   TString inputFileNameLYZ1 = "outputLYZ1analysis";
49   TFile* fileLYZ1 = NULL;
50   fileLYZ1 = TFile::Open(((inputFileNameLYZ1.Append(type)).Append(".root")).Data(), "READ"); 
51   
52   TString inputFileNameLYZ2 = "outputLYZ2analysis";
53   TFile* fileLYZ2 = NULL;
54   fileLYZ2 = TFile::Open(((inputFileNameLYZ2.Append(type)).Append(".root")).Data(), "READ"); 
55   
56   TString inputFileNameLYZEP = "outputLYZEPanalysis";
57   TFile* fileLYZEP = NULL;
58   fileLYZEP = TFile::Open(((inputFileNameLYZEP.Append(type)).Append(".root")).Data(), "READ");
59   
60   TString inputFileNameFQD = "outputFQDanalysis";
61   TFile* fileFQD = NULL;
62   fileFQD = TFile::Open(((inputFileNameFQD.Append(type)).Append(".root")).Data(), "READ"); 
63   
64   TString inputFileNameGFC = "outputGFCanalysis";
65   TFile* fileGFC = NULL;
66   fileGFC = TFile::Open(((inputFileNameGFC.Append(type)).Append(".root")).Data(), "READ"); 
67   
68   TString inputFileNameQC = "outputQCanalysis";
69   TFile* fileQC = NULL;
70   fileQC = TFile::Open(((inputFileNameQC.Append(type)).Append(".root")).Data(), "READ"); 
71   //==================================================================================
72  
73  
74  
75  
76   //==================================================================================
77   //                                 cosmetics
78   //==================================================================================
79   //removing the title and stat. box from all histograms:
80   gStyle->SetOptTitle(0);
81   gStyle->SetOptStat(0);
82   
83   //choosing the style and color of mesh for MC error bands:
84   Int_t meshStyle = 1001;
85   Int_t meshColor = kRed-10;
86   
87   //marker style and color (int. flow) 
88   Int_t markerStyle = 21;
89   Int_t markerColor = kRed-3;
90   //==================================================================================
91   
92   
93   
94   
95   //==================================================================================
96   //                              INTEGRATED FLOW
97   //==================================================================================
98   //the number of different methods:
99   const Int_t nMethods=12;
100   
101   //booking the histogram for the integrated flow results from all methods:
102   TH1D* intFlowAll = new TH1D("intFlowAll","Integrated Flow",nMethods,0,nMethods);      
103   //intFlowAll->SetLabelSize(0.036,"X");
104   //intFlowAll->SetLabelSize(0.036,"Y");
105   intFlowAll->SetMarkerStyle(markerStyle);
106   intFlowAll->SetMarkerColor(markerColor);
107   (intFlowAll->GetXaxis())->SetBinLabel(1,"v_{2}{MC}");
108   (intFlowAll->GetXaxis())->SetBinLabel(2,"v_{2}{2,GFC}");
109   (intFlowAll->GetXaxis())->SetBinLabel(3,"v_{2}{2,QC}");
110   (intFlowAll->GetXaxis())->SetBinLabel(4,"v_{2}{4,GFC}");
111   (intFlowAll->GetXaxis())->SetBinLabel(5,"v_{2}{4,QC}");
112   (intFlowAll->GetXaxis())->SetBinLabel(6,"v_{2}{6,GFC}");
113   (intFlowAll->GetXaxis())->SetBinLabel(7,"v_{2}{6,QC}");
114   (intFlowAll->GetXaxis())->SetBinLabel(8,"v_{2}{8,GFC}");
115   (intFlowAll->GetXaxis())->SetBinLabel(9,"v_{2}{8,QC}");
116   (intFlowAll->GetXaxis())->SetBinLabel(10,"v_{2}{FQD}");
117   (intFlowAll->GetXaxis())->SetBinLabel(11,"v_{2}{LYZ}");
118   (intFlowAll->GetXaxis())->SetBinLabel(12,"v_{2}{LYZEP}");
119   
120   //booking the graph to store flow values and errors from all methods:  
121   Double_t x[nMethods] = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5};
122   Double_t xError[nMethods] = {0.};
123   Double_t flowValue[nMethods] = {0.};//to be removed
124   Double_t flowError[nMethods] = {0.};//to be removed
125   Double_t flowValueRP[nMethods] = {0.};
126   Double_t flowErrorRP[nMethods] = {0.};
127   Double_t flowValuePOI[nMethods] = {0.};
128   Double_t flowErrorPOI[nMethods] = {0.};
129   
130   //accessing the results for each method:
131   //MCEP = Monte Carlo Event Plane
132   TList *pListMCEP = NULL;
133   AliFlowCommonHist *mcepCommonHist = NULL;
134   AliFlowCommonHistResults *mcepCommonHistRes = NULL; 
135   if(fileMCEP) {
136     fileMCEP->GetObject("cobjMCEP",pListMCEP); 
137     if(pListMCEP) {
138       mcepCommonHist    = dynamic_cast<AliFlowCommonHist*> (pListMCEP->FindObject("AliFlowCommonHistMCEP"));
139       mcepCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListMCEP->FindObject("AliFlowCommonHistResultsMCEP"));
140       if(mcepCommonHistRes) {
141         flowValue[0] = (mcepCommonHistRes->GetHistIntFlow())->GetBinContent(1);//to be removed
142         flowError[0] = (mcepCommonHistRes->GetHistIntFlow())->GetBinError(1);//to be removed
143         flowValueRP[0] = (mcepCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
144         flowErrorRP[0] = (mcepCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
145         flowValuePOI[0] = (mcepCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
146         flowErrorPOI[0] = (mcepCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
147       }
148     }
149   }
150   
151   //LYZ1 = Lee-Yang Zeros (1st run)
152   TList *pListLYZ1 = NULL;
153   AliFlowCommonHist *lyz1CommonHist = NULL;
154   AliFlowCommonHistResults *lyz1CommonHistRes = NULL; 
155   if(fileLYZ1) {
156     fileLYZ1->GetObject("cobjLYZ1",pListLYZ1); 
157     if(pListLYZ1) {
158       lyz1CommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZ1->FindObject("AliFlowCommonHistLYZ1"));
159       lyz1CommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZ1->FindObject("AliFlowCommonHistResultsLYZ1"));
160       if(lyz1CommonHistRes) {
161         flowValue[10] = (lyz1CommonHistRes->GetHistIntFlow())->GetBinContent(1);//to be removed
162         flowError[10] = (lyz1CommonHistRes->GetHistIntFlow())->GetBinError(1);//to be removed
163         flowValueRP[10] = (lyz1CommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
164         flowErrorRP[10] = (lyz1CommonHistRes->GetHistIntFlowRP())->GetBinError(1);
165         flowValuePOI[10] = (lyz1CommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
166         flowErrorPOI[10] = (lyz1CommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
167       }
168     }
169   }
170   
171   //LYZ2 = Lee-Yang Zeros (2nd run) (needed only for differential flow)
172   TList *pListLYZ2 = NULL;
173   AliFlowCommonHist *lyz2CommonHist = NULL;
174   AliFlowCommonHistResults *lyz2CommonHistRes = NULL; 
175   if(fileLYZ2) {
176     fileLYZ2->GetObject("cobjLYZ2",pListLYZ2); 
177     if(pListLYZ2) {
178       lyz2CommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZ2->FindObject("AliFlowCommonHistLYZ2"));
179       lyz2CommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZ2->FindObject("AliFlowCommonHistResultsLYZ2"));
180     }
181   }
182   
183   //LYZEP = Lee-Yang Zeros Event Plane
184   TList *pListLYZEP = NULL;
185   AliFlowCommonHist *lyzepCommonHist = NULL;
186   AliFlowCommonHistResults *lyzepCommonHistRes = NULL; 
187   if(fileLYZEP) {
188     fileLYZEP->GetObject("cobjLYZEP",pListLYZEP); 
189     if(pListLYZEP) {
190       lyzepCommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZEP->FindObject("AliFlowCommonHistLYZEP"));
191       lyzepCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZEP->FindObject("AliFlowCommonHistResultsLYZEP"));
192       if(lyzepCommonHistRes) {
193         flowValue[11] = (lyzepCommonHistRes->GetHistIntFlow())->GetBinContent(1);//to be removed
194         //flowError[11] = (lyzepCommonHistRes->GetHistIntFlow())->GetBinError(1);//to be removed
195         flowValueRP[11] = (lyzepCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
196         //flowErrorRP[11] = (lyzepCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
197         flowValuePOI[11] = (lyzepCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
198         //flowErrorPOI[11] = (lyzepCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
199       }
200     }
201   }
202  
203   //FQD = Fitting q-distribution
204   TList *pListFQD = NULL;
205   AliFlowCommonHist *fqdCommonHist = NULL;
206   AliFlowCommonHistResults *fqdCommonHistRes = NULL; 
207   if(fileFQD) {
208     fileFQD->GetObject("cobjFQD",pListFQD); 
209     if(pListFQD) {
210       fqdCommonHist = dynamic_cast<AliFlowCommonHist*> (pListFQD->FindObject("AliFlowCommonHistFQD"));
211       fqdCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListFQD->FindObject("AliFlowCommonHistResultsFQD"));
212       if(fqdCommonHistRes) {
213         flowValue[9] = (fqdCommonHistRes->GetHistIntFlow())->GetBinContent(1);//to be removed
214         flowError[9] = (fqdCommonHistRes->GetHistIntFlow())->GetBinError(1);//to be removed
215         flowValueRP[9] = (fqdCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
216         flowErrorRP[9] = (fqdCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
217         flowValuePOI[9] = (fqdCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
218         flowErrorPOI[9] = (fqdCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
219       }
220     }
221   }
222  
223   //GFC = Generating Function Cumulants
224   TList *pListGFC = NULL;
225   AliFlowCommonHist *gfcCommonHist = NULL;
226   AliFlowCommonHistResults *gfcCommonHistRes2 = NULL; 
227   AliFlowCommonHistResults *gfcCommonHistRes4 = NULL; 
228   AliFlowCommonHistResults *gfcCommonHistRes6 = NULL; 
229   AliFlowCommonHistResults *gfcCommonHistRes8 = NULL; 
230   if(fileGFC) {
231     fileGFC->GetObject("cobjGFC",pListGFC);
232     if(pListGFC) {
233       gfcCommonHist = dynamic_cast<AliFlowCommonHist*> (pListGFC->FindObject("AliFlowCommonHistGFC"));
234       gfcCommonHistRes2 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults2ndOrderGFC"));
235       if(gfcCommonHistRes2) {
236         flowValue[1] = (gfcCommonHistRes2->GetHistIntFlow())->GetBinContent(1);//to be removed
237         flowError[1] = (gfcCommonHistRes2->GetHistIntFlow())->GetBinError(1);//to be removed
238         flowValueRP[1] = (gfcCommonHistRes2->GetHistIntFlowRP())->GetBinContent(1);
239         flowErrorRP[1] = (gfcCommonHistRes2->GetHistIntFlowRP())->GetBinError(1);
240         flowValuePOI[1] = (gfcCommonHistRes2->GetHistIntFlowPOI())->GetBinContent(1);
241         flowErrorPOI[1] = (gfcCommonHistRes2->GetHistIntFlowPOI())->GetBinError(1);
242       }
243       gfcCommonHistRes4 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults4thOrderGFC"));
244       if(gfcCommonHistRes4) {
245         flowValue[3] = (gfcCommonHistRes4->GetHistIntFlow())->GetBinContent(1);//to be removed
246         flowError[3] = (gfcCommonHistRes4->GetHistIntFlow())->GetBinError(1);//to be removed
247         flowValueRP[3] = (gfcCommonHistRes4->GetHistIntFlowRP())->GetBinContent(1);
248         flowErrorRP[3] = (gfcCommonHistRes4->GetHistIntFlowRP())->GetBinError(1);
249         flowValuePOI[3] = (gfcCommonHistRes4->GetHistIntFlowPOI())->GetBinContent(1);
250         flowErrorPOI[3] = (gfcCommonHistRes4->GetHistIntFlowPOI())->GetBinError(1);
251       }
252       gfcCommonHistRes6 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults6thOrderGFC"));
253       if(gfcCommonHistRes6) {
254         flowValue[5] = (gfcCommonHistRes6->GetHistIntFlow())->GetBinContent(1);//to be removed
255         flowError[5] = (gfcCommonHistRes6->GetHistIntFlow())->GetBinError(1);//to be removed
256         flowValueRP[5] = (gfcCommonHistRes6->GetHistIntFlowRP())->GetBinContent(1);
257         flowErrorRP[5] = (gfcCommonHistRes6->GetHistIntFlowRP())->GetBinError(1);
258         flowValuePOI[5] = (gfcCommonHistRes6->GetHistIntFlowPOI())->GetBinContent(1);
259         flowErrorPOI[5] = (gfcCommonHistRes6->GetHistIntFlowPOI())->GetBinError(1);
260       }
261       gfcCommonHistRes8 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults8thOrderGFC"));
262       if(gfcCommonHistRes8)  {
263         flowValue[7] = (gfcCommonHistRes8->GetHistIntFlow())->GetBinContent(1);//to be removed
264         flowError[7] = (gfcCommonHistRes8->GetHistIntFlow())->GetBinError(1);//to be removed
265         flowValueRP[7] = (gfcCommonHistRes8->GetHistIntFlowRP())->GetBinContent(1);
266         flowErrorRP[7] = (gfcCommonHistRes8->GetHistIntFlowRP())->GetBinError(1);
267         flowValuePOI[7] = (gfcCommonHistRes8->GetHistIntFlowPOI())->GetBinContent(1);
268         flowErrorPOI[7] = (gfcCommonHistRes8->GetHistIntFlowPOI())->GetBinError(1);
269       }
270     }
271   }
272  
273   //QC = Q-cumulants
274   TList *pListQC = NULL;
275   AliFlowCommonHist *qcCommonHist2 = NULL; 
276   AliFlowCommonHist *qcCommonHist4 = NULL; 
277   AliFlowCommonHist *qcCommonHist6 = NULL; 
278   AliFlowCommonHist *qcCommonHist8 = NULL; 
279   AliFlowCommonHistResults *qcCommonHistRes2 = NULL; 
280   AliFlowCommonHistResults *qcCommonHistRes4 = NULL; 
281   AliFlowCommonHistResults *qcCommonHistRes6 = NULL; 
282   AliFlowCommonHistResults *qcCommonHistRes8 = NULL; 
283   
284   if(fileQC) {
285     fileQC->GetObject("cobjQC",pListQC);
286     if(pListQC) {
287       qcCommonHist2 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist2ndOrderQC"));
288       qcCommonHistRes2 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults2ndOrderQC"));
289       if(qcCommonHistRes2)  {
290         flowValue[2] = (qcCommonHistRes2->GetHistIntFlow())->GetBinContent(1);//to be removed
291         //flowError[2] = (qcCommonHistRes2->GetHistIntFlow())->GetBinError(1);//to be removed
292         flowValueRP[2] = (qcCommonHistRes2->GetHistIntFlowRP())->GetBinContent(1);
293         //flowErrorRP[2] = (qcCommonHistRes2->GetHistIntFlowRP())->GetBinError(1);
294         flowValuePOI[2] = (qcCommonHistRes2->GetHistIntFlowPOI())->GetBinContent(1);
295         //flowErrorPOI[2] = (qcCommonHistRes2->GetHistIntFlowPOI())->GetBinError(1);
296       }
297       qcCommonHist4 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist4thOrderQC"));
298       qcCommonHistRes4 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults4thOrderQC"));
299       if(qcCommonHistRes4) {
300         flowValue[4] = (qcCommonHistRes4->GetHistIntFlow())->GetBinContent(1);//to be removed
301         //flowError[4] = (qcCommonHistRes4->GetHistIntFlow())->GetBinError(1);//to be removed
302         flowValueRP[4] = (qcCommonHistRes4->GetHistIntFlowRP())->GetBinContent(1);
303         //flowErrorRP[4] = (qcCommonHistRes4->GetHistIntFlowRP())->GetBinError(1);
304         flowValuePOI[4] = (qcCommonHistRes4->GetHistIntFlowPOI())->GetBinContent(1);
305         //flowErrorPOI[4] = (qcCommonHistRes4->GetHistIntFlowPOI())->GetBinError(1);
306       }
307       qcCommonHist6 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist6thOrderQC"));
308       qcCommonHistRes6 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults6thOrderQC"));
309       if(qcCommonHistRes6) {
310         flowValue[6] = (qcCommonHistRes6->GetHistIntFlow())->GetBinContent(1);//to be removed
311         //flowError[6] = (qcCommonHistRes6->GetHistIntFlow())->GetBinError(1);//to be removed
312         flowValueRP[6] = (qcCommonHistRes6->GetHistIntFlowRP())->GetBinContent(1);
313         //flowErrorRP[6] = (qcCommonHistRes6->GetHistIntFlowRP())->GetBinError(1);
314         flowValuePOI[6] = (qcCommonHistRes6->GetHistIntFlowPOI())->GetBinContent(1);
315         //flowErrorPOI[6] = (qcCommonHistRes6->GetHistIntFlowPOI())->GetBinError(1);
316       }
317       qcCommonHist8 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist8thOrderQC"));
318       qcCommonHistRes8 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults8thOrderQC"));
319       if(qcCommonHistRes8)  {
320         flowValue[8] = (qcCommonHistRes8->GetHistIntFlow())->GetBinContent(1);//to be removed
321         //flowError[8] = (qcCommonHistRes8->GetHistIntFlow())->GetBinError(1);//to be removed
322         flowValueRP[8] = (qcCommonHistRes8->GetHistIntFlowRP())->GetBinContent(1);
323         //flowErrorRP[8] = (qcCommonHistRes8->GetHistIntFlowRP())->GetBinError(1);
324         flowValuePOI[8] = (qcCommonHistRes8->GetHistIntFlowPOI())->GetBinContent(1);
325         //flowErrorPOI[8] = (qcCommonHistRes8->GetHistIntFlowPOI())->GetBinError(1);
326       }
327     }
328   }        
329   
330   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
331   //              !!!!  to be removed  !!!!
332   Double_t dMax=flowValue[0]+flowError[0];
333   Double_t dMin=flowValue[0]-flowError[0];
334   
335   for(Int_t i=1;i<nMethods;i++) {
336     if(!(flowValue[i]==0. && flowError[i]==0.)) {
337       if(dMax<flowValue[i]+flowError[i]) dMax=flowValue[i]+flowError[i];
338       if(dMin>flowValue[i]-flowError[i]) dMin=flowValue[i]-flowError[i];
339     } 
340   }  
341   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
342   
343   //RP:
344   Double_t dMaxRP=flowValueRP[0]+flowErrorRP[0];
345   Double_t dMinRP=flowValueRP[0]-flowErrorRP[0];
346   
347   for(Int_t i=1;i<nMethods;i++) {
348     if(!(flowValueRP[i]==0. && flowErrorRP[i]==0.)) {
349       if(dMaxRP<flowValueRP[i]+flowErrorRP[i]) dMaxRP=flowValueRP[i]+flowErrorRP[i];
350       if(dMinRP>flowValueRP[i]-flowErrorRP[i]) dMinRP=flowValueRP[i]-flowErrorRP[i];
351     } 
352   }  
353
354   //POI:
355   Double_t dMaxPOI=flowValuePOI[0]+flowErrorPOI[0];
356   Double_t dMinPOI=flowValuePOI[0]-flowErrorPOI[0];
357   
358   for(Int_t i=1;i<nMethods;i++) {
359     if(!(flowValuePOI[i]==0. && flowErrorPOI[i]==0.)) {
360       if(dMaxPOI<flowValuePOI[i]+flowErrorPOI[i]) dMaxPOI=flowValuePOI[i]+flowErrorPOI[i];
361       if(dMinPOI>flowValuePOI[i]-flowErrorPOI[i]) dMinPOI=flowValuePOI[i]-flowErrorPOI[i];
362     } 
363   }  
364  
365   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
366   //                    !!!!  to be removed  !!!!
367   TGraph* flowResults = new TGraphErrors(nMethods, x, flowValue, xError, flowError);
368  
369   flowResults->SetMarkerStyle(markerStyle);
370   flowResults->SetMarkerColor(markerColor);
371   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
372   
373   //RP:
374   TGraph* flowResultsRP = new TGraphErrors(nMethods, x, flowValueRP, xError, flowErrorRP);
375   
376   flowResultsRP->SetMarkerStyle(markerStyle);
377   flowResultsRP->SetMarkerColor(markerColor);
378   
379   //POI:
380   TGraph* flowResultsPOI = new TGraphErrors(nMethods, x, flowValuePOI, xError, flowErrorPOI);
381   
382   flowResultsPOI->SetMarkerStyle(markerStyle);
383   flowResultsPOI->SetMarkerColor(markerColor);
384   
385   //-----------------------------------------------------------------------------------
386   
387   //----------------------------------------------------------------------------------
388   //cosmetics: mesh for MC error bands (integrated flow)
389   TGraph* pMesh = NULL;//to be removed
390   TGraph* pMeshRP = NULL;
391   TGraph* pMeshPOI = NULL;
392   
393   if(intFlowAll && mcepCommonHistRes) {
394     //Double_t valueMC = intFlowAll->GetBinContent(1);
395     //Double_t errorMC = intFlowAll->GetBinError(1);  
396     //Int_t nPts       = intFlowAll->GetNbinsX();     
397     
398     Int_t nPts       = nMethods;
399     Double_t valueMC = flowValue[0];//to be removed
400     Double_t errorMC = flowError[0];//to be removed  
401     Double_t valueMCRP = flowValueRP[0];
402     Double_t errorMCRP = flowErrorRP[0]; 
403     Double_t valueMCPOI = flowValuePOI[0];
404     Double_t errorMCPOI = flowErrorPOI[0]; 
405     
406     pMesh = new TGraph(nPts);//to be removed
407     pMeshRP = new TGraph(nPts);
408     pMeshPOI = new TGraph(nPts);
409     
410     //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
411     //             !!!! to be removed !!!!
412     pMesh->SetPoint(1,0,valueMC+errorMC);
413     pMesh->SetPoint(2,nPts+1,valueMC+errorMC);
414     pMesh->SetPoint(3,nPts+1,valueMC-errorMC);
415     pMesh->SetPoint(4,0,valueMC-errorMC);
416     pMesh->SetPoint(5,0,valueMC+errorMC);
417     
418     pMesh->SetFillStyle(meshStyle);
419     pMesh->SetFillColor(meshColor);
420     //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
421     
422     //RP:
423     pMeshRP->SetPoint(1,0,valueMCRP+errorMCRP);
424     pMeshRP->SetPoint(2,nPts+1,valueMCRP+errorMCRP);
425     pMeshRP->SetPoint(3,nPts+1,valueMCRP-errorMCRP);
426     pMeshRP->SetPoint(4,0,valueMCRP-errorMCRP);
427     pMeshRP->SetPoint(5,0,valueMCRP+errorMCRP);
428     
429     pMeshRP->SetFillStyle(meshStyle);
430     pMeshRP->SetFillColor(meshColor);
431     
432     //POI:
433     pMeshPOI->SetPoint(1,0,valueMCPOI+errorMCPOI);
434     pMeshPOI->SetPoint(2,nPts+1,valueMCPOI+errorMCPOI);
435     pMeshPOI->SetPoint(3,nPts+1,valueMCPOI-errorMCPOI);
436     pMeshPOI->SetPoint(4,0,valueMCPOI-errorMCPOI);
437     pMeshPOI->SetPoint(5,0,valueMCPOI+errorMCPOI);
438     
439     pMeshPOI->SetFillStyle(meshStyle);
440     pMeshPOI->SetFillColor(meshColor);     
441   }
442   //---------------------------------------------------------------------------------- 
443  
444   
445   //----------------------------------------------------------------------------------
446   //cosmetics: text (integrated flow) 
447   //default text:
448   TPaveText *textDefault = new TPaveText(0.05,0.77,0.95,0.90,"NDC");
449   textDefault->SetTextFont(72);
450   textDefault->SetTextSize(0.08);
451   //textDefault->SetLineColor(kFALSE);
452   //textDefault->SetShadowColor(kFALSE);
453   
454   TString *entryDefaultAvM = new TString("Average Multiplicity");
455   TString *entryDefaultAnd = new TString("and"); 
456   TString *entryDefaultNumOfEvts = new TString("Number of Events:");
457   
458   textDefault->AddText(entryDefaultAvM->Data());
459   textDefault->AddText(entryDefaultAnd->Data());
460   textDefault->AddText(entryDefaultNumOfEvts->Data());
461   
462   //results:
463   TPaveText *textResults = new TPaveText(0.05,0.12,0.95,0.70,"NDC");//to be removed
464   textResults->SetTextFont(72);//to be removed
465   textResults->SetTextSize(0.06);//to be removed
466   //textResults->SetLineColor(kFALSE);
467   //textResults->SetShadowColor(kFALSE);
468   
469   //results (RP):
470   TPaveText *textResultsRP = new TPaveText(0.05,0.12,0.95,0.70,"NDC");
471   textResultsRP->SetTextFont(72);
472   textResultsRP->SetTextSize(0.06);
473   
474   //results (POI):
475   TPaveText *textResultsPOI = new TPaveText(0.05,0.12,0.95,0.70,"NDC");
476   textResultsPOI->SetTextFont(72);
477   textResultsPOI->SetTextSize(0.06);
478   
479   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
480   //      !!!! to be removed !!!!!!                                      
481   TString *entryMC    = new TString("MC ...... ");
482   TString *entryGFC   = new TString("GFC ..... "); 
483   TString *entryQC2   = new TString("QC{2} ... ");
484   TString *entryQC4   = new TString("QC{4} ... ");
485   TString *entryQC6   = new TString("QC{6} ... ");
486   TString *entryQC8   = new TString("QC{8} ... ");
487   TString *entryFQD   = new TString("FQD ..... "); 
488   TString *entryLYZ1  = new TString("LYZ ..... "); 
489   TString *entryLYZEP = new TString("LYZEP ... "); 
490   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
491   
492   //RP: 
493   TString *entryMCRP    = new TString("MC ...... ");
494   TString *entryGFCRP   = new TString("GFC ..... "); 
495   TString *entryQC2RP   = new TString("QC{2} ... ");
496   TString *entryQC4RP   = new TString("QC{4} ... ");
497   TString *entryQC6RP   = new TString("QC{6} ... ");
498   TString *entryQC8RP   = new TString("QC{8} ... ");
499   TString *entryFQDRP   = new TString("FQD ..... "); 
500   TString *entryLYZ1RP  = new TString("LYZ ..... "); 
501   TString *entryLYZEPRP = new TString("LYZEP ... "); 
502
503   //POI: 
504   TString *entryMCPOI    = new TString("MC ...... ");
505   TString *entryGFCPOI   = new TString("GFC ..... "); 
506   TString *entryQC2POI   = new TString("QC{2} ... ");
507   TString *entryQC4POI   = new TString("QC{4} ... ");
508   TString *entryQC6POI   = new TString("QC{6} ... ");
509   TString *entryQC8POI   = new TString("QC{8} ... ");
510   TString *entryFQDPOI   = new TString("FQD ..... "); 
511   TString *entryLYZ1POI  = new TString("LYZ ..... "); 
512   TString *entryLYZEPPOI = new TString("LYZEP ... "); 
513   
514   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
515   //                  !!!! to be removed !!!!
516   Double_t avMultMC=0.;
517   Long_t nEvtsMC=0;
518   
519   Double_t avMultGFC=0.;
520   Long_t nEvtsGFC=0;
521   
522   Double_t avMultQC2=0., avMultQC4=0., avMultQC6=0., avMultQC8=0.;
523   Long_t nEvtsQC2=0, nEvtsQC4=0, nEvtsQC6=0, nEvtsQC8=0;
524   
525   Double_t avMultFQD=0.;
526   Long_t nEvtsFQD=0;
527   
528   Double_t avMultLYZ1=0.;
529   Long_t nEvtsLYZ1=0;
530   
531   Double_t avMultLYZEP=0.;
532   Long_t nEvtsLYZEP=0;
533   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
534   
535   //RP:
536   Double_t avMultMCRP=0.;
537   Long_t nEvtsMCRP=0;
538   
539   Double_t avMultGFCRP=0.;
540   Long_t nEvtsGFCRP=0;
541   
542   Double_t avMultQC2RP=0., avMultQC4RP=0., avMultQC6RP=0., avMultQC8RP=0.;
543   Long_t nEvtsQC2RP=0, nEvtsQC4RP=0, nEvtsQC6RP=0, nEvtsQC8RP=0;
544   
545   Double_t avMultFQDRP=0.;
546   Long_t nEvtsFQDRP=0;
547   
548   Double_t avMultLYZ1RP=0.;
549   Long_t nEvtsLYZ1RP=0;
550   
551   Double_t avMultLYZEPRP=0.;
552   Long_t nEvtsLYZEPRP=0;
553   
554   //POI:
555   Double_t avMultMCPOI=0.;
556   Long_t nEvtsMCPOI=0;
557   
558   Double_t avMultGFCPOI=0.;
559   Long_t nEvtsGFCPOI=0;
560   
561   Double_t avMultQC2POI=0., avMultQC4POI=0., avMultQC6POI=0., avMultQC8POI=0.;
562   Long_t nEvtsQC2POI=0, nEvtsQC4POI=0, nEvtsQC6POI=0, nEvtsQC8POI=0;
563   
564   Double_t avMultFQDPOI=0.;
565   Long_t nEvtsFQDPOI=0;
566   
567   Double_t avMultLYZ1POI=0.;
568   Long_t nEvtsLYZ1POI=0;
569   
570   Double_t avMultLYZEPPOI=0.;
571   Long_t nEvtsLYZEPPOI=0;
572   
573   //MC:  
574   if(mcepCommonHist) {
575     avMultMC = (mcepCommonHist->GetHistMultInt())->GetMean();//to be removed
576     nEvtsMC  = (mcepCommonHist->GetHistMultInt())->GetEntries();//to be removed
577     avMultMCRP = (mcepCommonHist->GetHistMultInt())->GetMean();
578     nEvtsMCRP  = (mcepCommonHist->GetHistMultInt())->GetEntries();
579     avMultMCPOI = (mcepCommonHist->GetHistMultDiff())->GetMean();
580     nEvtsMCPOI  = (mcepCommonHist->GetHistMultDiff())->GetEntries();
581   }
582   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
583   //   !!!! to be removed !!!!
584   if(entryMC) {   
585     entryMC->Append("M = ");
586     (*entryMC)+=(Long_t)avMultMC;
587     entryMC->Append(", N = ");
588     (*entryMC)+=(Long_t)nEvtsMC;
589   }
590  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
591   if(entryMCRP) {   
592     entryMCRP->Append("M = ");
593     (*entryMCRP)+=(Long_t)avMultMCRP;
594     entryMCRP->Append(", N = ");
595     (*entryMCRP)+=(Long_t)nEvtsMCRP;
596   }
597  if(entryMCPOI) {   
598    entryMCPOI->Append("M = ");
599    (*entryMCPOI)+=(Long_t)avMultMCPOI;
600    entryMCPOI->Append(", N = ");
601    (*entryMCPOI)+=(Long_t)nEvtsMCPOI;
602  }
603   
604  //GFC:
605  if(gfcCommonHist) {
606    avMultGFC = (gfcCommonHist->GetHistMultInt())->GetMean();//to be removed
607    nEvtsGFC  = (gfcCommonHist->GetHistMultInt())->GetEntries();//to be removed
608    avMultGFCRP = (gfcCommonHist->GetHistMultInt())->GetMean();
609    nEvtsGFCRP  = (gfcCommonHist->GetHistMultInt())->GetEntries();
610    avMultGFCPOI = (gfcCommonHist->GetHistMultDiff())->GetMean();
611    nEvtsGFCPOI  = (gfcCommonHist->GetHistMultDiff())->GetEntries();
612  }
613  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
614  //   !!!! to be removed !!!! 
615  if(entryGFC) { 
616    entryGFC->Append("M = ");
617    (*entryGFC)+=(Long_t)avMultGFC;
618    entryGFC->Append(", N = ");
619    (*entryGFC)+=(Long_t)nEvtsGFC;
620  }
621  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
622  if(entryGFCRP) { 
623    entryGFCRP->Append("M = ");
624    (*entryGFCRP)+=(Long_t)avMultGFCRP;
625    entryGFCRP->Append(", N = ");
626    (*entryGFCRP)+=(Long_t)nEvtsGFCRP;
627  }
628  if(entryGFCPOI) { 
629    entryGFCPOI->Append("M = ");
630    (*entryGFCPOI)+=(Long_t)avMultGFCPOI;
631    entryGFCPOI->Append(", N = ");
632    (*entryGFCPOI)+=(Long_t)nEvtsGFCPOI;
633  }
634  
635  //QC:
636  if(qcCommonHist2) {
637    avMultQC2 = (qcCommonHist2->GetHistMultInt())->GetMean();//to be removed
638    nEvtsQC2  = (qcCommonHist2->GetHistMultInt())->GetEntries();//to be removed
639    avMultQC2RP = (qcCommonHist2->GetHistMultInt())->GetMean();
640    nEvtsQC2RP  = (qcCommonHist2->GetHistMultInt())->GetEntries();
641    avMultQC2POI = (qcCommonHist2->GetHistMultDiff())->GetMean();
642    nEvtsQC2POI  = (qcCommonHist2->GetHistMultDiff())->GetEntries();
643  }
644  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
645  //   !!!! to be removed !!!!   
646  if(entryQC2)
647  { 
648   entryQC2->Append("M = ");
649   (*entryQC2)+=(Long_t)avMultQC2;
650   entryQC2->Append(", N = ");
651   (*entryQC2)+=(Long_t)nEvtsQC2;
652  }
653  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
654  if(entryQC2RP)
655  { 
656   entryQC2RP->Append("M = ");
657   (*entryQC2RP)+=(Long_t)avMultQC2RP;
658   entryQC2RP->Append(", N = ");
659   (*entryQC2RP)+=(Long_t)nEvtsQC2RP;
660  } 
661  if(entryQC2POI)
662  { 
663   entryQC2POI->Append("M = ");
664   (*entryQC2POI)+=(Long_t)avMultQC2POI;
665   entryQC2POI->Append(", N = ");
666   (*entryQC2POI)+=(Long_t)nEvtsQC2POI;
667  } 
668
669  if(qcCommonHist4)
670  {
671   avMultQC4 = (qcCommonHist4->GetHistMultInt())->GetMean();//to be removed
672   nEvtsQC4  = (qcCommonHist4->GetHistMultInt())->GetEntries();//to be removed
673   avMultQC4RP = (qcCommonHist4->GetHistMultInt())->GetMean();
674   nEvtsQC4RP  = (qcCommonHist4->GetHistMultInt())->GetEntries();
675   avMultQC4POI = (qcCommonHist4->GetHistMultDiff())->GetMean();
676   nEvtsQC4POI  = (qcCommonHist4->GetHistMultDiff())->GetEntries();
677  }
678  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
679  //   !!!! to be removed !!!!  
680  if(entryQC4)
681  {
682   entryQC4->Append("M = ");
683   (*entryQC4)+=(Long_t)avMultQC4;
684   entryQC4->Append(", N = ");
685   (*entryQC4)+=(Long_t)nEvtsQC4;
686  }
687  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
688  if(entryQC4RP)
689  {
690   entryQC4RP->Append("M = ");
691   (*entryQC4RP)+=(Long_t)avMultQC4RP;
692   entryQC4RP->Append(", N = ");
693   (*entryQC4RP)+=(Long_t)nEvtsQC4RP;
694  }
695  if(entryQC4POI)
696  {
697   entryQC4POI->Append("M = ");
698   (*entryQC4POI)+=(Long_t)avMultQC4POI;
699   entryQC4POI->Append(", N = ");
700   (*entryQC4POI)+=(Long_t)nEvtsQC4POI;
701  }
702    
703  if(qcCommonHist6)
704  {
705   avMultQC6 = (qcCommonHist6->GetHistMultInt())->GetMean();//to be removed
706   nEvtsQC6  = (qcCommonHist6->GetHistMultInt())->GetEntries();//to be removed
707   avMultQC6RP = (qcCommonHist6->GetHistMultInt())->GetMean();
708   nEvtsQC6RP  = (qcCommonHist6->GetHistMultInt())->GetEntries();
709   avMultQC6POI = (qcCommonHist6->GetHistMultDiff())->GetMean();
710   nEvtsQC6POI  = (qcCommonHist6->GetHistMultDiff())->GetEntries();
711  }
712  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
713  //   !!!! to be removed !!!!   
714  if(entryQC6)
715  {  
716   entryQC6->Append("M = ");
717   (*entryQC6)+=(Long_t)avMultQC6;
718   entryQC6->Append(", N = ");
719   (*entryQC6)+=(Long_t)nEvtsQC6;
720  }
721  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
722  if(entryQC6RP)
723  {  
724   entryQC6RP->Append("M = ");
725   (*entryQC6RP)+=(Long_t)avMultQC6RP;
726   entryQC6RP->Append(", N = ");
727   (*entryQC6RP)+=(Long_t)nEvtsQC6RP;
728  }
729  if(entryQC6POI)
730  {  
731   entryQC6POI->Append("M = ");
732   (*entryQC6POI)+=(Long_t)avMultQC6POI;
733   entryQC6POI->Append(", N = ");
734   (*entryQC6POI)+=(Long_t)nEvtsQC6POI;
735  }
736    
737  if(qcCommonHist8)
738  {
739   avMultQC8 = (qcCommonHist8->GetHistMultInt())->GetMean();//to be removed
740   nEvtsQC8  = (qcCommonHist8->GetHistMultInt())->GetEntries();//to be removed
741   avMultQC8RP = (qcCommonHist8->GetHistMultInt())->GetMean();
742   nEvtsQC8RP  = (qcCommonHist8->GetHistMultInt())->GetEntries();
743   avMultQC8POI = (qcCommonHist8->GetHistMultDiff())->GetMean();
744   nEvtsQC8POI  = (qcCommonHist8->GetHistMultDiff())->GetEntries();    
745  }
746  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
747  //   !!!! to be removed !!!!    
748  if(entryQC8)
749  {
750   entryQC8->Append("M = ");
751   (*entryQC8)+=(Long_t)avMultQC8;
752   entryQC8->Append(", N = ");
753   (*entryQC8)+=(Long_t)nEvtsQC8;
754  }
755  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
756  if(entryQC8RP)
757  {
758   entryQC8RP->Append("M = ");
759   (*entryQC8RP)+=(Long_t)avMultQC8RP;
760   entryQC8RP->Append(", N = ");
761   (*entryQC8RP)+=(Long_t)nEvtsQC8RP;
762  }
763  if(entryQC8POI)
764  {
765   entryQC8POI->Append("M = ");
766   (*entryQC8POI)+=(Long_t)avMultQC8POI;
767   entryQC8POI->Append(", N = ");
768   (*entryQC8POI)+=(Long_t)nEvtsQC8POI;
769  }
770   
771  //FQD:
772  if(fqdCommonHist)
773  {
774   avMultFQD = (fqdCommonHist->GetHistMultInt())->GetMean();//to be removed
775   nEvtsFQD  = (fqdCommonHist->GetHistMultInt())->GetEntries();//to be removed
776   avMultFQDRP = (fqdCommonHist->GetHistMultInt())->GetMean();
777   nEvtsFQDRP  = (fqdCommonHist->GetHistMultInt())->GetEntries();
778   avMultFQDPOI = (fqdCommonHist->GetHistMultDiff())->GetMean();
779   nEvtsFQDPOI  = (fqdCommonHist->GetHistMultDiff())->GetEntries();
780  } 
781  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
782  //   !!!! to be removed !!!!  
783  if(entryFQD)
784  {
785   entryFQD->Append("M = ");
786   (*entryFQD)+=(Long_t)avMultFQD;
787   entryFQD->Append(", N = ");
788   (*entryFQD)+=(Long_t)nEvtsFQD;
789  }
790  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
791  if(entryFQDRP)
792  {
793   entryFQDRP->Append("M = ");
794   (*entryFQDRP)+=(Long_t)avMultFQDRP;
795   entryFQDRP->Append(", N = ");
796   (*entryFQDRP)+=(Long_t)nEvtsFQDRP;
797  }
798  if(entryFQDPOI)
799  {
800   entryFQDPOI->Append("M = ");
801   (*entryFQDPOI)+=(Long_t)avMultFQDPOI;
802   entryFQDPOI->Append(", N = ");
803   (*entryFQDPOI)+=(Long_t)nEvtsFQDPOI;
804  }  
805   
806  //LYZ1:
807  if(lyz1CommonHist)
808  {
809   avMultLYZ1 = (lyz1CommonHist->GetHistMultInt())->GetMean();//to be removed
810   nEvtsLYZ1  = (lyz1CommonHist->GetHistMultInt())->GetEntries();//to be removed
811   avMultLYZ1RP = (lyz1CommonHist->GetHistMultInt())->GetMean();
812   nEvtsLYZ1RP  = (lyz1CommonHist->GetHistMultInt())->GetEntries();
813   avMultLYZ1POI = (lyz1CommonHist->GetHistMultDiff())->GetMean();
814   nEvtsLYZ1POI  = (lyz1CommonHist->GetHistMultDiff())->GetEntries();
815  }
816  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
817  //   !!!! to be removed !!!!   
818  if(entryLYZ1) 
819  {
820   entryLYZ1->Append("M = ");
821   (*entryLYZ1)+=(Long_t)avMultLYZ1;
822   entryLYZ1->Append(", N = ");
823   (*entryLYZ1)+=(Long_t)nEvtsLYZ1;
824  }
825  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
826  if(entryLYZ1RP) 
827  {
828   entryLYZ1RP->Append("M = ");
829   (*entryLYZ1RP)+=(Long_t)avMultLYZ1RP;
830   entryLYZ1RP->Append(", N = ");
831   (*entryLYZ1RP)+=(Long_t)nEvtsLYZ1RP;
832  }
833  if(entryLYZ1POI) 
834  {
835   entryLYZ1POI->Append("M = ");
836   (*entryLYZ1POI)+=(Long_t)avMultLYZ1POI;
837   entryLYZ1POI->Append(", N = ");
838   (*entryLYZ1POI)+=(Long_t)nEvtsLYZ1POI;
839  }
840  
841  //LYZEP:
842  if(lyzepCommonHist)
843  {
844   avMultLYZEP = (lyzepCommonHist->GetHistMultInt())->GetMean();//to be removed
845   nEvtsLYZEP  = (lyzepCommonHist->GetHistMultInt())->GetEntries();//to be removed
846   avMultLYZEPRP = (lyzepCommonHist->GetHistMultInt())->GetMean();
847   nEvtsLYZEPRP  = (lyzepCommonHist->GetHistMultInt())->GetEntries();
848   avMultLYZEPPOI = (lyzepCommonHist->GetHistMultDiff())->GetMean();
849   nEvtsLYZEPPOI  = (lyzepCommonHist->GetHistMultDiff())->GetEntries();    
850  }
851  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
852  //   !!!! to be removed !!!!   
853  if(entryLYZEP)
854  {
855   entryLYZEP->Append("M = ");
856   (*entryLYZEP)+=(Long_t)avMultLYZEP;
857   entryLYZEP->Append(", N = ");
858   (*entryLYZEP)+=(Long_t)nEvtsLYZEP;
859  }
860  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
861  if(entryLYZEPRP)
862  {
863   entryLYZEPRP->Append("M = ");
864   (*entryLYZEPRP)+=(Long_t)avMultLYZEPRP;
865   entryLYZEPRP->Append(", N = ");
866   (*entryLYZEPRP)+=(Long_t)nEvtsLYZEPRP;
867  }
868  if(entryLYZEPPOI)
869  {
870   entryLYZEPPOI->Append("M = ");
871   (*entryLYZEPPOI)+=(Long_t)avMultLYZEPPOI;
872   entryLYZEPPOI->Append(", N = ");
873   (*entryLYZEPPOI)+=(Long_t)nEvtsLYZEPPOI;
874  }
875
876  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
877  //   !!!! to be removed !!!!   
878  if(textResults)
879  {
880   textResults->AddText(entryMC->Data());
881   textResults->AddText(entryGFC->Data());
882   textResults->AddText(entryQC2->Data());
883   textResults->AddText(entryQC4->Data());
884   textResults->AddText(entryQC6->Data());
885   textResults->AddText(entryQC8->Data());
886   textResults->AddText(entryFQD->Data());
887   textResults->AddText(entryLYZ1->Data());
888   textResults->AddText(entryLYZEP->Data());
889  }
890  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
891  //RP:
892  if(textResultsRP)
893  {
894   textResultsRP->AddText(entryMCRP->Data());
895   textResultsRP->AddText(entryGFCRP->Data());
896   textResultsRP->AddText(entryQC2RP->Data());
897   textResultsRP->AddText(entryQC4RP->Data());
898   textResultsRP->AddText(entryQC6RP->Data());
899   textResultsRP->AddText(entryQC8RP->Data());
900   textResultsRP->AddText(entryFQDRP->Data());
901   textResultsRP->AddText(entryLYZ1RP->Data());
902   textResultsRP->AddText(entryLYZEPRP->Data());
903  }
904  //POI:
905  if(textResultsPOI)
906  {
907   textResultsPOI->AddText(entryMCPOI->Data());
908   textResultsPOI->AddText(entryGFCPOI->Data());
909   textResultsPOI->AddText(entryQC2POI->Data());
910   textResultsPOI->AddText(entryQC4POI->Data());
911   textResultsPOI->AddText(entryQC6POI->Data());
912   textResultsPOI->AddText(entryQC8POI->Data());
913   textResultsPOI->AddText(entryFQDPOI->Data());
914   textResultsPOI->AddText(entryLYZ1POI->Data());
915   textResultsPOI->AddText(entryLYZEPPOI->Data());
916  }
917  //----------------------------------------------------------------------------------
918  
919  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
920  //                           !!!! to be removed !!!!
921  //----------------------------------------------------------------------------------
922  //final drawing for integrated flow:
923  TCanvas* intFlowAllCanvas = new TCanvas("Integrated Flow","Integrated Flow",1000,600);
924  
925  intFlowAllCanvas->Divide(2,1);
926  
927  //1st pad is for plot:
928  (intFlowAllCanvas->cd(1))->SetPad(0.0,0.0,0.75,1.0);
929  
930  if(intFlowAll)
931  {
932   if(dMin>0. && dMax>0.)
933   {
934    (intFlowAll->GetYaxis())->SetRangeUser(0.9744*dMin,1.0144*dMax);
935   } else if(dMin<0. && dMax>0.)
936     {
937      if(!(-1.*dMin<4.*dMax))
938      {  
939       (intFlowAll->GetYaxis())->SetRangeUser(1.0266*dMin,1.0144*dMax);
940      } else {(intFlowAll->GetYaxis())->SetRangeUser(1.1266*dMin,1.0144*dMax);}  
941     } else if(dMin<0. && dMax<0.)
942       {
943        (intFlowAll->GetYaxis())->SetRangeUser(1.0266*dMin,0.9866*dMax);      
944       }
945   intFlowAll->Draw("E1");
946  }                    
947                                                     
948  if(pMesh) pMesh->Draw("LFSAME");
949   
950  if(flowResults) flowResults->Draw("PSAME");
951
952  //2nd pad is for legend:
953  (intFlowAllCanvas->cd(2))->SetPad(0.75,0.0,1.0,1.0);
954  
955  if(textDefault)
956  {
957   textDefault->Draw();
958   textResults->Draw();
959  }
960  
961  //----------------------------------------------------------------------------------
962  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
963
964  
965  
966  
967  //----------------------------------------------------------------------------------
968  //final drawing for integrated flow of RP (i.e. of particles used to determine the reaction plane):
969  if(plotIntFlowRP)
970  {
971   TCanvas* intFlowAllCanvasRP = new TCanvas("Integrated Flow RP","Integrated Flow RP",1000,600);
972  
973   intFlowAllCanvasRP->Divide(2,1);
974  
975   //1st pad is for plot:
976   (intFlowAllCanvasRP->cd(1))->SetPad(0.0,0.0,0.75,1.0);
977  
978   TH1D *intFlowAllRP = new TH1D(*intFlowAll); 
979
980   if(intFlowAllRP)
981   {
982    if(dMinRP>0. && dMaxRP>0.)
983    {
984     (intFlowAllRP->GetYaxis())->SetRangeUser(0.9744*dMinRP,1.0144*dMaxRP);
985    } else if(dMinRP<0. && dMaxRP>0.)
986      {
987       if(!(-1.*dMinRP<4.*dMaxRP))
988       {  
989        (intFlowAllRP->GetYaxis())->SetRangeUser(1.0266*dMinRP,1.0144*dMaxRP);
990       } else {(intFlowAllRP->GetYaxis())->SetRangeUser(1.1266*dMinRP,1.0144*dMaxRP);}  
991      } else if(dMinRP<0. && dMaxRP<0.)
992        {
993         (intFlowAllRP->GetYaxis())->SetRangeUser(1.0266*dMinRP,0.9866*dMaxRP);      
994        } 
995    intFlowAllRP->Draw("E1");
996   }
997                                                                                                                                                                                                                                                                                    
998   if(pMeshRP) pMeshRP->Draw("LFSAME");
999    
1000   if(flowResultsRP) flowResultsRP->Draw("PSAME");
1001
1002   //2nd pad is for legend:
1003   (intFlowAllCanvasRP->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1004   
1005   if(textDefault) textDefault->Draw();
1006  
1007   if(textResultsRP) textResultsRP->Draw();
1008  }//end of if(plotIntFlowRP} 
1009  //----------------------------------------------------------------------------------
1010  
1011  //----------------------------------------------------------------------------------
1012  //final drawing for integrated flow of POI (i.e. of particles of interest):
1013  if(plotIntFlowPOI)
1014  {
1015   TCanvas* intFlowAllCanvasPOI = new TCanvas("Integrated Flow POI","Integrated Flow POI",1000,600);
1016  
1017   intFlowAllCanvasPOI->Divide(2,1);
1018  
1019   //1st pad is for plot:
1020   (intFlowAllCanvasPOI->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1021   
1022   TH1D *intFlowAllPOI = new TH1D(*intFlowAll);
1023   
1024   if(intFlowAllPOI)
1025   {
1026    if(dMinPOI>0. && dMaxPOI>0.)
1027    {
1028     (intFlowAllPOI->GetYaxis())->SetRangeUser(0.9744*dMinPOI,1.0144*dMaxPOI);
1029    } else if(dMinPOI<0. && dMaxPOI>0.)
1030      {
1031       if(!(-1.*dMinPOI<4.*dMaxPOI))
1032       {  
1033        (intFlowAllPOI->GetYaxis())->SetRangeUser(1.0266*dMinPOI,1.0144*dMaxPOI);
1034       } else {(intFlowAllPOI->GetYaxis())->SetRangeUser(1.1266*dMinPOI,1.0144*dMaxPOI);}  
1035      } else if(dMinPOI<0. && dMaxPOI<0.)
1036        {
1037         (intFlowAllPOI->GetYaxis())->SetRangeUser(1.0266*dMinPOI,0.9866*dMaxPOI);      
1038        }
1039    intFlowAllPOI->Draw("E1");
1040   }
1041                             
1042   if(pMeshPOI) pMeshPOI->Draw("LFSAME");
1043    
1044   if(flowResultsPOI) flowResultsPOI->Draw("PSAME");
1045  
1046   //2nd pad is for legend:
1047   (intFlowAllCanvasPOI->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1048  
1049   if(textDefault) textDefault->Draw();
1050
1051   if(textResultsPOI) textResultsPOI->Draw();
1052  }// end of if(plotIntFlowPOI) 
1053  //----------------------------------------------------------------------------------
1054  
1055  //==================================================================================   
1056
1057
1058
1059
1060  //==================================================================================
1061  //                            DIFFERENTIAL FLOW
1062  //==================================================================================
1063  Int_t iNbinsPt  = AliFlowCommonConstants::GetNbinsPt();
1064  Double_t dPtMin = AliFlowCommonConstants::GetPtMin();
1065  Double_t dPtMax = AliFlowCommonConstants::GetPtMax();
1066  
1067  Int_t iNbinsEta  = AliFlowCommonConstants::GetNbinsEta();
1068  Double_t dEtaMin = AliFlowCommonConstants::GetEtaMin();
1069  Double_t dEtaMax = AliFlowCommonConstants::GetEtaMax();
1070  
1071  //----------------------------------------------------------------------------------
1072  //cosmetics: the style histogram for differential flow (pt):
1073  TH1D *styleHistPt = new TH1D("styleHistPt","styleHistPt",iNbinsPt,dPtMin,dPtMax);
1074  styleHistPt->SetTitle("Differential Flow");
1075  styleHistPt->SetXTitle("p_{t} [GeV]");
1076  styleHistPt->SetYTitle("v_{n}");
1077  
1078  //cosmetics: the style histogram for differential flow (eta):
1079  TH1D *styleHistEta = new TH1D("styleHistEta","styleHistEta",iNbinsEta,dEtaMin,dEtaMax);
1080  styleHistEta->SetTitle("Differential Flow");
1081  styleHistEta->SetXTitle("#eta");
1082  styleHistEta->SetYTitle("v_{n}");
1083  //----------------------------------------------------------------------------------
1084  
1085  
1086  
1087  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1088  //               !!!! to be removed !!!!
1089  //----------------------------------------------------------------------------------
1090  //cosmetics: Monte Carlo error bands for differential flow
1091  TGraph* pMeshDiffFlow = NULL;
1092  if(mcepCommonHistRes)
1093  {
1094   Int_t nPtsDF = (mcepCommonHistRes->GetHistDiffFlow())->GetNbinsX();
1095   Double_t binWidth = (mcepCommonHistRes->GetHistDiffFlow())->GetBinWidth(1);//assuming that all bins have the same width
1096        
1097   pMeshDiffFlow = new TGraph(2*nPtsDF+1);
1098   
1099   Double_t valueMC=0., errorMC=0.;
1100   for(Int_t i=1;i<nPtsDF+1;i++)
1101   {
1102    valueMC = (mcepCommonHistRes->GetHistDiffFlow())->GetBinContent(i);
1103    errorMC = (mcepCommonHistRes->GetHistDiffFlow())->GetBinError(i);       
1104    pMeshDiffFlow->SetPoint(i,(i-0.5)*binWidth,valueMC+errorMC);
1105   }    
1106   for(Int_t i=nPtsDF+1;i<2*nPtsDF+1;i++)
1107   {
1108    valueMC = (mcepCommonHistRes->GetHistDiffFlow())->GetBinContent(2*nPtsDF+1-i);
1109    errorMC = (mcepCommonHistRes->GetHistDiffFlow())->GetBinError(2*nPtsDF+1-i);       
1110    pMeshDiffFlow->SetPoint(i,(2*nPtsDF-i+0.5)*binWidth,valueMC-errorMC); 
1111   }
1112   pMeshDiffFlow->SetPoint(2*nPtsDF+1,0.5*binWidth,valueMC+errorMC); 
1113   pMeshDiffFlow->SetFillStyle(meshStyle);
1114   pMeshDiffFlow->SetFillColor(meshColor);
1115  } 
1116  //----------------------------------------------------------------------------------
1117  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1118
1119  //----------------------------------------------------------------------------------
1120  //RP:
1121  //cosmetics: Monte Carlo error bands for differential flow (Pt)
1122  TGraph* pMeshDiffFlowPtRP = NULL;
1123  if(mcepCommonHistRes)
1124  {
1125   Int_t nPtsDFPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetNbinsX();
1126   Double_t binWidthPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinWidth(1);//assuming that all bins have the same width
1127        
1128   pMeshDiffFlowPtRP = new TGraph(2*nPtsDFPtRP+1);
1129   
1130   Double_t valueMCPtRP=0., errorMCPtRP=0.;
1131   for(Int_t i=1;i<nPtsDFPtRP+1;i++)
1132   {
1133    valueMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(i);
1134    errorMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(i);       
1135    pMeshDiffFlowPtRP->SetPoint(i,(i-0.5)*binWidthPtRP,valueMCPtRP+errorMCPtRP);
1136   }    
1137   for(Int_t i=nPtsDFPtRP+1;i<2*nPtsDFPtRP+1;i++)
1138   {
1139    valueMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(2*nPtsDFPtRP+1-i);
1140    errorMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(2*nPtsDFPtRP+1-i);       
1141    pMeshDiffFlowPtRP->SetPoint(i,(2*nPtsDFPtRP-i+0.5)*binWidthPtRP,valueMCPtRP-errorMCPtRP); 
1142   }
1143   pMeshDiffFlowPtRP->SetPoint(2*nPtsDFPtRP+1,0.5*binWidthPtRP,valueMCPtRP+errorMCPtRP); 
1144   pMeshDiffFlowPtRP->SetFillStyle(meshStyle);
1145   pMeshDiffFlowPtRP->SetFillColor(meshColor);
1146  }
1147  
1148  //cosmetics: Monte Carlo error bands for differential flow (Eta)
1149  TGraph* pMeshDiffFlowEtaRP = NULL;
1150  if(mcepCommonHistRes)
1151  {
1152   Int_t nPtsDFEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetNbinsX();
1153   Double_t binWidthEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinWidth(1);//assuming that all bins have the same width
1154        
1155   pMeshDiffFlowEtaRP = new TGraph(2*nPtsDFEtaRP+1);
1156
1157   Double_t valueMCEtaRP=0., errorMCEtaRP=0.;
1158   for(Int_t i=1;i<nPtsDFEtaRP+1;i++)
1159   {
1160    valueMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinContent(i);
1161    errorMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinError(i);  
1162    pMeshDiffFlowEtaRP->SetPoint(i,(i-0.5)*binWidthEtaRP+dEtaMin,valueMCEtaRP+errorMCEtaRP);
1163   }    
1164   for(Int_t i=nPtsDFEtaRP+1;i<2*nPtsDFEtaRP+1;i++)
1165   {
1166    valueMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinContent(2*nPtsDFEtaRP+1-i);
1167    errorMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinError(2*nPtsDFEtaRP+1-i);       
1168    pMeshDiffFlowEtaRP->SetPoint(i,(2*nPtsDFEtaRP-i+0.5)*binWidthEtaRP+dEtaMin,valueMCEtaRP-errorMCEtaRP);   
1169   }
1170   pMeshDiffFlowEtaRP->SetPoint(2*nPtsDFEtaRP+1,0.5*binWidthEtaRP+dEtaMin,valueMCEtaRP+errorMCEtaRP); 
1171   pMeshDiffFlowEtaRP->SetFillStyle(meshStyle);
1172   pMeshDiffFlowEtaRP->SetFillColor(meshColor);
1173  } 
1174  //----------------------------------------------------------------------------------
1175
1176
1177  //----------------------------------------------------------------------------------
1178  //POI:
1179  //cosmetics: Monte Carlo error bands for differential flow (Pt)
1180  TGraph* pMeshDiffFlowPtPOI = NULL;
1181  if(mcepCommonHistRes)
1182  {
1183   Int_t nPtsDFPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetNbinsX();
1184   Double_t binWidthPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinWidth(1);//assuming that all bins have the same width
1185        
1186   pMeshDiffFlowPtPOI = new TGraph(2*nPtsDFPtPOI+1);
1187   
1188   Double_t valueMCPtPOI=0., errorMCPtPOI=0.;
1189   for(Int_t i=1;i<nPtsDFPtPOI+1;i++)
1190   {
1191    valueMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinContent(i);
1192    errorMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinError(i);       
1193    pMeshDiffFlowPtPOI->SetPoint(i,(i-0.5)*binWidthPtPOI,valueMCPtPOI+errorMCPtPOI);
1194   }    
1195   for(Int_t i=nPtsDFPtPOI+1;i<2*nPtsDFPtPOI+1;i++)
1196   {
1197    valueMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinContent(2*nPtsDFPtPOI+1-i);
1198    errorMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinError(2*nPtsDFPtPOI+1-i);       
1199    pMeshDiffFlowPtPOI->SetPoint(i,(2*nPtsDFPtPOI-i+0.5)*binWidthPtPOI,valueMCPtPOI-errorMCPtPOI); 
1200   }
1201   pMeshDiffFlowPtPOI->SetPoint(2*nPtsDFPtPOI+1,0.5*binWidthPtPOI,valueMCPtPOI+errorMCPtPOI); 
1202   pMeshDiffFlowPtPOI->SetFillStyle(meshStyle);
1203   pMeshDiffFlowPtPOI->SetFillColor(meshColor);
1204  }
1205  
1206  //cosmetics: Monte Carlo error bands for differential flow (Eta)
1207  TGraph* pMeshDiffFlowEtaPOI = NULL;
1208  if(mcepCommonHistRes)
1209  {
1210   Int_t nPtsDFEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetNbinsX();
1211   Double_t binWidthEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinWidth(1);//assuming that all bins have the same width
1212        
1213   pMeshDiffFlowEtaPOI = new TGraph(2*nPtsDFEtaPOI+1);
1214   
1215   Double_t valueMCEtaPOI=0., errorMCEtaPOI=0.;
1216   for(Int_t i=1;i<nPtsDFEtaPOI+1;i++)
1217   {
1218    valueMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinContent(i);
1219    errorMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinError(i);       
1220    pMeshDiffFlowEtaPOI->SetPoint(i,(i-0.5)*binWidthEtaPOI+dEtaMin,valueMCEtaPOI+errorMCEtaPOI);
1221   }    
1222   for(Int_t i=nPtsDFEtaPOI+1;i<2*nPtsDFEtaPOI+1;i++)
1223   {
1224    valueMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinContent(2*nPtsDFEtaPOI+1-i);
1225    errorMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinError(2*nPtsDFEtaPOI+1-i);       
1226    pMeshDiffFlowEtaPOI->SetPoint(i,(2*nPtsDFEtaPOI-i+0.5)*binWidthEtaPOI+dEtaMin,valueMCEtaPOI-errorMCEtaPOI); 
1227   }
1228   pMeshDiffFlowEtaPOI->SetPoint(2*nPtsDFEtaPOI+1,0.5*binWidthEtaPOI+dEtaMin,valueMCEtaPOI+errorMCEtaPOI); 
1229   pMeshDiffFlowEtaPOI->SetFillStyle(meshStyle);
1230   pMeshDiffFlowEtaPOI->SetFillColor(meshColor);
1231  } 
1232  //----------------------------------------------------------------------------------
1233    
1234  //MCEP = Monte Carlo Event Plane
1235  Double_t avMultDiffFlowMC=0.;//to be removed
1236  Double_t nEvtsDiffFlowMC=0;//to be removed
1237  Double_t avMultDiffFlowMCRP=0.;
1238  Double_t nEvtsDiffFlowMCRP=0;
1239  Double_t avMultDiffFlowMCPOI=0.;
1240  Double_t nEvtsDiffFlowMCPOI=0;
1241  if(fileMCEP)
1242  {
1243   if(mcepCommonHistRes)
1244   {
1245    (mcepCommonHistRes->GetHistDiffFlow())->SetMarkerColor(2);//to be removed
1246    (mcepCommonHistRes->GetHistDiffFlow())->SetMarkerStyle(20);//to be removed
1247    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(2);
1248    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(20);
1249    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(2);
1250    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(20);
1251    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(2);
1252    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(20);
1253    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(2);
1254    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(20);
1255   } 
1256   if(mcepCommonHist)
1257   {
1258    avMultDiffFlowMC = (mcepCommonHist->GetHistMultDiff())->GetMean();//to be removed
1259    nEvtsDiffFlowMC  = (mcepCommonHist->GetHistMultDiff())->GetEntries();//to be removed
1260    avMultDiffFlowMCRP = (mcepCommonHist->GetHistMultInt())->GetMean();
1261    nEvtsDiffFlowMCRP  = (mcepCommonHist->GetHistMultInt())->GetEntries();
1262    avMultDiffFlowMCPOI = (mcepCommonHist->GetHistMultDiff())->GetMean();
1263    nEvtsDiffFlowMCPOI  = (mcepCommonHist->GetHistMultDiff())->GetEntries();      
1264   } 
1265  } 
1266
1267  //GFC = Generating Function Cumulants
1268  Double_t avMultDiffFlowGFC=0.;//to be removed
1269  Double_t nEvtsDiffFlowGFC=0.;//to be removed
1270  Double_t avMultDiffFlowGFCRP=0.;
1271  Double_t nEvtsDiffFlowGFCRP=0.;
1272  Double_t avMultDiffFlowGFCPOI=0.;
1273  Double_t nEvtsDiffFlowGFCPOI=0.; 
1274  if(fileGFC)
1275  {
1276   if(gfcCommonHistRes2)
1277   {
1278    (gfcCommonHistRes2->GetHistDiffFlow())->SetMarkerColor(kViolet+7);//to be removed
1279    (gfcCommonHistRes2->GetHistDiffFlow())->SetMarkerStyle(20);//to be removed
1280    (gfcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerColor(kViolet+7);
1281    (gfcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerStyle(20);
1282    (gfcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerColor(kViolet+7);
1283    (gfcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerStyle(20);
1284    (gfcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerColor(kViolet+7);
1285    (gfcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerStyle(20);
1286    (gfcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerColor(kViolet+7);
1287    (gfcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerStyle(20);
1288   }
1289   if(gfcCommonHistRes4)
1290   { 
1291    (gfcCommonHistRes4->GetHistDiffFlow())->SetMarkerColor(kViolet-3);//to be removed
1292    (gfcCommonHistRes4->GetHistDiffFlow())->SetMarkerStyle(21);//to be removed
1293    (gfcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerColor(kViolet-3);
1294    (gfcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerStyle(21);
1295    (gfcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerColor(kViolet-3);
1296    (gfcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerStyle(21);
1297    (gfcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerColor(kViolet-3);
1298    (gfcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerStyle(21);
1299    (gfcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerColor(kViolet-3);
1300    (gfcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerStyle(21);         
1301   }
1302   if(gfcCommonHistRes6)
1303   { 
1304    (gfcCommonHistRes6->GetHistDiffFlow())->SetMarkerColor(kViolet+7);//to be removed
1305    (gfcCommonHistRes6->GetHistDiffFlow())->SetMarkerStyle(24);//to be removed
1306    (gfcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerColor(kViolet+7);
1307    (gfcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerStyle(24);
1308    (gfcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerColor(kViolet+7);
1309    (gfcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerStyle(24);
1310    (gfcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerColor(kViolet+7);
1311    (gfcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerStyle(24);
1312    (gfcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerColor(kViolet+7);
1313    (gfcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerStyle(24);
1314   }
1315   if(gfcCommonHistRes8)
1316   { 
1317    (gfcCommonHistRes8->GetHistDiffFlow())->SetMarkerColor(kViolet-3);//to be removed
1318    (gfcCommonHistRes8->GetHistDiffFlow())->SetMarkerStyle(25);//to be removed
1319    (gfcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerColor(kViolet-3);
1320    (gfcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerStyle(25);
1321    (gfcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerColor(kViolet-3);
1322    (gfcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerStyle(25);
1323    (gfcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerColor(kViolet-3);
1324    (gfcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerStyle(25);
1325    (gfcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerColor(kViolet-3);
1326    (gfcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerStyle(25);
1327   }
1328   if(gfcCommonHist)
1329   {
1330    avMultDiffFlowGFC = (gfcCommonHist->GetHistMultDiff())->GetMean();//to be removed
1331    nEvtsDiffFlowGFC  = (gfcCommonHist->GetHistMultDiff())->GetEntries();//to be removed
1332    avMultDiffFlowGFCRP = (gfcCommonHist->GetHistMultInt())->GetMean();   
1333    nEvtsDiffFlowGFCRP  = (gfcCommonHist->GetHistMultInt())->GetEntries();
1334    avMultDiffFlowGFCPOI = (gfcCommonHist->GetHistMultDiff())->GetMean();
1335    nEvtsDiffFlowGFCPOI  = (gfcCommonHist->GetHistMultDiff())->GetEntries();   
1336   } 
1337  }
1338   
1339  //QC = Q-cumulants
1340  Double_t avMultDiffFlowQC2=0., avMultDiffFlowQC4=0.;//to be removed
1341  Double_t nEvtsDiffFlowQC2=0., nEvtsDiffFlowQC4=0.;//to be removed
1342  Double_t avMultDiffFlowQC6=0., avMultDiffFlowQC8=0.;//to be removed
1343  Double_t nEvtsDiffFlowQC6=0., nEvtsDiffFlowQC8=0.;//to be removed
1344  Double_t avMultDiffFlowQC2RP=0.;
1345  Double_t nEvtsDiffFlowQC2RP=0.;
1346  Double_t avMultDiffFlowQC2POI=0.;
1347  Double_t nEvtsDiffFlowQC2POI=0.;
1348  Double_t avMultDiffFlowQC4RP=0.;
1349  Double_t nEvtsDiffFlowQC4RP=0.;
1350  Double_t avMultDiffFlowQC4POI=0.;
1351  Double_t nEvtsDiffFlowQC4POI=0.;
1352  Double_t avMultDiffFlowQC6RP=0.;
1353  Double_t nEvtsDiffFlowQC6RP=0.;
1354  Double_t avMultDiffFlowQC6POI=0.;
1355  Double_t nEvtsDiffFlowQC6POI=0.;
1356  Double_t avMultDiffFlowQC8RP=0.;
1357  Double_t nEvtsDiffFlowQC8RP=0.;
1358  Double_t avMultDiffFlowQC8POI=0.;
1359  Double_t nEvtsDiffFlowQC8POI=0.;
1360
1361  if(fileQC)
1362  {
1363   //QC{2}
1364   if(qcCommonHistRes2)
1365   {
1366    (qcCommonHistRes2->GetHistDiffFlow())->SetMarkerColor(kOrange+3);//to be removed
1367    (qcCommonHistRes2->GetHistDiffFlow())->SetMarkerStyle(20);//to be removed
1368    (qcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerColor(kOrange+3);
1369    (qcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerStyle(20);
1370    (qcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerColor(kOrange+3);
1371    (qcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerStyle(20);
1372    (qcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerColor(kOrange+3);
1373    (qcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerStyle(20);
1374    (qcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerColor(kOrange+3);
1375    (qcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerStyle(20);
1376   }
1377   if(qcCommonHist2)
1378   {
1379    avMultDiffFlowQC2 = (qcCommonHist2->GetHistMultDiff())->GetMean();//to be removed
1380    nEvtsDiffFlowQC2  = (qcCommonHist2->GetHistMultDiff())->GetEntries();//to be removed
1381    avMultDiffFlowQC2RP = (qcCommonHist2->GetHistMultInt())->GetMean();
1382    nEvtsDiffFlowQC2RP  = (qcCommonHist2->GetHistMultInt())->GetEntries();
1383    avMultDiffFlowQC2POI = (qcCommonHist2->GetHistMultDiff())->GetMean();
1384    nEvtsDiffFlowQC2POI  = (qcCommonHist2->GetHistMultDiff())->GetEntries();
1385   }
1386   //QC{4}
1387   if(qcCommonHistRes4)
1388   {
1389    (qcCommonHistRes4->GetHistDiffFlow())->SetMarkerColor(kOrange-6);//to be removed
1390    (qcCommonHistRes4->GetHistDiffFlow())->SetMarkerStyle(21);//to be removed
1391    (qcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerColor(kOrange-6);
1392    (qcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerStyle(21);
1393    (qcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerColor(kOrange-6);
1394    (qcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerStyle(21);
1395    (qcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerColor(kOrange-6);
1396    (qcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerStyle(21);
1397    (qcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerColor(kOrange-6);
1398    (qcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerStyle(21);
1399   }
1400   if(qcCommonHist4)
1401   {
1402    avMultDiffFlowQC4 = (qcCommonHist4->GetHistMultDiff())->GetMean();//to be removed
1403    nEvtsDiffFlowQC4  = (qcCommonHist4->GetHistMultDiff())->GetEntries();//to be removed
1404    avMultDiffFlowQC4RP = (qcCommonHist4->GetHistMultInt())->GetMean();
1405    nEvtsDiffFlowQC4RP  = (qcCommonHist4->GetHistMultInt())->GetEntries();
1406    avMultDiffFlowQC4POI = (qcCommonHist4->GetHistMultDiff())->GetMean();
1407    nEvtsDiffFlowQC4POI  = (qcCommonHist4->GetHistMultDiff())->GetEntries();
1408   }
1409   //QC{6}
1410   if(qcCommonHistRes6)
1411   {
1412    (qcCommonHistRes6->GetHistDiffFlow())->SetMarkerColor(kOrange+3);//to be removed
1413    (qcCommonHistRes6->GetHistDiffFlow())->SetMarkerStyle(24);//to be removed
1414    (qcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerColor(kOrange+3);
1415    (qcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerStyle(24);
1416    (qcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerColor(kOrange+3);
1417    (qcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerStyle(24);
1418    (qcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerColor(kOrange+3);
1419    (qcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerStyle(24);
1420    (qcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerColor(kOrange+3);
1421    (qcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerStyle(24);
1422   }
1423   if(qcCommonHist6)
1424   {
1425    avMultDiffFlowQC6 = (qcCommonHist6->GetHistMultDiff())->GetMean();//to be removed
1426    nEvtsDiffFlowQC6  = (qcCommonHist6->GetHistMultDiff())->GetEntries();//to be removed
1427    avMultDiffFlowQC6RP = (qcCommonHist6->GetHistMultInt())->GetMean();
1428    nEvtsDiffFlowQC6RP  = (qcCommonHist6->GetHistMultInt())->GetEntries();
1429    avMultDiffFlowQC6POI = (qcCommonHist6->GetHistMultDiff())->GetMean();
1430    nEvtsDiffFlowQC6POI  = (qcCommonHist6->GetHistMultDiff())->GetEntries();
1431   }
1432   //QC{8}
1433   if(qcCommonHistRes8)
1434   {
1435    (qcCommonHistRes8->GetHistDiffFlow())->SetMarkerColor(kOrange-6);//to be removed
1436    (qcCommonHistRes8->GetHistDiffFlow())->SetMarkerStyle(25);//to be removed
1437    (qcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerColor(kOrange-6);
1438    (qcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerStyle(25);
1439    (qcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerColor(kOrange-6);
1440    (qcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerStyle(25);
1441    (qcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerColor(kOrange-6);
1442    (qcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerStyle(25);
1443    (qcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerColor(kOrange-6);
1444    (qcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerStyle(25);
1445   }
1446   if(qcCommonHist8)
1447   {
1448    avMultDiffFlowQC8 = (qcCommonHist8->GetHistMultDiff())->GetMean();//to be removed
1449    nEvtsDiffFlowQC8  = (qcCommonHist8->GetHistMultDiff())->GetEntries();//to be removed
1450    avMultDiffFlowQC8RP = (qcCommonHist8->GetHistMultInt())->GetMean();
1451    nEvtsDiffFlowQC8RP  = (qcCommonHist8->GetHistMultInt())->GetEntries();
1452    avMultDiffFlowQC8POI = (qcCommonHist8->GetHistMultDiff())->GetMean();
1453    nEvtsDiffFlowQC8POI  = (qcCommonHist8->GetHistMultDiff())->GetEntries();
1454   }
1455  } 
1456
1457  //LYZ2 = Lee-Yang Zeros (2nd run)
1458  Double_t avMultDiffFlowLYZ2=0.;//to be removed
1459  Double_t nEvtsDiffFlowLYZ2=0;//to be removed
1460  Double_t avMultDiffFlowLYZ2RP=0.;
1461  Double_t nEvtsDiffFlowLYZ2RP=0;
1462  Double_t avMultDiffFlowLYZ2POI=0.;
1463  Double_t nEvtsDiffFlowLYZ2POI=0;
1464  if(fileLYZ2)
1465  {
1466   if(lyz2CommonHistRes)
1467   {
1468    (lyz2CommonHistRes->GetHistDiffFlow())->SetMarkerColor(kGreen+3);//to be removed
1469    (lyz2CommonHistRes->GetHistDiffFlow())->SetMarkerStyle(22);//to be removed
1470    (lyz2CommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(kGreen+3);
1471    (lyz2CommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(22);
1472    (lyz2CommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(kGreen+3);
1473    (lyz2CommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(22);
1474    (lyz2CommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(kGreen+3);
1475    (lyz2CommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(22);
1476    (lyz2CommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(kGreen+3);
1477    (lyz2CommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(22);
1478   } 
1479   if(lyz2CommonHist)
1480   {
1481    avMultDiffFlowLYZ2 = (lyz2CommonHist->GetHistMultDiff())->GetMean();//to be removed
1482    nEvtsDiffFlowLYZ2  = (lyz2CommonHist->GetHistMultDiff())->GetEntries();//to be removed
1483    avMultDiffFlowLYZ2RP = (lyz2CommonHist->GetHistMultInt())->GetMean();
1484    nEvtsDiffFlowLYZ2RP  = (lyz2CommonHist->GetHistMultInt())->GetEntries();
1485    avMultDiffFlowLYZ2POI = (lyz2CommonHist->GetHistMultDiff())->GetMean();
1486    nEvtsDiffFlowLYZ2POI  = (lyz2CommonHist->GetHistMultDiff())->GetEntries();
1487   } 
1488  } 
1489
1490  //LYZEP = Lee-Yang Zeros Event Plane
1491  Double_t avMultDiffFlowLYZEP=0.;//to be removed
1492  Double_t nEvtsDiffFlowLYZEP=0;//to be removed
1493  Double_t avMultDiffFlowLYZEPRP=0.;
1494  Double_t nEvtsDiffFlowLYZEPRP=0;
1495  Double_t avMultDiffFlowLYZEPPOI=0.;
1496  Double_t nEvtsDiffFlowLYZEPPOI=0;
1497  if(fileLYZEP)
1498  {
1499   if(lyzepCommonHistRes)
1500   {
1501    (lyzepCommonHistRes->GetHistDiffFlow())->Scale(0.01);//to be improved
1502    (lyzepCommonHistRes->GetHistDiffFlow())->SetMarkerColor(kGreen+3);//to be removed
1503    (lyzepCommonHistRes->GetHistDiffFlow())->SetMarkerStyle(26);//to be removed
1504    (lyzepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(kGreen+3);
1505    (lyzepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(26);
1506    (lyzepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(kGreen+3);
1507    (lyzepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(26);
1508    (lyzepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(kGreen+3);
1509    (lyzepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(26);
1510    (lyzepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(kGreen+3);
1511    (lyzepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(26);
1512   } 
1513   if(lyzepCommonHist)
1514   {
1515    avMultDiffFlowLYZEP = (lyzepCommonHist->GetHistMultDiff())->GetMean();//to be removed
1516    nEvtsDiffFlowLYZEP  = (lyzepCommonHist->GetHistMultDiff())->GetEntries();//to be removed
1517    avMultDiffFlowLYZEPRP = (lyzepCommonHist->GetHistMultInt())->GetMean();
1518    nEvtsDiffFlowLYZEPRP  = (lyzepCommonHist->GetHistMultInt())->GetEntries();
1519    avMultDiffFlowLYZEPPOI = (lyzepCommonHist->GetHistMultDiff())->GetMean();
1520    nEvtsDiffFlowLYZEPPOI  = (lyzepCommonHist->GetHistMultDiff())->GetEntries();
1521   } 
1522  } 
1523
1524  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1525  // !!!! to be removed !!!!
1526  //----------------------------------------------------------------------------------
1527  //final drawing for differential flow:
1528  TCanvas* diffFlowAllCanvas = new TCanvas("Differential Flow","Differential Flow",1000,600);
1529  
1530  diffFlowAllCanvas->Divide(2,1);
1531  
1532  //1st pad is for plot:
1533  (diffFlowAllCanvas->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1534   
1535  if(styleHistPt)
1536  {
1537   styleHistPt->Draw();
1538  }
1539
1540  if(pMeshDiffFlow)
1541  {
1542   pMeshDiffFlow->Draw("LFSAME");
1543  }
1544  //MC 
1545  if(mcepCommonHistRes)
1546  { 
1547   (mcepCommonHistRes->GetHistDiffFlow())->Draw("E1PSAME");
1548  }
1549  //GFC
1550  if(gfcCommonHistRes2)
1551  { 
1552   (gfcCommonHistRes2->GetHistDiffFlow())->Draw("E1PSAME"); 
1553  } 
1554  if(gfcCommonHistRes4)
1555  { 
1556   (gfcCommonHistRes4->GetHistDiffFlow())->Draw("E1PSAME"); 
1557  } 
1558  if(gfcCommonHistRes6)
1559  { 
1560   (gfcCommonHistRes6->GetHistDiffFlow())->Draw("E1PSAME"); 
1561  } 
1562  if(gfcCommonHistRes8)
1563  { 
1564   (gfcCommonHistRes8->GetHistDiffFlow())->Draw("E1PSAME"); 
1565  }   
1566  //QC
1567  if(qcCommonHistRes2)
1568  { 
1569   (qcCommonHistRes2->GetHistDiffFlow())->Draw("E1PSAME");
1570  }
1571  if(qcCommonHistRes4)
1572  { 
1573   (qcCommonHistRes4->GetHistDiffFlow())->Draw("E1PSAME");
1574  }
1575  //LYZ2
1576  if(lyz2CommonHistRes)
1577  { 
1578   (lyz2CommonHistRes->GetHistDiffFlow())->Draw("E1PSAME");
1579  }
1580  //LYZEP
1581  if(lyzepCommonHistRes)
1582  { 
1583   (lyzepCommonHistRes->GetHistDiffFlow())->Draw("E1PSAME");
1584  }
1585  
1586  //2nd pad is for legend:
1587  (diffFlowAllCanvas->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1588
1589  TLegend* legendDiffFlow = new TLegend(0.02,0.25,0.97,0.75);
1590  legendDiffFlow->SetTextFont(72);
1591  legendDiffFlow->SetTextSize(0.06);
1592
1593  //legend's entries:
1594  TString *entryDiffMC   = new TString("MC ....... ");
1595  TString *entryDiffGFC2 = new TString("GFC{2} ... ");
1596  TString *entryDiffGFC4 = new TString("GFC{4} ... ");
1597  TString *entryDiffGFC6 = new TString("GFC{6} ... ");
1598  TString *entryDiffGFC8 = new TString("GFC{8} ... "); 
1599  TString *entryDiffQC2  = new TString("QC{2} .... ");
1600  TString *entryDiffQC4  = new TString("QC{4} .... ");
1601  TString *entryDiffLYZ2 = new TString("LYZ ...... ");
1602  TString *entryDiffLYZEP = new TString("LYZEP ... ");
1603  
1604  //MC
1605  if(mcepCommonHistRes)
1606  {
1607   (mcepCommonHistRes->GetHistDiffFlow())->SetFillStyle(meshStyle);
1608   (mcepCommonHistRes->GetHistDiffFlow())->SetFillColor(meshColor);
1609   entryDiffMC->Append("M = ");
1610   (*entryDiffMC)+=(Long_t)avMultDiffFlowMC;
1611   entryDiffMC->Append(", N = ");
1612   (*entryDiffMC)+=(Long_t)nEvtsDiffFlowMC; 
1613   legendDiffFlow->AddEntry(mcepCommonHistRes->GetHistDiffFlow(),entryDiffMC->Data(),"f");
1614  }
1615
1616  //GFC
1617  if(gfcCommonHistRes2)
1618  {
1619   entryDiffGFC2->Append("M = ");
1620   (*entryDiffGFC2)+=(Long_t)avMultDiffFlowGFC;
1621   entryDiffGFC2->Append(", N = ");
1622   (*entryDiffGFC2)+=(Long_t)nEvtsDiffFlowGFC; 
1623   legendDiffFlow->AddEntry(gfcCommonHistRes2->GetHistDiffFlow(),entryDiffGFC2->Data(),"p");
1624  }
1625  if(gfcCommonHistRes4)
1626  {
1627   entryDiffGFC4->Append("M = ");
1628   (*entryDiffGFC4)+=(Long_t)avMultDiffFlowGFC;
1629   entryDiffGFC4->Append(", N = ");
1630   (*entryDiffGFC4)+=(Long_t)nEvtsDiffFlowGFC; 
1631   legendDiffFlow->AddEntry(gfcCommonHistRes4->GetHistDiffFlow(),entryDiffGFC4->Data(),"p");
1632  }
1633  if(gfcCommonHistRes6)
1634  {
1635   entryDiffGFC6->Append("M = ");
1636   (*entryDiffGFC6)+=(Long_t)avMultDiffFlowGFC;
1637   entryDiffGFC6->Append(", N = ");
1638   (*entryDiffGFC6)+=(Long_t)nEvtsDiffFlowGFC; 
1639   legendDiffFlow->AddEntry(gfcCommonHistRes6->GetHistDiffFlow(),entryDiffGFC6->Data(),"p");
1640  } 
1641  if(gfcCommonHistRes8)
1642  {
1643   entryDiffGFC8->Append("M = ");
1644   (*entryDiffGFC8)+=(Long_t)avMultDiffFlowGFC;
1645   entryDiffGFC8->Append(", N = ");
1646   (*entryDiffGFC8)+=(Long_t)nEvtsDiffFlowGFC; 
1647   legendDiffFlow->AddEntry(gfcCommonHistRes8->GetHistDiffFlow(),entryDiffGFC8->Data(),"p");
1648  }  
1649  //QC
1650  if(qcCommonHistRes2)
1651  {
1652   entryDiffQC2->Append("M = ");
1653   (*entryDiffQC2)+=(Long_t)avMultDiffFlowQC2;
1654   entryDiffQC2->Append(", N = ");
1655   (*entryDiffQC2)+=(Long_t)nEvtsDiffFlowQC2; 
1656   legendDiffFlow->AddEntry(qcCommonHistRes2->GetHistDiffFlow(),entryDiffQC2->Data(),"p");
1657  }
1658  if(qcCommonHistRes4)
1659  {
1660   entryDiffQC4->Append("M = ");
1661   (*entryDiffQC4)+=(Long_t)avMultDiffFlowQC4;
1662   entryDiffQC4->Append(", N = ");
1663   (*entryDiffQC4)+=(Long_t)nEvtsDiffFlowQC4; 
1664   legendDiffFlow->AddEntry(qcCommonHistRes4->GetHistDiffFlow(),entryDiffQC4->Data(),"p");
1665  }
1666  
1667  //LYZ
1668  if(lyz2CommonHistRes)
1669  {
1670   entryDiffLYZ2->Append("M = ");
1671   (*entryDiffLYZ2)+=(Long_t)avMultDiffFlowLYZ2;
1672   entryDiffLYZ2->Append(", N = ");
1673   (*entryDiffLYZ2)+=(Long_t)nEvtsDiffFlowLYZ2; 
1674   legendDiffFlow->AddEntry(lyz2CommonHistRes->GetHistDiffFlow(),entryDiffLYZ2->Data(),"p");
1675  }
1676  
1677  //LYZEP
1678  if(lyzepCommonHistRes)
1679  {
1680   entryDiffLYZEP->Append("M = ");
1681   (*entryDiffLYZEP)+=(Long_t)avMultDiffFlowLYZEP;
1682   entryDiffLYZEP->Append(", N = ");
1683   (*entryDiffLYZEP)+=(Long_t)nEvtsDiffFlowLYZEP; 
1684   legendDiffFlow->AddEntry(lyzepCommonHistRes->GetHistDiffFlow(),entryDiffLYZEP->Data(),"p");
1685  }
1686
1687
1688  //drawing finally the legend in the 2nd pad:     
1689  if(legendDiffFlow)
1690  {
1691   legendDiffFlow->SetMargin(0.15);
1692   legendDiffFlow->Draw();
1693  }
1694  //----------------------------------------------------------------------------------
1695  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1696
1697  
1698  //----------------------------------------------------------------------------------
1699  //final drawing for differential flow (Pt, RP):
1700  //set here the results of which methods will be plotted by default:
1701  Bool_t plotMCPtRP    = kFALSE;
1702  Bool_t plotGFC2PtRP  = kTRUE;
1703  Bool_t plotGFC4PtRP  = kTRUE;
1704  Bool_t plotGFC6PtRP  = kTRUE;
1705  Bool_t plotGFC8PtRP  = kTRUE;
1706  Bool_t plotQC2PtRP   = kTRUE;
1707  Bool_t plotQC4PtRP   = kTRUE;
1708  Bool_t plotQC6PtRP   = kTRUE;
1709  Bool_t plotQC8PtRP   = kTRUE;
1710  Bool_t plotLYZ2PtRP  = kTRUE;
1711  Bool_t plotLYZEPPtRP = kTRUE;  
1712  if(plotDiffFlowPtRP)
1713  {
1714   TCanvas* diffFlowPtAllCanvasRP = new TCanvas("Differential Flow (Pt) of RP","Differential Flow (Pt) of RP ",1000,600);
1715   
1716   diffFlowPtAllCanvasRP->Divide(2,1);
1717  
1718   //1st pad is for plot:
1719   (diffFlowPtAllCanvasRP->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1720  
1721   if(styleHistPt)
1722   {
1723    (styleHistPt->GetYaxis())->SetRangeUser(-0.3,1.0);
1724    styleHistPt->Draw();
1725   }
1726   if(pMeshDiffFlowPtRP)
1727   {
1728    pMeshDiffFlowPtRP->Draw("LFSAME");
1729   }
1730  
1731   //MC 
1732   if(plotMCPtRP && mcepCommonHistRes)
1733   { 
1734    (mcepCommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
1735   }
1736   //GFC
1737   if(plotGFC2PtRP && gfcCommonHistRes2)
1738   { 
1739    (gfcCommonHistRes2->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
1740   } 
1741   if(plotGFC4PtRP && gfcCommonHistRes4)
1742   { 
1743    (gfcCommonHistRes4->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
1744   } 
1745   if(plotGFC6PtRP && gfcCommonHistRes6)
1746   { 
1747    (gfcCommonHistRes6->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
1748   } 
1749   if(plotGFC8PtRP && gfcCommonHistRes8)
1750   { 
1751    (gfcCommonHistRes8->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
1752   }    
1753   //QC
1754   if(plotQC2PtRP && qcCommonHistRes2)
1755   { 
1756    (qcCommonHistRes2->GetHistDiffFlowPtRP())->Draw("E1PSAME");
1757   }
1758   if(plotQC4PtRP && qcCommonHistRes4)
1759   { 
1760    (qcCommonHistRes4->GetHistDiffFlowPtRP())->Draw("E1PSAME");
1761   }
1762   if(plotQC6PtRP && qcCommonHistRes6)
1763   { 
1764    (qcCommonHistRes6->GetHistDiffFlowPtRP())->Draw("E1PSAME");
1765   }
1766   if(plotQC8PtRP && qcCommonHistRes8)
1767   { 
1768    (qcCommonHistRes8->GetHistDiffFlowPtRP())->Draw("E1PSAME");
1769   }
1770   //LYZ2
1771   if(plotLYZ2PtRP && lyz2CommonHistRes)
1772   { 
1773    (lyz2CommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
1774   }
1775   //LYZEP
1776   if(plotLYZEPPtRP && lyzepCommonHistRes)
1777   { 
1778    (lyzepCommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
1779   }
1780
1781   //2nd pad is for legend:
1782   (diffFlowPtAllCanvasRP->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1783  
1784   TLegend* legendDiffFlowPtRP = new TLegend(0.02,0.25,0.97,0.75);
1785   legendDiffFlowPtRP->SetTextFont(72);
1786   legendDiffFlowPtRP->SetTextSize(0.06);
1787  
1788   //legend's entries:
1789   TString *entryDiffMCPtRP    = new TString("MC ....... ");
1790   TString *entryDiffGFC2PtRP  = new TString("GFC{2} ... ");
1791   TString *entryDiffGFC4PtRP  = new TString("GFC{4} ... ");
1792   TString *entryDiffGFC6PtRP  = new TString("GFC{6} ... ");
1793   TString *entryDiffGFC8PtRP  = new TString("GFC{8} ... "); 
1794   TString *entryDiffQC2PtRP   = new TString("QC{2} .... ");
1795   TString *entryDiffQC4PtRP   = new TString("QC{4} .... ");
1796   TString *entryDiffQC6PtRP   = new TString("QC{6} .... ");
1797   TString *entryDiffQC8PtRP   = new TString("QC{8} .... ");
1798   TString *entryDiffLYZ2PtRP  = new TString("LYZ ...... ");
1799   TString *entryDiffLYZEPPtRP = new TString("LYZEP ... ");
1800   
1801   //MC
1802   if(mcepCommonHistRes)
1803   {
1804    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetFillStyle(meshStyle);
1805    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetFillColor(meshColor);
1806    entryDiffMCPtRP->Append("M = ");
1807    (*entryDiffMCPtRP)+=(Long_t)avMultDiffFlowMCRP;
1808    entryDiffMCPtRP->Append(", N = ");
1809    (*entryDiffMCPtRP)+=(Long_t)nEvtsDiffFlowMCRP; 
1810    legendDiffFlowPtRP->AddEntry(mcepCommonHistRes->GetHistDiffFlowPtRP(),entryDiffMCPtRP->Data(),"f");
1811   }
1812
1813   //GFC
1814   if(plotGFC2PtRP && gfcCommonHistRes2)
1815   {
1816    entryDiffGFC2PtRP->Append("M = ");
1817    (*entryDiffGFC2PtRP)+=(Long_t)avMultDiffFlowGFCRP;
1818    entryDiffGFC2PtRP->Append(", N = ");
1819    (*entryDiffGFC2PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
1820    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes2->GetHistDiffFlowPtRP(),entryDiffGFC2PtRP->Data(),"p");
1821   }
1822   if(plotGFC4PtRP && gfcCommonHistRes4)
1823   {
1824    entryDiffGFC4PtRP->Append("M = ");
1825    (*entryDiffGFC4PtRP)+=(Long_t)avMultDiffFlowGFCRP;
1826    entryDiffGFC4PtRP->Append(", N = ");
1827    (*entryDiffGFC4PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
1828    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes4->GetHistDiffFlowPtRP(),entryDiffGFC4PtRP->Data(),"p");
1829   }
1830   if(plotGFC6PtRP && gfcCommonHistRes6)
1831   {
1832    entryDiffGFC6PtRP->Append("M = ");
1833    (*entryDiffGFC6PtRP)+=(Long_t)avMultDiffFlowGFCRP;
1834    entryDiffGFC6PtRP->Append(", N = ");
1835    (*entryDiffGFC6PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
1836    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes6->GetHistDiffFlowPtRP(),entryDiffGFC6PtRP->Data(),"p");
1837   } 
1838   if(plotGFC8PtRP && gfcCommonHistRes8)
1839   {
1840    entryDiffGFC8PtRP->Append("M = ");
1841    (*entryDiffGFC8PtRP)+=(Long_t)avMultDiffFlowGFCRP;
1842    entryDiffGFC8PtRP->Append(", N = ");
1843    (*entryDiffGFC8PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
1844    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes8->GetHistDiffFlowPtRP(),entryDiffGFC8PtRP->Data(),"p");
1845   }  
1846   
1847   //QC
1848   if(plotQC2PtRP && qcCommonHistRes2)
1849   {
1850    entryDiffQC2PtRP->Append("M = ");
1851    (*entryDiffQC2PtRP)+=(Long_t)avMultDiffFlowQC2RP;
1852    entryDiffQC2PtRP->Append(", N = ");
1853    (*entryDiffQC2PtRP)+=(Long_t)nEvtsDiffFlowQC2RP; 
1854    legendDiffFlowPtRP->AddEntry(qcCommonHistRes2->GetHistDiffFlowPtRP(),entryDiffQC2PtRP->Data(),"p");
1855   }
1856   if(plotQC4PtRP && qcCommonHistRes4)
1857   {
1858    entryDiffQC4PtRP->Append("M = ");
1859    (*entryDiffQC4PtRP)+=(Long_t)avMultDiffFlowQC4RP;
1860    entryDiffQC4PtRP->Append(", N = ");
1861    (*entryDiffQC4PtRP)+=(Long_t)nEvtsDiffFlowQC4RP; 
1862    legendDiffFlowPtRP->AddEntry(qcCommonHistRes4->GetHistDiffFlowPtRP(),entryDiffQC4PtRP->Data(),"p");
1863   }
1864   if(plotQC6PtRP && qcCommonHistRes6)
1865   {
1866    entryDiffQC6PtRP->Append("M = ");
1867    (*entryDiffQC6PtRP)+=(Long_t)avMultDiffFlowQC6RP;
1868    entryDiffQC6PtRP->Append(", N = ");
1869    (*entryDiffQC6PtRP)+=(Long_t)nEvtsDiffFlowQC6RP; 
1870    legendDiffFlowPtRP->AddEntry(qcCommonHistRes6->GetHistDiffFlowPtRP(),entryDiffQC6PtRP->Data(),"p");
1871   }
1872   if(plotQC8PtRP && qcCommonHistRes8)
1873   {
1874    entryDiffQC8PtRP->Append("M = ");
1875    (*entryDiffQC8PtRP)+=(Long_t)avMultDiffFlowQC8RP;
1876    entryDiffQC8PtRP->Append(", N = ");
1877    (*entryDiffQC8PtRP)+=(Long_t)nEvtsDiffFlowQC8RP; 
1878    legendDiffFlowPtRP->AddEntry(qcCommonHistRes8->GetHistDiffFlowPtRP(),entryDiffQC8PtRP->Data(),"p");
1879   }
1880   
1881   //LYZ2
1882   if(plotLYZ2PtRP && lyz2CommonHistRes)
1883   {
1884    entryDiffLYZ2PtRP->Append("M = ");
1885    (*entryDiffLYZ2PtRP)+=(Long_t)avMultDiffFlowLYZ2RP;
1886    entryDiffLYZ2PtRP->Append(", N = ");
1887    (*entryDiffLYZ2PtRP)+=(Long_t)nEvtsDiffFlowLYZ2RP; 
1888    legendDiffFlowPtRP->AddEntry(lyz2CommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZ2PtRP->Data(),"p");
1889   }
1890   
1891   //LYZEP
1892   if(plotLYZEPPtRP && lyzepCommonHistRes)
1893   {
1894    entryDiffLYZEPPtRP->Append("M = ");
1895    (*entryDiffLYZEPPtRP)+=(Long_t)avMultDiffFlowLYZEPRP;
1896    entryDiffLYZEPPtRP->Append(", N = ");
1897    (*entryDiffLYZEPPtRP)+=(Long_t)nEvtsDiffFlowLYZEPRP; 
1898    legendDiffFlowPtRP->AddEntry(lyzepCommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZEPPtRP->Data(),"p");
1899   }
1900
1901   //drawing finally the legend in the 2nd pad:     
1902   if(legendDiffFlowPtRP)
1903   {
1904    legendDiffFlowPtRP->SetMargin(0.15);
1905    legendDiffFlowPtRP->Draw();
1906   }
1907  }// end of if(plotDiffFlowPtRP)
1908  //----------------------------------------------------------------------------------
1909  
1910  
1911  //----------------------------------------------------------------------------------
1912  //final drawing for differential flow (Eta, RP):
1913  //set here the results of which methods will be plotted by default:
1914  Bool_t plotMCEtaRP    = kFALSE;
1915  Bool_t plotGFC2EtaRP  = kTRUE;
1916  Bool_t plotGFC4EtaRP  = kTRUE;
1917  Bool_t plotGFC6EtaRP  = kTRUE;
1918  Bool_t plotGFC8EtaRP  = kTRUE;
1919  Bool_t plotQC2EtaRP   = kTRUE;
1920  Bool_t plotQC4EtaRP   = kTRUE;
1921  Bool_t plotQC6EtaRP   = kTRUE;
1922  Bool_t plotQC8EtaRP   = kTRUE;
1923  Bool_t plotLYZ2EtaRP  = kTRUE;
1924  Bool_t plotLYZEPEtaRP = kTRUE;
1925  if(plotDiffFlowEtaRP)
1926  {
1927   TCanvas* diffFlowEtaAllCanvasRP = new TCanvas("Differential Flow (Eta) of RP","Differential Flow (Eta) of RP ",1000,600);
1928  
1929   diffFlowEtaAllCanvasRP->Divide(2,1);
1930  
1931   //1st pad is for plot:
1932   (diffFlowEtaAllCanvasRP->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1933   
1934   if(styleHistEta)
1935   {
1936    (styleHistEta->GetYaxis())->SetRangeUser(-0.3,1.0);
1937    styleHistEta->Draw();
1938   }
1939   if(pMeshDiffFlowEtaRP)
1940   {
1941    pMeshDiffFlowEtaRP->Draw("LFSAME");
1942   }
1943  
1944   //MC 
1945   if(plotMCEtaRP && mcepCommonHistRes)
1946   { 
1947    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
1948   }
1949   //GFC
1950   if(plotGFC2EtaRP && gfcCommonHistRes2)
1951   { 
1952    (gfcCommonHistRes2->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
1953   } 
1954   if(plotGFC4EtaRP && gfcCommonHistRes4)
1955   { 
1956    (gfcCommonHistRes4->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
1957   } 
1958   if(plotGFC6EtaRP && gfcCommonHistRes6)
1959   { 
1960    (gfcCommonHistRes6->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
1961   } 
1962   if(plotGFC8EtaRP && gfcCommonHistRes8)
1963   { 
1964    (gfcCommonHistRes8->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
1965   }    
1966   //QC
1967   if(plotQC2EtaRP && qcCommonHistRes2)
1968   { 
1969    (qcCommonHistRes2->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
1970   }
1971   if(plotQC4EtaRP && qcCommonHistRes4)
1972   { 
1973    (qcCommonHistRes4->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
1974   }
1975   if(plotQC6EtaRP && qcCommonHistRes6)
1976   { 
1977    (qcCommonHistRes6->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
1978   }
1979   if(plotQC8EtaRP && qcCommonHistRes8)
1980   { 
1981    (qcCommonHistRes8->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
1982   }
1983   //LYZ2
1984   if(plotLYZ2EtaRP && lyz2CommonHistRes)
1985   { 
1986    (lyz2CommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
1987   }
1988   //LYZEP
1989   if(plotLYZEPEtaRP && lyzepCommonHistRes)
1990   { 
1991    (lyzepCommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
1992   }
1993  
1994   //2nd pad is for legend:
1995   (diffFlowEtaAllCanvasRP->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1996
1997   TLegend* legendDiffFlowEtaRP = new TLegend(0.02,0.25,0.97,0.75);
1998   legendDiffFlowEtaRP->SetTextFont(72);
1999   legendDiffFlowEtaRP->SetTextSize(0.06);
2000   
2001   //legend's entries:
2002   TString *entryDiffMCEtaRP   = new TString("MC ....... ");
2003   TString *entryDiffGFC2EtaRP = new TString("GFC{2} ... ");
2004   TString *entryDiffGFC4EtaRP = new TString("GFC{4} ... ");
2005   TString *entryDiffGFC6EtaRP = new TString("GFC{6} ... ");
2006   TString *entryDiffGFC8EtaRP = new TString("GFC{8} ... "); 
2007   TString *entryDiffQC2EtaRP  = new TString("QC{2} .... ");
2008   TString *entryDiffQC4EtaRP  = new TString("QC{4} .... ");
2009   TString *entryDiffQC6EtaRP  = new TString("QC{6} .... ");
2010   TString *entryDiffQC8EtaRP  = new TString("QC{8} .... ");
2011   TString *entryDiffLYZ2EtaRP = new TString("LYZ ...... ");
2012   TString *entryDiffLYZEPEtaRP = new TString("LYZEP ... ");
2013  
2014   //MC
2015   if(mcepCommonHistRes)
2016   {
2017    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetFillStyle(meshStyle);
2018    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetFillColor(meshColor);
2019    entryDiffMCEtaRP->Append("M = ");
2020    (*entryDiffMCEtaRP)+=(Long_t)avMultDiffFlowMCRP;
2021    entryDiffMCEtaRP->Append(", N = ");
2022    (*entryDiffMCEtaRP)+=(Long_t)nEvtsDiffFlowMCRP; 
2023    legendDiffFlowEtaRP->AddEntry(mcepCommonHistRes->GetHistDiffFlowEtaRP(),entryDiffMCEtaRP->Data(),"f");
2024   }
2025  
2026   //GFC
2027   if(plotGFC2EtaRP && gfcCommonHistRes2)
2028   {
2029    entryDiffGFC2EtaRP->Append("M = ");
2030    (*entryDiffGFC2EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2031    entryDiffGFC2EtaRP->Append(", N = ");
2032    (*entryDiffGFC2EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2033    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes2->GetHistDiffFlowEtaRP(),entryDiffGFC2EtaRP->Data(),"p");
2034   }
2035   if(plotGFC4EtaRP && gfcCommonHistRes4)
2036   {
2037    entryDiffGFC4EtaRP->Append("M = ");
2038    (*entryDiffGFC4EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2039    entryDiffGFC4EtaRP->Append(", N = ");
2040    (*entryDiffGFC4EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2041    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes4->GetHistDiffFlowEtaRP(),entryDiffGFC4EtaRP->Data(),"p");
2042   }
2043   if(plotGFC6EtaRP && gfcCommonHistRes6)
2044   {
2045    entryDiffGFC6EtaRP->Append("M = ");
2046    (*entryDiffGFC6EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2047    entryDiffGFC6EtaRP->Append(", N = ");
2048    (*entryDiffGFC6EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2049    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes6->GetHistDiffFlowEtaRP(),entryDiffGFC6EtaRP->Data(),"p");
2050   } 
2051   if(plotGFC8EtaRP && gfcCommonHistRes8)
2052   {
2053    entryDiffGFC8EtaRP->Append("M = ");
2054    (*entryDiffGFC8EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2055    entryDiffGFC8EtaRP->Append(", N = ");
2056    (*entryDiffGFC8EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2057    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes8->GetHistDiffFlowEtaRP(),entryDiffGFC8EtaRP->Data(),"p");
2058   }  
2059   
2060   //QC
2061   if(plotQC2EtaRP && qcCommonHistRes2)
2062   {
2063    entryDiffQC2EtaRP->Append("M = ");
2064    (*entryDiffQC2EtaRP)+=(Long_t)avMultDiffFlowQC2RP;
2065    entryDiffQC2EtaRP->Append(", N = ");
2066    (*entryDiffQC2EtaRP)+=(Long_t)nEvtsDiffFlowQC2RP; 
2067    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes2->GetHistDiffFlowEtaRP(),entryDiffQC2EtaRP->Data(),"p");
2068   }
2069   if(plotQC4EtaRP && qcCommonHistRes4)
2070   {
2071    entryDiffQC4EtaRP->Append("M = ");
2072    (*entryDiffQC4EtaRP)+=(Long_t)avMultDiffFlowQC4RP;
2073    entryDiffQC4EtaRP->Append(", N = ");
2074    (*entryDiffQC4EtaRP)+=(Long_t)nEvtsDiffFlowQC4RP; 
2075    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes4->GetHistDiffFlowEtaRP(),entryDiffQC4EtaRP->Data(),"p");
2076   }
2077   if(plotQC6EtaRP && qcCommonHistRes6)
2078   {
2079    entryDiffQC6EtaRP->Append("M = ");
2080    (*entryDiffQC6EtaRP)+=(Long_t)avMultDiffFlowQC6RP;
2081    entryDiffQC6EtaRP->Append(", N = ");
2082    (*entryDiffQC6EtaRP)+=(Long_t)nEvtsDiffFlowQC6RP; 
2083    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes6->GetHistDiffFlowEtaRP(),entryDiffQC6EtaRP->Data(),"p");
2084   }
2085   if(plotQC8EtaRP && qcCommonHistRes8)
2086   {
2087    entryDiffQC8EtaRP->Append("M = ");
2088    (*entryDiffQC8EtaRP)+=(Long_t)avMultDiffFlowQC8RP;
2089    entryDiffQC8EtaRP->Append(", N = ");
2090    (*entryDiffQC8EtaRP)+=(Long_t)nEvtsDiffFlowQC8RP; 
2091    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes8->GetHistDiffFlowEtaRP(),entryDiffQC8EtaRP->Data(),"p");
2092   }
2093  
2094   //LYZ2
2095   if(plotLYZ2EtaRP && lyz2CommonHistRes)
2096   {
2097    entryDiffLYZ2EtaRP->Append("M = ");
2098    (*entryDiffLYZ2EtaRP)+=(Long_t)avMultDiffFlowLYZ2RP;
2099    entryDiffLYZ2EtaRP->Append(", N = ");
2100    (*entryDiffLYZ2EtaRP)+=(Long_t)nEvtsDiffFlowLYZ2RP; 
2101    legendDiffFlowEtaRP->AddEntry(lyz2CommonHistRes->GetHistDiffFlowEtaRP(),entryDiffLYZ2EtaRP->Data(),"p");
2102   }
2103   
2104   //LYZEP
2105   if(plotLYZEPEtaRP && lyzepCommonHistRes)
2106   {
2107    entryDiffLYZEPEtaRP->Append("M = ");
2108    (*entryDiffLYZEPEtaRP)+=(Long_t)avMultDiffFlowLYZEPRP;
2109    entryDiffLYZEPEtaRP->Append(", N = ");
2110    (*entryDiffLYZEPEtaRP)+=(Long_t)nEvtsDiffFlowLYZEPRP; 
2111    legendDiffFlowEtaRP->AddEntry(lyzepCommonHistRes->GetHistDiffFlowEtaRP(),entryDiffLYZEPEtaRP->Data(),"p");
2112   }
2113
2114   //drawing finally the legend in the 2nd pad:     
2115   if(legendDiffFlowEtaRP)
2116   {
2117    legendDiffFlowEtaRP->SetMargin(0.15);
2118    legendDiffFlowEtaRP->Draw();
2119   }
2120  }// end of if(plotDiffFlowEtaRP)
2121  //----------------------------------------------------------------------------------
2122
2123  //----------------------------------------------------------------------------------
2124  //final drawing for differential flow (Pt, POI):
2125  //set here the results of which methods will be plotted by default:
2126  Bool_t plotMCPtPOI    = kFALSE;
2127  Bool_t plotGFC2PtPOI  = kTRUE;
2128  Bool_t plotGFC4PtPOI  = kTRUE;
2129  Bool_t plotGFC6PtPOI  = kTRUE;
2130  Bool_t plotGFC8PtPOI  = kTRUE;
2131  Bool_t plotQC2PtPOI   = kTRUE;
2132  Bool_t plotQC4PtPOI   = kTRUE;
2133  Bool_t plotQC6PtPOI   = kTRUE;
2134  Bool_t plotQC8PtPOI   = kTRUE;
2135  Bool_t plotLYZ2PtPOI  = kTRUE;
2136  Bool_t plotLYZEPPtPOI = kTRUE; 
2137  if(plotDiffFlowPtPOI)
2138  {
2139   TCanvas* diffFlowPtAllCanvasPOI = new TCanvas("Differential Flow (Pt) of POI","Differential Flow (Pt) of POI ",1000,600);
2140  
2141   diffFlowPtAllCanvasPOI->Divide(2,1);
2142  
2143   //1st pad is for plot:
2144   (diffFlowPtAllCanvasPOI->cd(1))->SetPad(0.0,0.0,0.75,1.0);
2145   
2146   if(styleHistPt)
2147   {
2148    (styleHistPt->GetYaxis())->SetRangeUser(-0.3,1.0);
2149    styleHistPt->Draw();
2150   }
2151   if(pMeshDiffFlowPtPOI)
2152   {
2153    pMeshDiffFlowPtPOI->Draw("LFSAME");
2154   }
2155  
2156   //MC 
2157   if(plotMCPtPOI && mcepCommonHistRes)
2158   { 
2159    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
2160   }
2161   //GFC
2162   if(plotGFC2PtPOI && gfcCommonHistRes2)
2163   { 
2164    (gfcCommonHistRes2->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
2165   } 
2166   if(plotGFC4PtPOI && gfcCommonHistRes4)
2167   { 
2168    (gfcCommonHistRes4->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
2169   } 
2170   if(plotGFC6PtPOI && gfcCommonHistRes6)
2171   { 
2172    (gfcCommonHistRes6->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
2173   } 
2174   if(plotGFC8PtPOI && gfcCommonHistRes8)
2175   { 
2176    (gfcCommonHistRes8->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
2177   }    
2178   //QC
2179   if(plotQC2PtPOI && qcCommonHistRes2)
2180   { 
2181    (qcCommonHistRes2->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
2182   }
2183   if(plotQC4PtPOI && qcCommonHistRes4)
2184   { 
2185    (qcCommonHistRes4->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
2186   }
2187   if(plotQC6PtPOI && qcCommonHistRes6)
2188   { 
2189    (qcCommonHistRes6->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
2190   }
2191   if(plotQC8PtPOI && qcCommonHistRes8)
2192   { 
2193    (qcCommonHistRes8->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
2194   }
2195   //LYZ2
2196   if(plotLYZ2PtPOI && lyz2CommonHistRes)
2197   { 
2198    (lyz2CommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
2199   }
2200   //LYZEP
2201   if(plotLYZEPPtPOI && lyzepCommonHistRes)
2202   { 
2203    (lyzepCommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
2204   }
2205  
2206   //2nd pad is for legend:
2207   (diffFlowPtAllCanvasPOI->cd(2))->SetPad(0.75,0.0,1.0,1.0);
2208
2209   TLegend* legendDiffFlowPtPOI = new TLegend(0.02,0.25,0.97,0.75);
2210   legendDiffFlowPtPOI->SetTextFont(72);
2211   legendDiffFlowPtPOI->SetTextSize(0.06);
2212  
2213   //legend's entries:
2214   TString *entryDiffMCPtPOI   = new TString("MC ....... ");
2215   TString *entryDiffGFC2PtPOI = new TString("GFC{2} ... ");
2216   TString *entryDiffGFC4PtPOI = new TString("GFC{4} ... ");
2217   TString *entryDiffGFC6PtPOI = new TString("GFC{6} ... ");
2218   TString *entryDiffGFC8PtPOI = new TString("GFC{8} ... "); 
2219   TString *entryDiffQC2PtPOI  = new TString("QC{2} .... ");
2220   TString *entryDiffQC4PtPOI  = new TString("QC{4} .... ");
2221   TString *entryDiffQC6PtPOI  = new TString("QC{6} .... ");
2222   TString *entryDiffQC8PtPOI  = new TString("QC{8} .... ");
2223   TString *entryDiffLYZ2PtPOI = new TString("LYZ ...... ");
2224   TString *entryDiffLYZEPPtPOI = new TString("LYZEP ... "); 
2225  
2226   //MC
2227   if(mcepCommonHistRes)
2228   {
2229    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetFillStyle(meshStyle);
2230    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetFillColor(meshColor);
2231    entryDiffMCPtPOI->Append("M = ");
2232    (*entryDiffMCPtPOI)+=(Long_t)avMultDiffFlowMCPOI;
2233    entryDiffMCPtPOI->Append(", N = ");
2234    (*entryDiffMCPtPOI)+=(Long_t)nEvtsDiffFlowMCPOI; 
2235    legendDiffFlowPtPOI->AddEntry(mcepCommonHistRes->GetHistDiffFlowPtPOI(),entryDiffMCPtPOI->Data(),"f");
2236   }
2237
2238   //GFC
2239   if(plotGFC2PtPOI && gfcCommonHistRes2)
2240   {
2241    entryDiffGFC2PtPOI->Append("M = ");
2242    (*entryDiffGFC2PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2243    entryDiffGFC2PtPOI->Append(", N = ");
2244    (*entryDiffGFC2PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2245    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes2->GetHistDiffFlowPtPOI(),entryDiffGFC2PtPOI->Data(),"p");
2246   }
2247   if(plotGFC4PtPOI && gfcCommonHistRes4)
2248   {
2249    entryDiffGFC4PtPOI->Append("M = ");
2250    (*entryDiffGFC4PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2251    entryDiffGFC4PtPOI->Append(", N = ");
2252    (*entryDiffGFC4PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2253    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes4->GetHistDiffFlowPtPOI(),entryDiffGFC4PtPOI->Data(),"p");
2254   }
2255   if(plotGFC6PtPOI && gfcCommonHistRes6)
2256   {
2257    entryDiffGFC6PtPOI->Append("M = ");
2258    (*entryDiffGFC6PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2259    entryDiffGFC6PtPOI->Append(", N = ");
2260    (*entryDiffGFC6PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2261    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes6->GetHistDiffFlowPtPOI(),entryDiffGFC6PtPOI->Data(),"p");
2262   } 
2263   if(plotGFC8PtPOI && gfcCommonHistRes8)
2264   {
2265    entryDiffGFC8PtPOI->Append("M = ");
2266    (*entryDiffGFC8PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2267    entryDiffGFC8PtPOI->Append(", N = ");
2268    (*entryDiffGFC8PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2269    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes8->GetHistDiffFlowPtPOI(),entryDiffGFC8PtPOI->Data(),"p");
2270   }  
2271   
2272   //QC
2273   if(plotQC2PtPOI && qcCommonHistRes2)
2274   {
2275    entryDiffQC2PtPOI->Append("M = ");
2276    (*entryDiffQC2PtPOI)+=(Long_t)avMultDiffFlowQC2POI;
2277    entryDiffQC2PtPOI->Append(", N = ");
2278    (*entryDiffQC2PtPOI)+=(Long_t)nEvtsDiffFlowQC2POI; 
2279    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes2->GetHistDiffFlowPtPOI(),entryDiffQC2PtPOI->Data(),"p");
2280   }
2281   if(plotQC4PtPOI && qcCommonHistRes4)
2282   {
2283    entryDiffQC4PtPOI->Append("M = ");
2284    (*entryDiffQC4PtPOI)+=(Long_t)avMultDiffFlowQC4POI;
2285    entryDiffQC4PtPOI->Append(", N = ");
2286    (*entryDiffQC4PtPOI)+=(Long_t)nEvtsDiffFlowQC4POI; 
2287    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes4->GetHistDiffFlowPtPOI(),entryDiffQC4PtPOI->Data(),"p");
2288   }
2289   if(plotQC6PtPOI && qcCommonHistRes6)
2290   {
2291    entryDiffQC6PtPOI->Append("M = ");
2292    (*entryDiffQC6PtPOI)+=(Long_t)avMultDiffFlowQC6POI;
2293    entryDiffQC6PtPOI->Append(", N = ");
2294    (*entryDiffQC6PtPOI)+=(Long_t)nEvtsDiffFlowQC6POI; 
2295    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes6->GetHistDiffFlowPtPOI(),entryDiffQC6PtPOI->Data(),"p");
2296   }
2297   if(plotQC8PtPOI && qcCommonHistRes8)
2298   {
2299    entryDiffQC8PtPOI->Append("M = ");
2300    (*entryDiffQC8PtPOI)+=(Long_t)avMultDiffFlowQC8POI;
2301    entryDiffQC8PtPOI->Append(", N = ");
2302    (*entryDiffQC8PtPOI)+=(Long_t)nEvtsDiffFlowQC8POI; 
2303    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes8->GetHistDiffFlowPtPOI(),entryDiffQC8PtPOI->Data(),"p");
2304   }
2305  
2306   //LYZ2
2307   if(plotLYZ2PtPOI && lyz2CommonHistRes)
2308   {
2309    entryDiffLYZ2PtPOI->Append("M = ");
2310    (*entryDiffLYZ2PtPOI)+=(Long_t)avMultDiffFlowLYZ2POI;
2311    entryDiffLYZ2PtPOI->Append(", N = ");
2312    (*entryDiffLYZ2PtPOI)+=(Long_t)nEvtsDiffFlowLYZ2POI; 
2313    legendDiffFlowPtPOI->AddEntry(lyz2CommonHistRes->GetHistDiffFlowPtPOI(),entryDiffLYZ2PtPOI->Data(),"p");
2314   }
2315   
2316   //LYZEP
2317   if(plotLYZEPPtPOI && lyzepCommonHistRes)
2318   {
2319    entryDiffLYZEPPtPOI->Append("M = ");
2320    (*entryDiffLYZEPPtPOI)+=(Long_t)avMultDiffFlowLYZEPPOI;
2321    entryDiffLYZEPPtPOI->Append(", N = ");
2322    (*entryDiffLYZEPPtPOI)+=(Long_t)nEvtsDiffFlowLYZEPPOI; 
2323    legendDiffFlowPtPOI->AddEntry(lyzepCommonHistRes->GetHistDiffFlowPtPOI(),entryDiffLYZEPPtPOI->Data(),"p");
2324   }
2325
2326   //drawing finally the legend in the 2nd pad:     
2327   if(legendDiffFlowPtPOI)
2328   {
2329    legendDiffFlowPtPOI->SetMargin(0.15);
2330    legendDiffFlowPtPOI->Draw();
2331   }
2332  }//end of if(plotDiffFlowPtPOI)
2333  //----------------------------------------------------------------------------------
2334  
2335
2336  //----------------------------------------------------------------------------------
2337  //final drawing for differential flow (Eta, POI):
2338  //set here the results of which methods will be plotted by default:
2339  Bool_t plotMCEtaPOI    = kFALSE;
2340  Bool_t plotGFC2EtaPOI  = kTRUE;
2341  Bool_t plotGFC4EtaPOI  = kTRUE;
2342  Bool_t plotGFC6EtaPOI  = kTRUE;
2343  Bool_t plotGFC8EtaPOI  = kTRUE;
2344  Bool_t plotQC2EtaPOI   = kTRUE;
2345  Bool_t plotQC4EtaPOI   = kTRUE;
2346  Bool_t plotQC6EtaPOI   = kTRUE;
2347  Bool_t plotQC8EtaPOI   = kTRUE;
2348  Bool_t plotLYZ2EtaPOI  = kTRUE;
2349  Bool_t plotLYZEPEtaPOI = kTRUE;
2350  if(plotDiffFlowEtaPOI)
2351  {
2352   TCanvas* diffFlowEtaAllCanvasPOI = new TCanvas("Differential Flow (Eta) of POI","Differential Flow (Eta) of POI ",1000,600);
2353  
2354   diffFlowEtaAllCanvasPOI->Divide(2,1);
2355   
2356   //1st pad is for plot:
2357   (diffFlowEtaAllCanvasPOI->cd(1))->SetPad(0.0,0.0,0.75,1.0);
2358  
2359   if(styleHistEta)
2360   {
2361    (styleHistEta->GetYaxis())->SetRangeUser(-0.3,1.0);
2362    styleHistEta->Draw();
2363   }
2364   if(pMeshDiffFlowEtaPOI)
2365   {
2366    pMeshDiffFlowEtaPOI->Draw("LFSAME");
2367   }
2368  
2369   //MC 
2370   if(plotMCEtaPOI && mcepCommonHistRes)
2371   { 
2372    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
2373   }
2374   //GFC
2375   if(plotGFC2EtaPOI && gfcCommonHistRes2)
2376   { 
2377    (gfcCommonHistRes2->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
2378   } 
2379   if(plotGFC4EtaPOI && gfcCommonHistRes4)
2380   { 
2381    (gfcCommonHistRes4->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
2382   } 
2383   if(plotGFC6EtaPOI && gfcCommonHistRes6)
2384   { 
2385    (gfcCommonHistRes6->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
2386   } 
2387   if(plotGFC8EtaPOI && gfcCommonHistRes8)
2388   { 
2389    (gfcCommonHistRes8->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
2390   }    
2391   //QC
2392   if(plotQC2EtaPOI && qcCommonHistRes2)
2393   { 
2394    (qcCommonHistRes2->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
2395   }
2396   if(plotQC4EtaPOI && qcCommonHistRes4)
2397   { 
2398    (qcCommonHistRes4->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
2399   }
2400   if(plotQC6EtaPOI && qcCommonHistRes6)
2401   { 
2402    (qcCommonHistRes6->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
2403   }
2404   if(plotQC8EtaPOI && qcCommonHistRes8)
2405   { 
2406    (qcCommonHistRes8->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
2407   }
2408   //LYZ2
2409   if(plotLYZ2EtaPOI && lyz2CommonHistRes)
2410   { 
2411    (lyz2CommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
2412   }
2413   //LYZEP
2414   if(plotLYZEPEtaPOI && lyzepCommonHistRes)
2415   { 
2416    (lyzepCommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
2417   }
2418  
2419   //2nd pad is for legend:
2420   (diffFlowEtaAllCanvasPOI->cd(2))->SetPad(0.75,0.0,1.0,1.0);
2421  
2422   TLegend* legendDiffFlowEtaPOI = new TLegend(0.02,0.25,0.97,0.75);
2423   legendDiffFlowEtaPOI->SetTextFont(72);
2424   legendDiffFlowEtaPOI->SetTextSize(0.06);
2425  
2426   //legend's entries:
2427   TString *entryDiffMCEtaPOI    = new TString("MC ....... ");
2428   TString *entryDiffGFC2EtaPOI  = new TString("GFC{2} ... ");
2429   TString *entryDiffGFC4EtaPOI  = new TString("GFC{4} ... ");
2430   TString *entryDiffGFC6EtaPOI  = new TString("GFC{6} ... ");
2431   TString *entryDiffGFC8EtaPOI  = new TString("GFC{8} ... "); 
2432   TString *entryDiffQC2EtaPOI   = new TString("QC{2} .... ");
2433   TString *entryDiffQC4EtaPOI   = new TString("QC{4} .... ");
2434   TString *entryDiffQC6EtaPOI   = new TString("QC{6} .... ");
2435   TString *entryDiffQC8EtaPOI   = new TString("QC{8} .... ");
2436   TString *entryDiffLYZ2EtaPOI  = new TString("LYZ ...... ");
2437   TString *entryDiffLYZEPEtaPOI = new TString("LYZEP ... ");
2438  
2439   //MC
2440   if(mcepCommonHistRes)
2441   {
2442    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetFillStyle(meshStyle);
2443    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetFillColor(meshColor);
2444    entryDiffMCEtaPOI->Append("M = ");
2445    (*entryDiffMCEtaPOI)+=(Long_t)avMultDiffFlowMCPOI;
2446    entryDiffMCEtaPOI->Append(", N = ");
2447    (*entryDiffMCEtaPOI)+=(Long_t)nEvtsDiffFlowMCPOI; 
2448    legendDiffFlowEtaPOI->AddEntry(mcepCommonHistRes->GetHistDiffFlowEtaPOI(),entryDiffMCEtaPOI->Data(),"f");
2449   }
2450
2451   //GFC
2452   if(plotGFC2EtaPOI && gfcCommonHistRes2)
2453   {
2454    entryDiffGFC2EtaPOI->Append("M = ");
2455    (*entryDiffGFC2EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2456    entryDiffGFC2EtaPOI->Append(", N = ");
2457    (*entryDiffGFC2EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2458    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes2->GetHistDiffFlowEtaPOI(),entryDiffGFC2EtaPOI->Data(),"p");
2459   }
2460   if(plotGFC4EtaPOI && gfcCommonHistRes4)
2461   {
2462    entryDiffGFC4EtaPOI->Append("M = ");
2463    (*entryDiffGFC4EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2464    entryDiffGFC4EtaPOI->Append(", N = ");
2465    (*entryDiffGFC4EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2466    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes4->GetHistDiffFlowEtaPOI(),entryDiffGFC4EtaPOI->Data(),"p");
2467   }
2468   if(plotGFC6EtaPOI && gfcCommonHistRes6)
2469   {
2470    entryDiffGFC6EtaPOI->Append("M = ");
2471    (*entryDiffGFC6EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2472    entryDiffGFC6EtaPOI->Append(", N = ");
2473    (*entryDiffGFC6EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2474    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes6->GetHistDiffFlowEtaPOI(),entryDiffGFC6EtaPOI->Data(),"p");
2475   } 
2476   if(plotGFC8EtaPOI && gfcCommonHistRes8)
2477   {
2478    entryDiffGFC8EtaPOI->Append("M = ");
2479    (*entryDiffGFC8EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
2480    entryDiffGFC8EtaPOI->Append(", N = ");
2481    (*entryDiffGFC8EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
2482    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes8->GetHistDiffFlowEtaPOI(),entryDiffGFC8EtaPOI->Data(),"p");
2483   }  
2484  
2485   //QC
2486   if(plotQC2EtaPOI && qcCommonHistRes2)
2487   {
2488    entryDiffQC2EtaPOI->Append("M = ");
2489    (*entryDiffQC2EtaPOI)+=(Long_t)avMultDiffFlowQC2POI;
2490    entryDiffQC2EtaPOI->Append(", N = ");
2491    (*entryDiffQC2EtaPOI)+=(Long_t)nEvtsDiffFlowQC2POI; 
2492    legendDiffFlowEtaPOI->AddEntry(qcCommonHistRes2->GetHistDiffFlowEtaPOI(),entryDiffQC2EtaPOI->Data(),"p");
2493   }
2494   if(plotQC4EtaPOI && qcCommonHistRes4)
2495   {
2496    entryDiffQC4EtaPOI->Append("M = ");
2497    (*entryDiffQC4EtaPOI)+=(Long_t)avMultDiffFlowQC4POI;
2498    entryDiffQC4EtaPOI->Append(", N = ");
2499    (*entryDiffQC4EtaPOI)+=(Long_t)nEvtsDiffFlowQC4POI; 
2500    legendDiffFlowEtaPOI->AddEntry(qcCommonHistRes4->GetHistDiffFlowEtaPOI(),entryDiffQC4EtaPOI->Data(),"p");
2501   }
2502   if(plotQC6EtaPOI && qcCommonHistRes6)
2503   {
2504    entryDiffQC6EtaPOI->Append("M = ");
2505    (*entryDiffQC6EtaPOI)+=(Long_t)avMultDiffFlowQC6POI;
2506    entryDiffQC6EtaPOI->Append(", N = ");
2507    (*entryDiffQC6EtaPOI)+=(Long_t)nEvtsDiffFlowQC6POI; 
2508    legendDiffFlowEtaPOI->AddEntry(qcCommonHistRes6->GetHistDiffFlowEtaPOI(),entryDiffQC6EtaPOI->Data(),"p");
2509   }
2510   if(plotQC8EtaPOI && qcCommonHistRes8)
2511   {
2512    entryDiffQC8EtaPOI->Append("M = ");
2513    (*entryDiffQC8EtaPOI)+=(Long_t)avMultDiffFlowQC8POI;
2514    entryDiffQC8EtaPOI->Append(", N = ");
2515    (*entryDiffQC8EtaPOI)+=(Long_t)nEvtsDiffFlowQC8POI; 
2516    legendDiffFlowEtaPOI->AddEntry(qcCommonHistRes8->GetHistDiffFlowEtaPOI(),entryDiffQC8EtaPOI->Data(),"p");
2517   }
2518  
2519   //LYZ2
2520   if(plotLYZ2EtaPOI && lyz2CommonHistRes)
2521   {
2522    entryDiffLYZ2EtaPOI->Append("M = ");
2523    (*entryDiffLYZ2EtaPOI)+=(Long_t)avMultDiffFlowLYZ2POI;
2524    entryDiffLYZ2EtaPOI->Append(", N = ");
2525    (*entryDiffLYZ2EtaPOI)+=(Long_t)nEvtsDiffFlowLYZ2POI; 
2526    legendDiffFlowEtaPOI->AddEntry(lyz2CommonHistRes->GetHistDiffFlowEtaPOI(),entryDiffLYZ2EtaPOI->Data(),"p");
2527   }
2528   
2529   //LYZEP
2530   if(plotLYZEPEtaPOI && lyzepCommonHistRes)
2531   {
2532    entryDiffLYZEPEtaPOI->Append("M = ");
2533    (*entryDiffLYZEPEtaPOI)+=(Long_t)avMultDiffFlowLYZEPPOI;
2534    entryDiffLYZEPEtaPOI->Append(", N = ");
2535    (*entryDiffLYZEPEtaPOI)+=(Long_t)nEvtsDiffFlowLYZEPPOI; 
2536    legendDiffFlowEtaPOI->AddEntry(lyzepCommonHistRes->GetHistDiffFlowEtaPOI(),entryDiffLYZEPEtaPOI->Data(),"p");
2537   }
2538
2539   //drawing finally the legend in the 2nd pad:     
2540   if(legendDiffFlowEtaPOI)
2541   {
2542    legendDiffFlowEtaPOI->SetMargin(0.15);
2543    legendDiffFlowEtaPOI->Draw();
2544   }
2545  }//end of if(plotDiffFlowEtaPOI)
2546  //----------------------------------------------------------------------------------
2547
2548
2549  //=====================================================================================
2550
2551 }