Bug fixes in GFC
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Jan 2009 15:57:44 +0000 (15:57 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Jan 2009 15:57:44 +0000 (15:57 +0000)
PWG2/FLOW/AliAnalysisTaskCumulants.cxx
PWG2/FLOW/AliCumulantsFunctions.cxx
PWG2/FLOW/AliCumulantsFunctions.h
PWG2/FLOW/AliFlowAnalysisWithCumulants.cxx
PWG2/FLOW/AliFlowAnalysisWithCumulants.h
PWG2/FLOW/AliFlowAnalysisWithQCumulants.cxx
PWG2/FLOW/AliFlowAnalysisWithQCumulants.h

index 303f61c..6016c3a 100644 (file)
@@ -327,11 +327,11 @@ void AliAnalysisTaskCumulants::Terminate(Option_t *)
   
   //profiles with average values of generating functions for int. and diff. flow
   TProfile2D *intFlowGenFun    = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun")); 
-  TProfile2D *intFlowGenFun4   = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun4"));
   
-  TProfile2D *intFlowGenFun6   = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun6")); 
-  TProfile2D *intFlowGenFun8   = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun8"));
-  TProfile2D *intFlowGenFun16  = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun16"));  
+  TProfile2D *intFlowGenFun4   = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun4"));  //only for other system of Eq.
+  TProfile2D *intFlowGenFun6   = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun6"));  //only for other system of Eq. 
+  TProfile2D *intFlowGenFun8   = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun8"));  //only for other system of Eq.
+  TProfile2D *intFlowGenFun16  = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fIntFlowGenFun16")); //only for other system of Eq.  
   
   TProfile3D *diffFlowGenFunRe = dynamic_cast<TProfile3D*>(fListHistos->FindObject("fDiffFlowGenFunRe"));
   TProfile3D *diffFlowGenFunIm = dynamic_cast<TProfile3D*>(fListHistos->FindObject("fDiffFlowGenFunIm"));
@@ -342,6 +342,11 @@ void AliAnalysisTaskCumulants::Terminate(Option_t *)
   //average selected multiplicity (for int. flow) 
   TProfile *AvMult = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlowGFC"));
   
+  TProfile *AvMult4  = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlow4GFC"));  //only for other system of Eq.
+  TProfile *AvMult6  = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlow6GFC"));  //only for other system of Eq.
+  TProfile *AvMult8  = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlow8GFC"));  //only for other system of Eq.
+  TProfile *AvMult16 = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlow16GFC")); //only for other system of Eq.
+  
   //average values of Q-vector components (1st bin: <Q_x>, 2nd bin: <Q_y>, 3rd bin: <(Q_x)^2>, 4th bin: <(Q_y)^2>) 
   TProfile *QVectorComponents = dynamic_cast<TProfile*>(fListHistos->FindObject("fQVectorComponentsGFC"));
       
@@ -397,10 +402,11 @@ void AliAnalysisTaskCumulants::Terminate(Option_t *)
   fGFC->SetCommonHistsResults8th(commonHistRes8th);
   
   fGFC->SetIntFlowGenFun(intFlowGenFun);
-  fGFC->SetIntFlowGenFun4(intFlowGenFun4);
-  fGFC->SetIntFlowGenFun6(intFlowGenFun6);
-  fGFC->SetIntFlowGenFun8(intFlowGenFun8);  
-  fGFC->SetIntFlowGenFun16(intFlowGenFun16);      
+  
+  fGFC->SetIntFlowGenFun4(intFlowGenFun4);   //only for other system of Eq.
+  fGFC->SetIntFlowGenFun6(intFlowGenFun6);   //only for other system of Eq.
+  fGFC->SetIntFlowGenFun8(intFlowGenFun8);   //only for other system of Eq.
+  fGFC->SetIntFlowGenFun16(intFlowGenFun16); //only for other system of Eq.      
   
   fGFC->SetDiffFlowGenFunRe(diffFlowGenFunRe);
   fGFC->SetDiffFlowGenFunIm(diffFlowGenFunIm);
@@ -408,6 +414,12 @@ void AliAnalysisTaskCumulants::Terminate(Option_t *)
   fGFC->SetNumberOfParticlesPerPtBin(BinNoOfParticles);
   
   fGFC->SetAverageMultiplicity(AvMult);
+  
+  fGFC->SetAverageMultiplicity4(AvMult4);   //only for other system of Eq.
+  fGFC->SetAverageMultiplicity6(AvMult6);   //only for other system of Eq.
+  fGFC->SetAverageMultiplicity8(AvMult8);   //only for other system of Eq.
+  fGFC->SetAverageMultiplicity16(AvMult16); //only for other system of Eq.
+  
   fGFC->SetQVectorComponents(QVectorComponents);
   
   fGFC->Finish();
index 6bd548a..801b664 100644 (file)
@@ -50,10 +50,14 @@ ClassImp(AliCumulantsFunctions)
 
 AliCumulantsFunctions::AliCumulantsFunctions():  
  fIntGenFun(NULL),
- fIntGenFun4(NULL),
- fIntGenFun6(NULL),
- fIntGenFun8(NULL),
- fIntGenFun16(NULL),
+ fIntGenFun4(NULL),//only for other system of Eq.
+ fIntGenFun6(NULL),//only for other system of Eq.
+ fIntGenFun8(NULL),//only for other system of Eq.
+ fIntGenFun16(NULL),//only for other system of Eq.
+ fAvMult4(NULL),//only for other system of Eq.
+ fAvMult6(NULL),//only for other system of Eq.
+ fAvMult8(NULL),//only for other system of Eq.
+ fAvMult16(NULL),//only for other system of Eq.
  fDiffGenFunRe(NULL),
  fDiffGenFunIm(NULL),
  fBinNoOfParticles(NULL),
@@ -95,12 +99,16 @@ AliCumulantsFunctions::~AliCumulantsFunctions()
  //destructor
 }
 
-AliCumulantsFunctions::AliCumulantsFunctions(TProfile2D *IntGenFun, TProfile2D *IntGenFun4, TProfile2D *IntGenFun6, TProfile2D *IntGenFun8, TProfile2D *IntGenFun16, TProfile3D *DiffGenFunRe, TProfile3D *DiffGenFunIm, TProfile *BinNoOfParticles, TH1D *ifr, TH1D *dfr2, TH1D *dfr4, TH1D *dfr6, TH1D *dfr8, TProfile *AvMult, TProfile *QVector, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th):
+AliCumulantsFunctions::AliCumulantsFunctions(TProfile2D *IntGenFun, TProfile2D *IntGenFun4, TProfile2D *IntGenFun6, TProfile2D *IntGenFun8, TProfile2D *IntGenFun16, TProfile *AvMult4, TProfile *AvMult6, TProfile *AvMult8, TProfile *AvMult16, TProfile3D *DiffGenFunRe, TProfile3D *DiffGenFunIm, TProfile *BinNoOfParticles, TH1D *ifr, TH1D *dfr2, TH1D *dfr4, TH1D *dfr6, TH1D *dfr8, TProfile *AvMult, TProfile *QVector, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th):
  fIntGenFun(IntGenFun),
- fIntGenFun4(IntGenFun4),
- fIntGenFun6(IntGenFun6),
- fIntGenFun8(IntGenFun8),
- fIntGenFun16(IntGenFun16),
+ fIntGenFun4(IntGenFun4),//only for other system of Eq.
+ fIntGenFun6(IntGenFun6),//only for other system of Eq.
+ fIntGenFun8(IntGenFun8),//only for other system of Eq.
+ fIntGenFun16(IntGenFun16),//only for other system of Eq.
+ fAvMult4(AvMult4),//only for other system of Eq.
+ fAvMult6(AvMult6),//only for other system of Eq.
+ fAvMult8(AvMult8),//only for other system of Eq.
+ fAvMult16(AvMult16),//only for other system of Eq.
  fDiffGenFunRe(DiffGenFunRe),
  fDiffGenFunIm(DiffGenFunIm),
  fBinNoOfParticles(BinNoOfParticles),
@@ -158,9 +166,9 @@ void AliCumulantsFunctions::Calculate()
  static const Int_t fgknBins=100;                          //number of pt bins //to be improved
  
  Double_t fR0=AliFlowCumuConstants::fgR0;            //needed for numerics
- Double_t fPtMax=AliFlowCommonConstants::GetPtMax(); //maximum pt
- Double_t fPtMin=AliFlowCommonConstants::GetPtMin(); //minimum pt
- Double_t fBinWidth=(fPtMax-fPtMin)/fgknBins;        //width of pt bin (in GeV)   
+ //Double_t fPtMax=AliFlowCommonConstants::GetPtMax(); //maximum pt
+ //Double_t fPtMin=AliFlowCommonConstants::GetPtMin(); //minimum pt
+ //Double_t fBinWidth=(fPtMax-fPtMin)/fgknBins;        //width of pt bin (in GeV)   
  
  Bool_t fOtherEquations=AliFlowCumuConstants::fgOtherEquations;     //numerical equations for cumulants solved up to different highest order 
  
@@ -190,6 +198,7 @@ void AliCumulantsFunctions::Calculate()
  
  //<G[p][q]>
  Double_t AvG[fgkPmax][fgkQmax]={{0.}}; 
