using weights for Q cumulants 2nd order
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Feb 2009 14:49:26 +0000 (14:49 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Feb 2009 14:49:26 +0000 (14:49 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.h
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowVector.cxx
PWG2/FLOW/AliFlowCommon/AliFlowVector.h
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskQCumulants.cxx
PWG2/FLOW/macros/makeWeights.C

index 426aa24..8d3586c 100644 (file)
@@ -68,6 +68,7 @@ ClassImp(AliFlowAnalysisWithQCumulants)
 AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():  
  fTrack(NULL),
  fHistList(NULL),
+ fDiffFlowList(NULL),
  fWeightsList(NULL),
  fAvMultIntFlowQC(NULL),
  fQvectorComponents(NULL),
@@ -152,8 +153,11 @@ AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
  fUseEtaWeights(kFALSE)
 {
  //constructor 
- fHistList = new TList(); 
+ fHistList = new TList();
+ fDiffFlowList = new TList(); 
+ fDiffFlowList->SetName("DifferentialFlow"); 
  fWeightsList = new TList();
+ fWeightsList->SetName("Weights");
   
  fnBinsPt = AliFlowCommonConstants::GetNbinsPt();
  fPtMin   = AliFlowCommonConstants::GetPtMin();             
@@ -168,7 +172,8 @@ AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
 {
  //destructor
  delete fHistList; 
- delete fWeightsList;
+ delete fDiffFlowList;
+ delete fWeightsList; 
 }
 
 //================================================================================================================
@@ -312,290 +317,241 @@ void AliFlowAnalysisWithQCumulants::Init()
  fPtReq1nRP = new TProfile("fPtReq1nRP","Re[q_n]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtReq1nRP->SetXTitle("p_{t} [GeV]");
  fPtReq1nRP->SetYTitle("Re[q_n]");
- //fHistList->Add(fPtReq1nRP);
  
  //fPtImq1nRP
  fPtImq1nRP = new TProfile("fPtImq1nRP","Im[q_n]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtImq1nRP->SetXTitle("p_{t} [GeV]");
  fPtImq1nRP->SetYTitle("Im[q_n]");
- //fHistList->Add(fPtImq1nRP);
  
  //fPtReq2nRP
  fPtReq2nRP = new TProfile("fPtReq2nRP","Re[q_2n]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtReq2nRP->SetXTitle("p_{t} [GeV]");
  fPtReq2nRP->SetYTitle("Im[D]");
- //fHistList->Add(fPtReq2nRP);
 
  //fPtImq2nRP
  fPtImq2nRP = new TProfile("fPtImq2nRP","Im[q_2n]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtImq2nRP->SetXTitle("p_{t} [GeV]");
  fPtImq2nRP->SetYTitle("Im[q_2n]");
- //fHistList->Add(fPtImq2nRP);
  
  //f2PerPtBin1n1nRP
  f2PerPtBin1n1nRP = new TProfile("f2PerPtBin1n1nRP","<2'>_{n|n}",fnBinsPt,fPtMin,fPtMax,"s");
  f2PerPtBin1n1nRP->SetXTitle("p_{t} [GeV]");
- //f2PerPtBin1n1n->SetYTitle("<2'>_{n|n}");
- fHistList->Add(f2PerPtBin1n1nRP);
+ fDiffFlowList->Add(f2PerPtBin1n1nRP);
  
  //f2PerPtBin2n2nRP
  f2PerPtBin2n2nRP = new TProfile("f2PerPtBin2n2nRP","<2'>_{2n|2n}",fnBinsPt,fPtMin,fPtMax,"s");
  f2PerPtBin2n2nRP->SetXTitle("p_{t} [GeV]");
- //f2PerPtBin2n2nRP->SetYTitle("<2'>_{2n|2n}");}//line needed only for nested loops - end of if(nPrim>8&&nPrim<12) 
- fHistList->Add(f2PerPtBin2n2nRP);
+ fDiffFlowList->Add(f2PerPtBin2n2nRP);
  
  //f3PerPtBin2n1n1nRP
  f3PerPtBin2n1n1nRP = new TProfile("f3PerPtBin2n1n1nRP","<3'>_{2n|n,n}",fnBinsPt,fPtMin,fPtMax,"s");
  f3PerPtBin2n1n1nRP->SetXTitle("p_{t} [GeV]");
- //f3PerPtBin2n1n1nRP->SetYTitle("<3'>_{2n|n,n}");
- fHistList->Add(f3PerPtBin2n1n1nRP);
+ fDiffFlowList->Add(f3PerPtBin2n1n1nRP);
  
  //f3PerPtBin1n1n2nRP
  f3PerPtBin1n1n2nRP = new TProfile("f3PerPtBin1n1n2nRP","<3'>_{n,n|2n}",fnBinsPt,fPtMin,fPtMax,"s");
  f3PerPtBin1n1n2nRP->SetXTitle("p_{t} [GeV]");
- //f3PerPtBin1n1n2nRP->SetYTitle("<3'>_{n,n|2n}");
- fHistList->Add(f3PerPtBin1n1n2nRP);
+ fDiffFlowList->Add(f3PerPtBin1n1n2nRP);
  
  //f4PerPtBin1n1n1n1nRP
  f4PerPtBin1n1n1n1nRP = new TProfile("f4PerPtBin1n1n1n1nRP","<4'>_{n,n|n,n}",fnBinsPt,fPtMin,fPtMax,"s");
  f4PerPtBin1n1n1n1nRP->SetXTitle("p_{t} [GeV]");
- //f4PerPtBin1n1n1n1nRP->SetYTitle("<4'>_{n,n|n,n}");
- fHistList->Add(f4PerPtBin1n1n1n1nRP);
+ fDiffFlowList->Add(f4PerPtBin1n1n1n1nRP);
  
  //fEtaReq1nRP
  fEtaReq1nRP = new TProfile("fEtaReq1nRP","Re[q_n]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaReq1nRP->SetXTitle("#eta");
  fEtaReq1nRP->SetYTitle("Re[q_n]");
- fHistList->Add(fEtaReq1nRP);
  
  //fEtaImq1nRP
  fEtaImq1nRP = new TProfile("fEtaImq1nRP","Im[q_n]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaImq1nRP->SetXTitle("#eta");
  fEtaImq1nRP->SetYTitle("Im[q_n]");
- //fHistList->Add(fEtaImq1nRP);
  
  //fEtaReq2nRP
  fEtaReq2nRP = new TProfile("fEtaReq2nRP","Re[q_2n]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaReq2nRP->SetXTitle("#eta");
  fEtaReq2nRP->SetYTitle("Im[D]");
- //fHistList->Add(fEtaReq2nRP);
  
  //fEtaImq2nRP
  fEtaImq2nRP = new TProfile("fEtaImq2nRP","Im[q_2n]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaImq2nRP->SetXTitle("#eta");
  fEtaImq2nRP->SetYTitle("Im[q_2n]");
- //fHistList->Add(fEtaImq2nRP);
  
  //f2PerEtaBin1n1nRP
  f2PerEtaBin1n1nRP = new TProfile("f2PerEtaBin1n1nRP","<2'>_{n|n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f2PerEtaBin1n1nRP->SetXTitle("#eta");
-
- //f2PerEtaBin1n1nRP->SetYTitle("<2'>_{n|n}");
- fHistList->Add(f2PerEtaBin1n1nRP);
+ fDiffFlowList->Add(f2PerEtaBin1n1nRP);
  
  //f2PerEtaBin2n2nRP
  f2PerEtaBin2n2nRP = new TProfile("f2PerEtaBin2n2nRP","<2'>_{2n|2n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f2PerEtaBin2n2nRP->SetXTitle("#eta");
- //f2PerEtaBin2n2nRP->SetYTitle("<2'>_{2n|2n}");
- fHistList->Add(f2PerEtaBin2n2nRP);
+ fDiffFlowList->Add(f2PerEtaBin2n2nRP);
  
  //f3PerEtaBin2n1n1nRP
  f3PerEtaBin2n1n1nRP = new TProfile("f3PerEtaBin2n1n1nRP","<3'>_{2n|n,n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f3PerEtaBin2n1n1nRP->SetXTitle("#eta");
- //f3PerEtaBin2n1n1nRP->SetYTitle("<3'>_{2n|n,n}");
- fHistList->Add(f3PerEtaBin2n1n1nRP);
+ fDiffFlowList->Add(f3PerEtaBin2n1n1nRP);
  
  //f3PerEtaBin1n1n2nRP
  f3PerEtaBin1n1n2nRP = new TProfile("f3PerEtaBin1n1n2RP","<3'>_{n,n|2n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f3PerEtaBin1n1n2nRP->SetXTitle("#eta");
- //f3PerEtaBin1n1n2n->SetYTitle("<3'>_{n,n|2n}");
- fHistList->Add(f3PerEtaBin1n1n2nRP);
+ fDiffFlowList->Add(f3PerEtaBin1n1n2nRP);
  
  //f4PerEtaBin1n1n1n1nRP
  f4PerEtaBin1n1n1n1nRP = new TProfile("f4PerEtaBin1n1n1n1nRP","<4'>_{n,n|n,n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f4PerEtaBin1n1n1n1nRP->SetXTitle("#eta");
- //f4PerEtaBin1n1n1n1nRP->SetYTitle("<4'>_{n,n|n,n}");
- fHistList->Add(f4PerEtaBin1n1n1n1nRP);
+ fDiffFlowList->Add(f4PerEtaBin1n1n1n1nRP);
  
  //fPtReq1nPrimePOI
  fPtReq1nPrimePOI = new TProfile("fPtReq1nPrimePOI","Re[q_{n}^{'}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtReq1nPrimePOI->SetXTitle("p_{t} [GeV]");
  fPtReq1nPrimePOI->SetYTitle("Re[q_{n}^{'}]");
- //fHistList->Add(fPtReq1nPrimePOI);
  
  //fPtImq1nPrimePOI
  fPtImq1nPrimePOI = new TProfile("fPtImq1nPrimePOI","Im[q_{n}^{'}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtImq1nPrimePOI->SetXTitle("p_{t} [GeV]");
  fPtImq1nPrimePOI->SetYTitle("Im[q_{n}^{'}]");
- //fHistList->Add(fPtImq1nPrimePOI);
  
  //fPtReq2nPrimePOI
  fPtReq2nPrimePOI = new TProfile("fPtReq2nPrimePOI","Re[q_{2n}^{'}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtReq2nPrimePOI->SetXTitle("p_{t} [GeV]");
  fPtReq2nPrimePOI->SetYTitle("Re[q_{2n}^{'}]");
- //fHistList->Add(fPtReq2nPrimePOI);
  
  //fPtImq2nPrimePOI
  fPtImq2nPrimePOI = new TProfile("fPtImq2nPrimePOI","Im[q_{2n}^{'}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtImq2nPrimePOI->SetXTitle("p_{t} [GeV]");
  fPtImq2nPrimePOI->SetYTitle("Im[q_{2n}^{'}]");
- //fHistList->Add(fPtImq2nPrimePOI);
  
  //fmPrimePerPtBin
  fmPrimePerPtBin = new TProfile("fmPrimePerPtBin","# of particles selected both as RP and POI per #p_{t} bin",fnBinsPt,fPtMin,fPtMax,"s");
  fmPrimePerPtBin->SetXTitle("p_{t} [GeV]");
  fmPrimePerPtBin->SetYTitle("Counts");
- //fHistList->Add(fOverlapPerPtBin);
  
  //fPtReq1nPrimePrimePOI
  fPtReq1nPrimePrimePOI = new TProfile("fPtReq1nPrimePrimePOI","Re[q_{n}^{''}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtReq1nPrimePrimePOI->SetXTitle("p_{t} [GeV]");
  fPtReq1nPrimePrimePOI->SetYTitle("Re[q_{n}^{''}]");
- //fHistList->Add(fPtReq1nPrimePrimePOI);
  
  //fPtImq1nPrimePrimePOI
  fPtImq1nPrimePrimePOI = new TProfile("fPtImq1nPrimePrimePOI","Im[q_{n}^{''}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtImq1nPrimePrimePOI->SetXTitle("p_{t} [GeV]");
  fPtImq1nPrimePrimePOI->SetYTitle("Im[q_{n}^{''}]");
- //fHistList->Add(fPtImq1nPrimePrimePOI);
  
  //fPtReq2nPrimePrimePOI
  fPtReq2nPrimePrimePOI = new TProfile("fPtReq2nPrimePrimePOI","Re[q_{2n}^{''}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtReq2nPrimePrimePOI->SetXTitle("p_{t} [GeV]");
  fPtReq2nPrimePrimePOI->SetYTitle("Re[q_{2n}^{''}]");
- //fHistList->Add(fPtReq2nPrimePrimePOI);
  
  //fPtImq2nPrimePrimePOI
  fPtImq2nPrimePrimePOI = new TProfile("fPtImq2nPrimePrimePOI","Im[q_{2n}^{''}]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtImq2nPrimePrimePOI->SetXTitle("p_{t} [GeV]");
  fPtImq2nPrimePrimePOI->SetYTitle("Im[q_{2n}^{''}]");
- //fHistList->Add(fPtImq2nPrimePrimePOI);
  
  //fmPrimePrimePerPtBin
  fmPrimePrimePerPtBin = new TProfile("fmPrimePrimePerPtBin","# of particles selected as POI and NOT as RP per #p_{t} bin",fnBinsPt,fPtMin,fPtMax,"s");
  fmPrimePrimePerPtBin->SetXTitle("p_{t} [GeV]");
  fmPrimePrimePerPtBin->SetYTitle("Counts");
- //fHistList->Add(fmPrimePrimePerPtBin);
  
  //fEtaReq1nPrimePOI
  fEtaReq1nPrimePOI = new TProfile("fEtaReq1nPrimePOI","Re[q_{n}^{'}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaReq1nPrimePOI->SetXTitle("#eta");
  fEtaReq1nPrimePOI->SetYTitle("Re[q_{n}^{'}]");
- //fHistList->Add(fEtaReq1nPrimePOI);
  
  //fEtaImq1nPrimePOI
  fEtaImq1nPrimePOI = new TProfile("fEtaImq1nPrimePOI","Im[q_{n}^{'}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaImq1nPrimePOI->SetXTitle("#eta");
  fEtaImq1nPrimePOI->SetYTitle("Im[q_{n}^{'}]");
- //fHistList->Add(fEtaImq1nPrimePOI);
  
  //fEtaReq2nPrimePOI
  fEtaReq2nPrimePOI = new TProfile("fEtaReq2nPrimePOI","Re[q_{2n}^{'}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaReq2nPrimePOI->SetXTitle("#eta");
  fEtaReq2nPrimePOI->SetYTitle("Re[q_{2n}^{'}]");
- //fHistList->Add(fEtaReq2nPrimePOI);
  
  //fEtaImq2nPrimePOI
  fEtaImq2nPrimePOI = new TProfile("fEtaImq2nPrimePOI","Im[q_{2n}^{'}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaImq2nPrimePOI->SetXTitle("#eta");
  fEtaImq2nPrimePOI->SetYTitle("Im[q_{2n}^{'}]");
- //fHistList->Add(fEtaImq2nPrimePOI);
  
  //fmPrimePerEtaBin
  fmPrimePerEtaBin = new TProfile("fmPrimePerEtaBin","# of particles selected both as RP and POI per #p_{t} bin",fnBinsEta,fEtaMin,fEtaMax,"s");
  fmPrimePerEtaBin->SetXTitle("#eta");
  fmPrimePerEtaBin->SetYTitle("Counts");
- //fHistList->Add(fOverlapPerEtaBin);
  
- //fEtaReq1nPrimePrimePOIafvQvector1n=anEvent->GetQ(1*n
+ //fEtaReq1nPrimePrimePOI
  fEtaReq1nPrimePrimePOI = new TProfile("fEtaReq1nPrimePrimePOI","Re[q_{n}^{''}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaReq1nPrimePrimePOI->SetXTitle("#eta");
  fEtaReq1nPrimePrimePOI->SetYTitle("Re[q_{n}^{''}]");
- //fHistList->Add(fEtaReq1nPrimePrimePOI);
  
  //fEtaImq1nPrimePrimePOI
  fEtaImq1nPrimePrimePOI = new TProfile("fEtaImq1nPrimePrimePOI","Im[q_{n}^{''}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaImq1nPrimePrimePOI->SetXTitle("#eta");
  fEtaImq1nPrimePrimePOI->SetYTitle("Im[q_{n}^{''}]");
- //fHistList->Add(fEtaImq1nPrimePrimePOI);
  
  //fEtaReq2nPrimePrimePOI
  fEtaReq2nPrimePrimePOI = new TProfile("fEtaReq2nPrimePrimePOI","Re[q_{2n}^{''}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaReq2nPrimePrimePOI->SetXTitle("#eta");
  fEtaReq2nPrimePrimePOI->SetYTitle("Re[q_{2n}^{''}]");
- //fHistList->Add(fEtaReq2nPrimePrimePOI);
  
  //fEtaImq2nPrimePrimePOI
  fEtaImq2nPrimePrimePOI = new TProfile("fEtaImq2nPrimePrimePOI","Im[q_{2n}^{''}]",fnBinsEta,fEtaMin,fEtaMax,"s");
  fEtaImq2nPrimePrimePOI->SetXTitle("#eta");
  fEtaImq2nPrimePrimePOI->SetYTitle("Im[q_{2n}^{''}]");
- //fHistList->Add(fEtaImq2nPrimePrimePOI);
  
  //fmPrimePrimePerEtaBin
  fmPrimePrimePerEtaBin = new TProfile("fmPrimePrimePerEtaBin","# of particles selected as POI and NOT as RP per #p_{t} bin",fnBinsEta,fEtaMin,fEtaMax,"s");
  fmPrimePrimePerEtaBin->SetXTitle("#eta");
  fmPrimePrimePerEtaBin->SetYTitle("Counts");
- //fHistList->Add(fmPrimePrimePerEtaBin);
 
  //f2PerPtBin1n1nPOI
  f2PerPtBin1n1nPOI = new TProfile("f2PerPtBin1n1nPOI","<2'>_{n|n}",fnBinsPt,fPtMin,fPtMax,"s");
  f2PerPtBin1n1nPOI->SetXTitle("#eta");
- //f2PerPtBin1n1n->SetYTitle("<2'>_{n|n}");
- fHistList->Add(f2PerPtBin1n1nPOI);
+ fDiffFlowList->Add(f2PerPtBin1n1nPOI);
  
  //f2PerPtBin2n2nPOI
  f2PerPtBin2n2nPOI = new TProfile("f2PerPtBin2n2nPOI","<2'>_{2n|2n}",fnBinsPt,fPtMin,fPtMax,"s");
  f2PerPtBin2n2nPOI->SetXTitle("p_{t} [GeV]");
- //f2PerPtBin2n2nPOI->SetYTitle("<2'>_{2n|2n}");
- fHistList->Add(f2PerPtBin2n2nPOI);
+ fDiffFlowList->Add(f2PerPtBin2n2nPOI);
  
  //f3PerPtBin2n1n1nPOI
  f3PerPtBin2n1n1nPOI = new TProfile("f3PerPtBin2n1n1nPOI","<3'>_{2n|n,n}",fnBinsPt,fPtMin,fPtMax,"s");
  f3PerPtBin2n1n1nPOI->SetXTitle("p_{t} [GeV]");
- //f3PerPtBin2n1n1nPOI->SetYTitle("<3'>_{2n|n,n}");
- fHistList->Add(f3PerPtBin2n1n1nPOI);
+ fDiffFlowList->Add(f3PerPtBin2n1n1nPOI);
  
  //f3PerPtBin1n1n2nPOI
  f3PerPtBin1n1n2nPOI = new TProfile("f3PerPtBin1n1n2nPOI","<3'>_{n,n|2n}",fnBinsPt,fPtMin,fPtMax,"s");
  f3PerPtBin1n1n2nPOI->SetXTitle("p_{t} [GeV]");
- //f3PerPtBin1n1n2nPOI->SetYTitle("<3'>_{n,n|2n}");
- fHistList->Add(f3PerPtBin1n1n2nPOI);
+ fDiffFlowList->Add(f3PerPtBin1n1n2nPOI);
  
  //f4PerPtBin1n1n1n1nPOI
  f4PerPtBin1n1n1n1nPOI = new TProfile("f4PerPtBin1n1n1n1nPOI","<4'>_{n,n|n,n}",fnBinsPt,fPtMin,fPtMax,"s");
  f4PerPtBin1n1n1n1nPOI->SetXTitle("p_{t} [GeV]");
- //f4PerPtBin1n1n1n1nPOI->SetYTitle("<4'>_{n,n|n,n}");
- fHistList->Add(f4PerPtBin1n1n1n1nPOI);
+ fDiffFlowList->Add(f4PerPtBin1n1n1n1nPOI);
  
  //f2PerEtaBin1n1nPOI
  f2PerEtaBin1n1nPOI = new TProfile("f2PerEtaBin1n1nPOI","<2'>_{n|n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f2PerEtaBin1n1nPOI->SetXTitle("#eta");
- //f2PerEtaBin1n1nPOI->SetYTitle("<2'>_{n|n}");
- fHistList->Add(f2PerEtaBin1n1nPOI);
+ fDiffFlowList->Add(f2PerEtaBin1n1nPOI);
  
  //f2PerEtaBin2n2nPOI
  f2PerEtaBin2n2nPOI = new TProfile("f2PerEtaBin2n2nPOI","<2'>_{2n|2n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f2PerEtaBin2n2nPOI->SetXTitle("#eta");
- //f2PerEtaBin2n2nPOI->SetYTitle("<2'>_{2n|2n}");
- fHistList->Add(f2PerEtaBin2n2nPOI);
+ fDiffFlowList->Add(f2PerEtaBin2n2nPOI);
  
  //f3PerEtaBin2n1n1nPOI
  f3PerEtaBin2n1n1nPOI = new TProfile("f3PerEtaBin2n1n1nPOI","<3'>_{2n|n,n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f3PerEtaBin2n1n1nPOI->SetXTitle("#eta");
- //f3PerEtaBin2n1n1nPOI->SetYTitle("<3'>_{2n|n,n}");
- fHistList->Add(f3PerEtaBin2n1n1nPOI);
+ fDiffFlowList->Add(f3PerEtaBin2n1n1nPOI);
  
  //f3PerEtaBin1n1n2nPOI
  f3PerEtaBin1n1n2nPOI = new TProfile("f3PerEtaBin1n1n2POI","<3'>_{n,n|2n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f3PerEtaBin1n1n2nPOI->SetXTitle("#eta");
- //f3PerEtaBin1n1n2n->SetYTitle("<3'>_{n,n|2n}");
- fHistList->Add(f3PerEtaBin1n1n2nPOI);
+ fDiffFlowList->Add(f3PerEtaBin1n1n2nPOI);
  
  //f4PerEtaBin1n1n1n1nPOI
  f4PerEtaBin1n1n1n1nPOI = new TProfile("f4PerEtaBin1n1n1n1nPOI","<4'>_{n,n|n,n}",fnBinsEta,fEtaMin,fEtaMax,"s");
  f4PerEtaBin1n1n1n1nPOI->SetXTitle("#eta");
- //f4PerEtaBin1n1n1n1nPOI->SetYTitle("<4'>_{n,n|n,n}");
- fHistList->Add(f4PerEtaBin1n1n1n1nPOI);
+ fDiffFlowList->Add(f4PerEtaBin1n1n1n1nPOI);
  
  //common control histogram (2nd order)
  fCommonHists2nd = new AliFlowCommonHist("AliFlowCommonHist2ndOrderQC");
@@ -652,16 +608,30 @@ void AliFlowAnalysisWithQCumulants::Init()
  f8pDistribution->SetXTitle("<8>_{n,n,n,n|n,n,n,n}");
  f8pDistribution->SetYTitle("Counts");
  fHistList->Add(f8pDistribution);
+ // add list fWeightsList with weights to the main list
+ fHistList->Add(fWeightsList);
+  
+ // add list fDiffFlowList with histograms and profiles needed for differential flow to the main list 
+ fHistList->Add(fDiffFlowList); 
 }//end of Init()
 
 //================================================================================================================
 
 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
 {
- //running over data 
+ // running over data 
+ Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI + rest  
+ Int_t nRP = anEvent->GetEventNSelTracksIntFlow(); // nRP = number of particles used to determine the reaction plane
  
- //get the total multiplicity nPrim of event:
- Int_t nPrim = anEvent->NumberOfTracks();//nPrim = RPs + POIs + rest  
+ Int_t n = 2; // int flow harmonic (to be improved)
+ Double_t dPhi = 0.;
+ Double_t dPt  = 0.;
+ Double_t dEta = 0.;
+ Int_t nBinsPhi = 0;
 
  //needed for debugging: (to be improved - add explanation here) 
  //Bool_t bNestedLoops=kTRUE;
@@ -669,28 +639,109 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  //{
  //if(nPrim>0&&nPrim<12)
  //{
- Int_t n=2;//int flow harmonic (to be improved)
  
+  
+    
  //---------------------------------------------------------------------------------------------------------
- //Q-vectors of an event evaluated in harmonics n, 2n, 3n and 4n from RP particles:
- AliFlowVector afvQvector1n, afvQvector2n, afvQvector3n, afvQvector4n;
+ // weights:
+ Bool_t useWeights = fUsePhiWeights||fUsePtWeights||fUseEtaWeights;
+ TH1F *phiWeights = NULL; // histogram with phi weights
+ TH1D *ptWeights  = NULL; // histogram with pt weights
+ TH1D *etaWeights = NULL; // histogram with eta weights
+
+ // to be improved: will in general weights be different for Q-vectors evaluated in different harmonics ???
+ Double_t wPhi = 1.; // phi weight
+ Double_t wPt  = 1.; // pt weight
+ Double_t wEta = 1.; // eta weight
+ Double_t dSumOfWeights         = 0.;  
+ Double_t dSumOfWeightsToPower2 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 2)
+ Double_t dSumOfWeightsToPower3 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 3)
+ Double_t dSumOfWeightsToPower4 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 4)
+ Double_t dSumOfWeightsToPower5 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 5)
+ Double_t dSumOfWeightsToPower6 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 6)
+ Double_t dSumOfWeightsToPower7 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 7)
+ Double_t dSumOfWeightsToPower8 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 8) 
+   
+ if(useWeights)
+ {
+  if(!fWeightsList)
+  {
+   cout<<" WARNING: fWeightsList is NULL pointer. "<<endl;
+   exit(0);
+  }
+  if(fUsePhiWeights) 
+  {
+   phiWeights = dynamic_cast<TH1F *>(fWeightsList->FindObject("phi_weights"));
+   if(!phiWeights)
+   {
+    cout<<" WARNING: couldn't access the histogram with phi weights. "<<endl;
+    exit(0);
+   } 
+  } 
+  if(fUsePtWeights) 
+  { 
+   ptWeights = dynamic_cast<TH1D *>(fWeightsList->FindObject("pt_weights"));
+   if(!ptWeights) 
+   {
+    cout<<" WARNING: couldn't access the histogram with pt weights. "<<endl;
+    exit(0);
+   } 
+  } 
+  if(fUseEtaWeights) 
+  {
+   etaWeights = dynamic_cast<TH1D *>(fWeightsList->FindObject("eta_weights"));
+   if(!etaWeights) 
+   {
+    cout<<" WARNING: couldn't access the histogram with eta weights. "<<endl;
+    exit(0);
+   }
+  } 
+ } 
+ //---------------------------------------------------------------------------------------------------------
+
+  
+   
+     
  
+ //---------------------------------------------------------------------------------------------------------
+ // non-weighted and weighted Q-vectors of an event built-up from RP particles evaluated in harmonics n, 2n, 3n and 4n:
+ AliFlowVector afvQvector1n, afvQvector2n, afvQvector3n, afvQvector4n;
+ AliFlowVector afvQvector1nWeighted;
+
+ // non-weighted Q-vector in harmonic n: 
  afvQvector1n.Set(0.,0.);
  afvQvector1n.SetMult(0);
- afvQvector1n=anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
+ afvQvector1n = anEvent->GetQ(1*n); 
+
+ // weighted Q-vector in harmonic n:   
+ afvQvector1nWeighted = anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
+ dSumOfWeights = afvQvector1nWeighted.GetMult(); // to be improved (the name of this method)
+ dSumOfWeightsToPower2 = afvQvector1nWeighted.GetSumOfWeightsToPower2();
+ dSumOfWeightsToPower3 = afvQvector1nWeighted.GetSumOfWeightsToPower3();
+ dSumOfWeightsToPower4 = afvQvector1nWeighted.GetSumOfWeightsToPower4();
+ dSumOfWeightsToPower5 = afvQvector1nWeighted.GetSumOfWeightsToPower5();
+ dSumOfWeightsToPower6 = afvQvector1nWeighted.GetSumOfWeightsToPower6();
+ dSumOfWeightsToPower7 = afvQvector1nWeighted.GetSumOfWeightsToPower7();
+ dSumOfWeightsToPower8 = afvQvector1nWeighted.GetSumOfWeightsToPower8();
+ // non-weighted Q-vector in harmonic 2n: 
  afvQvector2n.Set(0.,0.);
  afvQvector2n.SetMult(0);
- afvQvector2n=anEvent->GetQ(2*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
-                                            
+ afvQvector2n = anEvent->GetQ(2*n); // to be improved: weights   
+                      
+ // non-weighted Q-vector in harmonic 3n:                                                                 
  afvQvector3n.Set(0.,0.);
  afvQvector3n.SetMult(0);
- afvQvector3n=anEvent->GetQ(3*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights); 
+ afvQvector3n = anEvent->GetQ(3*n); // to be improved: weights
  
+ // non-weighted Q-vector in harmonic 4n:
  afvQvector4n.Set(0.,0.);
  afvQvector4n.SetMult(0);
- afvQvector4n=anEvent->GetQ(4*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
-
+ afvQvector4n = anEvent->GetQ(4*n); // to be improved: weights
             
             
  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -704,9 +755,9 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  //---------------------------------------------------------------------------------------------------------
  
  //multiplicity of RP particles:
- Double_t dMult = afvQvector1n.GetMult();
+ Double_t dMult = afvQvector1n.GetMult(); // to be improved (name, this is actually weighted multiplicity)
  
- fAvMultIntFlowQC->Fill(0.,dMult,1.);//to be removed (this info is also stored in one of control histograms)
+ fAvMultIntFlowQC->Fill(0.,dMult,1.); // to be removed (this info is also stored in one of control histograms)
  
  //---------------------------------------------------------------------------------------------------------
  //
@@ -801,25 +852,30 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  // 5th bin: <4>*<8>
  // 6th bin: <6>*<8>
          
- //2-particle
- Double_t two1n1n=0., two2n2n=0., two3n3n=0., two4n4n=0.; 
- if(dMult>1)
+ // 2-particle
+ Double_t two1n1n = 0., two2n2n = 0., two3n3n = 0., two4n4n = 0.; 
+ if(nRP>1)
  {
-  //fill the common control histogram (2nd order):
-  
+  //fill the common control histogram (2nd order): 
   fCommonHists2nd->FillControlHistograms(anEvent); 
+  
+  if(pow(dSumOfWeights,2.)-dSumOfWeightsToPower2 != 0)
+  {
+   two1n1n = (pow(afvQvector1nWeighted.Mod(),2.)-dSumOfWeightsToPower2)/(pow(dSumOfWeights,2.)-dSumOfWeightsToPower2); // <2>_{n|n} = <cos(n*(phi1-phi2))>
+  }
  
-  two1n1n = (pow(afvQvector1n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); //<2>_{n|n}   = <cos(n*(phi1-phi2))>
-  two2n2n = (pow(afvQvector2n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); //<2>_{2n|2n} = <cos(2n*(phi1-phi2))>
-  two3n3n = (pow(afvQvector3n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); //<2>_{3n|3n} = <cos(3n*(phi1-phi2))>
-  two4n4n = (pow(afvQvector4n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); //<2>_{4n|4n} = <cos(4n*(phi1-phi2))>
+  // to be improved: Eqs. with weights needed for two2n2n, two3n3n and two4n4n 
+  two2n2n = (pow(afvQvector2n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); // <2>_{2n|2n} = <cos(2n*(phi1-phi2))>
+  two3n3n = (pow(afvQvector3n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); // <2>_{3n|3n} = <cos(3n*(phi1-phi2))>
+  two4n4n = (pow(afvQvector4n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); // <2>_{4n|4n} = <cos(4n*(phi1-phi2))>
     
-  fQCorrelations->Fill(0.,two1n1n,dMult*(dMult-1.)); 
-  fQCorrelations->Fill(1.,two2n2n,dMult*(dMult-1.)); 
-  fQCorrelations->Fill(2.,two3n3n,dMult*(dMult-1.)); 
-  fQCorrelations->Fill(3.,two4n4n,dMult*(dMult-1.)); 
+  fQCorrelations->Fill(0.,two1n1n,pow(dSumOfWeights,2.)-dSumOfWeightsToPower2); // OK    
+  fQCorrelations->Fill(1.,two2n2n,dMult*(dMult-1.)); // to be improved
+  fQCorrelations->Fill(2.,two3n3n,dMult*(dMult-1.)); // to be improved
+  fQCorrelations->Fill(3.,two4n4n,dMult*(dMult-1.)); // to be improved
   
-  f2pDistribution->Fill(two1n1n,dMult*(dMult-1.)); 
+  f2pDistribution->Fill(two1n1n,pow(dSumOfWeights,2.)-dSumOfWeightsToPower2); // OK
  }
  
  //3-particle
@@ -892,6 +948,11 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
   fQCorrelations->Fill(21.,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
  }
 
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ //      !!!! to be removed: temporary fix !!!!
+   two1n1n = (pow(afvQvector1n.Mod(),2.)-dMult)/(dMult*(dMult-1.));
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+    
  //6-particle
  Double_t six1n1n1n1n1n1n=0., six2n2n1n1n1n1n=0., six3n1n1n1n1n1n=0., six2n1n1n2n1n1n=0.;
  if(dMult>5)
@@ -950,6 +1011,8 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  
  Double_t dQ1nx = afvQvector1n.X();
  Double_t dQ1ny = afvQvector1n.Y();
+ Double_t dQ1nxW = afvQvector1nWeighted.X();
+ Double_t dQ1nyW = afvQvector1nWeighted.Y();
  Double_t dQ2nx = afvQvector2n.X();
  Double_t dQ2ny = afvQvector2n.Y();
  
@@ -966,24 +1029,62 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  //RP:
  Double_t qxPtRP=0.,qyPtRP=0.,q2xPtRP=0.,q2yPtRP=0.,mPtRP=0.;//add comments for these variables (deleteMe)
  Double_t qxEtaRP=0.,qyEtaRP=0.,q2xEtaRP=0.,q2yEtaRP=0.,mEtaRP=0.;//add comments for these variables (deleteMe)
+ Double_t dSumOfWeightsUpTomPtRP  = 0.; // sum_{i=1}^{m} w_{i}
+ Double_t dSumOfWeightsUpTomEtaRP = 0.; // sum_{i=1}^{m} w_{i}
+ TProfile *mPerBinPtRP = new TProfile("mPerBinPtRP","#sum_{i=1}^{m} w_{i}''",fnBinsPt,fPtMin,fPtMax,"s");
+ TProfile *mPerBinEtaRP = new TProfile("mPerBinEtaRP","#sum_{i=1}^{m} w_{i}''",fnBinsEta,fEtaMin,fEtaMax,"s");
   
- for(Int_t i=0;i<nPrim;i++)//loop over all particles
+ for(Int_t i=0;i<nPrim;i++) // loop over all particles
  { 
   fTrack=anEvent->GetTrack(i);
-  if(fTrack && fTrack->UseForIntegratedFlow())//checking RP condition 
+  if(fTrack && fTrack->UseForIntegratedFlow()) // checking RP condition 
   {
-   //Pt:
-   fPtReq1nRP->Fill(fTrack->Pt(),cos(n*(fTrack->Phi())),1.);
-   fPtImq1nRP->Fill(fTrack->Pt(),sin(n*(fTrack->Phi())),1.);
-   fPtReq2nRP->Fill(fTrack->Pt(),cos(2.*n*(fTrack->Phi())),1.);
-   fPtImq2nRP->Fill(fTrack->Pt(),sin(2.*n*(fTrack->Phi())),1.);
-   //Eta:
-   fEtaReq1nRP->Fill(fTrack->Eta(),cos(n*(fTrack->Phi())),1.);
-   fEtaImq1nRP->Fill(fTrack->Eta(),sin(n*(fTrack->Phi())),1.);
-   fEtaReq2nRP->Fill(fTrack->Eta(),cos(2.*n*(fTrack->Phi())),1.);
-   fEtaImq2nRP->Fill(fTrack->Eta(),sin(2.*n*(fTrack->Phi())),1.);
+   // get azimuthal angle, momentum and pseudorapidity of a particle:
+   dPhi = fTrack->Phi();
+   dPt  = fTrack->Pt();
+   dEta = fTrack->Eta();
+   // pt:
+   fPtReq1nRP->Fill(dPt,cos(n*dPhi),1.);
+   fPtImq1nRP->Fill(dPt,sin(n*dPhi),1.);
+   fPtReq2nRP->Fill(dPt,cos(2.*n*dPhi),1.);
+   fPtImq2nRP->Fill(dPt,sin(2.*n*dPhi),1.);
+   // eta:
+   fEtaReq1nRP->Fill(dEta,cos(n*dPhi),1.);
+   fEtaImq1nRP->Fill(dEta,sin(n*dPhi),1.);
+   fEtaReq2nRP->Fill(dEta,cos(2.*n*dPhi),1.);
+   fEtaImq2nRP->Fill(dEta,sin(2.*n*dPhi),1.);
+   // phi weights:
+   if(fUsePhiWeights) 
+   {
+    nBinsPhi = phiWeights->GetNbinsX();
+    if(nBinsPhi) 
+    {
+     wPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
+    }
+   } 
+   // pt weights:
+   if(fUsePtWeights)
+   {          
+    if(dBinWidthPt) 
+    {
+     wPt = ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/dBinWidthPt)));
+    }
+   }             
+   // eta weights:
+   if(fUseEtaWeights)
+   {    
+    if(dBinWidthEta)
+    {
+     wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/dBinWidthEta))); 
+    }
+   }
+   // sum_{i=1}^{m} w_{i}:
+   mPerBinPtRP->Fill(dPt,wPhi*wPt*wEta,1.);
+   mPerBinEtaRP->Fill(dEta,wPhi*wPt*wEta,1.);  
   }
- } 
+ }
   
  //Pt:
  Double_t twoDiffPt1n1nRP=0.,twoDiffPt2n2nRP=0.,threeDiffPt2n1n1nRP=0.,threeDiffPt1n1n2nRP=0.,fourDiffPt1n1n1n1nRP=0.;
@@ -995,12 +1096,19 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
   q2xPtRP = (fPtReq2nRP->GetBinContent(bin))*(fPtReq2nRP->GetBinEntries(bin));  
   q2yPtRP = (fPtImq2nRP->GetBinContent(bin))*(fPtImq2nRP->GetBinEntries(bin)); 
   mPtRP = fPtReq1nRP->GetBinEntries(bin);          
-  if(mPtRP>0&&dMult>1)
+  dSumOfWeightsUpTomPtRP = (mPerBinPtRP->GetBinContent(bin))*(mPerBinPtRP->GetBinEntries(bin));
+  
+  if(mPtRP*dSumOfWeights-dSumOfWeightsUpTomPtRP)
   {
-   twoDiffPt1n1nRP = (qxPtRP*dQ1nx+qyPtRP*dQ1ny-mPtRP)/(mPtRP*(dMult-1.));
-   f2PerPtBin1n1nRP->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt1n1nRP,mPtRP*(dMult-1.));//<2'>_{n|n}
+   //twoDiffPt1n1nRP = (qxPtRP*dQ1nx+qyPtRP*dQ1ny-mPtRP)/(mPtRP*(dMult-1.)); // OK without weights
+   //f2PerPtBin1n1nRP->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt1n1nRP,mPtRP*(dMult-1.));//<2'>_{n|n} // OK without weights
+   
+   twoDiffPt1n1nRP = (qxPtRP*dQ1nxW+qyPtRP*dQ1nyW-dSumOfWeightsUpTomPtRP)/(mPtRP*dSumOfWeights-dSumOfWeightsUpTomPtRP); // OK without weights
+   f2PerPtBin1n1nRP->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt1n1nRP,mPtRP*dSumOfWeights-dSumOfWeightsUpTomPtRP);//<2'>_{n|n} // OK without weights
+  } 
    
+  if(mPtRP>0&&dMult>1)
+  { 
    twoDiffPt2n2nRP = (q2xPtRP*dQ2nx+q2yPtRP*dQ2ny-mPtRP)/(mPtRP*(dMult-1.));
    f2PerPtBin2n2nRP->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt2n2nRP,mPtRP*(dMult-1.));//<2'>_{2n|2n} 
   }
@@ -1026,6 +1134,8 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  fPtReq2nRP->Reset();
  fPtImq2nRP->Reset();
  
+ mPerBinPtRP->Reset();
  //Eta:
  Double_t twoDiffEta1n1nRP=0.,twoDiffEta2n2nRP=0.,threeDiffEta2n1n1nRP=0.,threeDiffEta1n1n2nRP=0.,fourDiffEta1n1n1n1nRP=0.;
  
@@ -1036,12 +1146,19 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
   q2xEtaRP = (fEtaReq2nRP->GetBinContent(bin))*(fEtaReq2nRP->GetBinEntries(bin));  
   q2yEtaRP = (fEtaImq2nRP->GetBinContent(bin))*(fEtaImq2nRP->GetBinEntries(bin)); 
   mEtaRP = fEtaReq1nRP->GetBinEntries(bin); 
+  dSumOfWeightsUpTomEtaRP = (mPerBinEtaRP->GetBinContent(bin))*(mPerBinEtaRP->GetBinEntries(bin));
   
-  if(mEtaRP>0&&dMult>1)
+  if(mEtaRP*dSumOfWeights-dSumOfWeightsUpTomEtaRP)
   {
-   twoDiffEta1n1nRP = (qxEtaRP*dQ1nx+qyEtaRP*dQ1ny-mEtaRP)/(mEtaRP*(dMult-1.));
-   f2PerEtaBin1n1nRP->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta1n1nRP,mEtaRP*(dMult-1.));//<2'>_{n|n}
+   //twoDiffEta1n1nRP = (qxEtaRP*dQ1nx+qyEtaRP*dQ1ny-mEtaRP)/(mEtaRP*(dMult-1.)); // OK without weights
+   //f2PerEtaBin1n1nRP->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta1n1nRP,mEtaRP*(dMult-1.));//<2'>_{n|n} // OK without weights
+   
+   twoDiffEta1n1nRP = (qxEtaRP*dQ1nxW+qyEtaRP*dQ1nyW-dSumOfWeightsUpTomEtaRP)/(mEtaRP*dSumOfWeights-dSumOfWeightsUpTomEtaRP); // OK without weights
+   f2PerEtaBin1n1nRP->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta1n1nRP,mEtaRP*dSumOfWeights-dSumOfWeightsUpTomEtaRP);//<2'>_{n|n} // OK without weights
+  } 
    
+  if(mEtaRP>0&&dMult>1)
+  { 
    twoDiffEta2n2nRP = (q2xEtaRP*dQ2nx+q2yEtaRP*dQ2ny-mEtaRP)/(mEtaRP*(dMult-1.));
    f2PerEtaBin2n2nRP->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta2n2nRP,mEtaRP*(dMult-1.));//<2'>_{2n|2n} 
   }
@@ -1067,73 +1184,122 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  fEtaReq2nRP->Reset();
  fEtaImq2nRP->Reset();
  
+ mPerBinEtaRP->Reset();
  //POI:
  Double_t qxPrimePtPOI=0.,qyPrimePtPOI=0.,q2xPrimePtPOI=0.,q2yPrimePtPOI=0.,mPrimePtPOI=0.;//add comments for these variables (deleteMe)
  Double_t qxPrimePrimePtPOI=0.,qyPrimePrimePtPOI=0.,q2xPrimePrimePtPOI=0.,q2yPrimePrimePtPOI=0.,mPrimePrimePtPOI=0.;//add comments for these variables (deleteMe)
  Double_t qxPrimeEtaPOI=0.,qyPrimeEtaPOI=0.,q2xPrimeEtaPOI=0.,q2yPrimeEtaPOI=0.,mPrimeEtaPOI=0.;//add comments for these variables (deleteMe)
  Double_t qxPrimePrimeEtaPOI=0.,qyPrimePrimeEtaPOI=0.,q2xPrimePrimeEtaPOI=0.,q2yPrimePrimeEtaPOI=0.,mPrimePrimeEtaPOI=0.;//add comments for the
+ Double_t dSumOfWeightsUpTomPrimePrimePtPOI  = 0.; // sum_{i=1}^{m''} w_{i}
+ Double_t dSumOfWeightsUpTomPrimePrimeEtaPOI = 0.; // sum_{i=1}^{m''} w_{i}
+ TProfile *mPrimePrimePerBinPtPOI = new TProfile("mPrimePrimePerBinPtPOI","#sum_{i=1}^{m''} w_{i}''",fnBinsPt,fPtMin,fPtMax,"s");
+ TProfile *mPrimePrimePerBinEtaPOI = new TProfile("mPrimePrimePerBinEtaPOI","#sum_{i=1}^{m''} w_{i}''",fnBinsEta,fEtaMin,fEtaMax,"s");
 
- for(Int_t i=0;i<nPrim;i++)//loop over all particles (to be improved: do the calculations for RPs and POIs in the same loop) 
+ for(Int_t i=0;i<nPrim;i++) // loop over all particles (to be improved: do the calculations for RPs and POIs in the same loop) 
  { 
   fTrack=anEvent->GetTrack(i);
   if(fTrack)
   {
-   if(fTrack->UseForDifferentialFlow())//checking if particle is POI 
+   if(fTrack->UseForDifferentialFlow()) // checking if particle is POI 
    {
-    if(fTrack->UseForIntegratedFlow())//checking if particle is both POI and RP 
+    if(fTrack->UseForIntegratedFlow()) // checking if particle is both POI and RP 
     {
-     //Pt:
-     fPtReq1nPrimePrimePOI->Fill(fTrack->Pt(),cos(n*(fTrack->Phi())),1.); 
-     fPtImq1nPrimePrimePOI->Fill(fTrack->Pt(),sin(n*(fTrack->Phi())),1.);
-     fPtReq2nPrimePrimePOI->Fill(fTrack->Pt(),cos(2.*n*(fTrack->Phi())),1.);
-     fPtImq2nPrimePrimePOI->Fill(fTrack->Pt(),sin(2.*n*(fTrack->Phi())),1.);
-     //Eta:
-     fEtaReq1nPrimePrimePOI->Fill(fTrack->Eta(),cos(n*(fTrack->Phi())),1.); 
-     fEtaImq1nPrimePrimePOI->Fill(fTrack->Eta(),sin(n*(fTrack->Phi())),1.);
-     fEtaReq2nPrimePrimePOI->Fill(fTrack->Eta(),cos(2.*n*(fTrack->Phi())),1.);
-     fEtaImq2nPrimePrimePOI->Fill(fTrack->Eta(),sin(2.*n*(fTrack->Phi())),1.);
-    }else if(!(fTrack->UseForIntegratedFlow()))//checking if particles is POI and not RP  
+     // get azimuthal angle, momentum and pseudorapidity of a particle:
+     dPhi = fTrack->Phi();
+     dPt  = fTrack->Pt();
+     dEta = fTrack->Eta();
+     // pt:
+     fPtReq1nPrimePrimePOI->Fill(dPt,cos(n*dPhi),1.); 
+     fPtImq1nPrimePrimePOI->Fill(dPt,sin(n*dPhi),1.);
+     fPtReq2nPrimePrimePOI->Fill(dPt,cos(2.*n*dPhi),1.);
+     fPtImq2nPrimePrimePOI->Fill(dPt,sin(2.*n*dPhi),1.);
+     // eta:
+     fEtaReq1nPrimePrimePOI->Fill(dEta,cos(n*dPhi),1.); 
+     fEtaImq1nPrimePrimePOI->Fill(dEta,sin(n*dPhi),1.);
+     fEtaReq2nPrimePrimePOI->Fill(dEta,cos(2.*n*dPhi),1.);
+     fEtaImq2nPrimePrimePOI->Fill(dEta,sin(2.*n*dPhi),1.);
+     // phi weights:
+     if(fUsePhiWeights) 
+     {
+      nBinsPhi = phiWeights->GetNbinsX();
+      if(nBinsPhi) 
+      {
+       wPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
+      }
+     } 
+     // pt weights:
+     if(fUsePtWeights)
+     {          
+      if(dBinWidthPt) 
+      {
+       wPt = ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/dBinWidthPt)));
+      }
+     }             
+     // eta weights:
+     if(fUseEtaWeights)
+     {    
+      if(dBinWidthEta)
+      {
+       wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/dBinWidthEta))); 
+      }
+     }
+     // sum_{i=1}^{m''} w_{i}:
+     mPrimePrimePerBinPtPOI->Fill(dPt,wPhi*wPt*wEta,1.);
+     mPrimePrimePerBinEtaPOI->Fill(dEta,wPhi*wPt*wEta,1.);       
+    }else if(!(fTrack->UseForIntegratedFlow())) // checking if particles is POI and not RP  
      {
-      //Pt:
-      fPtReq1nPrimePOI->Fill(fTrack->Pt(),cos(n*(fTrack->Phi())),1.); 
-      fPtImq1nPrimePOI->Fill(fTrack->Pt(),sin(n*(fTrack->Phi())),1.);
-      fPtReq2nPrimePOI->Fill(fTrack->Pt(),cos(2.*n*(fTrack->Phi())),1.);
-      fPtImq2nPrimePOI->Fill(fTrack->Pt(),sin(2.*n*(fTrack->Phi())),1.);
-      //Eta:
-      fEtaReq1nPrimePOI->Fill(fTrack->Eta(),cos(n*(fTrack->Phi())),1.); 
-      fEtaImq1nPrimePOI->Fill(fTrack->Eta(),sin(n*(fTrack->Phi())),1.);
-      fEtaReq2nPrimePOI->Fill(fTrack->Eta(),cos(2.*n*(fTrack->Phi())),1.);
-      fEtaImq2nPrimePOI->Fill(fTrack->Eta(),sin(2.*n*(fTrack->Phi())),1.);
-     }//end of else if(!(fTrack->UseForIntegratedFlow()))//checking if particles is POI and not RP 
-   }//end of if(fTrack->UseForDifferentialFlow())//checking if particle is POI
-  }//end of if(fTrack}      
- }//end of for(Int_t i=0;i<nPrim;i++)        
+      // get azimuthal angle, momentum and pseudorapidity of a particle:
+      dPhi = fTrack->Phi();
+      dPt  = fTrack->Pt();
+      dEta = fTrack->Eta();
+      // pt:
+      fPtReq1nPrimePOI->Fill(dPt,cos(n*dPhi),1.); 
+      fPtImq1nPrimePOI->Fill(dPt,sin(n*dPhi),1.);
+      fPtReq2nPrimePOI->Fill(dPt,cos(2.*n*dPhi),1.);
+      fPtImq2nPrimePOI->Fill(dPt,sin(2.*n*dPhi),1.);
+      // eta:
+      fEtaReq1nPrimePOI->Fill(dEta,cos(n*dPhi),1.); 
+      fEtaImq1nPrimePOI->Fill(dEta,sin(n*dPhi),1.);
+      fEtaReq2nPrimePOI->Fill(dEta,cos(2.*n*dPhi),1.);
+      fEtaImq2nPrimePOI->Fill(dEta,sin(2.*n*dPhi),1.);
+     } // end of else if(!(fTrack->UseForIntegratedFlow())) // checking if particles is POI and not RP 
+   } // end of if(fTrack->UseForDifferentialFlow()) // checking if particle is POI
+  } // end of if(fTrack}      
+ } // end of for(Int_t i=0;i<nPrim;i++)        
          
- //Pt:
- //Double_t twoDiffPt1n1nPOI=0.,twoDiffPt2n2nPOI=0.,threeDiffPt2n1n1nPOI=0.,threeDiffPt1n1n2nPOI=0.,fourDiffPt1n1n1n1nPOI=0.;
+ // Pt, POI:
  Double_t twoDiffPt1n1nPOI=0.,twoDiffPt2n2nPOI=0.,fourDiffPt1n1n1n1nPOI=0.;
  
- for(Int_t bin=1;bin<(fnBinsPt+1);bin++)//loop over pt-bins 
+ for(Int_t bin=1;bin<(fnBinsPt+1);bin++) // loop over pt-bins 
  { 
-  //q'      
+  // q':      
   qxPrimePtPOI = (fPtReq1nPrimePOI->GetBinContent(bin))*(fPtReq1nPrimePOI->GetBinEntries(bin));
   qyPrimePtPOI = (fPtImq1nPrimePOI->GetBinContent(bin))*(fPtImq1nPrimePOI->GetBinEntries(bin)); 
   q2xPrimePtPOI = (fPtReq2nPrimePOI->GetBinContent(bin))*(fPtReq2nPrimePOI->GetBinEntries(bin));  
   q2yPrimePtPOI = (fPtImq2nPrimePOI->GetBinContent(bin))*(fPtImq2nPrimePOI->GetBinEntries(bin)); 
   mPrimePtPOI = fPtReq1nPrimePOI->GetBinEntries(bin);      
-  //q''                    
+  // q'':                    
   qxPrimePrimePtPOI = (fPtReq1nPrimePrimePOI->GetBinContent(bin))*(fPtReq1nPrimePrimePOI->GetBinEntries(bin));
   qyPrimePrimePtPOI = (fPtImq1nPrimePrimePOI->GetBinContent(bin))*(fPtImq1nPrimePrimePOI->GetBinEntries(bin)); 
   q2xPrimePrimePtPOI = (fPtReq2nPrimePrimePOI->GetBinContent(bin))*(fPtReq2nPrimePrimePOI->GetBinEntries(bin));  
   q2yPrimePrimePtPOI = (fPtImq2nPrimePrimePOI->GetBinContent(bin))*(fPtImq2nPrimePrimePOI->GetBinEntries(bin)); 
-  mPrimePrimePtPOI = fPtReq1nPrimePrimePOI->GetBinEntries(bin);         
-                   
-  if((mPrimePtPOI+mPrimePrimePtPOI>0)&&dMult>0&&!(mPrimePrimePtPOI==1&&mPrimePtPOI==0&&dMult==1))//to be improved 
+  mPrimePrimePtPOI = fPtReq1nPrimePrimePOI->GetBinEntries(bin);
+  dSumOfWeightsUpTomPrimePrimePtPOI = (mPrimePrimePerBinPtPOI->GetBinContent(bin))*(mPrimePrimePerBinPtPOI->GetBinEntries(bin));
+                             
+  if((mPrimePrimePtPOI+mPrimePtPOI)*dSumOfWeights-dSumOfWeightsUpTomPrimePrimePtPOI)
   {   
-   twoDiffPt1n1nPOI = (qxPrimePrimePtPOI*dQ1nx+qyPrimePrimePtPOI*dQ1ny-mPrimePrimePtPOI+qxPrimePtPOI*dQ1nx+qyPrimePtPOI*dQ1ny)/(mPrimePrimePtPOI*(dMult-1)+mPrimePtPOI*dMult);   
-   f2PerPtBin1n1nPOI->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt1n1nPOI,mPrimePrimePtPOI*(dMult-1)+mPrimePtPOI*dMult);//<2'>_{n|n}
+   //twoDiffPt1n1nPOI = (qxPrimePrimePtPOI*dQ1nx+qyPrimePrimePtPOI*dQ1ny-mPrimePrimePtPOI+qxPrimePtPOI*dQ1nx+qyPrimePtPOI*dQ1ny)/(mPrimePrimePtPOI*(dMult-1)+mPrimePtPOI*dMult); // OK without weights
   
-   twoDiffPt2n2nPOI = (q2xPrimePrimePtPOI*dQ2nx+q2yPrimePrimePtPOI*dQ2ny-mPrimePrimePtPOI+q2xPrimePtPOI*dQ2nx+q2yPrimePtPOI*dQ2ny)/(mPrimePrimePtPOI*(dMult-1)+mPrimePtPOI*dMult);   
+   twoDiffPt1n1nPOI = (qxPrimePrimePtPOI*dQ1nxW+qyPrimePrimePtPOI*dQ1nyW-dSumOfWeightsUpTomPrimePrimePtPOI+qxPrimePtPOI*dQ1nxW+qyPrimePtPOI*dQ1nyW)/((mPrimePrimePtPOI+mPrimePtPOI)*dSumOfWeights-dSumOfWeightsUpTomPrimePrimePtPOI); 
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
+   //f2PerPtBin1n1nPOI->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt1n1nPOI,mPrimePrimePtPOI*(dMult-1)+mPrimePtPOI*dMult);//<2'>_{n|n} //OK without weights
+   
+   f2PerPtBin1n1nPOI->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt1n1nPOI,(mPrimePrimePtPOI+mPrimePtPOI)*dSumOfWeights-dSumOfWeightsUpTomPrimePrimePtPOI); // <2'>_{n|n} 
+   
+   twoDiffPt2n2nPOI = (q2xPrimePrimePtPOI*dQ2nx+q2yPrimePrimePtPOI*dQ2ny-mPrimePrimePtPOI+q2xPrimePtPOI*dQ2nx+q2yPrimePtPOI*dQ2ny)/(mPrimePrimePtPOI*(dMult-1)+mPrimePtPOI*dMult); // to be improved: didn't check how it changed with weights   
    f2PerPtBin2n2nPOI->Fill(fPtMin+(bin-1)*dBinWidthPt,twoDiffPt2n2nPOI,mPrimePrimePtPOI*(dMult-1)+mPrimePtPOI*dMult);//<2'>_{2n|2n} 
   }//end of if((mPrimePtPOI+mPrimePrimePtPOI>0)&&dMult>0)
   
@@ -1167,6 +1333,8 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  fPtImq1nPrimePrimePOI->Reset();
  fPtReq2nPrimePrimePOI->Reset();
  fPtImq2nPrimePrimePOI->Reset();
+ mPrimePrimePerBinPtPOI->Reset(); 
 
  //Eta:
  //Double_t twoDiffEta1n1nPOI=0.,twoDiffEta2n2nPOI=0.,threeDiffEta2n1n1nPOI=0.,threeDiffEta1n1n2nPOI=0.,fourDiffEta1n1n1n1nPOI=0.;
@@ -1185,13 +1353,17 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
   qyPrimePrimeEtaPOI = (fEtaImq1nPrimePrimePOI->GetBinContent(bin))*(fEtaImq1nPrimePrimePOI->GetBinEntries(bin)); 
   q2xPrimePrimeEtaPOI = (fEtaReq2nPrimePrimePOI->GetBinContent(bin))*(fEtaReq2nPrimePrimePOI->GetBinEntries(bin));  
   q2yPrimePrimeEtaPOI = (fEtaImq2nPrimePrimePOI->GetBinContent(bin))*(fEtaImq2nPrimePrimePOI->GetBinEntries(bin)); 
-  mPrimePrimeEtaPOI = fEtaReq1nPrimePrimePOI->GetBinEntries(bin);         
-                   
-  if((mPrimeEtaPOI+mPrimePrimeEtaPOI>0)&&dMult>0&&!(mPrimePrimeEtaPOI==1&&mPrimeEtaPOI==0&&dMult==1))//to be improved (dMult>1 or dMult>0)
+  mPrimePrimeEtaPOI = fEtaReq1nPrimePrimePOI->GetBinEntries(bin);  
+  dSumOfWeightsUpTomPrimePrimeEtaPOI = (mPrimePrimePerBinEtaPOI->GetBinContent(bin))*(mPrimePrimePerBinEtaPOI->GetBinEntries(bin));       
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+  if((mPrimePrimeEtaPOI+mPrimeEtaPOI)*dSumOfWeights-dSumOfWeightsUpTomPrimePrimeEtaPOI)//to be improved (dMult>1 or dMult>0)
   {   
-   twoDiffEta1n1nPOI = (qxPrimePrimeEtaPOI*dQ1nx+qyPrimePrimeEtaPOI*dQ1ny-mPrimePrimeEtaPOI+qxPrimeEtaPOI*dQ1nx+qyPrimeEtaPOI*dQ1ny)/(mPrimePrimeEtaPOI*(dMult-1)+mPrimeEtaPOI*dMult);   
-   f2PerEtaBin1n1nPOI->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta1n1nPOI,mPrimePrimeEtaPOI*(dMult-1)+mPrimeEtaPOI*dMult);//<2'>_{n|n}
+   //twoDiffEta1n1nPOI = (qxPrimePrimeEtaPOI*dQ1nx+qyPrimePrimeEtaPOI*dQ1ny-mPrimePrimeEtaPOI+qxPrimeEtaPOI*dQ1nx+qyPrimeEtaPOI*dQ1ny)/(mPrimePrimeEtaPOI*(dMult-1)+mPrimeEtaPOI*dMult); // OK without weights 
+   //f2PerEtaBin1n1nPOI->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta1n1nPOI,mPrimePrimeEtaPOI*(dMult-1)+mPrimeEtaPOI*dMult);//<2'>_{n|n}  // OK without weights
   
+    twoDiffEta1n1nPOI = (qxPrimePrimeEtaPOI*dQ1nxW+qyPrimePrimeEtaPOI*dQ1nyW-dSumOfWeightsUpTomPrimePrimeEtaPOI+qxPrimeEtaPOI*dQ1nxW+qyPrimeEtaPOI*dQ1nyW)/((mPrimePrimeEtaPOI+mPrimeEtaPOI)*dSumOfWeights-dSumOfWeightsUpTomPrimePrimeEtaPOI); 
+    f2PerEtaBin1n1nPOI->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta1n1nPOI,(mPrimePrimeEtaPOI+mPrimeEtaPOI)*dSumOfWeights-dSumOfWeightsUpTomPrimePrimeEtaPOI); // <2'>_{n|n}  
+    
    twoDiffEta2n2nPOI = (q2xPrimePrimeEtaPOI*dQ2nx+q2yPrimePrimeEtaPOI*dQ2ny-mPrimePrimeEtaPOI+q2xPrimeEtaPOI*dQ2nx+q2yPrimeEtaPOI*dQ2ny)/(mPrimePrimeEtaPOI*(dMult-1)+mPrimeEtaPOI*dMult);   
    f2PerEtaBin2n2nPOI->Fill(fEtaMin+(bin-1)*dBinWidthEta,twoDiffEta2n2nPOI,mPrimePrimeEtaPOI*(dMult-1)+mPrimeEtaPOI*dMult);//<2'>_{2n|2n} 
   }//end of if((mPrimeEtaPOI+mPrimePrimeEtaPOI>0)&&dMult>0)
@@ -1226,7 +1398,9 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  fEtaImq1nPrimePrimePOI->Reset();
  fEtaReq2nPrimePrimePOI->Reset();
  fEtaImq2nPrimePrimePOI->Reset();
-
+ mPrimePrimePerBinEtaPOI->Reset();
 //---------------------------------------------------------------------------------------------------------
 
 
@@ -1296,6 +1470,7 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
 
 
 
+/*
 
 
 
@@ -1307,7 +1482,6 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
 
 
 
- /*
 
 
 
@@ -1698,6 +1872,48 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
   }//end of for(Int_t i2=0;i2<nPrim;i2++) 
  }//end of for(Int_t i1=0;i1<nPrim;i1++)
  
+ */
+
+ /*
  //<5'>_{2n,n|n,n,n}
  for(Int_t i1=0;i1<nPrim;i1++)
  {
@@ -1721,7 +1937,7 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
      if(i4==i1||i4==i2||i4==i3)continue;
      fTrack=anEvent->GetTrack(i4);
      if(!(fTrack->UseForIntegratedFlow()))continue;//RP condition  
-     phi4=fTrack->Phi();
+     phi4=fTrack->Phi();//
      for(Int_t i5=0;i5<nPrim;i5++)
      {
       if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
index d4a9357..dc3c266 100644 (file)
@@ -184,6 +184,7 @@ class AliFlowAnalysisWithQCumulants{
   
   AliFlowTrackSimple* fTrack;                           //track
   TList*              fHistList;                        //list to hold all output histograms
+  TList*              fDiffFlowList;                    //list to hold all histograms and profiles needed for differential flow
   TList*              fWeightsList;                     //list to hold all histograms with weights
     
   TProfile*           fAvMultIntFlowQC;                 //average selected multiplicity (for int. flow)
@@ -289,7 +290,7 @@ class AliFlowAnalysisWithQCumulants{
   Bool_t                     fUsePhiWeights;            //phi weights
   Bool_t                     fUsePtWeights;             //v_2(pt) weights
   Bool_t                     fUseEtaWeights;            //v_2(eta) weights
-                     
+                       
   ClassDef(AliFlowAnalysisWithQCumulants, 0);
 };
 
index b33d555..2c03bdf 100644 (file)
@@ -90,34 +90,42 @@ AliFlowTrackSimple* AliFlowEventSimple::GetTrack(Int_t i)
 //-----------------------------------------------------------------------   
 AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights) 
 {
-  //calculate Q-vector in harmonic n without weights (default harmonic n=2)  
+  // calculate Q-vector in harmonic n without weights (default harmonic n=2)  
   Double_t dQX = 0.;
   Double_t dQY = 0.;
   AliFlowVector vQ;
   vQ.Set(0.,0.);
   
   Int_t iOrder = n;
-  Int_t iUsedTracks = 0;
+  Double_t iUsedTracks = 0;
   Double_t dPhi=0.;
-  Double_t dPt=0;
-  Double_t dEta=0;
+  Double_t dPt=0.;
+  Double_t dEta=0.;
   
   AliFlowTrackSimple* pTrack = NULL;
  
   Int_t nBinsPhi=0; 
   Double_t dBinWidthPt=0.;
-  Double_t dNormPt=0.;
+  Double_t dPtMin=0.;
   Double_t dBinWidthEta=0.;
-  Double_t dNormEta=0.;
+  Double_t dEtaMin=0.;
  
-  Double_t wPhi=1.; //weight Phi  
-  Double_t wPt=1.;  //weight Pt 
-  Double_t wEta=1.; //weight Eta 
+  Double_t wPhi=1.; // weight Phi  
+  Double_t wPt=1.;  // weight Pt 
+  Double_t wEta=1.; // weight Eta 
   
   TH1F *phiWeights = NULL;
-  TH1D *ptWeights = NULL;
+  TH1D *ptWeights  = NULL;
   TH1D *etaWeights = NULL;
 
+  Double_t dSumOfWeightsToPower2 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 2)
+  Double_t dSumOfWeightsToPower3 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 3)
+  Double_t dSumOfWeightsToPower4 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 4)
+  Double_t dSumOfWeightsToPower5 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 5)
+  Double_t dSumOfWeightsToPower6 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 6)
+  Double_t dSumOfWeightsToPower7 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 7)
+  Double_t dSumOfWeightsToPower8 = 0.; // sum_{i=1}^{n} pow((wPhi*wPt*wEta)_i, 8) 
+
   if(weightsList)
   {
    if(usePhiWeights)
@@ -131,7 +139,7 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
     if(ptWeights)
     {
      dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
-     dNormPt = ptWeights->Integral();
+     dPtMin = (ptWeights->GetXaxis())->GetXmin();
     } 
    }       
    if(useEtaWeights)
@@ -140,11 +148,10 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
     if(etaWeights)
     {
      dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
-     dNormEta = etaWeights->Integral();
+     dEtaMin = (etaWeights->GetXaxis())->GetXmin();
     } 
    }          
   } // end of if(weightsList)
-
   
   // loop over tracks    
   for(Int_t i=0;i<fNumberOfTracks;i++)                               
@@ -157,35 +164,53 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
      dPhi = pTrack->Phi();
      dPt  = pTrack->Pt();
      dEta = pTrack->Eta();
-    
-     //determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
-     if(phiWeights && (nBinsPhi!=0) && (phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())))!=0))
+     
+     // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
+     if(phiWeights && nBinsPhi)
      {
-      wPhi=pow(nBinsPhi*phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi()))),-1);
+      wPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
      }
-     //determine v'(pt) weight:    
-     if(ptWeights && dBinWidthPt && dNormPt)
+     // determine v'(pt) weight:    
+     if(ptWeights && dBinWidthPt)
      {
-      wPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPt/dBinWidthPt)))/dNormPt; 
+      wPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt))); 
      }            
-     //determine v'(eta) weight:    
-     if(etaWeights && dBinWidthEta && dNormEta)
+     // determine v'(eta) weight:    
+     if(etaWeights && dBinWidthEta)
      {
-      wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor(dEta/dBinWidthEta)))/dNormEta; 
+      wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta))); 
      } 
-   
-     //building up the weighted Q-vector:       
+
+     // building up the weighted Q-vector:       
      dQX += wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
      dQY += wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi); 
-     iUsedTracks++;
+    
+     // weighted multiplicity:
+     iUsedTracks+=wPhi*wPt*wEta;
+    
+     // weights raised to various powers are summed up:
+     dSumOfWeightsToPower2+=pow(wPhi*wPt*wEta, 2); 
+     dSumOfWeightsToPower3+=pow(wPhi*wPt*wEta, 3); 
+     dSumOfWeightsToPower4+=pow(wPhi*wPt*wEta, 4); 
+     dSumOfWeightsToPower5+=pow(wPhi*wPt*wEta, 5); 
+     dSumOfWeightsToPower6+=pow(wPhi*wPt*wEta, 6); 
+     dSumOfWeightsToPower7+=pow(wPhi*wPt*wEta, 7); 
+     dSumOfWeightsToPower8+=pow(wPhi*wPt*wEta, 8); 
      
-    }//end of if (pTrack->UseForIntegratedFlow())
-   }//end of if (pTrack)
+    } // end of if (pTrack->UseForIntegratedFlow())
+   } // end of if (pTrack)
    else {cerr << "no particle!!!"<<endl;}
-  }//loop over particles
+  } // loop over particles
     
   vQ.Set(dQX,dQY);
   vQ.SetMult(iUsedTracks);
+  vQ.SetSumOfWeightsToPower2(dSumOfWeightsToPower2);
+  vQ.SetSumOfWeightsToPower3(dSumOfWeightsToPower3);
+  vQ.SetSumOfWeightsToPower4(dSumOfWeightsToPower4);
+  vQ.SetSumOfWeightsToPower5(dSumOfWeightsToPower5);
+  vQ.SetSumOfWeightsToPower6(dSumOfWeightsToPower6);
+  vQ.SetSumOfWeightsToPower7(dSumOfWeightsToPower7);
+  vQ.SetSumOfWeightsToPower8(dSumOfWeightsToPower8);
 
   return vQ;
   
index dffe3e6..187874b 100644 (file)
@@ -27,19 +27,66 @@ ClassImp(AliFlowVector)
 
 //________________________________________________________________________
 
-AliFlowVector::AliFlowVector():fMult(0){}
+AliFlowVector::AliFlowVector():
+ fMult(0),
+ fSumOfWeightsToPower2(0),
+ fSumOfWeightsToPower3(0),
+ fSumOfWeightsToPower4(0),
+ fSumOfWeightsToPower5(0),
+ fSumOfWeightsToPower6(0),
+ fSumOfWeightsToPower7(0),
+ fSumOfWeightsToPower8(0) 
+ {
+  // default contructor
+ }
 
-AliFlowVector::AliFlowVector(const AliFlowVector& aVector):TVector2(aVector),
-fMult(aVector.fMult){}
-AliFlowVector::AliFlowVector(const TVector2 &v, Double_t m):TVector2(v),fMult(m){}
-AliFlowVector::~AliFlowVector(){}
+AliFlowVector::AliFlowVector(const AliFlowVector& aVector):
+ TVector2(aVector),
+ fMult(aVector.fMult),
+ fSumOfWeightsToPower2(aVector.fSumOfWeightsToPower2),
+ fSumOfWeightsToPower3(aVector.fSumOfWeightsToPower3),
+ fSumOfWeightsToPower4(aVector.fSumOfWeightsToPower4),
+ fSumOfWeightsToPower5(aVector.fSumOfWeightsToPower5),
+ fSumOfWeightsToPower6(aVector.fSumOfWeightsToPower6),
+ fSumOfWeightsToPower7(aVector.fSumOfWeightsToPower7),
+ fSumOfWeightsToPower8(aVector.fSumOfWeightsToPower8)
+ {
+  // copy constructor
+ }
+AliFlowVector::AliFlowVector(const TVector2 &v, const Double_t m, const Double_t sumPow2w, const Double_t sumPow3w, const Double_t sumPow4w, const Double_t sumPow5w, const Double_t sumPow6w, const Double_t sumPow7w, const Double_t sumPow8w):
+ TVector2(v),
+ fMult(m),
+ fSumOfWeightsToPower2(sumPow2w),
+ fSumOfWeightsToPower3(sumPow3w),
+ fSumOfWeightsToPower4(sumPow4w),
+ fSumOfWeightsToPower5(sumPow5w),
+ fSumOfWeightsToPower6(sumPow6w),
+ fSumOfWeightsToPower7(sumPow7w),
+ fSumOfWeightsToPower8(sumPow8w) 
+ {
+  // custom constructor
+ }
+AliFlowVector::~AliFlowVector()
+{
+ // default constructor 
+}
 AliFlowVector& AliFlowVector::operator=(const AliFlowVector& aVector)
 {
-   //assignement operator
-   fX=aVector.X();
-   fY=aVector.Y();
-   fMult=aVector.GetMult();
-   return *this;
+ // assignement operator
+ fX = aVector.X();
+ fY = aVector.Y();
+ fMult = aVector.GetMult();
+ fSumOfWeightsToPower2 = aVector.GetSumOfWeightsToPower2();
+ fSumOfWeightsToPower3 = aVector.GetSumOfWeightsToPower3();
+ fSumOfWeightsToPower4 = aVector.GetSumOfWeightsToPower4();
+ fSumOfWeightsToPower5 = aVector.GetSumOfWeightsToPower5();
+ fSumOfWeightsToPower6 = aVector.GetSumOfWeightsToPower6();
+ fSumOfWeightsToPower7 = aVector.GetSumOfWeightsToPower7();
+ fSumOfWeightsToPower8 = aVector.GetSumOfWeightsToPower8();
+ return *this;
 }
 
 
index b932b33..e60877c 100644 (file)
@@ -2,8 +2,8 @@
 * See cxx source for full Copyright notice */
 /* $Id$ */
 
-#ifndef AliFlowVector_H
-#define AliFlowVector_H
+#ifndef ALIFLOWVECTOR_H
+#define ALIFLOWVECTOR_H
 
 #include "TVector2.h"
 
@@ -17,17 +17,45 @@ class AliFlowVector: public TVector2 {
  public:
   AliFlowVector();
   AliFlowVector(const AliFlowVector& aVector);
-  AliFlowVector(const TVector2 &p, Double_t m);
+  AliFlowVector(const TVector2 &p, const Double_t m, const Double_t sumPow2w, const Double_t sumPow3w, const Double_t sumPow4w, const Double_t sumPow5w, const Double_t sumPow6w, const Double_t sumPow7w, const Double_t sumPow8w);
   virtual ~AliFlowVector();
 
   AliFlowVector& operator=(const AliFlowVector& aVector);
 
-  void SetMult(Double_t mult)       {this->fMult = mult;} ;
-  Double_t GetMult() const          {return this -> fMult;} ;
+  void SetMult(Double_t const mult) {this->fMult = mult;};
+  Double_t GetMult() const {return this->fMult;};
   
+  void SetSumOfWeightsToPower2(Double_t const p2w) {this->fSumOfWeightsToPower2 = p2w;};
+  Double_t GetSumOfWeightsToPower2() const {return this->fSumOfWeightsToPower2;};
+
+  void SetSumOfWeightsToPower3(Double_t const p3w) {this->fSumOfWeightsToPower3 = p3w;};
+  Double_t GetSumOfWeightsToPower3() const {return this->fSumOfWeightsToPower3;};
+  
+  void SetSumOfWeightsToPower4(Double_t const p4w) {this->fSumOfWeightsToPower4 = p4w;};
+  Double_t GetSumOfWeightsToPower4() const {return this->fSumOfWeightsToPower4;};
+  
+  void SetSumOfWeightsToPower5(Double_t const p5w) {this->fSumOfWeightsToPower5 = p5w;};
+  Double_t GetSumOfWeightsToPower5() const {return this->fSumOfWeightsToPower5;};
+  
+  void SetSumOfWeightsToPower6(Double_t const p6w) {this->fSumOfWeightsToPower6 = p6w;};
+  Double_t GetSumOfWeightsToPower6() const {return this->fSumOfWeightsToPower6;};
+  
+  void SetSumOfWeightsToPower7(Double_t const p7w) {this->fSumOfWeightsToPower7 = p7w;};
+  Double_t GetSumOfWeightsToPower7() const {return this->fSumOfWeightsToPower7;};
+  
+  void SetSumOfWeightsToPower8(Double_t const p8w) {this->fSumOfWeightsToPower8 = p8w;};
+  Double_t GetSumOfWeightsToPower8() const {return this->fSumOfWeightsToPower8;};
+    
  private:
-  Double_t fMult;   //multiplicity
-        
+  Double_t fMult;                 // multiplicity = sum of weights = w_1 + w_2 + ... + w_n
+  Double_t fSumOfWeightsToPower2; // pow(w_1,2) + pow(w_2,2) + ... + pow(w_n,2)
+  Double_t fSumOfWeightsToPower3; // pow(w_1,3) + pow(w_2,3) + ... + pow(w_n,4)
+  Double_t fSumOfWeightsToPower4; // pow(w_1,4) + pow(w_2,4) + ... + pow(w_n,4)
+  Double_t fSumOfWeightsToPower5; // pow(w_1,5) + pow(w_2,5) + ... + pow(w_n,5)
+  Double_t fSumOfWeightsToPower6; // pow(w_1,6) + pow(w_2,6) + ... + pow(w_n,6)
+  Double_t fSumOfWeightsToPower7; // pow(w_1,7) + pow(w_2,7) + ... + pow(w_n,7)
+  Double_t fSumOfWeightsToPower8; // pow(w_1,8) + pow(w_2,8) + ... + pow(w_n,8)
   ClassDef(AliFlowVector, 0) 
 };
 #endif
index 58b74d4..7ce4540 100644 (file)
@@ -399,32 +399,32 @@ void AliAnalysisTaskQCumulants::Terminate(Option_t *)
   TProfile *QProduct = dynamic_cast<TProfile*>(fListHistos->FindObject("fQProduct"));
   
   //average 2-, 3- and 4-particle correlations per pt-bin 
-  TProfile *binnedPt2p1n1nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerPtBin1n1nRP"));
-  TProfile *binnedPt2p2n2nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerPtBin2n2nRP"));
-  TProfile *binnedPt3p2n1n1nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerPtBin2n1n1nRP"));
-  TProfile *binnedPt3p1n1n2nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerPtBin1n1n2nRP"));
-  TProfile *binnedPt4p1n1n1n1nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f4PerPtBin1n1n1n1nRP"));
+  TProfile *binnedPt2p1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerPtBin1n1nRP"));
+  TProfile *binnedPt2p2n2nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerPtBin2n2nRP"));
+  TProfile *binnedPt3p2n1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerPtBin2n1n1nRP"));
+  TProfile *binnedPt3p1n1n2nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerPtBin1n1n2nRP"));
+  TProfile *binnedPt4p1n1n1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerPtBin1n1n1n1nRP"));
   
   //average 2-, 3- and 4-particle correlations per eta-bin 
-  TProfile *binnedEta2p1n1nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerEtaBin1n1nRP"));
-  TProfile *binnedEta2p2n2nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerEtaBin2n2nRP"));
-  TProfile *binnedEta3p2n1n1nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerEtaBin2n1n1nRP"));
-  TProfile *binnedEta3p1n1n2nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerEtaBin1n1n2nRP"));
-  TProfile *binnedEta4p1n1n1n1nRP = dynamic_cast<TProfile*>(fListHistos->FindObject("f4PerEtaBin1n1n1n1nRP"));  
+  TProfile *binnedEta2p1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerEtaBin1n1nRP"));
+  TProfile *binnedEta2p2n2nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerEtaBin2n2nRP"));
+  TProfile *binnedEta3p2n1n1nRP =  dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerEtaBin2n1n1nRP"));
+  TProfile *binnedEta3p1n1n2nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerEtaBin1n1n2nRP"));
+  TProfile *binnedEta4p1n1n1n1nRP = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerEtaBin1n1n1n1nRP"));  
   
   //average 2-, 3- and 4-particle correlations per pt-bin 
-  TProfile *binnedPt2p1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerPtBin1n1nPOI"));
-  TProfile *binnedPt2p2n2nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerPtBin2n2nPOI"));
-  TProfile *binnedPt3p2n1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerPtBin2n1n1nPOI"));
-  TProfile *binnedPt3p1n1n2nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerPtBin1n1n2nPOI"));
-  TProfile *binnedPt4p1n1n1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f4PerPtBin1n1n1n1nPOI"));
+  TProfile *binnedPt2p1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerPtBin1n1nPOI"));
+  TProfile *binnedPt2p2n2nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerPtBin2n2nPOI"));
+  TProfile *binnedPt3p2n1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerPtBin2n1n1nPOI"));
+  TProfile *binnedPt3p1n1n2nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerPtBin1n1n2nPOI"));
+  TProfile *binnedPt4p1n1n1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerPtBin1n1n1n1nPOI"));
   
   //average 2-, 3- and 4-particle correlations per eta-bin 
-  TProfile *binnedEta2p1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerEtaBin1n1nPOI"));
-  TProfile *binnedEta2p2n2nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f2PerEtaBin2n2nPOI"));
-  TProfile *binnedEta3p2n1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerEtaBin2n1n1nPOI"));
-  TProfile *binnedEta3p1n1n2nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerEtaBin1n1n2nPOI"));
-  TProfile *binnedEta4p1n1n1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f4PerEtaBin1n1n1n1nPOI")); 
+  TProfile *binnedEta2p1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerEtaBin1n1nPOI"));
+  TProfile *binnedEta2p2n2nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f2PerEtaBin2n2nPOI"));
+  TProfile *binnedEta3p2n1n1nPOI =  dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerEtaBin2n1n1nPOI"));
+  TProfile *binnedEta3p1n1n2nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f3PerEtaBin1n1n2nPOI"));
+  TProfile *binnedEta4p1n1n1n1nPOI = dynamic_cast<TProfile*>((dynamic_cast<TList*>(fListHistos->FindObject("DifferentialFlow")))->FindObject("f4PerEtaBin1n1n1n1nPOI"));  
     
   //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("fQvectorComponents"));
@@ -493,7 +493,8 @@ void AliAnalysisTaskQCumulants::Terminate(Option_t *)
  }
  else
  {
-  cout<<"histogram list pointer is empty"<<endl;
+  cout<<" WARNING: QC histogram list pointer is NULL."<<endl;
+  cout<<endl;
  }
 }
 
index a804a80..4e8eff3 100755 (executable)
@@ -21,8 +21,8 @@ void makeWeights(TString type="ESD", TString method="GFC", TString cumulantOrder
  //for AliRoot
  gSystem->AddIncludePath("-I$ALICE_ROOT/include");
  gSystem->Load("libANALYSIS.so");
- gSystem->Load("libPWG2flowCommon.so");
- cerr<<"libPWG2flowCommon.so loaded ..."<<endl;
+ gSystem->Load("libPWG2flow.so");
+ cerr<<"libPWG2flow.so loaded ..."<<endl;
 
  //open the output file from the first run of the specified method:
  TString inputFileName = "output";
@@ -62,17 +62,30 @@ void makeWeights(TString type="ESD", TString method="GFC", TString cumulantOrder
  //making the output file and creating the TList to hold the histograms with weights:
  TFile* outputFile = new TFile("weights.root","RECREATE"); 
  TList* listWeights = new TList();
+ Int_t nBinsPhi = 0;
+ Double_t nParticlesInBin = 0;  // number of particles in particular phi bin
+ Double_t nParticlesPerBin = 0; // average number of particles per phi bin
+ Double_t nParticles = 0;       // number of particles in all phi bins 
+ Double_t wPhi = 0.;  
  //common control histos:
  if(commonHist)
  {
   //azimuthal acceptance:
   (commonHist->GetHistPhiInt())->SetName("phi_weights");
-  //normalizing:
-  Double_t norm=(commonHist->GetHistPhiInt())->Integral();
-  if(norm)
+  (commonHist->GetHistPhiInt())->SetTitle("Phi_weights: correction for non-uniform acceptance");
+  (commonHist->GetHistPhiInt())->SetYTitle("weights");
+  (commonHist->GetHistPhiInt())->SetXTitle("#phi"); 
+  nBinsPhi = (commonHist->GetHistPhiInt())->GetNbinsX();
+  nParticles = (commonHist->GetHistPhiInt())->Integral();
+  if(nBinsPhi) nParticlesPerBin = nParticles/nBinsPhi; 
+  // loop over phi bins:
+  for(Int_t b=1;b<nBinsPhi+1;b++)
   {
-   (commonHist->GetHistPhiInt())->Scale(1./norm);
-  } 
+   nParticlesInBin = (commonHist->GetHistPhiInt())->GetBinContent(b);
+   // calculate the phi weight wPhi for each bin:
+   if(nParticlesInBin) wPhi = nParticlesPerBin/nParticlesInBin;
+   (commonHist->GetHistPhiInt())->SetBinContent(b,wPhi);
+  }
   listWeights->Add(commonHist->GetHistPhiInt());
  }else{cout<<" WARNING: the common control histos from the 1st run were not accessed."<<endl;} 
  //common results histos: