simplified code
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowTasks / AliAnalysisTaskQCumulants.cxx
1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
6 *                                                                        *
7 * Permission to use, copy, modify and distribute this software and its   *
8 * documentation strictly for non-commercial purposes is hereby granted   *
9 * without fee, provided that the above copyright notice appears in all   *
10 * copies and that both the copyright notice and this permission notice   *
11 * appear in the supporting documentation. The authors make no claims     *
12 * about the suitability of this software for any purpose. It is          *
13 * provided "as is" without express or implied warranty.                  * 
14 **************************************************************************/
15
16 /**************************************
17  * analysis task for Q-cumulants      * 
18  *                                    * 
19  * authors: Naomi van der Kolk        *
20  *           (kolk@nikhef.nl)         *  
21  *          Raimond Snellings         *
22  *           (snelling@nikhef.nl)     * 
23  *          Ante Bilandzic            *
24  *           (anteb@nikhef.nl)        * 
25  * ***********************************/
26  
27 #include "Riostream.h"
28 #include "TChain.h"
29 #include "TTree.h"
30 #include "TFile.h"
31 #include "TList.h"
32 #include "TH1.h"
33 #include "TGraph.h"
34 #include "TProfile.h"
35 #include "TProfile2D.h"
36 #include "TProfile3D.h"
37 #include "TBits.h"
38
39 #include "AliAnalysisTask.h"
40 #include "AliAnalysisDataSlot.h"
41 #include "AliAnalysisDataContainer.h"
42 #include "AliAnalysisManager.h"
43
44 #include "AliFlowEventSimple.h"
45 #include "AliAnalysisTaskQCumulants.h"
46 #include "AliFlowAnalysisWithQCumulants.h"
47 #include "AliFlowCumuConstants.h"
48 #include "AliFlowCommonConstants.h"
49 #include "AliFlowCommonHist.h"
50 #include "AliFlowCommonHistResults.h"
51
52 ClassImp(AliAnalysisTaskQCumulants)
53
54 //================================================================================================================
55
56 AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t useWeights): 
57  AliAnalysisTask(name,""), 
58  fEvent(NULL),
59  fQCA(NULL), // Q-cumulant Analysis (QCA) object
60  fListHistos(NULL),
61  fUseWeights(useWeights),
62  fUsePhiWeights(kFALSE),
63  fUsePtWeights(kFALSE),
64  fUseEtaWeights(kFALSE),
65  fListWeights(NULL)
66 {
67  // constructor
68  cout<<"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name)"<<endl;
69  
70  // Define input and output slots here
71  // Input slot #0 works with a TChain
72  DefineInput(0, AliFlowEventSimple::Class());
73   
74  // Input slot #1 is needed for the weights 
75  if(useWeights)
76  {
77   DefineInput(1, TList::Class());   
78  }
79         
80  // Output slot #0 writes into a TList container
81  DefineOutput(0, TList::Class());  
82  
83 }
84
85 AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(): 
86  fEvent(NULL),
87  fQCA(NULL),//Q-cumulant Analysis (QCA) object
88  fListHistos(NULL),
89  fUseWeights(kFALSE),
90  fUsePhiWeights(kFALSE),
91  fUsePtWeights(kFALSE),
92  fUseEtaWeights(kFALSE),
93  fListWeights(NULL)
94 {
95  // dummy constructor
96  cout<<"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants()"<<endl;
97 }
98
99 //================================================================================================================
100
101 void AliAnalysisTaskQCumulants::ConnectInputData(Option_t *) 
102 {
103  // connect ESD or AOD (called once)
104  cout<<"AliAnalysisTaskQCumulants::ConnectInputData(Option_t *)"<<endl;
105 }
106
107 //================================================================================================================
108
109 void AliAnalysisTaskQCumulants::CreateOutputObjects() 
110 {
111  // called at every worker node to initialize
112  cout<<"AliAnalysisTaskQCumulants::CreateOutputObjects()"<<endl;
113
114  // analyser
115  fQCA = new AliFlowAnalysisWithQCumulants();
116  fQCA->Init();
117  
118  //weights:
119  if(fUseWeights)
120  {
121   //pass the flags to class:
122   if(fUsePhiWeights) fQCA->SetUsePhiWeights(fUsePhiWeights);
123   if(fUsePtWeights) fQCA->SetUsePtWeights(fUsePtWeights);
124   if(fUseEtaWeights) fQCA->SetUseEtaWeights(fUseEtaWeights);
125   //get data from input slot #1 which is used for weights:
126   if(GetNinputs()==2) 
127   {                   
128    fListWeights = (TList*)GetInputData(1); 
129   }
130   //pass the list with weights to class:
131   if(fListWeights) fQCA->SetWeightsList(fListWeights);
132  }
133  
134  if(fQCA->GetHistList()) 
135  {
136   fListHistos = fQCA->GetHistList();
137   //fListHistos->Print();
138  }
139  else 
140  {
141   Printf(" ERROR: Could not retrieve histogram list (QC, Task::COO)"); 
142  }
143
144  //PostData(0,fListHistos);
145  
146 }
147
148 //================================================================================================================
149
150 void AliAnalysisTaskQCumulants::Exec(Option_t *) 
151 {
152   // main loop (called for each event)
153  fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
154
155  // Q-cumulants
156  if(fEvent) 
157  {
158   fQCA->Make(fEvent);
159  }else 
160   {
161    cout<<" WARNING: No input data (QC, Task::E) !!!"<<endl;
162    cout<<endl;
163   }
164   
165  PostData(0,fListHistos);
166 }
167
168 //================================================================================================================
169
170 void AliAnalysisTaskQCumulants::Terminate(Option_t *) 
171 {
172  //accessing the output list which contains the merged 2D and 3D profiles from all worker nodes
173  fListHistos = (TList*)GetOutputData(0);
174  //fListHistos->Print();
175
176  if(fListHistos)
177  {      
178   // with or without weights
179   TBits *useWeightsBits = dynamic_cast<TBits*>(fListHistos->FindObject("TBits"));
180          
181   //final results (no-name integrated flow without weights)
182   TH1D *intFlowResultsQC = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fIntFlowResultsQC"));
183   
184   //final results (no-name integrated flow with weights)
185   TH1D *intFlowResultsQCW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fIntFlowResultsQCW"));
186   
187   //final results (POIs integrated flow without weights)
188   TH1D *intFlowResultsPOIQC = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fIntFlowResultsPOIQC"));
189   
190   //final results (POIs integrated flow with weights)
191   TH1D *intFlowResultsPOIQCW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fIntFlowResultsPOIQCW"));
192   
193   //final results (RPs integrated flow without weights)
194   TH1D *intFlowResultsRPQC = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fIntFlowResultsRPQC"));
195   
196   //final results (RPs integrated flow with weights)
197   TH1D *intFlowResultsRPQCW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fIntFlowResultsRPQCW"));
198   
199   //final results (differential flow)
200   TH1D *diffFlowResults2ndOrder = dynamic_cast<TH1D*>(fListHistos->FindObject("fDiffFlowResults2ndOrderQC"));
201   TH1D *diffFlowResults4thOrder = dynamic_cast<TH1D*>(fListHistos->FindObject("fDiffFlowResults4thOrderQC"));
202   
203   //final results for covariances (1st bin <2*4>-<2>*<4>, 2nd bin <2*6>-<2>*<6>, ...)
204   TH1D *covariances = dynamic_cast<TH1D*>(fListHistos->FindObject("fCovariances"));
205   
206   //common control histograms (taking into account only the events with 2 and more particles)  
207   AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fListHistos->FindObject("AliFlowCommonHist2ndOrderQC"));
208   
209   //common control histograms (taking into account only the events with 4 and more particles)  
210   AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fListHistos->FindObject("AliFlowCommonHist4thOrderQC"));
211   
212   //common control histograms (taking into account only the events with 6 and more particles)  
213   AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fListHistos->FindObject("AliFlowCommonHist6thOrderQC"));
214   
215   //common control histograms (taking into account only the events with 8 and more particles)  
216   AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fListHistos->FindObject("AliFlowCommonHist8thOrderQC"));
217   
218   //common histograms to store the final results for the 2nd order integrated and differential flow
219   AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>(fListHistos->FindObject("AliFlowCommonHistResults2ndOrderQC"));
220   
221   //common histograms to store the final results for the 4th order integrated and differential flow
222   AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>(fListHistos->FindObject("AliFlowCommonHistResults4thOrderQC"));
223   
224   //common histograms to store the final results for the 6th order integrated and differential flow
225   AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>(fListHistos->FindObject("AliFlowCommonHistResults6thOrderQC"));
226   
227   //common histograms to store the final results for the 8th order integrated and differential flow
228   AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>(fListHistos->FindObject("AliFlowCommonHistResults8thOrderQC"));
229   
230   //average selected multiplicity (for int. flow) 
231   TProfile *AvMult = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlowQC"));
232   
233   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
234   //                        !!!! to be removed !!!!
235   //profiles containing the Q-vectors from all events 
236   TProfile *qvectorForEachEventX = dynamic_cast<TProfile*>(fListHistos->FindObject("fQvectorForEachEventX"));
237   TProfile *qvectorForEachEventY = dynamic_cast<TProfile*>(fListHistos->FindObject("fQvectorForEachEventY"));  
238   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
239     
240   //multi-particle correlations calculated from Q-vectors
241   TProfile *qCorrelations = dynamic_cast<TProfile*>(fListHistos->FindObject("fQCorrelations"));
242   
243   //weighted multi-particle correlations calculated from Q-vectors
244   TProfile *qCorrelationsW = dynamic_cast<TProfile*>(fListHistos->FindObject("fQCorrelationsW"));
245   
246   //average of products: 1st bin: <2*4>, 2nd bin: <2*6>, ...
247   TProfile *QProduct = dynamic_cast<TProfile*>(fListHistos->FindObject("fQProduct"));
248   
249   //average 2- and 4-particle correlations per pt-bin 
250   TProfile *binnedPt2p1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerPtBin1n1nRP"));
251   TProfile *binnedPt4p1n1n1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerPtBin1n1n1n1nRP"));
252   
253   //average 2- and 4-particle correlations per eta-bin 
254   TProfile *binnedEta2p1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerEtaBin1n1nRP"));
255   TProfile *binnedEta4p1n1n1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerEtaBin1n1n1n1nRP"));  
256   
257   //average 2- and 4-particle correlations per pt-bin 
258   TProfile *binnedPt2p1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerPtBin1n1nPOI"));
259   TProfile *binnedPt4p1n1n1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerPtBin1n1n1n1nPOI"));
260   
261   //average 2- and 4-particle correlations per eta-bin 
262   TProfile *binnedEta2p1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerEtaBin1n1nPOI"));
263   TProfile *binnedEta4p1n1n1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerEtaBin1n1n1n1nPOI"));  
264   
265   //average 2- and 4-particle correlations per pt-bin 
266   TProfile *binnedWPt2p1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2WPerPtBin1n1nPOI"));
267   TProfile *binnedWPt4p1n1n1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4WPerPtBin1n1n1n1nPOI"));
268  
269   TProfile *binnedWEta2p1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2WPerEtaBin1n1nPOI"));
270   TProfile *binnedWEta4p1n1n1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4WPerEtaBin1n1n1n1nPOI"));
271   
272   TProfile *binnedWPt2p1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2WPerPtBin1n1nRP"));
273   TProfile *binnedWPt4p1n1n1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4WPerPtBin1n1n1n1nRP"));
274   
275   TProfile *binnedWEta2p1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2WPerEtaBin1n1nRP"));
276   TProfile *binnedWEta4p1n1n1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4WPerEtaBin1n1n1n1nRP"));
277   
278   //average values of Q-vector components (1st bin: <Q_x>, 2nd bin: <Q_y>, 3rd bin: <(Q_x)^2>, 4th bin: <(Q_y)^2>) 
279   TProfile *QVectorComponents = dynamic_cast<TProfile*>(fListHistos->FindObject("fQvectorComponents"));
280   
281   // multi-particle correlations calculated with nested loop (needed for int. flow)
282   TProfile *directCorrelations = dynamic_cast<TProfile*>(fListHistos->FindObject("fDirectCorrelations"));
283   
284   // multi-particle correlations calculated with nested loop (needed for weighted int. flow)
285   TProfile *directCorrelationsW = dynamic_cast<TProfile*>(fListHistos->FindObject("fDirectCorrelationsW"));
286   
287   // multi-particle correlations calculated with nested loop (needed for diff. flow)
288   TProfile *directCorrelationsDiffFlow = dynamic_cast<TProfile*>(fListHistos->FindObject("fDirectCorrelationsDiffFlow"));
289   
290   // multi-particle correlations calculated with nested loop (needed for int. flow)
291   TProfile *directCorrelationsDiffFlowW = dynamic_cast<TProfile*>(fListHistos->FindObject("fDirectCorrelationsDiffFlowW"));
292   
293   
294   
295   
296   
297   
298   // ...............................................................................................................................................
299   // non-weighted correlations for each (pt,eta) bin for POIs:
300   TProfile2D *twoPtEtaPOI   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2pPtEtaPOI"));
301   TProfile2D *fourPtEtaPOI  = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4pPtEtaPOI"));
302   TProfile2D *sixPtEtaPOI   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f6pPtEtaPOI"));
303   TProfile2D *eightPtEtaPOI = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f8pPtEtaPOI"));
304  
305   // non-weighted final results for differential flow for each for POIs:
306   // 3D (pt,eta)
307   TH2D *vn2ndPtEtaPOI = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtEtaPOI"));  
308   TH2D *vn4thPtEtaPOI = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtEtaPOI")); 
309   TH2D *vn6thPtEtaPOI = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtEtaPOI")); 
310   TH2D *vn8thPtEtaPOI = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtEtaPOI")); 
311   // 2D (pt)
312   TH1D *vn2ndPtPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtPOI"));  
313   TH1D *vn4thPtPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtPOI")); 
314   TH1D *vn6thPtPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtPOI")); 
315   TH1D *vn8thPtPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtPOI"));
316   // 2D (eta)
317   TH1D *vn2ndEtaPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndEtaPOI"));  
318   TH1D *vn4thEtaPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thEtaPOI")); 
319   TH1D *vn6thEtaPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thEtaPOI")); 
320   TH1D *vn8thEtaPOI = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thEtaPOI"));
321   
322   // weighted correlations for each (pt,eta) bin for POIs:
323   TProfile2D *twoPtEtaPOIW   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2pPtEtaPOIW"));
324   TProfile2D *fourPtEtaPOIW  = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4pPtEtaPOIW"));
325   TProfile2D *sixPtEtaPOIW   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f6pPtEtaPOIW"));
326   TProfile2D *eightPtEtaPOIW = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f8pPtEtaPOIW"));
327   
328   // weighted final results for differential flow for each for POIs:
329   // 3D (pt,eta)
330   TH2D *vn2ndPtEtaPOIW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtEtaPOIW"));  
331   TH2D *vn4thPtEtaPOIW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtEtaPOIW")); 
332   TH2D *vn6thPtEtaPOIW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtEtaPOIW")); 
333   TH2D *vn8thPtEtaPOIW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtEtaPOIW")); 
334   // 2D (pt)
335   TH1D *vn2ndPtPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtPOIW"));  
336   TH1D *vn4thPtPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtPOIW")); 
337   TH1D *vn6thPtPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtPOIW")); 
338   TH1D *vn8thPtPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtPOIW"));
339   // 2D (eta)
340   TH1D *vn2ndEtaPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndEtaPOIW"));  
341   TH1D *vn4thEtaPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thEtaPOIW")); 
342   TH1D *vn6thEtaPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thEtaPOIW")); 
343   TH1D *vn8thEtaPOIW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thEtaPOIW"));
344   
345   // non-weighted correlations for each (pt,eta) bin for RPs:
346   TProfile2D *twoPtEtaRP   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2pPtEtaRP"));
347   TProfile2D *fourPtEtaRP  = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4pPtEtaRP"));
348   TProfile2D *sixPtEtaRP   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f6pPtEtaRP"));
349   TProfile2D *eightPtEtaRP = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f8pPtEtaRP"));
350  
351   // non-weighted final results for differential flow for RPs:
352   // 3D (pt,eta)
353   TH2D *vn2ndPtEtaRP = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtEtaRP"));  
354   TH2D *vn4thPtEtaRP = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtEtaRP")); 
355   TH2D *vn6thPtEtaRP = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtEtaRP")); 
356   TH2D *vn8thPtEtaRP = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtEtaRP")); 
357   // 2D (pt)
358   TH1D *vn2ndPtRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtRP"));  
359   TH1D *vn4thPtRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtRP")); 
360   TH1D *vn6thPtRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtRP")); 
361   TH1D *vn8thPtRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtRP"));
362   // 2D (eta)
363   TH1D *vn2ndEtaRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndEtaRP"));  
364   TH1D *vn4thEtaRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thEtaRP")); 
365   TH1D *vn6thEtaRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thEtaRP")); 
366   TH1D *vn8thEtaRP = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thEtaRP"));
367   
368   // weighted correlations for each (pt,eta) bin for RPs:
369   TProfile2D *twoPtEtaRPW   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2pPtEtaRPW"));
370   TProfile2D *fourPtEtaRPW  = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4pPtEtaRPW"));
371   TProfile2D *sixPtEtaRPW   = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f6pPtEtaRPW"));
372   TProfile2D *eightPtEtaRPW = dynamic_cast<TProfile2D*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f8pPtEtaRPW"));
373   
374   // weighted final results for differential flow for RPs:
375   // 3D (pt,eta)
376   TH2D *vn2ndPtEtaRPW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtEtaRPW"));  
377   TH2D *vn4thPtEtaRPW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtEtaRPW")); 
378   TH2D *vn6thPtEtaRPW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtEtaRPW")); 
379   TH2D *vn8thPtEtaRPW = dynamic_cast<TH2D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtEtaRPW")); 
380   // 2D (pt)
381   TH1D *vn2ndPtRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndPtRPW"));  
382   TH1D *vn4thPtRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thPtRPW")); 
383   TH1D *vn6thPtRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thPtRPW")); 
384   TH1D *vn8thPtRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thPtRPW"));
385   // 2D (eta)
386   TH1D *vn2ndEtaRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn2ndEtaRPW"));  
387   TH1D *vn4thEtaRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn4thEtaRPW")); 
388   TH1D *vn6thEtaRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn6thEtaRPW")); 
389   TH1D *vn8thEtaRPW = dynamic_cast<TH1D*>((dynamic_cast<TList*>(fListHistos->FindObject("Results")))->FindObject("fvn8thEtaRPW"));
390   // ...............................................................................................................................................
391   
392   
393  
394   //----------------------------------------------------
395  
396   fQCA = new AliFlowAnalysisWithQCumulants();  
397  
398   fQCA->SetUseWeightsBits(useWeightsBits);
399   fQCA->SetIntFlowResults(intFlowResultsQC); 
400   fQCA->SetIntFlowResultsW(intFlowResultsQCW);
401   fQCA->SetIntFlowResultsPOI(intFlowResultsPOIQC); 
402   fQCA->SetIntFlowResultsPOIW(intFlowResultsPOIQCW); 
403   fQCA->SetIntFlowResultsRP(intFlowResultsRPQC); 
404   fQCA->SetIntFlowResultsRPW(intFlowResultsRPQCW); 
405
406   fQCA->SetDiffFlowResults2nd(diffFlowResults2ndOrder);
407   fQCA->SetDiffFlowResults4th(diffFlowResults4thOrder); 
408   fQCA->SetCovariances(covariances); 
409   
410   fQCA->SetCommonHists2nd(commonHist2nd); 
411   fQCA->SetCommonHists4th(commonHist4th);
412   fQCA->SetCommonHists6th(commonHist6th);
413   fQCA->SetCommonHists8th(commonHist8th);
414
415   fQCA->SetCommonHistsResults2nd(commonHistRes2nd); 
416   fQCA->SetCommonHistsResults4th(commonHistRes4th);
417   fQCA->SetCommonHistsResults6th(commonHistRes6th);
418   fQCA->SetCommonHistsResults8th(commonHistRes8th);
419  
420   fQCA->SetAverageMultiplicity(AvMult);
421   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
422   //             !!!! to be removed !!!!
423   fQCA->SetQvectorForEachEventX(qvectorForEachEventX);
424   fQCA->SetQvectorForEachEventY(qvectorForEachEventY);
425   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
426   fQCA->SetQCorrelations(qCorrelations);
427   fQCA->SetQCorrelationsW(qCorrelationsW);
428   fQCA->SetQProduct(QProduct);
429   fQCA->SetQVectorComponents(QVectorComponents);
430  
431   fQCA->SetTwo1n1nPerPtBinRP(binnedPt2p1n1nRP);
432   fQCA->SetFour1n1n1n1nPerPtBinRP(binnedPt4p1n1n1n1nRP);
433   
434   fQCA->SetTwo1n1nPerEtaBinRP(binnedEta2p1n1nRP);
435   fQCA->SetFour1n1n1n1nPerEtaBinRP(binnedEta4p1n1n1n1nRP); 
436   
437   fQCA->SetTwo1n1nPerPtBinPOI(binnedPt2p1n1nPOI);
438   fQCA->SetFour1n1n1n1nPerPtBinPOI(binnedPt4p1n1n1n1nPOI);
439   
440   fQCA->SetTwo1n1nPerEtaBinPOI(binnedEta2p1n1nPOI);
441   fQCA->SetFour1n1n1n1nPerEtaBinPOI(binnedEta4p1n1n1n1nPOI);    
442  
443   fQCA->SetTwo1n1nWPerPtBinPOI(binnedWPt2p1n1nPOI);
444   fQCA->SetFour1n1n1n1nWPerPtBinPOI(binnedWPt4p1n1n1n1nPOI);
445   
446   fQCA->SetTwo1n1nWPerEtaBinPOI(binnedWEta2p1n1nPOI);
447   fQCA->SetFour1n1n1n1nWPerEtaBinPOI(binnedWEta4p1n1n1n1nPOI);
448   
449   fQCA->SetTwo1n1nWPerPtBinRP(binnedWPt2p1n1nRP);
450   fQCA->SetFour1n1n1n1nWPerPtBinRP(binnedWPt4p1n1n1n1nRP);
451   
452   fQCA->SetTwo1n1nWPerEtaBinRP(binnedWEta2p1n1nRP);
453   fQCA->SetFour1n1n1n1nWPerEtaBinRP(binnedWEta4p1n1n1n1nRP);
454   
455   // nested loops results:
456   fQCA->SetDirectCorrelations(directCorrelations);
457   fQCA->SetDirectCorrelationsW(directCorrelationsW);
458   fQCA->SetDirectCorrelationsDiffFlow(directCorrelationsDiffFlow);
459   fQCA->SetDirectCorrelationsDiffFlowW(directCorrelationsDiffFlowW);
460   
461   // non-weighted correlations for each (pt,eta) bin for POIs:
462   fQCA->Set2pPtEtaPOI(twoPtEtaPOI);
463   fQCA->Set4pPtEtaPOI(fourPtEtaPOI);
464   fQCA->Set6pPtEtaPOI(sixPtEtaPOI);
465   fQCA->Set8pPtEtaPOI(eightPtEtaPOI);
466   
467   // non-weighted final results for differential flow for POIs:
468   // 3D (pt,eta)
469   fQCA->Setvn2ndPtEtaPOI(vn2ndPtEtaPOI);   
470   fQCA->Setvn4thPtEtaPOI(vn4thPtEtaPOI);  
471   fQCA->Setvn6thPtEtaPOI(vn6thPtEtaPOI);  
472   fQCA->Setvn8thPtEtaPOI(vn8thPtEtaPOI);   
473   // 2D (pt)
474   fQCA->Setvn2ndPtPOI(vn2ndPtPOI);   
475   fQCA->Setvn4thPtPOI(vn4thPtPOI);  
476   fQCA->Setvn6thPtPOI(vn6thPtPOI);  
477   fQCA->Setvn8thPtPOI(vn8thPtPOI);   
478   // 2D (eta)
479   fQCA->Setvn2ndEtaPOI(vn2ndEtaPOI);   
480   fQCA->Setvn4thEtaPOI(vn4thEtaPOI);  
481   fQCA->Setvn6thEtaPOI(vn6thEtaPOI);  
482   fQCA->Setvn8thEtaPOI(vn8thEtaPOI);   
483   
484   // weighted correlations for each (pt,eta) bin for POIs:
485   fQCA->Set2pPtEtaPOIW(twoPtEtaPOIW);
486   fQCA->Set4pPtEtaPOIW(fourPtEtaPOIW);
487   fQCA->Set6pPtEtaPOIW(sixPtEtaPOIW);
488   fQCA->Set8pPtEtaPOIW(eightPtEtaPOIW);
489   
490   // weighted final results for differential flow for POIs:
491   // 3D (pt,eta)
492   fQCA->Setvn2ndPtEtaPOIW(vn2ndPtEtaPOIW);   
493   fQCA->Setvn4thPtEtaPOIW(vn4thPtEtaPOIW);  
494   fQCA->Setvn6thPtEtaPOIW(vn6thPtEtaPOIW);  
495   fQCA->Setvn8thPtEtaPOIW(vn8thPtEtaPOIW); 
496   // 2D (pt)
497   fQCA->Setvn2ndPtPOIW(vn2ndPtPOIW);   
498   fQCA->Setvn4thPtPOIW(vn4thPtPOIW);  
499   fQCA->Setvn6thPtPOIW(vn6thPtPOIW);  
500   fQCA->Setvn8thPtPOIW(vn8thPtPOIW);   
501   // 2D (eta)
502   fQCA->Setvn2ndEtaPOIW(vn2ndEtaPOIW);   
503   fQCA->Setvn4thEtaPOIW(vn4thEtaPOIW);  
504   fQCA->Setvn6thEtaPOIW(vn6thEtaPOIW);  
505   fQCA->Setvn8thEtaPOIW(vn8thEtaPOIW);     
506   
507   // non-weighted correlations for each (pt,eta) bin for RPs:
508   fQCA->Set2pPtEtaRP(twoPtEtaRP);
509   fQCA->Set4pPtEtaRP(fourPtEtaRP);
510   fQCA->Set6pPtEtaRP(sixPtEtaRP);
511   fQCA->Set8pPtEtaRP(eightPtEtaRP);
512   
513   // non-weighted final results for differential flow for RPs:
514   // 3D (pt,eta)
515   fQCA->Setvn2ndPtEtaRP(vn2ndPtEtaRP);   
516   fQCA->Setvn4thPtEtaRP(vn4thPtEtaRP);  
517   fQCA->Setvn6thPtEtaRP(vn6thPtEtaRP);  
518   fQCA->Setvn8thPtEtaRP(vn8thPtEtaRP);  
519   // 2D (pt)
520   fQCA->Setvn2ndPtRP(vn2ndPtRP);   
521   fQCA->Setvn4thPtRP(vn4thPtRP);  
522   fQCA->Setvn6thPtRP(vn6thPtRP);  
523   fQCA->Setvn8thPtRP(vn8thPtRP);   
524   // 2D (eta)
525   fQCA->Setvn2ndEtaRP(vn2ndEtaRP);   
526   fQCA->Setvn4thEtaRP(vn4thEtaRP);  
527   fQCA->Setvn6thEtaRP(vn6thEtaRP);  
528   fQCA->Setvn8thEtaRP(vn8thEtaRP);      
529   
530   // weighted correlations for each (pt,eta) bin for RPs:
531   fQCA->Set2pPtEtaRPW(twoPtEtaRPW);
532   fQCA->Set4pPtEtaRPW(fourPtEtaRPW);
533   fQCA->Set6pPtEtaRPW(sixPtEtaRPW);
534   fQCA->Set8pPtEtaRPW(eightPtEtaRPW);
535   
536   // weighted final results for differential flow for RPs:
537   // 3D (pt,eta)
538   fQCA->Setvn2ndPtEtaRPW(vn2ndPtEtaRPW);   
539   fQCA->Setvn4thPtEtaRPW(vn4thPtEtaRPW);  
540   fQCA->Setvn6thPtEtaRPW(vn6thPtEtaRPW);  
541   fQCA->Setvn8thPtEtaRPW(vn8thPtEtaRPW);  
542   // 2D (pt)
543   fQCA->Setvn2ndPtRPW(vn2ndPtRPW);   
544   fQCA->Setvn4thPtRPW(vn4thPtRPW);  
545   fQCA->Setvn6thPtRPW(vn6thPtRPW);  
546   fQCA->Setvn8thPtRPW(vn8thPtRPW);   
547   // 2D (eta)
548   fQCA->Setvn2ndEtaRPW(vn2ndEtaRPW);   
549   fQCA->Setvn4thEtaRPW(vn4thEtaRPW);  
550   fQCA->Setvn6thEtaRPW(vn6thEtaRPW);  
551   fQCA->Setvn8thEtaRPW(vn8thEtaRPW);  
552   
553   fQCA->Finish();
554   
555   //----------------------------------------------------
556  }
557  else
558  {
559   cout<<" WARNING: histogram list pointer is empty (QC, Task::Terminate())"<<endl;
560   cout<<endl;
561  }
562 }
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583