+ Bool_t someAvGEntryIsNegative=kFALSE;
  if(fIntGenFun)
  {   
   for(Int_t p=0;p<fgkPmax;p++)
@@ -197,16 +206,20 @@ void AliCumulantsFunctions::Calculate()
    for(Int_t q=0;q<fgkQmax;q++)
    {
     AvG[p][q]=fIntGenFun->GetBinContent(p+1,q+1);
+    if(AvG[p][q]<0.)
+    {
+     someAvGEntryIsNegative=kTRUE;
+    } 
    }
   }  
- }
-  
+ } 
+   
  /////////////////////////////////////////////////////////////////////////////      
  //////////////////gen. function for the cumulants////////////////////////////
  /////////////////////////////////////////////////////////////////////////////
-  
+    
  Double_t C[fgkPmax][fgkQmax]={{0.}};//C[p][q]
- if(AvM)
+ if(AvM>0 && someAvGEntryIsNegative==kFALSE)
  {
   for(Int_t p=0;p<fgkPmax;p++)
   {
@@ -216,7 +229,7 @@ void AliCumulantsFunctions::Calculate()
    }
   }
  }
+    
  /////////////////////////////////////////////////////////////////////////////
  ///////avaraging the gen. function for the cumulants over azimuth////////////
  /////////////////////////////////////////////////////////////////////////////
@@ -290,10 +303,13 @@ void AliCumulantsFunctions::Calculate()
  Double_t ChiQ[4]={0.};
                             
  //v_2{2}
- if(AvM && cumulant[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant[0],(1./2.))*AvM,2.)>0.))
+ if(nEvents>0 && AvM>0 && cumulant[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant[0],(1./2.))*AvM,2.)>0.))
  {        
   ChiQ[0]=AvM*V2/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2*AvM,2.),0.5);
-  SdQ[0]=pow(((1./(2.*AvM*nEvents))*((1.+2.*pow(ChiQ[0],2))/(2.*pow(ChiQ[0],2)))),0.5);
+  if(ChiQ[0])
+  {  
+   SdQ[0]=pow(((1./(2.*AvM*nEvents))*((1.+2.*pow(ChiQ[0],2))/(2.*pow(ChiQ[0],2)))),0.5);
+  }
   cout<<" v_"<<fgkFlow<<"{2} = "<<V2<<" +/- "<<SdQ[0]<<endl;
   //cout<<" v_"<<fgkFlow<<"{2} = "<<V2<<" +/- "<<SdQ[0]<<", chi{2} = "<<ChiQ[0]<<endl;//printing also the chi
   fifr->SetBinContent(1,V2);
@@ -308,10 +324,13 @@ void AliCumulantsFunctions::Calculate()
  }
    
  //v_2{4}   
- if(AvM && cumulant[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant[1],(1./4.))*AvM,2.)>0.))
+ if(nEvents>0 && AvM>0 && cumulant[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant[1],(1./4.))*AvM,2.)>0.))
  {
   ChiQ[1]=AvM*V4/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4*AvM,2.),0.5);
-  SdQ[1]=(1./(pow(2.*AvM*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);
+  if(ChiQ[1])
+  {
+   SdQ[1]=(1./(pow(2.*AvM*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);
+  }
   cout<<" v_"<<fgkFlow<<"{4} = "<<V4<<" +/- "<<SdQ[1]<<endl;
   //cout<<" v_"<<fgkFlow<<"{4} = "<<V4<<" +/- "<<SdQ[1]<<", chi{4} = "<<ChiQ[1]<<endl;//printing also the chi
   fifr->SetBinContent(2,V4);
@@ -326,10 +345,13 @@ void AliCumulantsFunctions::Calculate()
  } 
   
  //v_2{6}
- if(AvM && cumulant[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant[2],(1./6.))*AvM,2.)>0.))
+ if(nEvents>0 && AvM>0 && cumulant[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant[2],(1./6.))*AvM,2.)>0.))
  {
   ChiQ[2]=AvM*V6/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V6*AvM,2.),0.5);
-  SdQ[2]=(1./(pow(2.*AvM*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);
+  if(ChiQ[2])
+  {
+   SdQ[2]=(1./(pow(2.*AvM*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);
+  } 
   cout<<" v_"<<fgkFlow<<"{6} = "<<V6<<" +/- "<<SdQ[2]<<endl;
   //cout<<" v_"<<fgkFlow<<"{6} = "<<V6<<" +/- "<<SdQ[2]<<", chi{6} = "<<ChiQ[2]<<endl;//printing also the chi
   fifr->SetBinContent(3,V6);
@@ -344,10 +366,13 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{8}
- if(AvM && cumulant[3]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-(1./33.)*cumulant[3],(1./8.))*AvM,2.)>0.))
+ if(nEvents>0 && AvM>0 && cumulant[3]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-(1./33.)*cumulant[3],(1./8.))*AvM,2.)>0.))
  {  
   ChiQ[3]=AvM*V8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V8*AvM,2.),0.5);
-  SdQ[3]=(1./(pow(2.*AvM*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);
+  if(ChiQ[3])
+  {
+   SdQ[3]=(1./(pow(2.*AvM*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);
+  } 
   cout<<" v_"<<fgkFlow<<"{8} = "<<V8<<" +/- "<<SdQ[3]<<endl;
   //cout<<" v_"<<fgkFlow<<"{8} = "<<V8<<" +/- "<<SdQ[3]<<", chi{8} = "<<ChiQ[3]<<endl;//printing also the chi
   fifr->SetBinContent(4,V8);
@@ -537,18 +562,43 @@ void AliCumulantsFunctions::Calculate()
   
   
  
+ //off the record: numerical equations for cumulants solved up to different highest order  
  if(fOtherEquations)
  {
  
  //==============================================================================================================================================
+  
  //up to 4th order
- Double_t AvG4[fgkPmax4][fgkQmax4]={{0.}};    
+ //avarage selected multiplicity
+ Double_t AvM4=0.;
+ if(fAvMult4)
+ {
+  AvM4=fAvMult4->GetBinContent(1);
+ }
+
+ //number of events
+ Int_t nEvents4=0;
+ if(fAvMult4)
+ {
+  nEvents4=(Int_t)(fAvMult4->GetBinEntries(1));
+ }
+ Double_t AvG4[fgkPmax4][fgkQmax4]={{0.}}; 
+ Bool_t someAvGEntryIsNegative4=kFALSE;   
  for(Int_t p=0;p<fgkPmax4;p++)
  {
   for(Int_t q=0;q<fgkQmax4;q++)
   {
    AvG4[p][q]=fIntGenFun4->GetBinContent(p+1,q+1);
+   if(AvG4[p][q]<0.)
+   {
+    someAvGEntryIsNegative4=kTRUE;
+   } 
   }
  }  
  /////////////////////////////////////////////////////////////////////////////      
@@ -556,13 +606,13 @@ void AliCumulantsFunctions::Calculate()
  /////////////////////////////////////////////////////////////////////////////
   
  Double_t C4[fgkPmax4][fgkQmax4]={{0.}};//C[p][q]
- if(AvM)
+ if(AvM4>0 && someAvGEntryIsNegative4==kFALSE)
  {
   for (Int_t p=0;p<fgkPmax4;p++)
   {
    for (Int_t q=0;q<fgkQmax4;q++)
    {
-    C4[p][q]=1.*AvM*(pow(AvG4[p][q],(1./AvM))-1.); 
+    C4[p][q]=1.*AvM4*(pow(AvG4[p][q],(1./AvM4))-1.); 
    }
   }
  }
@@ -621,10 +671,13 @@ void AliCumulantsFunctions::Calculate()
  Double_t ChiQo4[2]={0.};
           
  //v_2{2}
- if(AvM && cumulant4[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant4[0],(1./2.))*AvM,2.)>0.))
+ if(nEvents4 && AvM4 && cumulant4[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant4[0],(1./2.))*AvM4,2.)>0.))
  {        
-  ChiQo4[0]=AvM*V2o4/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o4*AvM,2.),0.5);
-  SdQo4[0]=pow(((1./(2.*AvM*nEvents))*((1.+2.*pow(ChiQo4[0],2))/(2.*pow(ChiQo4[0],2)))),0.5);
+  ChiQo4[0]=AvM4*V2o4/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o4*AvM4,2.),0.5);
+  if(ChiQo4[0])
+  {
+   SdQo4[0]=pow(((1./(2.*AvM4*nEvents4))*((1.+2.*pow(ChiQo4[0],2))/(2.*pow(ChiQo4[0],2)))),0.5);
+  }
   cout<<" v_"<<fgkFlow<<"{2} = "<<V2o4<<" +/- "<<SdQo4[0]<<endl;
   //cout<<" v_"<<fgkFlow<<"{2} = "<<V2o4<<" +/- "<<SdQo4[0]<<", chi{2} = "<<ChiQo4[0]<<endl;//printing also the chi
  } 
@@ -634,10 +687,13 @@ void AliCumulantsFunctions::Calculate()
  }
    
  //v_2{4}   
