uncertainties back in, incase of weights still behaving funny
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Feb 2009 14:28:40 +0000 (14:28 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Feb 2009 14:28:40 +0000 (14:28 +0000)
PWG2/FLOW/AliFlowCommon/AliCumulantsFunctions.cxx
PWG2/FLOW/AliFlowCommon/AliCumulantsFunctions.h
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithCumulants.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithCumulants.h
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx

index 515b227..cd7a826 100644 (file)
@@ -78,6 +78,7 @@ AliCumulantsFunctions::AliCumulantsFunctions():
  fdfr8(NULL),
  fAvMult(NULL),
  fQVector(NULL),
+ fAverageOfSquaredWeight(NULL),
  fchr2nd(NULL),
  fchr4th(NULL),
  fchr6th(NULL),
@@ -110,7 +111,7 @@ AliCumulantsFunctions::~AliCumulantsFunctions()
  //destructor
 }
 
-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, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th, AliFlowCommonHist *ch):
+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):
  fIntGenFun(intGenFun),
  fIntGenFun4(intGenFun4),//only for other system of Eq.
  fIntGenFun6(intGenFun6),//only for other system of Eq.
@@ -139,6 +140,7 @@ AliCumulantsFunctions::AliCumulantsFunctions(TProfile2D *intGenFun, TProfile2D *
  fdfr8(dfr8),
  fAvMult(avMult),
  fQVector(qVector),
+ fAverageOfSquaredWeight(averageOfSquaredWeight),
  fchr2nd(chr2nd),
  fchr4th(chr4th),
  fchr6th(chr6th),
@@ -218,6 +220,14 @@ void AliCumulantsFunctions::Calculate()
   dAvQ2y = fQVector->GetBinContent(4); //<(Q_y)^2>
  }
  
+ //<w^2>
+ Double_t dAvw2 = fAverageOfSquaredWeight->GetBinContent(1); // <w^2>
+ if(dAvw2 ==0) 
+ {
+  cout<<" WARNING: Average squared weight is 0."<<endl;
+  exit(0);
+ } 
  //<G[p][q]>
  Double_t dAvG[fgkPmax][fgkQmax]={{0.}}; 
  Bool_t someAvGEntryIsNegative=kFALSE;
@@ -319,17 +329,16 @@ void AliCumulantsFunctions::Calculate()
  cout<<endl;
  cout<<"***************************************"<<endl;
  cout<<"***************************************"<<endl;
- cout<<"flow estimates from GF-cumulants (RP):"<<endl;
+ cout<<"flow estimates from GF-cumulants:      "<<endl;
  cout<<endl;          
                 
  Double_t sdQ[4]={0.};
  Double_t chiQ[4]={0.};
                             
  //v_2{2}
- //if(nEvents>0 && dAvM>0 && cumulant[0]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(cumulant[0],(1./2.))*dAvM,2.)>0.))
- if(nEvents>0 && dAvM>0 && cumulant[0]>=0.)// to be improved (take the above line once chi is rescaled with weights, analogously for higher orders)
+ if(nEvents>0 && dAvM>0 && dAvw2 && cumulant[0]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(cumulant[0],(1./2.))*(dAvM/dAvw2),2.)>0.))
  {        
-  //chiQ[0]=dAvM*dV2/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.),0.5); // to be improved,  analogously for higher orders
+  chiQ[0]=(dAvM/dAvw2)*dV2/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM/dAvw2,2.),0.5); // to be improved,  analogously for higher orders
   if(chiQ[0])
   {  
    sdQ[0]=pow(((1./(2.*dAvM*nEvents))*((1.+2.*pow(chiQ[0],2))/(2.*pow(chiQ[0],2)))),0.5);
@@ -355,10 +364,9 @@ void AliCumulantsFunctions::Calculate()
  }
    
  //v_2{4}   
