]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowAnalysisWithQCumulants.cxx
new methods and possiility to run all methods in same run
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowAnalysisWithQCumulants.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  * flow analysis with Q-cumulants * 
18  *                                * 
19  * author:  Ante Bilandzic        * 
20  *           (anteb@nikhef.nl)    *
21  *********************************/ 
22
23 #define AliFlowAnalysisWithQCumulants_cxx
24
25 #include "Riostream.h"
26 #include "AliFlowCommonConstants.h"
27 #include "AliFlowCommonHist.h"
28 #include "AliFlowCommonHistResults.h"
29 #include "TChain.h"
30 #include "TFile.h"
31 #include "TList.h" //NEW
32 #include "TParticle.h"
33 #include "TRandom3.h"
34 #include "TProfile.h"
35 #include "TProfile2D.h" 
36 #include "TProfile3D.h"
37 #include "AliFlowEventSimple.h"
38 #include "AliFlowTrackSimple.h"
39 #include "AliFlowAnalysisWithQCumulants.h"
40
41 #include "TRandom.h"
42
43 class TH1;
44 class TGraph;
45 class TPave;
46 class TLatex;
47 class TMarker;
48 class TRandom3;
49 class TObjArray;
50 class TList;
51 class TCanvas;
52 class TSystem;
53 class TROOT;
54 class AliFlowVector;
55 class TVector;
56
57 //================================================================================================================
58
59 ClassImp(AliFlowAnalysisWithQCumulants)
60
61 AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():  
62  fTrack(NULL),
63  fHistList(NULL),
64  fAvMultIntFlow(NULL),
65  fQvectorComponents(NULL),
66  fIntFlowResults(NULL),
67  fDiffFlowResults2ndOrder(NULL),
68  fDiffFlowResults4thOrder(NULL),
69  fQCorrelations(NULL),
70  fQCovariance(NULL),
71  fDirectCorrelations(NULL),
72  fReD(NULL),
73  fImD(NULL),
74  fReq1n(NULL),
75  fImq1n(NULL),
76  fReq2n(NULL),
77  fImq2n(NULL),
78  f2_1n1n(NULL),
79  f2_2n2n(NULL),
80  f3_2n1n1n(NULL),
81  f3_1n1n2n(NULL),
82  f4_1n1n1n1n(NULL),
83  fQCorrelationsPerBin(NULL),
84  fCommonHists(NULL),
85  abTempDeleteMe(0)
86 {
87  //constructor 
88  fHistList = new TList(); 
89 }
90
91 AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
92 {
93  //desctructor
94  delete fHistList; 
95 }
96
97 //================================================================================================================
98
99 void AliFlowAnalysisWithQCumulants::CreateOutputObjects()
100 {
101  //various output histograms
102  
103  //avarage multiplicity 
104  fAvMultIntFlow = new TProfile("fAvMultIntFlow","Avarage multiplicity of selected particles used for int. flow",1,0,1,0,100000,"s");
105  fAvMultIntFlow->SetXTitle("");
106  fAvMultIntFlow->SetYTitle("<multiplicity>");
107  fHistList->Add(fAvMultIntFlow);
108  
109  //Q-vector stuff
110  fQvectorComponents = new TProfile("fQvectorComponents","Avarage of Q-vector components",44,0.,44.,"s");
111  fQvectorComponents->SetXTitle("");
112  fQvectorComponents->SetYTitle("");
113  //fHistList->Add(fQvectorComponents);
114  
115  //final results for integrated flow from Q-cumulants
116  fIntFlowResults = new TH1D("fIntFlowResults","Integrated Flow From Q-cumulants",4,0,4);
117  fIntFlowResults->SetXTitle("");
118  fIntFlowResults->SetYTitle("Integrated Flow [%]");
119  fHistList->Add(fIntFlowResults);
120  
121  //final results for differential flow from 2nd order Q-cumulant
122  fDiffFlowResults2ndOrder = new TH1D("fDiffFlowResults2ndOrder","Differential Flow From 2nd Order Q-cumulant",10000,0,1000);
123  fDiffFlowResults2ndOrder->SetXTitle("Pt [GeV]");
124  fDiffFlowResults2ndOrder->SetYTitle("Differential Flow [%]");
125  fHistList->Add(fDiffFlowResults2ndOrder);
126  
127  //final results for differential flow from 4th order Q-cumulant
128  fDiffFlowResults4thOrder = new TH1D("fDiffFlowResults4thOrder","Differential Flow From 4th Order Q-cumulant",10000,0,1000);
129  fDiffFlowResults4thOrder->SetXTitle("Pt [GeV]");
130  fDiffFlowResults4thOrder->SetYTitle("Differential Flow [%]");
131  fHistList->Add(fDiffFlowResults4thOrder);
132   
133  //multi-particle correlations calculated from Q-vectors
134  fQCorrelations = new TProfile("fQCorrelations","multi-particle correlations from Q-vectors",35,0,35,"s");
135  fQCorrelations->SetXTitle("");
136  fQCorrelations->SetYTitle("correlations");
137  fHistList->Add(fQCorrelations);
138  
139  //covariance of multi-particle correlations
140  fQCovariance = new TProfile("fQCovariance","covariance of multi-particle correlations",3,0,3,"s");
141  fQCovariance->SetXTitle("");
142  fQCovariance->SetYTitle("covariance");
143  fHistList->Add(fQCovariance);
144  
145  //multi-particle correlations calculated with nested loops (0..40 integrated flow; 40..80 differential flow)
146  fDirectCorrelations = new TProfile("fDirectCorrelations","multi-particle correlations with nested loops",80,0,80,"s");
147  fDirectCorrelations->SetXTitle("");
148  fDirectCorrelations->SetYTitle("correlations");
149  fHistList->Add(fDirectCorrelations);
150  
151  //ReD
152  fReD = new TProfile("fReD","Re[D]",10000,0.,1000.,"s");
153  fReD->SetXTitle("Pt");
154  fReD->SetYTitle("Re[D]");
155  //fHistList->Add(fReD);
156  
157  //ImD
158  fImD = new TProfile("fImD","Im[D]",10000,0.,1000.,"s");
159  fImD->SetXTitle("Pt");
160  fImD->SetYTitle("Im[D]");
161  //fHistList->Add(fImD);
162  
163  //fReq1n
164  fReq1n = new TProfile("fReq1n","Re[q_n]",10000,0.,1000.,"s");
165  fReq1n->SetXTitle("Pt");
166  fReq1n->SetYTitle("Re[q_n]");
167  fHistList->Add(fReq1n);
168  
169  //fImq1n
170  fImq1n = new TProfile("fImq1n","Im[q_n]",10000,0.,1000.,"s");
171  fImq1n->SetXTitle("Pt");
172  fImq1n->SetYTitle("Im[q_n]");
173  fHistList->Add(fImq1n);
174  
175  //fReq2n
176  fReq2n = new TProfile("fReq2n","Re[q_2n]",10000,0.,1000.,"s");
177  fReq2n->SetXTitle("Pt");
178  fReq2n->SetYTitle("Im[D]");
179  fHistList->Add(fReq2n);
180  
181  //fImq2n
182  fImq2n = new TProfile("fImq2n","Im[q_2n]",10000,0.,1000.,"s");
183  fImq2n->SetXTitle("Pt");
184  fImq2n->SetYTitle("Im[q_2n]");
185  fHistList->Add(fImq2n);
186  
187  //f2_1n1n
188  f2_1n1n = new TProfile("f2_1n1n","<2'>_{n|n}",10000,0.,1000.,"s");
189  f2_1n1n->SetXTitle("Pt");
190  f2_1n1n->SetYTitle("<2'>_{n|n}");
191  fHistList->Add(f2_1n1n);
192  
193  //f2_2n2n
194  f2_2n2n = new TProfile("f2_2n2n","<2'>_{2n|2n}",10000,0.,1000.,"s");
195  f2_2n2n->SetXTitle("Pt");
196  f2_2n2n->SetYTitle("<2'>_{2n|2n}");
197  fHistList->Add(f2_2n2n);
198  
199  //f3_2n1n1n
200  f3_2n1n1n = new TProfile("f3_2n1n1n","<3'>_{2n|n,n}",10000,0.,1000.,"s");
201  f3_2n1n1n->SetXTitle("Pt");
202  f3_2n1n1n->SetYTitle("<3'>_{2n|n,n}");
203  fHistList->Add(f3_2n1n1n);
204  
205  //f3_1n1n2n
206  f3_1n1n2n = new TProfile("f3_1n1n2n","<3'>_{n,n|2n}",10000,0.,1000.,"s");
207  f3_1n1n2n->SetXTitle("Pt");
208  f3_1n1n2n->SetYTitle("<3'>_{n,n|2n}");
209  fHistList->Add(f3_1n1n2n);
210  
211  //f4_1n1n1n1n
212  f4_1n1n1n1n = new TProfile("f4_1n1n1n1n","<4'>_{n,n|n,n}",10000,0.,1000.,"s");
213  f4_1n1n1n1n->SetXTitle("Pt");
214  f4_1n1n1n1n->SetYTitle("<4'>_{n,n|n,n}");
215  fHistList->Add(f4_1n1n1n1n);
216  
217  //multi-particle correlations calculated from Q-vectors for each pt bin
218  fQCorrelationsPerBin = new TProfile("fQCorrelationsPerBin","multi-particle correlations from Q-vectors per bin",10000,0,1000.,"s");
219  fQCorrelationsPerBin->SetXTitle("");
220  fQCorrelationsPerBin->SetYTitle("correlations");
221  //fHistList->Add(fQCorrelationsPerBin);
222  
223  //common control histograms
224  fCommonHists = new AliFlowCommonHist("QCumulants");
225  fHistList->Add(fCommonHists->GetHistList());  
226  
227 }//end of CreateOutputObjects()
228
229 //================================================================================================================
230
231 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
232 {
233  //running over data
234   
235  //get the total multiplicity of event:
236  //Int_t nPrim = anEvent->NumberOfTracks();
237  
238  
239
240  //if(nPrim>8&&nPrim<24)
241  //{
242
243  //fill the common control histograms:
244  fCommonHists->FillControlHistograms(anEvent);  
245  
246  //get the selected multiplicity (i.e. number of particles used for int. flow):
247  //Int_t nEventNSelTracksIntFlow = anEvent->GetEventNSelTracksIntFlow();
248  
249  Int_t n=2; //int flow harmonic (to be improved)
250  
251  //---------------------------------------------------------------------------------------------------------
252  //Q-vectors of an event evaluated in harmonics n, 2n, 3n and 4n:
253  AliFlowVector Qvector1n, Qvector2n, Qvector3n, Qvector4n;
254  
255  Qvector1n.Set(0.,0.);
256  Qvector1n.SetMult(0);
257  Qvector1n=anEvent->GetQ(1*n); 
258  
259  Qvector2n.Set(0.,0.);
260  Qvector2n.SetMult(0);
261  Qvector2n=anEvent->GetQ(2*n);                          
262  
263  Qvector3n.Set(0.,0.);
264  Qvector3n.SetMult(0);
265  Qvector3n=anEvent->GetQ(3*n);       
266  
267  Qvector4n.Set(0.,0.);
268  Qvector4n.SetMult(0);
269  Qvector4n=anEvent->GetQ(4*n);       
270  //---------------------------------------------------------------------------------------------------------
271  
272  //multiplicity (to be improved, because I already have nEventNSelTracksIntFlow and nPrim)
273  Double_t M = Qvector1n.GetMult();
274  
275  fAvMultIntFlow->Fill(0.,M,1.);
276  
277  //---------------------------------------------------------------------------------------------------------
278  //*************
279  //* Q-vectors *
280  //*************
281  Double_t ReQ2nQ1nstarQ1nstar = pow(Qvector1n.X(),2.)*Qvector2n.X()+2.*Qvector1n.X()*Qvector1n.Y()*Qvector2n.Y()-pow(Qvector1n.Y(),2.)*Qvector2n.X();
282  //Double_t ImQ2nQ1nstarQ1nstar = calculate and implement this (deleteMe)
283  Double_t ReQ4nQ2nstarQ2nstar = pow(Qvector2n.X(),2.)*Qvector4n.X()+2.*Qvector2n.X()*Qvector2n.Y()*Qvector4n.Y()-pow(Qvector2n.Y(),2.)*Qvector4n.X();
284  //Double_t ImQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
285  Double_t ReQ4nQ3nstarQ1nstar = Qvector4n.X()*(Qvector3n.X()*Qvector1n.X()-Qvector3n.Y()*Qvector1n.Y())+Qvector4n.Y()*(Qvector3n.X()*Qvector1n.Y()+Qvector3n.Y()*Qvector1n.X());
286  //Double_t ImQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
287  Double_t ReQ3nQ2nstarQ1nstar = Qvector3n.X()*Qvector2n.X()*Qvector1n.X()-Qvector3n.X()*Qvector2n.Y()*Qvector1n.Y()+Qvector3n.Y()*Qvector2n.X()*Qvector1n.Y()+Qvector3n.Y()*Qvector2n.Y()*Qvector1n.X(); //Re<Q_{3n} Q_{2n}^* Q_{n}^*>
288  //Double_t ImQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
289  Double_t ReQ3nQ1nstarQ1nstarQ1nstar = Qvector3n.X()*pow(Qvector1n.X(),3)-3.*Qvector1n.X()*Qvector3n.X()*pow(Qvector1n.Y(),2)+3.*Qvector1n.Y()*Qvector3n.Y()*pow(Qvector1n.X(),2)-Qvector3n.Y()*pow(Qvector1n.Y(),3); //Re<Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*>
290  //Double_t ImQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
291  Double_t Q2nQ1nQ2nstarQ1nstar = pow(Qvector2n.Mod()*Qvector1n.Mod(),2); //<|Q_{2n}|^2 |Q_{n}|^2>
292  Double_t ReQ4nQ2nstarQ1nstarQ1nstar = (Qvector4n.X()*Qvector2n.X()+Qvector4n.Y()*Qvector2n.Y())*(pow(Qvector1n.X(),2)-pow(Qvector1n.Y(),2))+2.*Qvector1n.X()*Qvector1n.Y()*(Qvector4n.Y()*Qvector2n.X()-Qvector4n.X()*Qvector2n.Y()); //Re<Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*> 
293  //Double_t ImQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
294  Double_t ReQ2nQ1nQ1nstarQ1nstarQ1nstar = (Qvector2n.X()*Qvector1n.X()-Qvector2n.Y()*Qvector1n.Y())*(pow(Qvector1n.X(),3)-3.*Qvector1n.X()*pow(Qvector1n.Y(),2))+(Qvector2n.X()*Qvector1n.Y()+Qvector1n.X()*Qvector2n.Y())*(3.*Qvector1n.Y()*pow(Qvector1n.X(),2)-pow(Qvector1n.Y(),3));
295  //Double_t ImQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
296  //---------------------------------------------------------------------------------------------------------
297  
298  //---------------------------------------------------------------------------------------------------------
299  //********************************
300  //* multi-particle correlations: *
301  //********************************
302
303  // binning of fQCorrelations: 
304  // 1st bin: <2>_{n|n} = two_1n1n
305  // 2nd bin: <2>_{2n|2n} = two_2n2n
306  // 3rd bin: <2>_{3n|3n} = two_3n3n
307  // 4th bin: <2>_{4n|4n} = two_4n4n
308  // 6th bin: <3>_{2n|n,n} = three_2n1n1n
309  // 7th bin: <3>_{3n|2n,n} = three_3n2n1n
310  // 8th bin: <3>_{4n|2n,2n} = three_4n2n2n
311  // 9th bin: <3>_{4n|3n,n} = three_4n3n1n
312  //11th bin: <4>_{n,n|n,n} = four_1n1n1n1n
313  //12th bin: <4>_{2n,n|2n,n} = four_2n1n2n1n
314  //13th bin: <4>_{3n|n,n,n} = four_3n1n1n1n
315  //14th bin: <4>_{4n|2n,n,n} = four_4n2n1n1n
316  //16th bin: <5>_{2n|n,n,n,n} = five_2n1n1n1n1n
317  //21th bin: <6>_{n,n,n|n,n,n} = six_1n1n1n1n1n1n
318  
319  // binning of fQCovariance: 
320  // 1st bin: <2>_{n|n}*<4>_{n,n|n,n}
321  // 2nd bin: <2>_{n|n}*<6>_{n,n,n|n,n,n} 
322  // 3rd bin: <4>_{n,n|n,n}*<6>_{n,n,n|n,n,n}
323  
324      
325  //2-particle
326  Double_t two_1n1n=0., two_2n2n=0., two_3n3n=0., two_4n4n=0.; 
327  if(M>1)
328  {
329   two_1n1n = (pow(Qvector1n.Mod(),2.)-M)/(M*(M-1.)); //<2>_{n|n}   = <cos(n*(phi1-phi2))>
330   two_2n2n = (pow(Qvector2n.Mod(),2.)-M)/(M*(M-1.)); //<2>_{2n|2n} = <cos(2n*(phi1-phi2))>
331   two_3n3n = (pow(Qvector3n.Mod(),2.)-M)/(M*(M-1.)); //<2>_{3n|3n} = <cos(3n*(phi1-phi2))>
332   two_4n4n = (pow(Qvector4n.Mod(),2.)-M)/(M*(M-1.)); //<2>_{4n|4n} = <cos(4n*(phi1-phi2))>
333  
334   fQCorrelations->Fill(0.,two_1n1n,M*(M-1.)); 
335   fQCorrelations->Fill(1.,two_2n2n,M*(M-1.)); 
336   fQCorrelations->Fill(2.,two_3n3n,M*(M-1.)); 
337   fQCorrelations->Fill(3.,two_4n4n,M*(M-1.)); 
338  }
339  
340  //3-particle
341  Double_t three_2n1n1n=0., three_3n2n1n=0., three_4n2n2n=0., three_4n3n1n=0.;
342  if(M>2)
343  {
344   three_2n1n1n = (ReQ2nQ1nstarQ1nstar-2.*pow(Qvector1n.Mod(),2.)-pow(Qvector2n.Mod(),2.)+2.*M)/(M*(M-1.)*(M-2.)); //Re[<3>_{2n|n,n}] = Re[<3>_{n,n|2n}] = <cos(n*(2.*phi1-phi2-phi3))>
345   three_3n2n1n = (ReQ3nQ2nstarQ1nstar-pow(Qvector3n.Mod(),2.)-pow(Qvector2n.Mod(),2.)-pow(Qvector1n.Mod(),2.)+2.*M)/(M*(M-1.)*(M-2.)); //Re[<3>_{3n|2n,n}] = Re[<3>_{2n,n|3n}] = <cos(n*(3.*phi1-2.*phi2-phi3))>
346   three_4n2n2n = (ReQ4nQ2nstarQ2nstar-2.*pow(Qvector2n.Mod(),2.)-pow(Qvector4n.Mod(),2.)+2.*M)/(M*(M-1.)*(M-2.)); //Re[<3>_{4n|2n,2n}] = Re[<3>_{2n,2n|4n}] = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
347   three_4n3n1n = (ReQ4nQ3nstarQ1nstar-pow(Qvector4n.Mod(),2.)-pow(Qvector3n.Mod(),2.)-pow(Qvector1n.Mod(),2.)+2.*M)/(M*(M-1.)*(M-2.)); //Re[<3>_{4n|3n,n}] = Re[<3>_{3n,n|4n}] = <cos(n*(4.*phi1-3.*phi2-phi3))>
348  
349   fQCorrelations->Fill(5.,three_2n1n1n,M*(M-1.)*(M-2.)); 
350   fQCorrelations->Fill(6.,three_3n2n1n,M*(M-1.)*(M-2.));
351   fQCorrelations->Fill(7.,three_4n2n2n,M*(M-1.)*(M-2.)); 
352   fQCorrelations->Fill(8.,three_4n3n1n,M*(M-1.)*(M-2.));    
353  }
354  
355  //4-particle
356  Double_t four_1n1n1n1n=0., four_2n1n2n1n=0., four_3n1n1n1n=0., four_4n2n1n1n=0.;  
357  if(M>3)
358  {
359   four_1n1n1n1n = (2.*M*(M-3.)+pow(Qvector1n.Mod(),4.)-4.*(M-2.)*pow(Qvector1n.Mod(),2.)-2.*ReQ2nQ1nstarQ1nstar+pow(Qvector2n.Mod(),2.))/(M*(M-1)*(M-2.)*(M-3.)); //<4>_{n,n|n,n}
360   four_2n1n2n1n = (Q2nQ1nQ2nstarQ1nstar-2.*ReQ3nQ2nstarQ1nstar-2.*ReQ2nQ1nstarQ1nstar)/(M*(M-1.)*(M-2.)*(M-3.))-((M-5.)*pow(Qvector1n.Mod(),2.)+(M-4.)*pow(Qvector2n.Mod(),2.)-pow(Qvector3n.Mod(),2.))/(M*(M-1.)*(M-2.)*(M-3.))+(M-6.)/((M-1.)*(M-2.)*(M-3.)); //Re[<4>_{2n,n|2n,n}]
361   four_3n1n1n1n = (ReQ3nQ1nstarQ1nstarQ1nstar-3.*ReQ3nQ2nstarQ1nstar-3.*ReQ2nQ1nstarQ1nstar)/(M*(M-1.)*(M-2.)*(M-3.))+(2.*pow(Qvector3n.Mod(),2.)+3.*pow(Qvector2n.Mod(),2.)+6.*pow(Qvector1n.Mod(),2.)-6.*M)/(M*(M-1.)*(M-2.)*(M-3.)); //Re[<4>_{3n|n,n,n}]
362   four_4n2n1n1n = (ReQ4nQ2nstarQ1nstarQ1nstar-M*(M-1.)*(M-2.)*(2.*three_3n2n1n+2.*three_4n3n1n+three_4n2n2n+three_2n1n1n)-M*(M-1.)*(2.*two_1n1n+2.*two_2n2n+2*two_3n3n+two_4n4n)-M)/(M*(M-1.)*(M-2.)*(M-3.)); //Re[<4>_{4n|2n,n,n}]
363
364   fQCorrelations->Fill(10.,four_1n1n1n1n,M*(M-1.)*(M-2.)*(M-3.)); 
365   fQCorrelations->Fill(11.,four_2n1n2n1n,M*(M-1.)*(M-2.)*(M-3.));
366   fQCorrelations->Fill(12.,four_3n1n1n1n,M*(M-1.)*(M-2.)*(M-3.));
367   fQCorrelations->Fill(13.,four_4n2n1n1n,M*(M-1.)*(M-2.)*(M-3.));
368   
369   fQCovariance->Fill(0.,two_1n1n*four_1n1n1n1n,M*(M-1.)*M*(M-1.)*(M-2.)*(M-3.));
370  }
371
372  //5-particle
373  //if(M>4)
374  //{
375   //temporarily, doesn't work with above scoping 
376   //Double_t five_2n1n1n1n1n = (ReQ2nQ1nQ1nstarQ1nstarQ1nstar-M*(M-1.)*(M-2.)*(M-3.)*(four_3n1n1n1n+3.*four_1n1n1n1n+3.*four_2n1n2n1n)-M*(M-1.)*(M-2.)*(3.*M*three_2n1n1n+4.*three_3n2n1n)-M*(M-1.)*((9.*M-11.)*two_1n1n+(3.*M-2.)*two_2n2n+two_3n3n)-M*(3.*M-2.))/(M*(M-1.)*(M-2.)*(M-3.)*(M-4.)); //Re[<5>_{2n,n|n,n,n}]
377  
378   //fQCorrelations->Fill(15.,five_2n1n1n1n1n,M*(M-1.)*(M-2.)*(M-3.)*(M-4.)); 
379  //}
380
381  //6-particle
382  if(M>5)
383  {
384   Double_t six_1n1n1n1n1n1n = (pow(Qvector1n.Mod(),6.)+9.*Q2nQ1nQ2nstarQ1nstar-6.*ReQ2nQ1nQ1nstarQ1nstarQ1nstar)/(M*(M-1)*(M-2)*(M-3)*(M-4)*(M-5)) + 4.*(ReQ3nQ1nstarQ1nstarQ1nstar-3.*ReQ3nQ2nstarQ1nstar)/(M*(M-1)*(M-2)*(M-3)*(M-4)*(M-5)) + 2.*(9.*(M-4.)*ReQ2nQ1nstarQ1nstar+2.*pow(Qvector3n.Mod(),2.))/(M*(M-1)*(M-2)*(M-3)*(M-4)*(M-5)) - 9.*(pow(Qvector1n.Mod(),4.)+pow(Qvector2n.Mod(),2.))/(M*(M-1)*(M-2)*(M-3)*(M-5)) + (18.*pow(Qvector1n.Mod(),2.))/(M*(M-1)*(M-3)*(M-4)) - (6.)/((M-1)*(M-2)*(M-3)); //<6>_{n,n,n|n,n,n}
385   
386   fQCorrelations->Fill(20.,six_1n1n1n1n1n1n,M*(M-1.)*(M-2.)*(M-3.)*(M-4.)*(M-5.)); 
387   
388   fQCovariance->Fill(1.,two_1n1n*six_1n1n1n1n1n1n,M*(M-1.)*M*(M-1.)*(M-2.)*(M-3.)*(M-4.)*(M-5.));
389   fQCovariance->Fill(2.,four_1n1n1n1n*six_1n1n1n1n1n1n,M*(M-1.)*(M-2.)*(M-3.)*M*(M-1.)*(M-2.)*(M-3.)*(M-4.)*(M-5.));
390  }
391  //---------------------------------------------------------------------------------------------------------
392  
393  
394  //--------------------------------------------------------------------------------------------------------- 
395  // DIFFERENTIAL FLOW
396  
397  Double_t Q_x = Qvector1n.X();
398  Double_t Q_y = Qvector1n.Y();
399  Double_t Q_2x = Qvector2n.X();
400  Double_t Q_2y = Qvector2n.Y();
401  
402  Double_t q_x=0.,q_y=0.,q_2x=0.,q_2y=0.,m=0.;
403  
404  for(Int_t i=0;i<M;i++) //check if nPrim == M
405  { 
406   fTrack=anEvent->GetTrack(i);
407   fReq1n->Fill(fTrack->Pt(),cos(n*(fTrack->Phi())),1.);
408   fImq1n->Fill(fTrack->Pt(),sin(n*(fTrack->Phi())),1.);
409   fReq2n->Fill(fTrack->Pt(),cos(2.*n*(fTrack->Phi())),1.);
410   fImq2n->Fill(fTrack->Pt(),sin(2.*n*(fTrack->Phi())),1.);
411  } 
412   
413  Double_t twoDiff_1n1n=0.,twoDiff_2n2n=0.,threeDiff_2n1n1n=0.,threeDiff_1n1n2n=0.,fourDiff_1n1n1n1n=0.;
414  
415  for(Int_t bin=1;bin<10001;bin++) //loop over pt-bins (to be improved upper limit)
416  { 
417   q_x = (fReq1n->GetBinContent(bin))*(fReq1n->GetBinEntries(bin));
418   q_y = (fImq1n->GetBinContent(bin))*(fImq1n->GetBinEntries(bin)); 
419   q_2x = (fReq2n->GetBinContent(bin))*(fReq2n->GetBinEntries(bin));  
420   q_2y = (fImq2n->GetBinContent(bin))*(fImq2n->GetBinEntries(bin)); 
421   m = fReq1n->GetBinEntries(bin); 
422  
423   if(m>0&&M>1)
424   {
425    twoDiff_1n1n = (q_x*Q_x+q_y*Q_y-m)/(m*(M-1.));
426    f2_1n1n->Fill((bin-1)*0.1,twoDiff_1n1n,m*(M-1.));//<2'>_{n|n}
427    
428    twoDiff_2n2n = (q_2x*Q_2x+q_2y*Q_2y-m)/(m*(M-1.));
429    f2_2n2n->Fill((bin-1)*0.1,twoDiff_2n2n,m*(M-1.));//<2'>_{2n|2n} 
430   }
431   
432   if(m>0&&M>2)
433   {
434    threeDiff_2n1n1n = (q_2x*(Q_x*Q_x-Q_y*Q_y)+2.*q_2y*Q_x*Q_y-2.*(q_x*Q_x+q_y*Q_y)-(q_2x*Q_2x+q_2y*Q_2y)+2.*m)/(m*(M-1.)*(M-2.));
435    f3_2n1n1n->Fill((bin-1)*0.1,threeDiff_2n1n1n,m*(M-1.)*(M-2.));//Re[<3'>_{2n|n,n}]
436    
437    threeDiff_1n1n2n = (Q_2x*(q_x*Q_x-q_y*Q_y)+Q_2y*(q_x*Q_y+q_y*Q_x)-2.*(q_x*Q_x+q_y*Q_y)-(q_2x*Q_2x+q_2y*Q_2y)+2.*m)/(m*(M-1.)*(M-2.));
438    f3_1n1n2n->Fill((bin-1)*0.1,threeDiff_1n1n2n,m*(M-1.)*(M-2.));//Re[<3'>_{n,n|2n}]
439   }
440   
441   if(m>0&&M>3)
442   {
443    fourDiff_1n1n1n1n = ((Q_x*Q_x+Q_y*Q_y)*(q_x*Q_x+q_y*Q_y)-(q_2x*(Q_x*Q_x-Q_y*Q_y)+2.*q_2y*Q_x*Q_y)-(Q_2x*(q_x*Q_x-q_y*Q_y)+Q_2y*(q_x*Q_y+q_y*Q_x))+(q_2x*Q_2x+q_2y*Q_2y)-2.*(M-3.)*(q_x*Q_x+q_y*Q_y)-2.*m*(Q_x*Q_x+Q_y*Q_y)+2.*(Q_x*q_x+Q_y*q_y)+2.*m*(M-3.))/(m*(M-1.)*(M-2.)*(M-3.));
444    f4_1n1n1n1n->Fill((bin-1)*0.1,fourDiff_1n1n1n1n,m*(M-1.)*(M-2.)*(M-3.)); //Re[<4'>_{n,n|n,n}]
445   }
446    
447  } 
448   
449  fReq1n->Reset();
450  fImq1n->Reset();
451  fReq2n->Reset();
452  fImq2n->Reset();
453 //---------------------------------------------------------------------------------------------------------
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506  
507  
508  /*
509  
510  AliFlowVector QvectorDiff;
511  
512  QvectorDiff.Set(0.,0.);
513  QvectorDiff.SetMult(0);
514  QvectorDiff=anEvent->GetQ(1.*n); 
515  
516  nPrim=QvectorDiff.GetMult();
517  
518  Double_t qBinx=0.,qBiny=0.,q2nBinx=0.,q2nBiny=0.,mm=0.;
519  
520  for(Int_t dd=0;dd<nPrim;dd++)
521  { 
522   fTrack=anEvent->GetTrack(dd);
523   if(fTrack->Pt()>0.04&&fTrack->Pt()<0.44)
524   {
525    qBinx+=cos(n*(fTrack->Phi()));
526    qBiny+=sin(n*(fTrack->Phi()));
527    q2nBinx+=cos(2.*n*(fTrack->Phi()));
528    q2nBiny+=sin(2.*n*(fTrack->Phi()));
529    mm++;
530   }
531   if(fTrack->Pt()>100.)
532   {
533    cout<<"****************"<<endl;
534    cout<<"Pt = "<<fTrack->Pt()<<endl;
535    cout<<"****************"<<endl;
536   }
537   fReD->Fill(fTrack->Pt(),cos(n*(fTrack->Phi())),1.);
538   fImD->Fill(fTrack->Pt(),sin(n*(fTrack->Phi())),1.);
539  }
540  
541  Double_t Qx=0.,Qy=0.,Mhere=0.;
542  for(Int_t bb=1;bb<10001;bb++)
543  {
544   Qx+=(fReD->GetBinContent(bb))*(fReD->GetBinEntries(bb));
545   Qy+=(fImD->GetBinContent(bb))*(fImD->GetBinEntries(bb));  
546   Mhere+=fReD->GetBinEntries(bb);
547  }
548  
549 if(mm!=0.){
550 Double_t threeDiff_n_n_2n = ((qBinx*Qvector1n.X()-qBiny*Qvector1n.Y())*Qvector2n.X()+(qBinx*Qvector1n.Y()+qBiny*Qvector1n.X())*Qvector2n.Y()-q2nBinx*Qvector2n.X()-q2nBiny*Qvector2n.Y()+2.*mm-2.*(qBinx*Qvector1n.X()+qBiny*Qvector1n.Y()))/(mm*(Mhere-1.)*(Mhere-2.));
551
552
553 Double_t threeDiff_2n_n_n = (q2nBinx*(Qvector1n.X()*Qvector1n.X()-Qvector1n.Y()*Qvector1n.Y())+2.*Qvector1n.X()*Qvector1n.Y()*q2nBiny
554 -2.*(qBinx*Qvector1n.X()+qBiny*Qvector1n.Y())-q2nBinx*Qvector2n.X()-q2nBiny*Qvector2n.Y()+2.*mm)/(mm*(Mhere-1.)*(Mhere-2.));
555
556
557
558
559
560
561
562
563
564
565
566
567
568 Double_t fourDiff = (pow(Qvector1n.Mod(),2.)*(qBinx*Qvector1n.X()+qBiny*Qvector1n.Y())-(qBinx*Qvector1n.X()-qBiny*Qvector1n.Y())*Qvector2n.X() + (qBinx*Qvector1n.Y()+qBiny*Qvector1n.X())*Qvector2n.Y()-
569
570 (q2nBinx*(Qvector1n.X()*Qvector1n.X()-Qvector1n.Y()*Qvector1n.Y())+2.*Qvector1n.X()*Qvector1n.Y()*q2nBiny)
571
572 -2.*(Mhere-2.)*(mm/Mhere)*pow(Qvector1n.Mod(),2.)+4.*mm*(Mhere-2.)-2.*(Mhere-2.)*(qBinx*Qvector1n.X()+qBiny*Qvector1n.Y()) +q2nBinx*Qvector2n.X()+q2nBiny*Qvector2n.Y()-2.*mm*(Mhere-1.))/(mm*(Mhere-1.)*(Mhere-2.)*(Mhere-3.));
573
574
575
576 //Double_t fourDiff_b = (pow(Qvector1n.Mod())*())/(mm*(Mhere-1.)*(Mhere-2.)*(Mhere-3.));
577
578
579
580
581
582
583
584
585
586 fQCorrelations->Fill(30,(qBinx*Qx+qBiny*Qy-mm)/(mm*(Mhere-1.)),mm*(Mhere-1.));//<2'>_{n|n}
587 fQCorrelations->Fill(34,(q2nBinx*Qvector2n.X()+q2nBiny*Qvector2n.Y()-mm)/(mm*(Mhere-1.)),mm*(Mhere-1.));//<2'>_{2n|2n}
588 fQCorrelations->Fill(31,threeDiff_n_n_2n,mm*(Mhere-1.)*(Mhere-2.));//<3'>_{n,n|2n}
589 fQCorrelations->Fill(32,threeDiff_2n_n_n,mm*(Mhere-1.)*(Mhere-2.));//<3'>_{2n|n,n}
590 //fQCorrelations->Fill(33,fourDiff,mm*(Mhere-1.)*(Mhere-2.)*(Mhere-3.));//<4'>_{n,n|n,n}
591
592 }
593
594
595
596
597
598  for(Int_t bb=1;bb<10001;bb++)
599  {
600   if(fReD->GetBinEntries(bb)>1){
601    Double_t qx=(fReD->GetBinContent(bb))*(fReD->GetBinEntries(bb));
602    Double_t qy=(fImD->GetBinContent(bb))*(fImD->GetBinEntries(bb));
603    
604    
605    
606    //Double_t dx=(fReD->GetBinContent(bb))*(fReD->GetBinEntries(bb));
607    //Double_t dy=(fImD->GetBinContent(bb))*(fImD->GetBinEntries(bb));
608    
609    
610    
611    
612    Int_t mhere = fReD->GetBinEntries(bb);
613    //cout<<"bin = "<<bb<<" m = "<<mhere<<endl;
614    //cout<<"Qx = "<<Qx<<" Dx = "<<Dx<<endl;
615    //cout<<"Qy = "<<Qy<<" Dy = "<<Dy<<endl;
616    
617    fQCorrelationsPerBin->Fill((bb-1)*0.1,(qx*Qx+qy*Qy-mhere)/(mhere*(Mhere-1.)),mhere*(Mhere-1.));
618    
619    //fQCorrelationsPerBin->Fill((bb-1)*0.1,(dx*dx+dy*dy-mhere)/(mhere*(mhere-1)),mhere*(mhere-1));
620      
621   }
622  }fourDiff_1n1n1n1n = ((Q_x*Q_x+Q_y*Q_y)*(q_x*Q_x+q_y*Q_y)-m*(M-1.)*(M-2.)*(threeDiff_2n1n1n+threeDiff_1n1n2n)-m*(M-1.)*2.*(M-2.)*twoDiff_1n1n-2.*(m*(d_x*d_x+d_y*d_y-(M-m))+(m-1.)*2.*(q_x*d_x+q_y*d_y)+(m-2.)*(q_x*q_x+q_y*q_y-m))-2.*m*(M-1.)*(twoDiff_1n1n+1.)-m*(M-1.)*2.*twoDiff_1n1n-m*(M-1.)*twoDiff_2n2n-m)/(m*(M-1.)*(M-2.)*(M-3.));//OK!!!!!!!!!
623   
624   
625   fReD->Reset();
626   fImD->Reset();
627   
628   
629   
630   //cout<<"2-particle correlation = "<<(Qx*Qx+Qy*Qy-Mhere)/(Mhere*(Mhere-1))<<endl;
631
632  
633  
634
635
636  
637
638
639
640 */
641
642
643  
644
645  
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694  
695  /*
696  
697  Int_t nSelTracksIntFlow = 0;//cross-checking the selected multiplicity 
698
699
700
701  
702
703
704  //calculating Q-vector of event (needed for errors) in n-th harmonic
705  AliFlowVector fQvector;
706  fQvector.Set(0.,0.);
707  fQvector.SetMult(0);
708  fQvector=anEvent->GetQ(n);                             //get the Q vector for this event
709    
710  nPrim = fQvector.GetMult();        
711  nEventNSelTracksIntFlow = fQvector.GetMult();
712  nEventNSelTracksIntFlow=nPrim; 
713  
714  
715  */
716  
717  
718  /*
719  //calculating Q-vector of event (needed for errors)
720  AliFlowVector fQvector;
721  fQvector.Set(0.,0.);
722  fQvector.SetMult(0);
723  fQvector=anEvent->GetQ();                             //get the Q vector for this event
724  
725  */
726  
727  //cout<<" multiplicity = "<<fQvector.GetMult()<<endl;
728  
729  
730  //binning is organized as follows:
731  //1st bin fill Q_x
732  //2nd bin fill Q_y
733  //3rd bin fill (Q_x)^2the selected multiplicity
734  //4th bin fill (Q_y)^2
735  //5th bin fill |Q_n|^2
736  //6th bin fill |Q_n|^4
737  //7th bin fill |Q_2n|^2
738  //8th bin fill Q_2n (Q_n)* (Q_n)*// Remark: * here denotes complex conjugate!!! //Re[Q_n^2 * Q_2n^*] 
739  //9th bin fill Q_2n (Q_n)* (Q_n)*// Remark: * here denotes complex conjugate!!! //Im[Q_n^2 * Q_2n^*] 
740  //10th bin fill |Q_3n|^2
741  //11th bin fill |Q_4n|^2
742  //12th bin fill |Q_5n|^2
743  //13th bin fill Re<Q_{3n} Q_{2n}^* Q_{n}^*>
744  //14th bin fill Re<Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*>
745  //15th bin fill <|Q_{2n}|^2 |Q_{n}|^2>
746  //16th bin fill Re<Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*>
747  //17th bin fill |Q_n|^6
748  
749  /*
750  
751  fQvectorComponents->Fill(0.,fQvector.X(),1);          //in the 1st bin fill Q_x
752  fQvectorComponents->Fill(1.,fQvector.Y(),1);          //in the 2nd bin fill Q_y
753  fQvectorComponents->Fill(2.,pow(fQvector.X(),2.),1);  //in the 3rd bin fill (Q_x)^2
754  fQvectorComponents->Fill(3.,pow(fQvector.Y(),2.),1);  //in the 4th bin fill (Q_y)^2
755  fQvectorComponents->Fill(4.,pow(fQvector.Mod(),2.),1);//in the 5th bin fill |Q|^2
756  fQvectorComponents->Fill(5.,pow(fQvector.Mod(),4.),1);//in the 6th bin fill |Q|^4
757
758  //flow vector in 2n-th harmonic
759  AliFlowVector fQvector2n;
760  fQvector2n.Set(0.,0.);
761  fQvector2n.SetMult(0);
762  fQvector2n=anEvent->GetQ(2*n);      //get the Q vector in 2n-th harmonic for this event
763  
764  fQvectorComponents->Fill(6.,pow(fQvector2n.Mod(),2.),1);//in the 7th bin fill |Q_2n|^2
765
766  Double_t
767  Q2nQnstarQnstar=pow(fQvector.X(),2.)*fQvector2n.X()+2.*fQvector.X()*fQvector.Y()*fQvector2n.Y()-pow(fQvector.Y(),2.)*fQvector2n.X();
768  
769  Double_t
770  Q2nQnstarQnstarTemp=-2.*fQvector.X()*fQvector2n.X()*fQvector.Y()+fQvector2n.Y()*pow(fQvector.X(),2.)-fQvector2n.Y()*pow(fQvector.Y(),2.);
771  
772  
773  fQvectorComponents->Fill(7.,Q2nQnstarQnstar,1); //in the 8th bin fill Re[Q_n^2 * Q_2n^*]       
774  fQvectorComponents->Fill(8.,Q2nQnstarQnstarTemp,1); //in the 9th bin fill Im[Q_n^2 * Q_2n^*]       
775  
776
777  //flow vector in 3n-th harmonic
778  AliFlowVector fQvector3n;
779  fQvector3n.Set(0.,0.);
780  fQvector3n.SetMult(0);
781  fQvector3n=anEvent->GetQ(3*n);      //get the Q vector in 3n-th harmonic for this event
782  fQvectorComponents->Fill(9.,pow(fQvector3n.Mod(),2.),1);//in the 10th bin fill |Q_3n|^2
783
784  //flow vector in 4n-th harmonic
785  AliFlowVector fQvector4n;
786  fQvector4n.Set(0.,0.);
787  fQvector4n.SetMult(0);
788  fQvector4n=anEvent->GetQ(4*n);      //get the Q vector in 4n-th harmonic for this event
789  fQvectorComponents->Fill(10.,pow(fQvector4n.Mod(),2.),1);//in the 11th bin fill |Q_4n|^2
790  
791  //flow vector in 5n-th harmonic
792  AliFlowVector fQvector5n;
793  fQvector5n.Set(0.,0.);
794  fQvector5n.SetMult(0);
795  fQvector5n=anEvent->GetQ(5*n);      //get the Q vector in 5n-th harmonic for this event
796  fQvectorComponents->Fill(11.,pow(fQvector5n.Mod(),2.),1);//in the 12th bin fill |Q_5n|^2
797   
798  
799  
800  Double_t
801  Q3nQ2nstarQnstar=fQvector3n.X()*fQvector2n.X()*fQvector.X()-fQvector3n.X()*fQvector2n.Y()*fQvector.Y()+fQvector3n.Y()*fQvector2n.X()*fQvector.Y()+fQvector3n.Y()*fQvector2n.Y()*fQvector.X();
802  fQvectorComponents->Fill(12.,Q3nQ2nstarQnstar,1); //in the 13th bin fill Re<Q_{3n} Q_{2n}^* Q_{n}^*>
803  
804  //fDirectCorrelations->Fill(2.,16,1);
805  
806  
807  Double_t
808  Q3nQnstarQnstarQnstar=fQvector3n.X()*pow(fQvector.X(),3)-3.*fQvector.X()*fQvector3n.X()*pow(fQvector.Y(),2)+3.*fQvector.Y()*fQvector3n.Y()*pow(fQvector.X(),2)-fQvector3n.Y()*pow(fQvector.Y(),3); 
809  fQvectorComponents->Fill(13.,Q3nQnstarQnstarQnstar,1); //in the 14th bin fill Re<Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*>
810  
811  
812  
813  Double_t
814  Q2nQnQ2nstarQnstar=pow(fQvector2n.Mod()*fQvector.Mod(),2); 
815  fQvectorComponents->Fill(14.,Q2nQnQ2nstarQnstar,1); //in the 15th bin fill <|Q_{2n}|^2 |Q_{n}|^2>
816  
817  
818  
819  Double_t
820  Q2nQnQnstarQnstarQnstar=(fQvector2n.X()*fQvector.X()-fQvector2n.Y()*fQvector.Y())*(pow(fQvector.X(),3)-3.*fQvector.X()*pow(fQvector.Y(),2))+(fQvector2n.X()*fQvector.Y()+fQvector.X()*fQvector2n.Y())*(3.*fQvector.Y()*pow(fQvector.X(),2)-pow(fQvector.Y(),3));
821  fQvectorComponents->Fill(15.,Q2nQnQnstarQnstarQnstar,1); //in the 16th bin fill Re<Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*>
822  
823  
824  fQvectorComponents->Fill(16.,pow(fQvector.Mod(),6),1); //in the 17th bin fill |Q|^6
825  */
826  
827  /*
828  Double_t
829  Q2nQnQnstarQnstarQnstar22222=(pow(fQvector.X(),2)+pow(fQvector.Y(),2))*(pow(fQvector.X(),2)*fQvector2n.X()-fQvector2n.X()*pow(fQvector.Y(),2)+2.*fQvector.X()*fQvector.Y()*fQvector2n.Y()); 
830  fQvectorComponents->Fill(16.,Q2nQnQnstarQnstarQnstar22222,1); //in the 16th bin fill Re<Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*>
831  */
832  
833
834
835
836
837
838
839
840
841
842
843 /*
844
845
846
847
848
849
850
851
852  //-------------------------------------------------------------------------------------------------------------------------------- 
853  // multi-particle correlations calculated with nested loops (for integrated flow)
854  
855  // fDirectCorrelations was declared as TProfile:
856  // fDirectCorrelations = new TProfile("fDirectCorrelations","multi-particle correlations with nested loops",80,0,80);
857  
858  // phik is the azimuth of the kth particle in laboratory frame
859
860  // binning in fDirectCorrelations: 0..40 correlations needed for integrated flow; 40..80 0..40 correlations needed for differential flow 
861
862  // integrated flow
863  // 1st bin: <2>_{n|n}
864  // 2nd bin: <2>_{2n|2n}
865  // 3rd bin: <2>_{3n|3n}
866  // 4th bin: <2>_{4n|4n}
867  // 6th bin: <3>_{2n|n,n}
868  // 7th bin: <3>_{3n|2n,n}
869  // 8th bin: <3>_{4n|2n,2n}
870  // 9th bin: <3>_{4n|3n,n}
871  //11th bin: <4>_{n,n|n,n}
872  //12th bin: <4>_{2n,n|2n,n}
873  //13th bin: <4>_{3n|n,n,n}
874  //14th bin: <4>_{4n|2n,n,n}
875  //16th bin: <5>_{2n|n,n,n,n}
876  //21th bin: <6>_{n,n,n|n,n,n}
877  
878  //differential flow
879  //41st bin: <2'>_{n|n}
880  //42nd bin: <2'>_{2n|2n}
881  //46th bin: <3'>_{2n|n,n}
882  //47th bin: <3'>_{n,n|2n}
883  //51st bin: <4'>_{n,n|n,n}
884
885  Double_t phi1=0.,phi2=0.;
886  Double_t phi3=0.,phi4=0.;
887  Double_t phi5=0.,phi6=0.;
888
889  //<2>_{kn|kn} (k=1,2,3,4)
890  for(Int_t i=0;i<M;i++)
891  {
892   fTrack=anEvent->GetTrack(i);
893   phi1=fTrack->Phi();
894   for(Int_t j=0;j<M;j++)
895   {
896    if(j==i)continue;
897    fTrack=anEvent->GetTrack(j);
898    phi2=fTrack->Phi();
899    fDirectCorrelations->Fill(0.,cos(n*(phi1-phi2)),1);    //<2>_{n,n}
900    fDirectCorrelations->Fill(1.,cos(2.*n*(phi1-phi2)),1); //<2>_{2n,2n}
901    fDirectCorrelations->Fill(2.,cos(3.*n*(phi1-phi2)),1); //<2>_{3n,3n}
902    fDirectCorrelations->Fill(3.,cos(4.*n*(phi1-phi2)),1); //<2>_{4n,4n} 
903   }
904  }  
905      
906  //<3>_{2n,n,n}, <3>_{3n|2n,n}, <3>_{4n,2n,2n} and <3>_{4n,3n,n}
907  for(Int_t i=0;i<M;i++)
908  {
909   fTrack=anEvent->GetTrack(i);
910   phi1=fTrack->Phi();
911   for(Int_t j=0;j<M;j++)
912   {
913    if(j==i)continue;
914    fTrack=anEvent->GetTrack(j);
915    phi2=fTrack->Phi();
916    for(Int_t k=0;k<M;k++)
917    {
918     if(k==i||k==j)continue;
919     fTrack=anEvent->GetTrack(k);
920     phi3=fTrack->Phi();
921     fDirectCorrelations->Fill(5.,cos(2*n*phi1-n*(phi2+phi3)),1);        //<3>_{2n,n,n}
922     fDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1);    //<3>_{3n,2n,n}
923     fDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1); //<3>_{4n,2n,2n}
924     fDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1);    //<3>_{4n,3n,n}
925    }
926   }
927  }
928   
929  //<4>_{n,n,n,n}, <4>_{2n,n,2n,n}, <4>_{3n,n,n,n} and <4>_{4n,2n,n,n}
930  for(Int_t i=0;i<M;i++)
931  {
932   fTrack=anEvent->GetTrack(i);
933   phi1=fTrack->Phi();
934   for(Int_t j=0;j<M;j++)
935   {
936    if(j==i)continue;
937    fTrack=anEvent->GetTrack(j);
938    phi2=fTrack->Phi();
939    for(Int_t k=0;k<M;k++)
940    {
941     if(k==i||k==j)continue;
942     fTrack=anEvent->GetTrack(k);
943     phi3=fTrack->Phi();
944     for(Int_t l=0;l<M;l++)
945     {
946      if(l==i||l==j||l==k)continue;
947      fTrack=anEvent->GetTrack(l);
948      phi4=fTrack->Phi();
949      fDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1);       //<4>_{n,n,n,n}
950      fDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1); //<4>_{2n,n,2n,n}
951      fDirectCorrelations->Fill(12.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1);    //<4>_{3n,n,n,n}
952      fDirectCorrelations->Fill(13.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1); //<4>_{4n,2n,n,n}
953     }  
954    }
955   }
956  }
957  
958  
959  
960  
961  
962
963  */
964  
965  
966  
967  
968  
969  
970  
971  /*
972  //<5>_{2n,n,n,n,n}
973  for(Int_t i=0;i<nPrim;i++)
974  {
975   cout<<"i = "<<i<<endl;
976   fTrack=anEvent->GetTrack(i);
977   phi1=fTrack->Phi();
978   for(Int_t j=0;j<nPrim;j++)
979   {
980    if(j==i)continue;
981    fTrack=anEvent->GetTrack(j);
982    phi2=fTrack->Phi();
983    for(Int_t k=0;k<nPrim;k++)
984    {
985     if(k==i||k==j)continue;
986     fTrack=anEvent->GetTrack(k);
987     phi3=fTrack->Phi();
988     for(Int_t l=0;l<nPrim;l++)
989     {
990      if(l==i||l==j||l==k)continue;
991      fTrack=anEvent->GetTrack(l);
992      phi4=fTrack->Phi();
993      for(Int_t m=0;m<nPrim;m++)
994      {
995       if(m==i||m==j||m==k||m==l)continue;
996       fTrack=anEvent->GetTrack(m);
997       phi5=fTrack->Phi();
998       fDirectCorrelations->Fill(15.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1); //<5>_{2n,n,n,n,n}
999      }
1000     }  
1001    }
1002   }
1003  }
1004  
1005  
1006  
1007  //<6>_{n,n,n,n,n,n}
1008  for(Int_t i=0;i<nPrim;i++)
1009  {
1010   //cout<<"i = "<<i<<endl;
1011   fTrack=anEvent->GetTrack(i);
1012   phi1=fTrack->Phi();
1013   for(Int_t j=0;j<nPrim;j++)
1014   {
1015    if(j==i)continue;
1016    fTrack=anEvent->GetTrack(j);
1017    phi2=fTrack->Phi();
1018    for(Int_t k=0;k<nPrim;k++)
1019    {
1020     if(k==i||k==j)continue;
1021     fTrack=anEvent->GetTrack(k);
1022     phi3=fTrack->Phi();
1023     for(Int_t l=0;l<nPrim;l++)
1024     {
1025      if(l==i||l==j||l==k)continue;
1026      fTrack=anEvent->GetTrack(l);
1027      phi4=fTrack->Phi();
1028      for(Int_t m=0;m<nPrim;m++)
1029      {
1030       if(m==i||m==j||m==k||m==l)continue;
1031       fTrack=anEvent->GetTrack(m);
1032       phi5=fTrack->Phi();
1033       for(Int_t nn=0;nn<nPrim;nn++)
1034       {
1035        if(nn==i||nn==j||nn==k||nn==l||nn==m)continue;
1036        fTrack=anEvent->GetTrack(nn);
1037        phi6=fTrack->Phi(); 
1038        fDirectCorrelations->Fill(20.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1); //<6>_{n,n,n,n,n,n}
1039       } 
1040      }
1041     }  
1042    }
1043   }
1044  }
1045  */
1046  //-------------------------------------------------------------------------------------------------------------------------------- 
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060 /*
1061
1062
1063
1064
1065
1066  //-------------------------------------------------------------------------------------------------------------------------------- 
1067  // multi-particle correlations calculated with nested loops (for differential flow)
1068  
1069  //differential flow (see above how the binning in fDirectCorrelations is organized)
1070  //41st bin: <2'>_{n|n}
1071  //42nd bin: <2'>_{2n|2n}
1072  //46th bin: <3'>_{2n|n,n}
1073  //47th bin: <3'>_{n,n|2n}
1074  //51st bin: <4'>_{n,n|n,n}
1075  
1076  //<2'>_{n|n}
1077  for(Int_t i=0;i<M;i++)
1078  {
1079   fTrack=anEvent->GetTrack(i);
1080   if(fTrack->Pt()>=0.5&&fTrack->Pt()<0.6)
1081   {
1082    phi1=fTrack->Phi();
1083    for(Int_t j=0;j<M;j++)
1084    {
1085     if(j==i)continue;
1086     fTrack=anEvent->GetTrack(j);
1087     phi2=fTrack->Phi(); 
1088     fDirectCorrelations->Fill(40.,cos(1.*n*(phi1-phi2)),1); //<2'>_{n,n}
1089     fDirectCorrelations->Fill(41.,cos(2.*n*(phi1-phi2)),1); //<2'>_{2n,2n}  
1090    }
1091   }
1092  }  
1093
1094  //<3'>_{2n|n,n}
1095  for(Int_t i=0;i<M;i++)
1096  {
1097   fTrack=anEvent->GetTrack(i);
1098   if(fTrack->Pt()>=0.5&&fTrack->Pt()<0.6)
1099   {
1100    phi1=fTrack->Phi();
1101    for(Int_t j=0;j<M;j++)
1102    {
1103     if(j==i)continue;
1104     fTrack=anEvent->GetTrack(j);
1105     phi2=fTrack->Phi();
1106     for(Int_t k=0;k<M;k++)
1107     {
1108      if(k==i||k==j)continue;
1109      fTrack=anEvent->GetTrack(k);
1110      phi3=fTrack->Phi();           
1111      fDirectCorrelations->Fill(45.,cos(n*(2.*phi1-phi2-phi3)),1); //<3'>_{2n|n,n}
1112      fDirectCorrelations->Fill(46.,cos(n*(phi1+phi2-2.*phi3)),1); //<3'>_{n,n|2n}    
1113     }
1114    }  
1115   }  
1116  }
1117   
1118  //<4'>_{n,n|n,n}
1119  for(Int_t i=0;i<M;i++)
1120  {
1121   fTrack=anEvent->GetTrack(i);
1122   if(fTrack->Pt()>=0.5&&fTrack->Pt()<0.6)
1123   {
1124    phi1=fTrack->Phi();
1125    for(Int_t j=0;j<M;j++)
1126    {
1127     if(j==i)continue;
1128     fTrack=anEvent->GetTrack(j);
1129     phi2=fTrack->Phi();
1130     for(Int_t k=0;k<M;k++)
1131     {
1132      if(k==i||k==j)continue;
1133      fTrack=anEvent->GetTrack(k);
1134      phi3=fTrack->Phi();
1135      for(Int_t l=0;l<M;l++)
1136      {
1137       if(l==i||l==j||l==k)continue;
1138       fTrack=anEvent->GetTrack(l);
1139       phi4=fTrack->Phi();
1140       fDirectCorrelations->Fill(50.,cos(n*(phi1+phi2-phi3-phi4)),1); //<4'>_{n,n|n,n}   
1141      } 
1142     }
1143    }  
1144   }  
1145  }
1146  //--------------------------------------------------------------------------------------------------------------------------------  
1147
1148
1149
1150
1151
1152 */
1153
1154
1155
1156
1157
1158
1159
1160 //}//end of if
1161
1162
1163 }//end of Make()
1164
1165 //================================================================================================================
1166
1167 void AliFlowAnalysisWithQCumulants::Finish()
1168 {
1169  //not needed for the time being...
1170 }
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188