- if(AvM && cumulant4[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant4[1],(1./4.))*AvM,2.)>0.))
+ if(nEvents4 && AvM4 && cumulant4[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant4[1],(1./4.))*AvM4,2.)>0.))
  {
-  ChiQo4[1]=AvM*V4o4/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o4*AvM,2.),0.5);
-  SdQo4[1]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo4[1]=AvM4*V4o4/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o4*AvM4,2.),0.5);
+  if(ChiQo4[1])
+  {
+   SdQo4[1]=(1./(pow(2.*AvM4*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);
+  }
   cout<<" v_"<<fgkFlow<<"{4} = "<<V4o4<<" +/- "<<SdQo4[1]<<endl;   
   //cout<<" v_"<<fgkFlow<<"{4} = "<<V4o4<<" +/- "<<SdQo4[1]<<", chi{4} = "<<ChiQo4[1]<<endl;//printing also the chi 
  } 
@@ -647,19 +703,38 @@ void AliCumulantsFunctions::Calculate()
  } 
   
  cout<<endl;
- cout<<"   nEvts = "<<nEvents<<", AvM = "<<AvM<<endl; 
+ cout<<"   nEvts = "<<nEvents4<<", AvM = "<<AvM4<<endl; 
  cout<<"***********************************"<<endl;    
  cout<<"***********************************"<<endl;   
  
  //============================================================================================================================================== 
  
  //up to 6th order
- Double_t AvG6[fgkPmax6][fgkQmax6]={{0.}};    
+ //avarage selected multiplicity
+ Double_t AvM6=0.;
+ if(fAvMult6)
+ {
+  AvM6=fAvMult6->GetBinContent(1);
+ }
+
+ //number of events
+ Int_t nEvents6=0;
+ if(fAvMult6)
+ {
+  nEvents6=(Int_t)(fAvMult6->GetBinEntries(1));
+ }
+ Double_t AvG6[fgkPmax6][fgkQmax6]={{0.}};  
+ Bool_t someAvGEntryIsNegative6=kFALSE;   
  for(Int_t p=0;p<fgkPmax6;p++)
  {
   for(Int_t q=0;q<fgkQmax6;q++)
   {
    AvG6[p][q]=fIntGenFun6->GetBinContent(p+1,q+1);
+   if(AvG6[p][q]<0.)
+   {
+    someAvGEntryIsNegative6=kTRUE;
+   } 
   }
  }  
  /////////////////////////////////////////////////////////////////////////////      
@@ -667,10 +742,13 @@ void AliCumulantsFunctions::Calculate()
  /////////////////////////////////////////////////////////////////////////////
   
  Double_t C6[fgkPmax6][fgkQmax6]={{0.}};//C[p][q]
- if(AvM){
-  for (Int_t p=0;p<fgkPmax6;p++){
-   for (Int_t q=0;q<fgkQmax6;q++){
-    C6[p][q]=1.*AvM*(pow(AvG6[p][q],(1./AvM))-1.); 
+ if(AvM6>0 && someAvGEntryIsNegative6==kFALSE)
+ {
+  for (Int_t p=0;p<fgkPmax6;p++)
+  {
+   for (Int_t q=0;q<fgkQmax6;q++)
+   {
+    C6[p][q]=1.*AvM6*(pow(AvG6[p][q],(1./AvM6))-1.); 
    }
   }
  }
@@ -733,10 +811,13 @@ void AliCumulantsFunctions::Calculate()
  Double_t ChiQo6[3]={0.};
           
  //v_2{2}
- if(AvM && cumulant6[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant6[0],(1./2.))*AvM,2.)>0.))
+ if(nEvents6 && AvM6 && cumulant6[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant6[0],(1./2.))*AvM6,2.)>0.))
  {        
-  ChiQo6[0]=AvM*V2o6/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o6*AvM,2.),0.5);
-  SdQo6[0]=pow(((1./(2.*AvM*nEvents))*((1.+2.*pow(ChiQo6[0],2))/(2.*pow(ChiQo6[0],2)))),0.5);
+  ChiQo6[0]=AvM6*V2o6/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o6*AvM6,2.),0.5);
+  if(ChiQo6[0])
+  {
+   SdQo6[0]=pow(((1./(2.*AvM6*nEvents6))*((1.+2.*pow(ChiQo6[0],2))/(2.*pow(ChiQo6[0],2)))),0.5);
+  }
   cout<<" v_"<<fgkFlow<<"{2} = "<<V2o6<<" +/- "<<SdQo6[0]<<endl;
   //cout<<" v_"<<fgkFlow<<"{2} = "<<V2o6<<" +/- "<<SdQo6[0]<<", chi{2} = "<<ChiQo6[0]<<endl;//printing also the chi
  } 
@@ -746,10 +827,13 @@ void AliCumulantsFunctions::Calculate()
  }
    
  //v_2{4}   
- if(AvM && cumulant6[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant6[1],(1./4.))*AvM,2.)>0.))
+ if(nEvents6 && AvM6 && cumulant6[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant6[1],(1./4.))*AvM6,2.)>0.))
  {
-  ChiQo6[1]=AvM*V4o6/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o6*AvM,2.),0.5);
-  SdQo6[1]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo6[1]=AvM6*V4o6/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o6*AvM6,2.),0.5);
+  if(ChiQo6[1])
+  {
+   SdQo6[1]=(1./(pow(2.*AvM6*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);
+  }
   cout<<" v_"<<fgkFlow<<"{4} = "<<V4o6<<" +/- "<<SdQo6[1]<<endl;    
   //cout<<" v_"<<fgkFlow<<"{4} = "<<V4o6<<" +/- "<<SdQo6[1]<<", chi{4} = "<<ChiQo6[1]<<endl;//printing also the chi 
  } 
@@ -759,10 +843,13 @@ void AliCumulantsFunctions::Calculate()
  }   
   
  //v_2{6}
- if(AvM && cumulant6[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant6[2],(1./6.))*AvM,2.)>0.))
+ if(nEvents6 && AvM6 && cumulant6[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant6[2],(1./6.))*AvM6,2.)>0.))
  {
-  ChiQo6[2]=AvM*V6/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V6o6*AvM,2.),0.5);
-  SdQo6[2]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo6[2]=AvM6*V6/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V6o6*AvM6,2.),0.5);
+  if(ChiQo6[2])
+  {
+   SdQo6[2]=(1./(pow(2.*AvM6*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);
+  } 
    cout<<" v_"<<fgkFlow<<"{6} = "<<V6o6<<" +/- "<<SdQo6[2]<<endl;   
    //cout<<" v_"<<fgkFlow<<"{6} = "<<V6o6<<" +/- "<<SdQo6[2]<<", chi{6} = "<<ChiQo6[2]<<endl;//printing also the chi
  }
@@ -772,19 +859,38 @@ void AliCumulantsFunctions::Calculate()
  }
  
  cout<<endl;
- cout<<"   nEvts = "<<nEvents<<", AvM = "<<AvM<<endl; 
+ cout<<"   nEvts = "<<nEvents6<<", AvM = "<<AvM6<<endl; 
  cout<<"***********************************"<<endl;    
  cout<<"***********************************"<<endl;   
  
  //============================================================================================================================================== 
     
  //up to 8th order
- Double_t AvG8[fgkPmax8][fgkQmax8]={{0.}};    
+ //avarage selected multiplicity
+ Double_t AvM8=0.;
+ if(fAvMult8)
+ {
+  AvM8=fAvMult8->GetBinContent(1);
+ }
+
+ //number of events
+ Int_t nEvents8=0;
+ if(fAvMult8)
+ {
+  nEvents8=(Int_t)(fAvMult8->GetBinEntries(1));
+ }
+ Double_t AvG8[fgkPmax8][fgkQmax8]={{0.}}; 
+ Bool_t someAvGEntryIsNegative8=kFALSE;   
  for(Int_t p=0;p<fgkPmax8;p++)
  {
   for(Int_t q=0;q<fgkQmax8;q++)
   {
    AvG8[p][q]=fIntGenFun8->GetBinContent(p+1,q+1);
+   if(AvG8[p][q]<0.)
+   {
+    someAvGEntryIsNegative8=kTRUE;
+   } 
   }
  }  
  /////////////////////////////////////////////////////////////////////////////      
@@ -792,10 +898,13 @@ void AliCumulantsFunctions::Calculate()
  /////////////////////////////////////////////////////////////////////////////
   
  Double_t C8[fgkPmax8][fgkQmax8]={{0.}};//C[p][q]
- if(AvM){
-  for (Int_t p=0;p<fgkPmax8;p++){
-   for (Int_t q=0;q<fgkQmax8;q++){
-    C8[p][q]=1.*AvM*(pow(AvG8[p][q],(1./AvM))-1.); 
+ if(AvM8>0 && someAvGEntryIsNegative8==kFALSE)
+ {
+  for (Int_t p=0;p<fgkPmax8;p++)
+  {
+   for (Int_t q=0;q<fgkQmax8;q++)
+   {
+    C8[p][q]=1.*AvM8*(pow(AvG8[p][q],(1./AvM8))-1.); 
    }
   }
  }
@@ -880,10 +989,13 @@ void AliCumulantsFunctions::Calculate()
  Double_t ChiQo8[4]={0.};
           
  //v_2{2}
- if(AvM && cumulant8[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant8[0],(1./2.))*AvM,2.)>0.))
+ if(nEvents8 && AvM8 && cumulant8[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant8[0],(1./2.))*AvM8,2.)>0.))
  {        
-  ChiQo8[0]=AvM*V2o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o8*AvM,2.),0.5);
-  SdQo8[0]=pow(((1./(2.*AvM*nEvents))*((1.+2.*pow(ChiQo8[0],2.))/(2.*pow(ChiQo8[0],2)))),0.5);
+  ChiQo8[0]=AvM8*V2o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o8*AvM8,2.),0.5);
+  if(ChiQo8[0])
+  {
+   SdQo8[0]=pow(((1./(2.*AvM8*nEvents8))*((1.+2.*pow(ChiQo8[0],2.))/(2.*pow(ChiQo8[0],2)))),0.5);
+  }
   cout<<" v_"<<fgkFlow<<"{2} = "<<V2o8<<" +/- "<<SdQo8[0]<<endl;    
   //cout<<" v_"<<fgkFlow<<"{2} = "<<V2o8<<" +/- "<<SdQo8[0]<<", chi{2} = "<<ChiQo8[0]<<endl;//printing also the chi
  } 