- //if(nEvents>0 && dAvM>0 && cumulant[1]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-cumulant[1],(1./4.))*dAvM,2.)>0.))
- if(nEvents>0 && dAvM>0 && cumulant[1]<=0.)
+ if(nEvents>0 && dAvM>0 && dAvw2 && cumulant[1]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-cumulant[1],(1./4.))*(dAvM/dAvw2),2.)>0.))
  {
-  //chiQ[1]=dAvM*dV4/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.),0.5);
+  chiQ[1]=(dAvM/dAvw2)*dV4/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*(dAvM/dAvw2),2.),0.5);
   if(chiQ[1])
   {
    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);
@@ -384,10 +392,9 @@ void AliCumulantsFunctions::Calculate()
  } 
   
  //v_2{6}
- //if(nEvents>0 && dAvM>0 && cumulant[2]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*cumulant[2],(1./6.))*dAvM,2.)>0.))
- if(nEvents>0 && dAvM>0 && cumulant[2]>=0.)
+ if(nEvents>0 && dAvM>0 && dAvw2 && cumulant[2]>=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*cumulant[2],(1./6.))*(dAvM/dAvw2),2.)>0.))
  {
-  //chiQ[2]=dAvM*dV6/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV6*dAvM,2.),0.5);
+  chiQ[2]=(dAvM/dAvw2)*dV6/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV6*(dAvM/dAvw2),2.),0.5);
   if(chiQ[2])
   {
    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);
@@ -414,10 +421,9 @@ void AliCumulantsFunctions::Calculate()
  }
   
  //v_2{8}
- //if(nEvents>0 && dAvM>0 && cumulant[3]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*cumulant[3],(1./8.))*dAvM,2.)>0.))
- if(nEvents>0 && dAvM>0 && cumulant[3]<=0.) 
+ if(nEvents>0 && dAvM>0 && dAvw2 && cumulant[3]<=0. && (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*cumulant[3],(1./8.))*(dAvM/dAvw2),2.)>0.))
  {  
-  //chiQ[3]=dAvM*dV8/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV8*dAvM,2.),0.5);
+  chiQ[3]=(dAvM/dAvw2)*dV8/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV8*(dAvM/dAvw2),2.),0.5);
   if(chiQ[3])
   {
    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);
@@ -575,10 +581,9 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[0]>0)
     {
       v2ptRP[b]=ptRPDiffCumulant2[b]/pow(cumulant[0],0.5);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0.&&ptBinRPNoOfParticles[b]>0.) // to be improved
-      if (ptBinRPNoOfParticles[b]>0.)
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*(dAvM/dAvw2),2.)>0. && ptBinRPNoOfParticles[b]>0.) 
       {
-       //sdRPDiff2pt[b]=pow((1./(2.*ptBinRPNoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5); // to be improved
+       sdRPDiff2pt[b]=pow((1./(2.*ptBinRPNoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5); 
        //cout<<"v'_2/2{2} = "<<v2ptRP[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdRPDiff2pt[b]<<"%"<<endl;
        fdfr2->SetBinContent(b+1,v2ptRP[b]);
        fdfr2->SetBinError(b+1,sdRPDiff2pt[b]);
@@ -602,10 +607,10 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[1]<0)
     {
       v4ptRP[b]=-ptRPDiffCumulant4[b]/pow(-cumulant[1],.75);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&ptBinRPNoOfParticles[b]>0.) // to be improved
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*(dAvM/dAvw2),2.)>0.&&ptBinRPNoOfParticles[b]>0.) // to be improved
       if (ptBinRPNoOfParticles[b]>0.)
       {
-       //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);
+       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);
        //cout<<"v'_2/2{4} = "<<v4ptRP[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdRPDiff4pt[b]<<"%"<<endl;
        fdfr4->SetBinContent(b+1,v4ptRP[b]);
        fdfr4->SetBinError(b+1,sdRPDiff4pt[b]);
@@ -673,9 +678,75 @@ void AliCumulantsFunctions::Calculate()
  
  
  
+  ///////////////////////////////////////////////////////////////////////////////////
+ //////////////////////// INTEGRATED FLOW CALCULATIONS (RP) /////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////
  
