Modifications for embedding into raw data
[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
4 enum libModes {mLocal,mLocalSource};
5 //mLocal: Analyze data on your computer using aliroot
6 //mLocalSource: Analyze data on your computer using root + source files
7
8 //void compareFlowResults(TString type="",Int_t mode=mLocalSource)
9 void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
10
11
12   // load needed libraries:                       
13   LoadPlotLibraries(mode);
14
15
16   //==================================================================================
17   //             set here which plots will be shown by default
18   //==================================================================================
19   Bool_t plotIntFlow = kTRUE;                  // integrated flow (no-name) // to be improved
20   Bool_t plotIntFlowRelativeToMC = kTRUE;      // plot |v{MC}-v{method}/v{MC}| for integrated flow (no-name) // to be improved
21   // RP = particles used to determine the reaction plane
22   Bool_t plotIntFlowRP = kTRUE;             // integrated flow RP
23   Bool_t plotIntFlowRelativeToMCRP = kTRUE;   // plot |v{MC}-v{method}/v{MC}| for integrated flow (RP) // to be improved
24   Bool_t plotDiffFlowPtRP = kTRUE;             // differential flow (Pt,RP)
25   Bool_t plotDiffFlowEtaRP = kTRUE;             // differential flow (Eta,RP)
26   Bool_t plotDiffFlowPtRelativeToMCRP = kTRUE;  // plot |v{MC}-v{method}/v{MC}| as a function of pt for RPs   
27   // POI = particle of interest
28   Bool_t plotIntFlowPOI = kTRUE;              // integrated flow POI
29   Bool_t plotIntFlowRelativeToMCPOI = kTRUE;   // plot |v{MC}-v{method}/v{MC}| for integrated flow (POI) // to be improved  
30   Bool_t plotDiffFlowPtPOI = kTRUE;           // differential flow (Pt,POI)
31   Bool_t plotDiffFlowEtaPOI = kTRUE;         // differential flow (Eta,POI)
32   //==================================================================================
33   
34   
35   //==================================================================================
36   // set here which methods will be plotted by default for differential flow (Pt,RP):
37   Bool_t plotMCPtRP       = kFALSE;
38   Bool_t plotSPPtRP       = kTRUE;
39   Bool_t plotGFC2PtRP     = kTRUE;
40   Bool_t plotGFC4PtRP     = kTRUE;
41   Bool_t plotGFC6PtRP     = kTRUE;
42   Bool_t plotGFC8PtRP     = kTRUE;
43   Bool_t plotQC2PtRP      = kTRUE;
44   Bool_t plotQC4PtRP      = kTRUE;
45   Bool_t plotQC6PtRP      = kFALSE; // not calculated yet
46   Bool_t plotQC8PtRP      = kFALSE; // not calculated yet
47   Bool_t plotLYZ2SUMPtRP  = kTRUE;
48   Bool_t plotLYZ2PRODPtRP = kTRUE;
49   Bool_t plotLYZEPPtRP    = kTRUE; 
50   
51   // set here which methods will be plotted by default for differential flow (Eta,RP):
52   Bool_t plotMCEtaRP       = kFALSE;
53   Bool_t plotSPEtaRP       = kTRUE;
54   Bool_t plotGFC2EtaRP     = kTRUE;
55   Bool_t plotGFC4EtaRP     = kTRUE;
56   Bool_t plotGFC6EtaRP     = kTRUE;
57   Bool_t plotGFC8EtaRP     = kTRUE;
58   Bool_t plotQC2EtaRP      = kTRUE;
59   Bool_t plotQC4EtaRP      = kTRUE;
60   Bool_t plotQC6EtaRP      = kFALSE; // not calculated yet
61   Bool_t plotQC8EtaRP      = kFALSE; // not calculated yet
62   Bool_t plotLYZ2SUMEtaRP  = kTRUE;
63   Bool_t plotLYZ2PRODEtaRP = kTRUE;
64   Bool_t plotLYZEPEtaRP    = kTRUE;
65   
66   // set here which methods will be plotted by default for |v{MC}-v{method}/v{MC}| as a function of pt for RPs 
67   Bool_t plotSPRelativeToMCRP       = kTRUE;
68   Bool_t plotGFC2RelativeToMCRP     = kTRUE;
69   Bool_t plotGFC4RelativeToMCRP     = kTRUE;
70   Bool_t plotGFC6RelativeToMCRP     = kTRUE;
71   Bool_t plotGFC8RelativeToMCRP     = kTRUE;
72   Bool_t plotQC2RelativeToMCRP      = kTRUE;
73   Bool_t plotQC4RelativeToMCRP      = kTRUE;
74   Bool_t plotQC6RelativeToMCRP      = kFALSE; // not calculated yet
75   Bool_t plotQC8RelativeToMCRP      = kFALSE; // not calculated yet
76   Bool_t plotLYZ2SUMRelativeToMCRP  = kTRUE;
77   Bool_t plotLYZ2PRODRelativeToMCRP = kTRUE;
78   Bool_t plotLYZEPRelativeToMCRP    = kTRUE;  
79   
80   // set here which methods will be plotted by default for differential flow (Pt,POI):
81   Bool_t plotMCPtPOI       = kFALSE;
82   Bool_t plotSPPtPOI       = kTRUE;
83   Bool_t plotGFC2PtPOI     = kTRUE;
84   Bool_t plotGFC4PtPOI     = kTRUE;
85   Bool_t plotGFC6PtPOI     = kTRUE;
86   Bool_t plotGFC8PtPOI     = kTRUE;
87   Bool_t plotQC2PtPOI      = kTRUE;
88   Bool_t plotQC4PtPOI      = kTRUE;
89   Bool_t plotQC6PtPOI      = kFALSE; // not calculated yet
90   Bool_t plotQC8PtPOI      = kFALSE; // not calculated yet
91   Bool_t plotLYZ2SUMPtPOI  = kTRUE;
92   Bool_t plotLYZ2PRODPtPOI = kTRUE;
93   Bool_t plotLYZEPPtPOI    = kTRUE; 
94   
95   // set here which methods will be plotted by default for differential flow (Eta,POI):
96   Bool_t plotMCEtaPOI       = kFALSE;
97   Bool_t plotSPEtaPOI       = kTRUE;
98   Bool_t plotGFC2EtaPOI     = kTRUE;
99   Bool_t plotGFC4EtaPOI     = kTRUE;
100   Bool_t plotGFC6EtaPOI     = kTRUE;
101   Bool_t plotGFC8EtaPOI     = kTRUE;
102   Bool_t plotQC2EtaPOI      = kTRUE;
103   Bool_t plotQC4EtaPOI      = kTRUE;
104   Bool_t plotQC6EtaPOI      = kFALSE; // not calculated yet
105   Bool_t plotQC8EtaPOI      = kFALSE; // not calculated yet
106   Bool_t plotLYZ2SUMEtaPOI  = kTRUE;
107   Bool_t plotLYZ2PRODEtaPOI = kTRUE;
108   Bool_t plotLYZEPEtaPOI    = kTRUE;
109   //==================================================================================
110  
111   
112   //==================================================================================  
113   // cosmetics: marker style (see TMarker) and color (see TAttFill) for each method:
114   // MC:
115   Int_t markerStyleMC = 20; // full circle
116   Int_t markerColorMC = kRed;
117   // SP:
118   Int_t markerStyleSP = 3; // star
119   Int_t markerColorSP = kViolet-6;
120   // GFC{2}
121   Int_t markerStyleGFC2 = 21; // full square
122   Int_t markerColorGFC2 = kAzure-7;
123   // GFC{4}
124   Int_t markerStyleGFC4 = 20; // full circle
125   Int_t markerColorGFC4 = kAzure+3;
126   // GFC{6}
127   Int_t markerStyleGFC6 = 25; // open square
128   Int_t markerColorGFC6 = kAzure-7;
129   // GFC{8}
130   Int_t markerStyleGFC8 = 24; // open circle
131   Int_t markerColorGFC8 = kAzure+3;
132   // QC{2}
133   Int_t markerStyleQC2 = 21; // full square
134   Int_t markerColorQC2 = kOrange-7;
135   // QC{4}
136   Int_t markerStyleQC4 = 20; // full circle
137   Int_t markerColorQC4 = kOrange+3;
138   // QC{6}
139   Int_t markerStyleQC6 = 25; // open square
140   Int_t markerColorQC6 = kOrange-7;
141   // QC{8}
142   Int_t markerStyleQC8 = 24; // open circle
143   Int_t markerColorQC8 = kOrange+3;
144   // LYZ2SUM
145   Int_t markerStyleLYZ2SUM = 22; // full triangle
146   Int_t markerColorLYZ2SUM = kYellow+3;
147   // LYZ2PROD
148   Int_t markerStyleLYZ2PROD = 22; // full triangle
149   Int_t markerColorLYZ2PROD = kGreen+3;
150   // LYZEP
151   Int_t markerStyleLYZEP = 26; // open triangle
152   Int_t markerColorLYZEP = kYellow+3; 
153   //==================================================================================
154
155
156   //==================================================================================  
157   // set here which result goes in which bin in the plot for integrated flow (no-name) 
158   // MC:
159   Int_t binMC = 1; 
160   // SP:
161   Int_t binSP = 2;
162   // GFC{2}
163   Int_t binGFC2 = 3; 
164   // GFC{4}
165   Int_t binGFC4 = 5; 
166   // GFC{6}
167   Int_t binGFC6 = 7; 
168   // GFC{8}
169   Int_t binGFC8 = 9; 
170   // QC{2}
171   Int_t binQC2 = 4; 
172   // QC{4}
173   Int_t binQC4 = 6; 
174   // QC{6}
175   Int_t binQC6 = 8; 
176   // QC{8}
177   Int_t binQC8 = 10; 
178   // FQD 
179   Int_t binFQD = 11; 
180   // LYZ1SUM
181   Int_t binLYZ1SUM = 12; 
182   // LYZ1PROD
183   Int_t binLYZ1PROD = 13; 
184   // LYZEP
185   Int_t binLYZEP = 14; 
186   //==================================================================================
187
188
189   //==================================================================================  
190   // set here which result goes in which bin in the plot for integrated flow (RP) 
191   // MC:
192   Int_t binMCRP = 1; 
193   // SP:
194   Int_t binSPRP = 2;
195   // GFC{2}
196   Int_t binGFC2RP = 3; 
197   // GFC{4}
198   Int_t binGFC4RP = 5; 
199   // GFC{6}
200   Int_t binGFC6RP = 7; 
201   // GFC{8}
202   Int_t binGFC8RP = 9; 
203   // QC{2}
204   Int_t binQC2RP = 4; 
205   // QC{4}
206   Int_t binQC4RP = 6; 
207   // QC{6}
208   Int_t binQC6RP = 8; 
209   // QC{8}
210   Int_t binQC8RP = 10; 
211   // FQD 
212   Int_t binFQDRP = 11; 
213   // LYZ2SUM
214   Int_t binLYZ2SUMRP = 12; 
215   // LYZ2PROD
216   Int_t binLYZ2PRODRP = 13; 
217   // LYZEP
218   Int_t binLYZEPRP = 14; 
219   //==================================================================================
220
221
222   //==================================================================================  
223   // set here which result goes in which bin in the plot for integrated flow (POI) 
224   // MC:
225   Int_t binMCPOI = 1; 
226   // SP:
227   Int_t binSPPOI = 2;
228   // GFC{2}
229   Int_t binGFC2POI = 3; 
230   // GFC{4}
231   Int_t binGFC4POI = 5; 
232   // GFC{6}
233   Int_t binGFC6POI = 7; 
234   // GFC{8}
235   Int_t binGFC8POI = 9; 
236   // QC{2}
237   Int_t binQC2POI = 4; 
238   // QC{4}
239   Int_t binQC4POI = 6; 
240   // QC{6}
241   Int_t binQC6POI = 8; 
242   // QC{8}
243   Int_t binQC8POI = 10; 
244   // FQD 
245   Int_t binFQDPOI = 11; 
246   // LYZ2SUM
247   Int_t binLYZ2SUMPOI = 12;  
248   // LYZ2PROD
249   Int_t binLYZ2PRODPOI = 13;    
250   // LYZEP
251   Int_t binLYZEPPOI = 14; 
252   //==================================================================================
253  
254                                         
255   //==================================================================================
256   //                         accessing output files
257   //==================================================================================
258   //open the output files:
259   TString inputFileNameMCEP = "outputMCEPanalysis";
260   TFile* fileMCEP = NULL;
261   fileMCEP = TFile::Open(((inputFileNameMCEP.Append(type)).Append(".root")).Data(), "READ"); 
262   
263   TString inputFileNameSP = "outputSPanalysis";
264   TFile* fileSP = NULL;
265   fileSP = TFile::Open(((inputFileNameSP.Append(type)).Append(".root")).Data(), "READ"); 
266   
267   TString inputFileNameLYZ1SUM = "outputLYZ1SUManalysis";
268   TFile* fileLYZ1SUM = NULL;
269   fileLYZ1SUM = TFile::Open(((inputFileNameLYZ1SUM.Append(type)).Append(".root")).Data(), "READ"); 
270   
271   TString inputFileNameLYZ2SUM = "outputLYZ2SUManalysis";
272   TFile* fileLYZ2SUM = NULL;
273   fileLYZ2SUM = TFile::Open(((inputFileNameLYZ2SUM.Append(type)).Append(".root")).Data(), "READ"); 
274   
275   TString inputFileNameLYZ1PROD = "outputLYZ1PRODanalysis";
276   TFile* fileLYZ1PROD = NULL;
277   fileLYZ1PROD = TFile::Open(((inputFileNameLYZ1PROD.Append(type)).Append(".root")).Data(), "READ"); 
278   
279   TString inputFileNameLYZ2PROD = "outputLYZ2PRODanalysis";
280   TFile* fileLYZ2PROD = NULL;
281   fileLYZ2PROD = TFile::Open(((inputFileNameLYZ2PROD.Append(type)).Append(".root")).Data(), "READ"); 
282   
283   TString inputFileNameLYZEP = "outputLYZEPanalysis";
284   TFile* fileLYZEP = NULL;
285   fileLYZEP = TFile::Open(((inputFileNameLYZEP.Append(type)).Append(".root")).Data(), "READ");
286   
287   TString inputFileNameFQD = "outputFQDanalysis";
288   TFile* fileFQD = NULL;
289   fileFQD = TFile::Open(((inputFileNameFQD.Append(type)).Append(".root")).Data(), "READ"); 
290   
291   TString inputFileNameGFC = "outputGFCanalysis";
292   TFile* fileGFC = NULL;
293   fileGFC = TFile::Open(((inputFileNameGFC.Append(type)).Append(".root")).Data(), "READ"); 
294   
295   TString inputFileNameQC = "outputQCanalysis";
296   TFile* fileQC = NULL;
297   fileQC = TFile::Open(((inputFileNameQC.Append(type)).Append(".root")).Data(), "READ"); 
298   //==================================================================================
299  
300  
301  
302  
303   //==================================================================================
304   //                                 cosmetics
305   //==================================================================================
306   //removing the title and stat. box from all histograms:
307   gStyle->SetOptTitle(0);
308   gStyle->SetOptStat(0);
309   
310   // plot for 'no-name' integrated flow:
311   // choosing the style and color of mesh for MC error bands
312   Int_t meshStyle = 1001;
313   Int_t meshColor = kGray;
314   
315   // marker style and color  
316   Int_t markerStyle = 21;
317   Int_t markerColor = kBlack;
318   
319   // plot for RP's integrated flow:
320   // choosing the style and color of mesh for MC error bands
321   Int_t meshStyleRP = 1001;
322   Int_t meshColorRP = kRed-10;
323   
324   // marker style and color  
325   Int_t markerStyleRP = 21;
326   Int_t markerColorRP = kRed-3;
327   
328   // plot for POI's integrated flow:
329   // choosing the style and color of mesh for MC error bands
330   Int_t meshStylePOI = 1001;
331   Int_t meshColorPOI = kBlue-10;
332   
333   // marker style and color  
334   Int_t markerStylePOI = 21;
335   Int_t markerColorPOI = kBlue-3;
336   
337   // choosing the style and color of mesh for MC error bands in the plots for diff. flow
338   // plot for differential flow (Pt,RP):
339   Int_t meshStyleDiffFlowPtRP = 1001;
340   Int_t meshColorDiffFlowPtRP = kRed-10;
341   
342   // plot for differential flow (Eta,RP):
343   Int_t meshStyleDiffFlowEtaRP = 1001;
344   Int_t meshColorDiffFlowEtaRP = kRed-10;
345   
346   // plot for differential flow (Pt,POI):
347   Int_t meshStyleDiffFlowPtPOI = 1001;
348   Int_t meshColorDiffFlowPtPOI = kRed-10;
349
350   // plot for differential flow (Eta,POI):
351   Int_t meshStyleDiffFlowEtaPOI = 1001;
352   Int_t meshColorDiffFlowEtaPOI = kRed-10;
353   //==================================================================================
354   
355   
356   
357   
358   //==================================================================================
359   //                             INTEGRATED FLOW (no-name, RP and POI)
360   //==================================================================================
361   // the number of different methods:
362   const Int_t nMethods=14;
363   
364   // booking the histogram for the integrated flow results from all methods:
365   TH1D* intFlowAll = new TH1D("intFlowAll","Integrated Flow",nMethods,0,nMethods);      
366   // intFlowAll->SetLabelSize(0.036,"X");
367   // intFlowAll->SetLabelSize(0.036,"Y");
368   intFlowAll->SetMarkerStyle(markerStyle);
369   intFlowAll->SetMarkerColor(markerColor);
370   (intFlowAll->GetXaxis())->SetBinLabel(binMC,"v_{2}{MC}");
371   (intFlowAll->GetXaxis())->SetBinLabel(binSP,"v_{2}{SP}");
372   (intFlowAll->GetXaxis())->SetBinLabel(binGFC2,"v_{2}{2,GFC}");
373   (intFlowAll->GetXaxis())->SetBinLabel(binQC2,"v_{2}{2,QC}");
374   (intFlowAll->GetXaxis())->SetBinLabel(binGFC4,"v_{2}{4,GFC}");
375   (intFlowAll->GetXaxis())->SetBinLabel(binQC4,"v_{2}{4,QC}");
376   (intFlowAll->GetXaxis())->SetBinLabel(binGFC6,"v_{2}{6,GFC}");
377   (intFlowAll->GetXaxis())->SetBinLabel(binQC6,"v_{2}{6,QC}");
378   (intFlowAll->GetXaxis())->SetBinLabel(binGFC8,"v_{2}{8,GFC}");
379   (intFlowAll->GetXaxis())->SetBinLabel(binQC8,"v_{2}{8,QC}");
380   (intFlowAll->GetXaxis())->SetBinLabel(binFQD,"v_{2}{FQD}");
381   (intFlowAll->GetXaxis())->SetBinLabel(binLYZ1SUM,"v_{2}{LYZ,sum}");
382   (intFlowAll->GetXaxis())->SetBinLabel(binLYZ1PROD,"v_{2}{LYZ,prod}");
383   (intFlowAll->GetXaxis())->SetBinLabel(binLYZEP,"v_{2}{LYZEP}");
384   
385   // booking the graph to store flow values and errors from all methods:    
386   Double_t x[nMethods] = {0.};
387   for(Int_t i=0;i<nMethods;i++)
388   {
389    x[i]=i+0.5;
390   }
391   Double_t xError[nMethods] = {0.};
392   Double_t flowValue[nMethods] = {0.};
393   Double_t flowError[nMethods] = {0.};
394   Double_t flowValueRP[nMethods] = {0.};
395   Double_t flowErrorRP[nMethods] = {0.};
396   Double_t flowValuePOI[nMethods] = {0.};
397   Double_t flowErrorPOI[nMethods] = {0.};
398   
399   // accessing the results for integrated flow for each method:
400   // MCEP = Monte Carlo Event Plane
401   TList *pListMCEP = NULL;
402   AliFlowCommonHist *mcepCommonHist = NULL;
403   AliFlowCommonHistResults *mcepCommonHistRes = NULL; 
404   if(fileMCEP) {
405     fileMCEP->GetObject("cobjMCEP",pListMCEP); 
406     if(pListMCEP) {
407       mcepCommonHist = dynamic_cast<AliFlowCommonHist*> (pListMCEP->FindObject("AliFlowCommonHistMCEP"));
408       mcepCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListMCEP->FindObject("AliFlowCommonHistResultsMCEP"));
409       if(mcepCommonHistRes) {
410         flowValue[binMC-1] = (mcepCommonHistRes->GetHistIntFlow())->GetBinContent(1);
411         flowError[binMC-1] = (mcepCommonHistRes->GetHistIntFlow())->GetBinError(1);
412         flowValueRP[binMCRP-1] = (mcepCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
413         flowErrorRP[binMCRP-1] = (mcepCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
414         flowValuePOI[binMCPOI-1] = (mcepCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
415         flowErrorPOI[binMCPOI-1] = (mcepCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
416       }
417     }
418   }
419   
420   // SP = Scalar Product
421   TList *pListSP = NULL;
422   AliFlowCommonHist *spCommonHist = NULL;
423   AliFlowCommonHistResults *spCommonHistRes = NULL; 
424   if(fileSP) {
425     fileSP->GetObject("cobjSP",pListSP); 
426     if(pListSP) {
427       spCommonHist = dynamic_cast<AliFlowCommonHist*> (pListSP->FindObject("AliFlowCommonHistSP"));
428       spCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListSP->FindObject("AliFlowCommonHistResultsSP"));
429       if(spCommonHistRes) {
430         flowValue[binSP-1] = (spCommonHistRes->GetHistIntFlow())->GetBinContent(1);
431         flowError[binSP-1] = (spCommonHistRes->GetHistIntFlow())->GetBinError(1);
432         flowValueRP[binSPRP-1] = (spCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
433         flowErrorRP[binSPRP-1] = (spCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
434         flowValuePOI[binSPPOI-1] = (spCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
435         flowErrorPOI[binSPPOI-1] = (spCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
436       }
437     }
438   }
439   
440   // LYZ1SUM = Lee-Yang Zeros (1st run, sum) is used to get only 'no-name' integrated flow
441   TList *pListLYZ1SUM = NULL;
442   AliFlowCommonHist *lyz1sumCommonHist = NULL;
443   AliFlowCommonHistResults *lyz1sumCommonHistRes = NULL; 
444   if(fileLYZ1SUM) {
445     fileLYZ1SUM->GetObject("cobjLYZ1SUM",pListLYZ1SUM); 
446     if(pListLYZ1SUM) {
447       lyz1sumCommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZ1SUM->FindObject("AliFlowCommonHistLYZ1SUM"));
448       lyz1sumCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZ1SUM->FindObject("AliFlowCommonHistResultsLYZ1SUM"));
449       if(lyz1sumCommonHistRes) {
450         flowValue[binLYZ1SUM-1] = (lyz1sumCommonHistRes->GetHistIntFlow())->GetBinContent(1);
451         flowError[binLYZ1SUM-1] = (lyz1sumCommonHistRes->GetHistIntFlow())->GetBinError(1);
452       }
453     }
454   }
455   
456   // LYZ2SUM = Lee-Yang Zeros (2nd run, sum) is used to get RP's and POI's integrated flow
457   TList *pListLYZ2SUM = NULL;
458   AliFlowCommonHist *lyz2sumCommonHist = NULL;
459   AliFlowCommonHistResults *lyz2sumCommonHistRes = NULL; 
460   if(fileLYZ2SUM) {
461     fileLYZ2SUM->GetObject("cobjLYZ2SUM",pListLYZ2SUM); 
462     if(pListLYZ2SUM) {
463       lyz2sumCommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZ2SUM->FindObject("AliFlowCommonHistLYZ2SUM"));
464       lyz2sumCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZ2SUM->FindObject("AliFlowCommonHistResultsLYZ2SUM"));
465       if(lyz2sumCommonHistRes) {
466         flowValueRP[binLYZ2SUMRP-1] = (lyz2sumCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
467         flowErrorRP[binLYZ2SUMRP-1] = (lyz2sumCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
468         flowValuePOI[binLYZ2SUMPOI-1] = (lyz2sumCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
469         flowErrorPOI[binLYZ2SUMPOI-1] = (lyz2sumCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
470       }
471     }
472   }
473  
474   // LYZ1PROD = Lee-Yang Zeros (1st run, product) is used to get only 'no-name' integrated flow
475   TList *pListLYZ1PROD = NULL;
476   AliFlowCommonHist *lyz1prodCommonHist = NULL;
477   AliFlowCommonHistResults *lyz1prodCommonHistRes = NULL; 
478   if(fileLYZ1PROD) {
479     fileLYZ1PROD->GetObject("cobjLYZ1PROD",pListLYZ1PROD); 
480     if(pListLYZ1PROD) {
481       lyz1prodCommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZ1PROD->FindObject("AliFlowCommonHistLYZ1PROD"));
482       lyz1prodCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZ1PROD->FindObject("AliFlowCommonHistResultsLYZ1PROD"));
483       if(lyz1prodCommonHistRes) {
484         flowValue[binLYZ1PROD-1] = (lyz1prodCommonHistRes->GetHistIntFlow())->GetBinContent(1);
485         flowError[binLYZ1PROD-1] = (lyz1prodCommonHistRes->GetHistIntFlow())->GetBinError(1);
486       }
487     }
488   }
489   
490   // LYZ2PROD = Lee-Yang Zeros (2nd run, product) is used to get RP's and POI's integrated flow
491   TList *pListLYZ2PROD = NULL;
492   AliFlowCommonHist *lyz2prodCommonHist = NULL;
493   AliFlowCommonHistResults *lyz2prodCommonHistRes = NULL; 
494   if(fileLYZ2PROD) {
495     fileLYZ2PROD->GetObject("cobjLYZ2PROD",pListLYZ2PROD); 
496     if(pListLYZ2PROD) {
497       lyz2prodCommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZ2PROD->FindObject("AliFlowCommonHistLYZ2PROD"));
498       lyz2prodCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZ2PROD->FindObject("AliFlowCommonHistResultsLYZ2PROD"));
499       if(lyz2prodCommonHistRes) {
500         flowValueRP[binLYZ2PRODRP-1] = (lyz2prodCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
501         flowErrorRP[binLYZ2PRODRP-1] = (lyz2prodCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
502         flowValuePOI[binLYZ2PRODPOI-1] = (lyz2prodCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
503         flowErrorPOI[binLYZ2PRODPOI-1] = (lyz2prodCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
504       }
505     }
506   }
507   
508   // LYZEP = Lee-Yang Zeros Event Plane
509   TList *pListLYZEP = NULL;
510   AliFlowCommonHist *lyzepCommonHist = NULL;
511   AliFlowCommonHistResults *lyzepCommonHistRes = NULL; 
512   if(fileLYZEP) {
513     fileLYZEP->GetObject("cobjLYZEP",pListLYZEP); 
514     if(pListLYZEP) {
515       lyzepCommonHist = dynamic_cast<AliFlowCommonHist*> (pListLYZEP->FindObject("AliFlowCommonHistLYZEP"));
516       lyzepCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListLYZEP->FindObject("AliFlowCommonHistResultsLYZEP"));
517       if(lyzepCommonHistRes) {
518         flowValue[binLYZEP-1] = (lyzepCommonHistRes->GetHistIntFlow())->GetBinContent(1);
519         flowError[binLYZEP-1] = (lyzepCommonHistRes->GetHistIntFlow())->GetBinError(1);
520         flowValueRP[binLYZEPRP-1] = (lyzepCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
521         flowErrorRP[binLYZEPRP-1] = (lyzepCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
522         flowValuePOI[binLYZEPPOI-1] = (lyzepCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
523         flowErrorPOI[binLYZEPPOI-1] = (lyzepCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
524       }
525     }
526   }
527  
528   // FQD = Fitting q-distribution
529   TList *pListFQD = NULL;
530   AliFlowCommonHist *fqdCommonHist = NULL;
531   AliFlowCommonHistResults *fqdCommonHistRes = NULL; 
532   if(fileFQD) {
533     fileFQD->GetObject("cobjFQD",pListFQD); 
534     if(pListFQD) {
535       fqdCommonHist = dynamic_cast<AliFlowCommonHist*> (pListFQD->FindObject("AliFlowCommonHistFQD"));
536       fqdCommonHistRes = dynamic_cast<AliFlowCommonHistResults*> (pListFQD->FindObject("AliFlowCommonHistResultsFQD"));
537       if(fqdCommonHistRes) {
538         flowValue[binFQD-1] = (fqdCommonHistRes->GetHistIntFlow())->GetBinContent(1);
539         flowError[binFQD-1] = (fqdCommonHistRes->GetHistIntFlow())->GetBinError(1);
540         //flowValueRP[binFQDRP-1] = (fqdCommonHistRes->GetHistIntFlowRP())->GetBinContent(1);
541         //flowErrorRP[binFQDRP-1] = (fqdCommonHistRes->GetHistIntFlowRP())->GetBinError(1);
542         //flowValuePOI[binFQDPOI-1] = (fqdCommonHistRes->GetHistIntFlowPOI())->GetBinContent(1);
543         //flowErrorPOI[binFQDPOI-1] = (fqdCommonHistRes->GetHistIntFlowPOI())->GetBinError(1);
544       }
545     }
546   }
547  
548   // GFC = Generating Function Cumulants
549   TList *pListGFC = NULL;
550   AliFlowCommonHist *gfcCommonHist = NULL;
551   AliFlowCommonHistResults *gfcCommonHistRes2 = NULL; 
552   AliFlowCommonHistResults *gfcCommonHistRes4 = NULL; 
553   AliFlowCommonHistResults *gfcCommonHistRes6 = NULL; 
554   AliFlowCommonHistResults *gfcCommonHistRes8 = NULL; 
555   if(fileGFC) {
556     fileGFC->GetObject("cobjGFC",pListGFC);
557     if(pListGFC) {
558       gfcCommonHist = dynamic_cast<AliFlowCommonHist*> (pListGFC->FindObject("AliFlowCommonHistGFC"));
559       gfcCommonHistRes2 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults2ndOrderGFC"));
560       if(gfcCommonHistRes2) {
561         flowValue[binGFC2-1] = (gfcCommonHistRes2->GetHistIntFlow())->GetBinContent(1);
562         flowError[binGFC2-1] = (gfcCommonHistRes2->GetHistIntFlow())->GetBinError(1);
563         flowValueRP[binGFC2RP-1] = (gfcCommonHistRes2->GetHistIntFlowRP())->GetBinContent(1);
564         flowErrorRP[binGFC2RP-1] = (gfcCommonHistRes2->GetHistIntFlowRP())->GetBinError(1);
565         flowValuePOI[binGFC2POI-1] = (gfcCommonHistRes2->GetHistIntFlowPOI())->GetBinContent(1);
566         flowErrorPOI[binGFC2POI-1] = (gfcCommonHistRes2->GetHistIntFlowPOI())->GetBinError(1);
567       }
568       gfcCommonHistRes4 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults4thOrderGFC"));
569       if(gfcCommonHistRes4) {
570         flowValue[binGFC4-1] = (gfcCommonHistRes4->GetHistIntFlow())->GetBinContent(1);
571         flowError[binGFC4-1] = (gfcCommonHistRes4->GetHistIntFlow())->GetBinError(1);
572         flowValueRP[binGFC4RP-1] = (gfcCommonHistRes4->GetHistIntFlowRP())->GetBinContent(1);
573         flowErrorRP[binGFC4RP-1] = (gfcCommonHistRes4->GetHistIntFlowRP())->GetBinError(1);
574         flowValuePOI[binGFC4POI-1] = (gfcCommonHistRes4->GetHistIntFlowPOI())->GetBinContent(1);
575         flowErrorPOI[binGFC4POI-1] = (gfcCommonHistRes4->GetHistIntFlowPOI())->GetBinError(1);
576       }
577       gfcCommonHistRes6 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults6thOrderGFC"));
578       if(gfcCommonHistRes6) {
579         flowValue[binGFC6-1] = (gfcCommonHistRes6->GetHistIntFlow())->GetBinContent(1);
580         flowError[binGFC6-1] = (gfcCommonHistRes6->GetHistIntFlow())->GetBinError(1);
581         flowValueRP[binGFC6RP-1] = (gfcCommonHistRes6->GetHistIntFlowRP())->GetBinContent(1);
582         flowErrorRP[binGFC6RP-1] = (gfcCommonHistRes6->GetHistIntFlowRP())->GetBinError(1);
583         flowValuePOI[binGFC6POI-1] = (gfcCommonHistRes6->GetHistIntFlowPOI())->GetBinContent(1);
584         flowErrorPOI[binGFC6POI-1] = (gfcCommonHistRes6->GetHistIntFlowPOI())->GetBinError(1);
585       }
586       gfcCommonHistRes8 = dynamic_cast<AliFlowCommonHistResults*> (pListGFC->FindObject("AliFlowCommonHistResults8thOrderGFC"));
587       if(gfcCommonHistRes8)  {
588         flowValue[binGFC8-1] = (gfcCommonHistRes8->GetHistIntFlow())->GetBinContent(1);
589         flowError[binGFC8-1] = (gfcCommonHistRes8->GetHistIntFlow())->GetBinError(1);
590         flowValueRP[binGFC8RP-1] = (gfcCommonHistRes8->GetHistIntFlowRP())->GetBinContent(1);
591         flowErrorRP[binGFC8RP-1] = (gfcCommonHistRes8->GetHistIntFlowRP())->GetBinError(1);
592         flowValuePOI[binGFC8POI-1] = (gfcCommonHistRes8->GetHistIntFlowPOI())->GetBinContent(1);
593         flowErrorPOI[binGFC8POI-1] = (gfcCommonHistRes8->GetHistIntFlowPOI())->GetBinError(1);
594       }
595     }
596   }
597  
598   //QC = Q-cumulants
599   TList *pListQC = NULL;
600   AliFlowCommonHist *qcCommonHist2 = NULL; 
601   AliFlowCommonHist *qcCommonHist4 = NULL; 
602   AliFlowCommonHist *qcCommonHist6 = NULL; 
603   AliFlowCommonHist *qcCommonHist8 = NULL; 
604   AliFlowCommonHistResults *qcCommonHistRes2 = NULL; 
605   AliFlowCommonHistResults *qcCommonHistRes4 = NULL; 
606   AliFlowCommonHistResults *qcCommonHistRes6 = NULL; 
607   AliFlowCommonHistResults *qcCommonHistRes8 = NULL; 
608   
609   if(fileQC) {
610     fileQC->GetObject("cobjQC",pListQC);
611     if(pListQC) {
612       qcCommonHist2 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist2ndOrderQC"));
613       qcCommonHistRes2 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults2ndOrderQC"));
614       if(qcCommonHistRes2)  {
615         flowValue[binQC2-1] = (qcCommonHistRes2->GetHistIntFlow())->GetBinContent(1);
616         //flowError[binQC2-1] = (qcCommonHistRes2->GetHistIntFlow())->GetBinError(1);
617         flowValueRP[binQC2RP-1] = (qcCommonHistRes2->GetHistIntFlowRP())->GetBinContent(1);
618         //flowErrorRP[binQC2RP-1] = (qcCommonHistRes2->GetHistIntFlowRP())->GetBinError(1);
619         flowValuePOI[binQC2POI-1] = (qcCommonHistRes2->GetHistIntFlowPOI())->GetBinContent(1);
620         //flowErrorPOI[binQC2POI-1] = (qcCommonHistRes2->GetHistIntFlowPOI())->GetBinError(1);
621       }
622       qcCommonHist4 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist4thOrderQC"));
623       qcCommonHistRes4 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults4thOrderQC"));
624       if(qcCommonHistRes4) {
625         flowValue[binQC4-1] = (qcCommonHistRes4->GetHistIntFlow())->GetBinContent(1);
626         //flowError[binQC4-1] = (qcCommonHistRes4->GetHistIntFlow())->GetBinError(1);
627         flowValueRP[binQC4RP-1] = (qcCommonHistRes4->GetHistIntFlowRP())->GetBinContent(1);
628         //flowErrorRP[binQC4RP-1] = (qcCommonHistRes4->GetHistIntFlowRP())->GetBinError(1);
629         flowValuePOI[binQC4POI-1] = (qcCommonHistRes4->GetHistIntFlowPOI())->GetBinContent(1);
630         //flowErrorPOI[binQC4POI-1] = (qcCommonHistRes4->GetHistIntFlowPOI())->GetBinError(1);
631       }
632       qcCommonHist6 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist6thOrderQC"));
633       qcCommonHistRes6 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults6thOrderQC"));
634       if(qcCommonHistRes6) {
635         flowValue[binQC6-1] = (qcCommonHistRes6->GetHistIntFlow())->GetBinContent(1);
636         //flowError[binQC6-1] = (qcCommonHistRes6->GetHistIntFlow())->GetBinError(1);
637         flowValueRP[binQC6RP-1] = (qcCommonHistRes6->GetHistIntFlowRP())->GetBinContent(1);
638         //flowErrorRP[binQC6RP-1] = (qcCommonHistRes6->GetHistIntFlowRP())->GetBinError(1);
639         flowValuePOI[binQC6POI-1] = (qcCommonHistRes6->GetHistIntFlowPOI())->GetBinContent(1);
640         //flowErrorPOI[binQC6POI-1] = (qcCommonHistRes6->GetHistIntFlowPOI())->GetBinError(1);
641       }
642       qcCommonHist8 = dynamic_cast<AliFlowCommonHist*> (pListQC->FindObject("AliFlowCommonHist8thOrderQC"));
643       qcCommonHistRes8 = dynamic_cast<AliFlowCommonHistResults*> (pListQC->FindObject("AliFlowCommonHistResults8thOrderQC"));
644       if(qcCommonHistRes8)  {
645         flowValue[binQC8-1] = (qcCommonHistRes8->GetHistIntFlow())->GetBinContent(1);
646         //flowError[binQC8-1] = (qcCommonHistRes8->GetHistIntFlow())->GetBinError(1);
647         flowValueRP[binQC8RP-1] = (qcCommonHistRes8->GetHistIntFlowRP())->GetBinContent(1);
648         //flowErrorRP[binQC8RP-1] = (qcCommonHistRes8->GetHistIntFlowRP())->GetBinError(1);
649         flowValuePOI[binQC8POI-1] = (qcCommonHistRes8->GetHistIntFlowPOI())->GetBinContent(1);
650         //flowErrorPOI[binQC8POI-1] = (qcCommonHistRes8->GetHistIntFlowPOI())->GetBinError(1);
651       }
652     }
653   }        
654   
655   // ranges on y-axis for 'no-name' plot:
656   Double_t dMax=flowValue[binMC-1]+flowError[binMC-1];
657   Double_t dMin=flowValue[binMC-1]-flowError[binMC-1];
658   
659   for(Int_t i=1;i<nMethods;i++) {
660     if(!(flowValue[i]==0. && flowError[i]==0.)) {
661       if(dMax<flowValue[i]+flowError[i]) dMax=flowValue[i]+flowError[i];
662       if(dMin>flowValue[i]-flowError[i]) dMin=flowValue[i]-flowError[i];
663     } 
664   }  
665   
666   // ranges on y-axis for RP plot:
667   Double_t dMaxRP=flowValueRP[binMCRP-1]+flowErrorRP[binMCRP-1];
668   Double_t dMinRP=flowValueRP[binMCRP-1]-flowErrorRP[binMCRP-1];
669   
670   for(Int_t i=1;i<nMethods;i++) {
671     if(!(flowValueRP[i]==0. && flowErrorRP[i]==0.)) {
672       if(dMaxRP<flowValueRP[i]+flowErrorRP[i]) dMaxRP=flowValueRP[i]+flowErrorRP[i];
673       if(dMinRP>flowValueRP[i]-flowErrorRP[i]) dMinRP=flowValueRP[i]-flowErrorRP[i];
674     } 
675   }  
676
677   // ranges on y-axis for POI plot:
678   Double_t dMaxPOI=flowValuePOI[binMCPOI-1]+flowErrorPOI[binMCPOI-1];
679   Double_t dMinPOI=flowValuePOI[binMCPOI-1]-flowErrorPOI[binMCPOI-1];
680   
681   for(Int_t i=1;i<nMethods;i++) {
682     if(!(flowValuePOI[i]==0. && flowErrorPOI[i]==0.)) {
683       if(dMaxPOI<flowValuePOI[i]+flowErrorPOI[i]) dMaxPOI=flowValuePOI[i]+flowErrorPOI[i];
684       if(dMinPOI>flowValuePOI[i]-flowErrorPOI[i]) dMinPOI=flowValuePOI[i]-flowErrorPOI[i];
685     } 
686   }  
687  
688   // no-name:
689   TGraph* flowResults = new TGraphErrors(nMethods, x, flowValue, xError, flowError);
690   flowResults->SetMarkerStyle(markerStyle);
691   flowResults->SetMarkerColor(markerColor);
692   
693   // RP:
694   TGraph* flowResultsRP = new TGraphErrors(nMethods, x, flowValueRP, xError, flowErrorRP); 
695   flowResultsRP->SetMarkerStyle(markerStyleRP);
696   flowResultsRP->SetMarkerColor(markerColorRP);
697   
698   // POI:
699   TGraph* flowResultsPOI = new TGraphErrors(nMethods, x, flowValuePOI, xError, flowErrorPOI);
700   flowResultsPOI->SetMarkerStyle(markerStylePOI);
701   flowResultsPOI->SetMarkerColor(markerColorPOI);
702   
703   // for plot |v{MC}-v{method}/v{MC}|
704   // no-name, RP and POI
705   Double_t flowRelativeToMC[nMethods] = {0.};
706   Double_t flowRelativeToMCError[nMethods] = {0.}; 
707   Double_t flowRelativeToMCRP[nMethods] = {0.};
708   Double_t flowRelativeToMCErrorRP[nMethods] = {0.}; 
709   Double_t flowRelativeToMCPOI[nMethods] = {0.};
710   Double_t flowRelativeToMCErrorPOI[nMethods] = {0.}; 
711   flowRelativeToMC[0] = 0.; // MC relative to itself (to be improved)
712   flowRelativeToMCRP[0] = 0.; // MC relative to itself (to be improved)
713   flowRelativeToMCPOI[0] = 0.; // MC relative to itself (to be improved)
714   for(Int_t i=1;i<nMethods;i++) 
715   {
716    if(flowValue[0] != 0)
717    {
718     if(flowValue[i] != 0) flowRelativeToMC[i] = (flowValue[i]-flowValue[0])/(flowValue[0]);
719     if(flowError[i] != 0) flowRelativeToMCError[i] = flowError[i]/flowValue[0];
720    }
721    if(flowValueRP[0] != 0)
722    {
723     if(flowValueRP[i] != 0) flowRelativeToMCRP[i] = (flowValueRP[i]-flowValueRP[0])/(flowValueRP[0]);
724     if(flowErrorRP[i] != 0) flowRelativeToMCErrorRP[i] = flowErrorRP[i]/flowValueRP[0];
725    }
726    if(flowValuePOI[0] != 0)
727    {
728     if(flowValuePOI[i] != 0) flowRelativeToMCPOI[i] = (flowValuePOI[i]-flowValuePOI[0])/(flowValuePOI[0]);
729     if(flowErrorPOI[i] != 0) flowRelativeToMCErrorPOI[i] = flowErrorPOI[i]/flowValuePOI[0];
730    }
731   } // for(Int_t i=1;i<nMethods;i++) 
732   
733   // integrated flow (no-name) relative to MC:
734   TGraph* flowResultsRelativeToMC = new TGraphErrors(nMethods, x, flowRelativeToMC, xError, flowRelativeToMCError);
735   flowResultsRelativeToMC->SetMarkerStyle(markerStyle);
736   flowResultsRelativeToMC->SetMarkerColor(markerColor);
737   
738   // integrated flow (RP) relative to MC:
739   TGraph* flowResultsRelativeToMCRP = new TGraphErrors(nMethods, x, flowRelativeToMCRP, xError, flowRelativeToMCErrorRP);
740   flowResultsRelativeToMCRP->SetMarkerStyle(markerStyleRP);
741   flowResultsRelativeToMCRP->SetMarkerColor(markerColorRP);
742  
743   // integrated flow (POI) relative to MC:
744   TGraph* flowResultsRelativeToMCPOI = new TGraphErrors(nMethods, x, flowRelativeToMCPOI, xError, flowRelativeToMCErrorPOI);
745   flowResultsRelativeToMCPOI->SetMarkerStyle(markerStylePOI);
746   flowResultsRelativeToMCPOI->SetMarkerColor(markerColorPOI);
747   //-----------------------------------------------------------------------------------
748   
749   //----------------------------------------------------------------------------------
750   // cosmetics: mesh for MC error bands (integrated flow)
751   TGraph* pMesh = NULL;
752   TGraph* pMeshRP = NULL;
753   TGraph* pMeshPOI = NULL;
754   
755   if(intFlowAll && mcepCommonHistRes) {
756     Int_t nPts       = nMethods;
757     Double_t valueMC = flowValue[binMC-1];
758     Double_t errorMC = flowError[binMC-1]; 
759     Double_t valueMCRP = flowValueRP[binMCRP-1];
760     Double_t errorMCRP = flowErrorRP[binMCRP-1]; 
761     Double_t valueMCPOI = flowValuePOI[binMCPOI-1];
762     Double_t errorMCPOI = flowErrorPOI[binMCPOI-1]; 
763     
764     pMesh = new TGraph(nPts);
765     pMeshRP = new TGraph(nPts);
766     pMeshPOI = new TGraph(nPts);
767     
768     // no-name:
769     pMesh->SetPoint(1,0,valueMC+errorMC);
770     pMesh->SetPoint(2,nPts+1,valueMC+errorMC);
771     pMesh->SetPoint(3,nPts+1,valueMC-errorMC);
772     pMesh->SetPoint(4,0,valueMC-errorMC);
773     pMesh->SetPoint(5,0,valueMC+errorMC);    
774     pMesh->SetFillStyle(meshStyle);
775     pMesh->SetFillColor(meshColor);
776      
777     // RP:
778     pMeshRP->SetPoint(1,0,valueMCRP+errorMCRP);
779     pMeshRP->SetPoint(2,nPts+1,valueMCRP+errorMCRP);
780     pMeshRP->SetPoint(3,nPts+1,valueMCRP-errorMCRP);
781     pMeshRP->SetPoint(4,0,valueMCRP-errorMCRP);
782     pMeshRP->SetPoint(5,0,valueMCRP+errorMCRP);   
783     pMeshRP->SetFillStyle(meshStyleRP);
784     pMeshRP->SetFillColor(meshColorRP);
785     
786     // POI:
787     pMeshPOI->SetPoint(1,0,valueMCPOI+errorMCPOI);
788     pMeshPOI->SetPoint(2,nPts+1,valueMCPOI+errorMCPOI);
789     pMeshPOI->SetPoint(3,nPts+1,valueMCPOI-errorMCPOI);
790     pMeshPOI->SetPoint(4,0,valueMCPOI-errorMCPOI);
791     pMeshPOI->SetPoint(5,0,valueMCPOI+errorMCPOI);    
792     pMeshPOI->SetFillStyle(meshStylePOI);
793     pMeshPOI->SetFillColor(meshColorPOI);     
794   }
795   //---------------------------------------------------------------------------------- 
796  
797   
798   //----------------------------------------------------------------------------------
799   //cosmetics: text (integrated flow) 
800   //default text:
801   TPaveText *textDefault = new TPaveText(0.05,0.77,0.95,0.90,"NDC");
802   textDefault->SetTextFont(72);
803   textDefault->SetTextSize(0.08);
804   
805   TString *entryDefaultAvM = new TString("Average Multiplicity");
806   TString *entryDefaultAnd = new TString("and"); 
807   TString *entryDefaultNumOfEvts = new TString("Number of Events:");
808   
809   textDefault->AddText(entryDefaultAvM->Data());
810   textDefault->AddText(entryDefaultAnd->Data());
811   textDefault->AddText(entryDefaultNumOfEvts->Data());
812   
813   // results (no-name):
814   TPaveText *textResults = new TPaveText(0.05,0.12,0.95,0.70,"NDC");
815   textResults->SetTextFont(72);
816   textResults->SetTextSize(0.06);
817   
818   // results (RP):
819   TPaveText *textResultsRP = new TPaveText(0.05,0.12,0.95,0.70,"NDC");
820   textResultsRP->SetTextFont(72);
821   textResultsRP->SetTextSize(0.06);
822   
823   // results (POI):
824   TPaveText *textResultsPOI = new TPaveText(0.05,0.12,0.95,0.70,"NDC");
825   textResultsPOI->SetTextFont(72);
826   textResultsPOI->SetTextSize(0.06);
827   
828   // no-name:              
829   TString *entryMC       = new TString("MC ........ ");
830   TString *entrySP       = new TString("SP ........ "); 
831   TString *entryGFC      = new TString("GFC ....... "); 
832   TString *entryQC2      = new TString("QC{2} ..... ");
833   TString *entryQC4      = new TString("QC{4} ..... ");
834   TString *entryQC6      = new TString("QC{6} ..... ");
835   TString *entryQC8      = new TString("QC{8} ..... ");
836   TString *entryFQD      = new TString("FQD ....... "); 
837   TString *entryLYZ1SUM  = new TString("LYZ{sum} .. "); 
838   TString *entryLYZ1PROD = new TString("LYZ{prod} . "); 
839   TString *entryLYZEP    = new TString("LYZEP ..... "); 
840   
841   // RP: 
842   TString *entryMCRP       = new TString("MC ........ ");
843   TString *entrySPRP       = new TString("SP ........ ");
844   TString *entryGFCRP      = new TString("GFC ....... "); 
845   TString *entryQC2RP      = new TString("QC{2} ..... ");
846   TString *entryQC4RP      = new TString("QC{4} ..... ");
847   TString *entryQC6RP      = new TString("QC{6} ..... ");
848   TString *entryQC8RP      = new TString("QC{8} ..... ");
849   TString *entryFQDRP      = new TString("FQD ....... "); 
850   TString *entryLYZ1SUMRP  = new TString("LYZ{sum} .. "); 
851   TString *entryLYZ1PRODRP = new TString("LYZ{prod} . ");
852   TString *entryLYZEPRP    = new TString("LYZEP ..... "); 
853   
854   // POI: 
855   TString *entryMCPOI       = new TString("MC ........ ");
856   TString *entrySPPOI       = new TString("SP ........ ");
857   TString *entryGFCPOI      = new TString("GFC ....... "); 
858   TString *entryQC2POI      = new TString("QC{2} ..... ");
859   TString *entryQC4POI      = new TString("QC{4} ..... ");
860   TString *entryQC6POI      = new TString("QC{6} ..... ");
861   TString *entryQC8POI      = new TString("QC{8} ..... ");
862   TString *entryFQDPOI      = new TString("FQD ....... "); 
863   TString *entryLYZ1SUMPOI  = new TString("LYZ{sum} .. "); 
864   TString *entryLYZ1PRODPOI = new TString("LYZ{prod} . "); 
865   TString *entryLYZEPPOI    = new TString("LYZEP ..... "); 
866   
867   // no-name:
868   Double_t avMultMC=0.;
869   Long_t nEvtsMC=0;
870   Double_t avMultSP=0.;
871   Long_t nEvtsSP=0;
872   Double_t avMultGFC=0.;
873   Long_t nEvtsGFC=0;
874   Double_t avMultQC2=0., avMultQC4=0., avMultQC6=0., avMultQC8=0.;
875   Long_t nEvtsQC2=0, nEvtsQC4=0, nEvtsQC6=0, nEvtsQC8=0;
876   Double_t avMultFQD=0.;
877   Long_t nEvtsFQD=0;
878   Double_t avMultLYZ1SUM=0.;
879   Long_t nEvtsLYZ1SUM=0;
880   Double_t avMultLYZ1PROD=0.;
881   Long_t nEvtsLYZ1PROD=0;
882   Double_t avMultLYZEP=0.;
883   Long_t nEvtsLYZEP=0;
884   
885   // RP:
886   Double_t avMultMCRP=0.;
887   Long_t nEvtsMCRP=0;
888   Double_t avMultSPRP=0.;
889   Long_t nEvtsSPRP=0;
890   Double_t avMultGFCRP=0.;
891   Long_t nEvtsGFCRP=0;
892   Double_t avMultQC2RP=0., avMultQC4RP=0., avMultQC6RP=0., avMultQC8RP=0.;
893   Long_t nEvtsQC2RP=0, nEvtsQC4RP=0, nEvtsQC6RP=0, nEvtsQC8RP=0;
894   Double_t avMultFQDRP=0.;
895   Long_t nEvtsFQDRP=0;
896   Double_t avMultLYZ1SUMRP=0.;
897   Long_t nEvtsLYZ1SUMRP=0;
898   Double_t avMultLYZ1PRODRP=0.;
899   Long_t nEvtsLYZ1PRODRP=0;
900   Double_t avMultLYZEPRP=0.;
901   Long_t nEvtsLYZEPRP=0;
902   
903   // POI:
904   Double_t avMultMCPOI=0.;
905   Long_t nEvtsMCPOI=0;
906   Double_t avMultSPPOI=0.;
907   Long_t nEvtsSPPOI=0;
908   Double_t avMultGFCPOI=0.;
909   Long_t nEvtsGFCPOI=0;
910   Double_t avMultQC2POI=0., avMultQC4POI=0., avMultQC6POI=0., avMultQC8POI=0.;
911   Long_t nEvtsQC2POI=0, nEvtsQC4POI=0, nEvtsQC6POI=0, nEvtsQC8POI=0;
912   Double_t avMultFQDPOI=0.;
913   Long_t nEvtsFQDPOI=0;
914   Double_t avMultLYZ1SUMPOI=0.;
915   Long_t nEvtsLYZ1SUMPOI=0;
916   Double_t avMultLYZ1PRODPOI=0.;
917   Long_t nEvtsLYZ1PRODPOI=0;
918   Double_t avMultLYZEPPOI=0.;
919   Long_t nEvtsLYZEPPOI=0;
920   
921   // MC:  
922   if(mcepCommonHist) {
923     avMultMC = (mcepCommonHist->GetHistMultRP())->GetMean();
924     nEvtsMC  = (mcepCommonHist->GetHistMultRP())->GetEntries();
925     avMultMCRP = (mcepCommonHist->GetHistMultRP())->GetMean();
926     nEvtsMCRP  = (mcepCommonHist->GetHistMultRP())->GetEntries();
927     avMultMCPOI = (mcepCommonHist->GetHistMultPOI())->GetMean();
928     nEvtsMCPOI  = (mcepCommonHist->GetHistMultPOI())->GetEntries();
929   }
930   
931   if(entryMC) {   
932     entryMC->Append("M = ");
933     (*entryMC)+=(Long_t)avMultMC;
934     entryMC->Append(", N = ");
935     (*entryMC)+=(Long_t)nEvtsMC;
936   }
937  
938   if(entryMCRP) {   
939     entryMCRP->Append("M = ");
940     (*entryMCRP)+=(Long_t)avMultMCRP;
941     entryMCRP->Append(", N = ");
942     (*entryMCRP)+=(Long_t)nEvtsMCRP;
943   }
944   
945   if(entryMCPOI) {   
946    entryMCPOI->Append("M = ");
947    (*entryMCPOI)+=(Long_t)avMultMCPOI;
948    entryMCPOI->Append(", N = ");
949    (*entryMCPOI)+=(Long_t)nEvtsMCPOI;
950   }
951   
952   // SP:  
953   if(spCommonHist) {
954     avMultSP = (spCommonHist->GetHistMultRP())->GetMean();
955     nEvtsSP  = (spCommonHist->GetHistMultRP())->GetEntries();
956     avMultSPRP = (spCommonHist->GetHistMultRP())->GetMean();
957     nEvtsSPRP  = (spCommonHist->GetHistMultRP())->GetEntries();
958     avMultSPPOI = (spCommonHist->GetHistMultPOI())->GetMean();
959     nEvtsSPPOI  = (spCommonHist->GetHistMultPOI())->GetEntries();
960   }
961   
962   if(entrySP) {   
963     entrySP->Append("M = ");
964     (*entrySP)+=(Long_t)avMultSP;
965     entrySP->Append(", N = ");
966     (*entrySP)+=(Long_t)nEvtsSP;
967   }
968  
969   if(entrySPRP) {   
970     entrySPRP->Append("M = ");
971     (*entrySPRP)+=(Long_t)avMultSPRP;
972     entrySPRP->Append(", N = ");
973     (*entrySPRP)+=(Long_t)nEvtsSPRP;
974   }
975   
976   if(entrySPPOI) {   
977    entrySPPOI->Append("M = ");
978    (*entrySPPOI)+=(Long_t)avMultSPPOI;
979    entrySPPOI->Append(", N = ");
980    (*entrySPPOI)+=(Long_t)nEvtsSPPOI;
981   }
982   
983  // GFC:
984  if(gfcCommonHist) {
985    avMultGFC = (gfcCommonHist->GetHistMultRP())->GetMean();
986    nEvtsGFC  = (gfcCommonHist->GetHistMultRP())->GetEntries();
987    avMultGFCRP = (gfcCommonHist->GetHistMultRP())->GetMean();
988    nEvtsGFCRP  = (gfcCommonHist->GetHistMultRP())->GetEntries();
989    avMultGFCPOI = (gfcCommonHist->GetHistMultPOI())->GetMean();
990    nEvtsGFCPOI  = (gfcCommonHist->GetHistMultPOI())->GetEntries();
991  }
992  
993  if(entryGFC) { 
994    entryGFC->Append("M = ");
995    (*entryGFC)+=(Long_t)avMultGFC;
996    entryGFC->Append(", N = ");
997    (*entryGFC)+=(Long_t)nEvtsGFC;
998  }
999  
1000  if(entryGFCRP) { 
1001    entryGFCRP->Append("M = ");
1002    (*entryGFCRP)+=(Long_t)avMultGFCRP;
1003    entryGFCRP->Append(", N = ");
1004    (*entryGFCRP)+=(Long_t)nEvtsGFCRP;
1005  }
1006  if(entryGFCPOI) { 
1007    entryGFCPOI->Append("M = ");
1008    (*entryGFCPOI)+=(Long_t)avMultGFCPOI;
1009    entryGFCPOI->Append(", N = ");
1010    (*entryGFCPOI)+=(Long_t)nEvtsGFCPOI;
1011  }
1012  
1013  // QC:
1014  if(qcCommonHist2) {
1015    avMultQC2 = (qcCommonHist2->GetHistMultRP())->GetMean();
1016    nEvtsQC2  = (qcCommonHist2->GetHistMultRP())->GetEntries();
1017    avMultQC2RP = (qcCommonHist2->GetHistMultRP())->GetMean();
1018    nEvtsQC2RP  = (qcCommonHist2->GetHistMultRP())->GetEntries();
1019    avMultQC2POI = (qcCommonHist2->GetHistMultPOI())->GetMean();
1020    nEvtsQC2POI  = (qcCommonHist2->GetHistMultPOI())->GetEntries();
1021  }
1022  
1023  if(entryQC2)
1024  { 
1025   entryQC2->Append("M = ");
1026   (*entryQC2)+=(Long_t)avMultQC2;
1027   entryQC2->Append(", N = ");
1028   (*entryQC2)+=(Long_t)nEvtsQC2;
1029  }
1030  
1031  if(entryQC2RP)
1032  { 
1033   entryQC2RP->Append("M = ");
1034   (*entryQC2RP)+=(Long_t)avMultQC2RP;
1035   entryQC2RP->Append(", N = ");
1036   (*entryQC2RP)+=(Long_t)nEvtsQC2RP;
1037  } 
1038  
1039  if(entryQC2POI)
1040  { 
1041   entryQC2POI->Append("M = ");
1042   (*entryQC2POI)+=(Long_t)avMultQC2POI;
1043   entryQC2POI->Append(", N = ");
1044   (*entryQC2POI)+=(Long_t)nEvtsQC2POI;
1045  } 
1046
1047  if(qcCommonHist4)
1048  {
1049   avMultQC4 = (qcCommonHist4->GetHistMultRP())->GetMean();
1050   nEvtsQC4  = (qcCommonHist4->GetHistMultRP())->GetEntries();
1051   avMultQC4RP = (qcCommonHist4->GetHistMultRP())->GetMean();
1052   nEvtsQC4RP  = (qcCommonHist4->GetHistMultRP())->GetEntries();
1053   avMultQC4POI = (qcCommonHist4->GetHistMultPOI())->GetMean();
1054   nEvtsQC4POI  = (qcCommonHist4->GetHistMultPOI())->GetEntries();
1055  }
1056  
1057  if(entryQC4)
1058  {
1059   entryQC4->Append("M = ");
1060   (*entryQC4)+=(Long_t)avMultQC4;
1061   entryQC4->Append(", N = ");
1062   (*entryQC4)+=(Long_t)nEvtsQC4;
1063  }
1064  
1065  if(entryQC4RP)
1066  {
1067   entryQC4RP->Append("M = ");
1068   (*entryQC4RP)+=(Long_t)avMultQC4RP;
1069   entryQC4RP->Append(", N = ");
1070   (*entryQC4RP)+=(Long_t)nEvtsQC4RP;
1071  }
1072  
1073  if(entryQC4POI)
1074  {
1075   entryQC4POI->Append("M = ");
1076   (*entryQC4POI)+=(Long_t)avMultQC4POI;
1077   entryQC4POI->Append(", N = ");
1078   (*entryQC4POI)+=(Long_t)nEvtsQC4POI;
1079  }
1080    
1081  if(qcCommonHist6)
1082  {
1083   avMultQC6 = (qcCommonHist6->GetHistMultRP())->GetMean();
1084   nEvtsQC6  = (qcCommonHist6->GetHistMultRP())->GetEntries();
1085   avMultQC6RP = (qcCommonHist6->GetHistMultRP())->GetMean();
1086   nEvtsQC6RP  = (qcCommonHist6->GetHistMultRP())->GetEntries();
1087   avMultQC6POI = (qcCommonHist6->GetHistMultPOI())->GetMean();
1088   nEvtsQC6POI  = (qcCommonHist6->GetHistMultPOI())->GetEntries();
1089  }
1090  
1091  if(entryQC6)
1092  {  
1093   entryQC6->Append("M = ");
1094   (*entryQC6)+=(Long_t)avMultQC6;
1095   entryQC6->Append(", N = ");
1096   (*entryQC6)+=(Long_t)nEvtsQC6;
1097  }
1098  
1099  if(entryQC6RP)
1100  {  
1101   entryQC6RP->Append("M = ");
1102   (*entryQC6RP)+=(Long_t)avMultQC6RP;
1103   entryQC6RP->Append(", N = ");
1104   (*entryQC6RP)+=(Long_t)nEvtsQC6RP;
1105  }
1106  
1107  if(entryQC6POI)
1108  {  
1109   entryQC6POI->Append("M = ");
1110   (*entryQC6POI)+=(Long_t)avMultQC6POI;
1111   entryQC6POI->Append(", N = ");
1112   (*entryQC6POI)+=(Long_t)nEvtsQC6POI;
1113  }
1114    
1115  if(qcCommonHist8)
1116  {
1117   avMultQC8 = (qcCommonHist8->GetHistMultRP())->GetMean();
1118   nEvtsQC8  = (qcCommonHist8->GetHistMultRP())->GetEntries();
1119   avMultQC8RP = (qcCommonHist8->GetHistMultRP())->GetMean();
1120   nEvtsQC8RP  = (qcCommonHist8->GetHistMultRP())->GetEntries();
1121   avMultQC8POI = (qcCommonHist8->GetHistMultPOI())->GetMean();
1122   nEvtsQC8POI  = (qcCommonHist8->GetHistMultPOI())->GetEntries();    
1123  }
1124   
1125  if(entryQC8)
1126  {
1127   entryQC8->Append("M = ");
1128   (*entryQC8)+=(Long_t)avMultQC8;
1129   entryQC8->Append(", N = ");
1130   (*entryQC8)+=(Long_t)nEvtsQC8;
1131  }
1132  
1133  if(entryQC8RP)
1134  {
1135   entryQC8RP->Append("M = ");
1136   (*entryQC8RP)+=(Long_t)avMultQC8RP;
1137   entryQC8RP->Append(", N = ");
1138   (*entryQC8RP)+=(Long_t)nEvtsQC8RP;
1139  }
1140  
1141  if(entryQC8POI)
1142  {
1143   entryQC8POI->Append("M = ");
1144   (*entryQC8POI)+=(Long_t)avMultQC8POI;
1145   entryQC8POI->Append(", N = ");
1146   (*entryQC8POI)+=(Long_t)nEvtsQC8POI;
1147  }
1148   
1149  // FQD:
1150  if(fqdCommonHist)
1151  {
1152   avMultFQD = (fqdCommonHist->GetHistMultRP())->GetMean();
1153   nEvtsFQD  = (fqdCommonHist->GetHistMultRP())->GetEntries();
1154   avMultFQDRP = (fqdCommonHist->GetHistMultRP())->GetMean();
1155   nEvtsFQDRP  = (fqdCommonHist->GetHistMultRP())->GetEntries();
1156   avMultFQDPOI = (fqdCommonHist->GetHistMultPOI())->GetMean();
1157   nEvtsFQDPOI  = (fqdCommonHist->GetHistMultPOI())->GetEntries();
1158  } 
1159  
1160  if(entryFQD)
1161  {
1162   entryFQD->Append("M = ");
1163   (*entryFQD)+=(Long_t)avMultFQD;
1164   entryFQD->Append(", N = ");
1165   (*entryFQD)+=(Long_t)nEvtsFQD;
1166  }
1167  
1168  if(entryFQDRP)
1169  {
1170   entryFQDRP->Append("M = ");
1171   (*entryFQDRP)+=(Long_t)avMultFQDRP;
1172   entryFQDRP->Append(", N = ");
1173   (*entryFQDRP)+=(Long_t)nEvtsFQDRP;
1174  }
1175  
1176  if(entryFQDPOI)
1177  {
1178   entryFQDPOI->Append("M = ");
1179   (*entryFQDPOI)+=(Long_t)avMultFQDPOI;
1180   entryFQDPOI->Append(", N = ");
1181   (*entryFQDPOI)+=(Long_t)nEvtsFQDPOI;
1182  }  
1183   
1184  // LYZ1SUM:
1185  if(lyz1sumCommonHist)
1186  {
1187   avMultLYZ1SUM = (lyz1sumCommonHist->GetHistMultRP())->GetMean();
1188   nEvtsLYZ1SUM  = (lyz1sumCommonHist->GetHistMultRP())->GetEntries();
1189   avMultLYZ1SUMRP = (lyz1sumCommonHist->GetHistMultRP())->GetMean();
1190   nEvtsLYZ1SUMRP  = (lyz1sumCommonHist->GetHistMultRP())->GetEntries();
1191   avMultLYZ1SUMPOI = (lyz1sumCommonHist->GetHistMultPOI())->GetMean();
1192   nEvtsLYZ1SUMPOI  = (lyz1sumCommonHist->GetHistMultPOI())->GetEntries();
1193  }
1194  
1195  if(entryLYZ1SUM) 
1196  {
1197   entryLYZ1SUM->Append("M = ");
1198   (*entryLYZ1SUM)+=(Long_t)avMultLYZ1SUM;
1199   entryLYZ1SUM->Append(", N = ");
1200   (*entryLYZ1SUM)+=(Long_t)nEvtsLYZ1SUM;
1201  }
1202  
1203  if(entryLYZ1SUMRP) 
1204  {
1205   entryLYZ1SUMRP->Append("M = ");
1206   (*entryLYZ1SUMRP)+=(Long_t)avMultLYZ1SUMRP;
1207   entryLYZ1SUMRP->Append(", N = ");
1208   (*entryLYZ1SUMRP)+=(Long_t)nEvtsLYZ1SUMRP;
1209  }
1210  
1211  if(entryLYZ1SUMPOI) 
1212  {
1213   entryLYZ1SUMPOI->Append("M = ");
1214   (*entryLYZ1SUMPOI)+=(Long_t)avMultLYZ1SUMPOI;
1215   entryLYZ1SUMPOI->Append(", N = ");
1216   (*entryLYZ1SUMPOI)+=(Long_t)nEvtsLYZ1SUMPOI;
1217  }
1218  
1219  // LYZ1PROD:
1220  if(lyz1prodCommonHist)
1221  {
1222   avMultLYZ1PROD = (lyz1prodCommonHist->GetHistMultRP())->GetMean();
1223   nEvtsLYZ1PROD  = (lyz1prodCommonHist->GetHistMultRP())->GetEntries();
1224   avMultLYZ1PRODRP = (lyz1prodCommonHist->GetHistMultRP())->GetMean();
1225   nEvtsLYZ1PRODRP  = (lyz1prodCommonHist->GetHistMultRP())->GetEntries();
1226   avMultLYZ1PRODPOI = (lyz1prodCommonHist->GetHistMultPOI())->GetMean();
1227   nEvtsLYZ1PRODPOI  = (lyz1prodCommonHist->GetHistMultPOI())->GetEntries();
1228  }
1229   
1230  if(entryLYZ1PROD) 
1231  {
1232   entryLYZ1PROD->Append("M = ");
1233   (*entryLYZ1PROD)+=(Long_t)avMultLYZ1PROD;
1234   entryLYZ1PROD->Append(", N = ");
1235   (*entryLYZ1PROD)+=(Long_t)nEvtsLYZ1PROD;
1236  }
1237  
1238  if(entryLYZ1PRODRP) 
1239  {
1240   entryLYZ1PRODRP->Append("M = ");
1241   (*entryLYZ1PRODRP)+=(Long_t)avMultLYZ1PRODRP;
1242   entryLYZ1PRODRP->Append(", N = ");
1243   (*entryLYZ1PRODRP)+=(Long_t)nEvtsLYZ1PRODRP;
1244  }
1245  
1246  if(entryLYZ1PRODPOI) 
1247  {
1248   entryLYZ1PRODPOI->Append("M = ");
1249   (*entryLYZ1PRODPOI)+=(Long_t)avMultLYZ1PRODPOI;
1250   entryLYZ1PRODPOI->Append(", N = ");
1251   (*entryLYZ1PRODPOI)+=(Long_t)nEvtsLYZ1PRODPOI;
1252  } 
1253  
1254  // LYZEP:
1255  if(lyzepCommonHist)
1256  {
1257   avMultLYZEP = (lyzepCommonHist->GetHistMultRP())->GetMean();
1258   nEvtsLYZEP  = (lyzepCommonHist->GetHistMultRP())->GetEntries();
1259   avMultLYZEPRP = (lyzepCommonHist->GetHistMultRP())->GetMean();
1260   nEvtsLYZEPRP  = (lyzepCommonHist->GetHistMultRP())->GetEntries();
1261   avMultLYZEPPOI = (lyzepCommonHist->GetHistMultPOI())->GetMean();
1262   nEvtsLYZEPPOI  = (lyzepCommonHist->GetHistMultPOI())->GetEntries();    
1263  }
1264  
1265  
1266  if(entryLYZEP)
1267  {
1268   entryLYZEP->Append("M = ");
1269   (*entryLYZEP)+=(Long_t)avMultLYZEP;
1270   entryLYZEP->Append(", N = ");
1271   (*entryLYZEP)+=(Long_t)nEvtsLYZEP;
1272  }
1273  
1274  if(entryLYZEPRP)
1275  {
1276   entryLYZEPRP->Append("M = ");
1277   (*entryLYZEPRP)+=(Long_t)avMultLYZEPRP;
1278   entryLYZEPRP->Append(", N = ");
1279   (*entryLYZEPRP)+=(Long_t)nEvtsLYZEPRP;
1280  }
1281  
1282  if(entryLYZEPPOI)
1283  {
1284   entryLYZEPPOI->Append("M = ");
1285   (*entryLYZEPPOI)+=(Long_t)avMultLYZEPPOI;
1286   entryLYZEPPOI->Append(", N = ");
1287   (*entryLYZEPPOI)+=(Long_t)nEvtsLYZEPPOI;
1288  }
1289
1290  // no-name:
1291  if(textResults)
1292  {
1293   textResults->AddText(entryMC->Data());
1294   textResults->AddText(entrySP->Data());
1295   textResults->AddText(entryGFC->Data());
1296   textResults->AddText(entryQC2->Data());
1297   textResults->AddText(entryQC4->Data());
1298   textResults->AddText(entryQC6->Data());
1299   textResults->AddText(entryQC8->Data());
1300   textResults->AddText(entryFQD->Data());
1301   textResults->AddText(entryLYZ1SUM->Data());
1302   textResults->AddText(entryLYZ1PROD->Data());
1303   textResults->AddText(entryLYZEP->Data());
1304  }
1305  
1306  // RP:
1307  if(textResultsRP)
1308  {
1309   textResultsRP->AddText(entryMCRP->Data());
1310   textResultsRP->AddText(entrySPRP->Data());
1311   textResultsRP->AddText(entryGFCRP->Data());
1312   textResultsRP->AddText(entryQC2RP->Data());
1313   textResultsRP->AddText(entryQC4RP->Data());
1314   textResultsRP->AddText(entryQC6RP->Data());
1315   textResultsRP->AddText(entryQC8RP->Data());
1316   textResultsRP->AddText(entryFQDRP->Data());
1317   textResultsRP->AddText(entryLYZ1SUMRP->Data());
1318   textResultsRP->AddText(entryLYZ1PRODRP->Data());
1319   textResultsRP->AddText(entryLYZEPRP->Data());
1320  }
1321  
1322  // POI:
1323  if(textResultsPOI)
1324  {
1325   textResultsPOI->AddText(entryMCPOI->Data());
1326   textResultsPOI->AddText(entrySPPOI->Data());
1327   textResultsPOI->AddText(entryGFCPOI->Data());
1328   textResultsPOI->AddText(entryQC2POI->Data());
1329   textResultsPOI->AddText(entryQC4POI->Data());
1330   textResultsPOI->AddText(entryQC6POI->Data());
1331   textResultsPOI->AddText(entryQC8POI->Data());
1332   textResultsPOI->AddText(entryFQDPOI->Data());
1333   textResultsPOI->AddText(entryLYZ1SUMPOI->Data());
1334   textResultsPOI->AddText(entryLYZ1PRODPOI->Data());
1335   textResultsPOI->AddText(entryLYZEPPOI->Data());
1336  }
1337  //----------------------------------------------------------------------------------
1338  
1339  
1340  //----------------------------------------------------------------------------------
1341  // final drawing for integrated flow (no-name):
1342  if(plotIntFlow)
1343  {
1344   TCanvas* intFlowAllCanvas = new TCanvas("Integrated Flow","Integrated Flow",1000,600);
1345  
1346   intFlowAllCanvas->Divide(2,1);
1347  
1348   // 1st pad is for plot:
1349   (intFlowAllCanvas->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1350   
1351   if(intFlowAll)
1352   {
1353    if(dMin>0. && dMax>0.)
1354    {
1355     (intFlowAll->GetYaxis())->SetRangeUser(0.9744*dMin,1.0144*dMax);
1356    } else if(dMin<0. && dMax>0.)
1357      {
1358       if(!(-1.*dMin<4.*dMax))
1359       {  
1360        (intFlowAll->GetYaxis())->SetRangeUser(1.0266*dMin,1.0144*dMax);
1361       } else {(intFlowAll->GetYaxis())->SetRangeUser(1.1266*dMin,1.0144*dMax);}  
1362      } else if(dMin<0. && dMax<0.)
1363        {
1364         (intFlowAll->GetYaxis())->SetRangeUser(1.0266*dMin,0.9866*dMax);      
1365        }
1366    intFlowAll->Draw("E1");
1367   }                    
1368                                                     
1369   if(pMesh) pMesh->Draw("LFSAME");
1370    
1371   if(flowResults) flowResults->Draw("PSAME");
1372
1373   // 2nd pad is for legend:
1374   (intFlowAllCanvas->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1375  
1376   if(textDefault) textDefault->Draw();
1377  
1378   if(textResults) textResults->Draw();
1379  
1380  }// end of if(plotIntFlow) 
1381  //----------------------------------------------------------------------------------
1382  
1383  
1384  //----------------------------------------------------------------------------------
1385  // final drawing for integrated flow relative to MC (no-name):
1386  if(plotIntFlowRelativeToMC)
1387  {
1388   TCanvas* intFlowAllRelativeToMCCanvas = new TCanvas("Integrated Flow Relative To MC","Integrated Flow Relative To MC",1000,600);
1389  
1390   intFlowAllRelativeToMCCanvas->Divide(2,1);
1391  
1392   // 1st pad is for plot:
1393   (intFlowAllRelativeToMCCanvas->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1394   
1395   TH1D *intFlowAllRelativeToMC = new TH1D(*intFlowAll);
1396   (intFlowAllRelativeToMC->GetYaxis())->SetRangeUser(-1,1);
1397   (intFlowAllRelativeToMC->GetYaxis())->SetTitle("(v_{n}\{method\} - v_{n}\{MC\})/v_{n}\{MC\}"); 
1398   intFlowAllRelativeToMC->Draw("E1");            
1399   
1400   if(flowResultsRelativeToMC) flowResultsRelativeToMC->Draw("PSAME");
1401
1402   // 2nd pad is for legend:
1403   (intFlowAllRelativeToMCCanvas->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1404  
1405   if(textDefault) textDefault->Draw();
1406  
1407   if(textResults) textResults->Draw();
1408  
1409  }// end of if(plotIntFlowRelativeToMC) 
1410  //----------------------------------------------------------------------------------
1411  
1412  
1413  //----------------------------------------------------------------------------------
1414  //final drawing for integrated flow of RP (i.e. of particles used to determine the reaction plane):
1415  if(plotIntFlowRP)
1416  {
1417   TCanvas* intFlowAllCanvasRP = new TCanvas("Integrated Flow RP","Integrated Flow RP",1000,600);
1418  
1419   intFlowAllCanvasRP->Divide(2,1);
1420  
1421   //1st pad is for plot:
1422   (intFlowAllCanvasRP->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1423  
1424   TH1D *intFlowAllRP = new TH1D(*intFlowAll);
1425   intFlowAllRP->SetMarkerStyle(markerStyleRP);
1426   intFlowAllRP->SetMarkerColor(markerColorRP);
1427   (intFlowAllRP->GetXaxis())->SetBinLabel(binMCRP,"v_{2}{MC}");
1428   (intFlowAllRP->GetXaxis())->SetBinLabel(binSPRP,"v_{2}{SP}");
1429   (intFlowAllRP->GetXaxis())->SetBinLabel(binGFC2RP,"v_{2}{2,GFC}");
1430   (intFlowAllRP->GetXaxis())->SetBinLabel(binQC2RP,"v_{2}{2,QC}");
1431   (intFlowAllRP->GetXaxis())->SetBinLabel(binGFC4RP,"v_{2}{4,GFC}");
1432   (intFlowAllRP->GetXaxis())->SetBinLabel(binQC4RP,"v_{2}{4,QC}");
1433   (intFlowAllRP->GetXaxis())->SetBinLabel(binGFC6RP,"v_{2}{6,GFC}");
1434   (intFlowAllRP->GetXaxis())->SetBinLabel(binQC6RP,"v_{2}{6,QC}");
1435   (intFlowAllRP->GetXaxis())->SetBinLabel(binGFC8RP,"v_{2}{8,GFC}");
1436   (intFlowAllRP->GetXaxis())->SetBinLabel(binQC8RP,"v_{2}{8,QC}");
1437   (intFlowAllRP->GetXaxis())->SetBinLabel(binFQDRP,"v_{2}{FQD}");
1438   (intFlowAllRP->GetXaxis())->SetBinLabel(binLYZ2SUMRP,"v_{2}{LYZ,sum}");
1439   (intFlowAllRP->GetXaxis())->SetBinLabel(binLYZ2PRODRP,"v_{2}{LYZ,prod}");
1440   (intFlowAllRP->GetXaxis())->SetBinLabel(binLYZEPRP,"v_{2}{LYZEP}");
1441
1442   if(intFlowAllRP)
1443   {
1444    if(dMinRP>0. && dMaxRP>0.)
1445    {
1446     (intFlowAllRP->GetYaxis())->SetRangeUser(0.9744*dMinRP,1.0144*dMaxRP);
1447    } else if(dMinRP<0. && dMaxRP>0.)
1448      {
1449       if(!(-1.*dMinRP<4.*dMaxRP))
1450       {  
1451        (intFlowAllRP->GetYaxis())->SetRangeUser(1.0266*dMinRP,1.0144*dMaxRP);
1452       } else {(intFlowAllRP->GetYaxis())->SetRangeUser(1.1266*dMinRP,1.0144*dMaxRP);}  
1453      } else if(dMinRP<0. && dMaxRP<0.)
1454        {
1455         (intFlowAllRP->GetYaxis())->SetRangeUser(1.0266*dMinRP,0.9866*dMaxRP);      
1456        } 
1457    intFlowAllRP->Draw("E1");
1458   }
1459                                                                                                                                                                                                                                                                                    
1460   if(pMeshRP) pMeshRP->Draw("LFSAME");
1461    
1462   if(flowResultsRP) flowResultsRP->Draw("PSAME");
1463
1464   //2nd pad is for legend:
1465   (intFlowAllCanvasRP->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1466   
1467   if(textDefault) textDefault->Draw();
1468  
1469   if(textResultsRP) textResultsRP->Draw();
1470  }//end of if(plotIntFlowRP} 
1471  //----------------------------------------------------------------------------------
1472  
1473  
1474  //----------------------------------------------------------------------------------
1475  // final drawing for integrated flow relative to MC (RP):
1476  if(plotIntFlowRelativeToMCRP)
1477  {
1478   TCanvas* intFlowAllRelativeToMCRPCanvas = new TCanvas("Integrated Flow (RP) Relative To MC","Integrated Flow (RP) Relative To MC",1000,600);
1479  
1480   intFlowAllRelativeToMCRPCanvas->Divide(2,1);
1481  
1482   // 1st pad is for plot:
1483   (intFlowAllRelativeToMCRPCanvas->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1484   
1485   TH1D *intFlowAllRelativeToMCRP = new TH1D(*intFlowAll);
1486   (intFlowAllRelativeToMCRP->GetYaxis())->SetRangeUser(-1,1); 
1487   (intFlowAllRelativeToMCRP->GetYaxis())->SetTitle("(v_{n}\{method\} - v_{n}\{MC\})/v_{n}\{MC\}");
1488   intFlowAllRelativeToMCRP->Draw("E1");            
1489   
1490   if(flowResultsRelativeToMCRP) flowResultsRelativeToMCRP->Draw("PSAME");
1491
1492   // 2nd pad is for legend:
1493   (intFlowAllRelativeToMCRPCanvas->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1494  
1495   if(textDefault) textDefault->Draw();
1496  
1497   if(textResultsRP) textResultsRP->Draw();
1498  
1499  }// end of if(plotIntFlowRelativeToMCRP) 
1500  //----------------------------------------------------------------------------------
1501   
1502  
1503  //----------------------------------------------------------------------------------
1504  //final drawing for integrated flow of POI (i.e. of particles of interest):
1505  if(plotIntFlowPOI)
1506  {
1507   TCanvas* intFlowAllCanvasPOI = new TCanvas("Integrated Flow POI","Integrated Flow POI",1000,600);
1508   
1509   intFlowAllCanvasPOI->Divide(2,1);
1510  
1511   //1st pad is for plot:
1512   (intFlowAllCanvasPOI->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1513   
1514   TH1D *intFlowAllPOI = new TH1D(*intFlowAll);
1515   intFlowAllPOI->SetMarkerStyle(markerStylePOI);
1516   intFlowAllPOI->SetMarkerColor(markerColorPOI);
1517   (intFlowAllPOI->GetXaxis())->SetBinLabel(binMCPOI,"v_{2}{MC}");
1518   (intFlowAllPOI->GetXaxis())->SetBinLabel(binSPPOI,"v_{2}{SP}");
1519   (intFlowAllPOI->GetXaxis())->SetBinLabel(binGFC2POI,"v_{2}{2,GFC}");
1520   (intFlowAllPOI->GetXaxis())->SetBinLabel(binQC2POI,"v_{2}{2,QC}");
1521   (intFlowAllPOI->GetXaxis())->SetBinLabel(binGFC4POI,"v_{2}{4,GFC}");
1522   (intFlowAllPOI->GetXaxis())->SetBinLabel(binQC4POI,"v_{2}{4,QC}");
1523   (intFlowAllPOI->GetXaxis())->SetBinLabel(binGFC6POI,"v_{2}{6,GFC}");
1524   (intFlowAllPOI->GetXaxis())->SetBinLabel(binQC6POI,"v_{2}{6,QC}");
1525   (intFlowAllPOI->GetXaxis())->SetBinLabel(binGFC8POI,"v_{2}{8,GFC}");
1526   (intFlowAllPOI->GetXaxis())->SetBinLabel(binQC8POI,"v_{2}{8,QC}");
1527   (intFlowAllPOI->GetXaxis())->SetBinLabel(binFQDPOI,"v_{2}{FQD}");
1528   (intFlowAllPOI->GetXaxis())->SetBinLabel(binLYZ2SUMPOI,"v_{2}{LYZ,sum}");
1529   (intFlowAllPOI->GetXaxis())->SetBinLabel(binLYZ2PRODPOI,"v_{2}{LYZ,prod}");
1530   (intFlowAllPOI->GetXaxis())->SetBinLabel(binLYZEPPOI,"v_{2}{LYZEP}");
1531   
1532   if(intFlowAllPOI)
1533   {
1534    if(dMinPOI>0. && dMaxPOI>0.)
1535    {
1536     (intFlowAllPOI->GetYaxis())->SetRangeUser(0.9744*dMinPOI,1.0144*dMaxPOI);
1537    } else if(dMinPOI<0. && dMaxPOI>0.)
1538      {
1539       if(!(-1.*dMinPOI<4.*dMaxPOI))
1540       {  
1541        (intFlowAllPOI->GetYaxis())->SetRangeUser(1.0266*dMinPOI,1.0144*dMaxPOI);
1542       } else {(intFlowAllPOI->GetYaxis())->SetRangeUser(1.1266*dMinPOI,1.0144*dMaxPOI);}  
1543      } else if(dMinPOI<0. && dMaxPOI<0.)
1544        {
1545         (intFlowAllPOI->GetYaxis())->SetRangeUser(1.0266*dMinPOI,0.9866*dMaxPOI);      
1546        }
1547    intFlowAllPOI->Draw("E1");
1548   }
1549                             
1550   if(pMeshPOI) pMeshPOI->Draw("LFSAME");
1551    
1552   if(flowResultsPOI) flowResultsPOI->Draw("PSAME");
1553  
1554   //2nd pad is for legend:
1555   (intFlowAllCanvasPOI->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1556  
1557   if(textDefault) textDefault->Draw();
1558
1559   if(textResultsPOI) textResultsPOI->Draw();
1560  }// end of if(plotIntFlowPOI) 
1561  //----------------------------------------------------------------------------------      
1562  
1563     
1564  //----------------------------------------------------------------------------------
1565  // final drawing for integrated flow relative to MC (POI):
1566  if(plotIntFlowRelativeToMCPOI)
1567  {
1568   TCanvas* intFlowAllRelativeToMCPOICanvas = new TCanvas("Integrated Flow (POI) Relative To MC","Integrated Flow (POI) Relative To MC",1000,600);
1569  
1570   intFlowAllRelativeToMCPOICanvas->Divide(2,1);
1571  
1572   // 1st pad is for plot:
1573   (intFlowAllRelativeToMCPOICanvas->cd(1))->SetPad(0.0,0.0,0.75,1.0);
1574   
1575   TH1D *intFlowAllRelativeToMCPOI = new TH1D(*intFlowAll);
1576   (intFlowAllRelativeToMCPOI->GetYaxis())->SetRangeUser(-1,1); 
1577   (intFlowAllRelativeToMCPOI->GetYaxis())->SetTitle("(v_{n}\{method\} - v_{n}\{MC\})/v_{n}\{MC\}");
1578   intFlowAllRelativeToMCPOI->Draw("E1");            
1579   
1580   if(flowResultsRelativeToMCPOI) flowResultsRelativeToMCPOI->Draw("PSAME");
1581
1582   // 2nd pad is for legend:
1583   (intFlowAllRelativeToMCPOICanvas->cd(2))->SetPad(0.75,0.0,1.0,1.0);
1584  
1585   if(textDefault) textDefault->Draw();
1586  
1587   if(textResultsPOI) textResultsPOI->Draw();
1588  
1589  }// end of if(plotIntFlowRelativeToMCPOI) 
1590  //----------------------------------------------------------------------------------
1591          
1592  //==================================================================================   
1593
1594
1595
1596
1597  //==================================================================================
1598  //                            DIFFERENTIAL FLOW
1599  //==================================================================================
1600  Int_t iNbinsPt  = AliFlowCommonConstants::GetNbinsPt();
1601  Double_t dPtMin = AliFlowCommonConstants::GetPtMin();
1602  Double_t dPtMax = AliFlowCommonConstants::GetPtMax();
1603  
1604  Int_t iNbinsEta  = AliFlowCommonConstants::GetNbinsEta();
1605  Double_t dEtaMin = AliFlowCommonConstants::GetEtaMin();
1606  Double_t dEtaMax = AliFlowCommonConstants::GetEtaMax();
1607  
1608  //----------------------------------------------------------------------------------
1609  //cosmetics: the style histogram for differential flow (pt):
1610  TH1D *styleHistPt = new TH1D("styleHistPt","styleHistPt",iNbinsPt,dPtMin,dPtMax);
1611  styleHistPt->SetTitle("Differential Flow");
1612  styleHistPt->SetXTitle("p_{t} [GeV]");
1613  styleHistPt->SetYTitle("v_{n}");
1614  
1615  //cosmetics: the style histogram for differential flow (eta):
1616  TH1D *styleHistEta = new TH1D("styleHistEta","styleHistEta",iNbinsEta,dEtaMin,dEtaMax);
1617  styleHistEta->SetTitle("Differential Flow");
1618  styleHistEta->SetXTitle("#eta");
1619  styleHistEta->SetYTitle("v_{n}");
1620  //----------------------------------------------------------------------------------
1621  
1622  
1623
1624  //----------------------------------------------------------------------------------
1625  //RP:
1626  //cosmetics: Monte Carlo error bands for differential flow (Pt)
1627  TGraph* pMeshDiffFlowPtRP = NULL;
1628  if(mcepCommonHistRes)
1629  {
1630   Int_t nBinsDiffFlowPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetNbinsX();
1631   Double_t binWidthPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinWidth(1);//assuming that all bins have the same width
1632
1633   //counting the non-empty bins: 
1634   Int_t nNonEmptyBinsDiffFlowPtRP=0;
1635   for(Int_t i=1;i<nBinsDiffFlowPtRP+1;i++)
1636   {
1637    if(!(mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(i)==0.0))
1638    {
1639     nNonEmptyBinsDiffFlowPtRP++;
1640    }
1641   }    
1642        
1643   pMeshDiffFlowPtRP = new TGraph(2*nNonEmptyBinsDiffFlowPtRP+1);
1644   
1645   Double_t valueMCPtRP=0.,errorMCPtRP=0.;
1646   Int_t countDiffFlowPtRP=1;
1647   Double_t xFirstDiffFlowPtRP=0.,yUpFirstDiffFlowPtRP=0.;//needed to close up the mesh
1648   for(Int_t i=1;i<nBinsDiffFlowPtRP+1;i++)
1649   {
1650    //setting up the upper limit of the mesh:
1651    valueMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(i);
1652    errorMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(i);   
1653    if(!(errorMCPtRP==0.0))
1654    {    
1655     pMeshDiffFlowPtRP->SetPoint(countDiffFlowPtRP++,(i-0.5)*binWidthPtRP+dPtMin,valueMCPtRP+errorMCPtRP);
1656     if(xFirstDiffFlowPtRP==0.)
1657     {
1658      xFirstDiffFlowPtRP=(i-0.5)*binWidthPtRP+dPtMin;
1659      yUpFirstDiffFlowPtRP=valueMCPtRP+errorMCPtRP;
1660     }
1661    } 
1662   }   
1663   for(Int_t i=nBinsDiffFlowPtRP+1;i<2*nBinsDiffFlowPtRP+1;i++)
1664   {
1665    //setting up the lower limit of the mesh:
1666    valueMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(2*nBinsDiffFlowPtRP+1-i);
1667    errorMCPtRP = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(2*nBinsDiffFlowPtRP+1-i); 
1668    if(!(errorMCPtRP==0.0))
1669    {      
1670     pMeshDiffFlowPtRP->SetPoint(countDiffFlowPtRP++,(2*nBinsDiffFlowPtRP-i+0.5)*binWidthPtRP+dPtMin,valueMCPtRP-errorMCPtRP);
1671    }  
1672   }
1673   //closing the mesh area:
1674   pMeshDiffFlowPtRP->SetPoint(2*nNonEmptyBinsDiffFlowPtRP+1,xFirstDiffFlowPtRP,yUpFirstDiffFlowPtRP);   
1675   
1676   //setting the mesh style and color:               
1677   pMeshDiffFlowPtRP->SetFillStyle(meshStyleDiffFlowPtRP);
1678   pMeshDiffFlowPtRP->SetFillColor(meshColorDiffFlowPtRP);
1679  }
1680
1681  //cosmetics: Monte Carlo error bands for differential flow (Eta)
1682  TGraph* pMeshDiffFlowEtaRP = NULL;
1683  if(mcepCommonHistRes)
1684  {
1685   Int_t nBinsDiffFlowEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetNbinsX();
1686   Double_t binWidthEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinWidth(1);//assuming that all bins have the same width
1687
1688   //counting the non-empty bins: 
1689   Int_t nNonEmptyBinsDiffFlowEtaRP=0;
1690   for(Int_t i=1;i<nBinsDiffFlowEtaRP+1;i++)
1691   {
1692    if(!(mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinError(i)==0.0))
1693    {
1694     nNonEmptyBinsDiffFlowEtaRP++;
1695    }
1696   }    
1697        
1698   pMeshDiffFlowEtaRP = new TGraph(2*nNonEmptyBinsDiffFlowEtaRP+1);
1699   
1700   Double_t valueMCEtaRP=0.,errorMCEtaRP=0.;
1701   Int_t countDiffFlowEtaRP=1;
1702   Double_t xFirstDiffFlowEtaRP=0.,yUpFirstDiffFlowEtaRP=0.;//needed to close up the mesh
1703   for(Int_t i=1;i<nBinsDiffFlowEtaRP+1;i++)
1704   {
1705    //setting up the upper limit of the mesh:
1706    valueMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinContent(i);
1707    errorMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinError(i);   
1708    if(!(errorMCEtaRP==0.0))
1709    {    
1710     pMeshDiffFlowEtaRP->SetPoint(countDiffFlowEtaRP++,(i-0.5)*binWidthEtaRP+dEtaMin,valueMCEtaRP+errorMCEtaRP);
1711     if(xFirstDiffFlowEtaRP==0.)
1712     {
1713      xFirstDiffFlowEtaRP=(i-0.5)*binWidthEtaRP+dEtaMin;
1714      yUpFirstDiffFlowEtaRP=valueMCEtaRP+errorMCEtaRP;
1715     }
1716    } 
1717   }   
1718   for(Int_t i=nBinsDiffFlowEtaRP+1;i<2*nBinsDiffFlowEtaRP+1;i++)
1719   {
1720    //setting up the lower limit of the mesh:
1721    valueMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinContent(2*nBinsDiffFlowEtaRP+1-i);
1722    errorMCEtaRP = (mcepCommonHistRes->GetHistDiffFlowEtaRP())->GetBinError(2*nBinsDiffFlowEtaRP+1-i); 
1723    if(!(errorMCEtaRP==0.0))
1724    {      
1725     pMeshDiffFlowEtaRP->SetPoint(countDiffFlowEtaRP++,(2*nBinsDiffFlowEtaRP-i+0.5)*binWidthEtaRP+dEtaMin,valueMCEtaRP-errorMCEtaRP);
1726    }  
1727   }
1728   //closing the mesh area:
1729   pMeshDiffFlowEtaRP->SetPoint(2*nNonEmptyBinsDiffFlowEtaRP+1,xFirstDiffFlowEtaRP,yUpFirstDiffFlowEtaRP);   
1730   
1731   //setting the mesh style and color:               
1732   pMeshDiffFlowEtaRP->SetFillStyle(meshStyleDiffFlowEtaRP);
1733   pMeshDiffFlowEtaRP->SetFillColor(meshColorDiffFlowEtaRP);
1734  } 
1735  //----------------------------------------------------------------------------------
1736
1737
1738
1739
1740  //----------------------------------------------------------------------------------
1741  //POI:
1742  //cosmetics: Monte Carlo error bands for differential flow (Pt)
1743  TGraph* pMeshDiffFlowPtPOI = NULL;
1744  if(mcepCommonHistRes)
1745  {
1746   Int_t nBinsDiffFlowPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetNbinsX();
1747   Double_t binWidthPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinWidth(1);//assuming that all bins have the same width
1748
1749   //counting the non-empty bins: 
1750   Int_t nNonEmptyBinsDiffFlowPtPOI=0;
1751   for(Int_t i=1;i<nBinsDiffFlowPtPOI+1;i++)
1752   {
1753    if(!(mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinError(i)==0.0))
1754    {
1755     nNonEmptyBinsDiffFlowPtPOI++;
1756    }
1757   }    
1758        
1759   pMeshDiffFlowPtPOI = new TGraph(2*nNonEmptyBinsDiffFlowPtPOI+1);
1760   
1761   Double_t valueMCPtPOI=0.,errorMCPtPOI=0.;
1762   Int_t countDiffFlowPtPOI=1;
1763   Double_t xFirstDiffFlowPtPOI=0.,yUpFirstDiffFlowPtPOI=0.;//needed to close up the mesh
1764   for(Int_t i=1;i<nBinsDiffFlowPtPOI+1;i++)
1765   {
1766    //setting up the upper limit of the mesh:
1767    valueMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinContent(i);
1768    errorMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinError(i);   
1769    if(!(errorMCPtPOI==0.0))
1770    {    
1771     pMeshDiffFlowPtPOI->SetPoint(countDiffFlowPtPOI++,(i-0.5)*binWidthPtPOI+dPtMin,valueMCPtPOI+errorMCPtPOI);
1772     if(xFirstDiffFlowPtPOI==0.)
1773     {
1774      xFirstDiffFlowPtPOI=(i-0.5)*binWidthPtPOI+dPtMin;
1775      yUpFirstDiffFlowPtPOI=valueMCPtPOI+errorMCPtPOI;
1776     }
1777    } 
1778   }   
1779   for(Int_t i=nBinsDiffFlowPtPOI+1;i<2*nBinsDiffFlowPtPOI+1;i++)
1780   {
1781    //setting up the lower limit of the mesh:
1782    valueMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinContent(2*nBinsDiffFlowPtPOI+1-i);
1783    errorMCPtPOI = (mcepCommonHistRes->GetHistDiffFlowPtPOI())->GetBinError(2*nBinsDiffFlowPtPOI+1-i); 
1784    if(!(errorMCPtPOI==0.0))
1785    {      
1786     pMeshDiffFlowPtPOI->SetPoint(countDiffFlowPtPOI++,(2*nBinsDiffFlowPtPOI-i+0.5)*binWidthPtPOI+dPtMin,valueMCPtPOI-errorMCPtPOI);
1787    }  
1788   }
1789   //closing the mesh area:
1790   pMeshDiffFlowPtPOI->SetPoint(2*nNonEmptyBinsDiffFlowPtPOI+1,xFirstDiffFlowPtPOI,yUpFirstDiffFlowPtPOI);   
1791   
1792   //setting the mesh style and color:               
1793   pMeshDiffFlowPtPOI->SetFillStyle(meshStyleDiffFlowPtPOI);
1794   pMeshDiffFlowPtPOI->SetFillColor(meshColorDiffFlowPtPOI);
1795  }
1796
1797  //cosmetics: Monte Carlo error bands for differential flow (Eta)
1798  TGraph* pMeshDiffFlowEtaPOI = NULL;
1799  if(mcepCommonHistRes)
1800  {
1801   Int_t nBinsDiffFlowEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetNbinsX();
1802   Double_t binWidthEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinWidth(1);//assuming that all bins have the same width
1803
1804   //counting the non-empty bins: 
1805   Int_t nNonEmptyBinsDiffFlowEtaPOI=0;
1806   for(Int_t i=1;i<nBinsDiffFlowEtaPOI+1;i++)
1807   {
1808    if(!(mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinError(i)==0.0))
1809    {
1810     nNonEmptyBinsDiffFlowEtaPOI++;
1811    }
1812   }    
1813        
1814   pMeshDiffFlowEtaPOI = new TGraph(2*nNonEmptyBinsDiffFlowEtaPOI+1);
1815   
1816   Double_t valueMCEtaPOI=0.,errorMCEtaPOI=0.;
1817   Int_t countDiffFlowEtaPOI=1;
1818   Double_t xFirstDiffFlowEtaPOI=0.,yUpFirstDiffFlowEtaPOI=0.;//needed to close up the mesh
1819   for(Int_t i=1;i<nBinsDiffFlowEtaPOI+1;i++)
1820   {
1821    //setting up the upper limit of the mesh:
1822    valueMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinContent(i);
1823    errorMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinError(i);   
1824    if(!(errorMCEtaPOI==0.0))
1825    {    
1826     pMeshDiffFlowEtaPOI->SetPoint(countDiffFlowEtaPOI++,(i-0.5)*binWidthEtaPOI+dEtaMin,valueMCEtaPOI+errorMCEtaPOI);
1827     if(xFirstDiffFlowEtaPOI==0.)
1828     {
1829      xFirstDiffFlowEtaPOI=(i-0.5)*binWidthEtaPOI+dEtaMin;
1830      yUpFirstDiffFlowEtaPOI=valueMCEtaPOI+errorMCEtaPOI;
1831     }
1832    } 
1833   }   
1834   for(Int_t i=nBinsDiffFlowEtaPOI+1;i<2*nBinsDiffFlowEtaPOI+1;i++)
1835   {
1836    //setting up the lower limit of the mesh:
1837    valueMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinContent(2*nBinsDiffFlowEtaPOI+1-i);
1838    errorMCEtaPOI = (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->GetBinError(2*nBinsDiffFlowEtaPOI+1-i); 
1839    if(!(errorMCEtaPOI==0.0))
1840    {      
1841     pMeshDiffFlowEtaPOI->SetPoint(countDiffFlowEtaPOI++,(2*nBinsDiffFlowEtaPOI-i+0.5)*binWidthEtaPOI+dEtaMin,valueMCEtaPOI-errorMCEtaPOI);
1842    }  
1843   }
1844   //closing the mesh area:
1845   pMeshDiffFlowEtaPOI->SetPoint(2*nNonEmptyBinsDiffFlowEtaPOI+1,xFirstDiffFlowEtaPOI,yUpFirstDiffFlowEtaPOI);   
1846   
1847   //setting the mesh style and color:               
1848   pMeshDiffFlowEtaPOI->SetFillStyle(meshStyleDiffFlowEtaPOI);
1849   pMeshDiffFlowEtaPOI->SetFillColor(meshColorDiffFlowEtaPOI);
1850  }
1851  //----------------------------------------------------------------------------------
1852    
1853  //MCEP = Monte Carlo Event Plane
1854  Double_t avMultDiffFlowMCRP=0.;
1855  Double_t nEvtsDiffFlowMCRP=0;
1856  Double_t avMultDiffFlowMCPOI=0.;
1857  Double_t nEvtsDiffFlowMCPOI=0;
1858  if(fileMCEP)
1859  {
1860   if(mcepCommonHistRes)
1861   {
1862    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorMC);
1863    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleMC);
1864    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorMC);
1865    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleMC);
1866    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorMC);
1867    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleMC);
1868    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorMC);
1869    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleMC);
1870   } 
1871   if(mcepCommonHist)
1872   {
1873    avMultDiffFlowMCRP = (mcepCommonHist->GetHistMultRP())->GetMean();
1874    nEvtsDiffFlowMCRP  = (mcepCommonHist->GetHistMultRP())->GetEntries();
1875    avMultDiffFlowMCPOI = (mcepCommonHist->GetHistMultPOI())->GetMean();
1876    nEvtsDiffFlowMCPOI  = (mcepCommonHist->GetHistMultPOI())->GetEntries();      
1877   } 
1878  } 
1879  
1880  //SP = Scalar Product
1881  Double_t avMultDiffFlowSPRP=0.;
1882  Double_t nEvtsDiffFlowSPRP=0;
1883  Double_t avMultDiffFlowSPPOI=0.;
1884  Double_t nEvtsDiffFlowSPPOI=0;
1885  if(fileSP)
1886  {
1887   if(spCommonHistRes)
1888   {
1889    (spCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorSP);
1890    (spCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleSP);
1891    (spCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorSP);
1892    (spCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleSP);
1893    (spCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorSP);
1894    (spCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleSP);
1895    (spCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorSP);
1896    (spCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleSP);
1897   } 
1898   if(spCommonHist)
1899   {
1900    avMultDiffFlowSPRP = (spCommonHist->GetHistMultRP())->GetMean();
1901    nEvtsDiffFlowSPRP = (spCommonHist->GetHistMultRP())->GetEntries();
1902    avMultDiffFlowSPPOI = (spCommonHist->GetHistMultPOI())->GetMean();
1903    nEvtsDiffFlowSPPOI = (spCommonHist->GetHistMultPOI())->GetEntries();      
1904   } 
1905  } 
1906
1907  //GFC = Generating Function Cumulants
1908  Double_t avMultDiffFlowGFC=0.;//to be removed
1909  Double_t nEvtsDiffFlowGFC=0.;//to be removed
1910  Double_t avMultDiffFlowGFCRP=0.;
1911  Double_t nEvtsDiffFlowGFCRP=0.;
1912  Double_t avMultDiffFlowGFCPOI=0.;
1913  Double_t nEvtsDiffFlowGFCPOI=0.; 
1914  if(fileGFC)
1915  {
1916   if(gfcCommonHistRes2)
1917   {
1918    (gfcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorGFC2);
1919    (gfcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleGFC2);
1920    (gfcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorGFC2);
1921    (gfcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleGFC2);
1922    (gfcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorGFC2);
1923    (gfcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleGFC2);
1924    (gfcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorGFC2);
1925    (gfcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleGFC2);
1926   }
1927   if(gfcCommonHistRes4)
1928   { 
1929    (gfcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorGFC4);
1930    (gfcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleGFC4);
1931    (gfcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorGFC4);
1932    (gfcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleGFC4);
1933    (gfcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorGFC4);
1934    (gfcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleGFC4);
1935    (gfcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorGFC4);
1936    (gfcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleGFC4);         
1937   }
1938   if(gfcCommonHistRes6)
1939   { 
1940    (gfcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorGFC6);
1941    (gfcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleGFC6);
1942    (gfcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorGFC6);
1943    (gfcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleGFC6);
1944    (gfcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorGFC6);
1945    (gfcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleGFC6);
1946    (gfcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorGFC6);
1947    (gfcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleGFC6);
1948   }
1949   if(gfcCommonHistRes8)
1950   { 
1951    (gfcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorGFC8);
1952    (gfcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleGFC8);
1953    (gfcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorGFC8);
1954    (gfcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleGFC8);
1955    (gfcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorGFC8);
1956    (gfcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleGFC8);
1957    (gfcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorGFC8);
1958    (gfcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleGFC8);
1959   }
1960   if(gfcCommonHist)
1961   {
1962    avMultDiffFlowGFCRP = (gfcCommonHist->GetHistMultRP())->GetMean();   
1963    nEvtsDiffFlowGFCRP  = (gfcCommonHist->GetHistMultRP())->GetEntries();
1964    avMultDiffFlowGFCPOI = (gfcCommonHist->GetHistMultPOI())->GetMean();
1965    nEvtsDiffFlowGFCPOI  = (gfcCommonHist->GetHistMultPOI())->GetEntries();   
1966   } 
1967  }
1968   
1969  //QC = Q-cumulants
1970  Double_t avMultDiffFlowQC2RP=0.;
1971  Double_t nEvtsDiffFlowQC2RP=0.;
1972  Double_t avMultDiffFlowQC2POI=0.;
1973  Double_t nEvtsDiffFlowQC2POI=0.;
1974  Double_t avMultDiffFlowQC4RP=0.;
1975  Double_t nEvtsDiffFlowQC4RP=0.;
1976  Double_t avMultDiffFlowQC4POI=0.;
1977  Double_t nEvtsDiffFlowQC4POI=0.;
1978  Double_t avMultDiffFlowQC6RP=0.;
1979  Double_t nEvtsDiffFlowQC6RP=0.;
1980  Double_t avMultDiffFlowQC6POI=0.;
1981  Double_t nEvtsDiffFlowQC6POI=0.;
1982  Double_t avMultDiffFlowQC8RP=0.;
1983  Double_t nEvtsDiffFlowQC8RP=0.;
1984  Double_t avMultDiffFlowQC8POI=0.;
1985  Double_t nEvtsDiffFlowQC8POI=0.;
1986
1987  if(fileQC)
1988  {
1989   //QC{2}
1990   if(qcCommonHistRes2)
1991   {
1992    (qcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorQC2);
1993    (qcCommonHistRes2->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleQC2);
1994    (qcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorQC2);
1995    (qcCommonHistRes2->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleQC2);
1996    (qcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorQC2);
1997    (qcCommonHistRes2->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleQC2);
1998    (qcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorQC2);
1999    (qcCommonHistRes2->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleQC2);
2000   }
2001   if(qcCommonHist2)
2002   {
2003    avMultDiffFlowQC2RP = (qcCommonHist2->GetHistMultRP())->GetMean();
2004    nEvtsDiffFlowQC2RP  = (qcCommonHist2->GetHistMultRP())->GetEntries();
2005    avMultDiffFlowQC2POI = (qcCommonHist2->GetHistMultPOI())->GetMean();
2006    nEvtsDiffFlowQC2POI  = (qcCommonHist2->GetHistMultPOI())->GetEntries();
2007   }
2008   //QC{4}
2009   if(qcCommonHistRes4)
2010   {
2011    (qcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorQC4);
2012    (qcCommonHistRes4->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleQC4);
2013    (qcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorQC4);
2014    (qcCommonHistRes4->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleQC4);
2015    (qcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorQC4);
2016    (qcCommonHistRes4->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleQC4);
2017    (qcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorQC4);
2018    (qcCommonHistRes4->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleQC4);
2019   }
2020   if(qcCommonHist4)
2021   {
2022    avMultDiffFlowQC4RP = (qcCommonHist4->GetHistMultRP())->GetMean();
2023    nEvtsDiffFlowQC4RP  = (qcCommonHist4->GetHistMultRP())->GetEntries();
2024    avMultDiffFlowQC4POI = (qcCommonHist4->GetHistMultPOI())->GetMean();
2025    nEvtsDiffFlowQC4POI  = (qcCommonHist4->GetHistMultPOI())->GetEntries();
2026   }
2027   //QC{6}
2028   if(qcCommonHistRes6)
2029   {
2030    (qcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorQC6);
2031    (qcCommonHistRes6->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleQC6);
2032    (qcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorQC6);
2033    (qcCommonHistRes6->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleQC6);
2034    (qcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorQC6);
2035    (qcCommonHistRes6->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleQC6);
2036    (qcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorQC6);
2037    (qcCommonHistRes6->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleQC6);
2038   }
2039   if(qcCommonHist6)
2040   {
2041    avMultDiffFlowQC6RP = (qcCommonHist6->GetHistMultRP())->GetMean();
2042    nEvtsDiffFlowQC6RP  = (qcCommonHist6->GetHistMultRP())->GetEntries();
2043    avMultDiffFlowQC6POI = (qcCommonHist6->GetHistMultPOI())->GetMean();
2044    nEvtsDiffFlowQC6POI  = (qcCommonHist6->GetHistMultPOI())->GetEntries();
2045   }
2046   //QC{8}
2047   if(qcCommonHistRes8)
2048   {
2049    (qcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorQC8);
2050    (qcCommonHistRes8->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleQC8);
2051    (qcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorQC8);
2052    (qcCommonHistRes8->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleQC8);
2053    (qcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorQC8);
2054    (qcCommonHistRes8->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleQC8);
2055    (qcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorQC8);
2056    (qcCommonHistRes8->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleQC8);
2057   }
2058   if(qcCommonHist8)
2059   {
2060    avMultDiffFlowQC8RP = (qcCommonHist8->GetHistMultRP())->GetMean();
2061    nEvtsDiffFlowQC8RP  = (qcCommonHist8->GetHistMultRP())->GetEntries();
2062    avMultDiffFlowQC8POI = (qcCommonHist8->GetHistMultPOI())->GetMean();
2063    nEvtsDiffFlowQC8POI  = (qcCommonHist8->GetHistMultPOI())->GetEntries();
2064   }
2065  } 
2066
2067  //LYZ2SUM = Lee-Yang Zeros (2nd run, sum)
2068  Double_t avMultDiffFlowLYZ2SUMRP=0.;
2069  Double_t nEvtsDiffFlowLYZ2SUMRP=0;
2070  Double_t avMultDiffFlowLYZ2SUMPOI=0.;
2071  Double_t nEvtsDiffFlowLYZ2SUMPOI=0;
2072  if(fileLYZ2SUM)
2073  {
2074   if(lyz2sumCommonHistRes)
2075   {
2076    (lyz2sumCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorLYZ2SUM);
2077    (lyz2sumCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleLYZ2SUM);
2078    (lyz2sumCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorLYZ2SUM);
2079    (lyz2sumCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleLYZ2SUM);
2080    (lyz2sumCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorLYZ2SUM);
2081    (lyz2sumCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleLYZ2SUM);
2082    (lyz2sumCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorLYZ2SUM);
2083    (lyz2sumCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleLYZ2SUM);
2084   } 
2085   if(lyz2sumCommonHist)
2086   {
2087    avMultDiffFlowLYZ2SUMRP = (lyz2sumCommonHist->GetHistMultRP())->GetMean();
2088    nEvtsDiffFlowLYZ2SUMRP  = (lyz2sumCommonHist->GetHistMultRP())->GetEntries();
2089    avMultDiffFlowLYZ2SUMPOI = (lyz2sumCommonHist->GetHistMultPOI())->GetMean();
2090    nEvtsDiffFlowLYZ2SUMPOI  = (lyz2sumCommonHist->GetHistMultPOI())->GetEntries();
2091   } 
2092  } 
2093  
2094  //LYZ2PROD = Lee-Yang Zeros (2nd run, product)
2095  Double_t avMultDiffFlowLYZ2PRODRP=0.;
2096  Double_t nEvtsDiffFlowLYZ2PRODRP=0;
2097  Double_t avMultDiffFlowLYZ2PRODPOI=0.;
2098  Double_t nEvtsDiffFlowLYZ2PRODPOI=0;
2099  if(fileLYZ2PROD)
2100  {
2101   if(lyz2prodCommonHistRes)
2102   {
2103    (lyz2prodCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorLYZ2PROD);
2104    (lyz2prodCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleLYZ2PROD);
2105    (lyz2prodCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorLYZ2PROD);
2106    (lyz2prodCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleLYZ2PROD);
2107    (lyz2prodCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorLYZ2PROD);
2108    (lyz2prodCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleLYZ2PROD);
2109    (lyz2prodCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorLYZ2PROD);
2110    (lyz2prodCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleLYZ2PROD);
2111   } 
2112   if(lyz2prodCommonHist)
2113   {
2114    avMultDiffFlowLYZ2PRODRP = (lyz2prodCommonHist->GetHistMultRP())->GetMean();
2115    nEvtsDiffFlowLYZ2PRODRP  = (lyz2prodCommonHist->GetHistMultRP())->GetEntries();
2116    avMultDiffFlowLYZ2PRODPOI = (lyz2prodCommonHist->GetHistMultPOI())->GetMean();
2117    nEvtsDiffFlowLYZ2PRODPOI  = (lyz2prodCommonHist->GetHistMultPOI())->GetEntries();
2118   } 
2119  } 
2120
2121  //LYZEP = Lee-Yang Zeros Event Plane
2122  Double_t avMultDiffFlowLYZEPRP=0.;
2123  Double_t nEvtsDiffFlowLYZEPRP=0;
2124  Double_t avMultDiffFlowLYZEPPOI=0.;
2125  Double_t nEvtsDiffFlowLYZEPPOI=0;
2126  if(fileLYZEP)
2127  {
2128   if(lyzepCommonHistRes)
2129   {
2130    (lyzepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerColor(markerColorLYZEP);
2131    (lyzepCommonHistRes->GetHistDiffFlowPtRP())->SetMarkerStyle(markerStyleLYZEP);
2132    (lyzepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerColor(markerColorLYZEP);
2133    (lyzepCommonHistRes->GetHistDiffFlowEtaRP())->SetMarkerStyle(markerStyleLYZEP);
2134    (lyzepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerColor(markerColorLYZEP);
2135    (lyzepCommonHistRes->GetHistDiffFlowPtPOI())->SetMarkerStyle(markerStyleLYZEP);
2136    (lyzepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerColor(markerColorLYZEP);
2137    (lyzepCommonHistRes->GetHistDiffFlowEtaPOI())->SetMarkerStyle(markerStyleLYZEP);
2138   } 
2139   if(lyzepCommonHist)
2140   {
2141    avMultDiffFlowLYZEPRP = (lyzepCommonHist->GetHistMultRP())->GetMean();
2142    nEvtsDiffFlowLYZEPRP  = (lyzepCommonHist->GetHistMultRP())->GetEntries();
2143    avMultDiffFlowLYZEPPOI = (lyzepCommonHist->GetHistMultPOI())->GetMean();
2144    nEvtsDiffFlowLYZEPPOI  = (lyzepCommonHist->GetHistMultPOI())->GetEntries();
2145   } 
2146  } 
2147
2148
2149  //----------------------------------------------------------------------------------
2150  //final drawing for differential flow (Pt, RP):
2151  if(plotDiffFlowPtRP)
2152  {
2153   TCanvas* diffFlowPtAllCanvasRP = new TCanvas("Differential Flow (Pt) of RP","Differential Flow (Pt) of RP ",1000,600);
2154   
2155   diffFlowPtAllCanvasRP->Divide(2,1);
2156  
2157   //1st pad is for plot:
2158   (diffFlowPtAllCanvasRP->cd(1))->SetPad(0.0,0.0,0.75,1.0);
2159  
2160   if(styleHistPt)
2161   {
2162    (styleHistPt->GetYaxis())->SetRangeUser(-0.3,1.0);
2163    styleHistPt->Draw();
2164   }
2165   if(pMeshDiffFlowPtRP)
2166   {
2167    pMeshDiffFlowPtRP->Draw("LFSAME");
2168   }
2169  
2170   //MC 
2171   if(plotMCPtRP && mcepCommonHistRes)
2172   { 
2173    (mcepCommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2174   }
2175   //SP 
2176   if(plotSPPtRP && spCommonHistRes)
2177   { 
2178    (spCommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2179   }
2180   //GFC
2181   if(plotGFC2PtRP && gfcCommonHistRes2)Pt
2182   { 
2183    (gfcCommonHistRes2->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
2184   } 
2185   if(plotGFC4PtRP && gfcCommonHistRes4)
2186   { 
2187    (gfcCommonHistRes4->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
2188   } 
2189   if(plotGFC6PtRP && gfcCommonHistRes6)
2190   { 
2191    (gfcCommonHistRes6->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
2192   } 
2193   if(plotGFC8PtRP && gfcCommonHistRes8)
2194   { 
2195    (gfcCommonHistRes8->GetHistDiffFlowPtRP())->Draw("E1PSAME"); 
2196   }    
2197   //QC
2198   if(plotQC2PtRP && qcCommonHistRes2)
2199   { 
2200    (qcCommonHistRes2->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2201   }
2202   if(plotQC4PtRP && qcCommonHistRes4)
2203   { 
2204    (qcCommonHistRes4->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2205   }
2206   if(plotQC6PtRP && qcCommonHistRes6)
2207   { 
2208    //(qcCommonHistRes6->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2209   }
2210   if(plotQC8PtRP && qcCommonHistRes8)
2211   { 
2212    //(qcCommonHistRes8->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2213   }
2214   //LYZ2SUM
2215   if(plotLYZ2SUMPtRP && lyz2sumCommonHistRes)
2216   { 
2217    (lyz2sumCommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2218   }
2219   //LYZ2PROD
2220   if(plotLYZ2PRODPtRP && lyz2prodCommonHistRes)
2221   { 
2222    (lyz2prodCommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2223   }
2224   //LYZEP
2225   if(plotLYZEPPtRP && lyzepCommonHistRes)
2226   { 
2227    (lyzepCommonHistRes->GetHistDiffFlowPtRP())->Draw("E1PSAME");
2228   }
2229
2230   //2nd pad is for legend:
2231   (diffFlowPtAllCanvasRP->cd(2))->SetPad(0.75,0.0,1.0,1.0);  
2232     
2233   TLegend* legendDiffFlowPtRP = new TLegend(0.02,0.12,0.97,0.70);
2234   legendDiffFlowPtRP->SetTextFont(72);
2235   legendDiffFlowPtRP->SetTextSize(0.06);
2236  
2237   //legend's entries:Pt
2238   TString *entryDiffMCPtRP       = new TString("MC ........ ");
2239   TString *entryDiffSPPtRP       = new TString("SP ........ ");
2240   TString *entryDiffGFC2PtRP     = new TString("GFC{2} .... ");
2241   TString *entryDiffGFC4PtRP     = new TString("GFC{4} .... ");
2242   TString *entryDiffGFC6PtRP     = new TString("GFC{6} .... ");
2243   TString *entryDiffGFC8PtRP     = new TString("GFC{8} .... "); 
2244   TString *entryDiffQC2PtRP      = new TString("QC{2} ..... ");
2245   TString *entryDiffQC4PtRP      = new TString("QC{4} ..... ");
2246   TString *entryDiffQC6PtRP      = new TString("QC{6} ..... ");
2247   TString *entryDiffQC8PtRP      = new TString("QC{8} ..... ");
2248   TString *entryDiffLYZ2SUMPtRP  = new TString("LYZ{sum} .. ");
2249   TString *entryDiffLYZ2PRODPtRP = new TString("LYZ{prod} . ");
2250   TString *entryDiffLYZEPPtRP    = new TString("LYZEP ..... ");
2251   
2252   //MC
2253   if(mcepCommonHistRes)
2254   {
2255    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetFillStyle(meshStyleDiffFlowPtRP);
2256    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetFillColor(meshColorDiffFlowPtRP);
2257    entryDiffMCPtRP->Append("M = ");
2258    (*entryDiffMCPtRP)+=(Long_t)avMultDiffFlowMCRP;
2259    entryDiffMCPtRP->Append(", N = ");
2260    (*entryDiffMCPtRP)+=(Long_t)nEvtsDiffFlowMCRP; 
2261    legendDiffFlowPtRP->AddEntry(mcepCommonHistRes->GetHistDiffFlowPtRP(),entryDiffMCPtRP->Data(),"f");
2262   }
2263   
2264   //SP
2265   if(plotSPPtRP && spCommonHistRes)
2266   {
2267    entryDiffSPPtRP->Append("M = ");
2268    (*entryDiffSPPtRP)+=(Long_t)avMultDiffFlowSPRP;
2269    entryDiffSPPtRP->Append(", N = ");
2270    (*entryDiffSPPtRP)+=(Long_t)nEvtsDiffFlowSPRP; 
2271    legendDiffFlowPtRP->AddEntry(spCommonHistRes->GetHistDiffFlowPtRP(),entryDiffSPPtRP->Data(),"p");
2272   }
2273
2274   //GFC
2275   if(plotGFC2PtRP && gfcCommonHistRes2)
2276   {
2277    entryDiffGFC2PtRP->Append("M = ");
2278    (*entryDiffGFC2PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2279    entryDiffGFC2PtRP->Append(", N = ");
2280    (*entryDiffGFC2PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2281    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes2->GetHistDiffFlowPtRP(),entryDiffGFC2PtRP->Data(),"p");
2282   }
2283   if(plotGFC4PtRP && gfcCommonHistRes4)
2284   {
2285    entryDiffGFC4PtRP->Append("M = ");
2286    (*entryDiffGFC4PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2287    entryDiffGFC4PtRP->Append(", N = ");
2288    (*entryDiffGFC4PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2289    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes4->GetHistDiffFlowPtRP(),entryDiffGFC4PtRP->Data(),"p");
2290   }
2291   if(plotGFC6PtRP && gfcCommonHistRes6)
2292   {
2293    entryDiffGFC6PtRP->Append("M = ");
2294    (*entryDiffGFC6PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2295    entryDiffGFC6PtRP->Append(", N = ");
2296    (*entryDiffGFC6PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2297    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes6->GetHistDiffFlowPtRP(),entryDiffGFC6PtRP->Data(),"p");
2298   } 
2299   if(plotGFC8PtRP && gfcCommonHistRes8)
2300   {
2301    entryDiffGFC8PtRP->Append("M = ");
2302    (*entryDiffGFC8PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2303    entryDiffGFC8PtRP->Append(", N = ");
2304    (*entryDiffGFC8PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2305    legendDiffFlowPtRP->AddEntry(gfcCommonHistRes8->GetHistDiffFlowPtRP(),entryDiffGFC8PtRP->Data(),"p");
2306   }  
2307   
2308   //QC
2309   if(plotQC2PtRP && qcCommonHistRes2)
2310   {
2311    entryDiffQC2PtRP->Append("M = ");
2312    (*entryDiffQC2PtRP)+=(Long_t)avMultDiffFlowQC2RP;
2313    entryDiffQC2PtRP->Append(", N = ");
2314    (*entryDiffQC2PtRP)+=(Long_t)nEvtsDiffFlowQC2RP; 
2315    legendDiffFlowPtRP->AddEntry(qcCommonHistRes2->GetHistDiffFlowPtRP(),entryDiffQC2PtRP->Data(),"p");
2316   }
2317   if(plotQC4PtRP && qcCommonHistRes4)
2318   {
2319    entryDiffQC4PtRP->Append("M = ");
2320    (*entryDiffQC4PtRP)+=(Long_t)avMultDiffFlowQC4RP;
2321    entryDiffQC4PtRP->Append(", N = ");
2322    (*entryDiffQC4PtRP)+=(Long_t)nEvtsDiffFlowQC4RP; 
2323    legendDiffFlowPtRP->AddEntry(qcCommonHistRes4->GetHistDiffFlowPtRP(),entryDiffQC4PtRP->Data(),"p");
2324   }
2325   if(plotQC6PtRP && qcCommonHistRes6)
2326   {
2327    entryDiffQC6PtRP->Append("M = ");
2328    (*entryDiffQC6PtRP)+=(Long_t)avMultDiffFlowQC6RP;
2329    entryDiffQC6PtRP->Append(", N = ");
2330    (*entryDiffQC6PtRP)+=(Long_t)nEvtsDiffFlowQC6RP; 
2331    legendDiffFlowPtRP->AddEntry(qcCommonHistRes6->GetHistDiffFlowPtRP(),entryDiffQC6PtRP->Data(),"p");
2332   }
2333   if(plotQC8PtRP && qcCommonHistRes8)
2334   {
2335    entryDiffQC8PtRP->Append("M = ");
2336    (*entryDiffQC8PtRP)+=(Long_t)avMultDiffFlowQC8RP;
2337    entryDiffQC8PtRP->Append(", N = ");
2338    (*entryDiffQC8PtRP)+=(Long_t)nEvtsDiffFlowQC8RP; 
2339    legendDiffFlowPtRP->AddEntry(qcCommonHistRes8->GetHistDiffFlowPtRP(),entryDiffQC8PtRP->Data(),"p");
2340   }
2341   
2342   //LYZ2SUM
2343   if(plotLYZ2SUMPtRP && lyz2sumCommonHistRes)
2344   {
2345    entryDiffLYZ2SUMPtRP->Append("M = ");
2346    (*entryDiffLYZ2SUMPtRP)+=(Long_t)avMultDiffFlowLYZ2SUMRP;
2347    entryDiffLYZ2SUMPtRP->Append(", N = ");
2348    (*entryDiffLYZ2SUMPtRP)+=(Long_t)nEvtsDiffFlowLYZ2SUMRP; 
2349    legendDiffFlowPtRP->AddEntry(lyz2sumCommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZ2SUMPtRP->Data(),"p");
2350   }
2351   
2352   //LYZ2PROD
2353   if(plotLYZ2PRODPtRP && lyz2prodCommonHistRes)
2354   {
2355    entryDiffLYZ2PRODPtRP->Append("M = ");
2356    (*entryDiffLYZ2PRODPtRP)+=(Long_t)avMultDiffFlowLYZ2PRODRP;
2357    entryDiffLYZ2PRODPtRP->Append(", N = ");
2358    (*entryDiffLYZ2PRODPtRP)+=(Long_t)nEvtsDiffFlowLYZ2PRODRP; 
2359    legendDiffFlowPtRP->AddEntry(lyz2prodCommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZ2PRODPtRP->Data(),"p");
2360   }
2361   
2362   //LYZEP
2363   if(plotLYZEPPtRP && lyzepCommonHistRes)
2364   {
2365    entryDiffLYZEPPtRP->Append("M = ");
2366    (*entryDiffLYZEPPtRP)+=(Long_t)avMultDiffFlowLYZEPRP;
2367    entryDiffLYZEPPtRP->Append(", N = ");
2368    (*entryDiffLYZEPPtRP)+=(Long_t)nEvtsDiffFlowLYZEPRP; 
2369    legendDiffFlowPtRP->AddEntry(lyzepCommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZEPPtRP->Data(),"p");
2370   }
2371
2372   //drawing finally the legend in the 2nd pad:         
2373   if(textDefault) textDefault->Draw();
2374   
2375   if(legendDiffFlowPtRP)
2376   {
2377    legendDiffFlowPtRP->SetMargin(0.15);
2378    legendDiffFlowPtRP->Draw();
2379   }
2380  }// end of if(plotDiffFlowPtRP)
2381  //----------------------------------------------------------------------------------
2382  
2383  //----------------------------------------------------------------------------------
2384  //final drawing for differential flow (Eta, RP):
2385  if(plotDiffFlowEtaRP)
2386  {
2387   TCanvas* diffFlowEtaAllCanvasRP = new TCanvas("Differential Flow (Eta) of RP","Differential Flow (Eta) of RP ",1000,600);
2388  
2389   diffFlowEtaAllCanvasRP->Divide(2,1);
2390  
2391   //1st pad is for plot:
2392   (diffFlowEtaAllCanvasRP->cd(1))->SetPad(0.0,0.0,0.75,1.0);
2393   
2394   if(styleHistEta)
2395   {
2396    (styleHistEta->GetYaxis())->SetRangeUser(-0.3,1.0);
2397    styleHistEta->Draw();
2398   }
2399   if(pMeshDiffFlowEtaRP)
2400   {
2401    pMeshDiffFlowEtaRP->Draw("LFSAME");
2402   }
2403  
2404   //MC 
2405   if(plotMCEtaRP && mcepCommonHistRes)
2406   { 
2407    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2408   }
2409   //SP 
2410   if(plotSPEtaRP && spCommonHistRes)
2411   { 
2412    (spCommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2413   }
2414   //GFC
2415   if(plotGFC2EtaRP && gfcCommonHistRes2)
2416   { 
2417    (gfcCommonHistRes2->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
2418   } 
2419   if(plotGFC4EtaRP && gfcCommonHistRes4)
2420   { 
2421    (gfcCommonHistRes4->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
2422   } 
2423   if(plotGFC6EtaRP && gfcCommonHistRes6)
2424   { 
2425    (gfcCommonHistRes6->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
2426   } 
2427   if(plotGFC8EtaRP && gfcCommonHistRes8)
2428   { 
2429    (gfcCommonHistRes8->GetHistDiffFlowEtaRP())->Draw("E1PSAME"); 
2430   }    
2431   //QC
2432   if(plotQC2EtaRP && qcCommonHistRes2)
2433   { 
2434    (qcCommonHistRes2->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2435   }
2436   if(plotQC4EtaRP && qcCommonHistRes4)
2437   { 
2438    (qcCommonHistRes4->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2439   }
2440   if(plotQC6EtaRP && qcCommonHistRes6)
2441   { 
2442    //(qcCommonHistRes6->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2443   }
2444   if(plotQC8EtaRP && qcCommonHistRes8)
2445   { 
2446    //(qcCommonHistRes8->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2447   }
2448   //LYZ2SUM
2449   if(plotLYZ2SUMEtaRP && lyz2sumCommonHistRes)
2450   { 
2451    (lyz2sumCommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2452   }
2453   //LYZ2PROD
2454   if(plotLYZ2PRODEtaRP && lyz2prodCommonHistRes)
2455   { 
2456    (lyz2prodCommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2457   }
2458   //LYZEP
2459   if(plotLYZEPEtaRP && lyzepCommonHistRes)
2460   { 
2461    (lyzepCommonHistRes->GetHistDiffFlowEtaRP())->Draw("E1PSAME");
2462   }
2463  
2464   //2nd pad is for legend:
2465   (diffFlowEtaAllCanvasRP->cd(2))->SetPad(0.75,0.0,1.0,1.0);
2466
2467   TLegend* legendDiffFlowEtaRP = new TLegend(0.02,0.12,0.97,0.70);
2468   legendDiffFlowEtaRP->SetTextFont(72);
2469   legendDiffFlowEtaRP->SetTextSize(0.06);
2470   
2471   //legend's entries:
2472   TString *entryDiffMCEtaRP       = new TString("MC ........ ");
2473   TString *entryDiffSPEtaRP       = new TString("SP ........ ");
2474   TString *entryDiffGFC2EtaRP     = new TString("GFC{2} .... ");
2475   TString *entryDiffGFC4EtaRP     = new TString("GFC{4} .... ");
2476   TString *entryDiffGFC6EtaRP     = new TString("GFC{6} .... ");
2477   TString *entryDiffGFC8EtaRP     = new TString("GFC{8} .... "); 
2478   TString *entryDiffQC2EtaRP      = new TString("QC{2} ..... ");
2479   TString *entryDiffQC4EtaRP      = new TString("QC{4} ..... ");
2480   TString *entryDiffQC6EtaRP      = new TString("QC{6} ..... ");
2481   TString *entryDiffQC8EtaRP      = new TString("QC{8} ..... ");
2482   TString *entryDiffLYZ2SUMEtaRP  = new TString("LYZ{sum} .. ");
2483   TString *entryDiffLYZ2PRODEtaRP = new TString("LYZ{prod} . ");
2484   TString *entryDiffLYZEPEtaRP    = new TString("LYZEP ..... ");
2485  
2486   //MC
2487   if(mcepCommonHistRes)
2488   {
2489    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetFillStyle(meshStyleDiffFlowEtaRP);
2490    (mcepCommonHistRes->GetHistDiffFlowEtaRP())->SetFillColor(meshColorDiffFlowEtaRP);
2491    entryDiffMCEtaRP->Append("M = ");
2492    (*entryDiffMCEtaRP)+=(Long_t)avMultDiffFlowMCRP;
2493    entryDiffMCEtaRP->Append(", N = ");
2494    (*entryDiffMCEtaRP)+=(Long_t)nEvtsDiffFlowMCRP; 
2495    legendDiffFlowEtaRP->AddEntry(mcepCommonHistRes->GetHistDiffFlowEtaRP(),entryDiffMCEtaRP->Data(),"f");
2496   }
2497   
2498   //SP
2499   if(plotSPEtaRP && spCommonHistRes)
2500   {
2501    entryDiffSPEtaRP->Append("M = ");
2502    (*entryDiffSPEtaRP)+=(Long_t)avMultDiffFlowSPRP;
2503    entryDiffSPEtaRP->Append(", N = ");
2504    (*entryDiffSPEtaRP)+=(Long_t)nEvtsDiffFlowSPRP; 
2505    legendDiffFlowEtaRP->AddEntry(spCommonHistRes->GetHistDiffFlowEtaRP(),entryDiffSPEtaRP->Data(),"p");
2506   }
2507  
2508   //GFC
2509   if(plotGFC2EtaRP && gfcCommonHistRes2)
2510   {
2511    entryDiffGFC2EtaRP->Append("M = ");
2512    (*entryDiffGFC2EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2513    entryDiffGFC2EtaRP->Append(", N = ");
2514    (*entryDiffGFC2EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2515    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes2->GetHistDiffFlowEtaRP(),entryDiffGFC2EtaRP->Data(),"p");
2516   }
2517   if(plotGFC4EtaRP && gfcCommonHistRes4)
2518   {
2519    entryDiffGFC4EtaRP->Append("M = ");
2520    (*entryDiffGFC4EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2521    entryDiffGFC4EtaRP->Append(", N = ");
2522    (*entryDiffGFC4EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2523    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes4->GetHistDiffFlowEtaRP(),entryDiffGFC4EtaRP->Data(),"p");
2524   }
2525   if(plotGFC6EtaRP && gfcCommonHistRes6)
2526   {
2527    entryDiffGFC6EtaRP->Append("M = ");
2528    (*entryDiffGFC6EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2529    entryDiffGFC6EtaRP->Append(", N = ");
2530    (*entryDiffGFC6EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2531    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes6->GetHistDiffFlowEtaRP(),entryDiffGFC6EtaRP->Data(),"p");
2532   } 
2533   if(plotGFC8EtaRP && gfcCommonHistRes8)
2534   {
2535    entryDiffGFC8EtaRP->Append("M = ");
2536    (*entryDiffGFC8EtaRP)+=(Long_t)avMultDiffFlowGFCRP;
2537    entryDiffGFC8EtaRP->Append(", N = ");
2538    (*entryDiffGFC8EtaRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2539    legendDiffFlowEtaRP->AddEntry(gfcCommonHistRes8->GetHistDiffFlowEtaRP(),entryDiffGFC8EtaRP->Data(),"p");
2540   }  
2541   
2542   //QC
2543   if(plotQC2EtaRP && qcCommonHistRes2)
2544   {
2545    entryDiffQC2EtaRP->Append("M = ");
2546    (*entryDiffQC2EtaRP)+=(Long_t)avMultDiffFlowQC2RP;
2547    entryDiffQC2EtaRP->Append(", N = ");
2548    (*entryDiffQC2EtaRP)+=(Long_t)nEvtsDiffFlowQC2RP; 
2549    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes2->GetHistDiffFlowEtaRP(),entryDiffQC2EtaRP->Data(),"p");
2550   }
2551   if(plotQC4EtaRP && qcCommonHistRes4)
2552   {
2553    entryDiffQC4EtaRP->Append("M = ");
2554    (*entryDiffQC4EtaRP)+=(Long_t)avMultDiffFlowQC4RP;
2555    entryDiffQC4EtaRP->Append(", N = ");
2556    (*entryDiffQC4EtaRP)+=(Long_t)nEvtsDiffFlowQC4RP; 
2557    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes4->GetHistDiffFlowEtaRP(),entryDiffQC4EtaRP->Data(),"p");
2558   }
2559   if(plotQC6EtaRP && qcCommonHistRes6)
2560   {
2561    entryDiffQC6EtaRP->Append("M = ");
2562    (*entryDiffQC6EtaRP)+=(Long_t)avMultDiffFlowQC6RP;
2563    entryDiffQC6EtaRP->Append(", N = ");
2564    (*entryDiffQC6EtaRP)+=(Long_t)nEvtsDiffFlowQC6RP; 
2565    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes6->GetHistDiffFlowEtaRP(),entryDiffQC6EtaRP->Data(),"p");
2566   }
2567   if(plotQC8EtaRP && qcCommonHistRes8)
2568   {
2569    entryDiffQC8EtaRP->Append("M = ");
2570    (*entryDiffQC8EtaRP)+=(Long_t)avMultDiffFlowQC8RP;
2571    entryDiffQC8EtaRP->Append(", N = ");
2572    (*entryDiffQC8EtaRP)+=(Long_t)nEvtsDiffFlowQC8RP; 
2573    legendDiffFlowEtaRP->AddEntry(qcCommonHistRes8->GetHistDiffFlowEtaRP(),entryDiffQC8EtaRP->Data(),"p");
2574   }
2575  
2576   //LYZ2SUM
2577   if(plotLYZ2SUMEtaRP && lyz2sumCommonHistRes)
2578   {
2579    entryDiffLYZ2SUMEtaRP->Append("M = ");
2580    (*entryDiffLYZ2SUMEtaRP)+=(Long_t)avMultDiffFlowLYZ2SUMRP;
2581    entryDiffLYZ2SUMEtaRP->Append(", N = ");
2582    (*entryDiffLYZ2SUMEtaRP)+=(Long_t)nEvtsDiffFlowLYZ2SUMRP; 
2583    legendDiffFlowEtaRP->AddEntry(lyz2sumCommonHistRes->GetHistDiffFlowEtaRP(),entryDiffLYZ2SUMEtaRP->Data(),"p");
2584   }
2585   
2586   //LYZ2PROD
2587   if(plotLYZ2PRODEtaRP && lyz2prodCommonHistRes)
2588   {
2589    entryDiffLYZ2PRODEtaRP->Append("M = ");
2590    (*entryDiffLYZ2PRODEtaRP)+=(Long_t)avMultDiffFlowLYZ2PRODRP;
2591    entryDiffLYZ2PRODEtaRP->Append(", N = ");
2592    (*entryDiffLYZ2PRODEtaRP)+=(Long_t)nEvtsDiffFlowLYZ2PRODRP; 
2593    legendDiffFlowEtaRP->AddEntry(lyz2prodCommonHistRes->GetHistDiffFlowEtaRP(),entryDiffLYZ2PRODEtaRP->Data(),"p");
2594   }
2595   
2596   //LYZEP
2597   if(plotLYZEPEtaRP && lyzepCommonHistRes)
2598   {
2599    entryDiffLYZEPEtaRP->Append("M = ");
2600    (*entryDiffLYZEPEtaRP)+=(Long_t)avMultDiffFlowLYZEPRP;
2601    entryDiffLYZEPEtaRP->Append(", N = ");
2602    (*entryDiffLYZEPEtaRP)+=(Long_t)nEvtsDiffFlowLYZEPRP; 
2603    legendDiffFlowEtaRP->AddEntry(lyzepCommonHistRes->GetHistDiffFlowEtaRP(),entryDiffLYZEPEtaRP->Data(),"p");
2604   }
2605
2606   //drawing finally the legend in the 2nd pad: 
2607   if(textDefault) textDefault->Draw();    
2608   
2609   if(legendDiffFlowEtaRP)
2610   {
2611    legendDiffFlowEtaRP->SetMargin(0.15);
2612    legendDiffFlowEtaRP->Draw();
2613   }
2614  }// end of if(plotDiffFlowEtaRP)
2615  //----------------------------------------------------------------------------------
2616  
2617  */
2618  
2619  //----------------------------------------------------------------------------------
2620  // final drawing for plot |(v{method}-v{MC})/v{MC}| as a function of pt for RPs  
2621  if(plotDiffFlowPtRelativeToMCRP)
2622  {  
2623   TCanvas* diffFlowPtRelativeToMCRP = new TCanvas("Differential Flow (Pt) of RPs relative to MC","Differ1ential Flow (Pt) of RPs relative to MC",1000,600);
2624   
2625   diffFlowPtRelativeToMCRP->Divide(2,1);
2626  
2627   //1st pad is for plot:
2628   (diffFlowPtRelativeToMCRP->cd(1))->SetPad(0.0,0.0,0.75,1.0);
2629  
2630   if(styleHistPt)
2631   {
2632    TH1D *styleHistPtReleativeToMC = new TH1D(*styleHistPt);
2633    (styleHistPtReleativeToMC->GetYaxis())->SetRangeUser(-4.0,4.0);
2634    (styleHistPtReleativeToMC->GetYaxis())->SetTitle("(v_{n}\{method\} - v_{n}\{MC\})/v_{n}\{MC\}");
2635    styleHistPtReleativeToMC->Draw();
2636   }
2637   
2638   TH1D *spDiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2639   TH1D *gfc2DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2640   TH1D *gfc4DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2641   TH1D *gfc6DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2642   TH1D *gfc8DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2643   TH1D *qc2DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2644   TH1D *qc4DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2645   TH1D *qc6DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2646   TH1D *qc8DiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2647   TH1D *lyz2sumDiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2648   TH1D *lyz2prodDiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2649   TH1D *lyzepDiffFlowPtRelativeToMCRP = new TH1D("","",iNbinsPt,dPtMin,dPtMax);
2650     
2651   if(mcepCommonHistRes && mcepCommonHistRes->GetHistDiffFlowPtRP())
2652   {
2653    for(Int_t p=1;p<iNbinsPt+1;p++)
2654    {
2655     Double_t dvnMC = (mcepCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(p);
2656     
2657     // SP:
2658     Double_t dvnSP = 0.;
2659     Double_t dvnErrorSP = 0.;
2660     if(spCommonHistRes && spCommonHistRes->GetHistDiffFlowPtRP())
2661     {
2662      dvnSP = (spCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(p);
2663      dvnErrorSP = (spCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(p);
2664     }
2665     if(dvnMC!=0. && dvnSP!=0.) 
2666     {
2667      spDiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnSP-dvnMC)/dvnMC);
2668      spDiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorSP/dvnMC);
2669     }
2670     
2671     // GFC{2}:
2672     Double_t dvnGFC2 = 0.;
2673     Double_t dvnErrorGFC2 = 0.;
2674     if(gfcCommonHistRes2 && gfcCommonHistRes2->GetHistDiffFlowPtRP())
2675     {
2676      dvnGFC2 = (gfcCommonHistRes2->GetHistDiffFlowPtRP())->GetBinContent(p);
2677      dvnErrorGFC2 = (gfcCommonHistRes2->GetHistDiffFlowPtRP())->GetBinError(p);
2678     }
2679     if(dvnMC!=0. && dvnGFC2!=0.) 
2680     {
2681      gfc2DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC2-dvnMC)/dvnMC);
2682      gfc2DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorGFC2/dvnMC);
2683     }
2684     
2685     // GFC{4}:
2686     Double_t dvnGFC4 = 0.;
2687     Double_t dvnErrorGFC4 = 0.;
2688     if(gfcCommonHistRes4 && gfcCommonHistRes4->GetHistDiffFlowPtRP())
2689     {
2690      dvnGFC4 = (gfcCommonHistRes4->GetHistDiffFlowPtRP())->GetBinContent(p);
2691      dvnErrorGFC4 = (gfcCommonHistRes4->GetHistDiffFlowPtRP())->GetBinError(p);
2692     }
2693     if(dvnMC!=0. && dvnGFC4!=0.) 
2694     {
2695      gfc4DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC4-dvnMC)/dvnMC);
2696      gfc4DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorGFC4/dvnMC);
2697     }
2698     
2699     // GFC{6}:
2700     Double_t dvnGFC6 = 0.;
2701     Double_t dvnErrorGFC6 = 0.;
2702     if(gfcCommonHistRes6 && gfcCommonHistRes6->GetHistDiffFlowPtRP())
2703     {
2704      dvnGFC6 = (gfcCommonHistRes6->GetHistDiffFlowPtRP())->GetBinContent(p);
2705      dvnErrorGFC6 = (gfcCommonHistRes6->GetHistDiffFlowPtRP())->GetBinError(p);
2706     }
2707     if(dvnMC!=0. && dvnGFC6!=0.) 
2708     {
2709      gfc6DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC6-dvnMC)/dvnMC);
2710      gfc6DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorGFC6/dvnMC);
2711     }
2712     
2713     // GFC{8}:
2714     Double_t dvnGFC8 = 0.;
2715     Double_t dvnErrorGFC8 = 0.;
2716     if(gfcCommonHistRes8 && gfcCommonHistRes8->GetHistDiffFlowPtRP())
2717     {
2718      dvnGFC8 = (gfcCommonHistRes8->GetHistDiffFlowPtRP())->GetBinContent(p);
2719      dvnErrorGFC8 = (gfcCommonHistRes8->GetHistDiffFlowPtRP())->GetBinError(p);
2720     }
2721     if(dvnMC!=0. && dvnGFC8!=0.) 
2722     {
2723      gfc8DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC8-dvnMC)/dvnMC);
2724      gfc8DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorGFC8/dvnMC);
2725     }
2726     
2727     // QC{2}:
2728     Double_t dvnQC2 = 0.;
2729     Double_t dvnErrorQC2 = 0.;
2730     if(qcCommonHistRes2 && qcCommonHistRes2->GetHistDiffFlowPtRP())
2731     {
2732      dvnQC2 = (qcCommonHistRes2->GetHistDiffFlowPtRP())->GetBinContent(p);
2733      dvnErrorQC2 = (qcCommonHistRes2->GetHistDiffFlowPtRP())->GetBinError(p);
2734     }
2735     if(dvnMC!=0. && dvnQC2!=0.) 
2736     {
2737      qc2DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC2-dvnMC)/dvnMC);
2738      qc2DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorQC2/dvnMC);
2739     }
2740     
2741     // QC{4}:
2742     Double_t dvnQC4 = 0.;
2743     Double_t dvnErrorQC4 = 0.;
2744     if(qcCommonHistRes4 && qcCommonHistRes4->GetHistDiffFlowPtRP())
2745     {
2746      dvnQC4 = (qcCommonHistRes4->GetHistDiffFlowPtRP())->GetBinContent(p);
2747      dvnErrorQC4 = (qcCommonHistRes4->GetHistDiffFlowPtRP())->GetBinError(p);
2748     }
2749     if(dvnMC!=0. && dvnQC4!=0.) 
2750     {
2751      qc4DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC4-dvnMC)/dvnMC);
2752      qc4DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorQC4/dvnMC);
2753     }
2754     
2755     // QC{6}:
2756     Double_t dvnQC6 = 0.;
2757     Double_t dvnErrorQC6 = 0.;
2758     if(qcCommonHistRes6 && qcCommonHistRes6->GetHistDiffFlowPtRP())
2759     {
2760      dvnQC6 = (qcCommonHistRes6->GetHistDiffFlowPtRP())->GetBinContent(p);
2761      dvnErrorQC6 = (qcCommonHistRes6->GetHistDiffFlowPtRP())->GetBinError(p);
2762     }
2763     if(dvnMC!=0. && dvnQC6!=0.) 
2764     {
2765      qc6DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC6-dvnMC)/dvnMC);
2766      qc6DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorQC6/dvnMC);
2767     }
2768     
2769     // QC{8}:
2770     Double_t dvnQC8 = 0.;
2771     Double_t dvnErrorQC8 = 0.;
2772     if(qcCommonHistRes8 && qcCommonHistRes8->GetHistDiffFlowPtRP())
2773     {
2774      dvnQC8 = (qcCommonHistRes8->GetHistDiffFlowPtRP())->GetBinContent(p);
2775      dvnErrorQC8 = (qcCommonHistRes8->GetHistDiffFlowPtRP())->GetBinError(p);
2776     }
2777     if(dvnMC!=0. && dvnQC8!=0.) 
2778     {
2779      qc8DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC8-dvnMC)/dvnMC);
2780      qc8DiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorQC8/dvnMC);
2781     }
2782     
2783     // LYZ2SUM:
2784     Double_t dvnLYZ2SUM = 0.;
2785     Double_t dvnErrorLYZ2SUM = 0.;
2786     if(lyz2sumCommonHistRes && lyz2sumCommonHistRes->GetHistDiffFlowPtRP())
2787     {
2788      dvnLYZ2SUM = (lyz2sumCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(p);
2789      dvnErrorLYZ2SUM = (lyz2sumCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(p);
2790     }
2791     if(dvnMC!=0. && dvnLYZ2SUM!=0.) 
2792     {
2793      lyz2sumDiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnLYZ2SUM-dvnMC)/dvnMC);
2794      lyz2sumDiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorLYZ2SUM/dvnMC);
2795     }
2796     
2797     // LYZ2PROD:
2798     Double_t dvnLYZ2PROD = 0.;
2799     Double_t dvnErrorLYZ2PROD = 0.;
2800     if(lyz2prodCommonHistRes && lyz2prodCommonHistRes->GetHistDiffFlowPtRP())
2801     {
2802      dvnLYZ2PROD = (lyz2prodCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(p);
2803      dvnErrorLYZ2PROD = (lyz2prodCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(p);
2804     }
2805     if(dvnMC!=0. && dvnLYZ2PROD!=0.) 
2806     {
2807      lyz2prodDiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnLYZ2PROD-dvnMC)/dvnMC);
2808      lyz2prodDiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorLYZ2PROD/dvnMC);
2809     }
2810       
2811     // LYZEP:
2812     Double_t dvnLYZEP = 0.;
2813     Double_t dvnErrorLYZEP = 0.;
2814     if(lyzepCommonHistRes && lyzepCommonHistRes->GetHistDiffFlowPtRP())
2815     {
2816      dvnLYZEP = (lyzepCommonHistRes->GetHistDiffFlowPtRP())->GetBinContent(p);
2817      dvnErrorLYZEP = (lyzepCommonHistRes->GetHistDiffFlowPtRP())->GetBinError(p);
2818     }
2819     if(dvnMC!=0. && dvnLYZEP!=0.) 
2820     {
2821      lyzepDiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnLYZEP-dvnMC)/dvnMC);
2822      lyzepDiffFlowPtRelativeToMCRP->SetBinError(p,dvnErrorLYZEP/dvnMC);
2823     }  
2824  
2825    } // end of for(Int_t p=1;p<iNbinsPt+1;p++)
2826   } // end of if(mcepCommonHistRes->GetHistDiffFlowPtRP())
2827   
2828   
2829   // final drawings: 
2830   spDiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorSP);
2831   spDiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleSP);
2832   if(plotSPRelativeToMCRP && spCommonHistRes) spDiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2833   
2834   gfc2DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorGFC2);
2835   gfc2DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleGFC2);
2836   if(plotGFC2RelativeToMCRP && gfcCommonHistRes2) gfc2DiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2837   
2838   gfc4DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorGFC4);
2839   gfc4DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleGFC4);
2840   if(plotGFC4RelativeToMCRP && gfcCommonHistRes4) gfc4DiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2841   
2842   gfc6DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorGFC6);
2843   gfc6DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleGFC6);
2844   if(plotGFC6RelativeToMCRP && gfcCommonHistRes6) gfc6DiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2845   
2846   gfc8DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorGFC8);
2847   gfc8DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleGFC8);
2848   if(plotGFC8RelativeToMCRP && gfcCommonHistRes8) gfc8DiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2849   
2850   qc2DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorQC2);
2851   qc2DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleQC2);
2852   if(plotQC2RelativeToMCRP && qcCommonHistRes2) qc2DiffFlowPtRelativeToMCRP->Draw("PSAME");
2853   
2854   qc4DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorQC4);
2855   qc4DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleQC4);
2856   if(plotQC4RelativeToMCRP && qcCommonHistRes4) qc4DiffFlowPtRelativeToMCRP->Draw("PSAME");
2857   
2858   qc6DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorQC6);
2859   qc6DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleQC6);
2860   if(plotQC6RelativeToMCRP && qcCommonHistRes6) qc6DiffFlowPtRelativeToMCRP->Draw("PSAME");
2861   
2862   qc8DiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorQC8);
2863   qc8DiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleQC8);
2864   if(plotQC8RelativeToMCRP && qcCommonHistRes8) qc8DiffFlowPtRelativeToMCRP->Draw("PSAME");
2865   
2866   lyz2sumDiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorLYZ2SUM);
2867   lyz2sumDiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleLYZ2SUM);
2868   if(plotLYZ2SUMRelativeToMCRP && lyz2sumCommonHistRes) lyz2sumDiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2869   
2870   lyz2prodDiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorLYZ2SUM);
2871   lyz2prodDiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleLYZ2SUM);
2872   if(plotLYZ2SUMRelativeToMCRP && lyz2prodCommonHistRes) lyz2prodDiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2873   
2874   lyzepDiffFlowPtRelativeToMCRP->SetMarkerColor(markerColorLYZEP);
2875   lyzepDiffFlowPtRelativeToMCRP->SetMarkerStyle(markerStyleLYZEP);
2876   if(plotLYZEPRelativeToMCRP && lyzepCommonHistRes) lyzepDiffFlowPtRelativeToMCRP->Draw("E1PSAME");
2877   
2878   //2nd pad is for legend:
2879   (diffFlowPtRelativeToMCRP->cd(2))->SetPad(0.75,0.0,1.0,1.0);
2880   
2881   TLegend* legendDiffFlowPtRP = new TLegend(0.02,0.12,0.97,0.70);
2882   legendDiffFlowPtRP->SetTextFont(72);
2883   legendDiffFlowPtRP->SetTextSize(0.06);
2884  
2885   //legend's entries:Pt 
2886   TString *entryDiffMCPtRP       = new TString("MC ........ ");
2887   TString *entryDiffSPPtRP       = new TString("SP ........ ");
2888   TString *entryDiffGFC2PtRP     = new TString("GFC{2} .... ");
2889   TString *entryDiffGFC4PtRP     = new TString("GFC{4} .... ");
2890   TString *entryDiffGFC6PtRP     = new TString("GFC{6} .... ");
2891   TString *entryDiffGFC8PtRP     = new TString("GFC{8} .... "); 
2892   TString *entryDiffQC2PtRP      = new TString("QC{2} ..... ");
2893   TString *entryDiffQC4PtRP      = new TString("QC{4} ..... ");
2894   TString *entryDiffQC6PtRP      = new TString("QC{6} ..... ");
2895   TString *entryDiffQC8PtRP      = new TString("QC{8} ..... ");
2896   TString *entryDiffLYZ2SUMPtRP  = new TString("LYZ{sum} .. ");
2897   TString *entryDiffLYZ2PRODPtRP = new TString("LYZ{prod} . ");
2898   TString *entryDiffLYZEPPtRP    = new TString("LYZEP ..... ");
2899   
2900   //MC
2901   if(mcepCommonHistRes)
2902   {
2903    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetFillStyle(meshStyleDiffFlowPtRP);
2904    (mcepCommonHistRes->GetHistDiffFlowPtRP())->SetFillColor(meshColorDiffFlowPtRP);
2905    entryDiffMCPtRP->Append("M = ");
2906    (*entryDiffMCPtRP)+=(Long_t)avMultDiffFlowMCRP;
2907    entryDiffMCPtRP->Append(", N = ");
2908    (*entryDiffMCPtRP)+=(Long_t)nEvtsDiffFlowMCRP; 
2909    //legendDiffFlowPtRP->AddEntry(mcepCommonHistRes->GetHistDiffFlowPtRP(),entryDiffMCPtRP->Data(),"f");
2910   }
2911   
2912   //SP
2913   if(plotSPPtRP && spCommonHistRes)
2914   {
2915    entryDiffSPPtRP->Append("M = ");
2916    (*entryDiffSPPtRP)+=(Long_t)avMultDiffFlowSPRP;
2917    entryDiffSPPtRP->Append(", N = ");
2918    (*entryDiffSPPtRP)+=(Long_t)nEvtsDiffFlowSPRP; 
2919    if(plotSPRelativeToMCRP) legendDiffFlowPtRP->AddEntry(spCommonHistRes->GetHistDiffFlowPtRP(),entryDiffSPPtRP->Data(),"p");
2920   }
2921
2922   //GFC
2923   if(plotGFC2PtRP && gfcCommonHistRes2)
2924   {
2925    entryDiffGFC2PtRP->Append("M = ");
2926    (*entryDiffGFC2PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2927    entryDiffGFC2PtRP->Append(", N = ");
2928    (*entryDiffGFC2PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2929    if(plotGFC2RelativeToMCRP) legendDiffFlowPtRP->AddEntry(gfcCommonHistRes2->GetHistDiffFlowPtRP(),entryDiffGFC2PtRP->Data(),"p");
2930   }
2931   if(plotGFC4PtRP && gfcCommonHistRes4)
2932   {
2933    entryDiffGFC4PtRP->Append("M = ");
2934    (*entryDiffGFC4PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2935    entryDiffGFC4PtRP->Append(", N = ");
2936    (*entryDiffGFC4PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2937    if(plotGFC4RelativeToMCRP) legendDiffFlowPtRP->AddEntry(gfcCommonHistRes4->GetHistDiffFlowPtRP(),entryDiffGFC4PtRP->Data(),"p");
2938   }
2939   if(plotGFC6PtRP && gfcCommonHistRes6)
2940   {
2941    entryDiffGFC6PtRP->Append("M = ");
2942    (*entryDiffGFC6PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2943    entryDiffGFC6PtRP->Append(", N = ");
2944    (*entryDiffGFC6PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2945    if(plotGFC6RelativeToMCRP) legendDiffFlowPtRP->AddEntry(gfcCommonHistRes6->GetHistDiffFlowPtRP(),entryDiffGFC6PtRP->Data(),"p");
2946   } 
2947   if(plotGFC8PtRP && gfcCommonHistRes8)
2948   {
2949    entryDiffGFC8PtRP->Append("M = ");
2950    (*entryDiffGFC8PtRP)+=(Long_t)avMultDiffFlowGFCRP;
2951    entryDiffGFC8PtRP->Append(", N = ");
2952    (*entryDiffGFC8PtRP)+=(Long_t)nEvtsDiffFlowGFCRP; 
2953    if(plotGFC8RelativeToMCRP) legendDiffFlowPtRP->AddEntry(gfcCommonHistRes8->GetHistDiffFlowPtRP(),entryDiffGFC8PtRP->Data(),"p");
2954   }  
2955   
2956   //QC
2957   if(plotQC2PtRP && qcCommonHistRes2)
2958   {
2959    entryDiffQC2PtRP->Append("M = ");
2960    (*entryDiffQC2PtRP)+=(Long_t)avMultDiffFlowQC2RP;
2961    entryDiffQC2PtRP->Append(", N = ");
2962    (*entryDiffQC2PtRP)+=(Long_t)nEvtsDiffFlowQC2RP; 
2963    if(plotQC2RelativeToMCRP) legendDiffFlowPtRP->AddEntry(qcCommonHistRes2->GetHistDiffFlowPtRP(),entryDiffQC2PtRP->Data(),"p");
2964   }
2965   if(plotQC4PtRP && qcCommonHistRes4)
2966   {
2967    entryDiffQC4PtRP->Append("M = ");
2968    (*entryDiffQC4PtRP)+=(Long_t)avMultDiffFlowQC4RP;
2969    entryDiffQC4PtRP->Append(", N = ");
2970    (*entryDiffQC4PtRP)+=(Long_t)nEvtsDiffFlowQC4RP; 
2971    if(plotQC4RelativeToMCRP) legendDiffFlowPtRP->AddEntry(qcCommonHistRes4->GetHistDiffFlowPtRP(),entryDiffQC4PtRP->Data(),"p");
2972   }
2973   if(plotQC6PtRP && qcCommonHistRes6)
2974   {
2975    entryDiffQC6PtRP->Append("M = ");
2976    (*entryDiffQC6PtRP)+=(Long_t)avMultDiffFlowQC6RP;
2977    entryDiffQC6PtRP->Append(", N = ");
2978    (*entryDiffQC6PtRP)+=(Long_t)nEvtsDiffFlowQC6RP; 
2979    if(plotQC6RelativeToMCRP) legendDiffFlowPtRP->AddEntry(qcCommonHistRes6->GetHistDiffFlowPtRP(),entryDiffQC6PtRP->Data(),"p");
2980   }
2981   if(plotQC8PtRP && qcCommonHistRes8)
2982   {
2983    entryDiffQC8PtRP->Append("M = ");
2984    (*entryDiffQC8PtRP)+=(Long_t)avMultDiffFlowQC8RP;
2985    entryDiffQC8PtRP->Append(", N = ");
2986    (*entryDiffQC8PtRP)+=(Long_t)nEvtsDiffFlowQC8RP; 
2987    if(plotQC8RelativeToMCRP) legendDiffFlowPtRP->AddEntry(qcCommonHistRes8->GetHistDiffFlowPtRP(),entryDiffQC8PtRP->Data(),"p");
2988   }
2989   
2990   //LYZ2SUM
2991   if(plotLYZ2SUMPtRP && lyz2sumCommonHistRes)
2992   {
2993    entryDiffLYZ2SUMPtRP->Append("M = ");
2994    (*entryDiffLYZ2SUMPtRP)+=(Long_t)avMultDiffFlowLYZ2SUMRP;
2995    entryDiffLYZ2SUMPtRP->Append(", N = ");
2996    (*entryDiffLYZ2SUMPtRP)+=(Long_t)nEvtsDiffFlowLYZ2SUMRP; 
2997    if(plotLYZ2SUMRelativeToMCRP) legendDiffFlowPtRP->AddEntry(lyz2sumCommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZ2SUMPtRP->Data(),"p");
2998   }
2999   
3000   //LYZ2PROD
3001   if(plotLYZ2PRODPtRP && lyz2prodCommonHistRes)
3002   {
3003    entryDiffLYZ2PRODPtRP->Append("M = ");
3004    (*entryDiffLYZ2PRODPtRP)+=(Long_t)avMultDiffFlowLYZ2PRODRP;
3005    entryDiffLYZ2PRODPtRP->Append(", N = ");
3006    (*entryDiffLYZ2PRODPtRP)+=(Long_t)nEvtsDiffFlowLYZ2PRODRP; 
3007    if(plotLYZ2PRODRelativeToMCRP) legendDiffFlowPtRP->AddEntry(lyz2prodCommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZ2PRODPtRP->Data(),"p");
3008   }
3009   
3010   //LYZEP
3011   if(plotLYZEPPtRP && lyzepCommonHistRes)
3012   {
3013    entryDiffLYZEPPtRP->Append("M = ");
3014    (*entryDiffLYZEPPtRP)+=(Long_t)avMultDiffFlowLYZEPRP;
3015    entryDiffLYZEPPtRP->Append(", N = ");
3016    (*entryDiffLYZEPPtRP)+=(Long_t)nEvtsDiffFlowLYZEPRP; 
3017    if(plotLYZEPRelativeToMCRP) legendDiffFlowPtRP->AddEntry(lyzepCommonHistRes->GetHistDiffFlowPtRP(),entryDiffLYZEPPtRP->Data(),"p");
3018   }
3019
3020   //drawing finally the legend in the 2nd pad:         
3021   if(textDefault) textDefault->Draw();
3022   
3023   if(legendDiffFlowPtRP)
3024   {
3025    legendDiffFlowPtRP->SetMargin(0.15);
3026    legendDiffFlowPtRP->Draw();
3027   } 
3028  } 
3029  //----------------------------------------------------------------------------------
3030  
3031  //----------------------------------------------------------------------------------
3032  //final drawing for differential flow (Pt, POI):
3033  if(plotDiffFlowPtPOI)
3034  {
3035   TCanvas* diffFlowPtAllCanvasPOI = new TCanvas("Differential Flow (Pt) of POI","Differential Flow (Pt) of POI ",1000,600);
3036  
3037   diffFlowPtAllCanvasPOI->Divide(2,1);
3038  
3039   //1st pad is for plot:
3040   (diffFlowPtAllCanvasPOI->cd(1))->SetPad(0.0,0.0,0.75,1.0);
3041   
3042   if(styleHistPt)
3043   {
3044    (styleHistPt->GetYaxis())->SetRangeUser(-0.3,1.0);
3045    styleHistPt->Draw();
3046   }
3047   if(pMeshDiffFlowPtPOI)
3048   {
3049    pMeshDiffFlowPtPOI->Draw("LFSAME");
3050   }
3051  
3052   //MC 
3053   if(plotMCPtPOI && mcepCommonHistRes)
3054   { 
3055    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3056   }
3057   //SP 
3058   if(plotSPPtPOI && spCommonHistRes)
3059   { 
3060    (spCommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3061   }
3062   //GFC
3063   if(plotGFC2PtPOI && gfcCommonHistRes2)
3064   { 
3065    (gfcCommonHistRes2->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
3066   } 
3067   if(plotGFC4PtPOI && gfcCommonHistRes4)
3068   { 
3069    (gfcCommonHistRes4->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
3070   } 
3071   if(plotGFC6PtPOI && gfcCommonHistRes6)
3072   { 
3073    (gfcCommonHistRes6->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
3074   } 
3075   if(plotGFC8PtPOI && gfcCommonHistRes8)
3076   { 
3077    (gfcCommonHistRes8->GetHistDiffFlowPtPOI())->Draw("E1PSAME"); 
3078   }    
3079   //QC
3080   if(plotQC2PtPOI && qcCommonHistRes2)
3081   { 
3082    (qcCommonHistRes2->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3083   }
3084   if(plotQC4PtPOI && qcCommonHistRes4)
3085   { 
3086    (qcCommonHistRes4->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3087   }
3088   if(plotQC6PtPOI && qcCommonHistRes6)
3089   { 
3090    //(qcCommonHistRes6->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3091   }
3092   if(plotQC8PtPOI && qcCommonHistRes8)
3093   { 
3094    //(qcCommonHistRes8->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3095   }
3096   //LYZ2SUM
3097   if(plotLYZ2SUMPtPOI && lyz2sumCommonHistRes)
3098   { 
3099    (lyz2sumCommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3100   }
3101   //LYZ2PROD
3102   if(plotLYZ2PRODPtPOI && lyz2prodCommonHistRes)
3103   { 
3104    (lyz2prodCommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3105   }
3106   //LYZEP
3107   if(plotLYZEPPtPOI && lyzepCommonHistRes)
3108   { 
3109    (lyzepCommonHistRes->GetHistDiffFlowPtPOI())->Draw("E1PSAME");
3110   }
3111  
3112   //2nd pad is for legend:
3113   (diffFlowPtAllCanvasPOI->cd(2))->SetPad(0.75,0.0,1.0,1.0);
3114
3115   TLegend* legendDiffFlowPtPOI = new TLegend(0.02,0.12,0.97,0.70);
3116   legendDiffFlowPtPOI->SetTextFont(72);
3117   legendDiffFlowPtPOI->SetTextSize(0.06);
3118  
3119   //legend's entries:
3120   TString *entryDiffMCPtPOI       = new TString("MC ........ ");
3121   TString *entryDiffSPPtPOI       = new TString("SP ........ ");
3122   TString *entryDiffGFC2PtPOI     = new TString("GFC{2} .... ");
3123   TString *entryDiffGFC4PtPOI     = new TString("GFC{4} .... ");
3124   TString *entryDiffGFC6PtPOI     = new TString("GFC{6} .... ");
3125   TString *entryDiffGFC8PtPOI     = new TString("GFC{8} .... "); 
3126   TString *entryDiffQC2PtPOI      = new TString("QC{2} ..... ");
3127   TString *entryDiffQC4PtPOI      = new TString("QC{4} ..... ");
3128   TString *entryDiffQC6PtPOI      = new TString("QC{6} ..... ");
3129   TString *entryDiffQC8PtPOI      = new TString("QC{8} ..... ");
3130   TString *entryDiffLYZ2SUMPtPOI  = new TString("LYZ{sum} .. ");
3131   TString *entryDiffLYZ2PRODPtPOI = new TString("LYZ{prod} . ");
3132   TString *entryDiffLYZEPPtPOI    = new TString("LYZEP ..... "); 
3133  
3134   //MC
3135   if(mcepCommonHistRes)
3136   {
3137    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetFillStyle(meshStyleDiffFlowPtPOI);
3138    (mcepCommonHistRes->GetHistDiffFlowPtPOI())->SetFillColor(meshColorDiffFlowPtPOI);
3139    entryDiffMCPtPOI->Append("M = ");
3140    (*entryDiffMCPtPOI)+=(Long_t)avMultDiffFlowMCPOI;
3141    entryDiffMCPtPOI->Append(", N = ");
3142    (*entryDiffMCPtPOI)+=(Long_t)nEvtsDiffFlowMCPOI; 
3143    legendDiffFlowPtPOI->AddEntry(mcepCommonHistRes->GetHistDiffFlowPtPOI(),entryDiffMCPtPOI->Data(),"f");
3144   }
3145   
3146   //SP
3147   if(plotSPPtPOI && spCommonHistRes)
3148   {
3149    entryDiffSPPtPOI->Append("M = ");
3150    (*entryDiffSPPtPOI)+=(Long_t)avMultDiffFlowSPPOI;
3151    entryDiffSPPtPOI->Append(", N = ");
3152    (*entryDiffSPPtPOI)+=(Long_t)nEvtsDiffFlowSPPOI; 
3153    legendDiffFlowPtPOI->AddEntry(spCommonHistRes->GetHistDiffFlowPtPOI(),entryDiffSPPtPOI->Data(),"p");
3154   }
3155
3156   //GFC
3157   if(plotGFC2PtPOI && gfcCommonHistRes2)
3158   {
3159    entryDiffGFC2PtPOI->Append("M = ");
3160    (*entryDiffGFC2PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3161    entryDiffGFC2PtPOI->Append(", N = ");
3162    (*entryDiffGFC2PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3163    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes2->GetHistDiffFlowPtPOI(),entryDiffGFC2PtPOI->Data(),"p");
3164   }
3165   if(plotGFC4PtPOI && gfcCommonHistRes4)
3166   {
3167    entryDiffGFC4PtPOI->Append("M = ");
3168    (*entryDiffGFC4PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3169    entryDiffGFC4PtPOI->Append(", N = ");
3170    (*entryDiffGFC4PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3171    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes4->GetHistDiffFlowPtPOI(),entryDiffGFC4PtPOI->Data(),"p");
3172   }
3173   if(plotGFC6PtPOI && gfcCommonHistRes6)
3174   {
3175    entryDiffGFC6PtPOI->Append("M = ");
3176    (*entryDiffGFC6PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3177    entryDiffGFC6PtPOI->Append(", N = ");
3178    (*entryDiffGFC6PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3179    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes6->GetHistDiffFlowPtPOI(),entryDiffGFC6PtPOI->Data(),"p");
3180   } 
3181   if(plotGFC8PtPOI && gfcCommonHistRes8)
3182   {
3183    entryDiffGFC8PtPOI->Append("M = ");
3184    (*entryDiffGFC8PtPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3185    entryDiffGFC8PtPOI->Append(", N = ");
3186    (*entryDiffGFC8PtPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3187    legendDiffFlowPtPOI->AddEntry(gfcCommonHistRes8->GetHistDiffFlowPtPOI(),entryDiffGFC8PtPOI->Data(),"p");
3188   }  
3189   
3190   //QC
3191   if(plotQC2PtPOI && qcCommonHistRes2)
3192   {
3193    entryDiffQC2PtPOI->Append("M = ");
3194    (*entryDiffQC2PtPOI)+=(Long_t)avMultDiffFlowQC2POI;
3195    entryDiffQC2PtPOI->Append(", N = ");
3196    (*entryDiffQC2PtPOI)+=(Long_t)nEvtsDiffFlowQC2POI; 
3197    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes2->GetHistDiffFlowPtPOI(),entryDiffQC2PtPOI->Data(),"p");
3198   }
3199   if(plotQC4PtPOI && qcCommonHistRes4)
3200   {
3201    entryDiffQC4PtPOI->Append("M = ");
3202    (*entryDiffQC4PtPOI)+=(Long_t)avMultDiffFlowQC4POI;
3203    entryDiffQC4PtPOI->Append(", N = ");
3204    (*entryDiffQC4PtPOI)+=(Long_t)nEvtsDiffFlowQC4POI; 
3205    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes4->GetHistDiffFlowPtPOI(),entryDiffQC4PtPOI->Data(),"p");
3206   }
3207   if(plotQC6PtPOI && qcCommonHistRes6)
3208   {
3209    entryDiffQC6PtPOI->Append("M = ");
3210    (*entryDiffQC6PtPOI)+=(Long_t)avMultDiffFlowQC6POI;
3211    entryDiffQC6PtPOI->Append(", N = ");
3212    (*entryDiffQC6PtPOI)+=(Long_t)nEvtsDiffFlowQC6POI; 
3213    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes6->GetHistDiffFlowPtPOI(),entryDiffQC6PtPOI->Data(),"p");
3214   }
3215   if(plotQC8PtPOI && qcCommonHistRes8)
3216   {
3217    entryDiffQC8PtPOI->Append("M = ");
3218    (*entryDiffQC8PtPOI)+=(Long_t)avMultDiffFlowQC8POI;
3219    entryDiffQC8PtPOI->Append(", N = ");
3220    (*entryDiffQC8PtPOI)+=(Long_t)nEvtsDiffFlowQC8POI; 
3221    legendDiffFlowPtPOI->AddEntry(qcCommonHistRes8->GetHistDiffFlowPtPOI(),entryDiffQC8PtPOI->Data(),"p");
3222   }
3223  
3224   //LYZ2SUM
3225   if(plotLYZ2SUMPtPOI && lyz2sumCommonHistRes)
3226   {
3227    entryDiffLYZ2SUMPtPOI->Append("M = ");
3228    (*entryDiffLYZ2SUMPtPOI)+=(Long_t)avMultDiffFlowLYZ2SUMPOI;
3229    entryDiffLYZ2SUMPtPOI->Append(", N = ");
3230    (*entryDiffLYZ2SUMPtPOI)+=(Long_t)nEvtsDiffFlowLYZ2SUMPOI; 
3231    legendDiffFlowPtPOI->AddEntry(lyz2sumCommonHistRes->GetHistDiffFlowPtPOI(),entryDiffLYZ2SUMPtPOI->Data(),"p");
3232   }
3233   
3234   //LYZ2PROD
3235   if(plotLYZ2PRODPtPOI && lyz2prodCommonHistRes)
3236   {
3237    entryDiffLYZ2PRODPtPOI->Append("M = ");
3238    (*entryDiffLYZ2PRODPtPOI)+=(Long_t)avMultDiffFlowLYZ2PRODPOI;
3239    entryDiffLYZ2PRODPtPOI->Append(", N = ");
3240    (*entryDiffLYZ2PRODPtPOI)+=(Long_t)nEvtsDiffFlowLYZ2PRODPOI; 
3241    legendDiffFlowPtPOI->AddEntry(lyz2prodCommonHistRes->GetHistDiffFlowPtPOI(),entryDiffLYZ2PRODPtPOI->Data(),"p");
3242   }
3243   
3244   //LYZEP
3245   if(plotLYZEPPtPOI && lyzepCommonHistRes)
3246   {
3247    entryDiffLYZEPPtPOI->Append("M = ");
3248    (*entryDiffLYZEPPtPOI)+=(Long_t)avMultDiffFlowLYZEPPOI;
3249    entryDiffLYZEPPtPOI->Append(", N = ");
3250    (*entryDiffLYZEPPtPOI)+=(Long_t)nEvtsDiffFlowLYZEPPOI; 
3251    legendDiffFlowPtPOI->AddEntry(lyzepCommonHistRes->GetHistDiffFlowPtPOI(),entryDiffLYZEPPtPOI->Data(),"p");
3252   }
3253
3254   //drawing finally the legend in the 2nd pad: 
3255   if(textDefault) textDefault->Draw();
3256           
3257   if(legendDiffFlowPtPOI)
3258   {
3259    legendDiffFlowPtPOI->SetMargin(0.15);
3260    legendDiffFlowPtPOI->Draw();
3261   }
3262  }//end of if(plotDiffFlowPtPOI)
3263  //----------------------------------------------------------------------------------
3264
3265
3266  //----------------------------------------------------------------------------------
3267  //final drawing for differential flow (Eta, POI):
3268  if(plotDiffFlowEtaPOI)
3269  {
3270   TCanvas* diffFlowEtaAllCanvasPOI = new TCanvas("Differential Flow (Eta) of POI","Differential Flow (Eta) of POI ",1000,600);
3271  
3272   diffFlowEtaAllCanvasPOI->Divide(2,1);
3273   
3274   //1st pad is for plot:
3275   (diffFlowEtaAllCanvasPOI->cd(1))->SetPad(0.0,0.0,0.75,1.0);
3276  
3277   if(styleHistEta)
3278   {
3279    (styleHistEta->GetYaxis())->SetRangeUser(-0.3,1.0);
3280    styleHistEta->Draw();
3281   }
3282   if(pMeshDiffFlowEtaPOI)
3283   {
3284    pMeshDiffFlowEtaPOI->Draw("LFSAME");
3285   }
3286  
3287   //MC 
3288   if(plotMCEtaPOI && mcepCommonHistRes)
3289   { 
3290    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3291   }
3292   //SP 
3293   if(plotSPEtaPOI && spCommonHistRes)
3294   { 
3295    (spCommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3296   }
3297   //GFC
3298   if(plotGFC2EtaPOI && gfcCommonHistRes2)
3299   { 
3300    (gfcCommonHistRes2->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
3301   } 
3302   if(plotGFC4EtaPOI && gfcCommonHistRes4)
3303   { 
3304    (gfcCommonHistRes4->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
3305   } 
3306   if(plotGFC6EtaPOI && gfcCommonHistRes6)
3307   { 
3308    (gfcCommonHistRes6->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
3309   } 
3310   if(plotGFC8EtaPOI && gfcCommonHistRes8)
3311   { 
3312    (gfcCommonHistRes8->GetHistDiffFlowEtaPOI())->Draw("E1PSAME"); 
3313   }    
3314   //QC
3315   if(plotQC2EtaPOI && qcCommonHistRes2)
3316   { 
3317    (qcCommonHistRes2->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3318   }
3319   if(plotQC4EtaPOI && qcCommonHistRes4)
3320   { 
3321    (qcCommonHistRes4->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3322   }
3323   if(plotQC6EtaPOI && qcCommonHistRes6)
3324   { 
3325    //(qcCommonHistRes6->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3326   }
3327   if(plotQC8EtaPOI && qcCommonHistRes8)
3328   { 
3329    //(qcCommonHistRes8->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3330   }
3331   //LYZ2SUM
3332   if(plotLYZ2SUMEtaPOI && lyz2sumCommonHistRes)
3333   { 
3334    (lyz2sumCommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3335   }
3336   //LYZ2PROD
3337   if(plotLYZ2PRODEtaPOI && lyz2prodCommonHistRes)
3338   { 
3339    (lyz2prodCommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3340   }
3341   //LYZEP
3342   if(plotLYZEPEtaPOI && lyzepCommonHistRes)
3343   { 
3344    (lyzepCommonHistRes->GetHistDiffFlowEtaPOI())->Draw("E1PSAME");
3345   }
3346  
3347   //2nd pad is for legend:
3348   (diffFlowEtaAllCanvasPOI->cd(2))->SetPad(0.75,0.0,1.0,1.0);
3349  
3350   TLegend* legendDiffFlowEtaPOI = new TLegend(0.02,0.12,0.97,0.70);
3351   legendDiffFlowEtaPOI->SetTextFont(72);
3352   legendDiffFlowEtaPOI->SetTextSize(0.06);
3353  
3354   //legend's entries:
3355   TString *entryDiffMCEtaPOI       = new TString("MC ........ ");
3356   TString *entryDiffSPEtaPOI       = new TString("SP ........ ");
3357   TString *entryDiffGFC2EtaPOI     = new TString("GFC{2} .... ");
3358   TString *entryDiffGFC4EtaPOI     = new TString("GFC{4} .... ");
3359   TString *entryDiffGFC6EtaPOI     = new TString("GFC{6} .... ");
3360   TString *entryDiffGFC8EtaPOI     = new TString("GFC{8} .... "); 
3361   TString *entryDiffQC2EtaPOI      = new TString("QC{2} ..... ");
3362   TString *entryDiffQC4EtaPOI      = new TString("QC{4} ..... ");
3363   TString *entryDiffQC6EtaPOI      = new TString("QC{6} ..... ");
3364   TString *entryDiffQC8EtaPOI      = new TString("QC{8} ..... ");
3365   TString *entryDiffLYZ2SUMEtaPOI  = new TString("LYZ{sum} .. ");
3366   TString *entryDiffLYZ2PRODEtaPOI = new TString("LYZ{prod} . ");
3367   TString *entryDiffLYZEPEtaPOI    = new TString("LYZEP ..... ");
3368  
3369   //MC
3370   if(mcepCommonHistRes)
3371   {
3372    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetFillStyle(meshStyleDiffFlowEtaPOI);
3373    (mcepCommonHistRes->GetHistDiffFlowEtaPOI())->SetFillColor(meshColorDiffFlowEtaPOI);
3374    entryDiffMCEtaPOI->Append("M = ");
3375    (*entryDiffMCEtaPOI)+=(Long_t)avMultDiffFlowMCPOI;
3376    entryDiffMCEtaPOI->Append(", N = ");
3377    (*entryDiffMCEtaPOI)+=(Long_t)nEvtsDiffFlowMCPOI; 
3378    legendDiffFlowEtaPOI->AddEntry(mcepCommonHistRes->GetHistDiffFlowEtaPOI(),entryDiffMCEtaPOI->Data(),"f");
3379   }
3380   
3381   //SP
3382   if(plotSPEtaPOI && spCommonHistRes)
3383   {
3384    entryDiffSPEtaPOI->Append("M = ");
3385    (*entryDiffSPEtaPOI)+=(Long_t)avMultDiffFlowSPPOI;
3386    entryDiffSPEtaPOI->Append(", N = ");
3387    (*entryDiffSPEtaPOI)+=(Long_t)nEvtsDiffFlowSPPOI; 
3388    legendDiffFlowEtaPOI->AddEntry(spCommonHistRes->GetHistDiffFlowEtaPOI(),entryDiffSPEtaPOI->Data(),"p");
3389   }
3390
3391   //GFC
3392   if(plotGFC2EtaPOI && gfcCommonHistRes2)
3393   {
3394    entryDiffGFC2EtaPOI->Append("M = ");
3395    (*entryDiffGFC2EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3396    entryDiffGFC2EtaPOI->Append(", N = ");
3397    (*entryDiffGFC2EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3398    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes2->GetHistDiffFlowEtaPOI(),entryDiffGFC2EtaPOI->Data(),"p");
3399   }
3400   if(plotGFC4EtaPOI && gfcCommonHistRes4)
3401   {
3402    entryDiffGFC4EtaPOI->Append("M = ");
3403    (*entryDiffGFC4EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3404    entryDiffGFC4EtaPOI->Append(", N = ");
3405    (*entryDiffGFC4EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3406    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes4->GetHistDiffFlowEtaPOI(),entryDiffGFC4EtaPOI->Data(),"p");
3407   }
3408   if(plotGFC6EtaPOI && gfcCommonHistRes6)
3409   {
3410    entryDiffGFC6EtaPOI->Append("M = ");
3411    (*entryDiffGFC6EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3412    entryDiffGFC6EtaPOI->Append(", N = ");
3413    (*entryDiffGFC6EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3414    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes6->GetHistDiffFlowEtaPOI(),entryDiffGFC6EtaPOI->Data(),"p");
3415   } 
3416   if(plotGFC8EtaPOI && gfcCommonHistRes8)
3417   {
3418    entryDiffGFC8EtaPOI->Append("M = ");
3419    (*entryDiffGFC8EtaPOI)+=(Long_t)avMultDiffFlowGFCPOI;
3420    entryDiffGFC8EtaPOI->Append(", N = ");
3421    (*entryDiffGFC8EtaPOI)+=(Long_t)nEvtsDiffFlowGFCPOI; 
3422    legendDiffFlowEtaPOI->AddEntry(gfcCommonHistRes8->GetHistDiffFlowEtaPOI(),entryDiffGFC8EtaPOI->Data(),"p");
3423   }  
3424  
3425   //QC
3426   if(plotQC2EtaPOI && qcCommonHistRes2)
3427   {
3428    entryDiffQC2EtaPOI->Append("M = ");
3429    (*entryDiffQC2EtaPOI)+=(Long_t)avMultDiffFlowQC2POI;
3430    entryDiffQC2EtaPOI->Append(", N = ");