@@ -893,10 +1005,13 @@ void AliCumulantsFunctions::Calculate()
  }
    
  //v_2{4}   
- if(AvM && cumulant8[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant8[1],(1./4.))*AvM,2.)>0.))
+ if(nEvents8 && AvM8 && cumulant8[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant8[1],(1./4.))*AvM8,2.)>0.))
  {
-  ChiQo8[1]=AvM*V4o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o8*AvM,2.),0.5);
-  SdQo8[1]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo8[1]=AvM8*V4o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o8*AvM8,2.),0.5);
+  if(ChiQo8[1])
+  {
+   SdQo8[1]=(1./(pow(2.*AvM8*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);
+  }
   cout<<" v_"<<fgkFlow<<"{4} = "<<V4o8<<" +/- "<<SdQo8[1]<<endl;    
   //cout<<" v_"<<fgkFlow<<"{4} = "<<V4o8<<" +/- "<<SdQo8[1]<<", chi{4} = "<<ChiQo8[1]<<endl;//printing also the chi 
  } 
@@ -906,10 +1021,13 @@ void AliCumulantsFunctions::Calculate()
  } 
   
  //v_2{6}
- if(AvM && cumulant8[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant8[2],(1./6.))*AvM,2.)>0.))
+ if(nEvents8 && AvM8 && cumulant8[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant8[2],(1./6.))*AvM8,2.)>0.))
  {
-  ChiQo8[2]=AvM*V6o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V6o8*AvM,2.),0.5);
-  SdQo8[2]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo8[2]=AvM8*V6o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V6o8*AvM8,2.),0.5);
+  if(ChiQo8[2])
+  {
+   SdQo8[2]=(1./(pow(2.*AvM8*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);
+  }
   cout<<" v_"<<fgkFlow<<"{6} = "<<V6o8<<" +/- "<<SdQo8[2]<<endl;
   //cout<<" v_"<<fgkFlow<<"{6} = "<<V6o8<<" +/- "<<SdQo8[2]<<", chi{6} = "<<ChiQo8[2]<<endl;//printing also the chi 
  }
@@ -919,10 +1037,13 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{8}
- if(AvM && cumulant8[3]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-(1./33.)*cumulant8[3],(1./8.))*AvM,2.)>0.))
+ if(nEvents8 && AvM8 && cumulant8[3]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-(1./33.)*cumulant8[3],(1./8.))*AvM8,2.)>0.))
  {  
-  ChiQo8[3]=AvM*V8o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V8o8*AvM,2.),0.5);
-  SdQo8[3]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo8[3]=AvM8*V8o8/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V8o8*AvM8,2.),0.5);
+  if(ChiQo8[3])
+  {
+   SdQo8[3]=(1./(pow(2.*AvM8*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);
+  } 
   cout<<" v_"<<fgkFlow<<"{8} = "<<V8o8<<" +/- "<<SdQo8[3]<<endl;  
   //cout<<" v_"<<fgkFlow<<"{8} = "<<V8o8<<" +/- "<<SdQo8[3]<<", chi{8} = "<<ChiQo8[3]<<endl;//printing also the chi 
  } 
@@ -932,18 +1053,37 @@ void AliCumulantsFunctions::Calculate()
  }
   
  cout<<endl;
- cout<<"   nEvts = "<<nEvents<<", AvM = "<<AvM<<endl; 
+ cout<<"   nEvts = "<<nEvents8<<", AvM = "<<AvM8<<endl; 
  cout<<"*********************************"<<endl; 
 
  //============================================================================================================================================== 
    
  //up to 16-th order: 
+ //avarage selected multiplicity
+ Double_t AvM16=0.;
+ if(fAvMult16)
+ {
+  AvM16=fAvMult16->GetBinContent(1);
+ }
+
+ //number of events
+ Int_t nEvents16=0;
+ if(fAvMult16)
+ {
+  nEvents16=(Int_t)(fAvMult16->GetBinEntries(1));
+ }
  Double_t AvG16[fgkPmax16][fgkQmax16]={{0.}};  
+ Bool_t someAvGEntryIsNegative16=kFALSE; 
  for(Int_t p=0;p<fgkPmax16;p++)
  {
   for(Int_t q=0;q<fgkQmax16;q++)
   {
    AvG16[p][q]=fIntGenFun16->GetBinContent(p+1,q+1);
+   if(AvG16[p][q]<0.)
+   {
+    someAvGEntryIsNegative16=kTRUE;
+   } 
   }
  }  
  
@@ -952,13 +1092,13 @@ void AliCumulantsFunctions::Calculate()
  /////////////////////////////////////////////////////////////////////////////
   
  Double_t C16[fgkPmax16][fgkQmax16]={{0.}};//C16[p][q]
- if(AvM)
+ if(AvM16>0 && someAvGEntryIsNegative16==kFALSE)
  {
   for(Int_t p=0;p<fgkPmax16;p++)
   {
    for(Int_t q=0;q<fgkQmax16;q++)
    {
-    C16[p][q]=1.*AvM*(pow(AvG16[p][q],(1./AvM))-1.); 
+    C16[p][q]=1.*AvM16*(pow(AvG16[p][q],(1./AvM16))-1.); 
    }
   }
  }
@@ -1072,10 +1212,13 @@ void AliCumulantsFunctions::Calculate()
  Double_t ChiQo16[8]={0.};
           
  //v_2{2}
- if(AvM && cumulant16[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant16[0],(1./2.))*AvM,2.)>0.))
+ if(nEvents16 && AvM16 && cumulant16[0]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(cumulant16[0],(1./2.))*AvM16,2.)>0.))
  {        
-  ChiQo16[0]=AvM*V2o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o16*AvM,2.),0.5);
-  SdQo16[0]=pow(((1./(2.*AvM*nEvents))*((1.+2.*pow(ChiQo16[0],2))/(2.*pow(ChiQo16[0],2)))),0.5);
+  ChiQo16[0]=AvM16*V2o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V2o16*AvM16,2.),0.5);
+  if(ChiQo16[0])
+  {
+   SdQo16[0]=pow(((1./(2.*AvM16*nEvents16))*((1.+2.*pow(ChiQo16[0],2))/(2.*pow(ChiQo16[0],2)))),0.5);
+  }
   cout<<" v_"<<fgkFlow<<"{2} = "<<V2o16<<" +/- "<<SdQo16[0]<<endl;
   //cout<<" v_"<<fgkFlow<<"{2} = "<<V2o16<<" +/- "<<SdQo16[0]<<", chi{2} = "<<ChiQo16[0]<<endl;//printing also the chi
  } 
@@ -1085,10 +1228,13 @@ void AliCumulantsFunctions::Calculate()
  }
    
  //v_2{4}   
- if(AvM && cumulant16[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant16[1],(1./4.))*AvM,2.)>0.))
+ if(nEvents16 && AvM16 && cumulant16[1]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-cumulant16[1],(1./4.))*AvM16,2.)>0.))
  {
-  ChiQo16[1]=AvM*V4o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o16*AvM,2.),0.5);
-  SdQo16[1]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo16[1]=AvM16*V4o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V4o16*AvM16,2.),0.5);
+  if(ChiQo16[1])
+  {
+   SdQo16[1]=(1./(pow(2.*AvM16*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);
+  }
   cout<<" v_"<<fgkFlow<<"{4} = "<<V4o16<<" +/- "<<SdQo16[1]<<endl; 
   //cout<<" v_"<<fgkFlow<<"{4} = "<<V4o16<<" +/- "<<SdQo16[1]<<", chi{4} = "<<ChiQo16[1]<<endl;//printing also the chi
  } 
@@ -1098,10 +1244,13 @@ void AliCumulantsFunctions::Calculate()
  } 
   
  //v_2{6}
