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