+ Double_t dV2RP=0., dV4RP=0., dV6RP=0., dV8RP=0.;
+ Double_t dV2RPError=0., dV4RPError=0., dV6RPError=0., dV8RPError=0.;
+ Double_t dSumOfYieldRP=0.;
+ for (Int_t b=1;b<fgknBinsPt+1;b++)
+ { 
+  if(fch->GetHistPtInt())
+  {  
+   dSumOfYieldRP+=(fch->GetHistPtInt())->GetBinContent(b);
+   if(fchr2nd->GetHistDiffFlowPtRP())
+   {
+    dV2RP+=((fchr2nd->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtInt())->GetBinContent(b);
+    dV2RPError+=pow((fch->GetHistPtInt())->GetBinContent(b),2.)*pow((fchr2nd->GetHistDiffFlowPtRP())->GetBinError(b),2.);  
+   }
+   if(fchr4th->GetHistDiffFlowPtRP())
+   {
+    dV4RP+=((fchr4th->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtInt())->GetBinContent(b);
+    dV4RPError+=pow((fch->GetHistPtInt())->GetBinContent(b),2.)*pow((fchr4th->GetHistDiffFlowPtRP())->GetBinError(b),2.);
+   }
+   if(fchr6th->GetHistDiffFlowPtRP())
+   {
+    dV6RP+=((fchr6th->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtInt())->GetBinContent(b);
+    dV6RPError+=pow((fch->GetHistPtInt())->GetBinContent(b),2.)*pow((fchr6th->GetHistDiffFlowPtRP())->GetBinError(b),2.);
+   }
+   if(fchr8th->GetHistDiffFlowPtRP())
+   {
+    dV8RP+=((fchr8th->GetHistDiffFlowPtRP())->GetBinContent(b))*(fch->GetHistPtInt())->GetBinContent(b);
+    dV8RPError+=pow((fch->GetHistPtInt())->GetBinContent(b),2.)*pow((fchr8th->GetHistDiffFlowPtRP())->GetBinError(b),2.);
+   }      
+  } 
+ }
  
+ if(dSumOfYieldRP)
+ {
+  dV2RP/=dSumOfYieldRP;
+  dV2RPError/=(dSumOfYieldRP*dSumOfYieldRP);
+  dV4RP/=dSumOfYieldRP;
+  dV4RPError/=(dSumOfYieldRP*dSumOfYieldRP);
+  dV6RP/=dSumOfYieldRP;
+  dV6RPError/=(dSumOfYieldRP*dSumOfYieldRP);
+  dV8RP/=dSumOfYieldRP;
+  dV8RPError/=(dSumOfYieldRP*dSumOfYieldRP);
+  fchr2nd->FillIntegratedFlowRP(dV2RP,pow(dV2RPError,0.5)); 
+  fchr4th->FillIntegratedFlowRP(dV4RP,pow(dV4RPError,0.5)); 
+  fchr6th->FillIntegratedFlowRP(dV6RP,pow(dV6RPError,0.5));//to be improved (errors needed) 
+  fchr8th->FillIntegratedFlowRP(dV8RP,pow(dV8RPError,0.5));//to be improved (errors needed)  
+ }
  
+ cout<<endl;
+ cout<<"***************************************"<<endl;
+ cout<<"***************************************"<<endl;
+ cout<<"flow estimates from GF-cumulants (RP):"<<endl;
+ cout<<endl;     
+
+ cout<<"   v_"<<fgkFlow<<"{2} = "<<dV2RP<<" +/- "<<pow(dV2RPError,0.5)<<endl;
+ cout<<"   v_"<<fgkFlow<<"{4} = "<<dV4RP<<" +/- "<<pow(dV4RPError,0.5)<<endl;
+ cout<<"   v_"<<fgkFlow<<"{6} = "<<dV6RP<<" +/- "<<pow(dV6RPError,0.5)<<endl;
+ cout<<"   v_"<<fgkFlow<<"{8} = "<<dV8RP<<" +/- "<<pow(dV8RPError,0.5)<<endl;
+
+ cout<<endl;
+ cout<<"      nEvts = "<<(fch->GetHistMultInt())->GetEntries()<<", AvM = "<<(fch->GetHistMultInt())->GetMean()<<endl; 
+ cout<<"***************************************"<<endl;
+ cout<<"***************************************"<<endl;
+
+
  
  
  
@@ -756,10 +827,9 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[0]>0)
     {
       v2etaRP[b]=etaRPDiffCumulant2[b]/pow(cumulant[0],0.5);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0.&&etaBinRPNoOfParticles[b]>0.) // to be improved
-      if (etaBinRPNoOfParticles[b]>0.)
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*(dAvM/dAvw2),2.)>0. && etaBinRPNoOfParticles[b]>0.) // to be improved
       {
-       //sdRPDiff2eta[b]=pow((1./(2.*etaBinRPNoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
+       sdRPDiff2eta[b]=pow((1./(2.*etaBinRPNoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
        //cout<<"v'_2/2{2} = "<<v2etaRP[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdDiff2eta[b]<<"%"<<endl;
        //fdfr2->SetBinContent(b+1,v2etaRP[b]);
        //fdfr2->SetBinError(b+1,sdDiff2eta[b]);
@@ -783,10 +853,9 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[1]<0)
     {
       v4etaRP[b]=-etaRPDiffCumulant4[b]/pow(-cumulant[1],0.75);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&etaBinRPNoOfParticles[b]>0.) // to be improved
-      if (etaBinRPNoOfParticles[b]>0.) 
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*(dAvM/dAvw2),2.)>0.&&etaBinRPNoOfParticles[b]>0.) // to be improved
       {
-       //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);
+       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);
        //cout<<"v'_2/2{4} = "<<v4eta[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdDiff4eta[b]<<"%"<<endl;
        //fdfr4->SetBinContent(b+1,v4eta[b]);
        //fdfr4->SetBinError(b+1,sdDiff4eta[b]);
@@ -1045,10 +1114,9 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[0]>0)
     {
       v2pt[b]=ptDiffCumulant2[b]/pow(cumulant[0],0.5);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0.&&ptBinPOINoOfParticles[b]>0.)