- if(AvM && cumulant16[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant16[2],(1./6.))*AvM,2.)>0.))
+ if(nEvents16 && AvM16 && cumulant16[2]>=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow((1./4.)*cumulant16[2],(1./6.))*AvM16,2.)>0.))
  {
-  ChiQo16[2]=AvM*V6o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V6o16*AvM,2.),0.5);
-  SdQo16[2]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo16[2]=AvM16*V6o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V6o16*AvM16,2.),0.5);
+  if(ChiQo16[2])
+  {
+   SdQo16[2]=(1./(pow(2.*AvM16*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);
+  }
   cout<<" v_"<<fgkFlow<<"{6} = "<<V6o16<<" +/- "<<SdQo16[2]<<endl;
   //cout<<" v_"<<fgkFlow<<"{6} = "<<V6o16<<" +/- "<<SdQo16[2]<<", chi{6} = "<<ChiQo16[2]<<endl;//printing also the chi
  }
@@ -1111,10 +1260,13 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{8}
- if(AvM && cumulant16[3]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-(1./33.)*cumulant16[3],(1./8.))*AvM,2.)>0.))
+ if(nEvents16 && AvM16 && cumulant16[3]<=0. && (AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(pow(-(1./33.)*cumulant16[3],(1./8.))*AvM16,2.)>0.))
  {  
-  ChiQo16[3]=AvM*V8o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V8o16*AvM,2.),0.5);
-  SdQo16[3]=(1./(pow(2.*AvM*nEvents,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);
+  ChiQo16[3]=AvM16*V8o16/pow(AvQ2x+AvQ2y-pow(AvQx,2.)-pow(AvQy,2.)-pow(V8o16*AvM16,2.),0.5);
+  if(ChiQo16[3])
+  {
+   SdQo16[3]=(1./(pow(2.*AvM16*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);
+  } 
   cout<<" v_"<<fgkFlow<<"{8} = "<<V8o16<<" +/- "<<SdQo16[3]<<endl;
   //cout<<" v_"<<fgkFlow<<"{8} = "<<V8o16<<" +/- "<<SdQo16[3]<<", chi{8} = "<<ChiQo16[3]<<endl;//printing also the chi
  } 
@@ -1124,7 +1276,7 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{10}
- if(AvM && cumulant16[4]>=0.)
+ if(nEvents16 && AvM16 && cumulant16[4]>=0.)
  {
   cout<<"v_"<<fgkFlow<<"{10} = "<<V10o16<<endl;
  } 
@@ -1134,7 +1286,7 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{12}
- if(AvM && AvM && cumulant16[5]<=0.)
+ if(nEvents16 && AvM16 && AvM16 && cumulant16[5]<=0.)
  {
   cout<<"v_"<<fgkFlow<<"{12} = "<<V12o16<<endl;
  } 
@@ -1144,7 +1296,7 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{14}
- if(AvM && cumulant16[6]>=0.)
+ if(nEvents16 && AvM16 && cumulant16[6]>=0.)
  {
   cout<<"v_"<<fgkFlow<<"{14} = "<<V14o16<<endl;
  } 
@@ -1154,7 +1306,7 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{16}
- if(AvM && cumulant16[7]<=0.)
+ if(nEvents16 && AvM16 && cumulant16[7]<=0.)
  {
   cout<<"v_"<<fgkFlow<<"{16} = "<<V16o16<<endl;
  } 
@@ -1164,7 +1316,7 @@ void AliCumulantsFunctions::Calculate()
  }
   
  cout<<endl;
- cout<<"   nEvts = "<<nEvents<<", AvM = "<<AvM<<endl; 
+ cout<<"   nEvts = "<<nEvents16<<", AvM = "<<AvM16<<endl; 
  cout<<"*********************************"<<endl;    
  
  //==============================================================================================================================================
index 1a70178..4f6f945 100644 (file)
@@ -38,7 +38,7 @@ class AliCumulantsFunctions{
   virtual ~AliCumulantsFunctions();
   //AliCumulantsFunctions(TProfile2D *IntGenFun, TProfile3D *DiffGenFunRe, TProfile3D *DiffGenFunIm, TH1D *ifr, TH1D *dfr2, TH1D *dfr4, TH1D *dfr6, TH1D *dfr8, TProfile *AvMult, TProfile *fQVector, TH1D *fQDistrib, TProfile2D *fdRe0, TProfile2D *fdRe1, TProfile2D *fdRe2, TProfile2D *fdRe3, TProfile2D *fdRe4, TProfile2D *fdRe5, TProfile2D *fdRe6, TProfile2D *fdRe7, TProfile2D *fdIm0, TProfile2D *fdIm1, TProfile2D *fdIm2, TProfile2D *fdIm3, TProfile2D *fdIm4, TProfile2D *fdIm5, TProfile2D *fdIm6, TProfile2D *fdIm7);
   
-  AliCumulantsFunctions(TProfile2D *IntGenFun, TProfile2D *IntGenFun4, TProfile2D *IntGenFun6, TProfile2D *IntGenFun8, TProfile2D *IntGenFun16, TProfile3D *DiffGenFunRe, TProfile3D *DiffGenFunIm, TProfile *BinNoOfParticles, TH1D *ifr, TH1D *dfr2, TH1D *dfr4, TH1D *dfr6, TH1D *dfr8, TProfile *AvMult, TProfile *QVector, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th);
+  AliCumulantsFunctions(TProfile2D *IntGenFun, TProfile2D *IntGenFun4, TProfile2D *IntGenFun6, TProfile2D *IntGenFun8, TProfile2D *IntGenFun16, TProfile *AvMult4, TProfile *AvMult6, TProfile *AvMult8, TProfile *AvMult16, TProfile3D *DiffGenFunRe, TProfile3D *DiffGenFunIm, TProfile *BinNoOfParticles, TH1D *ifr, TH1D *dfr2, TH1D *dfr4, TH1D *dfr6, TH1D *dfr8, TProfile *AvMult, TProfile *QVector, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th);
  
   void Calculate();
 
@@ -47,10 +47,16 @@ class AliCumulantsFunctions{
   AliCumulantsFunctions& operator=(const AliCumulantsFunctions& fun);
   
   TProfile2D *fIntGenFun;    //average value of generating function for int. flow
-  TProfile2D *fIntGenFun4;   //average value of generating function for int. flow
-  TProfile2D *fIntGenFun6;   //average value of generating function for int. flow
-  TProfile2D *fIntGenFun8;   //average value of generating function for int. flow
-  TProfile2D *fIntGenFun16;  //average value of generating function for int. flow
+  
+  TProfile2D *fIntGenFun4;   //average value of generating function for int. flow (only for other system of Eq.)
+  TProfile2D *fIntGenFun6;   //average value of generating function for int. flow (only for other system of Eq.)
+  TProfile2D *fIntGenFun8;   //average value of generating function for int. flow (only for other system of Eq.)
+  TProfile2D *fIntGenFun16;  //average value of generating function for int. flow (only for other system of Eq.)
+  
+  TProfile *fAvMult4;        //average selected multiplicity for int. flow (only for other system of Eq.)
+  TProfile *fAvMult6;        //average selected multiplicity for int. flow (only for other system of Eq.)
+  TProfile *fAvMult8;        //average selected multiplicity for int. flow (only for other system of Eq.)
+  TProfile *fAvMult16;       //average selected multiplicity for int. flow (only for other system of Eq.)
 
   TProfile3D *fDiffGenFunRe; //average value of generating function for diff. flow (real part)
   TProfile3D *fDiffGenFunIm; //average value of generating function for diff. flow (imaginary part)
index 3510f8e..2828bb3 100644 (file)
@@ -82,10 +82,14 @@ AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants():
  fCommonHistsResults6th(NULL),
  fCommonHistsResults8th(NULL),
  fIntFlowGenFun(NULL),
- fIntFlowGenFun4(NULL),
- fIntFlowGenFun6(NULL),
- fIntFlowGenFun8(NULL),
- fIntFlowGenFun16(NULL),
+ fIntFlowGenFun4(NULL),//(only for other system of Eq.)
+ fIntFlowGenFun6(NULL),//(only for other system of Eq.)
+ fIntFlowGenFun8(NULL),//(only for other system of Eq.)
+ fIntFlowGenFun16(NULL),//(only for other system of Eq.)
+ fAvMultIntFlow4GFC(NULL),//(only for other system of Eq.)
+ fAvMultIntFlow6GFC(NULL),//(only for other system of Eq.)
+ fAvMultIntFlow8GFC(NULL),//(only for other system of Eq.)
+ fAvMultIntFlow16GFC(NULL),//(only for other system of Eq.)
  fDiffFlowGenFunRe(NULL),
  fDiffFlowGenFunIm(NULL),
  fBinNoOfParticles(NULL),
@@ -202,29 +206,69 @@ void AliFlowAnalysisWithCumulants::CreateOutputObjects()
 
  if(fOtherEquations)
  {
-  //avarage of the generating function for integrated flow <G[p][q]> (up to 4th order)
+  //avarage of the generating function for integrated flow <G[p][q]> (only for other system of Eq. - up to 4th order)
   fIntFlowGenFun4 = new TProfile2D("fIntFlowGenFun4","<G4[p4][q4]>",fgkPmax4,0.,(Double_t)fgkPmax4,fgkQmax4,0.,(Double_t)fgkQmax4);
   fIntFlowGenFun4->SetXTitle("p4");
   fIntFlowGenFun4->SetYTitle("q4");
   fHistList->Add(fIntFlowGenFun4);
 
-  //avarage of the generating function for integrated flow <G[p][q]> (up to 6th order) 
+  //avarage of the generating function for integrated flow <G[p][q]> (only for other system of Eq. - up to 6th order) 
   fIntFlowGenFun6 = new TProfile2D("fIntFlowGenFun6","<G6[p6][q6]>",fgkPmax6,0.,(Double_t)fgkPmax6,fgkQmax6,0.,(Double_t)fgkQmax6);
   fIntFlowGenFun6->SetXTitle("p6");
   fIntFlowGenFun6->SetYTitle("q6");
   fHistList->Add(fIntFlowGenFun6);
 
-  //avarage of the generating function for integrated flow <G[p][q]> (up to 8th order)
+  //avarage of the generating function for integrated flow <G[p][q]> (only for other system of Eq. - up to 8th order)
   fIntFlowGenFun8 = new TProfile2D("fIntFlowGenFun8","<G8[p8][q8]>",fgkPmax8,0.,(Double_t)fgkPmax8,fgkQmax8,0.,(Double_t)fgkQmax8);
   fIntFlowGenFun8->SetXTitle("p8");
   fIntFlowGenFun8->SetYTitle("q8");
   fHistList->Add(fIntFlowGenFun8);
 
-  //avarage of the generating function for integrated flow <G[p][q]> (up to 16th order)
+  //avarage of the generating function for integrated flow <G[p][q]> (only for other system of Eq. - up to 16th order)
   fIntFlowGenFun16 = new TProfile2D("fIntFlowGenFun16","<G16[p16][q16]>",fgkPmax16,0.,(Double_t)fgkPmax16,fgkQmax16,0.,(Double_t)fgkQmax16);
   fIntFlowGenFun16->SetXTitle("p16");
   fIntFlowGenFun16->SetYTitle("q16");
   fHistList->Add(fIntFlowGenFun16);
+  //average multiplicity (only for other system of Eq. - up to 4th order)
+  fAvMultIntFlow4GFC = new TProfile("fAvMultIntFlow4GFC","Average Multiplicity",1,0,1,"s");
+  fAvMultIntFlow4GFC->SetXTitle("");
+  fAvMultIntFlow4GFC->SetYTitle("");
+  fAvMultIntFlow4GFC->SetLabelSize(0.06);
+  fAvMultIntFlow4GFC->SetMarkerStyle(25);
+  fAvMultIntFlow4GFC->SetLabelOffset(0.01);
+  (fAvMultIntFlow4GFC->GetXaxis())->SetBinLabel(1,"Average Multiplicity");
+  fHistList->Add(fAvMultIntFlow4GFC);
+  //average multiplicity (only for other system of Eq. - up to 6th order)
+  fAvMultIntFlow6GFC = new TProfile("fAvMultIntFlow6GFC","Average Multiplicity",1,0,1,"s");
+  fAvMultIntFlow6GFC->SetXTitle("");
+  fAvMultIntFlow6GFC->SetYTitle("");
+  fAvMultIntFlow6GFC->SetLabelSize(0.06);
+  fAvMultIntFlow6GFC->SetMarkerStyle(25);
+  fAvMultIntFlow6GFC->SetLabelOffset(0.01);
+  (fAvMultIntFlow6GFC->GetXaxis())->SetBinLabel(1,"Average Multiplicity");
+  fHistList->Add(fAvMultIntFlow6GFC);
+  //average multiplicity (only for other system of Eq. - up to 8th order)
+  fAvMultIntFlow8GFC = new TProfile("fAvMultIntFlow8GFC","Average Multiplicity",1,0,1,"s");
+  fAvMultIntFlow8GFC->SetXTitle("");
+  fAvMultIntFlow8GFC->SetYTitle("");
+  fAvMultIntFlow8GFC->SetLabelSize(0.06);
+  fAvMultIntFlow8GFC->SetMarkerStyle(25);
+  fAvMultIntFlow8GFC->SetLabelOffset(0.01);
+  (fAvMultIntFlow8GFC->GetXaxis())->SetBinLabel(1,"Average Multiplicity");
+  fHistList->Add(fAvMultIntFlow8GFC);
+  //average multiplicity (only for other system of Eq. - up to 16th order)
+  fAvMultIntFlow16GFC = new TProfile("fAvMultIntFlow16GFC","Average Multiplicity",1,0,1,"s");
+  fAvMultIntFlow16GFC->SetXTitle("");
+  fAvMultIntFlow16GFC->SetYTitle("");
+  fAvMultIntFlow16GFC->SetLabelSize(0.06);
+  fAvMultIntFlow16GFC->SetMarkerStyle(25);
+  fAvMultIntFlow16GFC->SetLabelOffset(0.01);
+  (fAvMultIntFlow16GFC->GetXaxis())->SetBinLabel(1,"Average Multiplicity");
+  fHistList->Add(fAvMultIntFlow16GFC);
  }
  
  //avarage of the real part of generating function for differential flow <Re(D[b][p][q])>
@@ -359,11 +403,13 @@ void AliFlowAnalysisWithCumulants::CreateOutputObjects()
 
 void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
 {
- //running over data
- Int_t nPrim = anEvent->NumberOfTracks();//total multiplicity
+ //running over data:
+ Int_t nPrim = anEvent->NumberOfTracks(); //total multiplicity
+ Int_t nEventNSelTracksIntFlow = anEvent->GetEventNSelTracksIntFlow(); //selected multiplicity (particles used for int. flow)
   
- //if(nPrim>30)//generating function formalism can be applied only for large multiplicities (to be improved in the future) 
- //{ 
+ if(nEventNSelTracksIntFlow>9) //generating function formalism applied here make sense only for selected multiplicity >= 10 
+ { 
  //fill the common control histograms
  fCommonHists->FillControlHistograms(anEvent);   
   
@@ -377,8 +423,6 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
     G[p][q]=1.;
    }   
   }
- Int_t nEventNSelTracksIntFlow = anEvent->GetEventNSelTracksIntFlow(); //selected multiplicity (particles used for int. flow)
 
  Int_t nSelTracksIntFlow = 0; //cross-checking the selected multiplicity
  
@@ -517,21 +561,27 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
  }//ending the second loop over data            
  */
       
-//}//end of if(nPrim>30)
-                      
- //numerical equations for cumulants solved up to different highest order  
+ }//end of if(nEventNSelTracksIntFlow>9)                   
  
+
  
   
+   
     
+     
+      
+       
+        
+         
+          
+           
+ //off the record: numerical equations for cumulants solved up to different highest order  
  if(fOtherEquations)
  {
+  //running over data
+  Int_t nPrimOE = anEvent->NumberOfTracks();//total multiplicity 
   
+  Int_t nEventNSelTracksIntFlowOE = anEvent->GetEventNSelTracksIntFlow();
   
   Double_t G4[fgkPmax4][fgkQmax4];
   Double_t G6[fgkPmax6][fgkQmax6];
@@ -556,13 +606,15 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
     } 
    }
   } 
