1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /**********************************
17 * functions and equations needed *
18 * for calculation of cumulants *
19 * and final flow estimates *
21 * author: Ante Bilandzic *
23 *********************************/
25 #define AliCumulantsFunctions_cxx
27 #include "Riostream.h"
31 #include "TParticle.h"
36 #include "TProfile2D.h"
37 #include "TProfile3D.h"
41 #include "AliFlowEventSimple.h"
42 #include "AliFlowTrackSimple.h"
43 #include "AliFlowAnalysisWithCumulants.h"
44 #include "AliFlowCumuConstants.h"
45 #include "AliFlowCommonConstants.h"
46 #include "AliFlowCommonHist.h"
47 #include "AliFlowCommonHistResults.h"
48 #include "AliCumulantsFunctions.h"
50 ClassImp(AliCumulantsFunctions)
52 //================================================================================================================_
54 AliCumulantsFunctions::AliCumulantsFunctions():
56 fIntGenFun4(NULL),//only for other system of Eq.
57 fIntGenFun6(NULL),//only for other system of Eq.
58 fIntGenFun8(NULL),//only for other system of Eq.
59 fIntGenFun16(NULL),//only for other system of Eq.
60 fAvMult4(NULL),//only for other system of Eq.
61 fAvMult6(NULL),//only for other system of Eq.
62 fAvMult8(NULL),//only for other system of Eq.
63 fAvMult16(NULL),//only for other system of Eq.
64 fDiffPtRPGenFunRe(NULL),
65 fDiffPtRPGenFunIm(NULL),
66 fPtBinRPNoOfParticles(NULL),
67 fDiffEtaRPGenFunRe(NULL),
68 fDiffEtaRPGenFunIm(NULL),
69 fEtaBinRPNoOfParticles(NULL),
70 fDiffPtPOIGenFunRe(NULL),
71 fDiffPtPOIGenFunIm(NULL),
72 fPtBinPOINoOfParticles(NULL),
73 fDiffEtaPOIGenFunRe(NULL),
74 fDiffEtaPOIGenFunIm(NULL),
75 fEtaBinPOINoOfParticles(NULL),
83 fAverageOfSquaredWeight(NULL),
88 fch(NULL)//common control histograms
108 //default constructor
111 AliCumulantsFunctions::~AliCumulantsFunctions()
116 AliCumulantsFunctions::AliCumulantsFunctions(TProfile2D *intGenFun, TProfile2D *intGenFun4, TProfile2D *intGenFun6, TProfile2D *intGenFun8, TProfile2D *intGenFun16, TProfile *avMult4, TProfile *avMult6, TProfile *avMult8, TProfile *avMult16, TProfile3D *diffPtRPGenFunRe, TProfile3D *diffPtRPGenFunIm, TProfile *ptBinRPNoOfParticles, TProfile3D *diffEtaRPGenFunRe, TProfile3D *diffEtaRPGenFunIm, TProfile *etaBinRPNoOfParticles, TProfile3D *diffPtPOIGenFunRe, TProfile3D *diffPtPOIGenFunIm, TProfile *ptBinPOINoOfParticles, TProfile3D *diffEtaPOIGenFunRe, TProfile3D *diffEtaPOIGenFunIm, TProfile *etaBinPOINoOfParticles, TH1D *ifr, TH1D *dfr2, TH1D *dfr4, TH1D *dfr6, TH1D *dfr8, TProfile *avMult, TProfile *qVector, TProfile *averageOfSquaredWeight, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th, AliFlowCommonHist *ch):
117 fIntGenFun(intGenFun),
118 fIntGenFun4(intGenFun4),//only for other system of Eq.
119 fIntGenFun6(intGenFun6),//only for other system of Eq.
120 fIntGenFun8(intGenFun8),//only for other system of Eq.
121 fIntGenFun16(intGenFun16),//only for other system of Eq.
122 fAvMult4(avMult4),//only for other system of Eq.
123 fAvMult6(avMult6),//only for other system of Eq.
124 fAvMult8(avMult8),//only for other system of Eq.
125 fAvMult16(avMult16),//only for other system of Eq.
126 fDiffPtRPGenFunRe(diffPtRPGenFunRe),
127 fDiffPtRPGenFunIm(diffPtRPGenFunIm),
128 fPtBinRPNoOfParticles(ptBinRPNoOfParticles),
129 fDiffEtaRPGenFunRe(diffEtaRPGenFunRe),
130 fDiffEtaRPGenFunIm(diffEtaRPGenFunIm),
131 fEtaBinRPNoOfParticles(etaBinRPNoOfParticles),
132 fDiffPtPOIGenFunRe(diffPtPOIGenFunRe),
133 fDiffPtPOIGenFunIm(diffPtPOIGenFunIm),
134 fPtBinPOINoOfParticles(ptBinPOINoOfParticles),
135 fDiffEtaPOIGenFunRe(diffEtaPOIGenFunRe),
136 fDiffEtaPOIGenFunIm(diffEtaPOIGenFunIm),
137 fEtaBinPOINoOfParticles(etaBinPOINoOfParticles),
145 fAverageOfSquaredWeight(averageOfSquaredWeight),
150 fch(ch)//common control histograms
173 //================================================================================================================
175 void AliCumulantsFunctions::Calculate()
177 //calculate cumulants and final integrated and differential flow estimates and store the results into output histograms
178 const Int_t cQmax=AliFlowCumuConstants::GetMaster()->GetQmax(); //needed for numerics
179 const Int_t cPmax=AliFlowCumuConstants::GetMaster()->GetPmax(); //needed for numerics
180 const Int_t cQmax4=AliFlowCumuConstants::GetMaster()->GetQmax4(); //needed for numerics
181 const Int_t cPmax4=AliFlowCumuConstants::GetMaster()->GetPmax4(); //needed for numerics
182 const Int_t cQmax6=AliFlowCumuConstants::GetMaster()->GetQmax6(); //needed for numerics
183 const Int_t cPmax6=AliFlowCumuConstants::GetMaster()->GetPmax6(); //needed for numerics
184 const Int_t cQmax8=AliFlowCumuConstants::GetMaster()->GetQmax8(); //needed for numerics
185 const Int_t cPmax8=AliFlowCumuConstants::GetMaster()->GetPmax8(); //needed for numerics
186 const Int_t cQmax16=AliFlowCumuConstants::GetMaster()->GetQmax16(); //needed for numerics
187 const Int_t cPmax16=AliFlowCumuConstants::GetMaster()->GetPmax16(); //needed for numerics
189 const Int_t cFlow=AliFlowCumuConstants::GetMaster()->GetFlow(); //integrated flow coefficient to be calculated
190 const Int_t cMltpl=AliFlowCumuConstants::GetMaster()->GetMltpl(); //the multiple in p=m*n (diff. flow)
191 const Int_t cnBinsPt=100; //number of pt bins //to be improved
192 const Int_t cnBinsEta=80; //number of eta bins //to be improved
194 Double_t fR0=AliFlowCumuConstants::GetMaster()->GetR0(); //needed for numerics
195 //Double_t fPtMax=AliFlowCommonConstants::GetMaster()->GetPtMax(); //maximum pt
196 //Double_t fPtMin=AliFlowCommonConstants::GetMaster()->GetPtMin(); //minimum pt
197 //Double_t fBinWidthPt=(fPtMax-fPtMin)/cnBinsPt; //width of pt bin (in GeV)
199 Bool_t fOtherEquations=AliFlowCumuConstants::GetMaster()->GetOtherEquations(); //numerical equations for cumulants solved up to different highest order
201 //avarage selected multiplicity
205 dAvM=fAvMult->GetBinContent(1);
212 nEvents=(Int_t)(fAvMult->GetBinEntries(1));
216 Double_t dAvQx=0.,dAvQy=0.,dAvQ2x=0.,dAvQ2y=0.;
219 dAvQx = fQVector->GetBinContent(1); //<Q_x>
220 dAvQy = fQVector->GetBinContent(2); //<Q_y>
221 dAvQ2x = fQVector->GetBinContent(3); //<(Q_x)^2>
222 dAvQ2y = fQVector->GetBinContent(4); //<(Q_y)^2>
229 dAvw2 = fAverageOfSquaredWeight->GetBinContent(1);
233 cout<<"WARNING: Average squared weight is 0 in GFC. Most probably one of the histograms in <weights.root> is empty. Nothing will be calculated !!!!"<<endl;
239 TMatrixD dAvG(cPmax, cQmax);
240 Bool_t someAvGEntryIsNegative=kFALSE;
243 for(Int_t p=0;p<cPmax;p++)
245 for(Int_t q=0;q<cQmax;q++)
247 dAvG(p,q)=fIntGenFun->GetBinContent(p+1,q+1);
250 someAvGEntryIsNegative=kTRUE;
256 /////////////////////////////////////////////////////////////////////////////
257 //////////////////gen. function for the cumulants////////////////////////////
258 /////////////////////////////////////////////////////////////////////////////
260 TMatrixD dC(cPmax, cQmax);//C[p][q]
261 if(dAvM>0 && someAvGEntryIsNegative==kFALSE)
263 for(Int_t p=0;p<cPmax;p++)
265 for(Int_t q=0;q<cQmax;q++)
267 dC(p,q)=1.*dAvM*(pow(dAvG(p,q),(1./dAvM))-1.);
272 /////////////////////////////////////////////////////////////////////////////
273 ///////avaraging the gen. function for the cumulants over azimuth////////////
274 /////////////////////////////////////////////////////////////////////////////
276 TVectorD dAvC(cPmax);//<C[p][q]>
277 Double_t tempHere=0.;
278 for(Int_t p=0;p<cPmax;p++)
281 for(Int_t q=0;q<cQmax;q++)
283 tempHere+=1.*dC(p,q);
285 dAvC[p]=1.*tempHere/cQmax;
288 /////////////////////////////////////////////////////////////////////////////
289 //////////////////////////////////final results//////////////////////////////
290 /////////////////////////////////////////////////////////////////////////////
292 TVectorD cumulant(cPmax);//array to store various order cumulants
294 //system of eq. for the cumulants
295 cumulant[0] = (-1./(60*fR0*fR0))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
296 cumulant[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
297 cumulant[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
298 cumulant[3] = (-24./pow(fR0,8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
299 cumulant[4] = (120./pow(fR0,10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
303 cout<<"*********************************"<<endl;
304 cout<<"cumulants:"<<endl;
305 cout<<" c_"<<cFlow<<"{2} = "<<cumulant[0]<<endl;
306 cout<<" c_"<<cFlow<<"{4} = "<<cumulant[1]<<endl;
307 cout<<" c_"<<cFlow<<"{6} = "<<cumulant[2]<<endl;
308 cout<<" c_"<<cFlow<<"{8} = "<<cumulant[3]<<endl;
309 cout<<"c_"<<cFlow<<"{10} = "<<cumulant[4]<<endl;
313 Double_t dV2=0.,dV4=0.,dV6=0.,dV8=0.,dV10=0.;//integrated flow estimates
317 dV2=pow(cumulant[0],(1./2.));
321 dV4=pow(-cumulant[1],(1./4.));
325 dV6=pow((1./4.)*cumulant[2],(1./6.));
329 dV8=pow(-(1./33.)*cumulant[3],(1./8.));
333 dV10=pow((1./456.)*cumulant[4],(1./10.));
337 cout<<"***************************************"<<endl;
338 cout<<"***************************************"<<endl;
339 cout<<"flow estimates from GF-cumulants: "<<endl;
342 Double_t sdQ[4]={0.};
343 Double_t chiQ[4]={0.};
346 if(nEvents>0 && dAvM>0 && dAvw2>0 && cumulant[0]>=0.)
348 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(cumulant[0],(1./2.))*(dAvM/dAvw2),2.)>0.))
350 chiQ[0]=(dAvM*dV2)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM/dAvw2,2.),0.5); // to be improved, analogously for higher orders
354 sdQ[0]=pow(((1./(2.*dAvM*nEvents))*((1.+2.*pow(chiQ[0],2))/(2.*pow(chiQ[0],2)))),0.5);
356 cout<<" v_"<<cFlow<<"{2} = "<<dV2<<" +/- "<<sdQ[0]<<endl;
357 //cout<<" v_"<<cFlow<<"{2} = "<<dV2<<" +/- "<<sdQ[0]<<", chi{2} = "<<chiQ[0]<<endl;//printing also the chi
358 fifr->SetBinContent(1,dV2);
359 fifr->SetBinError(1,sdQ[0]);
360 //filling common histograms:
361 fchr2nd->FillIntegratedFlow(dV2,sdQ[0]);
362 fchr2nd->FillChi(chiQ[0]);
366 fchr2nd->FillIntegratedFlowRP(dV2,sdQ[0]);
367 fchr2nd->FillChiRP(chiQ[0]);
373 cout<<" v_"<<cFlow<<"{2} = Im"<<endl;
377 if(nEvents>0 && dAvM>0 && dAvw2>0 && cumulant[1]<=0.)
379 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-cumulant[1],(1./4.))*(dAvM/dAvw2),2.)>0.))
381 chiQ[1]=(dAvM*dV4)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM/dAvw2,2.),0.5);
385 sdQ[1]=(1./(pow(2.*dAvM*nEvents,0.5)))*pow((1.+4.*pow(chiQ[1],2)+1.*pow(chiQ[1],4.)+2.*pow(chiQ[1],6.))/(2.*pow(chiQ[1],6.)),0.5);
387 cout<<" v_"<<cFlow<<"{4} = "<<dV4<<" +/- "<<sdQ[1]<<endl;
388 //cout<<" v_"<<cFlow<<"{4} = "<<dV4<<" +/- "<<sdQ[1]<<", chi{4} = "<<chiQ[1]<<endl;//printing also the chi
389 fifr->SetBinContent(2,dV4);
390 fifr->SetBinError(2,sdQ[1]);
391 //filling common histograms:
392 fchr4th->FillIntegratedFlow(dV4,sdQ[1]);
393 fchr4th->FillChi(chiQ[1]);
397 fchr4th->FillIntegratedFlowRP(dV4,sdQ[1]);
398 fchr4th->FillChiRP(chiQ[1]);
404 cout<<" v_"<<cFlow<<"{4} = Im"<<endl;
408 if(nEvents>0 && dAvM>0 && dAvw2>0 && cumulant[2]>=0.)
410 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*cumulant[2],(1./6.))*(dAvM/dAvw2),2.)>0.))
412 chiQ[2]=(dAvM*dV6)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV6*dAvM/dAvw2,2.),0.5);
416 sdQ[2]=(1./(pow(2.*dAvM*nEvents,0.5)))*pow((3.+18.*pow(chiQ[2],2)+9.*pow(chiQ[2],4.)+28.*pow(chiQ[2],6.)+12.*pow(chiQ[2],8.)+24.*pow(chiQ[2],10.))/(24.*pow(chiQ[2],10.)),0.5);
418 cout<<" v_"<<cFlow<<"{6} = "<<dV6<<" +/- "<<sdQ[2]<<endl;
419 //cout<<" v_"<<cFlow<<"{6} = "<<dV6<<" +/- "<<sdQ[2]<<", chi{6} = "<<chiQ[2]<<endl;//printing also the chi
420 fifr->SetBinContent(3,dV6);
421 fifr->SetBinError(3,sdQ[2]);
422 //filling common histograms:
423 fchr6th->FillIntegratedFlow(dV6,sdQ[2]);
424 fchr6th->FillChi(chiQ[2]);
428 fchr6th->FillIntegratedFlowRP(dV6,sdQ[2]);
429 fchr6th->FillChiRP(chiQ[2]);
436 cout<<" v_"<<cFlow<<"{6} = Im"<<endl;
440 if(nEvents>0 && dAvM>0 && dAvw2>0 && cumulant[3]<=0.)
442 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*cumulant[3],(1./8.))*(dAvM/dAvw2),2.)>0.))
444 chiQ[3]=(dAvM*dV8)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV8*dAvM/dAvw2,2.),0.5);
448 sdQ[3]=(1./(pow(2.*dAvM*nEvents,0.5)))*pow((12.+96.*pow(chiQ[3],2.)+72.*pow(chiQ[3],4.)+304.*pow(chiQ[3],6.)+257.*pow(chiQ[3],8.)+804.*pow(chiQ[3],10.)+363.*pow(chiQ[3],12.)+726.*pow(chiQ[3],14.))/(726.*pow(chiQ[3],14.)),0.5);
450 cout<<" v_"<<cFlow<<"{8} = "<<dV8<<" +/- "<<sdQ[3]<<endl;
451 //cout<<" v_"<<cFlow<<"{8} = "<<dV8<<" +/- "<<sdQ[3]<<", chi{8} = "<<chiQ[3]<<endl;//printing also the chi
452 fifr->SetBinContent(4,dV8);
453 fifr->SetBinError(4,sdQ[3]);
454 //filling common histograms:
455 fchr8th->FillIntegratedFlow(dV8,sdQ[3]);
456 fchr8th->FillChi(chiQ[3]);
459 fchr8th->FillIntegratedFlowRP(dV8,sdQ[3]);
460 fchr8th->FillChiRP(chiQ[3]);
466 cout<<" v_"<<cFlow<<"{8} = Im"<<endl;
471 if (dAvM && cumulant[4]>=0.)
473 cout<<"v_"<<cFlow<<"{10} = "<<dV10<<endl;
477 cout<<"v_"<<cFlow<<"{10} = Im"<<endl;
482 cout<<" nEvts = "<<nEvents<<", AvM = "<<dAvM<<endl;
483 cout<<"***************************************"<<endl;
484 cout<<"***************************************"<<endl;
487 //===========================================================================
488 // RP = Reaction Plane
489 //===========================================================================
491 /////////////////////////////////////////////////////////////////////////////
492 ///////////////////////DIFFERENTIAL FLOW CALCULATIONS////////////////////////
493 /////////////////////////////////////////////////////////////////////////////
495 TVectorD ptXRP(cnBinsPt * cPmax * cQmax);
496 TVectorD ptYRP(cnBinsPt * cPmax * cQmax);
497 TVectorD ptBinRPNoOfParticles(cnBinsPt);
499 //3D profiles (for pt)
500 for(Int_t b=0;b<cnBinsPt;b++)
502 ptBinRPNoOfParticles[b]=fPtBinRPNoOfParticles->GetBinEntries(b+1);
504 for(Int_t p=0;p<cPmax;p++)
506 for(Int_t q=0;q<cQmax;q++)
510 if(fDiffPtRPGenFunRe)
512 ptXRP[index3d(b,p,q,cnBinsPt,cPmax)]=fDiffPtRPGenFunRe->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
514 if(fDiffPtRPGenFunIm)
516 ptYRP[index3d(b,p,q,cnBinsPt,cPmax)]=fDiffPtRPGenFunIm->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
523 TVectorD etaXRP(cnBinsEta*cPmax*cQmax);
524 TVectorD etaYRP(cnBinsEta*cPmax*cQmax);
525 TVectorD etaBinRPNoOfParticles(cnBinsEta);
527 //3D profiles (for eta)
528 for(Int_t b=0;b<cnBinsEta;b++)
530 etaBinRPNoOfParticles[b]=fEtaBinRPNoOfParticles->GetBinEntries(b);
531 for(Int_t p=0;p<cPmax;p++)
533 for(Int_t q=0;q<cQmax;q++)
537 if(fDiffEtaRPGenFunRe)
539 etaXRP[index3d(b,p,q,cnBinsEta,cPmax)]=fDiffEtaRPGenFunRe->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
541 if(fDiffEtaRPGenFunIm)
543 etaYRP[index3d(b,p,q,cnBinsEta,cPmax)]=fDiffEtaRPGenFunIm->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
551 //-------------------------------------------------------------------------------------------------------------------------------
552 //final results for differential flow (in pt):
553 TMatrixD ptDRP(cnBinsPt, cPmax);
554 Double_t tempSumForptDRP=0.;
555 for (Int_t b=0;b<cnBinsPt;b++)
557 for (Int_t p=0;p<cPmax;p++)
560 for (Int_t q=0;q<cQmax;q++)
562 tempSumForptDRP+=cos(cMltpl*2.*q*TMath::Pi()/cQmax)*ptXRP[index3d(b,p,q,cnBinsPt,cPmax)] + sin(cMltpl*2.*q*TMath::Pi()/cQmax)*ptYRP[index3d(b,p,q,cnBinsPt,cPmax)];
564 ptDRP(b,p)=1.*(pow(fR0*pow(p+1.0,0.5),cMltpl)/cQmax)*tempSumForptDRP;
568 Double_t ptRPDiffCumulant2[cnBinsPt]={0.};
569 Double_t ptRPDiffCumulant4[cnBinsPt]={0.};
570 Double_t ptRPDiffCumulant6[cnBinsPt]={0.};
571 Double_t ptRPDiffCumulant8[cnBinsPt]={0.};
572 Double_t ptRPDiffCumulant10[cnBinsPt]={0.};
574 for (Int_t b=0;b<cnBinsPt;b++)
576 ptRPDiffCumulant2[b]=(1./(fR0*fR0))*(5.*ptDRP(b,0)-5.*ptDRP(b,1)+(10./3.)*ptDRP(b,2)-(5./4.)*ptDRP(b,3)+(1./5.)*ptDRP(b,4));
577 ptRPDiffCumulant4[b]=(1./pow(fR0,4.))*((-77./6.)*ptDRP(b,0)+(107./6.)*ptDRP(b,1)-(13./1.)*ptDRP(b,2)+(61./12.)*ptDRP(b,3)-(5./6.)*ptDRP(b,4));
578 ptRPDiffCumulant6[b]=(1./pow(fR0,6.))*((71./2.)*ptDRP(b,0)-59.*ptDRP(b,1)+49.*ptDRP(b,2)-(41./2.)*ptDRP(b,3)+(7./2.)*ptDRP(b,4));
579 ptRPDiffCumulant8[b]=(1./pow(fR0,8.))*(-84.*ptDRP(b,0)+156.*ptDRP(b,1)-144.*ptDRP(b,2)+66.*ptDRP(b,3)-12.*ptDRP(b,4));
580 ptRPDiffCumulant10[b]=(1./pow(fR0,10.))*(120.*ptDRP(b,0)-240.*ptDRP(b,1)+240.*ptDRP(b,2)-120.*ptDRP(b,3)+24.*ptDRP(b,4));
583 //diff. flow values per pt bin:
584 Double_t v2ptRP[cnBinsPt]={0.};
585 Double_t v4ptRP[cnBinsPt]={0.};
586 Double_t v6ptRP[cnBinsPt]={0.};
587 Double_t v8ptRP[cnBinsPt]={0.};
590 Double_t sdRPDiff2pt[cnBinsPt]={0.};
591 Double_t sdRPDiff4pt[cnBinsPt]={0.};
592 //Double_t sdDiff6pt[cnBinsPt]={0.};//to be improved (calculation needed)
593 //Double_t sdDiff8pt[cnBinsPt]={0.};//to be improved (calculation needed)
595 //cout<<"number of pt bins: "<<cnBinsPt<<endl;
596 //cout<<"****************************************"<<endl;
597 for (Int_t b=0;b<cnBinsPt;b++){
598 //cout<<"pt bin: "<<b*fBinWidthPt<<"-"<<(b+1)*fBinWidthPt<<" GeV"<<endl;
603 v2ptRP[b]=ptRPDiffCumulant2[b]/pow(cumulant[0],0.5);
604 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0. && ptBinRPNoOfParticles[b]>0.)
608 sdRPDiff2pt[b]=pow((1./(2.*ptBinRPNoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
610 //cout<<"v'_2/2{2} = "<<v2ptRP[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdRPDiff2pt[b]<<"%"<<endl;
611 fdfr2->SetBinContent(b+1,v2ptRP[b]);
612 fdfr2->SetBinError(b+1,sdRPDiff2pt[b]);
614 fchr2nd->FillDifferentialFlow(b+1,v2ptRP[b],sdRPDiff2pt[b]);
618 fchr2nd->FillDifferentialFlowPtRP(b+1,v2ptRP[b],sdRPDiff2pt[b]);
622 //cout<<"v'_2/2{2} = Im"<<endl;
625 //cout<<"v'_2/2{2} = Im"<<endl;
631 v4ptRP[b]=-ptRPDiffCumulant4[b]/pow(-cumulant[1],.75);
632 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&ptBinRPNoOfParticles[b]>0.) // to be improved
636 sdRPDiff4pt[b]=pow((1./(2.*ptBinRPNoOfParticles[b]))*((2.+6.*pow(chiQ[1],2.)+pow(chiQ[1],4.)+pow(chiQ[1],6.))/pow(chiQ[1],6.)),0.5);
638 //cout<<"v'_2/2{4} = "<<v4ptRP[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdRPDiff4pt[b]<<"%"<<endl;
639 fdfr4->SetBinContent(b+1,v4ptRP[b]);
640 fdfr4->SetBinError(b+1,sdRPDiff4pt[b]);
642 fchr4th->FillDifferentialFlow(b+1,v4ptRP[b],sdRPDiff4pt[b]);
647 fchr4th->FillDifferentialFlowPtRP(b+1,v4ptRP[b],sdRPDiff4pt[b]);
653 //cout<<"v'_2/2{4} = Im"<<endl;
656 //cout<<"v'_2/2{4} = Im"<<endl;
661 //cout<<"v'_2/2{6} = "<<100.*ptRPDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)))<<"%"<<endl;
662 v6ptRP[b]=ptRPDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)));
663 fdfr6->SetBinContent(b+1,v6ptRP[b]);
665 fchr6th->FillDifferentialFlow(b+1,v6ptRP[b],0.);
670 fchr6th->FillDifferentialFlowPtRP(b+1,v6ptRP[b],0.);
677 //cout<<"v'_2/2{6} = Im"<<endl;
682 //cout<<"v'_2/2{8} = "<<-100.*ptRPDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)))<<"%"<<endl;
683 v8ptRP[b]=-ptRPDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)));
684 fdfr8->SetBinContent(b+1,v8ptRP[b]);
686 fchr8th->FillDifferentialFlow(b+1,v8ptRP[b],0.);
691 fchr8th->FillDifferentialFlowPtRP(b+1,v8ptRP[b],0.);
697 //cout<<"v'_2/2{8} = Im"<<endl;
699 //cout<<"****************************************"<<endl;
701 //-------------------------------------------------------
705 ///////////////////////////////////////////////////////////////////////////////////
706 //////////////////////// INTEGRATED FLOW CALCULATIONS (RP) /////////////////////////
707 ///////////////////////////////////////////////////////////////////////////////////
709 Double_t dV2RP=0., dV4RP=0., dV6RP=0., dV8RP=0.;
710 Double_t dV2RPError=0., dV4RPError=0., dV6RPError=0., dV8RPError=0.;
711 Double_t dSumOfYieldRP=0.;
712 for (Int_t b=1;b<cnBinsPt+1;b++)
714 if(fch->GetHistPtRP())
716 dSumOfYieldRP+=(fch->GetHistPtRP())->GetBinContent(b);
717 if(fchr2nd->GetHistDiffFlowPtRP())
719 dV2RP+=((fchr2nd->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtRP())->GetBinContent(b);
720 dV2RPError+=pow((fch->GetHistPtRP())->GetBinContent(b),2.)*pow((fchr2nd->GetHistDiffFlowPtRP())->GetBinError(b),2.);
722 if(fchr4th->GetHistDiffFlowPtRP())
724 dV4RP+=((fchr4th->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtRP())->GetBinContent(b);
725 dV4RPError+=pow((fch->GetHistPtRP())->GetBinContent(b),2.)*pow((fchr4th->GetHistDiffFlowPtRP())->GetBinError(b),2.);
727 if(fchr6th->GetHistDiffFlowPtRP())
729 dV6RP+=((fchr6th->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtRP())->GetBinContent(b);
730 dV6RPError+=pow((fch->GetHistPtRP())->GetBinContent(b),2.)*pow((fchr6th->GetHistDiffFlowPtRP())->GetBinError(b),2.);
732 if(fchr8th->GetHistDiffFlowPtRP())
734 dV8RP+=((fchr8th->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtRP())->GetBinContent(b);
735 dV8RPError+=pow((fch->GetHistPtRP())->GetBinContent(b),2.)*pow((fchr8th->GetHistDiffFlowPtRP())->GetBinError(b),2.);
742 dV2RP/=dSumOfYieldRP;
743 dV2RPError/=(dSumOfYieldRP*dSumOfYieldRP);
744 dV4RP/=dSumOfYieldRP;
745 dV4RPError/=(dSumOfYieldRP*dSumOfYieldRP);
746 dV6RP/=dSumOfYieldRP;
747 dV6RPError/=(dSumOfYieldRP*dSumOfYieldRP);
748 dV8RP/=dSumOfYieldRP;
749 dV8RPError/=(dSumOfYieldRP*dSumOfYieldRP);
750 fchr2nd->FillIntegratedFlowRP(dV2RP,pow(dV2RPError,0.5));
751 fchr4th->FillIntegratedFlowRP(dV4RP,pow(dV4RPError,0.5));
752 fchr6th->FillIntegratedFlowRP(dV6RP,pow(dV6RPError,0.5));//to be improved (errors needed)
753 fchr8th->FillIntegratedFlowRP(dV8RP,pow(dV8RPError,0.5));//to be improved (errors needed)
757 cout<<"***************************************"<<endl;
758 cout<<"***************************************"<<endl;
759 cout<<"flow estimates from GF-cumulants (RP):"<<endl;
762 cout<<" v_"<<cFlow<<"{2} = "<<dV2RP<<" +/- "<<pow(dV2RPError,0.5)<<endl;
763 cout<<" v_"<<cFlow<<"{4} = "<<dV4RP<<" +/- "<<pow(dV4RPError,0.5)<<endl;
764 cout<<" v_"<<cFlow<<"{6} = "<<dV6RP<<" +/- "<<pow(dV6RPError,0.5)<<endl;
765 cout<<" v_"<<cFlow<<"{8} = "<<dV8RP<<" +/- "<<pow(dV8RPError,0.5)<<endl;
768 cout<<" nEvts = "<<(fch->GetHistMultRP())->GetEntries()<<", AvM = "<<(fch->GetHistMultRP())->GetMean()<<endl;
769 cout<<"***************************************"<<endl;
770 cout<<"***************************************"<<endl;
801 //-------------------------------------------------------------------------------------------------------------------------------
802 //final results for differential flow (in eta):
803 TMatrixD etaDRP(cnBinsEta,cPmax);
804 Double_t tempSumForEtaDRP=0.;
805 for (Int_t b=0;b<cnBinsEta;b++)
807 for (Int_t p=0;p<cPmax;p++)
810 for (Int_t q=0;q<cQmax;q++)
812 tempSumForEtaDRP+=cos(cMltpl*2.*q*TMath::Pi()/cQmax)*etaXRP[index3d(b,p,q,cnBinsEta,cPmax)] + sin(cMltpl*2.*q*TMath::Pi()/cQmax)*etaYRP[index3d(b,p,q,cnBinsEta,cPmax)];
814 etaDRP(b,p)=1.*(pow(fR0*pow(p+1.,.5),cMltpl)/cQmax)*tempSumForEtaDRP;
818 Double_t etaRPDiffCumulant2[cnBinsEta]={0.};
819 Double_t etaRPDiffCumulant4[cnBinsEta]={0.};
820 Double_t etaRPDiffCumulant6[cnBinsEta]={0.};
821 Double_t etaRPDiffCumulant8[cnBinsEta]={0.};
822 Double_t etaRPDiffCumulant10[cnBinsEta]={0.};
824 for (Int_t b=0;b<cnBinsEta;b++)
826 etaRPDiffCumulant2[b]=(1./(fR0*fR0))*(5.*etaDRP(b,0)-5.*etaDRP(b,1)+(10./3.)*etaDRP(b,2)-(5./4.)*etaDRP(b,3)+(1./5.)*etaDRP(b,4));
827 etaRPDiffCumulant4[b]=(1./pow(fR0,4.))*((-77./6.)*etaDRP(b,0)+(107./6.)*etaDRP(b,1)-(13./1.)*etaDRP(b,2)+(61./12.)*etaDRP(b,3)-(5./6.)*etaDRP(b,4));
828 etaRPDiffCumulant6[b]=(1./pow(fR0,6.))*((71./2.)*etaDRP(b,0)-59.*etaDRP(b,1)+49.*etaDRP(b,2)-(41./2.)*etaDRP(b,3)+(7./2.)*etaDRP(b,4));
829 etaRPDiffCumulant8[b]=(1./pow(fR0,8.))*(-84.*etaDRP(b,0)+156.*etaDRP(b,1)-144.*etaDRP(b,2)+66.*etaDRP(b,3)-12.*etaDRP(b,4));
830 etaRPDiffCumulant10[b]=(1./pow(fR0,10.))*(120.*etaDRP(b,0)-240.*etaDRP(b,1)+240.*etaDRP(b,2)-120.*etaDRP(b,3)+24.*etaDRP(b,4));
833 //diff. flow values per eta bin:
834 Double_t v2etaRP[cnBinsEta]={0.};
835 Double_t v4etaRP[cnBinsEta]={0.};
836 Double_t v6etaRP[cnBinsEta]={0.};
837 Double_t v8etaRP[cnBinsEta]={0.};
840 Double_t sdRPDiff2eta[cnBinsEta]={0.};
841 Double_t sdRPDiff4eta[cnBinsEta]={0.};
842 //Double_t sdDiff6eta[cnBinsEta]={0.};//to be improved (calculation needed)
843 //Double_t sdDiff8eta[cnBinsEta]={0.};//to be improved (calculation needed)
845 //cout<<"number of eta bins: "<<cnBinsEta<<endl;
846 //cout<<"****************************************"<<endl;
847 for (Int_t b=0;b<cnBinsEta;b++){
848 //cout<<"eta bin: "<<b*fBinWidthPt<<"-"<<(b+1)*fBinWidthPt<<" GeV"<<endl;
853 v2etaRP[b]=etaRPDiffCumulant2[b]/pow(cumulant[0],0.5);
854 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0. && etaBinRPNoOfParticles[b]>0.) // to be improved
858 sdRPDiff2eta[b]=pow((1./(2.*etaBinRPNoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
860 //cout<<"v'_2/2{2} = "<<v2etaRP[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdDiff2eta[b]<<"%"<<endl;
861 //fdfr2->SetBinContent(b+1,v2etaRP[b]);
862 //fdfr2->SetBinError(b+1,sdDiff2eta[b]);
864 //fchr2nd->FillDifferentialFlow(b+1,v2etaRP[b],sdDiff2eta[b]);
868 fchr2nd->FillDifferentialFlowEtaRP(b+1,v2etaRP[b],sdRPDiff2eta[b]);
873 //cout<<"v'_2/2{2} = Im"<<endl;
876 //cout<<"v'_2/2{2} = Im"<<endl;
882 v4etaRP[b]=-etaRPDiffCumulant4[b]/pow(-cumulant[1],0.75);
883 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&etaBinRPNoOfParticles[b]>0.) // to be improved
887 sdRPDiff4eta[b]=pow((1./(2.*etaBinRPNoOfParticles[b]))*((2.+6.*pow(chiQ[1],2.)+pow(chiQ[1],4.)+pow(chiQ[1],6.))/pow(chiQ[1],6.)),0.5);
889 //cout<<"v'_2/2{4} = "<<v4eta[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdDiff4eta[b]<<"%"<<endl;
890 //fdfr4->SetBinContent(b+1,v4eta[b]);
891 //fdfr4->SetBinError(b+1,sdDiff4eta[b]);
893 //fchr4th->FillDifferentialFlow(b+1,v4eta[b],sdDiff4eta[b]);
898 fchr4th->FillDifferentialFlowEtaRP(b+1,v4etaRP[b],sdRPDiff4eta[b]);
904 //cout<<"v'_2/2{4} = Im"<<endl;
907 //cout<<"v'_2/2{4} = Im"<<endl;
912 //cout<<"v'_2/2{6} = "<<100.*etaRPDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)))<<"%"<<endl;
913 v6etaRP[b]=etaRPDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)));
914 //fdfr6->SetBinContent(b+1,v6eta[b]);
916 //fchr6th->FillDifferentialFlow(b+1,v6eta[b],0.);
921 fchr6th->FillDifferentialFlowEtaRP(b+1,v6etaRP[b],0.);
928 //cout<<"v'_2/2{6} = Im"<<endl;
933 //cout<<"v'_2/2{8} = "<<-100.*etaRPDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)))<<"%"<<endl;
934 v8etaRP[b]=-etaRPDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)));
935 //fdfr8->SetBinContent(b+1,v8eta[b]);
937 //fchr8th->FillDifferentialFlow(b+1,v8eta[b],0.);
942 fchr8th->FillDifferentialFlowEtaRP(b+1,v8etaRP[b],0.);
948 //cout<<"v'_2/2{8} = Im"<<endl;
950 //cout<<"****************************************"<<endl;
952 //-------------------------------------------------------------------------------------------------------------------------------
997 //===========================================================================
998 // POI = Particle of Interest
999 //===========================================================================
1001 /////////////////////////////////////////////////////////////////////////////
1002 ///////////////////////DIFFERENTIAL FLOW CALCULATIONS////////////////////////
1003 /////////////////////////////////////////////////////////////////////////////
1005 TVectorD ptX(cnBinsPt*cPmax*cQmax);
1006 TVectorD ptY(cnBinsPt*cPmax*cQmax);
1007 TVectorD ptBinPOINoOfParticles(cnBinsPt);
1009 //3D profiles (for pt)
1010 for(Int_t b=0;b<cnBinsPt;b++)
1012 ptBinPOINoOfParticles[b]=fPtBinPOINoOfParticles->GetBinEntries(b+1);
1013 for(Int_t p=0;p<cPmax;p++)
1015 for(Int_t q=0;q<cQmax;q++)
1019 if(fDiffPtPOIGenFunRe)
1021 ptX[index3d(b,p,q,cnBinsPt,cPmax)]=fDiffPtPOIGenFunRe->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
1023 if(fDiffPtPOIGenFunIm)
1025 ptY[index3d(b,p,q,cnBinsPt,cPmax)]=fDiffPtPOIGenFunIm->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
1032 TVectorD etaX(cnBinsEta*cPmax*cQmax);
1033 TVectorD etaY(cnBinsEta*cPmax*cQmax);
1034 TVectorD etaBinPOINoOfParticles(cnBinsEta);
1036 //3D profiles (for eta)
1037 for(Int_t b=0;b<cnBinsEta;b++)
1039 etaBinPOINoOfParticles[b]=fEtaBinPOINoOfParticles->GetBinEntries(b+1);
1040 for(Int_t p=0;p<cPmax;p++)
1042 for(Int_t q=0;q<cQmax;q++)
1046 if(fDiffEtaPOIGenFunRe)
1048 etaX[index3d(b,p,q,cnBinsEta,cPmax)]=fDiffEtaPOIGenFunRe->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
1050 if(fDiffEtaPOIGenFunIm)
1052 etaY[index3d(b,p,q,cnBinsEta,cPmax)]=fDiffEtaPOIGenFunIm->GetBinContent(b+1,p+1,q+1)/dAvG(p,q);
1061 for(Int_t b=0;b<cnBinsPt;b++){cout<<"***************************************"<<endl;
1062 cout<<"***************************************"<<endl;
1063 //for(Int_t p=0;p<cPmax;p++){
1064 for(Int_t q=0;q<cQmax;q++){
1065 X[b][0][q]=fdRe0->GetBinContent(b+1,q+1)/AvG[0][q];
1066 Y[b][0][q]=fdIm0->GetBinContent(b+1,q+1)/AvG[0][q];
1067 //--------------------------------------------------
1068 X[b][1][q]=fdRe1->GetBinContent(b+1,q+1)/AvG[1][q];
1069 Y[b][1][q]=fdIm1->GetBinContent(b+1,q+1)/AvG[1][q];
1070 //--------------------------------------------------
1071 X[b][2][q]=fdRe2->GetBinContent(b+1,q+1)/AvG[2][q];
1072 Y[b][2][q]=fdIm2->GetBinContent(b+1,q+1)/AvG[2][q];
1073 //--------------------------------------------------
1074 X[b][3][q]=fdRe3->GetBinContent(b+1,q+1)/AvG[3][q];
1075 Y[b][3][q]=fdIm3->GetBinContent(b+1,q+1)/AvG[3][q];
1076 //--------------------------------------------------
1077 X[b][4][q]=fdRe4->GetBinContent(b+1,q+1)/AvG[4][q];
1078 Y[b][4][q]=fdIm4->GetBinContent(b+1,q+1)/AvG[4][q];
1079 //--------------------------------------------------
1080 X[b][5][q]=fdRe5->GetBinContent(b+1,q+1)/AvG[5][q];
1081 Y[b][5][q]=fdIm5->GetBinContent(b+1,q+1)/AvG[5][q];
1082 //--------------------------------------------------
1083 X[b][6][q]=fdRe6->GetBinContent(b+1,q+1)/AvG[6][q];
1084 Y[b][6][q]=fdIm6->GetBinContent(b+1,q+1)/AvG[6][q];
1085 //--------------------------------------------------
1086 X[b][7][q]=fdRe7->GetBinContent(b+1,q+1)/AvG[7][q];
1087 Y[b][7][q]=fdIm7->GetBinContent(b+1,q+1)/AvG[7][q];
1094 //-------------------------------------------------------------------------------------------------------------------------------
1095 //final results for differential flow (in pt):
1096 TMatrixD ptD(cnBinsPt,cPmax);
1097 Double_t tempSumForPtD=0.;
1098 for (Int_t b=0;b<cnBinsPt;b++)
1100 for (Int_t p=0;p<cPmax;p++)
1103 for (Int_t q=0;q<cQmax;q++)
1105 tempSumForPtD+=cos(cMltpl*2.*q*TMath::Pi()/cQmax)*ptX[index3d(b,p,q,cnBinsPt,cPmax)] + sin(cMltpl*2.*q*TMath::Pi()/cQmax)*ptY[index3d(b,p,q,cnBinsPt,cPmax)];
1107 ptD(b,p)=1.*(pow(fR0*pow(p+1.0,0.5),cMltpl)/cQmax)*tempSumForPtD;
1111 Double_t ptDiffCumulant2[cnBinsPt]={0.};
1112 Double_t ptDiffCumulant4[cnBinsPt]={0.};
1113 Double_t ptDiffCumulant6[cnBinsPt]={0.};
1114 Double_t ptDiffCumulant8[cnBinsPt]={0.};
1115 Double_t ptDiffCumulant10[cnBinsPt]={0.};
1117 for (Int_t b=0;b<cnBinsPt;b++)
1119 ptDiffCumulant2[b]=(1./(fR0*fR0))*(5.*ptD(b,0)-5.*ptD(b,1)+(10./3.)*ptD(b,2)-(5./4.)*ptD(b,3)+(1./5.)*ptD(b,4));
1120 ptDiffCumulant4[b]=(1./pow(fR0,4.))*((-77./6.)*ptD(b,0)+(107./6.)*ptD(b,1)-(13./1.)*ptD(b,2)+(61./12.)*ptD(b,3)-(5./6.)*ptD(b,4));
1121 ptDiffCumulant6[b]=(1./pow(fR0,6.))*((71./2.)*ptD(b,0)-59.*ptD(b,1)+49.*ptD(b,2)-(41./2.)*ptD(b,3)+(7./2.)*ptD(b,4));
1122 ptDiffCumulant8[b]=(1./pow(fR0,8.))*(-84.*ptD(b,0)+156.*ptD(b,1)-144.*ptD(b,2)+66.*ptD(b,3)-12.*ptD(b,4));
1123 ptDiffCumulant10[b]=(1./pow(fR0,10.))*(120.*ptD(b,0)-240.*ptD(b,1)+240.*ptD(b,2)-120.*ptD(b,3)+24.*ptD(b,4));
1126 //diff. flow values per pt bin:
1127 Double_t v2pt[cnBinsPt]={0.};
1128 Double_t v4pt[cnBinsPt]={0.};
1129 Double_t v6pt[cnBinsPt]={0.};
1130 Double_t v8pt[cnBinsPt]={0.};
1133 Double_t sdDiff2pt[cnBinsPt]={0.};
1134 Double_t sdDiff4pt[cnBinsPt]={0.};
1135 //Double_t sdDiff6pt[cnBinsPt]={0.};//to be improved (calculation needed)
1136 //Double_t sdDiff8pt[cnBinsPt]={0.};//to be improved (calculation needed)
1138 //cout<<"number of pt bins: "<<cnBinsPt<<endl;
1139 //cout<<"****************************************"<<endl;
1142 for (Int_t b=0;b<cnBinsPt;b++){
1143 //cout<<"pt bin: "<<b*fBinWidthPt<<"-"<<(b+1)*fBinWidthPt<<" GeV"<<endl;
1149 v2pt[b]=ptDiffCumulant2[b]/pow(cumulant[0],0.5);
1150 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0.&&ptBinPOINoOfParticles[b]>0.)
1154 sdDiff2pt[b]=pow((1./(2.*ptBinPOINoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
1156 //cout<<"v'_2/2{2} = "<<v2pt[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdDiff2pt[b]<<"%"<<endl;
1157 fdfr2->SetBinContent(b+1,v2pt[b]);
1158 fdfr2->SetBinError(b+1,sdDiff2pt[b]);
1160 fchr2nd->FillDifferentialFlow(b+1,v2pt[b],sdDiff2pt[b]);
1164 fchr2nd->FillDifferentialFlowPtPOI(b+1,v2pt[b],sdDiff2pt[b]);
1169 //cout<<"v'_2/2{2} = Im"<<endl;
1172 //cout<<"v'_2/2{2} = Im"<<endl;
1178 v4pt[b]=-ptDiffCumulant4[b]/pow(-cumulant[1],.75);
1179 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&ptBinPOINoOfParticles[b]>0.)
1183 sdDiff4pt[b]=pow((1./(2.*ptBinPOINoOfParticles[b]))*((2.+6.*pow(chiQ[1],2.)+pow(chiQ[1],4.)+pow(chiQ[1],6.))/pow(chiQ[1],6.)),0.5);
1185 //cout<<"v'_2/2{4} = "<<v4pt[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdDiff4pt[b]<<"%"<<endl;
1186 fdfr4->SetBinContent(b+1,v4pt[b]);
1187 fdfr4->SetBinError(b+1,sdDiff4pt[b]);
1189 fchr4th->FillDifferentialFlow(b+1,v4pt[b],sdDiff4pt[b]);
1194 fchr4th->FillDifferentialFlowPtPOI(b+1,v4pt[b],sdDiff4pt[b]);
1200 //cout<<"v'_2/2{4} = Im"<<endl;
1203 //cout<<"v'_2/2{4} = Im"<<endl;
1208 //cout<<"v'_2/2{6} = "<<100.*ptDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)))<<"%"<<endl;
1209 v6pt[b]=ptDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)));
1210 fdfr6->SetBinContent(b+1,v6pt[b]);
1212 fchr6th->FillDifferentialFlow(b+1,v6pt[b],0.);
1217 fchr6th->FillDifferentialFlowPtPOI(b+1,v6pt[b],0.);
1224 //cout<<"v'_2/2{6} = Im"<<endl;
1229 //cout<<"v'_2/2{8} = "<<-100.*ptDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)))<<"%"<<endl;
1230 v8pt[b]=-ptDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)));
1231 fdfr8->SetBinContent(b+1,v8pt[b]);
1233 fchr8th->FillDifferentialFlow(b+1,v8pt[b],0.);
1238 fchr8th->FillDifferentialFlowPtPOI(b+1,v8pt[b],0.);
1244 //cout<<"v'_2/2{8} = Im"<<endl;
1246 //cout<<"****************************************"<<endl;
1248 //-------------------------------------------------------------------------------------------------------------------------------
1254 ///////////////////////////////////////////////////////////////////////////////////
1255 //////////////////////// INTEGRATED FLOW CALCULATIONS (POI) ///////////////////////
1256 ///////////////////////////////////////////////////////////////////////////////////
1258 Double_t dV2POI=0., dV4POI=0., dV6POI=0., dV8POI=0.;
1259 Double_t dV2POIError=0., dV4POIError=0., dV6POIError=0., dV8POIError=0.;
1260 Double_t dSumOfYieldPOI=0.;
1261 for (Int_t b=1;b<cnBinsPt+1;b++)
1263 if(fch->GetHistPtPOI())
1265 dSumOfYieldPOI+=(fch->GetHistPtPOI())->GetBinContent(b);
1266 if(fchr2nd->GetHistDiffFlowPtPOI())
1268 dV2POI+=((fchr2nd->GetHistDiffFlowPtPOI())->GetBinContent(b))*(fch->GetHistPtPOI())->GetBinContent(b);
1269 dV2POIError+=pow((fch->GetHistPtPOI())->GetBinContent(b),2.)*pow((fchr2nd->GetHistDiffFlowPtPOI())->GetBinError(b),2.);
1271 if(fchr4th->GetHistDiffFlowPtPOI())
1273 dV4POI+=((fchr4th->GetHistDiffFlowPtPOI())->GetBinContent(b))*(fch->GetHistPtPOI())->GetBinContent(b);
1274 dV4POIError+=pow((fch->GetHistPtPOI())->GetBinContent(b),2.)*pow((fchr4th->GetHistDiffFlowPtPOI())->GetBinError(b),2.);
1276 if(fchr6th->GetHistDiffFlowPtPOI())
1278 dV6POI+=((fchr6th->GetHistDiffFlowPtPOI())->GetBinContent(b))*(fch->GetHistPtPOI())->GetBinContent(b);
1279 dV6POIError+=pow((fch->GetHistPtPOI())->GetBinContent(b),2.)*pow((fchr6th->GetHistDiffFlowPtPOI())->GetBinError(b),2.);
1281 if(fchr8th->GetHistDiffFlowPtPOI())
1283 dV8POI+=((fchr8th->GetHistDiffFlowPtPOI())->GetBinContent(b))*(fch->GetHistPtPOI())->GetBinContent(b);
1284 dV8POIError+=pow((fch->GetHistPtPOI())->GetBinContent(b),2.)*pow((fchr8th->GetHistDiffFlowPtPOI())->GetBinError(b),2.);
1291 dV2POI/=dSumOfYieldPOI;
1292 dV2POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
1293 dV4POI/=dSumOfYieldPOI;
1294 dV4POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
1295 dV6POI/=dSumOfYieldPOI;
1296 dV6POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
1297 dV8POI/=dSumOfYieldPOI;
1298 dV8POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
1299 fchr2nd->FillIntegratedFlowPOI(dV2POI,pow(dV2POIError,0.5));
1300 fchr4th->FillIntegratedFlowPOI(dV4POI,pow(dV4POIError,0.5));
1301 fchr6th->FillIntegratedFlowPOI(dV6POI,pow(dV6POIError,0.5));//to be improved (errors needed)
1302 fchr8th->FillIntegratedFlowPOI(dV8POI,pow(dV8POIError,0.5));//to be improved (errors needed)
1306 cout<<"***************************************"<<endl;
1307 cout<<"***************************************"<<endl;
1308 cout<<"flow estimates from GF-cumulants (POI):"<<endl;
1311 cout<<" v_"<<cFlow<<"{2} = "<<dV2POI<<" +/- "<<pow(dV2POIError,0.5)<<endl;
1312 cout<<" v_"<<cFlow<<"{4} = "<<dV4POI<<" +/- "<<pow(dV4POIError,0.5)<<endl;
1313 cout<<" v_"<<cFlow<<"{6} = "<<dV6POI<<" +/- "<<pow(dV6POIError,0.5)<<endl;
1314 cout<<" v_"<<cFlow<<"{8} = "<<dV8POI<<" +/- "<<pow(dV8POIError,0.5)<<endl;
1317 cout<<" nEvts = "<<(fch->GetHistMultPOI())->GetEntries()<<", AvM = "<<(fch->GetHistMultPOI())->GetMean()<<endl;
1318 cout<<"***************************************"<<endl;
1319 cout<<"***************************************"<<endl;
1322 //-------------------------------------------------------------------------------------------------------------------------------
1323 //final results for differential flow (in eta):
1324 TMatrixD etaD(cnBinsEta, cPmax);
1325 Double_t tempSumForEtaD=0.;
1326 for (Int_t b=0;b<cnBinsEta;b++)
1328 for (Int_t p=0;p<cPmax;p++)
1331 for (Int_t q=0;q<cQmax;q++)
1333 tempSumForEtaD+=cos(cMltpl*2.*q*TMath::Pi()/cQmax)*etaX[index3d(b,p,q,cnBinsEta,cPmax)] + sin(cMltpl*2.*q*TMath::Pi()/cQmax)*etaY[index3d(b,p,q,cnBinsEta,cPmax)];
1335 etaD(b,p)=1.*(pow(fR0*pow(p+1.,.5),cMltpl)/cQmax)*tempSumForEtaD;
1339 Double_t etaDiffCumulant2[cnBinsEta]={0.};
1340 Double_t etaDiffCumulant4[cnBinsEta]={0.};
1341 Double_t etaDiffCumulant6[cnBinsEta]={0.};
1342 Double_t etaDiffCumulant8[cnBinsEta]={0.};
1343 Double_t etaDiffCumulant10[cnBinsEta]={0.};
1345 for (Int_t b=0;b<cnBinsEta;b++)
1347 etaDiffCumulant2[b]=(1./(fR0*fR0))*(5.*etaD(b,0)-5.*etaD(b,1)+(10./3.)*etaD(b,2)-(5./4.)*etaD(b,3)+(1./5.)*etaD(b,4));
1348 etaDiffCumulant4[b]=(1./pow(fR0,4.))*((-77./6.)*etaD(b,0)+(107./6.)*etaD(b,1)-(13./1.)*etaD(b,2)+(61./12.)*etaD(b,3)-(5./6.)*etaD(b,4));
1349 etaDiffCumulant6[b]=(1./pow(fR0,6.))*((71./2.)*etaD(b,0)-59.*etaD(b,1)+49.*etaD(b,2)-(41./2.)*etaD(b,3)+(7./2.)*etaD(b,4));
1350 etaDiffCumulant8[b]=(1./pow(fR0,8.))*(-84.*etaD(b,0)+156.*etaD(b,1)-144.*etaD(b,2)+66.*etaD(b,3)-12.*etaD(b,4));
1351 etaDiffCumulant10[b]=(1./pow(fR0,10.))*(120.*etaD(b,0)-240.*etaD(b,1)+240.*etaD(b,2)-120.*etaD(b,3)+24.*etaD(b,4));
1354 //diff. flow values per eta bin:
1355 Double_t v2eta[cnBinsEta]={0.};
1356 Double_t v4eta[cnBinsEta]={0.};
1357 Double_t v6eta[cnBinsEta]={0.};
1358 Double_t v8eta[cnBinsEta]={0.};
1361 Double_t sdDiff2eta[cnBinsEta]={0.};
1362 Double_t sdDiff4eta[cnBinsEta]={0.};
1363 //Double_t sdDiff6eta[cnBinsEta]={0.};//to be improved (calculation needed)
1364 //Double_t sdDiff8eta[cnBinsEta]={0.};//to be improved (calculation needed)
1366 //cout<<"number of eta bins: "<<cnBinsEta<<endl;
1367 //cout<<"****************************************"<<endl;
1368 for (Int_t b=0;b<cnBinsEta;b++){
1369 //cout<<"eta bin: "<<b*fBinWidthPt<<"-"<<(b+1)*fBinWidthPt<<" GeV"<<endl;
1374 v2eta[b]=etaDiffCumulant2[b]/pow(cumulant[0],0.5);
1375 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0.&&etaBinPOINoOfParticles[b]>0.) // to be improved
1379 sdDiff2eta[b]=pow((1./(2.*etaBinPOINoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
1381 //cout<<"v'_2/2{2} = "<<v2eta[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdDiff2eta[b]<<"%"<<endl;
1382 fdfr2->SetBinContent(b+1,v2eta[b]);
1383 fdfr2->SetBinError(b+1,sdDiff2eta[b]);
1385 //fchr2nd->FillDifferentialFlow(b+1,v2eta[b],sdDiff2eta[b]);
1389 fchr2nd->FillDifferentialFlowEtaPOI(b+1,v2eta[b],sdDiff2eta[b]);
1394 //cout<<"v'_2/2{2} = Im"<<endl;
1397 //cout<<"v'_2/2{2} = Im"<<endl;
1403 v4eta[b]=-etaDiffCumulant4[b]/pow(-cumulant[1],0.75);
1404 if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&etaBinPOINoOfParticles[b]>0.) // to be improved
1408 sdDiff4eta[b]=pow((1./(2.*etaBinPOINoOfParticles[b]))*((2.+6.*pow(chiQ[1],2.)+pow(chiQ[1],4.)+pow(chiQ[1],6.))/pow(chiQ[1],6.)),0.5);
1410 //cout<<"v'_2/2{4} = "<<v4eta[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdDiff4eta[b]<<"%"<<endl;
1411 fdfr4->SetBinContent(b+1,v4eta[b]);
1412 fdfr4->SetBinError(b+1,sdDiff4eta[b]);
1414 //fchr4th->FillDifferentialFlow(b+1,v4eta[b],sdDiff4eta[b]);
1419 fchr4th->FillDifferentialFlowEtaPOI(b+1,v4eta[b],sdDiff4eta[b]);
1425 //cout<<"v'_2/2{4} = Im"<<endl;
1428 //cout<<"v'_2/2{4} = Im"<<endl;
1433 //cout<<"v'_2/2{6} = "<<100.*etaDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)))<<"%"<<endl;
1434 v6eta[b]=etaDiffCumulant6[b]/(4.*pow((1./4.)*cumulant[2],(5./6.)));
1435 //fdfr6->SetBinContent(b+1,v6eta[b]);
1437 //fchr6th->FillDifferentialFlow(b+1,v6eta[b],0.);
1442 fchr6th->FillDifferentialFlowEtaPOI(b+1,v6eta[b],0.);
1449 //cout<<"v'_2/2{6} = Im"<<endl;
1454 //cout<<"v'_2/2{8} = "<<-100.*etaDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)))<<"%"<<endl;
1455 v8eta[b]=-etaDiffCumulant8[b]/(33.*pow(-(1./33.)*cumulant[3],(7./8.)));
1456 //fdfr8->SetBinContent(b+1,v8eta[b]);
1458 //fchr8th->FillDifferentialFlow(b+1,v8eta[b],0.);
1463 fchr8th->FillDifferentialFlowEtaPOI(b+1,v8eta[b],0.);
1469 //cout<<"v'_2/2{8} = Im"<<endl;
1471 //cout<<"****************************************"<<endl;
1473 //-------------------------------------------------------------------------------------------------------------------------------
1482 //off the record: numerical equations for cumulants solved up to different highest order
1486 //==============================================================================================================================================
1489 //avarage selected multiplicity
1493 dAvM4=fAvMult4->GetBinContent(1);
1500 nEvents4=(Int_t)(fAvMult4->GetBinEntries(1));
1503 TMatrixD dAvG4(cPmax4,cQmax4);
1504 Bool_t someAvGEntryIsNegative4=kFALSE;
1505 for(Int_t p=0;p<cPmax4;p++)
1507 for(Int_t q=0;q<cQmax4;q++)
1509 dAvG4(p,q)=fIntGenFun4->GetBinContent(p+1,q+1);
1512 someAvGEntryIsNegative4=kTRUE;
1516 /////////////////////////////////////////////////////////////////////////////
1517 //////////////////gen. function for the cumulants////////////////////////////
1518 /////////////////////////////////////////////////////////////////////////////
1520 TMatrixD dC4(cPmax4,cQmax4);//C[p][q]
1521 if(dAvM4>0 && someAvGEntryIsNegative4==kFALSE)
1523 for (Int_t p=0;p<cPmax4;p++)
1525 for (Int_t q=0;q<cQmax4;q++)
1527 dC4(p,q)=1.*dAvM4*(pow(dAvG4(p,q),(1./dAvM4))-1.);
1531 /////////////////////////////////////////////////////////////////////////////
1532 ///////avaraging the gen. function for the cumulants over azimuth////////////
1533 /////////////////////////////////////////////////////////////////////////////
1535 TVectorD dAvC4(cPmax4);//<C[p][q]>
1536 for (Int_t p=0;p<cPmax4;p++)
1538 Double_t tempHere4=0.;
1539 for (Int_t q=0;q<cQmax4;q++)
1541 tempHere4+=1.*dC4(p,q);
1543 dAvC4[p]=1.*tempHere4/cQmax4;
1546 /////////////////////////////////////////////////////////////////////////////
1547 //////////////////////////////////final results//////////////////////////////
1548 /////////////////////////////////////////////////////////////////////////////
1550 TVectorD cumulant4(cPmax4);//array to store various order cumulants
1552 cumulant4[0]=(1./(fR0*fR0))*(2.*dAvC[0]-(1./2.)*dAvC[1]);
1553 cumulant4[1]=(2./pow(fR0,4.))*((-2.)*dAvC[0]+1.*dAvC[1]);
1557 cout<<"*********************************"<<endl;
1558 cout<<"cumulants:"<<endl;
1559 cout<<" c_"<<cFlow<<"{2} = "<<cumulant4[0]<<endl;
1560 cout<<" c_"<<cFlow<<"{4} = "<<cumulant4[1]<<endl;
1564 Double_t dV2o4=0.,dV4o4=0.;
1566 if(cumulant4[0]>=0.)
1568 dV2o4 = pow(cumulant4[0],(1./2.));
1570 if(cumulant4[1]<=0.)
1572 dV4o4 = pow(-cumulant4[1],(1./4.));
1576 cout<<"***********************************"<<endl;
1577 cout<<"***********************************"<<endl;
1578 cout<<"flow estimates from GF-cumulants:"<<endl;
1579 cout<<" (calculated up to 4th order) "<<endl;
1582 Double_t sdQo4[2]={0.};
1583 Double_t chiQo4[2]={0.};
1586 if(nEvents4 && dAvM4 && cumulant4[0]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(cumulant4[0],(1./2.))*dAvM4,2.)>0.))
1588 chiQo4[0]=dAvM4*dV2o4/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2o4*dAvM4,2.),0.5);
1591 sdQo4[0]=pow(((1./(2.*dAvM4*nEvents4))*((1.+2.*pow(chiQo4[0],2))/(2.*pow(chiQo4[0],2)))),0.5);
1593 cout<<" v_"<<cFlow<<"{2} = "<<dV2o4<<" +/- "<<sdQo4[0]<<endl;
1594 //cout<<" v_"<<cFlow<<"{2} = "<<dV2o4<<" +/- "<<sdQo4[0]<<", chi{2} = "<<chiQo4[0]<<endl;//printing also the chi
1598 cout<<" v_"<<cFlow<<"{2} = Im"<<endl;
1602 if(nEvents4 && dAvM4 && cumulant4[1]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-cumulant4[1],(1./4.))*dAvM4,2.)>0.))
1604 chiQo4[1]=dAvM4*dV4o4/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4o4*dAvM4,2.),0.5);
1607 sdQo4[1]=(1./(pow(2.*dAvM4*nEvents4,0.5)))*pow((1.+4.*pow(chiQo4[1],2)+1.*pow(chiQo4[1],4.)+2.*pow(chiQo4[1],6.))/(2.*pow(chiQo4[1],6.)),0.5);
1609 cout<<" v_"<<cFlow<<"{4} = "<<dV4o4<<" +/- "<<sdQo4[1]<<endl;
1610 //cout<<" v_"<<cFlow<<"{4} = "<<dV4o4<<" +/- "<<sdQo4[1]<<", chi{4} = "<<chiQo4[1]<<endl;//printing also the chi
1614 cout<<" v_"<<cFlow<<"{4} = Im"<<endl;
1618 cout<<" nEvts = "<<nEvents4<<", AvM = "<<dAvM4<<endl;
1619 cout<<"***********************************"<<endl;
1620 cout<<"***********************************"<<endl;
1622 //==============================================================================================================================================
1625 //avarage selected multiplicity
1629 dAvM6=fAvMult6->GetBinContent(1);
1636 nEvents6=(Int_t)(fAvMult6->GetBinEntries(1));
1639 TMatrixD dAvG6(cPmax6,cQmax6);
1640 Bool_t someAvGEntryIsNegative6=kFALSE;
1641 for(Int_t p=0;p<cPmax6;p++)
1643 for(Int_t q=0;q<cQmax6;q++)
1645 dAvG6(p,q)=fIntGenFun6->GetBinContent(p+1,q+1);
1648 someAvGEntryIsNegative6=kTRUE;
1652 /////////////////////////////////////////////////////////////////////////////
1653 //////////////////gen. function for the cumulants////////////////////////////
1654 /////////////////////////////////////////////////////////////////////////////
1656 TMatrixD dC6(cPmax6,cQmax6);//C[p][q]
1657 if(dAvM6>0 && someAvGEntryIsNegative6==kFALSE)
1659 for (Int_t p=0;p<cPmax6;p++)
1661 for (Int_t q=0;q<cQmax6;q++)
1663 dC6(p,q)=1.*dAvM6*(pow(dAvG6(p,q),(1./dAvM6))-1.);
1668 /////////////////////////////////////////////////////////////////////////////
1669 ///////avaraging the gen. function for the cumulants over azimuth////////////
1670 /////////////////////////////////////////////////////////////////////////////
1672 TVectorD dAvC6(cPmax6);//<etBinContent(1)C[p][q]>
1673 Double_t tempHere6=0.;
1674 for (Int_t p=0;p<cPmax6;p++){
1676 for (Int_t q=0;q<cQmax6;q++){
1677 tempHere6+=1.*dC6(p,q);
1679 dAvC6[p]=1.*tempHere6/cQmax6;
1682 /////////////////////////////////////////////////////////////////////////////
1683 //////////////////////////////////final results//////////////////////////////
1684 /////////////////////////////////////////////////////////////////////////////
1686 TVectorD cumulant6(cPmax6);//array to store various order cumulants
1687 cumulant6[0] = (1./(fR0*fR0))*(3.*dAvC[0]-(3./2.)*dAvC[1]+(1./3.)*dAvC[2]);
1688 cumulant6[1] = (2./pow(fR0,4.))*((-5.)*dAvC[0]+4.*dAvC[1]-1.*dAvC[2]);
1689 cumulant6[2] = (6./pow(fR0,6.))*(3.*dAvC[0]-3.*dAvC[1]+1.*dAvC[2]);
1693 cout<<"*********************************"<<endl;
1694 cout<<"cumulants:"<<endl;
1695 cout<<" c_"<<cFlow<<"{2} = "<<cumulant6[0]<<endl;
1696 cout<<" c_"<<cFlow<<"{4} = "<<cumulant6[1]<<endl;
1697 cout<<" c_"<<cFlow<<"{6} = "<<cumulant6[2]<<endl;
1701 Double_t dV2o6=0.,dV4o6=0.,dV6o6=0.;
1703 if(cumulant6[0]>=0.)
1705 dV2o6 = pow(cumulant6[0],(1./2.));
1707 if(cumulant6[1]<=0.)
1709 dV4o6 = pow(-cumulant6[1],(1./4.));
1711 if(cumulant6[2]>=0.)
1713 dV6o6 = pow((1./4.)*cumulant6[2],(1./6.));
1717 cout<<"***********************************"<<endl;
1718 cout<<"***********************************"<<endl;
1719 cout<<"flow estimates from GF-cumulants:"<<endl;
1720 cout<<" (calculated up to 6th order) "<<endl;
1723 Double_t sdQo6[3]={0.};
1724 Double_t chiQo6[3]={0.};
1727 if(nEvents6 && dAvM6 && cumulant6[0]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(cumulant6[0],(1./2.))*dAvM6,2.)>0.))
1729 chiQo6[0]=dAvM6*dV2o6/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2o6*dAvM6,2.),0.5);
1732 sdQo6[0]=pow(((1./(2.*dAvM6*nEvents6))*((1.+2.*pow(chiQo6[0],2))/(2.*pow(chiQo6[0],2)))),0.5);
1734 cout<<" v_"<<cFlow<<"{2} = "<<dV2o6<<" +/- "<<sdQo6[0]<<endl;
1735 //cout<<" v_"<<cFlow<<"{2} = "<<dV2o6<<" +/- "<<sdQo6[0]<<", chi{2} = "<<chiQo6[0]<<endl;//printing also the chi
1739 cout<<" v_"<<cFlow<<"{2} = Im"<<endl;
1743 if(nEvents6 && dAvM6 && cumulant6[1]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-cumulant6[1],(1./4.))*dAvM6,2.)>0.))
1745 chiQo6[1]=dAvM6*dV4o6/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4o6*dAvM6,2.),0.5);
1748 sdQo6[1]=(1./(pow(2.*dAvM6*nEvents6,0.5)))*pow((1.+4.*pow(chiQo6[1],2)+1.*pow(chiQo6[1],4.)+2.*pow(chiQo6[1],6.))/(2.*pow(chiQo6[1],6.)),0.5);
1750 cout<<" v_"<<cFlow<<"{4} = "<<dV4o6<<" +/- "<<sdQo6[1]<<endl;
1751 //cout<<" v_"<<cFlow<<"{4} = "<<dV4o6<<" +/- "<<sdQo6[1]<<", chi{4} = "<<chiQo6[1]<<endl;//printing also the chi
1755 cout<<" v_"<<cFlow<<"{4} = Im"<<endl;
1759 if(nEvents6 && dAvM6 && cumulant6[2]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*cumulant6[2],(1./6.))*dAvM6,2.)>0.))
1761 chiQo6[2]=dAvM6*dV6/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV6o6*dAvM6,2.),0.5);
1764 sdQo6[2]=(1./(pow(2.*dAvM6*nEvents6,0.5)))*pow((3.+18.*pow(chiQo6[2],2.)+9.*pow(chiQo6[2],4.)+28.*pow(chiQo6[2],6.)+12.*pow(chiQo6[2],8.)+24.*pow(chiQo6[2],10.))/(24.*pow(chiQo6[2],10.)),0.5);
1766 cout<<" v_"<<cFlow<<"{6} = "<<dV6o6<<" +/- "<<sdQo6[2]<<endl;
1767 //cout<<" v_"<<cFlow<<"{6} = "<<dV6o6<<" +/- "<<sdQo6[2]<<", chi{6} = "<<chiQo6[2]<<endl;//printing also the chi
1771 cout<<" v_"<<cFlow<<"{6} = Im"<<endl;
1775 cout<<" nEvts = "<<nEvents6<<", AvM = "<<dAvM6<<endl;
1776 cout<<"***********************************"<<endl;
1777 cout<<"***********************************"<<endl;
1779 //==============================================================================================================================================
1782 //avarage selected multiplicity
1786 dAvM8=fAvMult8->GetBinContent(1);
1793 nEvents8=(Int_t)(fAvMult8->GetBinEntries(1));
1796 TMatrixD dAvG8(cPmax8,cQmax8);
1797 Bool_t someAvGEntryIsNegative8=kFALSE;
1798 for(Int_t p=0;p<cPmax8;p++)
1800 for(Int_t q=0;q<cQmax8;q++)
1802 dAvG8(p,q)=fIntGenFun8->GetBinContent(p+1,q+1);
1805 someAvGEntryIsNegative8=kTRUE;
1809 /////////////////////////////////////////////////////////////////////////////
1810 //////////////////gen. function for the cumulants////////////////////////////
1811 /////////////////////////////////////////////////////////////////////////////
1813 TMatrixD dC8(cPmax8,cQmax8);//C[p][q]
1814 if(dAvM8>0 && someAvGEntryIsNegative8==kFALSE)
1816 for (Int_t p=0;p<cPmax8;p++)
1818 for (Int_t q=0;q<cQmax8;q++)
1820 dC8(p,q)=1.*dAvM8*(pow(dAvG8(p,q),(1./dAvM8))-1.);
1825 /////////////////////////////////////////////////////////////////////////////
1826 ///////avaraging the gen. function for the cumulants over azimuth////////////
1827 /////////////////////////////////////////////////////////////////////////////
1829 TVectorD dAvC8(cPmax8);//<C[p][q]>
1830 Double_t tempHere8=0.;
1831 for (Int_t p=0;p<cPmax8;p++)
1834 for (Int_t q=0;q<cQmax8;q++)
1836 tempHere8+=1.*dC8(p,q);
1838 dAvC8[p]=1.*tempHere8/cQmax8;
1841 /////////////////////////////////////////////////////////////////////////////
1842 //////////////////////////////////final results//////////////////////////////
1843 /////////////////////////////////////////////////////////////////////////////
1845 TVectorD cumulant8(cPmax8);//array to store various order cumulants
1846 cumulant8[0] = (1./(fR0*fR0))*(4.*dAvC[0]-3.*dAvC[1]+(4./3.)*dAvC[2]-(1./4.)*dAvC[3]);
1847 cumulant8[1] = (1./pow(fR0,4.))*((-52./3.)*dAvC[0]+19.*dAvC[1]-(28./3.)*dAvC[2]+(11./6.)*dAvC[3]);
1848 cumulant8[2] = (3./pow(fR0,6.))*(18.*dAvC[0]-24.*dAvC[1]+14.*dAvC[2]-3.*dAvC[3]);
1849 cumulant8[3] = (24./pow(fR0,8.))*((-4.)*dAvC[0]+6.*dAvC[1]-4.*dAvC[2]+1.*dAvC[3]);
1851 /* x0,y0 ~ 1/sqrt(p) (setting another complex mesh, doesn't work correctly)
1852 cumulant8[0] = (-1./(6.*fR0*fR0)) * (1.*dAvC[0] - 48.*dAvC[1] + 243.*dAvC[2] - 256.*dAvC[3]);
1853 cumulant8[1] = (2./pow(fR0,4.)) * (3.*dAvC[0] - 128.*dAvC[1] + 567.*dAvC[2] - 512.*dAvC[3]);
1854 cumulant8[2] = (-12./pow(fR0,6.)) * (13.*dAvC[0] - 456.*dAvC[1] + 1701.*dAvC[2] - 1408.*dAvC[3]);
1855 cumulant8[3] = (2304./pow(fR0,8.)) * (1.*dAvC[0] - 24.*dAvC[1] + 81.*dAvC[2] - 64.*dAvC[3]);
1858 /* x0,y0 ~ p (setting another complex mesh, doesn't work correctly)
1859 cumulant8[0] = (-1./(5040.*fR0*fR0)) * ((-8064.)*dAvC[0] + 1008.*dAvC[1] - 128.*dAvC[2] + 9.*dAvC[3]);
1860 cumulant8[1] = (1./(720.*pow(fR0,4.))) * (1952.*dAvC[0] - 676.*dAvC[1] + 96.*dAvC[2] - 7.*dAvC[3]);
1861 cumulant8[2] = (-1./(40.*pow(fR0,6.))) * ((-116.)*dAvC[0] + 52.*dAvC[1] - 12.*dAvC[2] + 1.*dAvC[3]);
1862 cumulant8[3] = (1./(35.*pow(fR0,8.))) * (56.*dAvC[0] - 28.*dAvC[1] + 8.*dAvC[2] - 1.*dAvC[3]);
1867 cout<<"*********************************"<<endl;
1868 cout<<"cumulants8:"<<endl;
1869 cout<<" c_"<<cFlow<<"{2} = "<<cumulant8[0]<<endl;
1870 cout<<" c_"<<cFlow<<"{4} = "<<cumulant8[1]<<endl;
1871 cout<<" c_"<<cFlow<<"{6} = "<<cumulant8[2]<<endl;
1872 cout<<" c_"<<cFlow<<"{8} = "<<cumulant8[3]<<endl;
1876 Double_t dV2o8=0.,dV4o8=0.,dV6o8=0.,dV8o8=0.;
1878 if(cumulant8[0]>=0.)
1880 dV2o8 = pow(cumulant8[0],(1./2.));
1882 if(cumulant8[1]<=0.)
1884 dV4o8 = pow(-cumulant8[1],(1./4.));
1886 if(cumulant8[2]>=0.)
1888 dV6o8 = pow((1./4.)*cumulant8[2],(1./6.));
1890 if(cumulant8[3]<=0.)
1892 dV8o8 = pow(-(1./33.)*cumulant8[3],(1./8.));
1896 cout<<"***********************************"<<endl;
1897 cout<<"***********************************"<<endl;
1898 cout<<"flow estimates from GF-cumulants:"<<endl;
1899 cout<<" (calculated up to 8th order) "<<endl;
1902 Double_t sdQo8[4]={0.};
1903 Double_t chiQo8[4]={0.};
1906 if(nEvents8 && dAvM8 && cumulant8[0]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(cumulant8[0],(1./2.))*dAvM8,2.)>0.))
1908 chiQo8[0]=dAvM8*dV2o8/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2o8*dAvM8,2.),0.5);
1911 sdQo8[0]=pow(((1./(2.*dAvM8*nEvents8))*((1.+2.*pow(chiQo8[0],2.))/(2.*pow(chiQo8[0],2)))),0.5);
1913 cout<<" v_"<<cFlow<<"{2} = "<<dV2o8<<" +/- "<<sdQo8[0]<<endl;
1914 //cout<<" v_"<<cFlow<<"{2} = "<<dV2o8<<" +/- "<<sdQo8[0]<<", chi{2} = "<<chiQo8[0]<<endl;//printing also the chi
1918 cout<<" v_"<<cFlow<<"{2} = Im"<<endl;
1922 if(nEvents8 && dAvM8 && cumulant8[1]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-cumulant8[1],(1./4.))*dAvM8,2.)>0.))
1924 chiQo8[1]=dAvM8*dV4o8/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4o8*dAvM8,2.),0.5);
1927 sdQo8[1]=(1./(pow(2.*dAvM8*nEvents8,0.5)))*pow((1.+4.*pow(chiQo8[1],2)+1.*pow(chiQo8[1],4.)+2.*pow(chiQo8[1],6.))/(2.*pow(chiQo8[1],6.)),0.5);
1929 cout<<" v_"<<cFlow<<"{4} = "<<dV4o8<<" +/- "<<sdQo8[1]<<endl;
1930 //cout<<" v_"<<cFlow<<"{4} = "<<dV4o8<<" +/- "<<sdQo8[1]<<", chi{4} = "<<chiQo8[1]<<endl;//printing also the chi
1934 cout<<" v_"<<cFlow<<"{4} = Im"<<endl;
1938 if(nEvents8 && dAvM8 && cumulant8[2]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*cumulant8[2],(1./6.))*dAvM8,2.)>0.))
1940 chiQo8[2]=dAvM8*dV6o8/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV6o8*dAvM8,2.),0.5);
1943 sdQo8[2]=(1./(pow(2.*dAvM8*nEvents8,0.5)))*pow((3.+18.*pow(chiQo8[2],2)+9.*pow(chiQo8[2],4.)+28.*pow(chiQo8[2],6.)+12.*pow(chiQo8[2],8.)+24.*pow(chiQo8[2],10.))/(24.*pow(chiQo8[2],10.)),0.5);
1945 cout<<" v_"<<cFlow<<"{6} = "<<dV6o8<<" +/- "<<sdQo8[2]<<endl;
1946 //cout<<" v_"<<cFlow<<"{6} = "<<dV6o8<<" +/- "<<sdQo8[2]<<", chi{6} = "<<chiQo8[2]<<endl;//printing also the chi
1950 cout<<" v_"<<cFlow<<"{6} = Im"<<endl;
1954 if(nEvents8 && dAvM8 && cumulant8[3]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*cumulant8[3],(1./8.))*dAvM8,2.)>0.))
1956 chiQo8[3]=dAvM8*dV8o8/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV8o8*dAvM8,2.),0.5);
1959 sdQo8[3]=(1./(pow(2.*dAvM8*nEvents8,0.5)))*pow((12.+96.*pow(chiQo8[3],2)+72.*pow(chiQo8[3],4.)+304.*pow(chiQo8[3],6.)+257.*pow(chiQo8[3],8.)+804.*pow(chiQo8[3],10.)+363.*pow(chiQo8[3],12.)+726.*pow(chiQo8[3],14.))/(726.*pow(chiQo8[3],14.)),0.5);
1961 cout<<" v_"<<cFlow<<"{8} = "<<dV8o8<<" +/- "<<sdQo8[3]<<endl;
1962 //cout<<" v_"<<cFlow<<"{8} = "<<dV8o8<<" +/- "<<sdQo8[3]<<", chi{8} = "<<chiQo8[3]<<endl;//printing also the chi
1966 cout<<" v_"<<cFlow<<"{8} = Im"<<endl;
1970 cout<<" nEvts = "<<nEvents8<<", AvM = "<<dAvM8<<endl;
1971 cout<<"*********************************"<<endl;
1973 //==============================================================================================================================================
1975 //up to 16-th order:
1976 //avarage selected multiplicity
1980 dAvM16=fAvMult16->GetBinContent(1);
1987 nEvents16=(Int_t)(fAvMult16->GetBinEntries(1));
1990 TMatrixD dAvG16(cPmax16,cQmax16);
1991 Bool_t someAvGEntryIsNegative16=kFALSE;
1992 for(Int_t p=0;p<cPmax16;p++)
1994 for(Int_t q=0;q<cQmax16;q++)
1996 dAvG16(p,q)=fIntGenFun16->GetBinContent(p+1,q+1);
1999 someAvGEntryIsNegative16=kTRUE;
2004 /////////////////////////////////////////////////////////////////////////////
2005 //////////////////gen. function for the cumulants////////////////////////////
2006 /////////////////////////////////////////////////////////////////////////////
2008 TMatrixD dC16(cPmax16,cQmax16);//C16[p][q]
2009 if(dAvM16>0 && someAvGEntryIsNegative16==kFALSE)
2011 for(Int_t p=0;p<cPmax16;p++)
2013 for(Int_t q=0;q<cQmax16;q++)
2015 dC16(p,q)=1.*dAvM16*(pow(dAvG16(p,q),(1./dAvM16))-1.);
2020 /////////////////////////////////////////////////////////////////////////////
2021 ///////avaraging the gen. function for the cumulants over azimuth////////////
2022 /////////////////////////////////////////////////////////////////////////////
2024 TVectorD dAvC16(cPmax16);//<C16[p][q]>
2025 Double_t tempHere16=0.;
2026 for (Int_t p=0;p<cPmax16;p++)
2029 for (Int_t q=0;q<cQmax16;q++)
2031 tempHere16+=1.*dC16(p,q);
2033 dAvC16[p]=1.*tempHere16/cQmax16;
2036 /////////////////////////////////////////////////////////////////////////////
2037 //////////////////////////////////final results//////////////////////////////
2038 /////////////////////////////////////////////////////////////////////////////
2040 TVectorD cumulant16(cPmax16);//array to store various order cumulants
2042 cumulant16[0] = (1./(fR0*fR0)) * (8.*dAvC16[0] - 14.*dAvC16[1] + (56./3.)*dAvC16[2] - (35./2.)*dAvC16[3] +
2043 (56./5.)*dAvC16[4] - (14./3.)*dAvC16[5] + (8./7.)*dAvC16[6] - (1./8.)*dAvC16[7]);
2045 cumulant16[1] = (1./pow(fR0,4.)) * ((-1924./35.)*dAvC16[0] + (621./5.)*dAvC16[1] - (8012./45.)*dAvC16[2] +
2046 (691./4.)*dAvC16[3] - (564./5.)*dAvC16[4] + (2143./45.)*dAvC16[5] -
2047 (412./35.)*dAvC16[6] + (363./280.)*dAvC16[7]);
2049 cumulant16[2] = (1./pow(fR0,6.)) * (349.*dAvC16[0] - (18353./20.)*dAvC16[1] + (7173./5.)*dAvC16[2] -
2050 1457.*dAvC16[3] + (4891./5.)*dAvC16[4] - (1683./4.)*dAvC16[5] +
2051 (527./5.)*dAvC16[6] - (469./40.)*dAvC16[7]);
2053 cumulant16[3] = (1./pow(fR0,8.)) * ((-10528./5.)*dAvC16[0] + (30578./5.)*dAvC16[1] - (51456./5.)*dAvC16[2] +
2054 10993.*dAvC16[3] - (38176./5.)*dAvC16[4] + (16818./5.)*dAvC16[5] -
2055 (4288./5.)*dAvC16[6] + (967./10.)*dAvC16[7]);
2057 cumulant16[4] = (1./pow(fR0,10.)) * (11500.*dAvC16[0] - 35800.*dAvC16[1] + 63900.*dAvC16[2] - 71600.*dAvC16[3] +
2058 51620.*dAvC16[4] - 23400.*dAvC16[5] + 6100.*dAvC16[6] - 700.*dAvC16[7]);
2060 cumulant16[5] = (1./pow(fR0,12.)) * (-52560.*dAvC16[0] + 172080.*dAvC16[1] - 321840.*dAvC16[2] + 376200.*dAvC16[3] -
2061 281520.*dAvC16[4] + 131760.*dAvC16[5] - 35280.*dAvC16[6] + 4140.*dAvC16[7]);
2063 cumulant16[6] = (1./pow(fR0,14.)) * (176400.*dAvC16[0] - 599760.*dAvC16[1] + 1164240.*dAvC16[2] - 1411200.*dAvC16[3] +
2064 1093680.*dAvC16[4] - 529200.*dAvC16[5] + 146160.*dAvC16[6] - 17640.*dAvC16[7]);
2066 cumulant16[7] = (1./pow(fR0,16.)) * (-322560*dAvC16[0] + 1128960.*dAvC16[1] - 2257920.*dAvC16[2] + 2822400.*dAvC16[3] -
2067 2257920.*dAvC16[4] + 1128960.*dAvC16[5] - 322560.*dAvC16[6] + 40320.*dAvC16[7]);
2071 cout<<"*********************************"<<endl;
2072 cout<<"cumulants:"<<endl;
2073 cout<<" c_"<<cFlow<<"{2} = "<<cumulant16[0]<<endl;
2074 cout<<" c_"<<cFlow<<"{4} = "<<cumulant16[1]<<endl;
2075 cout<<" c_"<<cFlow<<"{6} = "<<cumulant16[2]<<endl;
2076 cout<<" c_"<<cFlow<<"{8} = "<<cumulant16[3]<<endl;
2077 cout<<"c_"<<cFlow<<"{10} = "<<cumulant16[4]<<endl;
2078 cout<<"c_"<<cFlow<<"{12} = "<<cumulant16[5]<<endl;
2079 cout<<"c_"<<cFlow<<"{14} = "<<cumulant16[6]<<endl;
2080 cout<<"c_"<<cFlow<<"{16} = "<<cumulant16[7]<<endl;
2084 Double_t dV2o16=0.,dV4o16=0.,dV6o16=0.,dV8o16=0.,V10o16=0.,V12o16=0.,V14o16=0.,V16o16=0.;
2086 if(cumulant16[0]>=0.)
2088 dV2o16 = pow(cumulant16[0],(1./2.));
2090 if(cumulant16[1]<=0.)
2092 dV4o16 = pow(-cumulant16[1],(1./4.));
2094 if(cumulant16[2]>=0.)
2096 dV6o16 = pow((1./4.)*cumulant16[2],(1./6.));
2098 if(cumulant16[3]<=0.)
2100 dV8o16 = pow(-(1./33.)*cumulant16[3],(1./8.));
2102 if(cumulant16[4]>=0.)
2104 V10o16 = pow((1./456.)*cumulant16[4],(1./10.));
2106 if(cumulant16[5]<=0.)
2108 V12o16 = pow(-(1./9460.)*cumulant16[5],(1./12.));
2110 if(cumulant16[6]>=0.)
2112 V14o16 = pow((1./274800.)*cumulant16[6],(1./14.));
2114 if(cumulant16[7]<=0.)
2116 V16o16 = pow(-(1./10643745.)*cumulant16[7],(1./16.));
2120 cout<<"***********************************"<<endl;
2121 cout<<"***********************************"<<endl;
2122 cout<<"flow estimates from GF-cumulants:"<<endl;
2123 cout<<" (calculated up to 16th order) "<<endl;
2126 Double_t sdQo16[8]={0.};
2127 Double_t chiQo16[8]={0.};
2130 if(nEvents16 && dAvM16 && cumulant16[0]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(cumulant16[0],(1./2.))*dAvM16,2.)>0.))
2132 chiQo16[0]=dAvM16*dV2o16/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2o16*dAvM16,2.),0.5);
2135 sdQo16[0]=pow(((1./(2.*dAvM16*nEvents16))*((1.+2.*pow(chiQo16[0],2))/(2.*pow(chiQo16[0],2)))),0.5);
2137 cout<<" v_"<<cFlow<<"{2} = "<<dV2o16<<" +/- "<<sdQo16[0]<<endl;
2138 //cout<<" v_"<<cFlow<<"{2} = "<<dV2o16<<" +/- "<<sdQo16[0]<<", chi{2} = "<<chiQo16[0]<<endl;//printing also the chi
2142 cout<<" v_"<<cFlow<<"{2} = Im"<<endl;
2146 if(nEvents16 && dAvM16 && cumulant16[1]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-cumulant16[1],(1./4.))*dAvM16,2.)>0.))
2148 chiQo16[1]=dAvM16*dV4o16/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4o16*dAvM16,2.),0.5);
2151 sdQo16[1]=(1./(pow(2.*dAvM16*nEvents16,0.5)))*pow((1.+4.*pow(chiQo16[1],2.)+1.*pow(chiQo16[1],4.)+2.*pow(chiQo16[1],6.))/(2.*pow(chiQo16[1],6.)),0.5);
2153 cout<<" v_"<<cFlow<<"{4} = "<<dV4o16<<" +/- "<<sdQo16[1]<<endl;
2154 //cout<<" v_"<<cFlow<<"{4} = "<<dV4o16<<" +/- "<<sdQo16[1]<<", chi{4} = "<<chiQo16[1]<<endl;//printing also the chi
2158 cout<<" v_"<<cFlow<<"{4} = Im"<<endl;
2162 if(nEvents16 && dAvM16 && cumulant16[2]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*cumulant16[2],(1./6.))*dAvM16,2.)>0.))
2164 chiQo16[2]=dAvM16*dV6o16/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV6o16*dAvM16,2.),0.5);
2167 sdQo16[2]=(1./(pow(2.*dAvM16*nEvents16,0.5)))*pow((3.+18.*pow(chiQo16[2],2)+9.*pow(chiQo16[2],4.)+28.*pow(chiQo16[2],6.)+12.*pow(chiQo16[2],8.)+24.*pow(chiQo16[2],10.))/(24.*pow(chiQo16[2],10.)),0.5);
2169 cout<<" v_"<<cFlow<<"{6} = "<<dV6o16<<" +/- "<<sdQo16[2]<<endl;
2170 //cout<<" v_"<<cFlow<<"{6} = "<<dV6o16<<" +/- "<<sdQo16[2]<<", chi{6} = "<<chiQo16[2]<<endl;//printing also the chi
2174 cout<<" v_"<<cFlow<<"{6} = Im"<<endl;
2178 if(nEvents16 && dAvM16 && cumulant16[3]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*cumulant16[3],(1./8.))*dAvM16,2.)>0.))
2180 chiQo16[3]=dAvM16*dV8o16/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV8o16*dAvM16,2.),0.5);
2183 sdQo16[3]=(1./(pow(2.*dAvM16*nEvents16,0.5)))*pow((12.+96.*pow(chiQo16[3],2)+72.*pow(chiQo16[3],4.)+304.*pow(chiQo16[3],6.)+257.*pow(chiQo16[3],8.)+804.*pow(chiQo16[3],10.)+363.*pow(chiQo16[3],12.)+726.*pow(chiQo16[3],14.))/(726.*pow(chiQo16[3],14.)),0.5);
2185 cout<<" v_"<<cFlow<<"{8} = "<<dV8o16<<" +/- "<<sdQo16[3]<<endl;
2186 //cout<<" v_"<<cFlow<<"{8} = "<<dV8o16<<" +/- "<<sdQo16[3]<<", chi{8} = "<<chiQo16[3]<<endl;//printing also the chi
2190 cout<<" v_"<<cFlow<<"{8} = Im"<<endl;
2194 if(nEvents16 && dAvM16 && cumulant16[4]>=0.)
2196 cout<<"v_"<<cFlow<<"{10} = "<<V10o16<<endl;
2200 cout<<"v_"<<cFlow<<"{10} = Im"<<endl;
2204 if(nEvents16 && dAvM16 && cumulant16[5]<=0.)
2206 cout<<"v_"<<cFlow<<"{12} = "<<V12o16<<endl;
2210 cout<<"v_"<<cFlow<<"{12} = Im"<<endl;
2214 if(nEvents16 && dAvM16 && cumulant16[6]>=0.)
2216 cout<<"v_"<<cFlow<<"{14} = "<<V14o16<<endl;
2220 cout<<"v_"<<cFlow<<"{14} = Im"<<endl;
2224 if(nEvents16 && dAvM16 && cumulant16[7]<=0.)
2226 cout<<"v_"<<cFlow<<"{16} = "<<V16o16<<endl;
2230 cout<<"v_"<<cFlow<<"{16} = Im"<<endl;
2234 cout<<" nEvts = "<<nEvents16<<", AvM = "<<dAvM16<<endl;
2235 cout<<"*********************************"<<endl;
2237 //==============================================================================================================================================
2239 }//end of if(otherEquations)