-      if (ptBinPOINoOfParticles[b]>0.)
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*(dAvM/dAvw2),2.)>0.&&ptBinPOINoOfParticles[b]>0.)
       {
-       //sdDiff2pt[b]=pow((1./(2.*ptBinPOINoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
+       sdDiff2pt[b]=pow((1./(2.*ptBinPOINoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
        //cout<<"v'_2/2{2} = "<<v2pt[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdDiff2pt[b]<<"%"<<endl;
        fdfr2->SetBinContent(b+1,v2pt[b]);
        fdfr2->SetBinError(b+1,sdDiff2pt[b]);
@@ -1072,10 +1140,9 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[1]<0)
     {
       v4pt[b]=-ptDiffCumulant4[b]/pow(-cumulant[1],.75);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&ptBinPOINoOfParticles[b]>0.)
-      if (ptBinPOINoOfParticles[b]>0.)
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*(dAvM/dAvw2),2.)>0.&&ptBinPOINoOfParticles[b]>0.)
       {
-       //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);
+       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);
        //cout<<"v'_2/2{4} = "<<v4pt[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdDiff4pt[b]<<"%"<<endl;
        fdfr4->SetBinContent(b+1,v4pt[b]);
        fdfr4->SetBinError(b+1,sdDiff4pt[b]);
@@ -1145,18 +1212,18 @@ void AliCumulantsFunctions::Calculate()
    
      
   
- /////////////////////////////////////////////////////////////////////////////
- //////////////////////// INTEGRATED FLOW CALCULATIONS ///////////////////////
- /////////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////
+ //////////////////////// INTEGRATED FLOW CALCULATIONS (POI) ///////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////
  
  Double_t dV2POI=0., dV4POI=0., dV6POI=0., dV8POI=0.;
  Double_t dV2POIError=0., dV4POIError=0., dV6POIError=0., dV8POIError=0.;
- Double_t dSumOfYield=0.;
+ Double_t dSumOfYieldPOI=0.;
  for (Int_t b=1;b<fgknBinsPt+1;b++)
  { 
   if(fch->GetHistPtDiff())
   {  
-   dSumOfYield+=(fch->GetHistPtDiff())->GetBinContent(b);
+   dSumOfYieldPOI+=(fch->GetHistPtDiff())->GetBinContent(b);
    if(fchr2nd->GetHistDiffFlowPtPOI())
    {
     dV2POI+=((fchr2nd->GetHistDiffFlowPtPOI())->GetBinContent(b))*(fch->GetHistPtDiff())->GetBinContent(b);
@@ -1180,16 +1247,16 @@ void AliCumulantsFunctions::Calculate()
   } 
  }
  
- if(dSumOfYield)
+ if(dSumOfYieldPOI)
  {
-  dV2POI/=dSumOfYield;
-  dV2POIError/=(dSumOfYield*dSumOfYield);
-  dV4POI/=dSumOfYield;
-  dV4POIError/=(dSumOfYield*dSumOfYield);
-  dV6POI/=dSumOfYield;
-  dV6POIError/=(dSumOfYield*dSumOfYield);
-  dV8POI/=dSumOfYield;
-  dV8POIError/=(dSumOfYield*dSumOfYield);
+  dV2POI/=dSumOfYieldPOI;
+  dV2POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
+  dV4POI/=dSumOfYieldPOI;
+  dV4POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
+  dV6POI/=dSumOfYieldPOI;
+  dV6POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
+  dV8POI/=dSumOfYieldPOI;
+  dV8POIError/=(dSumOfYieldPOI*dSumOfYieldPOI);
   fchr2nd->FillIntegratedFlowPOI(dV2POI,pow(dV2POIError,0.5)); 
   fchr4th->FillIntegratedFlowPOI(dV4POI,pow(dV4POIError,0.5)); 
   fchr6th->FillIntegratedFlowPOI(dV6POI,pow(dV6POIError,0.5));//to be improved (errors needed) 
@@ -1207,9 +1274,11 @@ void AliCumulantsFunctions::Calculate()
  cout<<"   v_"<<fgkFlow<<"{6} = "<<dV6POI<<" +/- "<<pow(dV6POIError,0.5)<<endl;
  cout<<"   v_"<<fgkFlow<<"{8} = "<<dV8POI<<" +/- "<<pow(dV8POIError,0.5)<<endl;
 
+ cout<<endl;
+ cout<<"      nEvts = "<<(fch->GetHistMultDiff())->GetEntries()<<", AvM = "<<(fch->GetHistMultDiff())->GetMean()<<endl; 
  cout<<"***************************************"<<endl;
  cout<<"***************************************"<<endl;
+ cout<<endl;
  
   //-------------------------------------------------------------------------------------------------------------------------------
   //final results for differential flow (in eta):
@@ -1264,13 +1333,12 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[0]>0)
     {
       v2eta[b]=etaDiffCumulant2[b]/pow(cumulant[0],0.5);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*dAvM,2.)>0.&&etaBinPOINoOfParticles[b]>0.) // to be improved
-      if (etaBinPOINoOfParticles[b]>0.)
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV2*(dAvM/dAvw2),2.)>0.&&etaBinPOINoOfParticles[b]>0.) // to be improved
       {
-       //sdDiff2eta[b]=pow((1./(2.*etaBinPOINoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
+       sdDiff2eta[b]=pow((1./(2.*etaBinPOINoOfParticles[b]))*((1.+pow(chiQ[0],2.))/pow(chiQ[0],2.)),0.5);
        //cout<<"v'_2/2{2} = "<<v2eta[b]<<"%, "<<" "<<"sd{2} = "<<100.*sdDiff2eta[b]<<"%"<<endl;
-       //fdfr2->SetBinContent(b+1,v2eta[b]);
-       //fdfr2->SetBinError(b+1,sdDiff2eta[b]);
+       fdfr2->SetBinContent(b+1,v2eta[b]);
+       fdfr2->SetBinError(b+1,sdDiff2eta[b]);
        //common histogram:
        //fchr2nd->FillDifferentialFlow(b+1,v2eta[b],sdDiff2eta[b]);
        
@@ -1291,13 +1359,12 @@ void AliCumulantsFunctions::Calculate()
     if(cumulant[1]<0)
     {
       v4eta[b]=-etaDiffCumulant4[b]/pow(-cumulant[1],0.75);
-      //if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*dAvM,2.)>0.&&etaBinPOINoOfParticles[b]>0.) // to be improved
-      if (etaBinPOINoOfParticles[b]>0.)
+      if (dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(dV4*(dAvM/dAvw2),2.)>0.&&etaBinPOINoOfParticles[b]>0.) // to be improved
       {
-       //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);
+       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);
        //cout<<"v'_2/2{4} = "<<v4eta[b]<<"%, "<<" "<<"sd{4} = "<<100.*sdDiff4eta[b]<<"%"<<endl;
-       //fdfr4->SetBinContent(b+1,v4eta[b]);
-       //fdfr4->SetBinError(b+1,sdDiff4eta[b]);
+       fdfr4->SetBinContent(b+1,v4eta[b]);
+       fdfr4->SetBinError(b+1,sdDiff4eta[b]);
        //common histogram:
        //fchr4th->FillDifferentialFlow(b+1,v4eta[b],sdDiff4eta[b]);
        
@@ -1557,7 +1624,7 @@ void AliCumulantsFunctions::Calculate()
  ///////avaraging the gen. function for the cumulants over azimuth////////////
  /////////////////////////////////////////////////////////////////////////////
   
- Double_t dAvC6[fgkPmax6]={0.};//<C[p][q]>
+ Double_t dAvC6[fgkPmax6]={0.};//<etBinContent(1)C[p][q]>
  Double_t tempHere6=0.;
  for (Int_t p=0;p<fgkPmax6;p++){
   tempHere6=0.; 
index a311cef..83a59ef 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, 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, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th, AliFlowCommonHist *ch);
+  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);
  
   void Calculate();
 
@@ -83,6 +83,8 @@ class AliCumulantsFunctions{
   TProfile *fAvMult;         //average selected multiplicity for int. flow
   TProfile *fQVector;        //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 *fAverageOfSquaredWeight;    //<w^2>
+  
   AliFlowCommonHistResults *fchr2nd; //final results for 2nd order int. and diff. flow stored in the common histograms
   AliFlowCommonHistResults *fchr4th; //final results for 4th order int. and diff. flow stored in the common histograms
   AliFlowCommonHistResults *fchr6th; //final results for 6th order int. and diff. flow stored in the common histograms
index 238f6dc..bfea616 100644 (file)
@@ -129,7 +129,8 @@ AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants():
  fOtherEquations(kFALSE),
  fUsePhiWeights(kFALSE),
  fUsePtWeights(kFALSE),
- fUseEtaWeights(kFALSE)
+ fUseEtaWeights(kFALSE),
+ fAverageOfSquaredWeight(NULL)
 {
  //constructor 
  fHistList = new TList();
@@ -170,13 +171,13 @@ void AliFlowAnalysisWithCumulants::Init()
  //various output histograms
  
  //average multiplicity 
- fAvMultIntFlowGFC = new TProfile("fAvMultIntFlowGFC","Average Multiplicity",1,0,1,"s");
+ fAvMultIntFlowGFC = new TProfile("fAvMultIntFlowGFC","Average Weighted Multiplicity",1,0,1,"s");
  fAvMultIntFlowGFC->SetXTitle("");
  fAvMultIntFlowGFC->SetYTitle("");
  fAvMultIntFlowGFC->SetLabelSize(0.06);
  fAvMultIntFlowGFC->SetMarkerStyle(25);
  fAvMultIntFlowGFC->SetLabelOffset(0.01);
- (fAvMultIntFlowGFC->GetXaxis())->SetBinLabel(1,"Average Multiplicity");
+ (fAvMultIntFlowGFC->GetXaxis())->SetBinLabel(1,"Average Weighted Multiplicity");
  fHistList->Add(fAvMultIntFlowGFC);
  
  //averages of Q-vector components (1st bin: <Q_x>, 2nd bin: <Q_y>, 3rd bin: <(Q_x)^2>, 4th bin: <(Q_y)^2>)
@@ -499,6 +500,14 @@ void AliFlowAnalysisWithCumulants::Init()
  fCommonHistsResults8th = new AliFlowCommonHistResults("AliFlowCommonHistResults8thOrderGFC");
  fHistList->Add(fCommonHistsResults8th);
  
+ //<w^2>
+ fAverageOfSquaredWeight = new TProfile("fAverageOfSquaredWeight","<w^{2}>",1,0,1);
+ fAverageOfSquaredWeight->SetLabelSize(0.06);
+ fAverageOfSquaredWeight->SetMarkerStyle(25);
+ fAverageOfSquaredWeight->SetLabelOffset(0.01);
+ (fAverageOfSquaredWeight->GetXaxis())->SetBinLabel(1,"<w^{2}>");
+ fHistList->Add(fAverageOfSquaredWeight);
  // add list fWeightsList with weights to the main list
  fHistList->Add(fWeightsList); 
 }//end of Init()
@@ -512,7 +521,8 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
  
  Int_t nEventNSelTracksIntFlow = anEvent->GetEventNSelTracksIntFlow(); //selected multiplicity (particles used for int. flow)
  
-    
+ Int_t n = 2; // int flow harmonic (to be improved)
  //---------------------------------------------------------------------------------------------------------
  // weights:
  Bool_t useWeights = fUsePhiWeights||fUsePtWeights||fUseEtaWeights;
@@ -627,7 +637,9 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
     {
      genfunG[p][q]*=(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nEventNSelTracksIntFlow)*cos(fgkFlow*dPhi-2.*q*TMath::Pi()/fgkQmax));
     }
-   } 
+   }
+   // calculate <w^2> 
+   fAverageOfSquaredWeight->Fill(0.,pow(wPhi*wPt*wEta,2.),1); 
   }
  } // end of for(Int_t i=0;i<nPrim;i++) 
  
@@ -646,15 +658,15 @@ void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
   fAvMultIntFlowGFC->Fill(0.,nSelTracksIntFlow,1);
  }
  
- //calculating Q-vector of event (needed for errors)
+ // calculating Q-vector of event (needed for errors)
  AliFlowVector fQVector;
  fQVector.Set(0.,0.);
  fQVector.SetMult(0);
- fQVector=anEvent->GetQ(); //get the Q vector for this event
- fQVectorComponentsGFC->Fill(0.,fQVector.X(),1);         //in the 1st bin fill Q_x
- fQVectorComponentsGFC->Fill(1.,fQVector.Y(),1);         //in the 2nd bin fill Q_y
- fQVectorComponentsGFC->Fill(2.,pow(fQVector.X(),2.),1); //in the 3rd bin fill (Q_x)^2
- fQVectorComponentsGFC->Fill(3.,pow(fQVector.Y(),2.),1); //in the 4th bin fill (Q_y)^2
+ fQVector=anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights); // get the Q vector for this event
+ fQVectorComponentsGFC->Fill(0.,fQVector.X(),1);         // in the 1st bin fill Q_x
+ fQVectorComponentsGFC->Fill(1.,fQVector.Y(),1);         // in the 2nd bin fill Q_y
+ fQVectorComponentsGFC->Fill(2.,pow(fQVector.X(),2.),1); // in the 3rd bin fill (Q_x)^2
+ fQVectorComponentsGFC->Fill(3.,pow(fQVector.Y(),2.),1); // in the 4th bin fill (Q_y)^2
  
  //3D profiles for differential flow in pt and eta
  //second loop over data: evaluating the generating function D[b][p][q] for differential flow 