-  
-  //Int_t nEventNSelTracksIntFlowOE = anEvent->GetEventNSelTracksIntFlow();
+   
+  //multiplicities: 
+  if(nEventNSelTracksIntFlowOE>15) fAvMultIntFlow16GFC->Fill(0.,nEventNSelTracksIntFlowOE,1);
+  if(nEventNSelTracksIntFlowOE>7) fAvMultIntFlow8GFC->Fill(0.,nEventNSelTracksIntFlowOE,1);
+  if(nEventNSelTracksIntFlowOE>5) fAvMultIntFlow6GFC->Fill(0.,nEventNSelTracksIntFlowOE,1);
+  if(nEventNSelTracksIntFlowOE>3) fAvMultIntFlow4GFC->Fill(0.,nEventNSelTracksIntFlowOE,1);  
   
   //first loop over data: evaluating the generating function G[p][q] for integrated flow 
-  for(Int_t i=0;i<nPrim;i++)
+  for(Int_t i=0;i<nPrimOE;i++)
   {
    fTrack=anEvent->GetTrack(i);
    if(fTrack && fTrack->UseForIntegratedFlow())
@@ -571,16 +623,28 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
     {
      for(Int_t q=0;q<fgkQmax16;q++)
      {
-      G16[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlow)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax16));     
+      if(nEventNSelTracksIntFlowOE>15)
+      {
+       G16[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlowOE)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax16));
+      }       
       if(p<fgkPmax8 && q<fgkQmax8)
       {
-       G8[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlow)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax8));
+       if(nEventNSelTracksIntFlowOE>7)
+       { 
+        G8[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlowOE)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax8));
+       }
        if(p<fgkPmax6 && q<fgkQmax6)
        {
-        G6[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlow)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax6));
+        if(nEventNSelTracksIntFlowOE>5) 
+        {
+         G6[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlowOE)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax6));
+        }
         if(p<fgkPmax4 && q<fgkQmax4)
         {
-         G4[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlow)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax4));
+         if(nEventNSelTracksIntFlowOE>3)
+         {
+          G4[p][q]*=(1.+(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlowOE)*cos(fgkFlow*fTrack->Phi()-2.*q*TMath::Pi()/fgkQmax4));
+         } 
         }
        }
       }
@@ -594,26 +658,23 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
  {
   for(Int_t q=0;q<fgkQmax16;q++)
   {
-   fIntFlowGenFun16->Fill((Double_t)p,(Double_t)q,G16[p][q],1);
+   if(nEventNSelTracksIntFlowOE>15) fIntFlowGenFun16->Fill((Double_t)p,(Double_t)q,G16[p][q],1);
    if(p<fgkPmax8 && q<fgkQmax8)
    {
-    fIntFlowGenFun8->Fill((Double_t)p,(Double_t)q,G8[p][q],1);
+    if(nEventNSelTracksIntFlowOE>7) fIntFlowGenFun8->Fill((Double_t)p,(Double_t)q,G8[p][q],1);
     if(p<fgkPmax6 && q<fgkQmax6)
     {
-     fIntFlowGenFun6->Fill((Double_t)p,(Double_t)q,G6[p][q],1);
+     if(nEventNSelTracksIntFlowOE>5) fIntFlowGenFun6->Fill((Double_t)p,(Double_t)q,G6[p][q],1);
      if(p<fgkPmax4 && q<fgkQmax4)
      {
-      fIntFlowGenFun4->Fill((Double_t)p,(Double_t)q,G4[p][q],1);
+      if(nEventNSelTracksIntFlowOE>3) fIntFlowGenFun4->Fill((Double_t)p,(Double_t)q,G4[p][q],1);
      }
     }
    } 
   }
  }
 }//end of if(fOtherEquations)                  
-                                                                                       
-
-                                                                                                 
-                                                                                                                                                                                                                                                                                                 
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
 }//end of Make()
 
 //================================================================================================================
@@ -623,7 +684,7 @@ void AliFlowAnalysisWithCumulants::Finish()
  //calculate the final results
  //AliCumulantsFunctions finalResults(fIntFlowGenFun,NULL,NULL, fIntFlowResults,fDiffFlowResults2,fDiffFlowResults4,fDiffFlowResults6,fDiffFlowResults8,fAvMultIntFlow,fQVectorComponents,  fQDist,fDiffFlowGenFunRe0,fDiffFlowGenFunRe1,fDiffFlowGenFunRe2, fDiffFlowGenFunRe3,fDiffFlowGenFunRe4,fDiffFlowGenFunRe5,fDiffFlowGenFunRe6,fDiffFlowGenFunRe7,fDiffFlowGenFunIm0,fDiffFlowGenFunIm1, fDiffFlowGenFunIm2,fDiffFlowGenFunIm3,fDiffFlowGenFunIm4,fDiffFlowGenFunIm5,fDiffFlowGenFunIm6,fDiffFlowGenFunIm7);
 
- AliCumulantsFunctions finalResults(fIntFlowGenFun,fIntFlowGenFun4,fIntFlowGenFun6,fIntFlowGenFun8,fIntFlowGenFun16,fDiffFlowGenFunRe,fDiffFlowGenFunIm,fBinNoOfParticles, fIntFlowResultsGFC,fDiffFlowResults2ndOrderGFC,fDiffFlowResults4thOrderGFC,fDiffFlowResults6thOrderGFC,fDiffFlowResults8thOrderGFC, fAvMultIntFlowGFC,fQVectorComponentsGFC,fCommonHistsResults2nd, fCommonHistsResults4th,fCommonHistsResults6th,fCommonHistsResults8th);
+ AliCumulantsFunctions finalResults(fIntFlowGenFun,fIntFlowGenFun4,fIntFlowGenFun6,fIntFlowGenFun8,fIntFlowGenFun16,fAvMultIntFlow4GFC, fAvMultIntFlow6GFC,fAvMultIntFlow8GFC,fAvMultIntFlow16GFC,fDiffFlowGenFunRe,fDiffFlowGenFunIm,fBinNoOfParticles, fIntFlowResultsGFC,fDiffFlowResults2ndOrderGFC,fDiffFlowResults4thOrderGFC,fDiffFlowResults6thOrderGFC,fDiffFlowResults8thOrderGFC, fAvMultIntFlowGFC,fQVectorComponentsGFC,fCommonHistsResults2nd, fCommonHistsResults4th,fCommonHistsResults6th,fCommonHistsResults8th);
                            
  finalResults.Calculate();  
 }