@@ -904,7 +916,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,fAvMultIntFlow4GFC, fAvMultIntFlow6GFC,fAvMultIntFlow8GFC,fAvMultIntFlow16GFC,fDiffFlowPtRPGenFunRe,fDiffFlowPtRPGenFunIm,fPtBinRPNoOfParticles, fDiffFlowEtaRPGenFunRe,fDiffFlowEtaRPGenFunIm,fEtaBinRPNoOfParticles,fDiffFlowPtPOIGenFunRe,fDiffFlowPtPOIGenFunIm,fPtBinPOINoOfParticles, fDiffFlowEtaPOIGenFunRe,fDiffFlowEtaPOIGenFunIm,fEtaBinPOINoOfParticles,fIntFlowResultsGFC,fDiffFlowResults2ndOrderGFC,fDiffFlowResults4thOrderGFC,fDiffFlowResults6thOrderGFC,fDiffFlowResults8thOrderGFC, fAvMultIntFlowGFC,fQVectorComponentsGFC,fCommonHistsResults2nd, fCommonHistsResults4th,fCommonHistsResults6th,fCommonHistsResults8th,fCommonHists);
+ AliCumulantsFunctions finalResults(fIntFlowGenFun,fIntFlowGenFun4,fIntFlowGenFun6,fIntFlowGenFun8,fIntFlowGenFun16,fAvMultIntFlow4GFC, fAvMultIntFlow6GFC,fAvMultIntFlow8GFC,fAvMultIntFlow16GFC,fDiffFlowPtRPGenFunRe,fDiffFlowPtRPGenFunIm,fPtBinRPNoOfParticles, fDiffFlowEtaRPGenFunRe,fDiffFlowEtaRPGenFunIm,fEtaBinRPNoOfParticles,fDiffFlowPtPOIGenFunRe,fDiffFlowPtPOIGenFunIm,fPtBinPOINoOfParticles, fDiffFlowEtaPOIGenFunRe,fDiffFlowEtaPOIGenFunIm,fEtaBinPOINoOfParticles,fIntFlowResultsGFC,fDiffFlowResults2ndOrderGFC,fDiffFlowResults4thOrderGFC,fDiffFlowResults6thOrderGFC,fDiffFlowResults8thOrderGFC, fAvMultIntFlowGFC,fQVectorComponentsGFC,fAverageOfSquaredWeight,fCommonHistsResults2nd, fCommonHistsResults4th,fCommonHistsResults6th,fCommonHistsResults8th,fCommonHists);
                            
  finalResults.Calculate();  
 }