index bd75a95..d7e4f97 100644 (file)
@@ -79,19 +79,31 @@ class AliFlowAnalysisWithCumulants{
   void SetIntFlowGenFun(TProfile2D* ifgf)  {this->fIntFlowGenFun = ifgf;};
   TProfile2D* GetIntFlowGenFun() const     {return this->fIntFlowGenFun;};
 
-  void SetIntFlowGenFun4(TProfile2D* ifgf4)  {this->fIntFlowGenFun4 = ifgf4;};
-  TProfile2D* GetIntFlowGenFun4() const      {return this->fIntFlowGenFun4;};
+  void SetIntFlowGenFun4(TProfile2D* ifgf4)  {this->fIntFlowGenFun4 = ifgf4;}; //(only for other system of Eq.)
+  TProfile2D* GetIntFlowGenFun4() const      {return this->fIntFlowGenFun4;};  //(only for other system of Eq.)
   
-  void SetIntFlowGenFun6(TProfile2D* ifgf6)  {this->fIntFlowGenFun6 = ifgf6;};
-  TProfile2D* GetIntFlowGenFun6() const      {return this->fIntFlowGenFun6;};
+  void SetIntFlowGenFun6(TProfile2D* ifgf6)  {this->fIntFlowGenFun6 = ifgf6;}; //(only for other system of Eq.)
+  TProfile2D* GetIntFlowGenFun6() const      {return this->fIntFlowGenFun6;};  //(only for other system of Eq.)
   
-  void SetIntFlowGenFun8(TProfile2D* ifgf8)  {this->fIntFlowGenFun8 = ifgf8;};
-  TProfile2D* GetIntFlowGenFun8() const      {return this->fIntFlowGenFun8;};
+  void SetIntFlowGenFun8(TProfile2D* ifgf8)  {this->fIntFlowGenFun8 = ifgf8;}; //(only for other system of Eq.)
+  TProfile2D* GetIntFlowGenFun8() const      {return this->fIntFlowGenFun8;};  //(only for other system of Eq.)
   
-  void SetIntFlowGenFun16(TProfile2D* ifgf16)  {this->fIntFlowGenFun16 = ifgf16;};
-  TProfile2D* GetIntFlowGenFun16() const       {return this->fIntFlowGenFun16;};
+  void SetIntFlowGenFun16(TProfile2D* ifgf16)  {this->fIntFlowGenFun16 = ifgf16;}; //(only for other system of Eq.)
+  TProfile2D* GetIntFlowGenFun16() const       {return this->fIntFlowGenFun16;};   //(only for other system of Eq.)
  
-  void SetDiffFlowGenFunRe(TProfile3D* dfgfRe)  {this->fDiffFlowGenFunRe = dfgfRe;};
+  void SetAverageMultiplicity4(TProfile* am4)     {this->fAvMultIntFlow4GFC = am4;};  //(only for other system of Eq.)
+  TProfile* GetAverageMultiplicity4() const       {return this->fAvMultIntFlow4GFC;}; //(only for other system of Eq.)
+  
+  void SetAverageMultiplicity6(TProfile* am6)     {this->fAvMultIntFlow6GFC = am6;};  //(only for other system of Eq.)
+  TProfile* GetAverageMultiplicity6() const       {return this->fAvMultIntFlow6GFC;}; //(only for other system of Eq.)
+  
+  void SetAverageMultiplicity8(TProfile* am8)     {this->fAvMultIntFlow8GFC = am8;};  //(only for other system of Eq.)
+  TProfile* GetAverageMultiplicity8() const       {return this->fAvMultIntFlow8GFC;}; //(only for other system of Eq.)
+  
+  void SetAverageMultiplicity16(TProfile* am16)    {this->fAvMultIntFlow16GFC = am16;}; //(only for other system of Eq.)
+  TProfile* GetAverageMultiplicity16() const       {return this->fAvMultIntFlow16GFC;}; //(only for other system of Eq.)
+  void SetDiffFlowGenFunRe(TProfile3D* dfgfRe)    {this->fDiffFlowGenFunRe = dfgfRe;};
   TProfile3D* GetDiffFlowGenFunRe() const         {return this->fDiffFlowGenFunRe;};
   
   void SetDiffFlowGenFunIm(TProfile3D* dfgfIm)  {this->fDiffFlowGenFunIm = dfgfIm;};
@@ -153,11 +165,17 @@ class AliFlowAnalysisWithCumulants{
   AliFlowCommonHistResults*  fCommonHistsResults8th; //final results for 8th order int. and diff. flow stored in the common histograms
   
   TProfile2D*        fIntFlowGenFun;   //avarage of the generating function for integrated flow 
-  TProfile2D*        fIntFlowGenFun4;  //avarage of the generating function for integrated flow 
-  TProfile2D*        fIntFlowGenFun6;  //avarage of the generating function for integrated flow
-  TProfile2D*        fIntFlowGenFun8;  //avarage of the generating function for integrated flow
-  TProfile2D*        fIntFlowGenFun16; //avarage of the generating function for integrated flow 
-     
+  
+  TProfile2D*        fIntFlowGenFun4;  //avarage of the generating function for integrated flow (only for different system of Eq.)
+  TProfile2D*        fIntFlowGenFun6;  //avarage of the generating function for integrated flow (only for different system of Eq.)
+  TProfile2D*        fIntFlowGenFun8;  //avarage of the generating function for integrated flow (only for different system of Eq.)
+  TProfile2D*        fIntFlowGenFun16; //avarage of the generating function for integrated flow (only for different system of Eq.)
+
+  TProfile*          fAvMultIntFlow4GFC;  //average selected multiplicity (only for different system of Eq.)
+  TProfile*          fAvMultIntFlow6GFC;  //average selected multiplicity (only for different system of Eq.) 
+  TProfile*          fAvMultIntFlow8GFC;  //average selected multiplicity (only for different system of Eq.)
+  TProfile*          fAvMultIntFlow16GFC; //average selected multiplicity (only for different system of Eq.)
+                   
   TProfile3D*        fDiffFlowGenFunRe; //avarage of the generating function for differential flow (real part)
   TProfile3D*        fDiffFlowGenFunIm; //avarage of the generating function for differential flow (imaginary part)
   TProfile*          fBinNoOfParticles; //number of particles per pt bin
index 49c49ba..1412a2a 100644 (file)
@@ -81,7 +81,10 @@ AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
  f3PerBin2n1n1n(NULL),
  f3PerBin1n1n2n(NULL),
  f4PerBin1n1n1n1n(NULL),
- fCommonHists(NULL),
+ fCommonHists2nd(NULL),
+ fCommonHists4th(NULL),
+ fCommonHists6th(NULL),
+ fCommonHists8th(NULL),
  fCommonHistsResults2nd(NULL),
  fCommonHistsResults4th(NULL),
  fCommonHistsResults6th(NULL),
@@ -290,10 +293,22 @@ void AliFlowAnalysisWithQCumulants::CreateOutputObjects()
  //f4PerBin1n1n1n1n->SetYTitle("<4'>_{n,n|n,n}");
  fHistList->Add(f4PerBin1n1n1n1n);
  
- //common control histograms
- fCommonHists = new AliFlowCommonHist("AliFlowCommonHistQC");
- fHistList->Add(fCommonHists);  
+ //common control histogram (2nd order)
+ fCommonHists2nd = new AliFlowCommonHist("AliFlowCommonHist2ndOrderQC");
+ fHistList->Add(fCommonHists2nd);  
  
+ //common control histogram (4th order)
+ fCommonHists4th = new AliFlowCommonHist("AliFlowCommonHist4thOrderQC");
+ fHistList->Add(fCommonHists4th);  
+ //common control histogram (6th order)
+ fCommonHists6th = new AliFlowCommonHist("AliFlowCommonHist6thOrderQC");
+ fHistList->Add(fCommonHists6th);  
+ //common control histogram (8th order)
+ fCommonHists8th = new AliFlowCommonHist("AliFlowCommonHist8thOrderQC");
+ fHistList->Add(fCommonHists8th);  
+   
  //common histograms for final results (2nd order)
  fCommonHistsResults2nd = new AliFlowCommonHistResults("AliFlowCommonHistResults2ndOrderQC");
  fHistList->Add(fCommonHistsResults2nd); 
@@ -343,13 +358,11 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  //running over data     
           
  //get the total multiplicity of event:
- //Int_t nPrim = anEvent->NumberOfTracks();//line needed only for nested loops
+ Int_t nPrim = anEvent->NumberOfTracks();//line needed only for nested loops
+ cout<<"nPrim = "<<nPrim<<endl;
 
  //if(nPrim>8&&nPrim<12)//line needed only for nested loops  
  //{                    //line needed only for nested loops
-
- //fill the common control histograms:
- fCommonHists->FillControlHistograms(anEvent); 
  
  //get the selected multiplicity (i.e. number of particles used for int. flow):
  //Int_t nEventNSelTracksIntFlow = anEvent->GetEventNSelTracksIntFlow();
@@ -479,6 +492,9 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  Double_t two1n1n=0., two2n2n=0., two3n3n=0., two4n4n=0.; 
  if(xMult>1)
  {
+  //fill the common control histogram (2nd order):
+  fCommonHists2nd->FillControlHistograms(anEvent); 
   two1n1n = (pow(xQvector1n.Mod(),2.)-xMult)/(xMult*(xMult-1.)); //<2>_{n|n}   = <cos(n*(phi1-phi2))>
   two2n2n = (pow(xQvector2n.Mod(),2.)-xMult)/(xMult*(xMult-1.)); //<2>_{2n|2n} = <cos(2n*(phi1-phi2))>
   two3n3n = (pow(xQvector3n.Mod(),2.)-xMult)/(xMult*(xMult-1.)); //<2>_{3n|3n} = <cos(3n*(phi1-phi2))>
@@ -511,6 +527,9 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  Double_t four1n1n1n1n=0., four2n2n2n2n=0., four2n1n2n1n=0., four3n1n1n1n=0., four4n2n1n1n=0., four3n1n2n2n=0., four3n1n3n1n=0.;  
  if(xMult>3)
  {
+  //fill the common control histogram (4th order):
+  fCommonHists4th->FillControlHistograms(anEvent); 
+
   four1n1n1n1n = (2.*xMult*(xMult-3.)+pow(xQvector1n.Mod(),4.)-4.*(xMult-2.)*pow(xQvector1n.Mod(),2.)-2.*reQ2nQ1nstarQ1nstar+pow(xQvector2n.Mod(),2.))/(xMult*(xMult-1)*(xMult-2.)*(xMult-3.));//<4>_{n,n|n,n}
   four2n2n2n2n = (2.*xMult*(xMult-3.)+pow(xQvector2n.Mod(),4.)-4.*(xMult-2.)*pow(xQvector2n.Mod(),2.)-2.*reQ4nQ2nstarQ2nstar+pow(xQvector4n.Mod(),2.))/(xMult*(xMult-1)*(xMult-2.)*(xMult-3.));//<4>_{2n,2n|2n,2n}
   four2n1n2n1n = (xQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)/(xMult*(xMult-1.)*(xMult-2.)*(xMult-3.))-((xMult-5.)*pow(xQvector1n.Mod(),2.)+(xMult-4.)*pow(xQvector2n.Mod(),2.)-pow(xQvector3n.Mod(),2.))/(xMult*(xMult-1.)*(xMult-2.)*(xMult-3.))+(xMult-6.)/((xMult-1.)*(xMult-2.)*(xMult-3.));//Re[<4>_{2n,n|2n,n}]
@@ -563,6 +582,9 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  Double_t six1n1n1n1n1n1n=0., six2n2n1n1n1n1n=0., six3n1n1n1n1n1n=0., six2n1n1n2n1n1n=0.;
  if(xMult>5)
  {
+  //fill the common control histogram (6th order):
+  fCommonHists6th->FillControlHistograms(anEvent); 
   six1n1n1n1n1n1n = (pow(xQvector1n.Mod(),6.)+9.*xQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)/(xMult*(xMult-1)*(xMult-2)*(xMult-3)*(xMult-4)*(xMult-5))+4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)/(xMult*(xMult-1)*(xMult-2)*(xMult-3)*(xMult-4)*(xMult-5))+2.*(9.*(xMult-4.)*reQ2nQ1nstarQ1nstar+2.*pow(xQvector3n.Mod(),2.))/(xMult*(xMult-1)*(xMult-2)*(xMult-3)*(xMult-4)*(xMult-5))-9.*(pow(xQvector1n.Mod(),4.)+pow(xQvector2n.Mod(),2.))/(xMult*(xMult-1)*(xMult-2)*(xMult-3)*(xMult-5))+(18.*pow(xQvector1n.Mod(),2.))/(xMult*(xMult-1)*(xMult-3)*(xMult-4))-(6.)/((xMult-1)*(xMult-2)*(xMult-3));//<6>_{n,n,n|n,n,n}
   
   six2n1n1n2n1n1n = (xQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(xMult-4.)*(2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)-xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(4.*four1n1n1n1n+4.*two1n1n+2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n+4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n+4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)-xMult*(xMult-1.)*(xMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.+4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n+8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n+8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n+4.*three3n2n1n+2.*three4n2n2n)-xMult*(xMult-1.)*(4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n+   1.+2.*two2n2n+1.*two4n4n)-xMult)/(xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(xMult-4.)*(xMult-5.));//<6>_{2n,n,n|2n,n,n}
@@ -595,6 +617,9 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  Double_t eight1n1n1n1n1n1n1n1n=0.;
  if(xMult>7)
  {
+  //fill the common control histogram (8th order):
+  fCommonHists8th->FillControlHistograms(anEvent); 
+  
   eight1n1n1n1n1n1n1n1n = (pow(xQvector1n.Mod(),8)-xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(xMult-4.)*(xMult-5.)*(xMult-6.)*(12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(xMult-4.)*(xMult-5.)*(8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)-xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(xMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n+32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n+144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n+16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n+288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-xMult*(xMult-1.)*(xMult-2.)*(12.*three2n1n1n+16.*two1n1n+24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n+96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-xMult*(xMult-1.)*(8.*two1n1n+12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-xMult)/(xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(xMult-4.)*(xMult-5.)*(xMult-6.)*(xMult-7.));
   
   fQCorrelations->Fill(30.,eight1n1n1n1n1n1n1n1n,xMult*(xMult-1.)*(xMult-2.)*(xMult-3.)*(xMult-4.)*(xMult-5.)*(xMult-6.)*(xMult-7.));
index 8d6fd58..6afb7ce 100644 (file)
@@ -133,7 +133,10 @@ class AliFlowAnalysisWithQCumulants{
   TProfile*                  f3PerBin1n1n2n;            //<<3'>>_{n,n|2n} per pt-bin
   TProfile*                  f4PerBin1n1n1n1n;          //<<4'>>_{n,n|n,n} per pt-bin
  
-  AliFlowCommonHist*         fCommonHists;              //common control histograms
+  AliFlowCommonHist*         fCommonHists2nd;           //common control histograms for 2nd order
+  AliFlowCommonHist*         fCommonHists4th;           //common control histograms for 4th order
+  AliFlowCommonHist*         fCommonHists6th;           //common control histograms for 6th order
+  AliFlowCommonHist*         fCommonHists8th;           //common control histograms for 8th order
   
   AliFlowCommonHistResults*  fCommonHistsResults2nd;    //final results for 2nd order int. and diff. flow stored in the common histograms 
   AliFlowCommonHistResults*  fCommonHistsResults4th;    //final results for 4th order int. and diff. flow stored in the common histograms