index 5319c3c..e585590 100644 (file)
@@ -166,6 +166,9 @@ class AliFlowAnalysisWithCumulants{
   
   void SetUseEtaWeights(Bool_t const uEtaW) {this->fUseEtaWeights = uEtaW;};
   Bool_t GetUseEtaWeights() const {return this->fUseEtaWeights;};
+  
+  void SetAverageOfSquaredWeight(TProfile* const aosw) {this->fAverageOfSquaredWeight = aosw;};
+  TProfile* GetSumOfSquaredWeight() const {return this->fAverageOfSquaredWeight;}; 
 //----------------------------------------------------------------------------------------------------------------
  
  private:
@@ -260,8 +263,10 @@ class AliFlowAnalysisWithCumulants{
   
   Bool_t fUsePhiWeights;  //phi weights
   Bool_t fUsePtWeights;   //v_2(pt) weights
-  Bool_t  fUseEtaWeights; //v_2(eta) weights
-      
+  Bool_t fUseEtaWeights;  //v_2(eta) weights
+  
+  TProfile* fAverageOfSquaredWeight; //<w^2>      
+  
   ClassDef(AliFlowAnalysisWithCumulants, 0);
 };
 
index 05f9cb8..c08de8e 100644 (file)
@@ -399,6 +399,9 @@ void AliAnalysisTaskCumulants::Terminate(Option_t *)
   
   //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"));
+  
+  //<w^2> 
+  TProfile *averageOfSquaredWeight = dynamic_cast<TProfile*>(fListHistos->FindObject("fAverageOfSquaredWeight"));
       
   /*
   TProfile2D *diffFlowPtGenFunRe0 = dynamic_cast<TProfile2D*>(fListHistos->FindObject("fdiffFlowPtGenFunRe0"));
@@ -485,6 +488,8 @@ void AliAnalysisTaskCumulants::Terminate(Option_t *)
   
   fGFC->SetQVectorComponents(qVectorComponents);
   
+  fGFC->SetAverageOfSquaredWeight(averageOfSquaredWeight);
+  
   fGFC->Finish();
   
   //----------------------------------------------------