-/*************************************************************************
-* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
-* *
-* Author: The ALICE Off-line Project. *
-* Contributors are mentioned in the code where appropriate. *
-* *
-* Permission to use, copy, modify and distribute this software and its *
-* documentation strictly for non-commercial purposes is hereby granted *
-* without fee, provided that the above copyright notice appears in all *
-* copies and that both the copyright notice and this permission notice *
-* appear in the supporting documentation. The authors make no claims *
-* about the suitability of this software for any purpose. It is *
-* provided "as is" without express or implied warranty. *
-**************************************************************************/
-
-/**********************************
- * flow analysis with Q-cumulants *
- * *
- * author: Ante Bilandzic *
- * (anteb@nikhef.nl) *
- *********************************/
-
-#define AliFlowAnalysisWithQCumulants_cxx
-
-#include "Riostream.h"
-#include "AliFlowCommonConstants.h"
-#include "AliFlowCommonHist.h"
-#include "AliFlowCommonHistResults.h"
-#include "TChain.h"
-#include "TFile.h"
-#include "TList.h"
-#include "TGraph.h"
-#include "TParticle.h"
-#include "TRandom3.h"
-#include "TStyle.h"
-#include "TProfile.h"
-#include "TProfile2D.h"
-#include "TProfile3D.h"
-#include "TMath.h"
-#include "TArrow.h"
-#include "TPaveLabel.h"
-#include "TCanvas.h"
-#include "AliFlowEventSimple.h"
-#include "AliFlowTrackSimple.h"
-#include "AliFlowAnalysisWithQCumulants.h"
-#include "TArrayD.h"
-#include "TRandom.h"
-#include "TF1.h"
-
-class TH1;
-class TH2;
-class TGraph;
-class TPave;
-class TLatex;
-class TMarker;
-class TRandom3;
-class TObjArray;
-class TList;
-class TCanvas;
-class TSystem;
-class TROOT;
-class AliFlowVector;
-class TVector;
-
-
-//================================================================================================================
-
-
-ClassImp(AliFlowAnalysisWithQCumulants)
-
-AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
- // 0.) base:
- fHistList(NULL),
- // 1.) common:
- fCommonHists(NULL),
- fCommonHists2nd(NULL),
- fCommonHists4th(NULL),
- fCommonHists6th(NULL),
- fCommonHists8th(NULL),
- fCommonHistsResults2nd(NULL),
- fCommonHistsResults4th(NULL),
- fCommonHistsResults6th(NULL),
- fCommonHistsResults8th(NULL),
- fnBinsPhi(0),
- fPhiMin(0),
- fPhiMax(0),
- fPhiBinWidth(0),
- fnBinsPt(0),
- fPtMin(0),
- fPtMax(0),
- fPtBinWidth(0),
- fnBinsEta(0),
- fEtaMin(0),
- fEtaMax(0),
- fEtaBinWidth(0),
- fHarmonic(2),
- fAnalysisLabel(NULL),
- // 2.) weights:
- fWeightsList(NULL),
- fUsePhiWeights(kFALSE),
- fUsePtWeights(kFALSE),
- fUseEtaWeights(kFALSE),
- fUseParticleWeights(NULL),
- fPhiWeights(NULL),
- fPtWeights(NULL),
- fEtaWeights(NULL),
- // 3.) integrated flow:
- fIntFlowList(NULL),
- fIntFlowProfiles(NULL),
- fIntFlowResults(NULL),
- fReQ(NULL),
- fImQ(NULL),
- fSMpk(NULL),
- fAvMultiplicity(NULL),
- // 4.) differential flow:
- fDiffFlowList(NULL),
- fFlagsForDiffFlow(NULL),
- fCalculate2DFlow(kFALSE),
- fDiffFlowProfiles(NULL),
- fDiffFlowResults(NULL),
- // 5.) distributions:
- fDistributionsList(NULL),
- // x.) debugging and cross-checking:
- fNestedLoopsList(NULL),
- fEvaluateNestedLoopsForIntFlow(kFALSE),
- fEvaluateNestedLoopsForDiffFlow(kFALSE),
- fEvaluateNestedLoops(NULL),
- fDirectCorrelations(NULL),
- fDirectCorrectionsCos(NULL),
- fDirectCorrectionsSin(NULL),
- fDirectCorrelationsDiffFlow(NULL),
- fDirectCorrectionsDiffFlowCos(NULL),
- fDirectCorrectionsDiffFlowSin(NULL),
- fDirectCorrelationsW(NULL),
- fDirectCorrectionsCosW(NULL),
- fDirectCorrectionsSinW(NULL),
- fDirectCorrelationsDiffFlowW(NULL),
- fDirectCorrectionsDiffFlowCosW(NULL),
- fDirectCorrectionsDiffFlowSinW(NULL)
- {
- // constructor
-
- // base list to hold all output objects:
- fHistList = new TList();
- fHistList->SetName("cobjQC");
- fHistList->SetOwner(kTRUE);
-
- // list to hold histograms with phi, pt and eta weights:
- fWeightsList = new TList();
-
- // analysis label;
- fAnalysisLabel = new TString();
-
- // initialize all arrays:
- this->InitializeArraysForIntFlow();
- this->InitializeArraysForDiffFlow();
- this->InitializeArraysForDistributions();
-
- } // end of constructor
-
-
-//================================================================================================================
-
-
-AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
-{
- // destructor
-
- delete fHistList;
-
-} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
-
-
-//================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::Init()
-{
- // initialize all constants and book everything
-
- // access constants:
- this->AccessConstants();
-
- // booking:
- this->BookAndFillWeightsHistograms();
- this->BookAndNestAllLists();
- this->BookCommonHistograms();
- this->BookEverythingForIntegratedFlow();
- this->BookEverythingForDifferentialFlow();
- this->BookEverythingForDistributions();
- this->BookEverythingForNestedLoops();
-
- // set harmonic in common control histograms (to be improved (should I do this somewhere else?)):
- (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
- (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
- (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
- (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
- (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
-
-} // end of void AliFlowAnalysisWithQCumulants::Init()
-
-
-//================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
-{
- // running over data only in this method
-
- // a) fill the common control histograms and call method to fill fAvMultiplicity;
- // b) loop over data to calculate e-b-e quantities;
- // c) call the methods;
- // d) debugging and cross-checking (evaluate nested loops);
- // e) reset e-b-e quantities.
-
- Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
- Double_t dPt = 0.; // transverse momentum
- Double_t dEta = 0.; // pseudorapidity
-
- Double_t wPhi = 1.; // phi weight
- Double_t wPt = 1.; // pt weight
- Double_t wEta = 1.; // eta weight
-
- // ********************************************
- // **** FILL THE COMMON CONTROL HISTOGRAMS ****
- // ********************************************
-
- Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
-
- fCommonHists->FillControlHistograms(anEvent);
-
- if(nRP>1)
- {
- fCommonHists2nd->FillControlHistograms(anEvent);
- if(nRP>3)
- {
- fCommonHists4th->FillControlHistograms(anEvent);
- if(nRP>5)
- {
- fCommonHists6th->FillControlHistograms(anEvent);
- if(nRP>7)
- {
- fCommonHists8th->FillControlHistograms(anEvent);
- } // end of if(nRP>7)
- } // end of if(nRP>5)
- } // end of if(nRP>3)
- } // end of if(nRP>1)
-
- this->FillAverageMultiplicities(nRP);
-
- // *******************************************************
- // **** LOOP OVER DATA AND CALCULATE E-B-E QUANTITIES ****
- // *******************************************************
-
- Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
- // nRP = # of particles used to determine the reaction plane;
- // nPOI = # of particles of interest for a detailed flow analysis;
- // rest = # of particles which are not niether RPs nor POIs.
-
- AliFlowTrackSimple *aftsTrack = NULL;
-
- for(Int_t i=0;i<nPrim;i++)
- {
- aftsTrack=anEvent->GetTrack(i);
- if(aftsTrack)
- {
- if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
-
- Int_t n = fHarmonic; // shortcut for the harmonic
-
- if(aftsTrack->InRPSelection()) // RP condition:
- {
- dPhi = aftsTrack->Phi();
- dPt = aftsTrack->Pt();
- dEta = aftsTrack->Eta();
-
- if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
- {
- wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
- }
- if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
- {
- wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
- }
- if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
- {
- wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
- }
-
- // integrated flow:
- // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
- (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
- }
- }
- // calculate S^{M}_{p,k} for this event
- // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
- for(Int_t p=0;p<8;p++)
- {
- for(Int_t k=0;k<9;k++)
- {
- (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
- }
- }
-
- // differential flow:
- // 1D (pt):
- // (r_{m*m,k}(pt)):
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE1D[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE1D[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
- }
- }
-
- // s_{k}(pt) for RPs // to be improved (clarified)
- // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
- for(Int_t k=0;k<9;k++)
- {
- fs1D[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
- }
- // 1D (eta):
- // (r_{m*m,k}(eta)):
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE1D[1][0][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE1D[1][0][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
- }
- }
- // s_{k}(eta) for RPs // to be improved (clarified)
- // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
- for(Int_t k=0;k<9;k++)
- {
- fs1D[1][0][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
- }
- // 2D (pt,eta):
- if(fCalculate2DFlow)
- {
- // (r_{m*m,k}(pt,eta)):
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE2D[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE2D[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
- }
- }
- // s_{k}(pt,eta) for RPs // to be improved (clarified)
- // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
- for(Int_t k=0;k<9;k++)
- {
- fs2D[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
- }
- } // end of if(fCalculate2DFlow)
-
- if(aftsTrack->InPOISelection())
- {
- // 1D (pt):
- // (q_{m*m,k}(pt)):
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE1D[0][2][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE1D[0][2][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
- }
- }
- // s_{k}(pt) for RP&&POIs // to be improved (clarified)
- // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
- for(Int_t k=0;k<9;k++)
- {
- fs1D[0][2][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
- }
- // 1D (eta):
- // (q_{m*m,k}(eta)):
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE1D[1][2][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE1D[1][2][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
- }
- }
- // s_{k}(eta) for RP&&POIs // to be improved (clarified)
- // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
- for(Int_t k=0;k<9;k++)
- {
- fs1D[1][2][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
- }
- // 2D (pt,eta)
- if(fCalculate2DFlow)
- {
- // (q_{m*m,k}(pt,eta)):
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE2D[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE2D[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
- }
- }
- // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
- // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
- for(Int_t k=0;k<9;k++)
- {
- fs2D[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
- }
- } // end of if(fCalculate2DFlow)
-
- } // end of if(aftsTrack->InPOISelection())
- } // end of if(pTrack->InRPSelection())
-
- if(aftsTrack->InPOISelection())
- {
- dPhi = aftsTrack->Phi();
- dPt = aftsTrack->Pt();
- dEta = aftsTrack->Eta();
-
- // 1D (pt)
- // p_n(m*n,0):
- for(Int_t m=0;m<4;m++)
- {
- fReEBE1D[0][1][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE1D[0][1][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
- }
- // 1D (eta)
- // p_n(m*n,0):
- for(Int_t m=0;m<4;m++)
- {
- fReEBE1D[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE1D[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
- }
- // 2D (pt,eta):
- if(fCalculate2DFlow)
- {
- // p_n(m*n,0):
- for(Int_t m=0;m<4;m++)
- {
- fReEBE2D[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
- fImEBE2D[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
- }
- } // end of if(fCalculate2DFlow)
-
- } // end of if(pTrack->InPOISelection() )
-
- } else // to if(aftsTrack)
- {
- cout<<endl;
- cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
- cout<<endl;
- }
- } // end of for(Int_t i=0;i<nPrim;i++)
-
- // calculate the final expressions for S^{M}_{p,k}:
- for(Int_t p=0;p<8;p++)
- {
- for(Int_t k=0;k<9;k++)
- {
- (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
- }
- }
-
- // *****************************
- // **** CALL THE METHODS *******
- // *****************************
-
- // integrated flow:
- if(!fEvaluateNestedLoopsForIntFlow)
- {
- // without weights:
- if(nRP>1) this->CalculateCorrelationsForIntegratedFlow();
- if(nRP>0) this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms();
- if(nRP>0) this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms();
- if(nRP>3) this->CalculateQProductsForIntFlow();
- if(nRP>1) this->CalculateSumAndProductOfEventWeights();
- // with weights:
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- if(nRP>1) this->CalculateWeightedCorrelationsForIntegratedFlow();
- if(nRP>3) this->CalculateWeightedQProductsForIntFlow();
- }
- }
-
- // differential flow:
- if(!fEvaluateNestedLoopsForDiffFlow)
- {
- // 1D differential flow (pt)
- // without weights:
- if(nRP>1)
- {
- this->CalculateReducedCorrelations1D("RP","Pt");
- this->CalculateReducedCorrelations1D("POI","Pt");
- this->CalculateQProductsForDiffFlow("RP","Pt");
- this->CalculateQProductsForDiffFlow("POI","Pt");
- this->CalculateSumOfEventWeightsForDiffFlow("RP","Pt");
- this->CalculateProductOfEventWeightsForDiffFlow("RP","Pt");
- this->CalculateSumOfEventWeightsForDiffFlow("POI","Pt");
- this->CalculateProductOfEventWeightsForDiffFlow("POI","Pt");
- }
-
- // with weights:
- // ...
- // 1D differential flow (eta)
- if(nRP>1)
- {
- this->CalculateReducedCorrelations1D("RP","Eta");
- this->CalculateReducedCorrelations1D("POI","Eta");
- this->CalculateQProductsForDiffFlow("RP","Eta");
- this->CalculateQProductsForDiffFlow("POI","Eta");
- this->CalculateSumOfEventWeightsForDiffFlow("RP","Eta");
- this->CalculateProductOfEventWeightsForDiffFlow("RP","Eta");
- this->CalculateSumOfEventWeightsForDiffFlow("POI","Eta");
- this->CalculateProductOfEventWeightsForDiffFlow("POI","Eta");
- }
-
- // 2D differential flow
- if(fCalculate2DFlow)
- {
- // without weights:
- if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
- if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
-
- // with weights:
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
- if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
- }
- } // end of if(fCalculate2DFlow)
-
- }
-
- // **************************************************************
- // **** DEBUGGING AND CROSS-CHECKING (EVALUATE NESTED LOOPS) ****
- // **************************************************************
-
- if(fEvaluateNestedLoopsForIntFlow)
- {
- if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time
- {
- // without weights:
- if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
- {
- this->CalculateCorrelationsForIntegratedFlow();
- this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms();
- this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms();
- }
- // with weights:
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- this->CalculateWeightedCorrelationsForIntegratedFlow();
- }
-
- this->EvaluateNestedLoopsForIntegratedFlow(anEvent);
- }
- }
-
- if(fEvaluateNestedLoopsForDiffFlow)
- {
- if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time
- {
- // without weights:
- if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
- {
- this->CalculateCorrelationsForDifferentialFlow2D("RP");
- this->CalculateCorrelationsForDifferentialFlow2D("POI");
- }
- // with weights:
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
- this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
- }
-
- this->EvaluateNestedLoopsForDifferentialFlow(anEvent);
- }
- }
-
- // ********************************
- // **** RESET E-B-E QUANTITIES ****
- // ********************************
-
- // integrated flow:
- fReQ->Zero();
- fImQ->Zero();
- fSMpk->Zero();
- for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
- {
- fQCorrelationsEBE[pW]->Reset();
- for(Int_t sc=0;sc<2;sc++)
- {
- fQCorrectionsEBE[pW][sc]->Reset();
- }
- }
-
- // differential flow:
- // 1D:
- for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
- {
- for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
- {
- for(Int_t m=0;m<4;m++) // multiple of harmonic
- {
- for(Int_t k=0;k<9;k++) // power of weight
- {
- if(fReEBE1D[pe][t][m][k]) fReEBE1D[pe][t][m][k]->Reset();
- if(fImEBE1D[pe][t][m][k]) fImEBE1D[pe][t][m][k]->Reset();
- }
- }
- }
- }
-
- for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
- {
- for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
- {
- for(Int_t k=0;k<9;k++)
- {
- if(fs1D[pe][t][k]) fs1D[pe][t][k]->Reset();
- }
- }
- }
-
- // e-b-e reduced correlations:
- for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
- {
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t rci=0;rci<4;rci++) // reduced correlation index
- {
- if(fReducedCorrelationsEBE[t][pe][rci]) fReducedCorrelationsEBE[t][pe][rci]->Reset();
- }
- }
- }
-
- // 2D (pt,eta)
- if(fCalculate2DFlow)
- {
- for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
- {
- for(Int_t m=0;m<4;m++) // multiple of harmonic
- {
- for(Int_t k=0;k<9;k++) // power of weight
- {
- if(fReEBE2D[t][m][k]) fReEBE2D[t][m][k]->Reset();
- if(fImEBE2D[t][m][k]) fImEBE2D[t][m][k]->Reset();
- }
- }
- }
-
- for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
- {
- for(Int_t k=0;k<9;k++)
- {
- if(fs2D[t][k]) fs2D[t][k]->Reset();
- }
- }
- } // end of if(fCalculate2DFlow)
-
-} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::Finish()
-{
- // calculate the final results
-
- // a) acces the constants;
- // b) access the flags;
- // c) calculate the final results for integrated flow (without and with weights);
- // d) store in AliFlowCommonHistResults and print the final results for integrated flow;
- // e) calculate the final results for differential flow (without and with weights);
- // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));
- // g) COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW
-
- // ******************************
- // **** ACCESS THE CONSTANTS ****
- // ******************************
-
- this->AccessConstants();
-
- // **************************
- // **** ACCESS THE FLAGS ****
- // **************************
-
- fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
- fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
- fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
- fEvaluateNestedLoopsForIntFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(1);
- fEvaluateNestedLoopsForDiffFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(2);
-
- // *********************************************************
- // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****
- // *********************************************************
-
- // without weights:
- this->FinalizeCorrelationsForIntFlow(kFALSE,"exact");
- this->CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(kFALSE,"exact");
- this->CalculateCovariancesForIntFlow(kFALSE,"exact");
- this->CalculateCumulantsForIntFlow(kFALSE,"exact");
- //this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kFALSE,"exact");
- this->CalculateIntFlow(kFALSE,"exact",kFALSE); // pW = 0, eW = 0, not corrected for non-uniform acceptance
- //this->CalculateIntFlow(kFALSE,"exact",kTRUE); // pW = 0, eW = 0, corrected for non-uniform acceptance
-
- // with weights:
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- this->FinalizeCorrelationsForIntFlow(kTRUE,"exact");
- // this->CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(kTRUE,"exact");
- this->CalculateCovariancesForIntFlow(kTRUE,"exact");
- this->CalculateCumulantsForIntFlow(kTRUE,"exact");
- // this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kTRUE,"exact");
- this->CalculateIntFlow(kTRUE,"exact",kFALSE); // weighted and not corrected for non-uniform acceptance
- // this->CalculateIntFlow(kTRUE,"exact",kTRUE); // weighted and corrected for non-uniform acceptance
- }
-
- // ***************************************************************
- // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****
- // ***************************************************************
-
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- this->FillCommonHistResultsIntFlow(kTRUE,"exact",kFALSE); // weighted and not corrected for non-uniform acceptance
- // this->FillCommonHistResultsIntFlow(kTRUE,kTRUE); // weighted and corrected for non-uniform acceptance (to be improved (enabled))
- // this->PrintQuantifyingCorrectionsForNonUniformAcceptance(kTRUE,"exact"); // (to be improved (enabled))
- } else
- {
- this->FillCommonHistResultsIntFlow(kFALSE,"exact",kFALSE); // non-weighted and corrected for non-uniform acceptance
- this->PrintQuantifyingCorrectionsForNonUniformAcceptance(kFALSE,"exact");
- }
-
- this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)
-
- // ***********************************************************
- // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
- // ***********************************************************
-
- // without weights:
- this->FinalizeReducedCorrelations("RP","Pt");
- this->FinalizeReducedCorrelations("RP","Eta");
- this->FinalizeReducedCorrelations("POI","Pt");
- this->FinalizeReducedCorrelations("POI","Eta");
- this->CalculateCovariancesForDiffFlow("RP","Pt");
- this->CalculateCovariancesForDiffFlow("RP","Eta");
- this->CalculateCovariancesForDiffFlow("POI","Pt");
- this->CalculateCovariancesForDiffFlow("POI","Eta");
-
- //this->FinalizeCorrelationsForDiffFlow("RP",kFALSE,"exact");
- //this->FinalizeCorrelationsForDiffFlow("POI",kFALSE,"exact");
- this->CalculateCumulantsForDiffFlow("RP",kFALSE,"exact");
- this->CalculateCumulantsForDiffFlow("POI",kFALSE,"exact");
- this->CalculateDiffFlow("RP",kFALSE,"exact");
- this->CalculateDiffFlow("POI",kFALSE,"exact");
- this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP",kFALSE,"exact");
- this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI",kFALSE,"exact");
-
- // with weights:
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- //this->FinalizeCorrelationsForDiffFlow("RP",kTRUE,"exact");
- //this->FinalizeCorrelationsForDiffFlow("POI",kTRUE,"exact");
- this->CalculateCumulantsForDiffFlow("RP",kTRUE,"exact");
- this->CalculateCumulantsForDiffFlow("POI",kTRUE,"exact");
- this->CalculateDiffFlow("RP",kTRUE,"exact");
- this->CalculateDiffFlow("POI",kTRUE,"exact");
- this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP",kTRUE,"exact");
- this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI",kTRUE,"exact");
- }
-
-
- //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"POI"); // to be improved (to calculate also when weights are used)
- //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"RP"); // to be improved (to calculate also when weights are used)
-
-
- // *****************************************************************
- // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
- // *****************************************************************
- if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
- {
- this->FillCommonHistResultsDiffFlow("RP",kTRUE,"exact",kFALSE);
- this->FillCommonHistResultsDiffFlow("POI",kTRUE,"exact",kFALSE);
- } else
- {
- this->FillCommonHistResultsDiffFlow("RP",kFALSE,"exact",kFALSE);
- this->FillCommonHistResultsDiffFlow("POI",kFALSE,"exact",kFALSE);
- }
-
- this->PrintFinalResultsForIntegratedFlow("RP");
- this->PrintFinalResultsForIntegratedFlow("POI");
-
- // *****************************************************************************************
- // **** COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW ****
- // *****************************************************************************************
-
- if(fEvaluateNestedLoopsForIntFlow)
- {
- this->CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
- }
-
- if(fEvaluateNestedLoopsForDiffFlow)
- {
- this->CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
- }
-
-} // end of AliFlowAnalysisWithQCumulants::Finish()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms()
-{
- // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
-
- // multiplicity:
- Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- Double_t dReQ1n = (*fReQ)(0,0);
- Double_t dReQ2n = (*fReQ)(1,0);
- //Double_t dReQ3n = (*fReQ)(2,0);
- //Double_t dReQ4n = (*fReQ)(3,0);
- Double_t dImQ1n = (*fImQ)(0,0);
- Double_t dImQ2n = (*fImQ)(1,0);
- //Double_t dImQ3n = (*fImQ)(2,0);
- //Double_t dImQ4n = (*fImQ)(3,0);
-
- // *************************************************************
- // **** corrections for non-uniform acceptance (cos terms): ****
- // *************************************************************
- //
- // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
- // are stored in 1D profile fQCorrectionsCos.
- // Remark 2: binning of fQCorrectionsCos is organized as follows:
- // --------------------------------------------------------------------------------------------------------------------
- // 1st bin: <<cos(n*(phi1))>> = cosP1n
- // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
- // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
- // ...
- // --------------------------------------------------------------------------------------------------------------------
-
- // 1-particle:
- Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
-
- if(dMult>0)
- {
- cosP1n = dReQ1n/dMult;
-
- // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
- fQCorrectionsEBE[0][1]->SetBinContent(1,cosP1n);
-
- // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
- fQCorrections[0][0][1]->Fill(0.5,cosP1n,dMult);
- }
-
- // 2-particle:
- Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
-
- if(dMult>1)
- {
- cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
-
- // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
- fQCorrectionsEBE[0][1]->SetBinContent(2,cosP1nP1n);
-
- // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
- fQCorrections[0][0][1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
- }
-
- // 3-particle:
- Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
-
- if(dMult>2)
- {
- cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
- / (dMult*(dMult-1)*(dMult-2));
-
- // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
- fQCorrectionsEBE[0][1]->SetBinContent(3,cosP1nM1nM1n);
-
- // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
- fQCorrections[0][0][1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
- }
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms()
-{
- // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
-
- // multiplicity:
- Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- Double_t dReQ1n = (*fReQ)(0,0);
- Double_t dReQ2n = (*fReQ)(1,0);
- //Double_t dReQ3n = (*fReQ)(2,0);
- //Double_t dReQ4n = (*fReQ)(3,0);
- Double_t dImQ1n = (*fImQ)(0,0);
- Double_t dImQ2n = (*fImQ)(1,0);
- //Double_t dImQ3n = (*fImQ)(2,0);
- //Double_t dImQ4n = (*fImQ)(3,0);
-
- // *************************************************************
- // **** corrections for non-uniform acceptance (sin terms): ****
- // *************************************************************
- //
- // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
- // are stored in 1D profile fQCorrectionsSin.
- // Remark 2: binning of fQCorrectionsSin is organized as follows:
- // --------------------------------------------------------------------------------------------------------------------
- // 1st bin: <<sin(n*(phi1))>> = sinP1n
- // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
- // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
- // ...
- // --------------------------------------------------------------------------------------------------------------------
-
- // 1-particle:
- Double_t sinP1n = 0.; // <sin(n*(phi1))>
-
- if(dMult>0)
- {
- sinP1n = dImQ1n/dMult;
-
- // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
- fQCorrectionsEBE[0][0]->SetBinContent(1,sinP1n);
-
- // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
- fQCorrections[0][0][0]->Fill(0.5,sinP1n,dMult);
- }
-
- // 2-particle:
- Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
-
- if(dMult>1)
- {
- sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
-
- // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
- fQCorrectionsEBE[0][0]->SetBinContent(2,sinP1nP1n);
-
- // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
- fQCorrections[0][0][0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
- }
-
- // 3-particle:
- Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
-
- if(dMult>2)
- {
- sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
- / (dMult*(dMult-1)*(dMult-2));
-
- // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
- fQCorrectionsEBE[0][0]->SetBinContent(3,sinP1nM1nM1n);
-
- // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
- fQCorrections[0][0][0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
- }
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)
-{
- // calculate corrections for non-uniform acceptance of the detector for differential flow (cos terms)
-
- // multiplicity:
- //Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- //Double_t dReQ1n = (*fReQ)(0,0);
- //Double_t dReQ2n = (*fReQ)(1,0);
- //Double_t dReQ3n = (*fReQ)(2,0);
- //Double_t dReQ4n = (*fReQ)(3,0);
- //Double_t dImQ1n = (*fImQ)(0,0);
- //Double_t dImQ2n = (*fImQ)(1,0);
- //Double_t dImQ3n = (*fImQ)(2,0);
- //Double_t dImQ4n = (*fImQ)(3,0);
-
- // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin):
- //Double_t dReqnPtEta = 0.;
- //Double_t dImqnPtEta = 0.;
-
- // number of POIs in each (pt,eta) bin:
- Double_t dmPtEta = 0.;
-
- // real and imaginary parts of q''_{n}, q''_{2n}, ...
- // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin):
- //Double_t dReqPrimePrime1nPtEta = 0.;
- //Double_t dImqPrimePrime1nPtEta = 0.;
- //Double_t dReqPrimePrime2nPtEta = 0.;
- //Double_t dImqPrimePrime2nPtEta = 0.;
-
- // number of particles which are both RPs and POIs in each (pt,eta) bin:
- //Double_t dmPrimePrimePtEta = 0.;
-
- if(type == "POI")
- {
- // q''_{n}, q''_{2n}:
- //...............................................................................................
- //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));
- //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));
- //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));
- //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));
- //...............................................................................................
-
- // m'':
- //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));
-
- // q'_{n}:
- //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));
- //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));
- //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));
- }
- else if(type == "RP")
- {
- // q_RP{n}, q_RP{2n}:
- //...............................................................................................
- //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));
- //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));
- //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));
- //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));
- //...............................................................................................
-
- // m'':
- //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));
-
- //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
- //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
- //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-)
- }
-
- // 1'-p correction:
- //Double_t oneCosP1nPsiPtEta = 0.;
-
- if(dmPtEta)
- {
- //oneCosP1nPsiPtEta = dReqnPtEta/dmPtEta;
-
- // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:
- if(type == "POI")
- {
- //fCorrectionsCosP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
- // oneCosP1nPsiPtEta,dmPtEta);
- }
- else if(type == "RP")
- {
- //fCorrectionsCosP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
- // oneCosP1nPsiPtEta,dmPtEta);
- }
- } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)
-
- /*
-
- // 4'-particle correlation:
- Double_t four1n1n1n1nPtEta = 0.;
- if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
- {
- four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
- - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
- - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n
- - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
- + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
- - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
- - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta
- + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n)
- + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n)
- + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
- + 2.*dmPrimePrimePtEta*dMult
- - 6.*dmPrimePrimePtEta)
- / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- // fill the 2D profile to get the average correlation for each (pt, eta) bin:
- if(type == "POI")
- {
- f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
- }
- else if(type == "RP")
- {
- f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
- }
- } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))
-
- */
-
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)
-{
- // calculate corrections for non-uniform acceptance of the detector for differential flow (sin terms)
-
- // multiplicity:
- //Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- //Double_t dReQ1n = (*fReQ)(0,0);
- //Double_t dReQ2n = (*fReQ)(1,0);
- //Double_t dReQ3n = (*fReQ)(2,0);
- //Double_t dReQ4n = (*fReQ)(3,0);
- //Double_t dImQ1n = (*fImQ)(0,0);
- //Double_t dImQ2n = (*fImQ)(1,0);
- //Double_t dImQ3n = (*fImQ)(2,0);
- //Double_t dImQ4n = (*fImQ)(3,0);
-
- // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin):
- //Double_t dReqnPtEta = 0.;
- //Double_t dImqnPtEta = 0.;
-
- // number of POIs in each (pt,eta) bin:
- Double_t dmPtEta = 0.;
-
- // real and imaginary parts of q''_{n}, q''_{2n}, ...
- // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin):
- //Double_t dReqPrimePrime1nPtEta = 0.;
- //Double_t dImqPrimePrime1nPtEta = 0.;
- //Double_t dReqPrimePrime2nPtEta = 0.;
- //Double_t dImqPrimePrime2nPtEta = 0.;
-
- // number of particles which are both RPs and POIs in each (pt,eta) bin:
- //Double_t dmPrimePrimePtEta = 0.;
-
- if(type == "POI")
- {
- // q''_{n}, q''_{2n}:
- //...............................................................................................
- //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));
- //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));
- //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));
- //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));
- //...............................................................................................
-
- // m'':
- //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));
-
- // q'_{n}:
- //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));
- //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));
- //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));
- }
- else if(type == "RP")
- {
- // q_RP{n}, q_RP{2n}:
- //...............................................................................................
- //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));
- //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));
- //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));
- //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));
- //...............................................................................................
-
- // m'':
- //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));
-
- //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
- //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
- //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-)
- }
-
- // 1'-p correction:
- //Double_t oneSinP1nPsiPtEta = 0.;
-
- if(dmPtEta)
- {
- //oneSinP1nPsiPtEta = dImqnPtEta/dmPtEta;
-
- // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:
- if(type == "POI")
- {
- //fCorrectionsSinP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
- // oneSinP1nPsiPtEta,dmPtEta);
- }
- else if(type == "RP")
- {
- //fCorrectionsSinP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
- // oneSinP1nPsiPtEta,dmPtEta);
- }
- } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)
-
- /*
-
- // 4'-particle correlation:
- Double_t four1n1n1n1nPtEta = 0.;
- if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
- {
- four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
- - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
- - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n
- - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
- + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
- - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
- - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta
- + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n)
- + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n)
- + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
- + 2.*dmPrimePrimePtEta*dMult
- - 6.*dmPrimePrimePtEta)
- / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- // fill the 2D profile to get the average correlation for each (pt, eta) bin:
- if(type == "POI")
- {
- f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
- }
- else if(type == "RP")
- {
- f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
- }
- } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
- // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))
-
- */
-
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)
-{
- // evaluate the nested loops relevant for differential flow (needed for cross-checking the results)
-
- Int_t nPrim = anEvent->NumberOfTracks();
- AliFlowTrackSimple *aftsTrack = NULL;
-
- Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
- Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
-
- Int_t n = fHarmonic; // to be improved
-
- // ********************************************
- // **** NESTED LOOPS FOR DIFFERENTIAL FLOW ****
- // ********************************************
-
- // Remark 1: (pt,eta) bin in which the cross-checking will be performed is given by 1.1 < pt < 1.2 GeV and -0.55 < eta < -0.525
-
- // Remark 2: multi-particle correlations needed for diff. flow calculated with nested loops without weights are stored in 1D profile
- // fDirectCorrelationsDiffFlow
-
- // Remark 3: multi-particle correlations needed for diff. flow calculated with nested loops with weights are stored in 1D profile
- // fDirectCorrelationsDiffFlowW;
-
- // Remark 4: binning of fDirectCorrelationsDiffFlow is organized as follows:
- //......................................................................................
- // ---- bins 1-20: 2-particle correlations ----
- // 1st bin: <2'>_{1n|1n} = twoPrime1n1n = <cos(n*(psi1-phi2))>
- // ---- bins 21-40: 3-particle correlations ----
- // ---- bins 41-60: 4-particle correlations ----
- // 41st bin: <4'>_{1n,1n|1n,1n} = fourPrime1n1n1n1n = <cos(n*(psi1+phi2-phi3-phi4))>
- //......................................................................................
-
- // Remark 5: binning of fDirectCorrelationsDiffFlow is organized as follows:
- //......................................................................................
- // ---- bins 1-20: 2-particle correlations ----
- // 1st bin: twoPrime1n1nW0W1 = <w2 cos(n*(psi1-phi2))>
- // ---- bins 21-40: 3-particle correlations ----
- // ---- bins 41-60: 4-particle correlations ----
- // 41st bin: fourPrime1n1n1n1nW0W1W1W1 = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
- //......................................................................................
-
- // 2'-particle:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- // POI condition (first particle in the correlator must be POI):
- if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;
- psi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
-
- fDirectCorrectionsDiffFlowCos->Fill(0.,cos(1.*n*(psi1)),1.); // <<cos(n*(psi1))>>
- fDirectCorrectionsDiffFlowSin->Fill(0.,sin(1.*n*(psi1)),1.); // <<sin(n*(psi1))>>
-
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- // RP condition (!(first) particle in the correlator must be RP):
- if(!(aftsTrack->InRPSelection()))continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted:
- //.....................................................................................
- fDirectCorrelationsDiffFlow->Fill(0.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))>
- //.....................................................................................
- // weighted:
- //.....................................................................................
- if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(0.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))>
- //.....................................................................................
-
- //fDirectCorrelations->Fill(103.,cos(1.*n*(phi1-phi2)),pow(wPhi1,2)*wPhi2);//<2'>_{n,n}
- //fDirectCorrelations->Fill(104.,cos(2.*n*(phi1-phi2)),wPhi1*pow(wPhi2,2));//<2'>_{n,n}
- //fDirectCorrelations->Fill(105.,cos(1.*n*(phi1-phi2)),pow(wPhi2,3));//<2'>_{n,n}
- //fDirectCorrelations->Fill(41.,cos(2.*n*(phi1-phi2)),1);//<2'>_{2n,2n}
- //fDirectCorrelations->Fill(42.,cos(3.*n*(phi1-phi2)),1);//<2'>_{3n,3n}
- //fDirectCorrelations->Fill(43.,cos(4.*n*(phi1-phi2)),1);//<2'>_{4n,4n}
-
- }//end of for(Int_t i2=0;i2<nPrim;i2++)
- }//end of for(Int_t i1=0;i1<nPrim;i1++)
-
-
-
- /*
-
- //<3'>_{2n|n,n}
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
- psi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
- //fill the fDirectCorrelations:
-
- // 2-p
- //fDirectCorrelations->Fill(101.,cos(n*(phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(phi2-phi3))>
- //fDirectCorrelations->Fill(102.,cos(n*(phi1-phi3)),pow(wPhi2,2.)*wPhi3); // <w2^2 w3 cos(n(psi1-phi2))>
-
- // 3-p
- //fDirectCorrelations->Fill(110.,cos(n*(2.*phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))>
- //fDirectCorrelations->Fill(111.,cos(n*(phi1+phi2-2.*phi3)),wPhi2*pow(wPhi3,2.)); // <w2 w3^2 cos(n(psi1+phi2-2.*phi3))>
-
-
- //fDirectCorrelations->Fill(46.,cos(n*(phi1+phi2-2.*phi3)),1);//<3'>_{n,n|2n}
- }//end of for(Int_t i3=0;i3<nPrim;i3++)
- }//end of for(Int_t i2=0;i2<nPrim;i2++)
- }//end of for(Int_t i1=0;i1<nPrim;i1++)
- */
-
- // 4'-particle:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- // POI condition (first particle in the correlator must be POI):
- if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;
- psi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- // RP condition (!(first) particle in the correlator must be RP):
- if(!(aftsTrack->InRPSelection()))continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- // RP condition (!(first) particle in the correlator must be RP):
- if(!(aftsTrack->InRPSelection()))continue;
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- // RP condition (!(first) particle in the correlator must be RP):
- if(!(aftsTrack->InRPSelection()))continue;
- phi4=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted:
- //.........................................................................................................................
- fDirectCorrelationsDiffFlow->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi1-phi2-phi3))>
- //.........................................................................................................................
- // weighted:
- //...............................................................................................................................
- if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4); // <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>
- //...............................................................................................................................
-
- }//end of for(Int_t i4=0;i4<nPrim;i4++)
- }//end of for(Int_t i3=0;i3<nPrim;i3++)
- }//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++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
- phi1=aftsTrack->Phi();
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi2=aftsTrack->Phi();
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi3=aftsTrack->Phi();
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi4=aftsTrack->Phi();//
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi5=aftsTrack->Phi();
- //fill the fDirectCorrelations:if(bNestedLoops)
- //fDirectCorrelations->Fill(55.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1);//<5'>_{2n,n|n,n,n}
- }//end of for(Int_t i5=0;i5<nPrim;i5++)
- }//end of for(Int_t i4=0;i4<nPrim;i4++)
- }//end of for(Int_t i3=0;i3<nPrim;i3++)
- }//end of for(Int_t i2=0;i2<nPrim;i2++)
- }//end of for(Int_t i1=0;i1<nPrim;i1++)
-
-
-
- */
- /*
-
-
-
- //<6'>_{n,n,n|n,n,n}
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
- phi1=aftsTrack->Phi();
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi2=aftsTrack->Phi();
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi3=aftsTrack->Phi();
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi4=aftsTrack->Phi();
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi5=aftsTrack->Phi();
- for(Int_t i6=0;i6<nPrim;i6++)
- {
- if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
- aftsTrack=anEvent->GetTrack(i6);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi6=aftsTrack->Phi();
- //fill the fDirectCorrelations:
- //fDirectCorrelations->Fill(60.,cos(n*(phi1+phi2+phi3-phi4-phi5-phi6)),1);//<6'>_{n,n,n|n,n,n}
- }//end of for(Int_t i6=0;i6<nPrim;i6++)
- }//end of for(Int_t i5=0;i5<nPrim;i5++)
- }//end of for(Int_t i4=0;i4<nPrim;i4++)
- }//end of for(Int_t i3=0;i3<nPrim;i3++)
- }//end of for(Int_t i2=0;i2<nPrim;i2++)
- }//end of for(Int_t i1=0;i1<nPrim;i1++)
-
-
- */
- /*
-
-
- //<7'>_{2n,n,n|n,n,n,n}
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
- phi1=aftsTrack->Phi();
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi2=aftsTrack->Phi();
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi3=aftsTrack->Phi();
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi4=aftsTrack->Phi();
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi5=aftsTrack->Phi();
- for(Int_t i6=0;i6<nPrim;i6++)
- {
- if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
- aftsTrack=anEvent->GetTrack(i6);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi6=aftsTrack->Phi();
- for(Int_t i7=0;i7<nPrim;i7++)
- {
- if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
- aftsTrack=anEvent->GetTrack(i7);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi7=aftsTrack->Phi();
- //fill the fDirectCorrelations:
- //fDirectCorrelations->Fill(65.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1);//<7'>_{2n,n,n|n,n,n,n}
- }//end of for(Int_t i7=0;i7<nPrim;i7++)
- }//end of for(Int_t i6=0;i6<nPrim;i6++)
- }//end of for(Int_t i5=0;i5<nPrim;i5++)
- }//end of for(Int_t i4=0;i4<nPrim;i4++)
- }//end of for(Int_t i3=0;i3<nPrim;i3++)
- }//end of for(Int_t i2=0;i2<nPrim;i2++)
- }//end of for(Int_t i1=0;i1<nPrim;i1++)
-
-
-
- */
- /*
-
-
-
- //<8'>_{n,n,n,n|n,n,n,n}
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
- phi1=aftsTrack->Phi();
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi2=aftsTrack->Phi();
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi3=aftsTrack->Phi();
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi4=aftsTrack->Phi();
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi5=aftsTrack->Phi();
- for(Int_t i6=0;i6<nPrim;i6++)
- {
- if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
- aftsTrack=anEvent->GetTrack(i6);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi6=aftsTrack->Phi();
- for(Int_t i7=0;i7<nPrim;i7++)
- {
- if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
- aftsTrack=anEvent->GetTrack(i7);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi7=aftsTrack->Phi();
- for(Int_t i8=0;i8<nPrim;i8++)
- {
- if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
- aftsTrack=anEvent->GetTrack(i8);
- if(!(aftsTrack->InRPSelection()))continue;//RP condition
- phi8=aftsTrack->Phi();
- //fill the fDirectCorrelations:
- //fDirectCorrelations->Fill(70.,cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8)),1);//<8'>_{n,n,n,n|n,n,n,n}
- }//end of for(Int_t i8=0;i8<nPrim;i8++)
- }//end of for(Int_t i7=0;i7<nPrim;i7++)
- }//end of for(Int_t i6=0;i6<nPrim;i6++)
- }//end of for(Int_t i5=0;i5<nPrim;i5++)
- }//end of for(Int_t i4=0;i4<nPrim;i4++)
- }//end of for(Int_t i3=0;i3<nPrim;i3++)
- }//end of for(Int_t i2=0;i2<nPrim;i2++)
- }//end of for(Int_t i1=0;i1<nPrim;i1++)
-
-
-
- */
-
-
-
-
-} // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
-{
- // get pointers to all output histograms (called before Finish())
- if(outputListHistos)
- {
- // 1.) common control histograms and common histograms for final results:
- AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHistQC"));
- if(commonHist) this->SetCommonHists(commonHist);
- AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist2ndOrderQC"));
- if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
- AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist4thOrderQC"));
- if(commonHist4th) this->SetCommonHists4th(commonHist4th);
- AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist6thOrderQC"));
- if(commonHist6th) this->SetCommonHists6th(commonHist6th);
- AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist8thOrderQC"));
- if(commonHist8th) this->SetCommonHists8th(commonHist8th);
- AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
- (outputListHistos->FindObject("AliFlowCommonHistResults2ndOrderQC"));
- if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
- AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
- (outputListHistos->FindObject("AliFlowCommonHistResults4thOrderQC"));
- if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
- AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
- (outputListHistos->FindObject("AliFlowCommonHistResults6thOrderQC"));
- if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
- AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
- (outputListHistos->FindObject("AliFlowCommonHistResults8thOrderQC"));
- if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
-
- // 2.) weights:
- TList *weightsList = dynamic_cast<TList*>(outputListHistos->FindObject("Weights"));
- if(weightsList) this->SetWeightsList(weightsList);
- Bool_t bUsePhiWeights = kFALSE;
- Bool_t bUsePtWeights = kFALSE;
- Bool_t bUseEtaWeights = kFALSE;
- TString fUseParticleWeightsName = "fUseParticleWeightsQC";
- fUseParticleWeightsName += fAnalysisLabel->Data();
- TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
- if(useParticleWeights)
- {
- this->SetUseParticleWeights(useParticleWeights);
- bUsePhiWeights = (Int_t)useParticleWeights->GetBinContent(1);
- bUsePtWeights = (Int_t)useParticleWeights->GetBinContent(2);
- bUseEtaWeights = (Int_t)useParticleWeights->GetBinContent(3);
- }
-
- // 3.) integrated flow:
- TList *intFlowList = NULL;
- TList *intFlowProfiles = NULL;
- TList *intFlowResults = NULL;
-
- intFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Integrated Flow"));
- if(intFlowList)
- {
- intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
- intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
- } else
- {
- cout<<"WARNING: intFlowList is NULL in AFAWQC::GOH() !!!!"<<endl;
- }
-
- // profiles:
- if(intFlowProfiles)
- {
- // average multiplicities:
- TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject("fAvMultiplicity"));
- if(avMultiplicity)
- {
- this->SetAvMultiplicity(avMultiplicity);
- } else
- {
- cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GOH() !!!!"<<endl;
- }
-
- // flags: (to be improved (united with other flags in this method))
- TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
- TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
- //TString nuaFlag[2] = {"not corrected","corrected"};
- TString sinCosFlag[2] = {"sin","cos"};
-
- for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
- {
- for(Int_t eW=0;eW<1;eW++)
- {
- // correlations (profiles):
- TProfile *qCorrelations = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("fQCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(qCorrelations)
- {
- this->SetQCorrelations(qCorrelations,pW,eW);
- } else
- {
- cout<<"WARNING: qCorrelations is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // products (profiles):
- TProfile *qProducts = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("fQProducts: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(qProducts)
- {
- this->SetQProducts(qProducts,pW,eW);
- } else
- {
- cout<<"WARNING: qProducts is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // corrections (profiles):
- for(Int_t sc=0;sc<2;sc++)
- {
- TProfile *qCorrections = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("fQCorrections: %s, %s, %s terms",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()))));
- if(qCorrections)
- {
- this->SetQCorrections(qCorrections,pW,eW,sc);
- } else
- {
- cout<<"WARNING: qCorrections is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"sc = "<<sc<<endl;
- }
- } // end of for(Int_t sc=0;sc<2;sc++)
- } // end of for(Int_t eW=0;eW<1;eW++)
- } // end of for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
- } else // to if(intFlowProfiles)
- {
- cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GOH() !!!!"<<endl;
- }
-
- // results:
- if(intFlowResults)
- {
- for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- // flags: (to be improved (united with other flags in this method))
- TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
- TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
- TString nuaFlag[2] = {"not corrected","corrected"};
- TString powerFlag[2] = {"linear","quadratic"};
- //TString sinCosFlag[2] = {"sin","cos"};
- // correlations (results):
- TH1D *correlations = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(correlations)
- {
- this->SetCorrelations(correlations,pW,eW);
- } else
- {
- cout<<"WARNING: correlations is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // corrections (results):
- TH1D *corrections = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCorrections: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(corrections)
- {
- this->SetCorrections(corrections,pW,eW);
- } else
- {
- cout<<"WARNING: corrections is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // covariances (results):
- TH1D *covariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCovariances: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(covariances)
- {
- this->SetCovariances(covariances,pW,eW);
- } else
- {
- cout<<"WARNING: covariances is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // sum of linear and quadratic event weights (results):
- for(Int_t power=0;power<2;power++)
- {
- TH1D *sumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fSumOfEventWeights: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data())));
- if(sumOfEventWeights)
- {
- this->SetSumOfEventWeights(sumOfEventWeights,pW,eW,power);
- } else
- {
- cout<<"WARNING: sumOfEventWeights is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"power = "<<power<<endl;
- }
- } // end of for(Int_t power=0;power<2;power++)
- // products of event weights (results):
- TH1D *productOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fProductOfEventWeights: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(productOfEventWeights)
- {
- this->SetProductOfEventWeights(productOfEventWeights,pW,eW);
- } else
- {
- cout<<"WARNING: productOfEventWeights is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
-
- for(Int_t nua=0;nua<2;nua++)
- {
- // integrated Q-cumulants:
- TH1D *cumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCumulants: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
- if(cumulants)
- {
- this->SetCumulants(cumulants,pW,eW,nua);
- } else
- {
- cout<<"WARNING: cumulants is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- }
- // integrated flow estimates from Q-cumulants:
- TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fIntFlow: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
- if(intFlow)
- {
- this->SetIntFlow(intFlow,pW,eW,nua);
- } else
- {
- cout<<"WARNING: intFlow is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- }
- } // end of for(Int_t nua=0;nua<2;nua++)
- } // end of for(Int_t eW=0;eW<1;eW++)
- } // end of for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
- } else // to if(intFlowResults)
- {
- cout<<"WARNING: intFlowResults is NULL in AFAWQC::GOH() !!!!"<<endl;
- }
-
- // differential flow:
- TString typeFlag[2] = {"RP","POI"};
- TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (do I need this here?)
- TString powerFlag[2] = {"1","2"};
- //TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"};
- TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
- TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
-
- TString pWeightsFlag[2] = {"not used","used"};
- TString eWeightsFlag[2] = {"exact","non-exact"};
- TString sinCosFlag[2] = {"sin","cos"};
- TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance
- // base list fDiffFlowList "Differential Flow":
- TList *diffFlowList = NULL;
- diffFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Differential Flow"));
- // list holding nested lists containing profiles:
- TList *diffFlowListProfiles = NULL;
- // list holding nested lists containing 2D and 1D histograms with final results:
- TList *diffFlowListResults = NULL;
- if(diffFlowList)
- {
- // flags for differetial flow:
- TString flagsForDiffFlowName = "fFlagsForDiffFlowQC";
- flagsForDiffFlowName += fAnalysisLabel->Data();
- TProfile *flagsForDiffFlow = dynamic_cast<TProfile*>(diffFlowList->FindObject(flagsForDiffFlowName.Data()));
- Bool_t bCalculate2DFlow = kFALSE;
- if(flagsForDiffFlow)
- {
- this->SetFlagsForDiffFlow(flagsForDiffFlow);
- bCalculate2DFlow = (Int_t)flagsForDiffFlow->GetBinContent(1);
- }
-
- // to be improved (moved into dedicated list to hold reduced correlations)
-
- // reduced correlations:
- TString reducedCorrelationsName = "fReducedCorrelations";
- reducedCorrelationsName += fAnalysisLabel->Data();
- TProfile *reducedCorrelations[2][2][4] = {{{NULL}}};
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t ci=0;ci<4;ci++) // correlation index
- {
- reducedCorrelations[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowList->FindObject(Form("%s, %s, %s, %s",reducedCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));
- if(reducedCorrelations[t][pe][ci])
- {
- this->SetReducedCorrelations(reducedCorrelations[t][pe][ci],t,pe,ci);
- } else
- {
- cout<<"WARNING: reducedCorrelations[t][pe][ci] is NULL in AFAWFQD::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"ci = "<<ci<<endl;
- }
-
- } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
- } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
- } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
-
- // to be improved (moved into dedicated list to hold fSumOfEventWeightsForDiffFlow
-
- // sum of event weights for reduced correlations:
- TString sumOfEventWeightsForDiffFlowName = "fSumOfEventWeightsForDiffFlow";
- sumOfEventWeightsForDiffFlowName += fAnalysisLabel->Data();
- TH1D *sumOfEventWeightsForDiffFlow[2][2][2][4] = {{{{NULL}}}};
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- for(Int_t p=0;p<2;p++) // power of weights is 1 or 2
- {
- for(Int_t ew=0;ew<4;ew++) // reduced correlation index
- {
- sumOfEventWeightsForDiffFlow[pe][t][p][ew] = dynamic_cast<TH1D*>(diffFlowList->FindObject(Form("%s, %s, %s, %s, %s",sumOfEventWeightsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data())));
- if(sumOfEventWeightsForDiffFlow[pe][t][p][ew])
- {
- this->SetSumOfEventWeightsForDiffFlow(sumOfEventWeightsForDiffFlow[pe][t][p][ew],pe,t,p,ew);
- } else
- {
- cout<<"WARNING: sumOfEventWeightsForDiffFlow[pe][t][p][ew] is NULL in AFAWFQD::GOH() !!!!"<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"p = "<<p<<endl;
- cout<<"ew = "<<ew<<endl;
- }
- }
- }
- }
- }
-
- // products of both types of correlations:
- TString qProductsForDiffFlowName = "fQProductsForDiffFlow";
- qProductsForDiffFlowName += fAnalysisLabel->Data();
- TProfile *qProductsForDiffFlow[2][2][8][8] = {{{{NULL}}}};
- // products of event weights for both types of correlations:
- TString productOfEventWeightsForDiffFlowName = "fProductOfEventWeightsForDiffFlow";
- productOfEventWeightsForDiffFlowName += fAnalysisLabel->Data();
- TH1D *productOfEventWeightsForDiffFlow[2][2][8][8] = {{{{NULL}}}};
-
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
- {
- for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
- {
- // products of both types of correlations:
- qProductsForDiffFlow[pe][t][mci1][mci2] = dynamic_cast<TProfile*>(diffFlowList->FindObject(Form("%s, %s, %s, %s, %s",qProductsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));
- if(qProductsForDiffFlow[pe][t][mci1][mci2])
- {
- this->SetQProductsForDiffFlow(qProductsForDiffFlow[pe][t][mci1][mci2],pe,t,mci1,mci2);
- } else
- {
- cout<<"WARNING: qProductsForDiffFlow[pe][t][mci1][mci2] is NULL in AFAWFQD::GOH() !!!!"<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"mci1 = "<<mci1<<endl;
- cout<<"mci2 = "<<mci2<<endl;
- }
- // products of event weights for both types of correlations:
- productOfEventWeightsForDiffFlow[pe][t][mci1][mci2] = dynamic_cast<TH1D*>(diffFlowList->FindObject(Form("%s, %s, %s, %s, %s",productOfEventWeightsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));
- if(productOfEventWeightsForDiffFlow[pe][t][mci1][mci2])
- {
- this->SetProductOfEventWeightsForDiffFlow(productOfEventWeightsForDiffFlow[pe][t][mci1][mci2],pe,t,mci1,mci2);
- } else
- {
- cout<<"WARNING: productOfEventWeightsForDiffFlow[pe][t][mci1][mci2] is NULL in AFAWFQD::GOH() !!!!"<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"mci1 = "<<mci1<<endl;
- cout<<"mci2 = "<<mci2<<endl;
- }
-
- if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not accessed here
- }
- }
- }
- }
-
- // profiles and results:
- diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
- diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
- } else
- {
- cout<<"WARNING: diffFlowList is NULL in AFAWQC::GOH() !!!!"<<endl;
- }
-
- // nested list in the list of profiles fDiffFlowListProfiles "Profiles":
- TList *dfpType[2] = {NULL};
- TList *dfpParticleWeights[2][2] = {{NULL}};
- TList *dfpEventWeights[2][2][2] = {{{NULL}}};
- TList *diffFlowCorrelations[2][2][2] = {{{NULL}}};
- TList *diffFlowProductsOfCorrelations[2][2][2] = {{{NULL}}};
- TList *diffFlowCorrectionTerms[2][2][2][2] = {{{{NULL}}}};
-
- if(diffFlowListProfiles)
- {
- for(Int_t t=0;t<2;t++)
- {
- dfpType[t] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(typeFlag[t].Data()));
- if(dfpType[t])
- {
- for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- {
- dfpParticleWeights[t][pW] = dynamic_cast<TList*>(dfpType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));
- if(dfpParticleWeights[t][pW])
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- dfpEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfpParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(dfpEventWeights[t][pW][eW])
- {
- // correlations:
- diffFlowCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- // products of correlations:
- diffFlowProductsOfCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Products of correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- // correction terms:
- for(Int_t sc=0;sc<2;sc++)
- {
- diffFlowCorrectionTerms[t][pW][eW][sc] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Corrections for NUA (%s, pWeights %s, eWeights %s, %s terms)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data())));
- //this->SetDiffFlowCorrectionTerms(diffFlowCorrectionTerms[t][pW][sc],t,pW,sc);
- }
- } else // to if(dfpEventWeights[t][pW][eW])
- {
- cout<<"WARNING: dfpEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- } // end of for(Int_t eW=0;eW<2;eW++)
- } else // to if(dfpParticleWeights[t][pW])
- {
- cout<<"WARNING: dfpParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- }
- } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- } else // if(dfpType[t])
- {
- cout<<"WARNING: dfpType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- }
- } // end of for(Int_t t=0;t<2;t++)
- } else // to if(diffFlowListProfiles)
- {
- cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GOH() !!!!"<<endl;
- }
-
- TProfile2D *correlationsPro[2][2][2][4] = {{{{NULL}}}};
- TProfile2D *productsOfCorrelationsPro[2][2][2][5] = {{{{NULL}}}};
- TProfile2D *correctionTermsPro[2][2][2][2][2] = {{{{{NULL}}}}};
-
- TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};
- TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
- TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};
- TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};
- TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};
- TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};
- TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
- TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
-
- for(Int_t t=0;t<2;t++)
- {
- for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- // correlations:
- if(diffFlowCorrelations[t][pW][eW])
- {
- for(Int_t correlIndex=0;correlIndex<4;correlIndex++)
- {
- correlationsPro[t][pW][eW][correlIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrelations[t][pW][eW]->FindObject(correlationName[correlIndex].Data()));
- if(correlationsPro[t][pW][eW][correlIndex])
- {
- this->SetCorrelationsPro(correlationsPro[t][pW][eW][correlIndex],t,pW,eW,correlIndex);
- } else // to if(correlationsPro[t][pW][ew][correlIndex])
- {
- cout<<"WARNING: correlationsPro[t][pW][eW][correlIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"ci = "<<correlIndex<<endl;
- }
- }
- } else // to if(diffFlowCorrelations[t][pW][eW])
- {
- cout<<"WARNING: diffFlowCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // products of correlations:
- if(diffFlowProductsOfCorrelations[t][pW][eW])
- {
- for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)
- {
- productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = dynamic_cast<TProfile2D*>(diffFlowProductsOfCorrelations[t][pW][eW]->FindObject(productOfCorrelationsName[productOfCorrelationsIndex].Data()));
- if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])
- {
- this->SetProductsOfCorrelationsPro(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex],t,pW,eW,productOfCorrelationsIndex);
- } else // to if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])
- {
- cout<<"WARNING: productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"ci = "<<productOfCorrelationsIndex<<endl;
- }
- }
- } else // to if(diffFlowProductsOfCorrelations[t][pW][eW])
- {
- cout<<"WARNING: diffFlowProductsOfCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // correction terms:
- for(Int_t sc=0;sc<2;sc++)
- {
- if(diffFlowCorrectionTerms[t][pW][eW][sc])
- {
- for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)
- {
- if(sc==0)
- {
- correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsSinTermsName[correctionIndex].Data()));
- if(correctionTermsPro[t][pW][eW][sc][correctionIndex])
- {
- this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);
- } else
- {
- cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"sc = "<<sc<<endl;
- cout<<"ci = "<<correctionIndex<<endl;
- }
- }
- if(sc==1)
- {
- correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsCosTermsName[correctionIndex].Data()));
- if(correctionTermsPro[t][pW][eW][sc][correctionIndex])
- {
- this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);
- } else
- {
- cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"sc = "<<sc<<endl;
- cout<<"ci = "<<correctionIndex<<endl;
- }
- }
- } // end of for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)
- } else // to if(diffFlowCorrectionTerms[t][pW][eW][sc])
- {
- cout<<"WARNING: diffFlowCorrectionTerms[t][pW][eW][sc] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"sc = "<<sc<<endl;
- }
- } // end of for(Int_t sc=0;sc<2;sc++)
- } // end of for(Int_t eW=0;eW<2;eW++)
- } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- } // end of for(Int_t t=0;t<2;t++)
-
- // nested list in the list of results fDiffFlowListResults "Results":
- TList *dfrType[2] = {NULL};
- TList *dfrParticleWeights[2][2] = {{NULL}};
- TList *dfrEventWeights[2][2][2] = {{{NULL}}};
- TList *dfrCorrections[2][2][2][2] = {{{{NULL}}}};
- TList *diffFlowFinalCorrelations[2][2][2] = {{{NULL}}};
- TList *diffFlowFinalCorrections[2][2][2] = {{{NULL}}};
- TList *diffFlowFinalCovariances[2][2][2] = {{{NULL}}};
- TList *diffFlowFinalCumulants[2][2][2][2] = {{{{NULL}}}};
- TList *diffFlowFinalFlow[2][2][2][2] = {{{{NULL}}}};
-
- if(diffFlowListResults)
- {
- for(Int_t t=0;t<2;t++)
- {
- dfrType[t] = dynamic_cast<TList*>(diffFlowListResults->FindObject(typeFlag[t].Data()));
- if(dfrType[t])
- {
- for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- {
- dfrParticleWeights[t][pW] = dynamic_cast<TList*>(dfrType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));
- if(dfrParticleWeights[t][pW])
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- dfrEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfrParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- if(dfrEventWeights[t][pW][eW])
- {
- diffFlowFinalCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- diffFlowFinalCorrections[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Corrections (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- diffFlowFinalCovariances[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Covariances (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
- for(Int_t nua=0;nua<2;nua++)
- {
- dfrCorrections[t][pW][eW][nua] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("%s, pWeights %s, eWeights %s, %s for NUA",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
- if(dfrCorrections[t][pW][eW][nua])
- {
- diffFlowFinalCumulants[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Cumulants (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
- diffFlowFinalFlow[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Differential Flow (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
- } else // to if(dfrCorrections[t][pW][eW][nua])
- {
- cout<<"WARNING: dfrCorrections[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- }
- } // end of for(Int_t nua=0;nua<2;nua++)
- } else // to if(dfrEventWeights[t][pW][eW])
- {
- cout<<"WARNING: dfrEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- } // end of for(Int_t eW=0;eW<2;eW++)
- } else // to if(dfrParticleWeights[t][pW])
- {
- cout<<"WARNING: dfrParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- }
- } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- } else // to if(dfrType[t])
- {
- cout<<"WARNING: dfrType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- }
- } // end of for(Int_t t=0;t<2;t++)
- } else // to if(diffFlowListResults)
- {
- cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GOH() !!!!"<<endl;
- }
-
- TH2D *finalCorrelations2D[2][2][2][4] = {{{{NULL}}}};
- TH1D *finalCorrelations1D[2][2][2][2][4] = {{{{{NULL}}}}};
- TH2D *finalCumulants2D[2][2][2][2][4] = {{{{{NULL}}}}};
- TH1D *finalCumulantsPt[2][2][2][2][4] = {{{{{NULL}}}}};
- TH1D *finalCumulantsEta[2][2][2][2][4] = {{{{{NULL}}}}};
- TH2D *finalCorrections2D[2][2][2][4] = {{{{NULL}}}};
- TH1D *finalCorrections1D[2][2][2][2][4] = {{{{{NULL}}}}};
- TH2D *finalCovariances2D[2][2][2][4] = {{{{NULL}}}};
- TH1D *finalCovariances1D[2][2][2][2][5] = {{{{{NULL}}}}};
- TH2D *finalFlow2D[2][2][2][2][4] = {{{{{NULL}}}}};
- TH1D *finalFlowPt[2][2][2][2][4] = {{{{{NULL}}}}};
- TH1D *finalFlowEta[2][2][2][2][4] = {{{{{NULL}}}}};
- TH2D *nonEmptyBins2D[2] = {NULL};
- //TH1D *nonEmptyBins1D[2][2] = {{NULL}};
-
- for(Int_t t=0;t<2;t++)
- {
- // 2D:
- nonEmptyBins2D[t] = dynamic_cast<TH2D*>(dfrType[t]->FindObject(Form("%s, (p_{t},#eta)",typeFlag[t].Data())));
- if(nonEmptyBins2D[t])
- {
- this->SetNonEmptyBins2D(nonEmptyBins2D[t],t);
- } else
- {
- cout<<"WARNING: nonEmptyBins2D[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- }
- // 1D:
-
- /*
- for(Int_t pe=0;pe<2;pe++)
- {
- nonEmptyBins1D[t][pe] = dynamic_cast<TH1D*>(dfrType[t]->FindObject(Form("%s, %s",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
- if(nonEmptyBins1D[t][pe])
- {
- this->SetNonEmptyBins1D(nonEmptyBins1D[t][pe],t,pe);
- } else
- {
- cout<<"WARNING: nonEmptyBins1D[t][pe] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pe = "<<pe<<endl;
- }
- }
- */
-
- for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- // correlations:
- if(diffFlowFinalCorrelations[t][pW][eW])
- {
- for(Int_t correlIndex=0;correlIndex<4;correlIndex++)
- {
- // 2D:
- finalCorrelations2D[t][pW][eW][correlIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correlationName[correlIndex].Data())));
- if(finalCorrelations2D[t][pW][eW][correlIndex])
- {
- this->SetFinalCorrelations2D(finalCorrelations2D[t][pW][eW][correlIndex],t,pW,eW,correlIndex);
- } else
- {
- cout<<"WARNING: finalCorrelations2D[t][pW][eW][correlIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"ci = "<<correlIndex<<endl;
- }
- // 1D
- for(Int_t pe=0;pe<2;pe++)
- {
- if(pe==0)
- {
- finalCorrelations1D[t][pW][eW][pe][correlIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t})",correlationName[correlIndex].Data())));
- }
- if(pe==1)
- {
- finalCorrelations1D[t][pW][eW][pe][correlIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (#eta)",correlationName[correlIndex].Data())));
- }
- if(finalCorrelations1D[t][pW][eW][pe][correlIndex])
- {
- this->SetFinalCorrelations1D(finalCorrelations1D[t][pW][eW][pe][correlIndex],t,pW,eW,pe,correlIndex);
- } else
- {
- cout<<"WARNING: finalCorrelations1D[t][pW][eW][pe][correlIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"ci = "<<correlIndex<<endl;
- }
- } // end of for(Int_t pe=0;pe<2;pe++)
- } // end of for(Int_t correlIndex=0;correlIndex<4;correlIndex++)
- } else // to if(diffFlowFinalCorrelations[t][pW][eW])
- {
- cout<<"WARNING: diffFlowFinalCorrelations[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // corrections:
- if(diffFlowFinalCorrections[t][pW][eW])
- {
- for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
- {
- // 2D:
- finalCorrections2D[t][pW][eW][correctionIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data())));
- if(finalCorrections2D[t][pW][eW][correctionIndex])
- {
- this->SetFinalCorrections2D(finalCorrections2D[t][pW][eW][correctionIndex],t,pW,eW,correctionIndex);
- } else
- {
- cout<<"WARNING: finalCorrections2D[t][pW][eW][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"ci = "<<correctionIndex<<endl;
- }
- // 1D
- for(Int_t pe=0;pe<2;pe++)
- {
- if(pe==0)
- {
- finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t})",correctionName[correctionIndex].Data())));
- }
- if(pe==1)
- {
- finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (#eta)",correctionName[correctionIndex].Data())));
- }
- if(finalCorrections1D[t][pW][eW][pe][correctionIndex])
- {
- this->SetFinalCorrections1D(finalCorrections1D[t][pW][eW][pe][correctionIndex],t,pW,eW,pe,correctionIndex);
- } else
- {
- cout<<"WARNING: finalCorrections1D[t][pW][eW][pe][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"ci = "<<correctionIndex<<endl;
- }
- } // end of for(Int_t pe=0;pe<2;pe++)
- } // end of for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
- } else // to if(diffFlowFinalCorrections[t][pW][eW])
- {
- cout<<"WARNING: diffFlowFinalCorrections[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
- // covariances:
- if(diffFlowFinalCovariances[t][pW][eW])
- {
- for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
- {
- // 2D:
- finalCovariances2D[t][pW][eW][covarianceIndex] = dynamic_cast<TH2D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data())));
- if(finalCovariances2D[t][pW][eW][covarianceIndex])
- {
- this->SetFinalCovariances2D(finalCovariances2D[t][pW][eW][covarianceIndex],t,pW,eW,covarianceIndex);
- } else
- {
- cout<<"WARNING: finalCovariances2D[t][pW][eW][nua][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"ci = "<<covarianceIndex<<endl;
- }
- // 1D:
- for(Int_t pe=0;pe<2;pe++)
- {
- if(pe==0)
- {
- finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data())));
- }
- if(pe==1)
- {
- finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (#eta)",covarianceName[covarianceIndex].Data())));
- }
- if(finalCovariances1D[t][pW][eW][pe][covarianceIndex])
- {
- this->SetFinalCovariances1D(finalCovariances1D[t][pW][eW][pe][covarianceIndex],t,pW,eW,pe,covarianceIndex);
- } else
- {
- cout<<"WARNING: finalCovariances1D[t][pW][eW][pe][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"ci = "<<covarianceIndex<<endl;
- }
- } // end of for(Int_t pe=0;pe<2;pe++)
- } // end of for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
- } else // to if(diffFlowFinalCovariances[t][pW][eW])
- {
- cout<<"WARNING: diffFlowFinalCovariances[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- }
-
- for(Int_t nua=0;nua<2;nua++)
- {
- // cumulants:
- if(diffFlowFinalCumulants[t][pW][eW][nua])
- {
- for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
- {
- // 2D:
- finalCumulants2D[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH2D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data())));
- if(finalCumulants2D[t][pW][eW][nua][cumulantIndex])
- {
- this->SetFinalCumulants2D(finalCumulants2D[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
- } else
- {
- cout<<"WARNING: finalCumulants2D[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"ci = "<<cumulantIndex<<endl;
- }
- // pt:
- finalCumulantsPt[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data())));
- if(finalCumulantsPt[t][pW][eW][nua][cumulantIndex])
- {
- this->SetFinalCumulantsPt(finalCumulantsPt[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
- } else
- {
- cout<<"WARNING: finalCumulantsPt[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"ci = "<<cumulantIndex<<endl;
- }
- // eta:
- finalCumulantsEta[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",cumulantName[cumulantIndex].Data())));
- if(finalCumulantsEta[t][pW][eW][nua][cumulantIndex])
- {
- this->SetFinalCumulantsEta(finalCumulantsEta[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
- } else
- {
- cout<<"WARNING: finalCumulantsEta[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"ci = "<<cumulantIndex<<endl;
- }
- } // end of for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
- } else // to if(diffFlowFinalCumulants[t][pW][eW][nua])
- {
- cout<<"WARNING: diffFlowFinalCumulants[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- }
- // flow:
- if(diffFlowFinalFlow[t][pW][eW][nua])
- {
- for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
- {
- // 2D:
- finalFlow2D[t][pW][eW][nua][flowIndex] = dynamic_cast<TH2D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data())));
- if(finalFlow2D[t][pW][eW][nua][flowIndex])
- {
- this->SetFinalFlow2D(finalFlow2D[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
- } else
- {
- cout<<"WARNING: finalFlow2D[t][pW][eW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"ci = "<<flowIndex<<endl;
- }
- // pt:
- finalFlowPt[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",flowName[flowIndex].Data())));
- if(finalFlowPt[t][pW][eW][nua][flowIndex])
- {
- this->SetFinalFlowPt(finalFlowPt[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
- } else
- {
- cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"ci = "<<flowIndex<<endl;
- }
- // eta:
- finalFlowEta[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",flowName[flowIndex].Data())));
- if(finalFlowEta[t][pW][eW][nua][flowIndex])
- {
- this->SetFinalFlowEta(finalFlowEta[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
- } else
- {
- cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"ci = "<<flowIndex<<endl;
- }
- } // end of for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
- } else // to if(diffFlowFinalFlow[t][pW][eW][nua])
- {
- cout<<"WARNING: diffFlowFinalFlow[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- }
- } // end of for(Int_t nua=0;nua<2;nua++)
- } // end of for(Int_t eW=0;eW<2;eW++)
- } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
- } // end of for(Int_t t=0;t<2;t++)
-
- // x.) nested loops:
- TList *nestedLoopsList = dynamic_cast<TList*>(outputListHistos->FindObject("Nested Loops"));
- if(nestedLoopsList) this->SetNestedLoopsList(nestedLoopsList);
- TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fEvaluateNestedLoops"));
- Bool_t bEvaluateNestedLoopsForIntFlow = kFALSE;
- Bool_t bEvaluateNestedLoopsForDiffFlow = kFALSE;
- if(evaluateNestedLoops)
- {
- this->SetEvaluateNestedLoops(evaluateNestedLoops);
- bEvaluateNestedLoopsForIntFlow = (Int_t)evaluateNestedLoops->GetBinContent(1);
- bEvaluateNestedLoopsForDiffFlow = (Int_t)evaluateNestedLoops->GetBinContent(2);
- }
-
- if(bEvaluateNestedLoopsForIntFlow)
- {
- TProfile *directCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelation"));
- if(directCorrelations) this->SetDirectCorrelations(directCorrelations);
- TProfile *directCorrectionsCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCos"));
- if(directCorrectionsCos) this->SetDirectCorrectionsCos(directCorrectionsCos);
- TProfile *directCorrectionsSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSin"));
- if(directCorrectionsSin) this->SetDirectCorrectionsSin(directCorrectionsSin);
- if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)
- {
- TProfile *directCorrelationsW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationW"));
- if(directCorrelationsW) this->SetDirectCorrelationsW(directCorrelationsW);
- TProfile *directCorrectionsCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCosW"));
- if(directCorrectionsCosW) this->SetDirectCorrectionsCosW(directCorrectionsCosW);
- TProfile *directCorrectionsSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSinW"));
- if(directCorrectionsSinW) this->SetDirectCorrectionsSinW(directCorrectionsSinW);
- }
- }
-
- if(bEvaluateNestedLoopsForDiffFlow)
- {
- TProfile *directCorrelationsDiffFlow = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlow"));
- if(directCorrelationsDiffFlow) this->SetDirectCorrelationsDiffFlow(directCorrelationsDiffFlow);
- TProfile *directCorrectionsDiffFlowCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCos"));
- if(directCorrectionsDiffFlowCos) this->SetDirectCorrectionsDiffFlowCos(directCorrectionsDiffFlowCos);
- TProfile *directCorrectionsDiffFlowSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSin"));
- if(directCorrectionsDiffFlowSin) this->SetDirectCorrectionsDiffFlowSin(directCorrectionsDiffFlowSin);
- if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)
- {
- TProfile *directCorrelationsDiffFlowW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlowW"));
- if(directCorrelationsDiffFlowW) this->SetDirectCorrelationsDiffFlowW(directCorrelationsDiffFlowW);
- TProfile *directCorrectionsDiffFlowCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCosW"));
- if(directCorrectionsDiffFlowCosW) this->SetDirectCorrectionsDiffFlowCosW(directCorrectionsDiffFlowCosW);
- TProfile *directCorrectionsDiffFlowSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSinW"));
- if(directCorrectionsDiffFlowSinW) this->SetDirectCorrectionsDiffFlowSinW(directCorrectionsDiffFlowSinW);
- }
- }
-
- }
-}
-
-
-//================================================================================================================================
-
-
-TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
-{
- // project 2D profile onto pt axis to get 1D profile
-
- Int_t nBinsPt = profilePtEta->GetNbinsX();
- Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
- Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
-
- Int_t nBinsEta = profilePtEta->GetNbinsY();
-
- TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
-
- for(Int_t p=1;p<=nBinsPt;p++)
- {
- Double_t contentPt = 0.;
- Double_t entryPt = 0.;
- Double_t spreadPt = 0.;
- Double_t sum1 = 0.;
- Double_t sum2 = 0.;
- Double_t sum3 = 0.;
- for(Int_t e=1;e<=nBinsEta;e++)
- {
- contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
- * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
- entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
-
- sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
- * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
- + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
- sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
- sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
- * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
- }
- if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
- {
- spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
- }
- profilePt->SetBinContent(p,contentPt);
- profilePt->SetBinEntries(p,entryPt);
- {
- profilePt->SetBinError(p,spreadPt);
- }
-
- }
-
- return profilePt;
-
-} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
-
-
-//================================================================================================================================
-
-
-TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
-{
- // project 2D profile onto eta axis to get 1D profile
-
- Int_t nBinsEta = profilePtEta->GetNbinsY();
- Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
- Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
-
- Int_t nBinsPt = profilePtEta->GetNbinsX();
-
- TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
-
- for(Int_t e=1;e<=nBinsEta;e++)
- {
- Double_t contentEta = 0.;
- Double_t entryEta = 0.;
- for(Int_t p=1;p<=nBinsPt;p++)
- {
- contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
- * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
- entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
- }
- profileEta->SetBinContent(e,contentEta);
- profileEta->SetBinEntries(e,entryEta);
- }
-
- return profileEta;
-
-} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-{
- // calculate final corrections for non-uniform acceptance for QC{2}, QC{4}, QC{6} and QC{8}
-
- // corrections for non-uniform acceptance (NUA) are stored in histogram fCorrectionsForNUA,
- // binning of fCorrectionsForNUA is organized as follows:
- //
- // 1st bin: correction to QC{2}
- // 2nd bin: correction to QC{4}
- // 3rd bin: correction to QC{6}
- // 4th bin: correction to QC{8}
-
- // shortcuts flags:
- Int_t pW = (Int_t)(useParticleWeights);
-
- Int_t eW = -1;
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
- {
- if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
- {
- cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"sc = "<<sc<<endl;
- exit(0);
- }
- }
-
- // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
- Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
- //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
- //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
- //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
-
- // correction terms to QC{2}:
- // <<cos(n*phi1)>>^2
- Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
- // <<sin(n*phi1)>>^2
- Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
- // final corrections for non-uniform acceptance to QC{2}:
- Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
- fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
-
- // correction terms to QC{4}:
- // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
- Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
- // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
- Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
- // <<cos(n*(phi1+phi2))>>^2
- Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
- // <<sin(n*(phi1+phi2))>>^2
- Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
- // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
- Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
- * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
- // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
- Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
- * fQCorrections[pW][eW][1]->GetBinContent(1)
- * fQCorrections[pW][eW][0]->GetBinContent(1);
- // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
- Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
- // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
- Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
- // final correction to QC{4}:
- Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
- + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
- fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
-
- // ... to be improved (continued for 6th and 8th order)
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)
-{
-
- useParticleWeights=kFALSE;
- type="ac";
-
- // calculate final corrections due to non-uniform acceptance of the detector to reduced multi-particle correlations
- /*
- if(!(useParticleWeights))
- {
- if(type == "POI")
- {
- // **** corrections for non-uniform acceptance for 2nd order QC' for POI's ****
-
- // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:
- if(fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos)
- {
- // pt,eta:
- if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Reset(); // to be improved
- TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaPOI->ProjectionXY("","e")));
- correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)
- delete correctionPtEta1stTerm;
- // pt:
- if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Reset(); // to be improved
- TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)
- delete correctionPt1stTerm;
- // eta:
- if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Reset(); // to be improved
- TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)
- delete correctionEta1stTerm;
- } else
- {
- cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos && f2pFinalCorrectionsForNUAPtEtaPOI) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
- cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
- }
-
- // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>:
- if(fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin)
- {
- // pt,eta:
- TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaPOI->ProjectionXY("","e")));
- correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)
- delete correctionPtEta2ndTerm;
- // pt:
- TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)
- delete correctionPt2ndTerm;
- // eta:
- TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)
- delete correctionEta2ndTerm;
- } else
- {
- cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
- cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
- }
- } else if(type == "RP")
- {
- // **** corrections for non-uniform acceptance for 2nd order QC' for RP's ****
-
- // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:
- if(fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos)
- {
- // pt,eta:
- if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Reset(); // to be improved
- TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaRP->ProjectionXY("","e")));
- correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)
- delete correctionPtEta1stTerm;
- // pt:
- if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Reset(); // to be improved
- TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)
- delete correctionPt1stTerm;
- // eta:
- if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Reset(); // to be improved
- TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)
- delete correctionEta1stTerm;
- } else
- {
- cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
- cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
- }
- // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>:
- if(fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin)
- {
- // pt,eta:
- TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaRP->ProjectionXY("","e")));
- correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)
- delete correctionPtEta2ndTerm;
- // pt:
- TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)
- delete correctionPt2ndTerm;
- // eta:
- TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
- correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
- if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)
- delete correctionEta2ndTerm;
- } else
- {
- cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
- cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
- }
- } else // to else if(type == "RP")
- {
- cout<<"WARNING: Type must be either POI or RP in QC::CFCFNUAFDF() !!!! "<<endl;
- cout<<" Corrections for non-uniform acceptance for differential flow were not calculated."<<endl;
- }
- } else // to if(!(useParticleWeights))
- {
- // ...
- }
- */
-} // end of AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)
-
-
-//==================================================================================================================================
-
-/*
-void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(
- TH2D *flowPtEta, TH1D *flowPt, TH1D *flowEta,
- TProfile2D *profile2ndPtEta, TProfile2D *profile4thPtEta,
- TProfile2D *profile6thPtEta, TProfile2D *profile8thPtEta)
-{
- // calculate and store the final results for integrated flow
-
- TString *namePtEta = new TString();
- TString *type = new TString();
- TString *order2nd = new TString();
- TString *order4th = new TString();
- TString *order6th = new TString();
- TString *order8th = new TString();
- TString *pW = new TString();
-
- if(profile2ndPtEta) *namePtEta = profile2ndPtEta->GetName();
- if(namePtEta->Contains("POI")) *type = "POI";
- if(namePtEta->Contains("RP")) *type = "RP";
- if(namePtEta->Contains("W")) *pW = "W";
- if(namePtEta->Contains("2")) *order2nd = "2";
- if(profile4thPtEta) *namePtEta = profile4thPtEta->GetName();
- if(namePtEta->Contains("4")) *order4th = "4";
-
- if(profile6thPtEta) *namePtEta = profile6thPtEta->GetName();
- if(namePtEta->Contains("6")) *order6th = "6";
-
- if(profile8thPtEta) *namePtEta = profile8thPtEta->GetName();
- if(namePtEta->Contains("8")) *order8th = "8";
-
- TProfile *profile2ndPt = NULL;
- TProfile *profile4thPt = NULL;
- TProfile *profile6thPt = NULL;
- TProfile *profile8thPt = NULL;
-
- TProfile *profile2ndEta = NULL;
- TProfile *profile4thEta = NULL;
- TProfile *profile6thEta = NULL;
- TProfile *profile8thEta = NULL;
-
- if(*order2nd == "2")
- {
- profile2ndPt = new TProfile(*(this->MakePtProjection(profile2ndPtEta)));
- profile2ndEta = new TProfile(*(this->MakeEtaProjection(profile2ndPtEta)));
- if(*order4th == "4")
- {
- profile4thPt = new TProfile(*(this->MakePtProjection(profile4thPtEta)));
- profile4thEta = new TProfile(*(this->MakeEtaProjection(profile4thPtEta)));
- if(*order6th == "6")
- {
- profile6thPt = new TProfile(*(this->MakePtProjection(profile6thPtEta)));
- profile6thEta = new TProfile(*(this->MakeEtaProjection(profile6thPtEta)));
- if(*order8th == "8")
- {
- profile8thPt = new TProfile(*(this->MakePtProjection(profile8thPtEta)));
- profile8thEta = new TProfile(*(this->MakeEtaProjection(profile8thPtEta)));
- }
- }
- }
- }
-
- Int_t nBinsPt = profile2ndPt->GetNbinsX();
- Int_t nBinsEta = profile2ndEta->GetNbinsX();
-
- Double_t dV2 = 0.;
- Double_t dV4 = 0.;
- Double_t dV6 = 0.;
- Double_t dV8 = 0.;
-
- if(!(*pW == "W"))
- {
- dV2 = fIntFlowResultsQC->GetBinContent(1);
- dV4 = fIntFlowResultsQC->GetBinContent(2);
- dV6 = fIntFlowResultsQC->GetBinContent(3);
- dV8 = fIntFlowResultsQC->GetBinContent(4);
- }
- else if(*pW == "W")
- {
- dV2 = fIntFlowResultsQCW->GetBinContent(1);
- dV4 = fIntFlowResultsQCW->GetBinContent(2);
- dV6 = fIntFlowResultsQCW->GetBinContent(3);
- dV8 = fIntFlowResultsQCW->GetBinContent(4);
- }
-
- // 3D (pt,eta):
- Double_t twoPrimePtEta = 0.; // <<2'>> (pt,eta)
- Double_t fourPrimePtEta = 0.; // <<4'>> (pt,eta)
- //Double_t sixPrimePtEta = 0.; // <<6'>> (pt,eta)
- //Double_t eightPrimePtEta = 0.; // <<8'>> (pt,eta)
- Double_t secondOrderDiffFlowCumulantPtEta = 0.; // d_n{2,Q} (pt,eta)
- Double_t fourthOrderDiffFlowCumulantPtEta = 0.; // d_n{4,Q} (pt,eta)
- //Double_t sixthOrderDiffFlowCumulantPtEta = 0.; // d_n{6,Q} (pt,eta)
- //Double_t eightOrderDiffFlowCumulantPtEta = 0.; // d_n{8,Q} (pt,eta)2nd
- Double_t dv2PtEta = 0.; // v'_n{2} (pt,eta)
- Double_t dv4PtEta = 0.; // v'_n{4} (pt,eta)
- //Double_t dv6PtEta = 0.; // v'_n{6} (pt,eta)
- //Double_t dv8PtEta = 0.; // v'_n{8} (pt,eta)
-
- // 2D (pt):
- Double_t twoPrimePt = 0.; // <<2'>> (pt)
- Double_t fourPrimePt = 0.; // <<4'>> (pt)
- //Double_t sixPrimePt = 0.; // <<6'>> (pt)
- //Double_t eightPrimePt = 0.; // <<8'>> (pt)
- Double_t secondOrderDiffFlowCumulantPt = 0.; // d_n{2,Q} (pt)
- Double_t fourthOrderDiffFlowCumulantPt = 0.; // d_n{4,Q} (pt)
- //Double_t sixthOrderDiffFlowCumulantPt = 0.; // d_n{6,Q} (pt)
- //Double_t eightOrderDiffFlowCumulantPt = 0.; // d_n{8,Q} (pt)
- Double_t dv2Pt = 0.; // v'_n{2} (pt)
- Double_t dv4Pt = 0.; // v'_n{4} (pt)
- //Double_t dv6Pt = 0.; // v'_n{6} (pt)
- //Double_t dv8Pt = 0.; // v'_n{8} (pt)
-
- // 2D (eta):
- Double_t twoPrimeEta = 0.; // <<2'>> (eta)
- Double_t fourPrimeEta = 0.; // <<4>> (eta)
- //Double_t sixPrimeEta = 0.; // <<6>> (eta)
- //Double_t eightPrimeEta = 0.; // <<8'>> (eta)
- Double_t secondOrderDiffFlowCumulantEta = 0.; // d_n{2,Q} (eta)
- Double_t fourthOrderDiffFlowCumulantEta = 0.; // d_n{4,Q} (eta)
- //Double_t sixthOrderDiffFlowCumulantEta = 0.; // d_n{6,Q} (eta)
- //Double_t eightOrderDiffFlowCumulantEta = 0.; // d_n{8,Q} (eta)
- Double_t dv2Eta = 0.; // v'_n{2} (eta)
- Double_t dv4Eta = 0.; // v'_n{4} (eta)
- //Double_t dv6Eta = 0.; // v'_n{6} (eta)
- //Double_t dv8Eta = 0.; // v'_n{8} (eta)
-
-
- // looping over (pt,eta) bins to calculate v'(pt,eta)
- for(Int_t p=1;p<nBinsPt+1;p++)
- {
- for(Int_t e=1;e<nBinsEta+1;e++)
- {
-
- // 2nd order:
- twoPrimePtEta = profile2ndPtEta->GetBinContent(profile2ndPtEta->GetBin(p,e));
- secondOrderDiffFlowCumulantPtEta = twoPrimePtEta;
-
-
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- // to be improved (applying correction for NUA):
- if(namePtEta->Contains("POI"))
- {
- if(f2pFinalCorrectionsForNUAPtEtaPOI) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta
- - f2pFinalCorrectionsForNUAPtEtaPOI->GetBinContent(f2pFinalCorrectionsForNUAPtEtaPOI->GetBin(p,e)) ;
- } else if (namePtEta->Contains("RP"))
- {
- if(f2pFinalCorrectionsForNUAPtEtaRP) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta
- - f2pFinalCorrectionsForNUAPtEtaRP->GetBinContent(f2pFinalCorrectionsForNUAPtEtaRP->GetBin(p,e));
- }
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
-
- if(dV2)
- {
- dv2PtEta = secondOrderDiffFlowCumulantPtEta/dV2;
- if(*order2nd == "2")
- {
- flowPtEta->SetBinContent(p,e,dv2PtEta);
- }
- }
-
- // 4th order:
- if(*order4th == "4" || *order6th == "6" || *order8th == "8")
- {
- fourPrimePtEta = profile4thPtEta->GetBinContent(profile4thPtEta->GetBin(p,e));
- fourthOrderDiffFlowCumulantPtEta = fourPrimePtEta - 2.*twoPrimePtEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
- if(dV4)
- {
- dv4PtEta = -fourthOrderDiffFlowCumulantPtEta/pow(dV4,3);
- if(*order4th == "4")
- {
- flowPtEta->SetBinContent(p,e,dv4PtEta);
- }
- }
- }
-
- } // end of for(Int_t e=1;e<nBinsEta+1;e++)
- } // end of for(Int_t p=1;p<nBinsPt+1;p++)
-
-
- // looping over (pt) bins to calcualate v'(pt)
- for(Int_t p=1;p<nBinsPt+1;p++)
- {
-
- // 2nd order:
- twoPrimePt = profile2ndPt->GetBinContent(p);
- secondOrderDiffFlowCumulantPt = twoPrimePt;
-
-
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- // to be improved (applying correction for NUA):
- if(namePtEta->Contains("POI"))
- {
- if(f2pFinalCorrectionsForNUAPtPOI) secondOrderDiffFlowCumulantPt = twoPrimePt
- - f2pFinalCorrectionsForNUAPtPOI->GetBinContent(p) ;
- } else if (namePtEta->Contains("RP"))
- {
- if(f2pFinalCorrectionsForNUAPtRP) secondOrderDiffFlowCumulantPt = twoPrimePt
- - f2pFinalCorrectionsForNUAPtRP->GetBinContent(p);
- }
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
-
- if(dV2)
- {
- dv2Pt = secondOrderDiffFlowCumulantPt/dV2;
- if(*order2nd == "2")
- {
- flowPt->SetBinContent(p,dv2Pt);
- }
-
- // common control histos: (to be improved fill only once. now they are filled first without weights and then with weights):
- if(namePtEta->Contains("POI") && *order2nd == "2")
- {
- fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)
- }
- else if(namePtEta->Contains("RP") && *order2nd == "2")
- {
- fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)
- }
-
- }
-
- // 4th order:
- if(*order4th == "4" || *order6th == "6" || *order8th == "8")
- {
- fourPrimePt = profile4thPt->GetBinContent(profile4thPt->GetBin(p));
- fourthOrderDiffFlowCumulantPt = fourPrimePt - 2.*twoPrimePt*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
- if(dV4)
- {
- dv4Pt = -fourthOrderDiffFlowCumulantPt/pow(dV4,3);
- if(*order4th == "4")
- {
- flowPt->SetBinContent(p,dv4Pt);
- }
-
- // common control histos: (to be improved):
- if(namePtEta->Contains("POI") && *order4th == "4")
- {
- fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)
- }
- else if(namePtEta->Contains("RP") && *order4th == "4" )
- {
- fCommonHistsResults4th->FillDifferentialFlowPtRP(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)
- }
-
- }
- }
-
- } // end of for(Int_t p=1;p<nBinsPt+1;p++)
-
-
- // looping over (eta) bins to calcualate v'(eta)
- for(Int_t e=1;e<nBinsEta+1;e++)
- {
-
- // 2nd order:
- twoPrimeEta = profile2ndEta->GetBinContent(e);
- secondOrderDiffFlowCumulantEta = twoPrimeEta;
-
-
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- // to be improved (applying correction for NUA):
- if(namePtEta->Contains("POI"))
- {
- if(f2pFinalCorrectionsForNUAEtaPOI) secondOrderDiffFlowCumulantEta = twoPrimeEta
- - f2pFinalCorrectionsForNUAEtaPOI->GetBinContent(e) ;
- } else if (namePtEta->Contains("RP"))
- {
- if(f2pFinalCorrectionsForNUAEtaRP) secondOrderDiffFlowCumulantEta = twoPrimeEta
- - f2pFinalCorrectionsForNUAEtaRP->GetBinContent(e);
- }
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
-
- if(dV2)
- {
- dv2Eta = secondOrderDiffFlowCumulantEta/dV2;
- if(*order2nd == "2")
- {
- flowEta->SetBinContent(e,dv2Eta);
- }
-
- // common control histos: (to be improved):
- if(namePtEta->Contains("POI") && *order2nd == "2")
- {
- fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)
- }
- else if(namePtEta->Contains("RP") && *order2nd == "2")
- {
- fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)
- }
-
-
- }
-
- // 4th order:
- if(*order4th == "4" || *order6th == "6" || *order8th == "8")
- {
- fourPrimeEta = profile4thEta->GetBinContent(profile4thEta->GetBin(e));
- fourthOrderDiffFlowCumulantEta = fourPrimeEta - 2.*twoPrimeEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
- if(dV4)
- {
- dv4Eta = -fourthOrderDiffFlowCumulantEta/pow(dV4,3);
- if(*order4th == "4")
- {
- flowEta->SetBinContent(e,dv4Eta);
- }
-
- // common control histos: (to be improved):
- if(namePtEta->Contains("POI") && *order4th == "4")
- {
- fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)
- }
- else if(namePtEta->Contains("RP") && *order4th == "4")
- {
- fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)
- }
-
- }
- }
-
- } // end of for(Int_t e=1;e<nBinsEta+1;e++)
-
- delete namePtEta;
- delete type;
- delete order2nd;
- delete order4th;
- delete order6th;
- delete order8th;
- delete pW;
- delete profile2ndPt;
- delete profile4thPt;
- delete profile6thPt;
- delete profile8thPt;
- delete profile2ndEta;
- delete profile4thEta;
- delete profile6thEta;
- delete profile8thEta;
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(Bool_t useParticleWeights, TString type)
-*/
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
-{
- // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME)
-
- Int_t n = fHarmonic;
-
- if(type == "NONAME" || type == "RP" || type == "POI")
- {
- if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
- {
- cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
- cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;
- }
- } else
- {
- cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;
- exit(0);
- }
-
- Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
- Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
-
- if(type == "NONAME")
- {
- dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
- dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
- dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
- dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
- dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
- dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
- dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
- dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
- } else if(type == "RP")
- {
- dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
- dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
- dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
- dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
- dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
- dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
- dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
- dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
- } else if(type == "POI")
- {
- dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
- dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
- dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
- dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
- dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
- dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
- dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
- dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
- }
-
- TString title = " flow estimates from Q-cumulants";
- TString subtitle = " (";
-
- if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
- {
- subtitle.Append(type);
- subtitle.Append(", without weights)");
- } else
- {
- subtitle.Append(type);
- subtitle.Append(", with weights)");
- }
-
- cout<<endl;
- cout<<"*************************************"<<endl;
- cout<<"*************************************"<<endl;
- cout<<title.Data()<<endl;
- cout<<subtitle.Data()<<endl;
- cout<<endl;
-
- for(Int_t i=0;i<4;i++)
- {
- if(dVn[i]>=0.)
- {
- cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
- }
- else
- {
- cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;
- }
- }
-
- cout<<endl;
- /*
- if(type == "NONAME")
- {
- cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved
- }
- else if (type == "RP")
- {
- cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved
- }
- else if (type == "POI")
- {
- cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved
- }
- */
- cout<<"*************************************"<<endl;
- cout<<"*************************************"<<endl;
- cout<<endl;
-
-}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(Bool_t useParticleWeights)
-{
- // compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
-
- cout<<endl;
- cout<<" *************************************"<<endl;
- cout<<" **** cross-checking the formulas ****"<<endl;
- cout<<" **** for differential flow ****"<<endl;
- cout<<" **** ****"<<endl;
- cout<<" **** (pt,eta) bin: ****"<<endl;
- cout<<" **** 1.1 < pt < 1.2 GeV ****"<<endl;
- cout<<" **** -0.55 < eta < -0.525 ****"<<endl;
- cout<<" *************************************"<<endl;
- cout<<endl;
-
- if(!useParticleWeights)
- {
- cout<<"<cos(n(psi1-phi2))> from Q-vectors = "<<fCorrelationsPro[0][0][0][0]->GetBinContent(fCorrelationsPro[0][0][0][0]->GetBin(12,19))<<endl;
- cout<<"<cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(1)<<endl;
- cout<<endl;
- cout<<"<cos(n(psi1+phi2-phi3-phi4))> from Q-vectors = "<<fCorrelationsPro[0][0][0][1]->GetBinContent(fCorrelationsPro[0][0][0][1]->GetBin(12,19))<<endl;
- cout<<"<cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(41)<<endl;
- cout<<endl;
- cout<<"****************************************************"<<endl;
- cout<<"****************************************************"<<endl;
- cout<<endl;
- /*
- cout<<"<cos(n(psi1))> from Q-vectors = "<<fCorrectionsCosP1nPsiPtEtaPOI->GetBinContent(fCorrectionsCosP1nPsiPtEtaPOI->GetBin(12,19))<<endl;
- cout<<"<cos(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowCos->GetBinContent(1)<<endl;
- cout<<endl;
- cout<<"<sin(n(psi1))> from Q-vectors = "<<fCorrectionsSinP1nPsiPtEtaPOI->GetBinContent(fCorrectionsSinP1nPsiPtEtaPOI->GetBin(12,19))<<endl;
- cout<<"<sin(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowSin->GetBinContent(1)<<endl;
- cout<<endl;
- */
- }
-
- if(useParticleWeights)
- {
- cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][0]->GetBinContent(fCorrelationsPro[0][1][0][0]->GetBin(12,19))<<endl;
- cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][0]->GetBinContent(fCorrelationsPro[1][1][0][0]->GetBin(12,19))<<endl;
- cout<<"<w2 cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(1)<<endl;
- cout<<endl;
- cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][1]->GetBinContent(fCorrelationsPro[0][1][0][1]->GetBin(12,19))<<endl;
- cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][1]->GetBinContent(fCorrelationsPro[1][1][0][1]->GetBin(12,19))<<endl;
- cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(41)<<endl;
- cout<<endl;
- }
-
-} // end of void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
-{
- //store the final results in output .root file
- TFile *output = new TFile(outputFileName.Data(),"RECREATE");
- //output->WriteObject(fHistList, "cobjQC","SingleKey");
- fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
- delete output;
-}
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
-{
- // book common control histograms and common histograms for final results
-
- // common control histogram (ALL events)
- fCommonHists = new AliFlowCommonHist("AliFlowCommonHistQC");
- fHistList->Add(fCommonHists);
-
- // common control histogram (for events with 2 and more particles)
- fCommonHists2nd = new AliFlowCommonHist("AliFlowCommonHist2ndOrderQC");
- fHistList->Add(fCommonHists2nd);
-
- // common control histogram (for events with 4 and more particles)
- fCommonHists4th = new AliFlowCommonHist("AliFlowCommonHist4thOrderQC");
- fHistList->Add(fCommonHists4th);
-
- // common control histogram (for events with 6 and more particles)
- fCommonHists6th = new AliFlowCommonHist("AliFlowCommonHist6thOrderQC");
- fHistList->Add(fCommonHists6th);
-
- // common control histogram (for events with 8 and more particles)
- fCommonHists8th = new AliFlowCommonHist("AliFlowCommonHist8thOrderQC");
- fHistList->Add(fCommonHists8th);
-
- // common histograms for final results (calculated for events with 2 and more particles)
- fCommonHistsResults2nd = new AliFlowCommonHistResults("AliFlowCommonHistResults2ndOrderQC");
- fHistList->Add(fCommonHistsResults2nd);
-
- // common histograms for final results (calculated for events with 4 and more particles)
- fCommonHistsResults4th = new AliFlowCommonHistResults("AliFlowCommonHistResults4thOrderQC");
- fHistList->Add(fCommonHistsResults4th);
-
- // common histograms for final results (calculated for events with 6 and more particles)
- fCommonHistsResults6th = new AliFlowCommonHistResults("AliFlowCommonHistResults6thOrderQC");
- fHistList->Add(fCommonHistsResults6th);
-
- // common histograms for final results (calculated for events with 8 and more particles)
- fCommonHistsResults8th = new AliFlowCommonHistResults("AliFlowCommonHistResults8thOrderQC");
- fHistList->Add(fCommonHistsResults8th);
-
-} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
-{
- // book and fill histograms which hold phi, pt and eta weights
-
- if(!fWeightsList)
- {
- cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
- exit(0);
- }
-
- TString fUseParticleWeightsName = "fUseParticleWeightsQC";
- fUseParticleWeightsName += fAnalysisLabel->Data();
- fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
- fUseParticleWeights->SetLabelSize(0.06);
- (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
- (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
- (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
- fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
- fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
- fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
- fWeightsList->Add(fUseParticleWeights);
-
- if(fUsePhiWeights)
- {
- if(fWeightsList->FindObject("phi_weights"))
- {
- fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
- if(fPhiWeights->GetBinWidth(1) != fPhiBinWidth)
- {
- cout<<"WARNING: fPhiWeights->GetBinWidth(1) != fPhiBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
- cout<<" This indicates inconsistent binning in phi histograms throughout the code."<<endl;
- exit(0);
- }
- } else
- {
- cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
- exit(0);
- }
- } // end of if(fUsePhiWeights)
-
- if(fUsePtWeights)
- {
- if(fWeightsList->FindObject("pt_weights"))
- {
- fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
- if(fPtWeights->GetBinWidth(1) != fPtBinWidth)
- {
- cout<<"WARNING: fPtWeights->GetBinWidth(1) != fPtBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
- cout<<" This indicates insconsistent binning in pt histograms throughout the code."<<endl;
- exit(0);
- }
- } else
- {
- cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
- exit(0);
- }
- } // end of if(fUsePtWeights)
-
- if(fUseEtaWeights)
- {
- if(fWeightsList->FindObject("eta_weights"))
- {
- fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
- if(fEtaWeights->GetBinWidth(1) != fEtaBinWidth)
- {
- cout<<"WARNING: fEtaWeights->GetBinWidth(1) != fEtaBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
- cout<<" This indicates insconsistent binning in eta histograms throughout the code."<<endl;
- exit(0);
- }
- } else
- {
- cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
- exit(0);
- }
- } // end of if(fUseEtaWeights)
-
-} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
-{
- // book all objects for integrated flow
-
- // a) common;
- // b) profiles;
- // c) results;
-
- // ****************
- // **** COMMON ****
- // ****************
-
- // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
- fReQ = new TMatrixD(4,9);
- fImQ = new TMatrixD(4,9);
- fSMpk = new TMatrixD(8,9);
-
- // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
- fAvMultiplicity = new TProfile("fAvMultiplicity","Average Multiplicities of RPs",9,0,9);
- fAvMultiplicity->SetTickLength(-0.01,"Y");
- fAvMultiplicity->SetMarkerStyle(25);
- fAvMultiplicity->SetLabelSize(0.05);
- fAvMultiplicity->SetLabelOffset(0.02,"Y");
- fAvMultiplicity->SetYTitle("Average Multiplicity");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
- (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
- fIntFlowProfiles->Add(fAvMultiplicity);
-
- TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
- TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
- TString nuaFlag[2] = {"not corrected","corrected"};
- TString sinCosFlag[2] = {"sin","cos"};
- TString powerFlag[2] = {"linear","quadratic"};
-
- for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
- {
- // ***************
- // **** E-B-E ****
- // ***************
-
- // average multiparticle correlations for single event calculated from Q-vectors
- // (Remark: binning is organized in the same way as in fQCorrelations[pW][eW] bellow):
- fQCorrelationsEBE[pW] = new TH1D(Form("fQCorrelationsEBE: %s",pWeightsFlag[pW].Data()),Form("Average multi-particle correlations for single event calculated from Q-vectors (%s)",pWeightsFlag[pW].Data()),32,0,32);
-
- for(Int_t sc=0;sc<2;sc++)
- {
- // correction terms for non-uniform acceptance for single event calculated from Q-vectors
- // (Remark: binning is organized in the same way as in fQCorrections[pW][sc]):
- fQCorrectionsEBE[pW][sc] = new TH1D(Form("fQCorrectionsEBE: %s, %s terms",pWeightsFlag[pW].Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance for single event (%s, %s terms)",pWeightsFlag[pW].Data(),sinCosFlag[sc].Data()),10,0,10);
- }
-
- for(Int_t eW=0;eW<2;eW++)
- {
- // ******************
- // **** PROFILES ****
- // ******************
-
- // final average multiparticle correlations for all events calculated from Q-vectors:
- fQCorrelations[pW][eW] = new TProfile(Form("fQCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Final average multi-particle correlations calculated from Q-vectors (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),32,0,32,"s");
- fQCorrelations[pW][eW]->SetTickLength(-0.01,"Y");
- fQCorrelations[pW][eW]->SetMarkerStyle(25);
- fQCorrelations[pW][eW]->SetLabelSize(0.03);
- fQCorrelations[pW][eW]->SetLabelOffset(0.01,"Y");
- // 2-p correlations:
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
- // 3-p correlations:
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
- // 4-p correlations:
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
- // 5-p correlations:
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
- // 6-p correlations:
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
- // 7-p correlations:
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
- // 8-p correlations:
- (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
- // add fQCorrelations[0] to the list fIntFlowList:
- fIntFlowProfiles->Add(fQCorrelations[pW][eW]);
-
- // averages <<2><4>>, <<2><6>>, <<4><6>>, etc, needed to calculate covariances:
- fQProducts[pW][eW] = new TProfile(Form("fQProducts: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Averages of products (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
- fQProducts[pW][eW]->SetTickLength(-0.01,"Y");
- fQProducts[pW][eW]->SetMarkerStyle(25);
- fQProducts[pW][eW]->SetLabelSize(0.05);
- fQProducts[pW][eW]->SetLabelOffset(0.01,"Y");
- (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2><4>>");
- (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2><6>>");
- (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2><8>>");
- (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(4,"<<4><6>>");
- (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(5,"<<4><8>>");
- (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(6,"<<6><8>>");
- fIntFlowProfiles->Add(fQProducts[pW][eW]);
-
- for(Int_t sc=0;sc<2;sc++)
- {
- // final average correction terms for non-uniform acceptance calculated from Q-vectors:
- fQCorrections[pW][eW][sc] = new TProfile(Form("fQCorrections: %s, %s, %s terms",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s, %s, %s terms)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()),10,0,10,"s");
- fQCorrections[pW][eW][sc]->SetTickLength(-0.01,"Y");
- fQCorrections[pW][eW][sc]->SetMarkerStyle(25);
- fQCorrections[pW][eW][sc]->SetLabelSize(0.03);
- fQCorrections[pW][eW][sc]->SetLabelOffset(0.01,"Y");
- // .........................................................................
- // 1-p terms:
- (fQCorrections[pW][eW][sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
- // 2-p terms:
- // 3-p terms:
- // ...
- // .........................................................................
- // add fQCorrectionsCos to the list fIntFlowList:
- fIntFlowProfiles->Add(fQCorrections[pW][eW][sc]);
- } // end of for(Int_t sc=0;sc<2;sc++)
-
- // *****************
- // **** RESULTS ****
- // *****************
-
- // final results for average multi-particle correlations with correct statistical errors:
- fCorrelations[pW][eW] = new TH1D(Form("fCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Average multi-particle correlations (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),32,0,32);
- fCorrelations[pW][eW]->SetTickLength(-0.01,"Y");
- fCorrelations[pW][eW]->SetMarkerStyle(25);
- fCorrelations[pW][eW]->SetLabelSize(0.03);
- fCorrelations[pW][eW]->SetLabelOffset(0.01,"Y");
- // 2-p correlations:
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
- // 3-p correlations:
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
- // 4-p correlations:
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
- // 5-p correlations:
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
- // 6-p correlations:
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
- // 7-p correlations:
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
- // 8-p correlations:
- (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
- // add fCorrelations to the list fIntFlowList:
- fIntFlowResults->Add(fCorrelations[pW][eW]);
-
- // final corrections for non-uniform acceptance for QC{2}, QC{4}, QC{6} and QC{8}:
- fCorrections[pW][eW] = new TH1D(Form("fCorrections: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Corrections for non-uniform acceptance for Q-cumulants (%s, %s)",eWeightsFlag[eW].Data()),4,0,4);
- fCorrections[pW][eW]->SetLabelSize(0.05);
- fCorrections[pW][eW]->SetMarkerStyle(25);
- (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(1,"corr. for QC{2}");
- (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(2,"corr. for QC{4}");
- (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(3,"corr. for QC{6}");
- (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(4,"corr. for QC{8}");
- // add fCorrections[pW] to list fIntFlowResults:
- fIntFlowResults->Add(fCorrections[pW][eW]);
-
- // final results for covariances:
- fCovariances[pW][eW] = new TH1D(Form("fCovariances: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Covariances (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
- fCovariances[pW][eW]->SetLabelSize(0.05);
- fCovariances[pW][eW]->SetMarkerStyle(25);
- (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(1,"Cov(2,4)");
- (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(2,"Cov(2,6)");
- (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(3,"Cov(2,8)");
- (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(4,"Cov(4,6)");
- (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(5,"Cov(4,8)");
- (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(6,"Cov(6,8)");
- // add fCovariances[pW][eW] to list fIntFlowResults:
- fIntFlowResults->Add(fCovariances[pW][eW]);
-
- // final results for sum of event weights:
- for(Int_t power=0;power<2;power++)
- {
- fSumOfEventWeights[pW][eW][power] = new TH1D(Form("fSumOfEventWeights: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data()),Form("SumOfEventWeights (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data()),4,0,4);
- fSumOfEventWeights[pW][eW][power]->SetLabelSize(0.05);
- fSumOfEventWeights[pW][eW][power]->SetMarkerStyle(25);
- (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
- (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
- (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
- (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
- // add fSumOfEventWeights[pW][eW][power] to list fIntFlowResults:
- fIntFlowResults->Add(fSumOfEventWeights[pW][eW][power]);
- }
-
- // final results for sum of product of event weights:
- fProductOfEventWeights[pW][eW] = new TH1D(Form("fProductOfEventWeights: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("ProductOfEventWeights (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
- fProductOfEventWeights[pW][eW]->SetLabelSize(0.05);
- fProductOfEventWeights[pW][eW]->SetMarkerStyle(25);
- (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
- (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
- (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
- (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
- (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
- (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
- // add fProductOfEventWeights[pW][eW] to list fIntFlowResults:
- fIntFlowResults->Add(fProductOfEventWeights[pW][eW]);
-
- for(Int_t nua=0;nua<2;nua++)
- {
- // integrated Q-cumulants:
- fCumulants[pW][eW][nua] = new TH1D(Form("fCumulants: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),Form("Q-cumulants (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),4,0,4);
- fCumulants[pW][eW][nua]->SetLabelSize(0.05);
- fCumulants[pW][eW][nua]->SetMarkerStyle(25);
- (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(1,"QC{2}");
- (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(2,"QC{4}");
- (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(3,"QC{6}");
- (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(4,"QC{8}");
- // add fCumulants[pW][nua] to list fIntFlowResults:
- fIntFlowResults->Add(fCumulants[pW][eW][nua]);
-
- // integrated flow from Q-cumulants:
- fIntFlow[pW][eW][nua] = new TH1D(Form("fIntFlow: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),Form("Integrated flow from Q-cumulants (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),4,0,4);
- fIntFlow[pW][eW][nua]->SetLabelSize(0.05);
- fIntFlow[pW][eW][nua]->SetMarkerStyle(25);
- (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}");
- (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}");
- (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}");
- (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}");
- // add fIntFlow[pW][nua] to list fIntFlowResults:
- fIntFlowResults->Add(fIntFlow[pW][eW][nua]);
-
- } // end of for(Int_t nua=0;nua<2;nua++)
- } // end of for(Int_t eW=0;eW<2;eW++)
- } // end of for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
-
-
-
- /*
- // final average weighted multi-particle correlations for all events calculated from Q-vectors
- fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
- fQCorrelations[1]->SetTickLength(-0.01,"Y");
- fQCorrelations[1]->SetMarkerStyle(25);
- fQCorrelations[1]->SetLabelSize(0.03);
- fQCorrelations[1]->SetLabelOffset(0.01,"Y");
- // 2-particle correlations:
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
- // 3-particle correlations:
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
- // 4-particle correlations:
- (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
- // add fQCorrelations[1] to the list fIntFlowList:
- fIntFlowList->Add(fQCorrelations[1]);
- */
-
-
-} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
-{
- // book all profiles relevant for calculations with nested loops
-
- fEvaluateNestedLoops = new TProfile("fEvaluateNestedLoops","1 = evaluate, 0 = do not evaluate",2,0,2);
- fEvaluateNestedLoops->SetLabelSize(0.05);
- (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"Nested Loops (Int. Flow)");
- (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"Nested Loops (Diff. Flow)");
- fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateNestedLoopsForIntFlow);
- fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateNestedLoopsForDiffFlow);
- // add fEvaluateNestedLoops to the list fNestedLoopsList:
- fNestedLoopsList->Add(fEvaluateNestedLoops);
-
- if(fEvaluateNestedLoopsForIntFlow)
- {
- fDirectCorrelations = new TProfile("fDirectCorrelations","multi-particle correlations with nested loops",100,0,100,"s");
- fNestedLoopsList->Add(fDirectCorrelations);
- fDirectCorrectionsCos = new TProfile("fDirectCorrectionsCos"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");
- fNestedLoopsList->Add(fDirectCorrectionsCos);
- fDirectCorrectionsSin = new TProfile("fDirectCorrectionsSin"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");
- fNestedLoopsList->Add(fDirectCorrectionsSin);
- if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)
- {
- fDirectCorrelationsW = new TProfile("fDirectCorrelationsW","multi-particle correlations with nested loops",200,0,200,"s");
- fNestedLoopsList->Add(fDirectCorrelationsW);
- fDirectCorrectionsCosW = new TProfile("fDirectCorrectionsCosW"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");
- fNestedLoopsList->Add(fDirectCorrectionsCosW);
- fDirectCorrectionsSinW = new TProfile("fDirectCorrectionsSinW"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");
- fNestedLoopsList->Add(fDirectCorrectionsSinW);
- }
- }
-
- if(fEvaluateNestedLoopsForDiffFlow)
- {
- fDirectCorrelationsDiffFlow = new TProfile("fDirectCorrelationsDiffFlow","multi-particle correlations with nested loops",200,0,200,"s");
- fNestedLoopsList->Add(fDirectCorrelationsDiffFlow);
- fDirectCorrectionsDiffFlowCos = new TProfile("fDirectCorrectionsDiffFlowCos",
- "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");
- fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCos);
- fDirectCorrectionsDiffFlowSin = new TProfile("fDirectCorrectionsDiffFlowSin",
- "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");
- fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSin);
- if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)
- {
- fDirectCorrelationsDiffFlowW = new TProfile("fDirectCorrelationsDiffFlowW","multi-particle correlations with nested loops",200,0,200,"s");
- fNestedLoopsList->Add(fDirectCorrelationsDiffFlowW);
- fDirectCorrectionsDiffFlowCosW = new TProfile("fDirectCorrectionsDiffFlowCosW",
- "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");
- fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCosW);
- fDirectCorrectionsDiffFlowSinW = new TProfile("fDirectCorrectionsDiffFlowSinW",
- "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");
- fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSinW);
- }
- }
-
-} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForIntegratedFlow()
-{
- // calculate all correlations needed for integrated flow
-
- // multiplicity:
- Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- Double_t dReQ1n = (*fReQ)(0,0);
- Double_t dReQ2n = (*fReQ)(1,0);
- Double_t dReQ3n = (*fReQ)(2,0);
- Double_t dReQ4n = (*fReQ)(3,0);
- Double_t dImQ1n = (*fImQ)(0,0);
- Double_t dImQ2n = (*fImQ)(1,0);
- Double_t dImQ3n = (*fImQ)(2,0);
- Double_t dImQ4n = (*fImQ)(3,0);
-
- // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- // (these expression appear in the Eqs. for the multi-particle correlations bellow)
-
- // Re[Q_{2n} Q_{n}^* Q_{n}^*]
- Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
-
- // Im[Q_{2n} Q_{n}^* Q_{n}^*]
- //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
-
- // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
- Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
-
- // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
- Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
- + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
-
- // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
- //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
-
- // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
- Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
-
- // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
- Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
-
- // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
- //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
-
- // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
- Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
-
- // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
- Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
-
- // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
- Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
-
- // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
- //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
-
- // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
- Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
- + dImQ3n*dImQ2n*dReQ1n;
-
- // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
- Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
-
- // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
- //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
-
- // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
- + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
-
- // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
-
- // |Q_{2n}|^2 |Q_{n}|^2
- Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
-
- // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
- + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
-
- // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
-
- // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
- + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
-
- // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
-
- // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
- * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
-
- // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
- // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
-
- // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
- + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
- - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
-
- // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
- // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
- // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
-
- // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
- * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
-
- // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
- // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
-
-
- // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
- + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
- * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
- - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
-
- // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
- // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
- // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
-
- // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
- * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
- + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
-
- // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
- // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
- // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
-
- // |Q_{2n}|^2 |Q_{n}|^4
- Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
-
- // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
- * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
- + 2.*dReQ1n*dImQ1n*dImQ2n);
-
- // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
- //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
- // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
- // - 2.*dReQ1n*dReQ2n*dImQ1n);
-
-
-
-
- // **************************************
- // **** multi-particle correlations: ****
- // **************************************
- //
- // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0].
- // Remark 2: binning of fQCorrelations[0] is organized as follows:
- // --------------------------------------------------------------------------------------------------------------------
- // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
- // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
- // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
- // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
- // 5th bin: ---- EMPTY ----
- // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
- // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
- // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
- // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
- // 10th bin: ---- EMPTY ----
- // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
- // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
- // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
- // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
- // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
- // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
- // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
- // 18th bin: ---- EMPTY ----
- // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
- // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
- // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
- // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
- // 23rd bin: ---- EMPTY ----
- // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
- // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
- // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
- // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
- // 28th bin: ---- EMPTY ----
- // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
- // 30th bin: ---- EMPTY ----
- // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
- // --------------------------------------------------------------------------------------------------------------------
-
- // 2-particle:
- Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
- Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
- Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
- Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
-
- if(dMult>1)
- {
- two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
- two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
- two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
- two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
-
- // average non-weighted 2-particle correlations for single event:
- fQCorrelationsEBE[0]->SetBinContent(1,two1n1n);
- fQCorrelationsEBE[0]->SetBinContent(2,two2n2n);
- fQCorrelationsEBE[0]->SetBinContent(3,two3n3n);
- fQCorrelationsEBE[0]->SetBinContent(4,two4n4n);
-
- // final average non-weighted 2-particle correlations for all events:
- fQCorrelations[0][0]->Fill(0.5,two1n1n,dMult*(dMult-1.));
- fQCorrelations[0][0]->Fill(1.5,two2n2n,dMult*(dMult-1.));
- fQCorrelations[0][0]->Fill(2.5,two3n3n,dMult*(dMult-1.));
- fQCorrelations[0][0]->Fill(3.5,two4n4n,dMult*(dMult-1.));
-
- // distribution of <cos(n*(phi1-phi2))>:
- //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
- } // end of if(dMult>1)
-
- // 3-particle:
- Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
- Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
- Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
- Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
-
- if(dMult>2)
- {
- three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
- - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
- / (dMult*(dMult-1.)*(dMult-2.));
- three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
- - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
- - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
- / (dMult*(dMult-1.)*(dMult-2.));
- three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
- - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
- / (dMult*(dMult-1.)*(dMult-2.));
- three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
- - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
- - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
- / (dMult*(dMult-1.)*(dMult-2.));
-
- // average non-weighted 3-particle correlations for single event:
- fQCorrelationsEBE[0]->SetBinContent(6,three2n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(7,three3n2n1n);
- fQCorrelationsEBE[0]->SetBinContent(8,three4n2n2n);
- fQCorrelationsEBE[0]->SetBinContent(9,three4n3n1n);
-
- // final average non-weighted 3-particle correlations for all events:
- fQCorrelations[0][0]->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
- fQCorrelations[0][0]->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
- fQCorrelations[0][0]->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
- fQCorrelations[0][0]->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
- } // end of if(dMult>2)
-
- // 4-particle:
- Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
- Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
- Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
- Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
- Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
- Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
- Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
-
- if(dMult>3)
- {
- four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
- + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
- / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
- four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
- + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
- / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
- four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
- + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
- four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
- + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
- four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
- - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
- four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
- - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
- four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
- - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
- + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
- + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
-
- // average non-weighted 4-particle correlations for single event:
- fQCorrelationsEBE[0]->SetBinContent(11,four1n1n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(12,four2n1n2n1n);
- fQCorrelationsEBE[0]->SetBinContent(13,four2n2n2n2n);
- fQCorrelationsEBE[0]->SetBinContent(14,four3n1n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(15,four3n1n3n1n);
- fQCorrelationsEBE[0]->SetBinContent(16,four3n1n2n2n);
- fQCorrelationsEBE[0]->SetBinContent(17,four4n2n1n1n);
-
- // final average non-weighted 4-particle correlations for all events:
- fQCorrelations[0][0]->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
- fQCorrelations[0][0]->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
- fQCorrelations[0][0]->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
- fQCorrelations[0][0]->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
- fQCorrelations[0][0]->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
- fQCorrelations[0][0]->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
- fQCorrelations[0][0]->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
- //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- } // end of if(dMult>3)
-
- // 5-particle:
- Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
- Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
- Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
- Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
-
- if(dMult>4)
- {
- five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
- + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
- - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
- - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
-
- five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
- + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
- - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
- - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
-
- five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
- + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
-
- five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
- - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
- + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
- - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
- - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
- + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
- - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
-
- // average non-weighted 5-particle correlations for single event:
- fQCorrelationsEBE[0]->SetBinContent(19,five2n1n1n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(20,five2n2n2n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(21,five3n1n2n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(22,five4n1n1n1n1n);
-
- // final average non-weighted 5-particle correlations for all events:
- fQCorrelations[0][0]->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
- fQCorrelations[0][0]->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
- fQCorrelations[0][0]->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
- fQCorrelations[0][0]->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
- } // end of if(dMult>4)
-
- // 6-particle:
- Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
- Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
- Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
- Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
-
- if(dMult>5)
- {
- six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
- + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
- + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
- - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
- + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
- / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
- - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
-
- six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
- * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
- - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
- + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
- + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
- + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
- - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
- + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
- + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
- + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
- + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
- * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
- + 1.+2.*two2n2n+1.*two4n4n)-dMult)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
-
- six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
- * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
- * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
- + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
- + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
- + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
-
- six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
- * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
- - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
- + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
- - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
- + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
- + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
- + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
-
- // average non-weighted 6-particle correlations for single event:
- fQCorrelationsEBE[0]->SetBinContent(24,six1n1n1n1n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(25,six2n1n1n2n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(26,six2n2n1n1n1n1n);
- fQCorrelationsEBE[0]->SetBinContent(27,six3n1n1n1n1n1n);
-
- // final average non-weighted 6-particle correlations for all events:
- fQCorrelations[0][0]->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
- fQCorrelations[0][0]->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
- fQCorrelations[0][0]->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
- fQCorrelations[0][0]->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
-
- // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
- //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
- } // end of if(dMult>5)
-
- // 7-particle:
- Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
-
- if(dMult>6)
- {
- seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
- * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
- - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
- + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
- + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
- - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
- + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
- + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
- + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
- + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
- + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
- + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
- + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
- + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
- + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
-
- // average non-weighted 7-particle correlations for single event:
- fQCorrelationsEBE[0]->SetBinContent(29,seven2n1n1n1n1n1n1n);
-
- // final average non-weighted 7-particle correlations for all events:
- fQCorrelations[0][0]->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
- } // end of if(dMult>6)
-
- // 8-particle:
- Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
- if(dMult>7)
- {
- eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
- * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
- * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
- - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
- + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
- + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
- * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
- + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
- + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
- + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
- + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
- + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
- / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
-
- // average non-weighted 8-particle correlations for single event:
- fQCorrelationsEBE[0]->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
-
- // final average non-weighted 8-particle correlations for all events:
- fQCorrelations[0][0]->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
-
- // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
- //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
- } // end of if(dMult>7)
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForIntegratedFlow()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)
-{
- // 1.) Evaluate with nested loops the relevant correlations for integrated flow without and with using the particle weights.
- // Results are stored in profiles fDirectCorrelations and fDirectCorrelationsW, respectively.
-
- // 2.) Evaluate with nested loops corrections for non-uniform acceptance relevant for integrated flow,
- // without and with using the particle weights.
- // Without weights: cos terms are stored in profile fDirectCorrectionsCos, and sin terms in profile fDirectCorrectionsSin.
- // With weights: cos terms are stored in profile fDirectCorrectionsCosW, and sin terms in profile fDirectCorrectionsSinW.
-
- // 3.) Binning of fDirectCorrelations is organized as follows:
- //
- // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
- // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
- // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
- // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
- // 5th bin: ---- EMPTY ----
- // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
- // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
- // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
- // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
- // 10th bin: ---- EMPTY ----
- // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
- // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
- // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
- // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
- // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
- // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
- // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
- // 18th bin: ---- EMPTY ----
- // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
- // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
- // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
- // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
- // 23rd bin: ---- EMPTY ----
- // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
- // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
- // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
- // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
- // 28th bin: ---- EMPTY ----
- // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
- // 30th bin: ---- EMPTY ----
- // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
-
- // 4.) Binning of fDirectCorrelationsW is organized as follows:
- // ..............................................................................................
- // ---- bins 1-20: 2-particle correlations ----
- // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
- // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
- // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
- // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
- // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
- // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
- // ---- bins 21-40: 3-particle correlations ----
- // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
- // ---- bins 41-60: 4-particle correlations ----
- // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
- // ---- bins 61-80: 5-particle correlations ----
- // ---- bins 81-100: 6-particle correlations ----
- // ---- bins 101-120: 7-particle correlations ----
- // ---- bins 121-140: 8-particle correlations ----
- // ..............................................................................................
-
- // 5.) Binning of fDirectCorrectionsCos is organized as follows:
- // ..............................................................................................
- // 1st bin: <<cos(n*(phi1))>> = cosP1n
- // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
- // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
- // ...
- // ..............................................................................................
-
- // 6.) Binning of fDirectCorrectionsSin is organized as follows:
- // ..............................................................................................
- // 1st bin: <<sin(n*(phi1))>> = sinP1n
- // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
- // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
- // ...
- // ..............................................................................................
-
- // 7.) Binning of fDirectCorrectionsCosW is organized as follows:
- // ..............................................................................................
- // ...
- // ..............................................................................................
-
- // 8.) Binning of fDirectCorrectionsSinW is organized as follows:
- // ..............................................................................................
- // ...
- // ..............................................................................................
-
- Int_t nPrim = anEvent->NumberOfTracks();
- AliFlowTrackSimple *aftsTrack = NULL;
-
- Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
- Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
-
- Int_t n = fHarmonic;
-
- // 2-particle correlations and 1- and 2-particle correction terms:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!(aftsTrack->InRPSelection())) continue;
- phi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
-
- // corrections for non-uniform acceptance:
- // non-weighted:
- fDirectCorrectionsCos->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
- fDirectCorrectionsSin->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
- // weighted:
- // fDirectCorrectionsCosW->Fill(0.5,???,1); // to be improved (continued)
- // fDirectCorrectionsSinW->Fill(0.5,???,1); // to be improved (continued)
-
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection())) continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted correlations:
- fDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
- fDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
- fDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
- fDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
-
- // weighted correlations:
- // ................................................................................................................
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))>
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(4.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
- // ...
- // ................................................................................................................
-
- // non-weighted corrections for non-uniform acceptance (cos terms)
- // ................................................................................................................
- fDirectCorrectionsCos->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
- // ...
- // ................................................................................................................
-
- // non-weighted corrections for non-uniform acceptance (sin terms)
- // ................................................................................................................
- fDirectCorrectionsSin->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
- // ...
- // ................................................................................................................
-
- // weighted corrections for non-uniform acceptance (cos terms)
- // ................................................................................................................
- // fDirectCorrectionsCosW->Fill(1.5,???,1.); // to be improved (continued)
- // ...
- // ................................................................................................................
-
- // non-weighted corrections for non-uniform acceptance (sin terms)
- // ................................................................................................................
- // fDirectCorrectionsSinW->Fill(1.5,???,1.); // to be improved (continued)
- // ...
- // ................................................................................................................
-
- } // end of for(Int_t i2=0;i2<nPrim;i2++)
- } // end of for(Int_t i1=0;i1<nPrim;i1++)
-
- // 3-particle correlations:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!(aftsTrack->InRPSelection())) continue;
- phi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection())) continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection())) continue;
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted correlations:
- fDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
- fDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
- fDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
- fDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
-
- // weighted correlations:
- // ..............................................................................................................................
- // 2-p:
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(5.,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
- // 3-p:
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(20.,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
- // ...
- // ..............................................................................................................................
-
- // non-weighted corrections for non-uniform acceptance (cos terms)
- // ................................................................................................................
- fDirectCorrectionsCos->Fill(2.,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
- // ...
- // ................................................................................................................
-
- // non-weighted corrections for non-uniform acceptance (sin terms)
- // ................................................................................................................
- fDirectCorrectionsSin->Fill(2.,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
- // ...
- // ................................................................................................................
-
- // weighted corrections for non-uniform acceptance (cos terms)
- // ................................................................................................................
- // ...
- // ................................................................................................................
-
- // weighted corrections for non-uniform acceptance (sin terms)
- // ................................................................................................................
- // ...
- // ................................................................................................................
-
- } // end of for(Int_t i3=0;i3<nPrim;i3++)
- } // end of for(Int_t i2=0;i2<nPrim;i2++)
- } // end of for(Int_t i1=0;i1<nPrim;i1++)
-
- // 4-particle correlations:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- aftsTrack=anEvent->GetTrack(i1);
- if(!(aftsTrack->InRPSelection())) continue;
- phi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection())) continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection())) continue;
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection())) continue;
- phi4=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted:
- fDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
- fDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
- fDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
- fDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
- fDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
- fDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
- fDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
-
- // weighted:
- //.......................................................................................
- // 4-p:
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(40.,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
- // ...
- //.......................................................................................
-
- }
- }
- }
- }
-
- // 5-particle correlations:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- //cout<<"i1 = "<<i1<<endl;
- aftsTrack=anEvent->GetTrack(i1);
- if(!(aftsTrack->InRPSelection())) continue;
- phi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection())) continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection())) continue;
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection())) continue;
- phi4=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection())) continue;
- phi5=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted:
- //------------------------------------------------------------------------------------------------------
- fDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
- fDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
- fDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
- fDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
- //------------------------------------------------------------------------------------------------------
-
- // weighted:
- //..............................................................................................................
- // 5-p:
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(60.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),pow(wPhi1,2)*wPhi2*wPhi3*wPhi4*wPhi5);
- //..............................................................................................................
-
- }
- }
- }
- }
- }
-
- // 6-particle correlations:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- //cout<<"i1 = "<<i1<<endl;
- aftsTrack=anEvent->GetTrack(i1);
- if(!(aftsTrack->InRPSelection())) continue;
- phi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection())) continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection())) continue;
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection())) continue;
- phi4=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection())) continue;
- phi5=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i6=0;i6<nPrim;i6++)
- {
- if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
- aftsTrack=anEvent->GetTrack(i6);
- if(!(aftsTrack->InRPSelection())) continue;
- phi6=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted:
- //-----------------------------------------------------------------------------------------------------------
- fDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
- fDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,n,n|2n,n,n}
- fDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,2n|n,n,n,n}
- fDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n}
- //-----------------------------------------------------------------------------------------------------------
-
- // weighted:
- //.................................................................................................................
- // 6-p:
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(80.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6);
- //.................................................................................................................
-
- }
- }
- }
- }
- }
- }
-
- // 7-particle correlations:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- //cout<<"i1 = "<<i1<<endl;
- aftsTrack=anEvent->GetTrack(i1);
- if(!(aftsTrack->InRPSelection())) continue;
- phi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection())) continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection())) continue;
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection())) continue;
- phi4=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection())) continue;
- phi5=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i6=0;i6<nPrim;i6++)
- {
- if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
- aftsTrack=anEvent->GetTrack(i6);
- if(!(aftsTrack->InRPSelection())) continue;
- phi6=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i7=0;i7<nPrim;i7++)
- {
- if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
- aftsTrack=anEvent->GetTrack(i7);
- if(!(aftsTrack->InRPSelection())) continue;
- phi7=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted:
- //---------------------------------------------------------------------------------------------------------------
- fDirectCorrelations->Fill(28.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1.);//<7>_{2n,n,n|n,n,n,n}
- //---------------------------------------------------------------------------------------------------------------
-
- // weighted:
- //..........................................................................................................................................
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(100.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),
- pow(wPhi1,2.)*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7);
- //..........................................................................................................................................
-
- }
- }
- }
- }
- }
- }
- }
-
- cout<<endl;
-
- // 8-particle correlations:
- for(Int_t i1=0;i1<nPrim;i1++)
- {
- cout<<"i1 = "<<i1<<endl;
- aftsTrack=anEvent->GetTrack(i1);
- if(!(aftsTrack->InRPSelection())) continue;
- phi1=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i2=0;i2<nPrim;i2++)
- {
- if(i2==i1)continue;
- aftsTrack=anEvent->GetTrack(i2);
- if(!(aftsTrack->InRPSelection())) continue;
- phi2=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i3=0;i3<nPrim;i3++)
- {
- if(i3==i1||i3==i2)continue;
- aftsTrack=anEvent->GetTrack(i3);
- if(!(aftsTrack->InRPSelection())) continue;
- phi3=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i4=0;i4<nPrim;i4++)
- {
- if(i4==i1||i4==i2||i4==i3)continue;
- aftsTrack=anEvent->GetTrack(i4);
- if(!(aftsTrack->InRPSelection())) continue;
- phi4=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i5=0;i5<nPrim;i5++)
- {
- if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
- aftsTrack=anEvent->GetTrack(i5);
- if(!(aftsTrack->InRPSelection())) continue;
- phi5=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i6=0;i6<nPrim;i6++)
- {
- if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
- aftsTrack=anEvent->GetTrack(i6);
- if(!(aftsTrack->InRPSelection())) continue;
- phi6=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i7=0;i7<nPrim;i7++)
- {
- if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
- aftsTrack=anEvent->GetTrack(i7);
- if(!(aftsTrack->InRPSelection())) continue;
- phi7=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi())));
- for(Int_t i8=0;i8<nPrim;i8++)
- {
- if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
- aftsTrack=anEvent->GetTrack(i8);
- if(!(aftsTrack->InRPSelection())) continue;
- phi8=aftsTrack->Phi();
- if(fUsePhiWeights && fPhiWeights) wPhi8 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi8*fnBinsPhi/TMath::TwoPi())));
-
- // non-weighted:
- //--------------------------------------------------------------------------------------------------------------------
- fDirectCorrelations->Fill(30.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),1.);//<8>_{n,n,n,n|n,n,n,n}
- //--------------------------------------------------------------------------------------------------------------------
-
- // weighted:
- //...........................................................................................................................................
- if(fUsePhiWeights) fDirectCorrelationsW->Fill(120.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),
- wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7*wPhi8);
- //...........................................................................................................................................
-
- }
- }
- }
- }
- }
- }
- }
- }
-
-} // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)
-{
- // compare results needed for int. flow calculated with nested loops and with those calculated from Q-vectors
-
- cout<<endl;
- cout<<endl;
- cout<<" *************************************"<<endl;
- cout<<" **** cross-checking the formulas ****"<<endl;
- cout<<" **** for integrated flow ****"<<endl;
- cout<<" *************************************"<<endl;
- cout<<endl;
- cout<<endl;
-
- if(!(useParticleWeights))
- {
- cout<<" **** results for non-weighted correlations: ****"<<endl;
- cout<<endl;
- cout<<"<2>_{1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(1)<<endl;
- cout<<"<2>_{1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(1)<<endl;
- cout<<endl;
- cout<<"<2>_{2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(2)<<endl;
- cout<<"<2>_{2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(2)<<endl;
- cout<<endl;
- cout<<"<2>_{3n,3n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(3)<<endl;
- cout<<"<2>_{3n,3n} from nested loops = "<<fDirectCorrelations->GetBinContent(3)<<endl;
- cout<<endl;
- cout<<"<2>_{4n,4n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(4)<<endl;
- cout<<"<2>_{4n,4n} from nested loops = "<<fDirectCorrelations->GetBinContent(4)<<endl;
- cout<<endl;
- cout<<"<3>_{2n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(6)<<endl;
- cout<<"<3>_{2n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(6)<<endl;
- cout<<endl;
- cout<<"<3>_{3n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(7)<<endl;
- cout<<"<3>_{3n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(7)<<endl;
- cout<<endl;
- cout<<"<3>_{4n,2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(8)<<endl;
- cout<<"<3>_{4n,2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(8)<<endl;
- cout<<endl;
- cout<<"<3>_{4n,3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(9)<<endl;
- cout<<"<3>_{4n,3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(9)<<endl;
- cout<<endl;
- cout<<"<4>_{1n,1n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(11)<<endl;
- cout<<"<4>_{1n,1n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(11)<<endl;
- cout<<endl;
- cout<<"<4>_{2n,1n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(12)<<endl;
- cout<<"<4>_{2n,1n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(12)<<endl;
- cout<<endl;
- cout<<"<4>_{2n,2n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(13)<<endl;
- cout<<"<4>_{2n,2n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(13)<<endl;
- cout<<endl;
- cout<<"<4>_{3n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(14)<<endl;
- cout<<"<4>_{3n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(14)<<endl;
- cout<<endl;
- cout<<"<4>_{3n,1n|3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(15)<<endl;
- cout<<"<4>_{3n,1n|3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(15)<<endl;
- cout<<endl;
- cout<<"<4>_{3n,1n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(16)<<endl;
- cout<<"<4>_{3n,1n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(16)<<endl;
- cout<<endl;
- cout<<"<4>_{4n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(17)<<endl;
- cout<<"<4>_{4n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(17)<<endl;
- cout<<endl;
- cout<<"<5>_{2n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(19)<<endl;
- cout<<"<5>_{2n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(19)<<endl;
- cout<<endl;
- cout<<"<5>_{2n,2n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(20)<<endl;
- cout<<"<5>_{2n,2n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(20)<<endl;
- cout<<endl;
- cout<<"<5>_{3n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(21)<<endl;
- cout<<"<5>_{3n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(21)<<endl;
- cout<<endl;
- cout<<"<5>_{4n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(22)<<endl;
- cout<<"<5>_{4n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(22)<<endl;
- cout<<endl;
- cout<<"<6>_{1n,1n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(24)<<endl;
- cout<<"<6>_{1n,1n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(24)<<endl;
- cout<<endl;
- cout<<"<6>_{2n,1n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(25)<<endl;
- cout<<"<6>_{2n,1n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(25)<<endl;
- cout<<endl;
- cout<<"<6>_{2n,2n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(26)<<endl;
- cout<<"<6>_{2n,2n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(26)<<endl;
- cout<<endl;
- cout<<"<6>_{3n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(27)<<endl;
- cout<<"<6>_{3n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(27)<<endl;
- cout<<endl;
- cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(29)<<endl;
- cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(29)<<endl;
- cout<<endl;
- cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(31)<<endl;
- cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(31)<<endl;
- cout<<endl;
- cout<<endl;
- cout<<" **** results for non-weighted correction terms: ****"<<endl;
- cout<<endl;
- //.........................................................................................
- cout<<"<cos(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(1)<<endl;
- cout<<"<cos(n*phi1)> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(1)<<endl;
- cout<<endl;
- cout<<"<sin(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(1)<<endl;
- cout<<"<sin(n*phi1)> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(1)<<endl;
- cout<<endl;
- cout<<"<cos(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(2)<<endl;
- cout<<"<cos(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(2)<<endl;
- cout<<endl;
- cout<<"<sin(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(2)<<endl;
- cout<<"<sin(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(2)<<endl;
- cout<<endl;
- cout<<"<cos(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(3)<<endl;
- cout<<"<cos(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(3)<<endl;
- cout<<endl;
- cout<<"<sin(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(3)<<endl;
- cout<<"<sin(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(3)<<endl;
- cout<<endl;
- //.........................................................................................
- }
-
- if(useParticleWeights)
- {
- cout<<" **** results for weighted correlations: ****"<<endl;
- cout<<endl;
- //.........................................................................................
- cout<<"<w1 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(1)<<endl;
- cout<<"<<w1 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(1)<<endl;
- cout<<endl;
- cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(2)<<endl;
- cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(2)<<endl;
- cout<<endl;
- cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(3)<<endl;
- cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(3)<<endl;
- cout<<endl;
- cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(4)<<endl;
- cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(4)<<endl;
- cout<<endl;
- /*
- cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(5)<<endl;
- cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(5)<<endl;
- cout<<endl;
- cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(6)<<endl;
- cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(6)<<endl;
- cout<<endl;
- cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(21)<<endl;
- cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(21)<<endl;
- cout<<endl;
- */
- cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(11)<<endl;
- cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(41)<<endl;
- cout<<endl;
- //.........................................................................................
- //cout<<endl;
- //cout<<endl;
- //cout<<" **** results for weighted correction terms: ****"<<endl;
- //cout<<endl;
- //.........................................................................................
- }
-
-} // end of AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateQProductsForIntFlow()
-{
- // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
-
- // binning of fQProducts is organized as follows:
- //
- // 1st bin: <2><4>
- // 2nd bin: <2><6>
- // 3rd bin: <2><8>
- // 4th bin: <4><6>
- // 5th bin: <4><8>
- // 6th bin: <6><8>
-
- Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
-
- Double_t twoEBE = 0.; // <2>
- Double_t fourEBE = 0.; // <4>
- Double_t sixEBE = 0.; // <6>
- Double_t eightEBE = 0.; // <8>
-
- if(dMult>1)
- {
- twoEBE = fQCorrelationsEBE[0]->GetBinContent(1);
- if(dMult>3)
- {
- fourEBE = fQCorrelationsEBE[0]->GetBinContent(11);
- if(dMult>5)
- {
- sixEBE = fQCorrelationsEBE[0]->GetBinContent(24);
- if(dMult>7)
- {
- eightEBE = fQCorrelationsEBE[0]->GetBinContent(31);
- }
- }
- }
- }
-
- // <2><4>
- if(dMult>3)
- {
- fQProducts[0][0]->Fill(0.5,twoEBE*fourEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3));
- }
-
- // <2><6>
- if(dMult>5)
- {
- fQProducts[0][0]->Fill(1.5,twoEBE*sixEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));
- }
-
- // <2><8>
- if(dMult>7)
- {
- fQProducts[0][0]->Fill(2.5,twoEBE*eightEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
- }
-
- // <4><6>
- if(dMult>5)
- {
- fQProducts[0][0]->Fill(3.5,fourEBE*sixEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));
- }
-
- // <4><8>
- if(dMult>7)
- {
- fQProducts[0][0]->Fill(4.5,fourEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*
- dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
- }
-
- // <6><8>
- if(dMult>7)
- {
- fQProducts[0][0]->Fill(5.5,sixEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*
- dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
- }
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateQProductsForIntFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCovariancesForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-{
- // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
- // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
- // b) Store in histogram fCovariances for instance the following:
- //
- // Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]
- //
- // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
- // c) Binning of fCovariances is organized as follows:
- //
- // 1st bin: Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]
- // 2nd bin: Cov(<2>,<6>) * (sum_{i=1}^{N} w_{<2>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]
- // 3rd bin: Cov(<2>,<8>) * (sum_{i=1}^{N} w_{<2>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
- // 4th bin: Cov(<4>,<6>) * (sum_{i=1}^{N} w_{<4>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]
- // 5th bin: Cov(<4>,<8>) * (sum_{i=1}^{N} w_{<4>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
- // 6th bin: Cov(<6>,<8>) * (sum_{i=1}^{N} w_{<6>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<6>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
-
- // shortcuts for flags:
- Int_t pW = (Int_t)(useParticleWeights);
- Int_t eW = -1;
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- for(Int_t power=0;power<2;power++)
- {
- if(!(fQCorrelations[pW][eW] && fQProducts[pW][eW] && fCovariances[pW][eW] && fSumOfEventWeights[pW][eW][power] && fProductOfEventWeights[pW][eW]))
- {
- cout<<"WARNING: fQCorrelations[pW][eW] && fQProducts[pW][eW] && fCovariances[pW][eW] && fSumOfEventWeights[pW][eW][power] && fProductOfEventWeights[pW][eW] is NULL in AFAWQC::CCFIF() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"power = "<<power<<endl;
- exit(0);
- }
- }
-
- // average 2-, 4-, 6- and 8-particle azimuthal correlations for all events:
- Double_t two = fCorrelations[pW][eW]->GetBinContent(1); // <<2>>
- Double_t four = fCorrelations[pW][eW]->GetBinContent(11); // <<4>>
- Double_t six = fCorrelations[pW][eW]->GetBinContent(24); // <<6>>
- Double_t eight = fCorrelations[pW][eW]->GetBinContent(31); // <<8>>
-
- // average products of 2-, 4-, 6- and 8-particle azimuthal correlations:
- Double_t product24 = fQProducts[pW][eW]->GetBinContent(1); // <<2><4>>
- Double_t product26 = fQProducts[pW][eW]->GetBinContent(2); // <<2><6>>
- Double_t product28 = fQProducts[pW][eW]->GetBinContent(3); // <<2><8>>
- Double_t product46 = fQProducts[pW][eW]->GetBinContent(4); // <<4><6>>
- Double_t product48 = fQProducts[pW][eW]->GetBinContent(5); // <<4><8>>
- Double_t product68 = fQProducts[pW][eW]->GetBinContent(6); // <<6><8>>
-
- // denominators in the expressions for the unbiased estimator for covariance:
- Double_t denom24 = 0.;
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(2))
- {
- denom24 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(1))/
- (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(2));
- }
- Double_t denom26 = 0.;
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
- {
- denom26 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(2))/
- (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
- }
- Double_t denom28 = 0.;
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
- {
- denom28 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(3))/
- (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
- }
- Double_t denom46 = 0.;
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) && fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
- {
- denom46 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(4))/
- (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
- }
- Double_t denom48 = 0.;
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
- {
- denom48 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(5))/
- (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
- }
- Double_t denom68 = 0.;
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(3) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
- {
- denom68 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(6))/
- (fSumOfEventWeights[pW][eW][0]->GetBinContent(3) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
- }
-
- // Cov(<2>,<4>):
- Double_t cov24 = 0.;
- Double_t wCov24 = 0.;
- if(denom24)
- {
- cov24 = (product24-two*four)/denom24; // Cov(<2>,<4>)
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(2))
- {
- wCov24 = cov24 * fProductOfEventWeights[pW][eW]->GetBinContent(1)
- / (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(2));
- fCovariances[pW][eW]->SetBinContent(1,wCov24);
- }
- }
- // Cov(<2>,<6>):
- Double_t cov26 = 0.;
- Double_t wCov26 = 0.;
- if(denom26)
- {
- cov26 = (product26-two*six)/denom26; // Cov(<2>,<6>)
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
- {
- wCov26 = cov26 * fProductOfEventWeights[pW][eW]->GetBinContent(2)
- / (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
- fCovariances[pW][eW]->SetBinContent(2,wCov26);
- }
- }
- // Cov(<2>,<8>):
- Double_t cov28 = 0.;
- Double_t wCov28 = 0.;
- if(denom28)
- {
- cov28 = (product28-two*eight)/denom28; // Cov(<2>,<8>)
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
- {
- wCov28 = cov28 * fProductOfEventWeights[pW][eW]->GetBinContent(3)
- / (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
- fCovariances[pW][eW]->SetBinContent(3,wCov28);
- }
- }
- // Cov(<4>,<6>):
- Double_t cov46 = 0.;
- Double_t wCov46 = 0.;
- if(denom46)
- {
- cov46 = (product46-four*six)/denom46; // Cov(<4>,<6>)
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
- {
- wCov46 = cov46 * fProductOfEventWeights[pW][eW]->GetBinContent(4)
- / (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
- fCovariances[pW][eW]->SetBinContent(4,wCov46);
- }
- }
- // Cov(<4>,<8>):
- Double_t cov48 = 0.;
- Double_t wCov48 = 0.;
- if(denom48)
- {
- cov48 = (product48-four*eight)/denom48; // Cov(<4>,<8>)
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
- {
- wCov48 = cov48 * fProductOfEventWeights[pW][eW]->GetBinContent(5)
- / (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
- fCovariances[pW][eW]->SetBinContent(5,wCov48);
- }
- }
- // Cov(<6>,<8>):
- Double_t cov68 = 0.;
- Double_t wCov68 = 0.;
- if(denom68)
- {
- cov68 = (product68-six*eight)/denom68; // Cov(<6>,<8>)
- if(fSumOfEventWeights[pW][eW][0]->GetBinContent(3) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
- {
- wCov68 = cov68 * fProductOfEventWeights[pW][eW]->GetBinContent(6)
- / (fSumOfEventWeights[pW][eW][0]->GetBinContent(3) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
- fCovariances[pW][eW]->SetBinContent(6,wCov68);
- }
- }
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForIntFlow(Bool_t useParticleWeights, TString eventWeights) // to be improved (there is better way to implement this method)
-{
- // From fQCorrelations[pW][eW] access measured correlations and spread, calculate statistical errors and store the
- // final results and statistical errors for correlations in fCorrelations[pW][eW] (binning is the same as in fQCorrelations[pW][eW]).
-
- // shortcuts for flags:
- Int_t pW = (Int_t)(useParticleWeights);
-
- Int_t eW = -1;
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- for(Int_t power=0;power<2;power++)
- {
- if(!(fQCorrelations[pW][eW] && fCorrelations[pW][eW] && fSumOfEventWeights[pW][eW][power]))
- {
- cout<<"WARNING: fQCorrelations[pW][eW] && fCorrelations[pW][eW] && fSumOfEventWeights[pW][eW][power] is NULL in AFAWQC::FCFIF() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"power = "<<power<<endl;
- exit(0);
- }
- }
-
- // <<2>>:
- Double_t correlation2p = fQCorrelations[pW][eW]->GetBinContent(1);
- Double_t spread2p = fQCorrelations[pW][eW]->GetBinError(1);
- Double_t sumOfEventWeightsLinear2p = fSumOfEventWeights[pW][eW][0]->GetBinContent(1);
- Double_t sumOfEventWeightsQuadratic2p = fSumOfEventWeights[pW][eW][1]->GetBinContent(1);
- // stat.error = termA * spread * termB:
- // termB = 1/sqrt(1-termA^2)
- Double_t termA2p = 0.;
- Double_t termB2p = 0.;
- Double_t statError2p = 0.;
- if(sumOfEventWeightsLinear2p)
- {
- termA2p = pow(sumOfEventWeightsQuadratic2p,0.5)/sumOfEventWeightsLinear2p;
- } else
- {
- cout<<"WARNING: sumOfEventWeightsLinear2p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
-
- if(1-pow(termA2p,2.) > 0)
- {
- termB2p = 1./pow(1-pow(termA2p,2.),0.5);
- } else
- {
- cout<<"WARNING: 1-pow(termA2p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
-
- statError2p = termA2p*spread2p*termB2p;
- fCorrelations[pW][eW]->SetBinContent(1,correlation2p);
- fCorrelations[pW][eW]->SetBinError(1,statError2p);
-
- // <<4>>:
- Double_t correlation4p = fQCorrelations[pW][eW]->GetBinContent(11);
- Double_t spread4p = fQCorrelations[pW][eW]->GetBinError(11);
- Double_t sumOfEventWeightsLinear4p = fSumOfEventWeights[pW][eW][0]->GetBinContent(2);
- Double_t sumOfEventWeightsQuadratic4p = fSumOfEventWeights[pW][eW][1]->GetBinContent(2);
- Double_t termA4p = 0.;
- Double_t termB4p = 0.;
- Double_t statError4p = 0.;
- if(sumOfEventWeightsLinear4p)
- {
- termA4p = pow(sumOfEventWeightsQuadratic4p,0.5)/sumOfEventWeightsLinear4p;
- } else
- {
- cout<<"WARNING: sumOfEventWeightsLinear4p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
- if(1-pow(termA4p,2.) > 0)
- {
- termB4p = 1./pow(1-pow(termA4p,2.),0.5);
- } else
- {
- cout<<"WARNING: 1-pow(termA4p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
-
- statError4p = termA4p*spread4p*termB4p;
- fCorrelations[pW][eW]->SetBinContent(11,correlation4p);
- fCorrelations[pW][eW]->SetBinError(11,statError4p);
-
- // <<6>>:
- Double_t correlation6p = fQCorrelations[pW][eW]->GetBinContent(24);
- Double_t spread6p = fQCorrelations[pW][eW]->GetBinError(24);
- Double_t sumOfEventWeightsLinear6p = fSumOfEventWeights[pW][eW][0]->GetBinContent(3);
- Double_t sumOfEventWeightsQuadratic6p = fSumOfEventWeights[pW][eW][1]->GetBinContent(3);
- Double_t termA6p = 0.;
- Double_t termB6p = 0.;
- Double_t statError6p = 0.;
- if(sumOfEventWeightsLinear6p)
- {
- termA6p = pow(sumOfEventWeightsQuadratic6p,0.5)/sumOfEventWeightsLinear6p;
- } else
- {
- cout<<"WARNING: sumOfEventWeightsLinear6p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
- if(1-pow(termA6p,2.) > 0)
- {
- termB6p = 1./pow(1-pow(termA6p,2.),0.5);
- } else
- {
- cout<<"WARNING: 1-pow(termA6p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
-
- statError6p = termA6p*spread6p*termB6p;
- fCorrelations[pW][eW]->SetBinContent(24,correlation6p);
- fCorrelations[pW][eW]->SetBinError(24,statError6p);
-
- // <<8>>
- Double_t correlation8p = fQCorrelations[pW][eW]->GetBinContent(31);
- Double_t spread8p = fQCorrelations[pW][eW]->GetBinError(31);
- Double_t sumOfEventWeightsLinear8p = fSumOfEventWeights[pW][eW][0]->GetBinContent(4);
- Double_t sumOfEventWeightsQuadratic8p = fSumOfEventWeights[pW][eW][1]->GetBinContent(4);
- Double_t termA8p = 0.;
- Double_t termB8p = 0.;
- Double_t statError8p = 0.;
- if(sumOfEventWeightsLinear8p)
- {
- termA8p = pow(sumOfEventWeightsQuadratic8p,0.5)/sumOfEventWeightsLinear8p;
- } else
- {
- cout<<"WARNING: sumOfEventWeightsLinear8p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
- if(1-pow(termA8p,2.) > 0)
- {
- termB8p = 1./pow(1-pow(termA8p,2.),0.5);
- } else
- {
- cout<<"WARNING: 1-pow(termA8p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
- }
-
- statError8p = termA8p*spread8p*termB8p;
- fCorrelations[pW][eW]->SetBinContent(31,correlation8p);
- fCorrelations[pW][eW]->SetBinError(31,statError8p);
-
-} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
-{
- // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
-
- // Binning of fAverageMultiplicity is organized as follows:
- // 1st bin: all events (including the empty ones)
- // 2nd bin: event with # of RPs greater or equal to 1
- // 3rd bin: event with # of RPs greater or equal to 2
- // 4th bin: event with # of RPs greater or equal to 3
- // 5th bin: event with # of RPs greater or equal to 4
- // 6th bin: event with # of RPs greater or equal to 5
- // 7th bin: event with # of RPs greater or equal to 6
- // 8th bin: event with # of RPs greater or equal to 7
- // 9th bin: event with # of RPs greater or equal to 8
-
- if(!fAvMultiplicity)
- {
- cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
- exit(0);
- }
-
- if(nRP<0)
- {
- cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
- exit(0);
- }
-
- for(Int_t i=0;i<9;i++)
- {
- if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
- }
-
-} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-{
- // a) Calculate Q-cumulants from the measured multiparticle correlations.
- // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants.
- // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
- // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)
- // is called afterwards to correct for this bias.
- // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.
- // Binning of fCumulants is organized as follows:
- //
- // 1st bin: QC{2}
- // 2nd bin: QC{4}
- // 3rd bin: QC{6}
- // 4th bin: QC{8}
-
- // shortcuts for the flags:
- Int_t pW = (Int_t)(useParticleWeights); // (0=weights not used, 1=weights used)
-
- Int_t eW = -1;
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- if(!(fCorrelations[pW][eW] && fCovariances[pW][eW] && fCumulants[pW][eW][0] && fAvMultiplicity))
- {
- cout<<"WARNING: fCorrelations[pW][eW] && fCovariances[pW][eW] && fCumulants[pW][eW][0] && fAvMultiplicity is NULL in AFAWQC::CCFIF() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- exit(0);
- }
-
- // correlations:
- Double_t two = fCorrelations[pW][eW]->GetBinContent(1); // <<2>>
- Double_t four = fCorrelations[pW][eW]->GetBinContent(11); // <<4>>
- Double_t six = fCorrelations[pW][eW]->GetBinContent(24); // <<6>>
- Double_t eight = fCorrelations[pW][eW]->GetBinContent(31); // <<8>>
-
- // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
- Double_t twoError = fCorrelations[pW][eW]->GetBinError(1); // stat. error of <2>
- Double_t fourError = fCorrelations[pW][eW]->GetBinError(11); // stat. error of <4>
- Double_t sixError = fCorrelations[pW][eW]->GetBinError(24); // stat. error of <6>
- Double_t eightError = fCorrelations[pW][eW]->GetBinError(31); // stat. error of <8>
-
- // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesForIntFlow()):
- Double_t wCov24 = fCovariances[pW][eW]->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
- Double_t wCov26 = fCovariances[pW][eW]->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
- Double_t wCov28 = fCovariances[pW][eW]->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
- Double_t wCov46 = fCovariances[pW][eW]->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
- Double_t wCov48 = fCovariances[pW][eW]->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
- Double_t wCov68 = fCovariances[pW][eW]->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
-
- // Q-cumulants:
- Double_t qc2 = 0.; // QC{2}
- Double_t qc4 = 0.; // QC{4}
- Double_t qc6 = 0.; // QC{6}
- Double_t qc8 = 0.; // QC{8}
- if(two) qc2 = two;
- if(four) qc4 = four-2.*pow(two,2.);
- if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
- if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
-
- // statistical errors of Q-cumulants:
- Double_t qc2Error = 0.;
- Double_t qc4Error = 0.;
- Double_t qc6Error = 0.;
- Double_t qc8Error = 0.;
-
- // squared statistical errors of Q-cumulants:
- //Double_t qc2ErrorSquared = 0.;
- Double_t qc4ErrorSquared = 0.;
- Double_t qc6ErrorSquared = 0.;
- Double_t qc8ErrorSquared = 0.;
-
- // statistical error of QC{2}:
- qc2Error = twoError;
-
- // statistical error of QC{4}:
- qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
- - 8.*two*wCov24;
- if(qc4ErrorSquared>=0.)
- {
- qc4Error = pow(qc4ErrorSquared,0.5);
- } else
- {
- cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;
- }
-
- // statistical error of QC{6}:
- qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
- + 81.*pow(two,2.)*pow(fourError,2.)
- + pow(sixError,2.)
- - 162.*two*(4.*pow(two,2.)-four)*wCov24
- + 18.*(4.*pow(two,2.)-four)*wCov26
- - 18.*two*wCov46;
-
- if(qc6ErrorSquared>=0.)
- {
- qc6Error = pow(qc6ErrorSquared,0.5);
- } else
- {
- cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;
- }
-
- // statistical error of QC{8}:
- qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
- + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
- + 256.*pow(two,2.)*pow(sixError,2.)
- + pow(eightError,2.)
- - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
- + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
- - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
- - 1152.*two*(4.*pow(two,2.)-four)*wCov46
- + 72.*(4.*pow(two,2.)-four)*wCov48
- - 32.*two*wCov68;
- if(qc8ErrorSquared>=0.)
- {
- qc8Error = pow(qc8ErrorSquared,0.5);
- } else
- {
- cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;
- }
-
- // store the results and statistical errors for Q-cumulants:
- fCumulants[pW][eW][0]->SetBinContent(1,qc2);
- fCumulants[pW][eW][0]->SetBinError(1,qc2Error);
- fCumulants[pW][eW][0]->SetBinContent(2,qc4);
- fCumulants[pW][eW][0]->SetBinError(2,qc4Error);
- fCumulants[pW][eW][0]->SetBinContent(3,qc6);
- fCumulants[pW][eW][0]->SetBinError(3,qc6Error);
- fCumulants[pW][eW][0]->SetBinContent(4,qc8);
- fCumulants[pW][eW][0]->SetBinError(4,qc8Error);
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
-{
- // a) Calculate the final results for integrated flow estimates from Q-cumulants.
- // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of integrated flow estimates.
- // c) Store the results and statistical errors of integrated flow estimates in histogram fIntFlow.
- // Binning of fIntFlow is organized as follows:
- //
- // 1st bin: v{2,QC}
- // 2nd bin: v{4,QC}
- // 3rd bin: v{6,QC}
- // 4th bin: v{8,QC}
-
- // shortcuts for the flags:
- Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not useed, 1=pWeights used
- Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
- Int_t eW = -1;
-
- if(eventWeights = "exact")
- {
- eW = 0;
- }
-
- if(!(fCumulants[pW][eW][nua] && fCorrelations[pW][eW] && fCovariances[pW][eW] && fIntFlow[pW][eW][nua]))
- {
- cout<<"WARNING: fCorrelations[pW][eW] && fCovariances[pW][eW] && fIntFlow[pW][eW][nua] is NULL in AFAWQC::CIF() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- exit(0);
- }
-
- // Q-cumulants:
- Double_t qc2 = fCumulants[pW][eW][nua]->GetBinContent(1); // QC{2}
- Double_t qc4 = fCumulants[pW][eW][nua]->GetBinContent(2); // QC{4}
- Double_t qc6 = fCumulants[pW][eW][nua]->GetBinContent(3); // QC{6}
- Double_t qc8 = fCumulants[pW][eW][nua]->GetBinContent(4); // QC{8}
-
- // average 2-, 4-, 6- and 8-particle azimuthal correlations:
- Double_t two = fCorrelations[pW][eW]->GetBinContent(1); // <<2>>
- Double_t four = fCorrelations[pW][eW]->GetBinContent(11); // <<4>>
- Double_t six = fCorrelations[pW][eW]->GetBinContent(24); // <<6>>
- Double_t eight = fCorrelations[pW][eW]->GetBinContent(31); // <<8>>
-
- // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
- Double_t twoError = fCorrelations[pW][eW]->GetBinError(1); // stat. error of <2>
- Double_t fourError = fCorrelations[pW][eW]->GetBinError(11); // stat. error of <4>
- Double_t sixError = fCorrelations[pW][eW]->GetBinError(24); // stat. error of <6>
- Double_t eightError = fCorrelations[pW][eW]->GetBinError(31); // stat. error of <8>
-
- // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesForIntFlow()):
- Double_t wCov24 = fCovariances[pW][eW]->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
- Double_t wCov26 = fCovariances[pW][eW]->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
- Double_t wCov28 = fCovariances[pW][eW]->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
- Double_t wCov46 = fCovariances[pW][eW]->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
- Double_t wCov48 = fCovariances[pW][eW]->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
- Double_t wCov68 = fCovariances[pW][eW]->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
-
- // integrated flow estimates:
- Double_t v2 = 0.; // v{2,QC}
- Double_t v4 = 0.; // v{4,QC}
- Double_t v6 = 0.; // v{6,QC}
- Double_t v8 = 0.; // v{8,QC}
-
- // calculate integrated flow estimates from Q-cumulants:
- if(qc2>=0.) v2 = pow(qc2,1./2.);
- if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
- if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
- if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
-
- // statistical errors of integrated flow estimates:
- Double_t v2Error = 0.; // statistical error of v{2,QC}
- Double_t v4Error = 0.; // statistical error of v{4,QC}
- Double_t v6Error = 0.; // statistical error of v{6,QC}
- Double_t v8Error = 0.; // statistical error of v{8,QC}
-
- // squares of statistical errors of integrated flow estimates:
- Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
- Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
- Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
- Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
-
- // calculate squared statistical errors of integrated flow estimates:
- if(two != 0.)
- {
- v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
- }
- if(2.*pow(two,2.)-four > 0.)
- {
- v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*
- (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
- }
- if(six-9.*four*two+12.*pow(two,3.) > 0.)
- {
- v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*
- ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
- + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
- - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
- }
- if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
- {
- v8ErrorSquared = (4./pow(33,1./4.))*(1./pow(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.),7./4.))*
- (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
- + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
- + pow(two,2.)*pow(sixError,2.)
- + (1./256.)*pow(eightError,2.)
- - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
- + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
- - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
- - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
- + (9./32.)*(4.*pow(two,2.)-four)*wCov48
- - (1./8.)*two*wCov68);
- }
-
- // calculate statistical errors of integrated flow estimates:
- if(v2ErrorSquared >= 0.)
- {
- v2Error = pow(v2ErrorSquared,0.5);
- } else
- {
- cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;
- }
- if(v4ErrorSquared >= 0.)
- {
- v4Error = pow(v4ErrorSquared,0.5);
- } else
- {
- cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;
- }
- if(v6ErrorSquared >= 0.)
- {
- v6Error = pow(v6ErrorSquared,0.5);
- } else
- {
- cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;
- }
- if(v8ErrorSquared >= 0.)
- {
- v8Error = pow(v8ErrorSquared,0.5);
- } else
- {
- cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;
- }
-
- // store the results and statistical errors of integrated flow estimates:
- fIntFlow[pW][eW][nua]->SetBinContent(1,v2);
- fIntFlow[pW][eW][nua]->SetBinError(1,v2Error);
- fIntFlow[pW][eW][nua]->SetBinContent(2,v4);
- fIntFlow[pW][eW][nua]->SetBinError(2,v4Error);
- fIntFlow[pW][eW][nua]->SetBinContent(3,v6);
- fIntFlow[pW][eW][nua]->SetBinError(3,v6Error);
- fIntFlow[pW][eW][nua]->SetBinContent(4,v8);
- fIntFlow[pW][eW][nua]->SetBinError(4,v8Error);
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
-{
- // fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
-
- // shortcuts for the flags:
- Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not useed, 1=pWeights used
- Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
- Int_t eW = -1;
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- if(!fIntFlow[pW][eW][nua])
- {
- cout<<"WARNING: fIntFlow[pW][eW][nua] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- exit(0);
- }
-
- if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
- {
- cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
- cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
- exit(0);
- }
-
- Double_t v2 = fIntFlow[pW][eW][nua]->GetBinContent(1);
- Double_t v4 = fIntFlow[pW][eW][nua]->GetBinContent(2);
- Double_t v6 = fIntFlow[pW][eW][nua]->GetBinContent(3);
- Double_t v8 = fIntFlow[pW][eW][nua]->GetBinContent(4);
-
- Double_t v2Error = fIntFlow[pW][eW][nua]->GetBinError(1);
- Double_t v4Error = fIntFlow[pW][eW][nua]->GetBinError(2);
- Double_t v6Error = fIntFlow[pW][eW][nua]->GetBinError(3);
- Double_t v8Error = fIntFlow[pW][eW][nua]->GetBinError(4);
-
- fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
- fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
- fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
- fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
-
-} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-{
- // apply correction for non-uniform acceptance to cumulants for integrated flow
- // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
-
- // shortcuts for the flags:
- Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
- Int_t eW = -1;
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
- {
- cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- exit(0);
- }
-
- // non-corrected cumulants:
- Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
- Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
- Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
- Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
- // statistical error of non-corrected cumulants:
- Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
- Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
- Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
- Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
- // corrections for non-uniform acceptance:
- Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
- Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
- Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
- Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
- // corrected cumulants:
- Double_t qc2Corrected = qc2 + qc2Correction;
- Double_t qc4Corrected = qc4 + qc4Correction;
- Double_t qc6Corrected = qc6 + qc6Correction;
- Double_t qc8Corrected = qc8 + qc8Correction;
-
- // ... to be improved (I need here also to correct error of QCs for NUA.
- // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
-
- // store corrected results and statistical errors for cumulants:
- fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
- fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
- fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
- fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
- fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
- fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
- fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
- fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
-
-} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
-{
- // print on the screen QC{n,biased}/QC{n,corrected}
-
- // shortcuts for the flags:
- Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
-
- Int_t eW = -1;
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
- {
- cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- exit(0);
- }
-
- cout<<endl;
- cout<<" Quantifying the bias to Q-cumulants from"<<endl;
- cout<<" non-uniform acceptance of the detector:"<<endl;
- cout<<endl;
-
- if(fCumulants[pW][eW][1]->GetBinContent(1))
- {
- cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
- }
- if(fCumulants[pW][eW][1]->GetBinContent(2))
- {
- cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
- }
-
- cout<<endl;
-
-} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()
-{
- // calculate all weighted correlations needed for integrated flow and store them in 1D profile fQCorrelations[1][eW] and fQExtraCorrelations[1][eW]
-
- for(Int_t eW=0;eW<2;eW++)
- {
- if(!(fQCorrelationsEBE[1] && fQCorrelations[1][eW]))
- {
- cout<<"WARNING: fQCorrelationsEBE[1] && fQCorrelations[1][eW] is NULL in AFAWQC::CWCFIF() !!!!"<<endl;
- cout<<"eW = "<<eW<<endl;
- exit(0);
- }
- }
-
- // Remark 1: binning of fQCorrelations[W] is organized as follows:
- //..............................................................................................
- // ---- bins 1-20: 2-particle correlations ----
- // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
- // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
- // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
- // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
- // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
- // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
- // ---- bins 21-40: 3-particle correlations ----
- // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
- // ---- bins 41-60: 4-particle correlations ----
- // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
- // ---- bins 61-80: 5-particle correlations ----
- // ---- bins 81-100: 6-particle correlations ----
- // ---- bins 101-120: 7-particle correlations ----
- // ---- bins 121-140: 8-particle correlations ----
- //..............................................................................................
-
- // multiplicity (number of particles used to determine the reaction plane)
- Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- Double_t dReQ1n1k = (*fReQ)(0,1);
- Double_t dReQ2n2k = (*fReQ)(1,2);
- Double_t dReQ3n3k = (*fReQ)(2,3);
- Double_t dReQ4n4k = (*fReQ)(3,4);
- Double_t dReQ1n3k = (*fReQ)(0,3);
- Double_t dImQ1n1k = (*fImQ)(0,1);
- Double_t dImQ2n2k = (*fImQ)(1,2);
- Double_t dImQ3n3k = (*fImQ)(2,3);
- Double_t dImQ4n4k = (*fImQ)(3,4);
- Double_t dImQ1n3k = (*fImQ)(0,3);
-
- // dMs are variables introduced in order to simplify some Eqs. bellow:
- //..............................................................................................
- Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
- Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
- Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
- Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
- Double_t dM31 = (*fSMpk)(0,3)*(*fSMpk)(0,1)-(*fSMpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j
- Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
- - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
- Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
- + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
- + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
- //..............................................................................................
-
- // ***********************************************
- // **** weighted multi-particle correlations: ****
- // ***********************************************
- //..............................................................................................
- // weighted 2-particle correlations:
- Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
- Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
- Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
- Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
- Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
- Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
-
- if(dMult>1)
- {
- if(dM11)
- {
- two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
-
- // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
- fQCorrelationsEBE[1]->SetBinContent(1,two1n1nW1W1);
-
- // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
- //fQCorrelationsW->Fill(0.,two1n1nW1W1,dM11);
- fQCorrelations[1][0]->Fill(0.5,two1n1nW1W1,dM11);
- }
- if(dM22)
- {
- two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
- //fQCorrelationsW->Fill(1.,two2n2nW2W2,dM22);
- fQCorrelations[1][0]->Fill(1.5,two2n2nW2W2,dM22);
- }
- if(dM33)
- {
- two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
- //fQCorrelationsW->Fill(2.,two3n3nW3W3,dM33);
- fQCorrelations[1][0]->Fill(2.5,two3n3nW3W3,dM33);
- }
- if(dM44)
- {
- two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
- //fQCorrelationsW->Fill(3.,two4n4nW4W4,dM44);
- fQCorrelations[1][0]->Fill(3.5,two4n4nW4W4,dM44);
- }
- if(dM31)
- {
- two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
- //fQCorrelationsW->Fill(4.,two1n1nW3W1,dM31);
- }
- if(dM211)
- {
- two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
- - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
- - (*fSMpk)(0,4)))/dM211;
- //fQCorrelationsW->Fill(5.,two1n1nW1W1W2,dM211);
- }
- } // end of if(dMult>1)
- //..............................................................................................
-
- //..............................................................................................
- // weighted 3-particle correlations:
- Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
-
- if(dMult>2)
- {
- if(dM211)
- {
- three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
- - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
- - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
- + 2.*(*fSMpk)(0,4))/dM211;
- //fQCorrelationsW->Fill(20.,three2n1n1nW2W1W1,dM211);
- }
- } // end of if(dMult>2)
- //..............................................................................................
-
- //..............................................................................................
- // weighted 4-particle correlations:
- Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
- if(dMult>3)
- {
- if(dM1111)
- {
- four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
- - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
- + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
- + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
- - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
- - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
-
- // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
- fQCorrelationsEBE[1]->SetBinContent(11,four1n1n1n1nW1W1W1W1);
-
- // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
- //fQCorrelationsW->Fill(40.,four1n1n1n1nW1W1W1W1,dM1111);
-
- fQCorrelations[1][0]->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
- }
- } // end of if(dMult>3)
- //..............................................................................................
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
-{
- // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
- // Remark: here we take weighted correlations!
-
- // binning of fQProductsW is organized as follows:
- //
- // 1st bin: <2><4>
- // 2nd bin: <2><6>
- // 3rd bin: <2><8>
- // 4th bin: <4><6>
- // 5th bin: <4><8>
- // 6th bin: <6><8>
-
- Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
-
- Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
- Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
- + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
- + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
-
- Double_t twoEBEW = 0.; // <2>
- Double_t fourEBEW = 0.; // <4>
-
- twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
- fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
-
- // <2><4>
- if(dMult>3)
- {
- fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
- }
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
-{
- // initialize all arrays needed to calculate the integrated flow
-
- for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
- {
- fQCorrelationsEBE[pW] = NULL;
- for(Int_t sc=0;sc<2;sc++)
- {
- fQCorrectionsEBE[pW][sc] = NULL;
- }
- for(Int_t eW=0;eW<2;eW++)
- {
- // profiles:
- fQCorrelations[pW][eW] = NULL;
- fQProducts[pW][eW] = NULL;
- for(Int_t sc=0;sc<2;sc++) // sin or cos terms
- {
- fQCorrections[pW][eW][sc] = NULL;
- }
- // histograms with results:
- fCorrelations[pW][eW] = NULL;
- fCovariances[pW][eW] = NULL;
- fCorrections[pW][eW] = NULL;
- fProductOfEventWeights[pW][eW] = NULL;
- for(Int_t power=0;power<2;power++)
- {
- fSumOfEventWeights[pW][eW][power] = NULL;
- }
- for(Int_t nua=0;nua<2;nua++) // not corrected or corrected
- {
- fCumulants[pW][eW][nua] = NULL;
- fIntFlow[pW][eW][nua] = NULL;
- }
- }
- }
-
-} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
-{
- // initialize all arrays needed to calcualted differential flow
-
- // nested lists in fDiffFlowProfiles:
- for(Int_t t=0;t<2;t++)
- {
- fDFPType[t] = NULL;
- for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
- {
- fDFPParticleWeights[t][pW] = NULL;
- for(Int_t eW=0;eW<2;eW++)
- {
- fDFPEventWeights[t][pW][eW] = NULL;
- fDiffFlowCorrelations[t][pW][eW] = NULL;
- fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
- for(Int_t sc=0;sc<2;sc++)
- {
- fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
- }
- }
- }
- }
-
- // profiles in nested lists in fDiffFlowProfiles:
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t ci=0;ci<4;ci++) // correlation index
- {
- fReducedCorrelations[t][pe][ci] = NULL;
- }
- } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
-
- for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- // correlations:
- for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
- {
- fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
- }
- // products of correlations:
- for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
- {
- fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
- }
- // correction terms:
- for(Int_t sc=0;sc<2;sc++)
- {
- for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
- {
- fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
- }
- }
- }
- }
- }
-
- // nested lists in fDiffFlowResults:
- for(Int_t t=0;t<2;t++)
- {
- fDFRType[t] = NULL;
- for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
- {
- fDFRParticleWeights[t][pW] = NULL;
- for(Int_t eW=0;eW<2;eW++)
- {
- fDFREventWeights[t][pW][eW] = NULL;
- fDiffFlowFinalCorrelations[t][pW][eW] = NULL;
- fDiffFlowFinalCorrections[t][pW][eW] = NULL;
- fDiffFlowFinalCovariances[t][pW][eW] = NULL;
- for(Int_t nua=0;nua<2;nua++)
- {
- fDFRCorrections[t][pW][eW][nua] = NULL;
- fDiffFlowFinalCumulants[t][pW][eW][nua] = NULL;
- fDiffFlowFinalFlow[t][pW][eW][nua] = NULL;
- }
- }
- }
- }
-
- // 2D and 1D histograms in nested lists in fDiffFlowResults:
- for(Int_t t=0;t<2;t++)
- {
- fNonEmptyBins2D[t] = NULL;
- for(Int_t pe=0;pe<2;pe++)
- {
- fNonEmptyBins1D[t][pe] = NULL;
- }
- for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- // correlations:
- for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
- {
- fFinalCorrelations2D[t][pW][eW][correlationIndex] = NULL;
- for(Int_t pe=0;pe<2;pe++)
- {
- fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = NULL;
- }
- }
- // corrections:
- for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
- {
- fFinalCorrections2D[t][pW][eW][correctionIndex] = NULL;
- for(Int_t pe=0;pe<2;pe++)
- {
- fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = NULL;
- }
- }
- // covariances:
- for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
- {
- fFinalCovariances2D[t][pW][eW][covarianceIndex] = NULL;
- for(Int_t pe=0;pe<2;pe++)
- {
- fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = NULL;
- }
- }
- for(Int_t nua=0;nua<2;nua++)
- {
- // cumulants:
- for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
- {
- fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = NULL;
- fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = NULL;
- fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = NULL;
- }
- // final flow:
- for(Int_t finalFlowIndex=0;finalFlowIndex<4;finalFlowIndex++)
- {
- fFinalFlow2D[t][pW][eW][nua][finalFlowIndex] = NULL;
- fFinalFlowPt[t][pW][eW][nua][finalFlowIndex] = NULL;
- fFinalFlowEta[t][pW][eW][nua][finalFlowIndex] = NULL;
- }
- }
- }
- }
- }
-
- // 1D:
- for(Int_t pe=0;pe<2;pe++) // pr or eta
- {
- for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
- {
- for(Int_t m=0;m<4;m++) // multiple of harmonic
- {
- for(Int_t k=0;k<9;k++) // power of weight
- {
- fReEBE1D[pe][t][m][k] = NULL;
- fImEBE1D[pe][t][m][k] = NULL;
- fs1D[pe][t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
- }
- }
- }
- }
-
- // 2D:
- for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
- {
- for(Int_t m=0;m<4;m++) // multiple of harmonic
- {
- for(Int_t k=0;k<9;k++) // power of weight
- {
- fReEBE2D[t][m][k] = NULL;
- fImEBE2D[t][m][k] = NULL;
- fs2D[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
- }
- }
- }
-
- // sum of event weights for reduced correlations:
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type = RP or POI
- {
- for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
- {
- for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
- {
- fSumOfEventWeightsForDiffFlow[pe][t][p][ew] = NULL;
- }
- }
- }
- }
-
- // product of both types of correlations:
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type = RP or POI
- {
- for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
- {
- for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
- {
- fQProductsForDiffFlow[pe][t][mci1][mci2] = NULL;
- }
- }
- }
- }
-
- // product of event weights for both types of correlations:
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type = RP or POI
- {
- for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
- {
- for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
- {
- fProductOfEventWeightsForDiffFlow[pe][t][mci1][mci2] = NULL;
- }
- }
- }
- }
-
-} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
-{
- // organize and book everything needed for differential flow
-
- // book and nest all lists belonging to the list fDiffFlowProfiles "Profiles":
- TList list; // to be improved (do I need this here?)
- list.SetOwner(kTRUE); // to be improved (do I need this here?)
- TString typeFlag[2] = {"RP","POI"}; // to be improved (do I need this here?)
- TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (do I need this here?)
- TString powerFlag[2] = {"1","2"}; // to be improved (do I need this here?)
- //TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"};
- TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
- TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
-
- Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
- Double_t minPtEta[2] = {fPtMin,fEtaMin};
- Double_t maxPtEta[2] = {fPtMax,fEtaMax};
-
- // reduced correlations:
- TString reducedCorrelationsName = "fReducedCorrelations";
- reducedCorrelationsName += fAnalysisLabel->Data();
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t rci=0;rci<4;rci++) // reduced correlation index
- {
- // reduced correlations:
- fReducedCorrelations[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",reducedCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",reducedCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
- fReducedCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
- fDiffFlowList->Add(fReducedCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
- } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
- } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
- } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
-
-
- // reduced correlations e-b-e (to be improved (implement a new method to book separately e-b-e quantities)):
- TString reducedCorrelationsEBEName = "fReducedCorrelationsEBE";
- reducedCorrelationsEBEName += fAnalysisLabel->Data();
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t rci=0;rci<4;rci++) // reduced correlation index
- {
- // reduced correlations:
- fReducedCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, %s",reducedCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",reducedCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
- } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
- } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
- } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
-
- // sums of event weights for reduced correlations:
- TString sumOfEventWeightsForDiffFlowName = "fSumOfEventWeightsForDiffFlow";
- sumOfEventWeightsForDiffFlowName += fAnalysisLabel->Data();
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type is RP or POI
- {
- for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
- {
- for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
- {
- fSumOfEventWeightsForDiffFlow[pe][t][p][ew] = new TH1D(Form("%s, %s, %s, %s, %s",sumOfEventWeightsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),Form("%s, %s, %s, power = %s, %s",sumOfEventWeightsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
- fSumOfEventWeightsForDiffFlow[pe][t][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
- fDiffFlowList->Add(fSumOfEventWeightsForDiffFlow[pe][t][p][ew]); // to be improved (add dedicated list to hold all this)
- }
- }
- }
- }
-
- // products of both types of correlations:
- TString qProductsForDiffFlowName = "fQProductsForDiffFlow";
- qProductsForDiffFlowName += fAnalysisLabel->Data();
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type is RP or POI
- {
- for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
- {
- for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
- {
- fQProductsForDiffFlow[pe][t][mci1][mci2] = new TProfile(Form("%s, %s, %s, %s, %s",qProductsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",qProductsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
- fQProductsForDiffFlow[pe][t][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
- fDiffFlowList->Add(fQProductsForDiffFlow[pe][t][mci1][mci2]); // to be improved (add dedicated list to hold all this)
-
- if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
- }
- }
- }
- }
-
- // products of event weights for both types of correlations:
- TString productOfEventWeightsForDiffFlowName = "fProductOfEventWeightsForDiffFlow";
- productOfEventWeightsForDiffFlowName += fAnalysisLabel->Data();
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<2;t++) // type is RP or POI
- {
- for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
- {
- for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
- {
- fProductOfEventWeightsForDiffFlow[pe][t][mci1][mci2] = new TH1D(Form("%s, %s, %s, %s, %s",productOfEventWeightsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",productOfEventWeightsForDiffFlowName.Data(),ptEtaFlag[pe].Data(),typeFlag[t].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
- fProductOfEventWeightsForDiffFlow[pe][t][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
- fDiffFlowList->Add(fProductOfEventWeightsForDiffFlow[pe][t][mci1][mci2]); // to be improved (add dedicated list to hold reduced correlations)
- if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
- }
- }
- }
- }
-
- TString pWeightsFlag[2] = {"not used","used"}; // to be improved (do I need this here?)
- TString eWeightsFlag[2] = {"exact","non-exact"}; // to be improved (do I need this here?)
- //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (do I need this here?)
- TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance // to be improved (do I need this here?)
-
- // book all 1D profiles:
- // pt:
- TProfile styleProfilePt("","",fnBinsPt,fPtMin,fPtMax);
- styleProfilePt.SetXTitle("p_{t}");
- // eta:
- TProfile styleProfileEta("","",fnBinsEta,fEtaMin,fEtaMax);
- styleProfileEta.SetXTitle("#eta");
-
-
-
- // book all 2D profiles and add to appropriate lists:
- TProfile2D styleProfile("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
- styleProfile.SetXTitle("p_{t}");
- styleProfile.SetYTitle("#eta");
- TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};
- TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
- TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};
- TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};
- TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};
- TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};
- TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
- TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
-
- // profile to hold flags for diffrential flow:
- TString fFlagsForDiffFlowName = "fFlagsForDiffFlowQC";
- fFlagsForDiffFlowName += fAnalysisLabel->Data();
- fFlagsForDiffFlow = new TProfile(fFlagsForDiffFlowName.Data(),"Flags for differential flow",10,0,10);
- fFlagsForDiffFlow->SetLabelSize(0.06);
- (fFlagsForDiffFlow->GetXaxis())->SetBinLabel(1,"2D Flow");
- fFlagsForDiffFlow->Fill(0.5,(Int_t)fCalculate2DFlow);
- fDiffFlowList->Add(fFlagsForDiffFlow);
-
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // weights: not used or used
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- // correlations:
- for(Int_t correlIndex=0;correlIndex<4;correlIndex++)
- {
- fCorrelationsPro[t][pW][eW][correlIndex] = (TProfile2D*)styleProfile.Clone(correlationName[correlIndex].Data());
- fCorrelationsPro[t][pW][eW][correlIndex]->SetTitle(correlationName[correlIndex].Data());
- fDiffFlowCorrelations[t][pW][eW]->Add(fCorrelationsPro[t][pW][eW][correlIndex]);
- }
- // products of correlations:
- for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)
- {
- fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = (TProfile2D*)styleProfile.Clone(productOfCorrelationsName[productOfCorrelationsIndex].Data());
- fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]->SetTitle(productOfCorrelationsName[productOfCorrelationsIndex].Data());
- fDiffFlowProductsOfCorrelations[t][pW][eW]->Add(fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]);
- }
- // correction terms:
- for(Int_t sc=0;sc<2;sc++)
- {
- for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
- {
- if(sc==0)
- {
- fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsSinTermsName[correctionsIndex].Data());
- fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsSinTermsName[correctionsIndex].Data());
- fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);
- }
- if(sc==1)
- {
- fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsCosTermsName[correctionsIndex].Data());
- fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsCosTermsName[correctionsIndex].Data());
- fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);
- }
- }
- }
- }
- }
- }
-
- // book all 2D and 1D histograms for final results and store them in appropriate lists:
- TH2D styleHistPtEta("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
- styleHistPtEta.SetXTitle("p_{t}");
- styleHistPtEta.SetYTitle("#eta");
- TH1D styleHistPt("","",fnBinsPt,fPtMin,fPtMax);
- styleHistPt.SetXTitle("p_{t}");
- TH1D styleHistEta("","",fnBinsEta,fEtaMin,fEtaMax);
- styleHistEta.SetXTitle("#eta");
- for(Int_t t=0;t<2;t++) // RP or POI
- {
- // 2D:
- fNonEmptyBins2D[t] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",typeFlag[t].Data()));
- fNonEmptyBins2D[t]->SetTitle(Form("Non-empty bins: %s (p_{t},#eta)",typeFlag[t].Data()));
- fDFRType[t]->Add(fNonEmptyBins2D[t]);
- // 1D:
- fNonEmptyBins1D[t][0] = (TH1D*)styleHistPt.Clone(Form("%s, p_{t}",typeFlag[t].Data()));
- fNonEmptyBins1D[t][0]->SetTitle(Form("Non-empty bins: %s (p_{t})",typeFlag[t].Data()));
- fDFRType[t]->Add(fNonEmptyBins1D[t][0]);
- fNonEmptyBins1D[t][1] = (TH1D*)styleHistEta.Clone(Form("%s, #eta",typeFlag[t].Data()));
- fNonEmptyBins1D[t][1]->SetTitle(Form("Non-empty bins: %s (#eta)",typeFlag[t].Data()));
- fDFRType[t]->Add(fNonEmptyBins1D[t][1]);
-
- for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used or used
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- // correlations:
- for(Int_t correlIndex=0;correlIndex<4;correlIndex++)
- {
- // 2D:
- fFinalCorrelations2D[t][pW][eW][correlIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correlationName[correlIndex].Data()));
- fFinalCorrelations2D[t][pW][eW][correlIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correlationName[correlIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations2D[t][pW][eW][correlIndex]);
- // 1D:
- for(Int_t pe=0;pe<2;pe++) // pt or eta:
- {
- if(pe==0)
- {
- fFinalCorrelations1D[t][pW][eW][pe][correlIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correlationName[correlIndex].Data()));
- fFinalCorrelations1D[t][pW][eW][pe][correlIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correlationName[correlIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlIndex]);
- }
- if(pe==1)
- {
- fFinalCorrelations1D[t][pW][eW][pe][correlIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correlationName[correlIndex].Data()));
- fFinalCorrelations1D[t][pW][eW][pe][correlIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correlationName[correlIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlIndex]);
- }
- }
- }
- // corrections:
- for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
- {
- // 2D:
- fFinalCorrections2D[t][pW][eW][correctionIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data()));
- fFinalCorrections2D[t][pW][eW][correctionIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections2D[t][pW][eW][correctionIndex]);
- // 1D:
- for(Int_t pe=0;pe<2;pe++) // pt or eta:
- {
- if(pe==0)
- {
- fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correctionName[correctionIndex].Data()));
- fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]);
- }
- if(pe==1)
- {
- fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correctionName[correctionIndex].Data()));
- fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]);
- }
- }
- }
- // covariances:
- for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
- {
- // 2D:
- fFinalCovariances2D[t][pW][eW][covarianceIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data()));
- fFinalCovariances2D[t][pW][eW][covarianceIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances2D[t][pW][eW][covarianceIndex]);
- // 1D:
- for(Int_t pe=0;pe<2;pe++) // pt or eta:
- {
- if(pe==0)
- {
- fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data()));
- fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]);
- }
- if(pe==1)
- {
- fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",covarianceName[covarianceIndex].Data()));
- fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]);
- }
- }
- }
- for(Int_t nua=0;nua<2;nua++) // corrected or not
- {
- // cumulants:
- for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
- {
- // 2D:
- fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data()));
- fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]);
- // pt:
- fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data()));
- fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]);
- // eta:
- fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",cumulantName[cumulantIndex].Data()));
- fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]);
- }
- // flow:
- for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
- {
- // 2D:
- fFinalFlow2D[t][pW][eW][nua][flowIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data()));
- fFinalFlow2D[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlow2D[t][pW][eW][nua][flowIndex]);
- // pt:
- fFinalFlowPt[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",flowName[flowIndex].Data()));
- fFinalFlowPt[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowPt[t][pW][eW][nua][flowIndex]);
- // eta:
- fFinalFlowEta[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",flowName[flowIndex].Data()));
- fFinalFlowEta[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowEta[t][pW][eW][nua][flowIndex]);
- }
- }
- }
- }
- }
-
- // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
- // Explanantion of notation:
- // 1.) n is harmonic, m is multiple of harmonic;
- // 2.) k is power of weight;
- // 3.) r_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for RPs in particular (pt,eta) bin (i-th RP is weighted with w_i^k);
- // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
- // (if i-th POI is also RP, than it is weighted with w_i^k);
- // 5.) q_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for particles which are both RPs and POIs in particular (pt,eta) bin
- // (i-th RP&&POI is weighted with w_i^k)
-
- // 1D:
- //Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta}; // to be improved (removed)
- //Double_t minPtEta[2] = {fPtMin,fEtaMin}; // to be improved (removed)
- //Double_t maxPtEta[2] = {fPtMax,fEtaMax}; // to be improved (removed)
-
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
- {
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE1D[pe][t][m][k] = new TProfile(Form("pteta%dTypeFlag%dmultiple%dpower%dRe",pe,t,m,k),Form("pteta%dTypeFlag%dmultiple%dpower%dRe",pe,t,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
- fImEBE1D[pe][t][m][k] = new TProfile(Form("pteta%dTypeFlag%dmultiple%dpower%dIm",pe,t,m,k),Form("pteta%dTypeFlag%dmultiple%dpower%dIm",pe,t,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
- }
- }
- }
- }
-
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
- {
- for(Int_t k=0;k<9;k++)
- {
- fs1D[pe][t][k] = new TProfile(Form("pteta%dTypeFlag%dmultiple%d",pe,t,k),Form("pteta%dTypeFlag%dmultiple%d",pe,t,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
- }
- }
- }
-
- // 2D:
- TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
- TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
-
- for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
- {
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- fReEBE2D[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
- fImEBE2D[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
- }
- }
- }
-
- TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
-
- for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
- {
- for(Int_t k=0;k<9;k++)
- {
- fs2D[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
- }
- }
-
-} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
-{
- // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
-
- Int_t typeFlag = -1;
-
- // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
- // index:
- // 0: <2'>
- // 1: <4'>
-
- // multiplicity:
- Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- Double_t dReQ1n = (*fReQ)(0,0);
- Double_t dReQ2n = (*fReQ)(1,0);
- //Double_t dReQ3n = (*fReQ)(2,0);
- //Double_t dReQ4n = (*fReQ)(3,0);
- Double_t dImQ1n = (*fImQ)(0,0);
- Double_t dImQ2n = (*fImQ)(1,0);
- //Double_t dImQ3n = (*fImQ)(2,0);
- //Double_t dImQ4n = (*fImQ)(3,0);
-
- // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
- Double_t p1n0kRe = 0.;
- Double_t p1n0kIm = 0.;
-
- // number of POIs in particular (pt,eta) bin:
- Double_t mp = 0.;
-
- // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin):
- Double_t q1n0kRe = 0.;
- Double_t q1n0kIm = 0.;
- Double_t q2n0kRe = 0.;
- Double_t q2n0kIm = 0.;
-
- // number of particles which are both RPs and POIs in particular (pt,eta) bin:
- Double_t mq = 0.;
-
- // q_{m*n,0}:
- q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
- * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
- q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
- * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
- q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
- * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
- q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
- * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
-
- mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
-
- if(type == "POI")
- {
- // p_{m*n,0}:
- p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
- * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
- p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
- * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
-
- mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
-
- typeFlag = 1;
- }
- else if(type == "RP")
- {
- // p_{m*n,0} = q_{m*n,0}:
- p1n0kRe = q1n0kRe;
- p1n0kIm = q1n0kIm;
- mp = mq;
-
- typeFlag = 0;
- }
-
- // count events with non-empty (pt,eta) bin:
- if(mp>0)
- {
- fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
- }
-
- // 2'-particle correlation for particular (pt,eta) bin:
- Double_t two1n1nPtEta = 0.;
- if(mp*dMult-mq)
- {
- two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
- / (mp*dMult-mq);
-
- // fill the 2D profile to get the average correlation for each (pt,eta) bin:
- if(type == "POI")
- {
- //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
-
- fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
- }
- else if(type == "RP")
- {
- //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
- fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
- }
- } // end of if(mp*dMult-mq)
-
- // 4'-particle correlation:
- Double_t four1n1n1n1nPtEta = 0.;
- if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
- {
- four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
- - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
- - 2.*q2n0kIm*dReQ1n*dImQ1n
- - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
- + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
- - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
- - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
- + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
- + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
- + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
- + 2.*mq*dMult
- - 6.*mq)
- / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- // fill the 2D profile to get the average correlation for each (pt, eta) bin:
- if(type == "POI")
- {
- //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
- }
- else if(type == "RP")
- {
- //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
- (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
- }
- } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
-
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
-{
- // calculate all weighted correlations needed for differential flow
-
- // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- Double_t dReQ1n1k = (*fReQ)(0,1);
- Double_t dReQ2n2k = (*fReQ)(1,2);
- Double_t dReQ1n3k = (*fReQ)(0,3);
- //Double_t dReQ4n4k = (*fReQ)(3,4);
- Double_t dImQ1n1k = (*fImQ)(0,1);
- Double_t dImQ2n2k = (*fImQ)(1,2);
- Double_t dImQ1n3k = (*fImQ)(0,3);
- //Double_t dImQ4n4k = (*fImQ)(3,4);
-
- // S^M_{p,k} (see .h file for the definition of fSMpk):
- Double_t dSM1p1k = (*fSMpk)(0,1);
- Double_t dSM1p2k = (*fSMpk)(0,2);
- Double_t dSM1p3k = (*fSMpk)(0,3);
- Double_t dSM2p1k = (*fSMpk)(1,1);
- Double_t dSM3p1k = (*fSMpk)(2,1);
-
- // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
- Double_t p1n0kRe = 0.;
- Double_t p1n0kIm = 0.;
-
- // number of POIs in particular (pt,eta) bin):
- Double_t mp = 0.;
-
- // real and imaginary parts of q_{m*n,k}:
- // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
- Double_t q1n2kRe = 0.;
- Double_t q1n2kIm = 0.;
- Double_t q2n1kRe = 0.;
- Double_t q2n1kIm = 0.;
-
- // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
- Double_t s1p1k = 0.;
- Double_t s1p2k = 0.;
- Double_t s1p3k = 0.;
-
- // M0111 from Eq. (118) in QC2c (to be improved (notation))
- Double_t dM0111 = 0.;
-
- if(type == "POI")
- {
- // p_{m*n,0}:
- p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
- * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
- p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
- * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
-
- mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
-
- // q_{m*n,k}:
- q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
- * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
- q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
- * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
- q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
- * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
- q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
- * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
-
- // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
- s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
- s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
- s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
-
- // M0111 from Eq. (118) in QC2c (to be improved (notation)):
- dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
- - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
- + 2.*(s1p3k-s1p2k*dSM1p1k));
- }
- else if(type == "RP")
- {
- p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
- * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
- p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
- * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
-
- mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
-
- // q_{m*n,k}:
- q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
- * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
- q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
- * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
- q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
- * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
- q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
- * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
-
- // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
- s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
- s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
- s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
-
- // M0111 from Eq. (118) in QC2c (to be improved (notation)):
- dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
- - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
- + 2.*(s1p3k-s1p2k*dSM1p1k));
- //...............................................................................................
- }
-
- // 2'-particle correlation:
- Double_t two1n1nW0W1PtEta = 0.;
- if(mp*dSM1p1k-s1p1k)
- {
- two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
- / (mp*dSM1p1k-s1p1k);
-
- // fill the 2D profile to get the average correlation for each (pt, eta) bin:
- if(type == "POI")
- {
- //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
- // mp*dSM1p1k-s1p1k);
- fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
- }
- else if(type == "RP")
- {
- //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
- // mp*dSM1p1k-s1p1k);
- fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
- }
- } // end of if(mp*dMult-dmPrimePrimePtEta)
-
- // 4'-particle correlation:
- Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
- if(dM0111)
- {
- four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
- - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
- - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
- - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
- + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
- - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
- - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
- + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
- + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
- + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
- + 2.*s1p1k*dSM1p2k
- - 6.*s1p3k)
- / dM0111; // to be imropoved (notation of dM0111)
-
- // fill the 2D profile to get the average correlation for each (pt, eta) bin:
- if(type == "POI")
- {
- //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
- fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
- }
- else if(type == "RP")
- {
- //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
- fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
- }
- } // end of if(dM0111)
-
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
-{
- // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
- // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
- // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
-
- Int_t typeFlag = -1;
- Int_t pWeightsFlag = -1;
- Int_t eWeightsFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- } else
- {
- cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
- exit(0);
- }
-
- if(!useParticleWeights)
- {
- pWeightsFlag = 0;
- } else
- {
- pWeightsFlag = 1;
- }
-
- if(eventWeights == "exact")
- {
- eWeightsFlag = 0;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pW = pWeightsFlag;
- Int_t eW = eWeightsFlag;
-
- // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
- // pt:
- for(Int_t p=1;p<fnBinsPt;p++)
- {
- Double_t contentPt = 0.;
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
- }
- fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
- }
- // eta:
- for(Int_t e=1;e<fnBinsEta;e++)
- {
- Double_t contentEta = 0.;
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
- }
- fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
- }
-
- // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
- TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
-
- for(Int_t pe=0;pe<2;pe++) // pt or eta
- {
- for(Int_t ci=0;ci<4;ci++) // correlation index
- {
- if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
- if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
- }
- }
-
- // transfer 2D profile into 2D histogram:
- // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
- for(Int_t ci=0;ci<4;ci++)
- {
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
- Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
- Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
- Double_t error = 0.;
- fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
- if(nEvts>0)
- {
- error = spread/pow(nEvts,0.5);
- fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
- }
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
- } // end of for(Int_t ci=0;ci<4;ci++)
-
- // transfer 1D profile into 1D histogram (pt):
- // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
- for(Int_t ci=0;ci<4;ci++)
- {
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- if(profile[0][ci])
- {
- Double_t correlation = profile[0][ci]->GetBinContent(p);
- Double_t spread = profile[0][ci]->GetBinError(p);
- Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
- Double_t error = 0.;
- fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
- if(nEvts>0)
- {
- error = spread/pow(nEvts,0.5);
- fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
- }
- }
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
- } // end of for(Int_t ci=0;ci<4;ci++)
-
- // transfer 1D profile into 1D histogram (eta):
- // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
- for(Int_t ci=0;ci<4;ci++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- if(profile[1][ci])
- {
- Double_t correlation = profile[1][ci]->GetBinContent(e);
- fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
- }
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t ci=0;ci<4;ci++)
-
-} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCumulantsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
-{
- // calcualate cumulants for differential flow from measured correlations
- // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
-
- Int_t typeFlag = -1;
- Int_t pWeightsFlag = -1;
- Int_t eWeightsFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- } else
- {
- cout<<"WARNING: type must be either RP or POI in AFAWQC::CCFDF() !!!!"<<endl;
- exit(0);
- }
-
- if(!useParticleWeights)
- {
- pWeightsFlag = 0;
- } else
- {
- pWeightsFlag = 1;
- }
-
- if(eventWeights == "exact")
- {
- eWeightsFlag = 0;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pW = pWeightsFlag;
- Int_t eW = eWeightsFlag;
-
- // correlation <<2>>:
- Double_t two = fQCorrelations[pW][eW]->GetBinContent(1);
-
- /*
- // 2D (pt,eta):
- // to be improved (see documentation if I can do all this without looping)
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // reduced correlations:
- Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
- Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
- for(Int_t nua=0;nua<2;nua++)
- {
- // QC{2'}:
- Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
- fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
- // QC{4'}:
- Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
- fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
- } // end of for(Int_t nua=0;nua<2;nua++)
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
- */
-
- // 1D (pt):
- // to be improved (see documentation if I can do all this without looping)
- // to be improved (treat pt and eta in one go)
- // to be improved (combine loops over nua for 2D and 1D)
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- // reduced correlations:
- Double_t twoPrime = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinContent(p); // <<2'>>(pt)
- Double_t fourPrime = fFinalCorrelations1D[t][pW][eW][0][1]->GetBinContent(p); // <<4'>>(pt)
- // final statistical error of reduced correlations:
- Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
- for(Int_t nua=0;nua<2;nua++)
- {
- // QC{2'}:
- Double_t qc2Prime = twoPrime; // QC{2'}
- Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
- fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinContent(p,qc2Prime);
- fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
- // QC{4'}:
- Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
- fFinalCumulantsPt[t][pW][eW][nua][1]->SetBinContent(p,qc4Prime);
- } // end of for(Int_t nua=0;nua<2;nua++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
-
- // 1D (eta):
- // to be improved (see documentation if I can do all this without looping)
- // to be improved (treat pt and eta in one go)
- // to be improved (combine loops over nua for 2D and 1D)
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // reduced correlations:
- Double_t twoPrime = fFinalCorrelations1D[t][pW][eW][1][0]->GetBinContent(e); // <<2'>>(eta)
- Double_t fourPrime = fFinalCorrelations1D[t][pW][eW][1][1]->GetBinContent(e); // <<4'>>(eta)
- // final statistical error of reduced correlations:
- Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][1][0]->GetBinError(e);
- for(Int_t nua=0;nua<2;nua++)
- {
- // QC{2'}:
- Double_t qc2Prime = twoPrime; // QC{2'}
- Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
- fFinalCumulantsEta[t][pW][eW][nua][0]->SetBinContent(e,qc2Prime);
- fFinalCumulantsEta[t][pW][eW][nua][0]->SetBinError(e,qc2PrimeError);
- // QC{4'}:
- Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
- fFinalCumulantsEta[t][pW][eW][nua][1]->SetBinContent(e,qc4Prime);
- } // end of for(Int_t nua=0;nua<2;nua++)
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
-
-
-} // end of void AliFlowAnalysisWithQCumulants::CalculateCumulantsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights);
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
-{
- // calculate final results for integrated flow of RPs and POIs
-
- Int_t typeFlag = -1;
- Int_t pWeightsFlag = -1;
- Int_t eWeightsFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- } else
- {
- cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
- exit(0);
- }
-
- if(!useParticleWeights)
- {
- pWeightsFlag = 0;
- } else
- {
- pWeightsFlag = 1;
- }
-
- if(eventWeights == "exact")
- {
- eWeightsFlag = 0;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pW = pWeightsFlag;
- Int_t eW = eWeightsFlag;
-
- // pt yield:
- TH1F *yield2ndPt = NULL;
- TH1F *yield4thPt = NULL;
- TH1F *yield6thPt = NULL;
- TH1F *yield8thPt = NULL;
-
- if(type == "POI")
- {
- yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
- yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
- yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
- yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
- }
- else if(type == "RP")
- {
- yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
- yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
- yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
- yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
- }
-
- Int_t nBinsPt = yield2ndPt->GetNbinsX();
-
- TH1D *flow2ndPt = NULL;
- TH1D *flow4thPt = NULL;
- TH1D *flow6thPt = NULL;
- TH1D *flow8thPt = NULL;
-
- // to be improved (nua = 0 is hardwired)
- flow2ndPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][0]->Clone();
- flow4thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][1]->Clone();
- flow6thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][2]->Clone();
- flow8thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][3]->Clone();
-
- Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
- Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
-
- Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
- Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
-
- Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
- Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
-
- // looping over pt bins:
- for(Int_t p=1;p<nBinsPt+1;p++)
- {
- dvn2nd = flow2ndPt->GetBinContent(p);
- dvn4th = flow4thPt->GetBinContent(p);
- dvn6th = flow6thPt->GetBinContent(p);
- dvn8th = flow8thPt->GetBinContent(p);
-
- dErrvn2nd = flow2ndPt->GetBinError(p);
- dErrvn4th = flow4thPt->GetBinError(p);
- dErrvn6th = flow6thPt->GetBinError(p);
- dErrvn8th = flow8thPt->GetBinError(p);
-
- dYield2nd = yield2ndPt->GetBinContent(p);
- dYield4th = yield4thPt->GetBinContent(p);
- dYield6th = yield6thPt->GetBinContent(p);
- dYield8th = yield8thPt->GetBinContent(p);
-
- dVn2nd += dvn2nd*dYield2nd;
- dVn4th += dvn4th*dYield4th;
- dVn6th += dvn6th*dYield6th;
- dVn8th += dvn8th*dYield8th;
-
- dSum2nd += dYield2nd;
- dSum4th += dYield4th;
- dSum6th += dYield6th;
- dSum8th += dYield8th;
-
- dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
- dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
- dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
- dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
-
- } // end of for(Int_t p=1;p<nBinsPt+1;p++)
-
- // normalizing the results for integrated flow:
- if(dSum2nd)
- {
- dVn2nd /= dSum2nd;
- dErrVn2nd /= (dSum2nd*dSum2nd);
- dErrVn2nd = TMath::Sqrt(dErrVn2nd);
- }
- if(dSum4th)
- {
- dVn4th /= dSum4th;
- dErrVn4th /= (dSum4th*dSum4th);
- dErrVn4th = TMath::Sqrt(dErrVn4th);
- }
- //if(dSum6th) dVn6th/=dSum6th;
- //if(dSum8th) dVn8th/=dSum8th;
-
- /*
- // storing the results for integrated flow:
- if(!(useParticleWeights))
- {
- if(type == "POI")
- {
- // 2nd:
- fIntFlowResultsPOIQC->SetBinContent(1,dVn2nd);
- fIntFlowResultsPOIQC->SetBinError(1,dSd2nd);
- // 4th:
- fIntFlowResultsPOIQC->SetBinContent(2,dVn4th);
- fIntFlowResultsPOIQC->SetBinError(2,dSd4th);
- // 6th:
- fIntFlowResultsPOIQC->SetBinContent(3,dVn6th);
- fIntFlowResultsPOIQC->SetBinError(3,dSd6th);
- // 8th:
- fIntFlowResultsPOIQC->SetBinContent(4,dVn8th);
- fIntFlowResultsPOIQC->SetBinError(4,dSd8th);
- }
- else if (type == "RP")
- {
- // 2nd:
- fIntFlowResultsRPQC->SetBinContent(1,dVn2nd);
- fIntFlowResultsRPQC->SetBinError(1,dSd2nd);
- // 4th:
- fIntFlowResultsRPQC->SetBinContent(2,dVn4th);
- fIntFlowResultsRPQC->SetBinError(2,dSd4th);
- // 6th:
- fIntFlowResultsRPQC->SetBinContent(3,dVn6th);
- fIntFlowResultsRPQC->SetBinError(3,dSd6th);
- // 8th:
- fIntFlowResultsRPQC->SetBinContent(4,dVn8th);
- fIntFlowResultsRPQC->SetBinError(4,dSd8th);
- }
- }
- else if (useParticleWeights)
- {
- if(type == "POI")
- {
- // 2nd:
- fIntFlowResultsPOIQCW->SetBinContent(1,dVn2nd);
- fIntFlowResultsPOIQCW->SetBinError(1,dSd2nd);
- // 4th:
- fIntFlowResultsPOIQCW->SetBinContent(2,dVn4th);
- fIntFlowResultsPOIQCW->SetBinError(2,dSd4th);
- // 6th:
- fIntFlowResultsPOIQCW->SetBinContent(3,dVn6th);
- fIntFlowResultsPOIQCW->SetBinError(3,dSd6th);
- // 8th:
- fIntFlowResultsPOIQCW->SetBinContent(4,dVn8th);
- fIntFlowResultsPOIQCW->SetBinError(4,dSd8th);
- }
- else if (type == "RP")
- {
- // 2nd:
- fIntFlowResultsRPQCW->SetBinContent(1,dVn2nd);
- fIntFlowResultsRPQCW->SetBinError(1,dSd2nd);
- // 4th:
- fIntFlowResultsRPQCW->SetBinContent(2,dVn4th);
- fIntFlowResultsRPQCW->SetBinError(2,dSd4th);
- // 6th:
- fIntFlowResultsRPQCW->SetBinContent(3,dVn6th);
- fIntFlowResultsRPQCW->SetBinError(3,dSd6th);
- // 8th:
- fIntFlowResultsRPQCW->SetBinContent(4,dVn8th);
- fIntFlowResultsRPQCW->SetBinError(4,dSd8th);
- }
- }
- */
-
- // storing the results for integrated flow in common histos:
- // to be improved - now they are being filled twice ...
- if(type == "POI")
- {
- fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
- fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
- fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
- fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
- }
- else if (type == "RP")
- {
- fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
- fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
- fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
- fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
- }
-
- delete flow2ndPt;
- delete flow4thPt;
- //delete flow6thPt;
- //delete flow8thPt;
-
- delete yield2ndPt;
- delete yield4thPt;
- delete yield6thPt;
- delete yield8thPt;
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
-{
- // initialize arrays used for distributions:
-
- for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
- {
- for(Int_t eW=0;eW<2;eW++)
- {
- for(Int_t di=0;di<4;di++) // distribution index
- {
- fDistributions[pW][eW][di] = NULL;
- }
- }
- }
-
-} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
-{
- // book all histograms for distributions
-
- /*
- //weighted <2>_{n|n} distribution
- f2pDistribution = new TH1D("f2pDistribution","<2>_{n|n} distribution",100000,-0.02,0.1);
- f2pDistribution->SetXTitle("<2>_{n|n}");
- f2pDistribution->SetYTitle("Counts");
- fHistList->Add(f2pDistribution);
-
- //weighted <4>_{n,n|n,n} distribution
- f4pDistribution = new TH1D("f4pDistribution","<4>_{n,n|n,n} distribution",100000,-0.00025,0.002);
- f4pDistribution->SetXTitle("<4>_{n,n|n,n}");
- f4pDistribution->SetYTitle("Counts");
- fHistList->Add(f4pDistribution);
-
- //weighted <6>_{n,n,n|n,n,n} distribution
- f6pDistribution = new TH1D("f6pDistribution","<6>_{n,n,n|n,n,n} distribution",100000,-0.000005,0.000025);
- f6pDistribution->SetXTitle("<6>_{n,n,n|n,n,n}");
- f6pDistribution->SetYTitle("Counts");
- fHistList->Add(f6pDistribution);
-
- //weighted <8>_{n,n,n,n|n,n,n,n} distribution
- f8pDistribution = new TH1D("f8pDistribution","<8>_{n,n,n,n|n,n,n,n} distribution",100000,-0.000000001,0.00000001);
- f8pDistribution->SetXTitle("<8>_{n,n,n,n|n,n,n,n}");
- f8pDistribution->SetYTitle("Counts");
- fHistList->Add(f8pDistribution);
- */
-
-} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
-{
- // book and nest all lists in fHistList
-
- // booking and nesting:
- fWeightsList->SetName("Weights");
- fWeightsList->SetOwner(kTRUE);
- fHistList->Add(fWeightsList);
-
- fIntFlowList = new TList();
- fIntFlowList->SetName("Integrated Flow");
- fIntFlowList->SetOwner(kTRUE);
- fHistList->Add(fIntFlowList);
-
- fIntFlowResults = new TList();
- fIntFlowResults->SetName("Results");
- fIntFlowResults->SetOwner(kTRUE);
- fIntFlowList->Add(fIntFlowResults);
-
- fIntFlowProfiles = new TList();
- fIntFlowProfiles->SetName("Profiles");
- fIntFlowProfiles->SetOwner(kTRUE);
- fIntFlowList->Add(fIntFlowProfiles);
-
- fDiffFlowList = new TList();
- fDiffFlowList->SetName("Differential Flow");
- fDiffFlowList->SetOwner(kTRUE);
- fHistList->Add(fDiffFlowList);
-
- fDiffFlowProfiles = new TList();
- fDiffFlowProfiles->SetName("Profiles");
- fDiffFlowProfiles->SetOwner(kTRUE);
- fDiffFlowList->Add(fDiffFlowProfiles);
-
- fDiffFlowResults = new TList();
- fDiffFlowResults->SetName("Results");
- fDiffFlowResults->SetOwner(kTRUE);
- fDiffFlowList->Add(fDiffFlowResults);
-
- fDistributionsList = new TList();
- fDistributionsList->SetName("Distributions");
- fDistributionsList->SetOwner(kTRUE);
- fHistList->Add(fDistributionsList);
-
- fNestedLoopsList = new TList();
- fNestedLoopsList->SetName("Nested Loops");
- fNestedLoopsList->SetOwner(kTRUE);
- fHistList->Add(fNestedLoopsList);
-
- // flags for naming nested lists:
- TList list;
- list.SetOwner(kTRUE);
- TString typeFlag[2] = {"RP","POI"};
- TString pWeightsFlag[2] = {"not used","used"};
- TString eWeightsFlag[2] = {"exact","non-exact"};
- TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance
- TString sinCosFlag[2] = {"sin","cos"};
-
- // nested lists in fDiffFlowProfiles (Differential Flow/Profiles):
- for(Int_t t=0;t<2;t++) // type: RP or POI
- {
- fDFPType[t] = (TList*)list.Clone();
- fDFPType[t]->SetName(Form("%s",typeFlag[t].Data()));
- fDiffFlowProfiles->Add(fDFPType[t]);
- for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // weights: not used or used
- {
- fDFPParticleWeights[t][pW] = (TList*)list.Clone();
- fDFPParticleWeights[t][pW]->SetName(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data()));
- fDFPType[t]->Add(fDFPParticleWeights[t][pW]);
- for(Int_t eW=0;eW<2;eW++)
- {
- fDFPEventWeights[t][pW][eW] = (TList*)list.Clone();
- fDFPEventWeights[t][pW][eW]->SetName(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDFPParticleWeights[t][pW]->Add(fDFPEventWeights[t][pW][eW]);
- // correlations:
- fDiffFlowCorrelations[t][pW][eW] = (TList*)list.Clone();
- fDiffFlowCorrelations[t][pW][eW]->SetName(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDFPEventWeights[t][pW][eW]->Add(fDiffFlowCorrelations[t][pW][eW]);
- // products of correlations:
- fDiffFlowProductsOfCorrelations[t][pW][eW] = (TList*)list.Clone();
- fDiffFlowProductsOfCorrelations[t][pW][eW]->SetName(Form("Products of correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDFPEventWeights[t][pW][eW]->Add(fDiffFlowProductsOfCorrelations[t][pW][eW]);
- // correction terms:
- for(Int_t sc=0;sc<2;sc++) // corrections for NUA: sin or cos terms
- {
- fDiffFlowCorrectionTerms[t][pW][eW][sc] = (TList*)list.Clone();
- fDiffFlowCorrectionTerms[t][pW][eW][sc]->SetName(Form("Corrections for NUA (%s, pWeights %s, eWeights %s, %s terms)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()));
- fDFPEventWeights[t][pW][eW]->Add(fDiffFlowCorrectionTerms[t][pW][eW][sc]);
- }
- }
- }
- }
-
- // nested lists in fDiffFlowResults (Differential Flow/Results):
- for(Int_t t=0;t<2;t++) // RP or POI
- {
- fDFRType[t] = (TList*)list.Clone();
- fDFRType[t]->SetName(Form("%s",typeFlag[t].Data()));
- fDiffFlowResults->Add(fDFRType[t]);
- for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used or used
- {
- fDFRParticleWeights[t][pW] = (TList*)list.Clone();
- fDFRParticleWeights[t][pW]->SetName(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data()));
- fDFRType[t]->Add(fDFRParticleWeights[t][pW]);
- for(Int_t eW=0;eW<2;eW++) // event weights: exact ot non-exact // to be improved (terminology)
- {
- fDFREventWeights[t][pW][eW] = (TList*)list.Clone();
- fDFREventWeights[t][pW][eW]->SetName(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDFRParticleWeights[t][pW]->Add(fDFREventWeights[t][pW][eW]);
- // final correlations:
- fDiffFlowFinalCorrelations[t][pW][eW] = (TList*)list.Clone();
- fDiffFlowFinalCorrelations[t][pW][eW]->SetName(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCorrelations[t][pW][eW]);
- // final covariances:
- fDiffFlowFinalCovariances[t][pW][eW] = (TList*)list.Clone();
- fDiffFlowFinalCovariances[t][pW][eW]->SetName(Form("Covariances (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCovariances[t][pW][eW]);
- // final corrections:
- fDiffFlowFinalCorrections[t][pW][eW] = (TList*)list.Clone();
- fDiffFlowFinalCorrections[t][pW][eW]->SetName(Form("Corrections (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
- fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCorrections[t][pW][eW]);
- for(Int_t nua=0;nua<2;nua++)
- {
- fDFRCorrections[t][pW][eW][nua] = (TList*)list.Clone();
- fDFRCorrections[t][pW][eW][nua]->SetName(Form("%s, pWeights %s, eWeights %s, %s for NUA",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDFREventWeights[t][pW][eW]->Add(fDFRCorrections[t][pW][eW][nua]);
- // final cumulants:
- fDiffFlowFinalCumulants[t][pW][eW][nua] = (TList*)list.Clone();
- fDiffFlowFinalCumulants[t][pW][eW][nua]->SetName(Form("Cumulants (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDFRCorrections[t][pW][eW][nua]->Add(fDiffFlowFinalCumulants[t][pW][eW][nua]);
- // final differential flow:
- fDiffFlowFinalFlow[t][pW][eW][nua] = (TList*)list.Clone();
- fDiffFlowFinalFlow[t][pW][eW][nua]->SetName(Form("Differential Flow (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
- fDFRCorrections[t][pW][eW][nua]->Add(fDiffFlowFinalFlow[t][pW][eW][nua]);
- }
- }
- }
- }
-
-} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
-{
- // fill common result histograms for differential flow
-
- // shortcuts for the flags:
- Int_t t = 0; // 0=RP, 1=POI
- Int_t pW = (Int_t)(useParticleWeights); // 0=weights not useed, 1=weights used
- Int_t eW = -1;
- Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
-
- if(type == "POI")
- {
- t = 1;
- }
-
- if(eventWeights == "exact")
- {
- eW = 0;
- }
-
- for(Int_t o=0;o<4;o++) // order
- {
- if(!fFinalFlowPt[t][pW][eW][nua][o])
- {
- cout<<"WARNING: fFinalFlowPt[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"o = "<<o<<endl;
- exit(0);
- }
- if(!fFinalFlowEta[t][pW][eW][nua][o])
- {
- cout<<"WARNING: fFinalFlowEta[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
- cout<<"t = "<<t<<endl;
- cout<<"pW = "<<pW<<endl;
- cout<<"eW = "<<eW<<endl;
- cout<<"nua = "<<nua<<endl;
- cout<<"o = "<<o<<endl;
- exit(0);
- }
- }
-
- if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
- {
- cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
- cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
- exit(0);
- }
-
- // pt:
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- Double_t v2 = fFinalFlowPt[t][pW][eW][nua][0]->GetBinContent(p);
- Double_t v4 = fFinalFlowPt[t][pW][eW][nua][1]->GetBinContent(p);
- Double_t v6 = fFinalFlowPt[t][pW][eW][nua][2]->GetBinContent(p);
- Double_t v8 = fFinalFlowPt[t][pW][eW][nua][3]->GetBinContent(p);
-
- Double_t v2Error = fFinalFlowPt[t][pW][eW][nua][0]->GetBinError(p);
- Double_t v4Error = fFinalFlowPt[t][pW][eW][nua][1]->GetBinError(p);
- //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
- //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
-
- if(type == "RP")
- {
- fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
- fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
- fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
- fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
- } else if(type == "POI")
- {
- fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
- fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
- fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
- fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
- }
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
-
- // eta:
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- Double_t v2 = fFinalFlowEta[t][pW][eW][nua][0]->GetBinContent(e);
- Double_t v4 = fFinalFlowEta[t][pW][eW][nua][1]->GetBinContent(e);
- Double_t v6 = fFinalFlowEta[t][pW][eW][nua][2]->GetBinContent(e);
- Double_t v8 = fFinalFlowEta[t][pW][eW][nua][3]->GetBinContent(e);
-
- //Double_t v2Error = fFinalFlow1D[t][pW][nua][1][0]->GetBinError(e);
- //Double_t v4Error = fFinalFlow1D[t][pW][nua][1][1]->GetBinError(e);
- //Double_t v6Error = fFinalFlow1D[t][pW][nua][1][2]->GetBinError(e);
- //Double_t v8Error = fFinalFlow1D[t][pW][nua][1][3]->GetBinError(e);
-
- if(type == "RP")
- {
- fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,0.);
- fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,0.);
- fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
- fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
- } else if(type == "POI")
- {
- fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,0.);
- fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,0.);
- fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
- fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
- }
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
-
-} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::AccessConstants()
-{
- // access needed common constants from AliFlowCommonConstants
-
- fnBinsPhi = AliFlowCommonConstants::GetNbinsPhi();
- fPhiMin = AliFlowCommonConstants::GetPhiMin();
- fPhiMax = AliFlowCommonConstants::GetPhiMax();
- if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
- fnBinsPt = AliFlowCommonConstants::GetNbinsPt();
- fPtMin = AliFlowCommonConstants::GetPtMin();
- fPtMax = AliFlowCommonConstants::GetPtMax();
- if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
- fnBinsEta = AliFlowCommonConstants::GetNbinsEta();
- fEtaMin = AliFlowCommonConstants::GetEtaMin();
- fEtaMax = AliFlowCommonConstants::GetEtaMax();
- if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
-
-} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateSumAndProductOfEventWeights()
-{
- // 1.) calculate sum of linear and quadratic event weights;
- // 2.) calculate products of event weights
-
- Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
-
- Double_t eventWeight[4] = {0};
- eventWeight[0] = dMult*(dMult-1); // event weight for <2>
- eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
- eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
- eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
-
- for(Int_t p=0;p<2;p++)
- {
- for(Int_t c=0;c<4;c++)
- {
- fSumOfEventWeights[0][0][p]->Fill(c+0.5,pow(eventWeight[c],p+1));
- }
- }
-
- // to be improved (hardwired pW and eW):
- fProductOfEventWeights[0][0]->Fill(0.5,eventWeight[0]*eventWeight[1]);
- fProductOfEventWeights[0][0]->Fill(1.5,eventWeight[0]*eventWeight[2]);
- fProductOfEventWeights[0][0]->Fill(2.5,eventWeight[0]*eventWeight[3]);
- fProductOfEventWeights[0][0]->Fill(3.5,eventWeight[1]*eventWeight[2]);
- fProductOfEventWeights[0][0]->Fill(4.5,eventWeight[1]*eventWeight[3]);
- fProductOfEventWeights[0][0]->Fill(5.5,eventWeight[2]*eventWeight[3]);
-
-} // end of void AliFlowAnalysisWithQCumulants::CalculateSumAndProductOfEventWeights()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateReducedCorrelations1D(TString type, TString ptOrEta)
-{
- // calculate reduced correlations for RPs or POIs in pt or eta bins
-
- // multiplicity:
- Double_t dMult = (*fSMpk)(0,0);
-
- // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
- Double_t dReQ1n = (*fReQ)(0,0);
- Double_t dReQ2n = (*fReQ)(1,0);
- //Double_t dReQ3n = (*fReQ)(2,0);
- //Double_t dReQ4n = (*fReQ)(3,0);
- Double_t dImQ1n = (*fImQ)(0,0);
- Double_t dImQ2n = (*fImQ)(1,0);
- //Double_t dImQ3n = (*fImQ)(2,0);
- //Double_t dImQ4n = (*fImQ)(3,0);
-
- // reduced correlations are stored in fReducedCorrelations[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
- //
- // 0: <<2'>>
- // 1: <<4'>>
- // 2: <<6'>>
- // 3: <<8'>>
-
- Int_t t = -1; // type flag
- Int_t pe = -1; // ptEta flag
-
- if(type == "RP")
- {
- t = 0;
- } else if(type == "POI")
- {
- t = 1;
- }
-
- if(ptOrEta == "Pt")
- {
- pe = 0;
- } else if(ptOrEta == "Eta")
- {
- pe = 1;
- }
-
- Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
- Double_t minPtEta[2] = {fPtMin,fEtaMin};
- //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
- Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
-
- // looping over all bins and calculating reduced correlations:
- for(Int_t b=1;b<=nBinsPtEta[pe];b++)
- {
- // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
- Double_t p1n0kRe = 0.;
- Double_t p1n0kIm = 0.;
-
- // number of POIs in particular pt or eta bin:
- Double_t mp = 0.;
-
- // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
- Double_t q1n0kRe = 0.;
- Double_t q1n0kIm = 0.;
- Double_t q2n0kRe = 0.;
- Double_t q2n0kIm = 0.;
-
- // number of particles which are both RPs and POIs in particular pt or eta bin:
- Double_t mq = 0.;
-
- // q_{m*n,0}:
- q1n0kRe = fReEBE1D[pe][2][0][0]->GetBinContent(fReEBE1D[pe][2][0][0]->GetBin(b))
- * fReEBE1D[pe][2][0][0]->GetBinEntries(fReEBE1D[pe][2][0][0]->GetBin(b));
- q1n0kIm = fImEBE1D[pe][2][0][0]->GetBinContent(fImEBE1D[pe][2][0][0]->GetBin(b))
- * fImEBE1D[pe][2][0][0]->GetBinEntries(fImEBE1D[pe][2][0][0]->GetBin(b));
- q2n0kRe = fReEBE1D[pe][2][1][0]->GetBinContent(fReEBE1D[pe][2][1][0]->GetBin(b))
- * fReEBE1D[pe][2][1][0]->GetBinEntries(fReEBE1D[pe][2][1][0]->GetBin(b));
- q2n0kIm = fImEBE1D[pe][2][1][0]->GetBinContent(fImEBE1D[pe][2][1][0]->GetBin(b))
- * fImEBE1D[pe][2][1][0]->GetBinEntries(fImEBE1D[pe][2][1][0]->GetBin(b));
-
- mq = fReEBE1D[pe][2][0][0]->GetBinEntries(fReEBE1D[pe][2][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
-
- if(type == "POI")
- {
- // p_{m*n,0}:
- p1n0kRe = fReEBE1D[pe][1][0][0]->GetBinContent(fReEBE1D[pe][1][0][0]->GetBin(b))
- * fReEBE1D[pe][1][0][0]->GetBinEntries(fReEBE1D[pe][1][0][0]->GetBin(b));
- p1n0kIm = fImEBE1D[pe][1][0][0]->GetBinContent(fImEBE1D[pe][1][0][0]->GetBin(b))
- * fImEBE1D[pe][1][0][0]->GetBinEntries(fImEBE1D[pe][1][0][0]->GetBin(b));
-
- mp = fReEBE1D[pe][1][0][0]->GetBinEntries(fReEBE1D[pe][1][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
-
- t = 1; // typeFlag = RP or POI
- }
- else if(type == "RP")
- {
- // p_{m*n,0} = q_{m*n,0}:
- p1n0kRe = q1n0kRe;
- p1n0kIm = q1n0kIm;
- mp = mq;
-
- t = 0; // typeFlag = RP or POI
- }
-
- // 2'-particle correlation for particular (pt,eta) bin:
- Double_t two1n1nPtEta = 0.;
- if(mp*dMult-mq)
- {
- two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
- / (mp*dMult-mq);
-
- if(type == "POI")
- {
- // fill profile to get <<2'>> for POIs
- fReducedCorrelations[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
- // histogram to store <2'> for POIs e-b-e (needed in some other methods):
- fReducedCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
- }
- else if(type == "RP")
- {
- // profile to get <<2'>> for RPs:
- fReducedCorrelations[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
- // histogram to store <2'> for RPs e-b-e (needed in some other methods):
- fReducedCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
- }
- } // end of if(mp*dMult-mq)
-
- // 4'-particle correlation:
- Double_t four1n1n1n1nPtEta = 0.;
- if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
- {
- four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
- - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
- - 2.*q2n0kIm*dReQ1n*dImQ1n
- - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
- + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
- - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
- - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
- + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
- + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
- + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
- + 2.*mq*dMult
- - 6.*mq)
- / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
-
- if(type == "POI")
- {
- // profile to get <<4'>> for POIs:
- fReducedCorrelations[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
- (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
- // histogram to store <4'> for POIs e-b-e (needed in some other methods):
- fReducedCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
- }
- else if(type == "RP")
- {
- // profile to get <<4'>> for RPs:
- fReducedCorrelations[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
- (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
- // histogram to store <4'> for RPs e-b-e (needed in some other methods):
- fReducedCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
- }
- } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
-
- } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
-
-} // end of void AliFlowAnalysisWithQCumulants::CalculateReducedCorrelations1D(TString type, TString ptOrEta);
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateSumOfEventWeightsForDiffFlow(TString type, TString ptOrEta)
-{
- // Calculate sums of various event weights for reduced correlations.
- // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
-
- Int_t typeFlag = -1;
- Int_t ptEtaFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- }
-
- if(ptOrEta == "Pt")
- {
- ptEtaFlag = 0;
- } else if(ptOrEta == "Eta")
- {
- ptEtaFlag = 1;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pe = ptEtaFlag;
-
- // binning:
- Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
- Double_t minPtEta[2] = {fPtMin,fEtaMin};
- //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
- Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
-
- for(Int_t rpq=0;rpq<3;rpq++)
- {
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- if(!fReEBE1D[pe][rpq][m][k])
- {
- cout<<"WARNING: fReEBE1D[pe][rpq][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"rpq = "<<rpq<<endl;
- cout<<"m = "<<m<<endl;
- cout<<"k = "<<k<<endl;
- exit(0);
- }
- }
- }
- }
-
- // multiplicities:
- Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
- Double_t mr = 0.; // number of RPs in particular pt or eta bin
- Double_t mp = 0.; // number of POIs in particular pt or eta bin
- Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
-
- // event weights for reduced correlations:
- Double_t dw2 = 0.; // event weight for <2'>
- Double_t dw4 = 0.; // event weight for <4'>
- //Double_t dw6 = 0.; // event weight for <6'>
- //Double_t dw8 = 0.; // event weight for <8'>
-
- // looping over bins:
- for(Int_t b=1;b<=nBinsPtEta[pe];b++)
- {
- if(type == "RP")
- {
- mr = fReEBE1D[pe][0][0][0]->GetBinEntries(b);
- mp = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
- mq = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
- } else if(type == "POI")
- {
- mp = fReEBE1D[pe][1][0][0]->GetBinEntries(b);
- mq = fReEBE1D[pe][2][0][0]->GetBinEntries(b);
- }
-
- // event weight for <2'>:
- dw2 = mp*dMult-mq;
- fSumOfEventWeightsForDiffFlow[pe][t][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
- fSumOfEventWeightsForDiffFlow[pe][t][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
-
- // event weight for <4'>:
- dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
- fSumOfEventWeightsForDiffFlow[pe][t][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
- fSumOfEventWeightsForDiffFlow[pe][t][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
-
- // event weight for <6'>:
- //dw6 = ...;
- //fSumOfEventWeightsForDiffFlow[pe][t][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
- //fSumOfEventWeightsForDiffFlow[pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
-
- // event weight for <8'>:
- //dw8 = ...;
- //fSumOfEventWeightsForDiffFlow[pe][t][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
- //fSumOfEventWeightsForDiffFlow[pe][t][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
-
- } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
-} // end of void AliFlowAnalysisWithQCumulants::CalculateSumOfEventWeightsForDiffFlow()
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateProductOfEventWeightsForDiffFlow(TString type, TString ptOrEta)
-{
- // Calculate products of various event weights for both types of correlations (the ones for int. and diff. flow).
- // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
- //
- // Important: To fill fProductOfEventWeightsForDiffFlow[][][][] use bellow table (i,j) with following constraints:
- // 1.) i<j
- // 2.) do not store terms which DO NOT include reduced correlations;
- // Table:
- // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]
-
- Int_t typeFlag = -1;
- Int_t ptEtaFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- }
-
- if(ptOrEta == "Pt")
- {
- ptEtaFlag = 0;
- } else if(ptOrEta == "Eta")
- {
- ptEtaFlag = 1;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pe = ptEtaFlag;
-
- // binning:
- Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
- Double_t minPtEta[2] = {fPtMin,fEtaMin};
- //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
- Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
-
- // protection:
- for(Int_t rpq=0;rpq<3;rpq++)
- {
- for(Int_t m=0;m<4;m++)
- {
- for(Int_t k=0;k<9;k++)
- {
- if(!fReEBE1D[pe][rpq][m][k])
- {
- cout<<"WARNING: fReEBE1D[pe][rpq][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
- cout<<"pe = "<<pe<<endl;
- cout<<"rpq = "<<rpq<<endl;
- cout<<"m = "<<m<<endl;
- cout<<"k = "<<k<<endl;
- exit(0);
- }
- }
- }
- }
-
- // multiplicities:
- Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
- Double_t mr = 0.; // number of RPs in particular pt or eta bin
- Double_t mp = 0.; // number of POIs in particular pt or eta bin
- Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
-
- // event weights for correlations:
- Double_t dW2 = dMult*(dMult-1); // event weight for <2>
- Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
- Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
- Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
-
- // event weights for reduced correlations:
- Double_t dw2 = 0.; // event weight for <2'>
- Double_t dw4 = 0.; // event weight for <4'>
- //Double_t dw6 = 0.; // event weight for <6'>
- //Double_t dw8 = 0.; // event weight for <8'>
-
- // looping over bins:
- for(Int_t b=1;b<=nBinsPtEta[pe];b++)
- {
- if(type == "RP")
- {
- mr = fReEBE1D[pe][0][0][0]->GetBinEntries(b);
- mp = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
- mq = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
- } else if(type == "POI")
- {
- mp = fReEBE1D[pe][1][0][0]->GetBinEntries(b);
- mq = fReEBE1D[pe][2][0][0]->GetBinEntries(b);
- }
-
- // event weight for <2'>:
- dw2 = mp*dMult-mq;
- fProductOfEventWeightsForDiffFlow[pe][t][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
- fProductOfEventWeightsForDiffFlow[pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
- fProductOfEventWeightsForDiffFlow[pe][t][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
- fProductOfEventWeightsForDiffFlow[pe][t][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
-
- // event weight for <4'>:
- dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
- fProductOfEventWeightsForDiffFlow[pe][t][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
- fProductOfEventWeightsForDiffFlow[pe][t][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
- fProductOfEventWeightsForDiffFlow[pe][t][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
- fProductOfEventWeightsForDiffFlow[pe][t][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
- fProductOfEventWeightsForDiffFlow[pe][t][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
-
- // event weight for <6'>:
- //dw6 = ...;
- //fProductOfEventWeightsForDiffFlow[pe][t][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
- //fProductOfEventWeightsForDiffFlow[pe][t][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
- //fProductOfEventWeightsForDiffFlow[pe][t][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
- //fProductOfEventWeightsForDiffFlow[pe][t][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
- //fProductOfEventWeightsForDiffFlow[pe][t][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
- //fProductOfEventWeightsForDiffFlow[pe][t][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
- //fProductOfEventWeightsForDiffFlow[pe][t][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
-
- // event weight for <8'>:
- //dw8 = ...;
- //fProductOfEventWeightsForDiffFlow[pe][t][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
- //fProductOfEventWeightsForDiffFlow[pe][t][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
- //fProductOfEventWeightsForDiffFlow[pe][t][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
- //fProductOfEventWeightsForDiffFlow[pe][t][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
- //fProductOfEventWeightsForDiffFlow[pe][t][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
- //fProductOfEventWeightsForDiffFlow[pe][t][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
- //fProductOfEventWeightsForDiffFlow[pe][t][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
-
- // Table:
- // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]
-
- } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
-
-
-} // end of void AliFlowAnalysisWithQCumulants::CalculateProductOfEventWeightsForDiffFlow(TString type, TString ptOrEta)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
-{
- // transfer profiles into histos and propagate errors correctly
-
- Int_t typeFlag = -1;
- Int_t ptEtaFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- }
-
- if(ptOrEta == "Pt")
- {
- ptEtaFlag = 0;
- } else if(ptOrEta == "Eta")
- {
- ptEtaFlag = 1;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pe = ptEtaFlag;
-
- // common:
- Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
- //Double_t minPtEta[2] = {fPtMin,fEtaMin};
- //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
- //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
-
- // transfer 1D profile into 1D histogram:
- Double_t correlation = 0.;
- Double_t spread = 0.;
- Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
- Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
- Double_t error = 0.; // error = termA * spread * termB
- // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
- // termB = 1/pow(1-termA^2,0.5)
- Double_t termA = 0.;
- Double_t termB = 0.;
- for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
- {
- for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
- {
- if(fReducedCorrelations[t][pe][rci])
- {
- correlation = fReducedCorrelations[t][pe][rci]->GetBinContent(b);
- spread = fReducedCorrelations[t][pe][rci]->GetBinError(b);
- sumOfWeights = fSumOfEventWeightsForDiffFlow[pe][t][0][rci]->GetBinContent(b);
- sumOfSquaredWeights = fSumOfEventWeightsForDiffFlow[pe][t][1][rci]->GetBinContent(b);
- if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
- if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
- error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
- fFinalCorrelations1D[t][0][0][pe][rci]->SetBinContent(b,correlation);
- fFinalCorrelations1D[t][0][0][pe][rci]->SetBinError(b,error);
- } // end of if(fReducedCorrelations[t][pe][rci])
- } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
- } // end of for(Int_t rci=0;rci<4;rci++)
-
-} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateQProductsForDiffFlow(TString type, TString ptOrEta)
-{
- // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
- // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
- // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
- // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
- // <6'><8'>, <8><8'>
-
- Int_t typeFlag = -1;
- Int_t ptEtaFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- }
-
- if(ptOrEta == "Pt")
- {
- ptEtaFlag = 0;
- } else if(ptOrEta == "Eta")
- {
- ptEtaFlag = 1;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pe = ptEtaFlag;
-
- // common:
- Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
- Double_t minPtEta[2] = {fPtMin,fEtaMin};
- //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
- Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
-
- // protections // to be improved (add protection for all pointers in this method)
- if(!fQCorrelationsEBE[0])
- {
- cout<<"WARNING: fQCorrelationsEBE[0] is NULL in AFAWQC::CQPFDF() !!!!"<<endl;
- exit(0);
- }
-
- Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
- Double_t mr = 0.; // number of RPs in particular pt or eta bin
- Double_t mp = 0.; // number of POIs in particular pt or eta bin
- Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
-
- // e-b-e correlations:
- Double_t twoEBE = 0.; // <2>
- Double_t fourEBE = 0.; // <4>
- Double_t sixEBE = 0.; // <6>
- Double_t eightEBE = 0.; // <8>
-
- if(dMult>1)
- {
- twoEBE = fQCorrelationsEBE[0]->GetBinContent(1);
- if(dMult>3)
- {
- fourEBE = fQCorrelationsEBE[0]->GetBinContent(11);
- if(dMult>5)
- {
- sixEBE = fQCorrelationsEBE[0]->GetBinContent(24);
- if(dMult>7)
- {
- eightEBE = fQCorrelationsEBE[0]->GetBinContent(31);
- }
- }
- }
- }
-
- // event weights for correlations:
- Double_t dW2 = dMult*(dMult-1); // event weight for <2>
- Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
- Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
- Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
-
- // e-b-e reduced correlations:
- Double_t twoReducedEBE = 0.; // <2'>
- Double_t fourReducedEBE = 0.; // <4'>
- Double_t sixReducedEBE = 0.; // <6'>
- Double_t eightReducedEBE = 0.; // <8'>
-
- // event weights for reduced correlations:
- Double_t dw2 = 0.; // event weight for <2'>
- Double_t dw4 = 0.; // event weight for <4'>
- //Double_t dw6 = 0.; // event weight for <6'>
- //Double_t dw8 = 0.; // event weight for <8'>
-
- // looping over bins:
- for(Int_t b=1;b<=nBinsPtEta[pe];b++)
- {
- // e-b-e reduced correlations:
- twoReducedEBE = fReducedCorrelationsEBE[t][pe][0]->GetBinContent(b);
- fourReducedEBE = fReducedCorrelationsEBE[t][pe][1]->GetBinContent(b);
- sixReducedEBE = fReducedCorrelationsEBE[t][pe][2]->GetBinContent(b);
- eightReducedEBE = fReducedCorrelationsEBE[t][pe][3]->GetBinContent(b);
-
- // to be improved (I should not do this here again)
- if(type == "RP")
- {
- mr = fReEBE1D[pe][0][0][0]->GetBinEntries(b);
- mp = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
- mq = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
- } else if(type == "POI")
- {
- mp = fReEBE1D[pe][1][0][0]->GetBinEntries(b);
- mq = fReEBE1D[pe][2][0][0]->GetBinEntries(b);
- }
-
- // event weights for reduced correlations:
- dw2 = mp*dMult-mq; // weight for <2'>
- dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
- + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
- //dw6 = ...
- //dw8 = ...
-
- // storing all products:
- fQProductsForDiffFlow[pe][t][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
- fQProductsForDiffFlow[pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
- fQProductsForDiffFlow[pe][t][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
- fQProductsForDiffFlow[pe][t][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
-
- // event weight for <4'>:
- fQProductsForDiffFlow[pe][t][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
- fQProductsForDiffFlow[pe][t][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
- fQProductsForDiffFlow[pe][t][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
- fQProductsForDiffFlow[pe][t][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
- fQProductsForDiffFlow[pe][t][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
-
- // event weight for <6'>:
- //dw6 = ...;
- //fQProductsForDiffFlow[pe][t][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
- //fQProductsForDiffFlow[pe][t][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
- //fQProductsForDiffFlow[pe][t][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
- //fQProductsForDiffFlow[pe][t][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
- //fQProductsForDiffFlow[pe][t][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
- //fQProductsForDiffFlow[pe][t][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
- //fQProductsForDiffFlow[pe][t][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
-
- // event weight for <8'>:
- //dw8 = ...;
- //fQProductsForDiffFlow[pe][t][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
- //fQProductsForDiffFlow[pe][t][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
- //fQProductsForDiffFlow[pe][t][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
- //fQProductsForDiffFlow[pe][t][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
- //fQProductsForDiffFlow[pe][t][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
- //fQProductsForDiffFlow[pe][t][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
- //fQProductsForDiffFlow[pe][t][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
-
- } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
-
-} // end of void AliFlowAnalysisWithQCumulants::CalculateQProductsForDiffFlow(TString type, TString ptOrEta)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateCovariancesForDiffFlow(TString type, TString ptOrEta) // to be improved (reimplemented)
-{
- // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
- // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
- // b) Store in histogram fFinalCovariances1D[t][0][0][pe][i] for instance the following:
- //
- // Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
- //
- // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
- // c) Binning of fFinalCovariances1D[t][0][0][pe][i] is organized as follows:
- //
- // 1st bin: Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
- // 2nd bin: Cov(<2>,<4'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
- // 3rd bin: Cov(<4>,<2'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
- // 4th bin: Cov(<4>,<4'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
- // 5th bin: Cov(<2'>,<4'>) * (sum_{i=1}^{N} w_{<2'>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2'>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
- // ...
-
- Int_t typeFlag = -1;
- Int_t ptEtaFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- }
-
- if(ptOrEta == "Pt")
- {
- ptEtaFlag = 0;
- } else if(ptOrEta == "Eta")
- {
- ptEtaFlag = 1;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pe = ptEtaFlag;
-
- // common:
- Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
- //Double_t minPtEta[2] = {fPtMin,fEtaMin};
- //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
- //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
-
- // average correlations:
- Double_t two = fCorrelations[0][0]->GetBinContent(1); // <<2>>
- Double_t four = fCorrelations[0][0]->GetBinContent(11); // <<4>>
- //Double_t six = fCorrelations[0][0]->GetBinContent(24); // <<6>>
- //Double_t eight = fCorrelations[0][0]->GetBinContent(31); // <<8>>
-
- // sum of weights for correlation:
- Double_t sumOfWeightsForTwo = fSumOfEventWeights[0][0][0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
- Double_t sumOfWeightsForFour = fSumOfEventWeights[0][0][0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
- //Double_t sumOfWeightsForSix = fSumOfEventWeights[0][0][0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
- //Double_t sumOfWeightsForEight = fSumOfEventWeights[0][0][0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
-
- // average reduced correlations:
- Double_t twoReduced = 0.; // <<2'>>
- Double_t fourReduced = 0.; // <<4'>>
- //Double_t sixReduced = 0.; // <<6'>>
- //Double_t eightReduced = 0.; // <<8'>>
-
- // sum of weights for reduced correlation:
- Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
- Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
- //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
- //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
-
- // product of weights for reduced correlation:
- Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
- Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
- Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
- Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
- Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
- // ...
-
- // products for differential flow:
- Double_t twoTwoReduced = 0; // <<2><2'>>
- Double_t twoFourReduced = 0; // <<2><4'>>
- Double_t fourTwoReduced = 0; // <<4><2'>>
- Double_t fourFourReduced = 0; // <<4><4'>>
- Double_t twoReducedFourReduced = 0; // <<2'><4'>>
-
- // denominators in the expressions for the unbiased estimators for covariances:
- // denominator = 1 - term1/(term2*term3)
- // prefactor = term1/(term2*term3)
- Double_t denominator = 0.;
- Double_t prefactor = 0.;
- Double_t term1 = 0.;
- Double_t term2 = 0.;
- Double_t term3 = 0.;
-
- // unbiased estimators for covariances for differential flow:
- Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
- Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
- Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
- Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
- Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
- Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
- Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
- Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
- Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
- Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
-
- for(Int_t b=1;b<=nBinsPtEta[pe];b++)
- {
- // average reduced corelations:
- twoReduced = fFinalCorrelations1D[t][0][0][pe][0]->GetBinContent(b);
- fourReduced = fFinalCorrelations1D[t][0][0][pe][1]->GetBinContent(b);
- // average products:
- twoTwoReduced = fQProductsForDiffFlow[pe][t][0][1]->GetBinContent(b);
- twoFourReduced = fQProductsForDiffFlow[pe][t][0][3]->GetBinContent(b);
- fourTwoReduced = fQProductsForDiffFlow[pe][t][1][2]->GetBinContent(b);
- fourFourReduced = fQProductsForDiffFlow[pe][t][2][3]->GetBinContent(b);
- twoReducedFourReduced = fQProductsForDiffFlow[pe][t][1][3]->GetBinContent(b);
- // sum of weights for reduced correlations:
- sumOfWeightsForTwoReduced = fSumOfEventWeightsForDiffFlow[pe][t][0][0]->GetBinContent(b);
- sumOfWeightsForFourReduced = fSumOfEventWeightsForDiffFlow[pe][t][0][1]->GetBinContent(b);
- // products of weights for correlations:
- productOfWeightsForTwoTwoReduced = fProductOfEventWeightsForDiffFlow[pe][t][0][1]->GetBinContent(b);
- productOfWeightsForTwoFourReduced = fProductOfEventWeightsForDiffFlow[pe][t][0][3]->GetBinContent(b);
- productOfWeightsForFourTwoReduced = fProductOfEventWeightsForDiffFlow[pe][t][1][2]->GetBinContent(b);
- productOfWeightsForFourFourReduced = fProductOfEventWeightsForDiffFlow[pe][t][2][3]->GetBinContent(b);
- productOfWeightsForTwoReducedFourReduced = fProductOfEventWeightsForDiffFlow[pe][t][1][3]->GetBinContent(b);
- // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
- // prefactor (multiplies Cov's) = term1/(term2*term3)
- // <2>,<2'>:
- term1 = productOfWeightsForTwoTwoReduced;
- term2 = sumOfWeightsForTwo;
- term3 = sumOfWeightsForTwoReduced;
- if(term2*term3>0.)
- {
- denominator = 1.-term1/(term2*term3);
- prefactor = term1/(term2*term3);
- if(denominator!=0.)
- {
- covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
- wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
- fFinalCovariances1D[t][0][0][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
- }
- }
- // <2>,<4'>:
- term1 = productOfWeightsForTwoFourReduced;
- term2 = sumOfWeightsForTwo;
- term3 = sumOfWeightsForFourReduced;
- if(term2*term3>0.)
- {
- denominator = 1.-term1/(term2*term3);
- prefactor = term1/(term2*term3);
- if(denominator!=0.)
- {
- covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
- wCovTwoFourReduced = covTwoFourReduced*prefactor;
- fFinalCovariances1D[t][0][0][pe][1]->SetBinContent(b,wCovTwoFourReduced);
- }
- }
- // <4>,<2'>:
- term1 = productOfWeightsForFourTwoReduced;
- term2 = sumOfWeightsForFour;
- term3 = sumOfWeightsForTwoReduced;
- if(term2*term3>0.)
- {
- denominator = 1.-term1/(term2*term3);
- prefactor = term1/(term2*term3);
- if(denominator!=0.)
- {
- covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
- wCovFourTwoReduced = covFourTwoReduced*prefactor;
- fFinalCovariances1D[t][0][0][pe][2]->SetBinContent(b,wCovFourTwoReduced);
- }
- }
- // <4>,<4'>:
- term1 = productOfWeightsForFourFourReduced;
- term2 = sumOfWeightsForFour;
- term3 = sumOfWeightsForFourReduced;
- if(term2*term3>0.)
- {
- denominator = 1.-term1/(term2*term3);
- prefactor = term1/(term2*term3);
- if(denominator!=0.)
- {
- covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
- wCovFourFourReduced = covFourFourReduced*prefactor;
- fFinalCovariances1D[t][0][0][pe][3]->SetBinContent(b,wCovFourFourReduced);
- }
- }
- // <2'>,<4'>:
- term1 = productOfWeightsForTwoReducedFourReduced;
- term2 = sumOfWeightsForTwoReduced;
- term3 = sumOfWeightsForFourReduced;
- if(term2*term3>0.)
- {
- denominator = 1.-term1/(term2*term3);
- prefactor = term1/(term2*term3);
- if(denominator!=0.)
- {
- covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
- wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
- fFinalCovariances1D[t][0][0][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
- }
- }
-
- } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
-
-} // end of void AliFlowAnalysisWithQCumulants::CalculateCovariancesForDiffFlow(TString type, TString ptOrEta)
-
-
-//================================================================================================================================
-
-
-void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
-{
- // calculate differential flow from differential cumulants and previously obtained integrated flow:
-
- Int_t typeFlag = -1;
- Int_t pWeightsFlag = -1;
- Int_t eWeightsFlag = -1;
-
- if(type == "RP")
- {
- typeFlag = 0;
- } else if(type == "POI")
- {
- typeFlag = 1;
- } else
- {
- cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
- exit(0);
- }
-
- if(!useParticleWeights)
- {
- pWeightsFlag = 0;
- } else
- {
- pWeightsFlag = 1;
- }
-
- if(eventWeights == "exact")
- {
- eWeightsFlag = 0;
- }
-
- // shortcuts:
- Int_t t = typeFlag;
- Int_t pW = pWeightsFlag;
- Int_t eW = eWeightsFlag;
-
- // correlations:
- Double_t two = fCorrelations[0][0]->GetBinContent(1); // <<2>>
- Double_t four = fCorrelations[0][0]->GetBinContent(11); // <<4>>
-
- // statistical errors of correlations:
- Double_t twoError = fCorrelations[0][0]->GetBinError(1);
- Double_t fourError = fCorrelations[0][0]->GetBinError(11);
-
- // reduced correlations:
- Double_t twoReduced = 0.; // <<2'>>
- Double_t fourReduced = 0.; // <<4'>>
-
- // statistical errors of reduced correlations:
- Double_t twoReducedError = 0.;
- Double_t fourReducedError = 0.;
-
- // covariances:
- Double_t wCovTwoFour = fCovariances[0][0]->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)
- Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
- Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
- Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
- Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
- Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
-
- // differential flow:
- Double_t v2Prime = 0.; // v'{2}
- Double_t v4Prime = 0.; // v'{4}
-
- // statistical error of differential flow:
- Double_t v2PrimeError = 0.;
- Double_t v4PrimeError = 0.;
-
- // squared statistical error of differential flow:
- Double_t v2PrimeErrorSquared = 0.;
- Double_t v4PrimeErrorSquared = 0.;
-
- // 1D (pt): // to be improved (combined with eta, combined nua loop with 2D)
- for(Int_t nua=0;nua<2;nua++)
- {
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- // reduced correlations and statistical errors:
- twoReduced = fFinalCorrelations1D[t][0][0][0][0]->GetBinContent(p);
- twoReducedError = fFinalCorrelations1D[t][0][0][0][0]->GetBinError(p);
- fourReduced = fFinalCorrelations1D[t][0][0][0][1]->GetBinContent(p);
- fourReducedError = fFinalCorrelations1D[t][0][0][0][1]->GetBinError(p);
- // covariances:
- wCovTwoTwoReduced = fFinalCovariances1D[t][0][0][0][0]->GetBinContent(p);
- wCovTwoFourReduced = fFinalCovariances1D[t][0][0][0][1]->GetBinContent(p);
- wCovFourTwoReduced = fFinalCovariances1D[t][0][0][0][2]->GetBinContent(p);
- wCovFourFourReduced = fFinalCovariances1D[t][0][0][0][3]->GetBinContent(p);
- wCovTwoReducedFourReduced = fFinalCovariances1D[t][0][0][0][4]->GetBinContent(p);
- // differential flow:
- // v'{2}:
- if(two>0.)
- {
- v2Prime = twoReduced/pow(two,0.5);
- v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
- (pow(twoReduced,2.)*pow(twoError,2.)
- + 4.*pow(two,2.)*pow(twoReducedError,2.)
- - 4.*two*twoReduced*wCovTwoTwoReduced);
-
- /*
- if(p>10&& p<15)
- {
- cout<<endl;
- cout<<"p = "<<p<<":"<<endl;
- cout<<"1 = "<<pow(twoReduced,2.)*pow(twoError,2.)<<endl;
- cout<<"2 = "<<4.*pow(two,2.)*pow(twoReduced,2.)<<endl;
- cout<<"3 = "<<- 4.*two*twoReduced*wCovTwoTwoReduced<<endl;
- }
- */
-
- if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
-
- fFinalFlowPt[t][pW][eW][nua][0]->SetBinContent(p,v2Prime);
- fFinalFlowPt[t][pW][eW][nua][0]->SetBinError(p,v2PrimeError);
- }
- // differential flow:
- // v'{4}
- if(2.*pow(two,2.)-four > 0.)
- {
- v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
- v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
- (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
- + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
- + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
- + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
-
- - (3./2.)*(2.*two*twoReduced-fourReduced)
- * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
- - 4.*two*(2.*pow(two,2.)-four)
- * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
- + 2.*(2.*pow(two,2.)-four)
- * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
- + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
- - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
- - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
- if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
-
- fFinalFlowPt[t][pW][eW][nua][1]->SetBinContent(p,v4Prime);
- fFinalFlowPt[t][pW][eW][nua][1]->SetBinError(p,v4PrimeError);
- }
-
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
- } // end of for(Int_t nua=0;nua<2;nua++)
-
-
- /*
- // 1D (eta): // to be improved (combined with pt, combined nua loop with 2D)
- for(Int_t nua=0;nua<2;nua++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // differential cumulants:
- Double_t qc2Prime = fFinalCumulantsEta[t][pW][eW][nua][0]->GetBinContent(e); // QC{2'}
- Double_t qc4Prime = fFinalCumulantsEta[t][pW][eW][nua][1]->GetBinContent(e); // QC{4'}
- // differential flow:
- Double_t v2Prime = 0.;
- Double_t v4Prime = 0.;
- if(v2)
- {
- v2Prime = qc2Prime/v2;
- fFinalFlowEta[t][pW][eW][nua][0]->SetBinContent(e,v2Prime);
- }
- if(v4)
- {
- v4Prime = -qc4Prime/pow(v4,3.);
- fFinalFlowEta[t][pW][eW][nua][1]->SetBinContent(e,v4Prime);
- }
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t nua=0;nua<2;nua++)
- */
-
- /*
- // 2D:
- for(Int_t nua=0;nua<2;nua++)
- {
- for(Int_t p=1;p<=fnBinsPt;p++)
- {
- for(Int_t e=1;e<=fnBinsEta;e++)
- {
- // differential cumulants:
- Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
- Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
- // differential flow:
- Double_t v2Prime = 0.;
- Double_t v4Prime = 0.;
- if(v2)
- {
- v2Prime = qc2Prime/v2;
- fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
- }
- if(v4)
- {
- v4Prime = -qc4Prime/pow(v4,3.);
- fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
- }
- } // end of for(Int_t e=1;e<=fnBinsEta;e++)
- } // end of for(Int_t p=1;p<=fnBinsPt;p++)
- } // end of for(Int_t nua=0;nua<2;nua++)
- */
-
-
-
-} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
-
+/*************************************************************************\r
+* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *\r
+* *\r
+* Author: The ALICE Off-line Project. *\r
+* Contributors are mentioned in the code where appropriate. *\r
+* *\r
+* Permission to use, copy, modify and distribute this software and its *\r
+* documentation strictly for non-commercial purposes is hereby granted *\r
+* without fee, provided that the above copyright notice appears in all *\r
+* copies and that both the copyright notice and this permission notice *\r
+* appear in the supporting documentation. The authors make no claims *\r
+* about the suitability of this software for any purpose. It is *\r
+* provided "as is" without express or implied warranty. * \r
+**************************************************************************/\r
+\r
+/********************************** \r
+ * flow analysis with Q-cumulants * \r
+ * * \r
+ * author: Ante Bilandzic * \r
+ * (anteb@nikhef.nl) *\r
+ *********************************/ \r
+\r
+#define AliFlowAnalysisWithQCumulants_cxx\r
+\r
+#include "Riostream.h"\r
+#include "AliFlowCommonConstants.h"\r
+#include "AliFlowCommonHist.h"\r
+#include "AliFlowCommonHistResults.h"\r
+#include "TChain.h"\r
+#include "TFile.h"\r
+#include "TList.h"\r
+#include "TGraph.h"\r
+#include "TParticle.h"\r
+#include "TRandom3.h"\r
+#include "TStyle.h"\r
+#include "TProfile.h"\r
+#include "TProfile2D.h" \r
+#include "TProfile3D.h"\r
+#include "TMath.h"\r
+#include "TArrow.h"\r
+#include "TPaveLabel.h"\r
+#include "TCanvas.h"\r
+#include "AliFlowEventSimple.h"\r
+#include "AliFlowTrackSimple.h"\r
+#include "AliFlowAnalysisWithQCumulants.h"\r
+#include "TArrayD.h"\r
+#include "TRandom.h"\r
+#include "TF1.h"\r
+\r
+class TH1;\r
+class TH2;\r
+class TGraph;\r
+class TPave;\r
+class TLatex;\r
+class TMarker;\r
+class TRandom3;\r
+class TObjArray;\r
+class TList;\r
+class TCanvas;\r
+class TSystem;\r
+class TROOT;\r
+class AliFlowVector;\r
+class TVector;\r
+\r
+\r
+//================================================================================================================\r
+\r
+\r
+ClassImp(AliFlowAnalysisWithQCumulants)\r
+\r
+AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants(): \r
+ // 0.) base:\r
+ fHistList(NULL),\r
+ // 1.) common:\r
+ fCommonHists(NULL),\r
+ fCommonHists2nd(NULL), \r
+ fCommonHists4th(NULL),\r
+ fCommonHists6th(NULL),\r
+ fCommonHists8th(NULL),\r
+ fCommonHistsResults2nd(NULL),\r
+ fCommonHistsResults4th(NULL),\r
+ fCommonHistsResults6th(NULL),\r
+ fCommonHistsResults8th(NULL),\r
+ fnBinsPhi(0),\r
+ fPhiMin(0),\r
+ fPhiMax(0),\r
+ fPhiBinWidth(0),\r
+ fnBinsPt(0),\r
+ fPtMin(0),\r
+ fPtMax(0),\r
+ fPtBinWidth(0),\r
+ fnBinsEta(0),\r
+ fEtaMin(0),\r
+ fEtaMax(0),\r
+ fEtaBinWidth(0),\r
+ fHarmonic(2),\r
+ fAnalysisLabel(NULL),\r
+ // 2.) weights:\r
+ fWeightsList(NULL),\r
+ fUsePhiWeights(kFALSE),\r
+ fUsePtWeights(kFALSE),\r
+ fUseEtaWeights(kFALSE),\r
+ fUseParticleWeights(NULL),\r
+ fPhiWeights(NULL),\r
+ fPtWeights(NULL),\r
+ fEtaWeights(NULL),\r
+ // 3.) integrated flow:\r
+ fIntFlowList(NULL), \r
+ fIntFlowProfiles(NULL),\r
+ fIntFlowResults(NULL),\r
+ fIntFlowFlags(NULL),\r
+ fApplyCorrectionForNUA(kFALSE), \r
+ fReQ(NULL),\r
+ fImQ(NULL),\r
+ fSMpk(NULL),\r
+ fIntFlowCorrelationsEBE(NULL),\r
+ fIntFlowCorrelationsAllEBE(NULL),\r
+ fAvMultiplicity(NULL),\r
+ fIntFlowCorrelationsPro(NULL),\r
+ fIntFlowCorrelationsAllPro(NULL),\r
+ fIntFlowProductOfCorrelationsPro(NULL),\r
+ fIntFlowCorrelationsHist(NULL),\r
+ fIntFlowCorrelationsAllHist(NULL),\r
+ fIntFlowCovariances(NULL),\r
+ fIntFlowSumOfProductOfEventWeights(NULL),\r
+ fIntFlowQcumulants(NULL),\r
+ fIntFlow(NULL),\r
+ // 4.) differential flow:\r
+ fDiffFlowList(NULL),\r
+ fDiffFlowProfiles(NULL),\r
+ fDiffFlowResults(NULL),\r
+ fDiffFlowFlags(NULL),\r
+ fCalculate2DFlow(kFALSE),\r
+ // 5.) distributions:\r
+ fDistributionsList(NULL),\r
+ // x.) debugging and cross-checking:\r
+ fNestedLoopsList(NULL),\r
+ fEvaluateNestedLoopsForIntFlow(kFALSE),\r
+ fEvaluateNestedLoopsForDiffFlow(kFALSE), \r
+ fEvaluateNestedLoops(NULL),\r
+ fDirectCorrelations(NULL),\r
+ fDirectCorrectionsCos(NULL),\r
+ fDirectCorrectionsSin(NULL),\r
+ fDirectCorrelationsDiffFlow(NULL),\r
+ fDirectCorrectionsDiffFlowCos(NULL),\r
+ fDirectCorrectionsDiffFlowSin(NULL),\r
+ fDirectCorrelationsW(NULL),\r
+ fDirectCorrectionsCosW(NULL),\r
+ fDirectCorrectionsSinW(NULL),\r
+ fDirectCorrelationsDiffFlowW(NULL),\r
+ fDirectCorrectionsDiffFlowCosW(NULL),\r
+ fDirectCorrectionsDiffFlowSinW(NULL)\r
+ {\r
+ // constructor \r
+ \r
+ // base list to hold all output objects:\r
+ fHistList = new TList();\r
+ fHistList->SetName("cobjQC");\r
+ fHistList->SetOwner(kTRUE);\r
+ \r
+ // list to hold histograms with phi, pt and eta weights: \r
+ fWeightsList = new TList();\r
+ \r
+ // analysis label;\r
+ fAnalysisLabel = new TString();\r
+ \r
+ // initialize all arrays: \r
+ this->InitializeArraysForIntFlow();\r
+ this->InitializeArraysForDiffFlow();\r
+ this->InitializeArraysForDistributions();\r
+ \r
+ } // end of constructor\r
+ \r
+\r
+//================================================================================================================ \r
+\r
+\r
+AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()\r
+{\r
+ // destructor\r
+ \r
+ delete fHistList;\r
+\r
+} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()\r
+\r
+\r
+//================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::Init()\r
+{\r
+ // a) Access all common constants;\r
+ // b) Book all objects;\r
+ // c) Store flags for integrated and differential flow;\r
+ // d) Store harmonic which will be estimated.\r
+ \r
+ // a) Access all common constants:\r
+ this->AccessConstants();\r
+ \r
+ // b) Book all objects:\r
+ this->BookAndFillWeightsHistograms();\r
+ this->BookAndNestAllLists();\r
+ this->BookCommonHistograms();\r
+ this->BookEverythingForIntegratedFlow(); \r
+ this->BookEverythingForDifferentialFlow(); \r
+ this->BookEverythingForDistributions();\r
+ this->BookEverythingForNestedLoops();\r
+ \r
+ // c) Store flags for integrated and differential flow:\r
+ this->StoreIntFlowFlags();\r
+ this->StoreDiffFlowFlags();\r
+\r
+ // d) Store harmonic which will be estimated:\r
+ this->StoreHarmonic();\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::Init()\r
+\r
+\r
+//================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)\r
+{\r
+ // running over data only in this method\r
+ \r
+ // a) fill the common control histograms and call method to fill fAvMultiplicity;\r
+ // b) loop over data to calculate e-b-e quantities;\r
+ // c) call the methods;\r
+ // d) debugging and cross-checking (evaluate nested loops);\r
+ // e) reset e-b-e quantities.\r
+ \r
+ Double_t dPhi = 0.; // azimuthal angle in the laboratory frame\r
+ Double_t dPt = 0.; // transverse momentum\r
+ Double_t dEta = 0.; // pseudorapidity\r
+\r
+ Double_t wPhi = 1.; // phi weight\r
+ Double_t wPt = 1.; // pt weight\r
+ Double_t wEta = 1.; // eta weight\r
+ \r
+ // ********************************************\r
+ // **** FILL THE COMMON CONTROL HISTOGRAMS ****\r
+ // ********************************************\r
+ \r
+ Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)\r
+ \r
+ fCommonHists->FillControlHistograms(anEvent); \r
+ \r
+ if(nRP>1)\r
+ {\r
+ fCommonHists2nd->FillControlHistograms(anEvent); \r
+ if(nRP>3)\r
+ {\r
+ fCommonHists4th->FillControlHistograms(anEvent); \r
+ if(nRP>5)\r
+ {\r
+ fCommonHists6th->FillControlHistograms(anEvent); \r
+ if(nRP>7)\r
+ {\r
+ fCommonHists8th->FillControlHistograms(anEvent); \r
+ } // end of if(nRP>7) \r
+ } // end of if(nRP>5) \r
+ } // end of if(nRP>3) \r
+ } // end of if(nRP>1) \r
+ \r
+ this->FillAverageMultiplicities(nRP); \r
+ \r
+ // *******************************************************\r
+ // **** LOOP OVER DATA AND CALCULATE E-B-E QUANTITIES ****\r
+ // *******************************************************\r
+ \r
+ Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:\r
+ // nRP = # of particles used to determine the reaction plane;\r
+ // nPOI = # of particles of interest for a detailed flow analysis;\r
+ // rest = # of particles which are not niether RPs nor POIs. \r
+ \r
+ AliFlowTrackSimple *aftsTrack = NULL;\r
+ \r
+ for(Int_t i=0;i<nPrim;i++) \r
+ { \r
+ aftsTrack=anEvent->GetTrack(i);\r
+ if(aftsTrack)\r
+ {\r
+ if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs\r
+ Int_t n = fHarmonic; // shortcut for the harmonic\r
+ if(aftsTrack->InRPSelection()) // RP condition:\r
+ { \r
+ dPhi = aftsTrack->Phi();\r
+ dPt = aftsTrack->Pt();\r
+ dEta = aftsTrack->Eta();\r
+ if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:\r
+ {\r
+ wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));\r
+ }\r
+ if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:\r
+ {\r
+ wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth))); \r
+ } \r
+ if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle: \r
+ {\r
+ wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth))); \r
+ } \r
+ \r
+ // integrated flow: \r
+ // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:\r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi); \r
+ (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi); \r
+ } \r
+ }\r
+ // calculate S^{M}_{p,k} for this event \r
+ // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:\r
+ for(Int_t p=0;p<8;p++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ { \r
+ (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);\r
+ }\r
+ } \r
+ \r
+ // differential flow:\r
+ // 1D (pt):\r
+ // (r_{m*m,k}(pt)): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ }\r
+ \r
+ // s_{k}(pt) for RPs // to be improved (clarified)\r
+ // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);\r
+ }\r
+ // 1D (eta):\r
+ // (r_{m*m,k}(eta)): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ } \r
+ // s_{k}(eta) for RPs // to be improved (clarified)\r
+ // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);\r
+ }\r
+ \r
+ \r
+ \r
+ /*\r
+ // 2D (pt,eta):\r
+ if(fCalculate2DFlow)\r
+ {\r
+ // (r_{m*m,k}(pt,eta)): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ } \r
+ // s_{k}(pt,eta) for RPs // to be improved (clarified)\r
+ // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);\r
+ }\r
+ } // end of if(fCalculate2DFlow) \r
+ */ \r
+ \r
+ \r
+ \r
+ if(aftsTrack->InPOISelection())\r
+ {\r
+ // 1D (pt): \r
+ // (q_{m*m,k}(pt)): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ } \r
+ // s_{k}(pt) for RP&&POIs // to be improved (clarified)\r
+ // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);\r
+ }\r
+ // 1D (eta): \r
+ // (q_{m*m,k}(eta)): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ } \r
+ // s_{k}(eta) for RP&&POIs // to be improved (clarified)\r
+ // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);\r
+ }\r
+ \r
+ /*\r
+ // 2D (pt,eta) \r
+ if(fCalculate2DFlow)\r
+ {\r
+ // (q_{m*m,k}(pt,eta)): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ } \r
+ // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)\r
+ // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);\r
+ }\r
+ } // end of if(fCalculate2DFlow) \r
+ */\r
+ \r
+ } // end of if(aftsTrack->InPOISelection())\r
+ \r
+\r
+ \r
+ } // end of if(pTrack->InRPSelection())\r
+\r
+ \r
+ \r
+ if(aftsTrack->InPOISelection())\r
+ {\r
+ dPhi = aftsTrack->Phi();\r
+ dPt = aftsTrack->Pt();\r
+ dEta = aftsTrack->Eta();\r
+ \r
+ // 1D (pt)\r
+ // p_n(m*n,0): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ // 1D (eta)\r
+ // p_n(m*n,0): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ \r
+ \r
+ /*\r
+ // 2D (pt,eta):\r
+ if(fCalculate2DFlow)\r
+ { \r
+ // p_n(m*n,0): \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);\r
+ fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);\r
+ }\r
+ } // end of if(fCalculate2DFlow) \r
+ */\r
+ \r
+ \r
+ } // end of if(pTrack->InPOISelection() ) \r
+ \r
+ \r
+ } else // to if(aftsTrack)\r
+ {\r
+ cout<<endl;\r
+ cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;\r
+ cout<<endl; \r
+ }\r
+ } // end of for(Int_t i=0;i<nPrim;i++) \r
+\r
+ // calculate the final expressions for S^{M}_{p,k}:\r
+ for(Int_t p=0;p<8;p++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);\r
+ } \r
+ } \r
+ \r
+ // *****************************\r
+ // **** CALL THE METHODS *******\r
+ // *****************************\r
+ // integrated flow:\r
+ if(!fEvaluateNestedLoopsForIntFlow)\r
+ {\r
+ // without weights:\r
+ if(nRP>1) this->CalculateIntFlowCorrelations();\r
+ if(nRP>3) this->CalculateIntFlowProductOfCorrelations();\r
+ if(nRP>1) this->CalculateIntFlowSumOfEventWeights();\r
+ if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();\r
+ if(fApplyCorrectionForNUA)\r
+ {\r
+ if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();\r
+ if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();\r
+ }\r
+ // with weights:\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
+ {\r
+ //if(nRP>1) this->CalculateWeightedCorrelationsForIntegratedFlow();\r
+ //if(nRP>3) this->CalculateWeightedQProductsForIntFlow();\r
+ } \r
+ }\r
+\r
+ // differential flow:\r
+ if(!fEvaluateNestedLoopsForDiffFlow)\r
+ {\r
+ // 1D differential flow (without usage of particle weights):\r
+ if(nRP>1)\r
+ {\r
+ this->CalculateReducedCorrelations1D("RP","Pt");\r
+ this->CalculateReducedCorrelations1D("RP","Eta");\r
+ this->CalculateReducedCorrelations1D("POI","Pt");\r
+ this->CalculateReducedCorrelations1D("POI","Eta");\r
+ this->CalculateDiffFlowProductOfCorrelations("RP","Pt");\r
+ this->CalculateDiffFlowProductOfCorrelations("RP","Eta");\r
+ this->CalculateDiffFlowProductOfCorrelations("POI","Pt");\r
+ this->CalculateDiffFlowProductOfCorrelations("POI","Eta");\r
+ this->CalculateDiffFlowSumOfEventWeights("RP","Pt");\r
+ this->CalculateDiffFlowSumOfEventWeights("RP","Eta");\r
+ this->CalculateDiffFlowSumOfEventWeights("POI","Pt");\r
+ this->CalculateDiffFlowSumOfEventWeights("POI","Eta");\r
+ this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");\r
+ this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");\r
+ this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");\r
+ this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");\r
+ }\r
+ \r
+ // with weights:\r
+ // ... \r
+ // 1D differential flow (eta) \r
+ if(nRP>1)\r
+ {\r
+ /*\r
+ this->CalculateReducedCorrelations1D("RP","Eta");\r
+ this->CalculateReducedCorrelations1D("POI","Eta");\r
+ this->CalculateQProductsForDiffFlow("RP","Eta");\r
+ this->CalculateQProductsForDiffFlow("POI","Eta");\r
+ this->CalculateSumOfEventWeightsForDiffFlow("RP","Eta");\r
+ this->CalculateProductOfEventWeightsForDiffFlow("RP","Eta");\r
+ this->CalculateSumOfEventWeightsForDiffFlow("POI","Eta");\r
+ this->CalculateProductOfEventWeightsForDiffFlow("POI","Eta");\r
+ */\r
+ }\r
+ \r
+ /*\r
+ // 2D differential flow\r
+ if(fCalculate2DFlow)\r
+ {\r
+ // without weights:\r
+ if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");\r
+ if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");\r
+ \r
+ // with weights:\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
+ {\r
+ if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");\r
+ if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");\r
+ } \r
+ } // end of if(fCalculate2DFlow)\r
+ */\r
+ \r
+ }\r
+ \r
+ // **************************************************************\r
+ // **** DEBUGGING AND CROSS-CHECKING (EVALUATE NESTED LOOPS) ****\r
+ // **************************************************************\r
+\r
+ if(fEvaluateNestedLoopsForIntFlow)\r
+ {\r
+ if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time \r
+ {\r
+ // without weights:\r
+ if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
+ {\r
+ this->CalculateIntFlowCorrelations();\r
+ this->CalculateIntFlowCorrectionsForNUASinTerms();\r
+ this->CalculateIntFlowCorrectionsForNUACosTerms();\r
+ }\r
+ // with weights:\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
+ {\r
+ this->CalculateWeightedCorrelationsForIntegratedFlow();\r
+ }\r
+ \r
+ this->EvaluateNestedLoopsForIntegratedFlow(anEvent); \r
+ }\r
+ } \r
+ \r
+ if(fEvaluateNestedLoopsForDiffFlow)\r
+ {\r
+ if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time \r
+ {\r
+ // without weights:\r
+ if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
+ {\r
+ this->CalculateCorrelationsForDifferentialFlow2D("RP");\r
+ this->CalculateCorrelationsForDifferentialFlow2D("POI");\r
+ }\r
+ // with weights:\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
+ {\r
+ this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");\r
+ this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");\r
+ }\r
+ \r
+ this->EvaluateNestedLoopsForDifferentialFlow(anEvent); \r
+ }\r
+ } \r
+ \r
+ // ********************************\r
+ // **** RESET E-B-E QUANTITIES ****\r
+ // ********************************\r
+ \r
+ // integrated flow:\r
+ fReQ->Zero();\r
+ fImQ->Zero();\r
+ fSMpk->Zero();\r
+ fIntFlowCorrelationsEBE->Reset();\r
+ fIntFlowCorrelationsAllEBE->Reset();\r
+ \r
+ if(fApplyCorrectionForNUA) \r
+ {\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();\r
+ } \r
+ }\r
+ \r
+ // differential flow:\r
+ // 1D:\r
+ for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta\r
+ {\r
+ for(Int_t m=0;m<4;m++) // multiple of harmonic\r
+ {\r
+ for(Int_t k=0;k<9;k++) // power of weight\r
+ {\r
+ if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();\r
+ if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();\r
+ } \r
+ }\r
+ }\r
+ }\r
+ \r
+ for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();\r
+ }\r
+ }\r
+ }\r
+\r
+ // e-b-e reduced correlations:\r
+ for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
+ {\r
+ if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();\r
+ }\r
+ }\r
+ }\r
+ \r
+ // 2D (pt,eta)\r
+ if(fCalculate2DFlow)\r
+ {\r
+ for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
+ {\r
+ for(Int_t m=0;m<4;m++) // multiple of harmonic\r
+ {\r
+ for(Int_t k=0;k<9;k++) // power of weight\r
+ {\r
+ if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();\r
+ if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();\r
+ } \r
+ }\r
+ }\r
+ for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )\r
+ { \r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();\r
+ }\r
+ } \r
+ } // end of if(fCalculate2DFlow) \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::Finish()\r
+{\r
+ // Calculate the final results.\r
+ // a) acces the constants;\r
+ // b) access the flags;\r
+ // c) calculate the final results for integrated flow (without and with weights);\r
+ // d) store in AliFlowCommonHistResults and print the final results for integrated flow;\r
+ // e) calculate the final results for differential flow (without and with weights);\r
+ // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));\r
+ // g) COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW\r
+ \r
+ // ******************************\r
+ // **** ACCESS THE CONSTANTS ****\r
+ // ******************************\r
+ \r
+ this->AccessConstants(); \r
+ \r
+ // **************************\r
+ // **** ACCESS THE FLAGS ****\r
+ // ************************** \r
+ fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1); \r
+ fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2); \r
+ fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3); \r
+ fApplyCorrectionForNUA = (Int_t)fIntFlowFlags->GetBinContent(3); \r
+ fEvaluateNestedLoopsForIntFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(1);\r
+ fEvaluateNestedLoopsForDiffFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(2); \r
+ \r
+ // *********************************************************\r
+ // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****\r
+ // ********************************************************* \r
+ \r
+ // without weights:\r
+ this->FinalizeCorrelationsIntFlow();\r
+ this->CalculateCovariancesIntFlow();\r
+ this->CalculateCumulantsIntFlow();\r
+ this->CalculateIntFlow(); \r
+\r
+ if(fApplyCorrectionForNUA) // to be improved (reorganized)\r
+ {\r
+ this->FinalizeCorrectionTermsForNUAIntFlow();\r
+ this->CalculateQcumulantsCorrectedForNUAIntFlow(); \r
+ this->CalculateIntFlowCorrectedForNUA(); \r
+ }\r
+ \r
+ //this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kFALSE,"exact");\r
+ \r
+ // with weights:\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
+ {\r
+ //this->FinalizeCorrelationsIntFlow(); \r
+ // this->CalculateCorrectionsForNUAForIntQcumulants(kTRUE,"exact");\r
+ //this->CalculateCovariancesIntFlow(kTRUE,"exact");\r
+ //this->CalculateCumulantsIntFlow();\r
+ // this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kTRUE,"exact");\r
+ //this->CalculateIntFlow(); \r
+ // this->CalculateIntFlow(kTRUE,"exact",kTRUE); // weighted and corrected for non-uniform acceptance\r
+ }\r
+ \r
+ // ***************************************************************\r
+ // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****\r
+ // ***************************************************************\r
+ \r
+ this->FillCommonHistResultsIntFlow(); \r
+ \r
+ this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)\r
+ \r
+ // ***********************************************************\r
+ // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****\r
+ // *********************************************************** \r
+ \r
+ // without weights:\r
+ this->FinalizeReducedCorrelations("RP","Pt"); \r
+ this->FinalizeReducedCorrelations("RP","Eta"); \r
+ this->FinalizeReducedCorrelations("POI","Pt"); \r
+ this->FinalizeReducedCorrelations("POI","Eta"); \r
+ this->CalculateDiffFlowCovariances("RP","Pt");\r
+ this->CalculateDiffFlowCovariances("RP","Eta");\r
+ this->CalculateDiffFlowCovariances("POI","Pt");\r
+ this->CalculateDiffFlowCovariances("POI","Eta");\r
+ this->CalculateDiffFlowCumulants("RP","Pt");\r
+ this->CalculateDiffFlowCumulants("RP","Eta");\r
+ this->CalculateDiffFlowCumulants("POI","Pt");\r
+ this->CalculateDiffFlowCumulants("POI","Eta");\r
+ this->CalculateDiffFlow("RP","Pt");\r
+ this->CalculateDiffFlow("RP","Eta");\r
+ this->CalculateDiffFlow("POI","Pt");\r
+ this->CalculateDiffFlow("POI","Eta");\r
+ this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");\r
+ this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");\r
+ //this->FinalizeCorrelationsForDiffFlow("RP",kFALSE,"exact");\r
+ //this->FinalizeCorrelationsForDiffFlow("POI",kFALSE,"exact");\r
+ \r
+ // with weights:\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
+ {\r
+ //this->FinalizeCorrelationsForDiffFlow("RP",kTRUE,"exact");\r
+ //this->FinalizeCorrelationsForDiffFlow("POI",kTRUE,"exact");\r
+ //this->CalculateDiffFlowCumulants("RP",kTRUE,"exact");\r
+ //this->CalculateDiffFlowCumulants("POI",kTRUE,"exact");\r
+ //this->CalculateDiffFlow("RP",kTRUE,"exact");\r
+ //this->CalculateDiffFlow("POI",kTRUE,"exact");\r
+ //this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP",kTRUE,"exact");\r
+ //this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI",kTRUE,"exact");\r
+ }\r
+ \r
+ \r
+ //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"POI"); // to be improved (to calculate also when weights are used) \r
+ //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"RP"); // to be improved (to calculate also when weights are used)\r
+\r
+ \r
+ // *****************************************************************\r
+ // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****\r
+ // *****************************************************************\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
+ {\r
+ //this->FillCommonHistResultsDiffFlow("RP",kTRUE,"exact",kFALSE);\r
+ //this->FillCommonHistResultsDiffFlow("POI",kTRUE,"exact",kFALSE);\r
+ } else\r
+ {\r
+ this->FillCommonHistResultsDiffFlow("RP");\r
+ this->FillCommonHistResultsDiffFlow("POI");\r
+ }\r
+ \r
+ this->PrintFinalResultsForIntegratedFlow("RP"); \r
+ this->PrintFinalResultsForIntegratedFlow("POI"); \r
+ \r
+ // *****************************************************************************************\r
+ // **** COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW ****\r
+ // ***************************************************************************************** \r
+ \r
+ if(fEvaluateNestedLoopsForIntFlow) \r
+ {\r
+ this->CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);\r
+ } \r
+ \r
+ if(fEvaluateNestedLoopsForDiffFlow) \r
+ {\r
+ this->CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);\r
+ } \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::Finish()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()\r
+{\r
+ // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)\r
+ \r
+ // multiplicity:\r
+ Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ Double_t dReQ1n = (*fReQ)(0,0);\r
+ Double_t dReQ2n = (*fReQ)(1,0);\r
+ //Double_t dReQ3n = (*fReQ)(2,0);\r
+ //Double_t dReQ4n = (*fReQ)(3,0);\r
+ Double_t dImQ1n = (*fImQ)(0,0);\r
+ Double_t dImQ2n = (*fImQ)(1,0);\r
+ //Double_t dImQ3n = (*fImQ)(2,0);\r
+ //Double_t dImQ4n = (*fImQ)(3,0);\r
+ \r
+ // *************************************************************\r
+ // **** corrections for non-uniform acceptance (cos terms): ****\r
+ // *************************************************************\r
+ //\r
+ // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors \r
+ // are stored in 1D profile fQCorrectionsCos.\r
+ // Remark 2: binning of fQCorrectionsCos is organized as follows:\r
+ // --------------------------------------------------------------------------------------------------------------------\r
+ // 1st bin: <<cos(n*(phi1))>> = cosP1n\r
+ // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n\r
+ // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n\r
+ // ...\r
+ // --------------------------------------------------------------------------------------------------------------------\r
+ \r
+ // 1-particle:\r
+ Double_t cosP1n = 0.; // <<cos(n*(phi1))>>\r
+ \r
+ if(dMult>0)\r
+ {\r
+ cosP1n = dReQ1n/dMult; \r
+ \r
+ // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:\r
+ fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);\r
+ \r
+ // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:\r
+ fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult); \r
+ } \r
+ \r
+ // 2-particle:\r
+ Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>\r
+ \r
+ if(dMult>1)\r
+ {\r
+ cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1)); \r
+ \r
+ // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:\r
+ fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);\r
+ \r
+ // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:\r
+ fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1)); \r
+ } \r
+ \r
+ // 3-particle:\r
+ Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>\r
+ \r
+ if(dMult>2)\r
+ {\r
+ cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)\r
+ / (dMult*(dMult-1)*(dMult-2)); \r
+ \r
+ // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:\r
+ fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);\r
+ \r
+ // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:\r
+ fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2)); \r
+ } \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()\r
+{\r
+ // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)\r
+ \r
+ // multiplicity:\r
+ Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ Double_t dReQ1n = (*fReQ)(0,0);\r
+ Double_t dReQ2n = (*fReQ)(1,0);\r
+ //Double_t dReQ3n = (*fReQ)(2,0);\r
+ //Double_t dReQ4n = (*fReQ)(3,0);\r
+ Double_t dImQ1n = (*fImQ)(0,0);\r
+ Double_t dImQ2n = (*fImQ)(1,0);\r
+ //Double_t dImQ3n = (*fImQ)(2,0);\r
+ //Double_t dImQ4n = (*fImQ)(3,0);\r
+ \r
+ // *************************************************************\r
+ // **** corrections for non-uniform acceptance (sin terms): ****\r
+ // *************************************************************\r
+ //\r
+ // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors \r
+ // are stored in 1D profile fQCorrectionsSin.\r
+ // Remark 2: binning of fQCorrectionsSin is organized as follows:\r
+ // --------------------------------------------------------------------------------------------------------------------\r
+ // 1st bin: <<sin(n*(phi1))>> = sinP1n\r
+ // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n\r
+ // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n\r
+ // ...\r
+ // --------------------------------------------------------------------------------------------------------------------\r
+ \r
+ // 1-particle:\r
+ Double_t sinP1n = 0.; // <sin(n*(phi1))>\r
+ \r
+ if(dMult>0)\r
+ {\r
+ sinP1n = dImQ1n/dMult; \r
+ \r
+ // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:\r
+ fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);\r
+ \r
+ // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
+ fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult); \r
+ } \r
+ \r
+ // 2-particle:\r
+ Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>\r
+ \r
+ if(dMult>1)\r
+ {\r
+ sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1)); \r
+ \r
+ // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:\r
+ fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);\r
+ \r
+ // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
+ fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1)); \r
+ } \r
+ \r
+ // 3-particle:\r
+ Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>\r
+ \r
+ if(dMult>2)\r
+ {\r
+ sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)\r
+ / (dMult*(dMult-1)*(dMult-2)); \r
+ \r
+ // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:\r
+ fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);\r
+ \r
+ // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events: \r
+ fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2)); \r
+ } \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)\r
+{\r
+ // calculate corrections for non-uniform acceptance of the detector for differential flow (cos terms)\r
+ \r
+ // multiplicity:\r
+ //Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ //Double_t dReQ1n = (*fReQ)(0,0);\r
+ //Double_t dReQ2n = (*fReQ)(1,0);\r
+ //Double_t dReQ3n = (*fReQ)(2,0);\r
+ //Double_t dReQ4n = (*fReQ)(3,0);\r
+ //Double_t dImQ1n = (*fImQ)(0,0);\r
+ //Double_t dImQ2n = (*fImQ)(1,0);\r
+ //Double_t dImQ3n = (*fImQ)(2,0);\r
+ //Double_t dImQ4n = (*fImQ)(3,0);\r
+\r
+ // looping over all (pt,eta) bins and calculating correlations needed for differential flow: \r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin): \r
+ //Double_t dReqnPtEta = 0.;\r
+ //Double_t dImqnPtEta = 0.;\r
+\r
+ // number of POIs in each (pt,eta) bin:\r
+ Double_t dmPtEta = 0.;\r
+\r
+ // real and imaginary parts of q''_{n}, q''_{2n}, ... \r
+ // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin): \r
+ //Double_t dReqPrimePrime1nPtEta = 0.;\r
+ //Double_t dImqPrimePrime1nPtEta = 0.;\r
+ //Double_t dReqPrimePrime2nPtEta = 0.;\r
+ //Double_t dImqPrimePrime2nPtEta = 0.;\r
+\r
+ // number of particles which are both RPs and POIs in each (pt,eta) bin:\r
+ //Double_t dmPrimePrimePtEta = 0.;\r
+ \r
+ if(type == "POI")\r
+ {\r
+ // q''_{n}, q''_{2n}:\r
+ //...............................................................................................\r
+ //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));\r
+ //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));\r
+ //...............................................................................................\r
+ \r
+ // m'':\r
+ //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));\r
+ \r
+ // q'_{n}: \r
+ //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));\r
+ //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));\r
+ //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ // q_RP{n}, q_RP{2n}:\r
+ //...............................................................................................\r
+ //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));\r
+ //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));\r
+ //...............................................................................................\r
+ \r
+ // m'':\r
+ //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));\r
+ \r
+ //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)\r
+ //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)\r
+ //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-) \r
+ }\r
+ \r
+ // 1'-p correction:\r
+ //Double_t oneCosP1nPsiPtEta = 0.;\r
+ \r
+ if(dmPtEta)\r
+ {\r
+ //oneCosP1nPsiPtEta = dReqnPtEta/dmPtEta;\r
+ \r
+ // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:\r
+ if(type == "POI")\r
+ { \r
+ //fCorrectionsCosP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,\r
+ // oneCosP1nPsiPtEta,dmPtEta);\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ //fCorrectionsCosP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,\r
+ // oneCosP1nPsiPtEta,dmPtEta);\r
+ }\r
+ } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)\r
+ \r
+ /*\r
+ \r
+ // 4'-particle correlation:\r
+ Double_t four1n1n1n1nPtEta = 0.;\r
+ if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
+ {\r
+ four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)\r
+ - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
+ - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n\r
+ - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
+ + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
+ - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)\r
+ - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta \r
+ + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n) \r
+ + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n) \r
+ + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n) \r
+ + 2.*dmPrimePrimePtEta*dMult \r
+ - 6.*dmPrimePrimePtEta) \r
+ / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ \r
+ // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
+ if(type == "POI")\r
+ {\r
+ f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ }\r
+ } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ \r
+ */\r
+ \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)\r
+{\r
+ // calculate corrections for non-uniform acceptance of the detector for differential flow (sin terms)\r
+ \r
+ // multiplicity:\r
+ //Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ //Double_t dReQ1n = (*fReQ)(0,0);\r
+ //Double_t dReQ2n = (*fReQ)(1,0);\r
+ //Double_t dReQ3n = (*fReQ)(2,0);\r
+ //Double_t dReQ4n = (*fReQ)(3,0);\r
+ //Double_t dImQ1n = (*fImQ)(0,0);\r
+ //Double_t dImQ2n = (*fImQ)(1,0);\r
+ //Double_t dImQ3n = (*fImQ)(2,0);\r
+ //Double_t dImQ4n = (*fImQ)(3,0);\r
+\r
+ // looping over all (pt,eta) bins and calculating correlations needed for differential flow: \r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin): \r
+ //Double_t dReqnPtEta = 0.;\r
+ //Double_t dImqnPtEta = 0.;\r
+\r
+ // number of POIs in each (pt,eta) bin:\r
+ Double_t dmPtEta = 0.;\r
+\r
+ // real and imaginary parts of q''_{n}, q''_{2n}, ... \r
+ // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin): \r
+ //Double_t dReqPrimePrime1nPtEta = 0.;\r
+ //Double_t dImqPrimePrime1nPtEta = 0.;\r
+ //Double_t dReqPrimePrime2nPtEta = 0.;\r
+ //Double_t dImqPrimePrime2nPtEta = 0.;\r
+\r
+ // number of particles which are both RPs and POIs in each (pt,eta) bin:\r
+ //Double_t dmPrimePrimePtEta = 0.;\r
+ \r
+ if(type == "POI")\r
+ {\r
+ // q''_{n}, q''_{2n}:\r
+ //...............................................................................................\r
+ //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));\r
+ //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));\r
+ //...............................................................................................\r
+ \r
+ // m'':\r
+ //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));\r
+ \r
+ // q'_{n}: \r
+ //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));\r
+ //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));\r
+ //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ // q_RP{n}, q_RP{2n}:\r
+ //...............................................................................................\r
+ //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));\r
+ //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));\r
+ //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));\r
+ //...............................................................................................\r
+ \r
+ // m'':\r
+ //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));\r
+ \r
+ //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)\r
+ //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)\r
+ //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-) \r
+ }\r
+ \r
+ // 1'-p correction:\r
+ //Double_t oneSinP1nPsiPtEta = 0.;\r
+ \r
+ if(dmPtEta)\r
+ {\r
+ //oneSinP1nPsiPtEta = dImqnPtEta/dmPtEta;\r
+ \r
+ // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:\r
+ if(type == "POI")\r
+ { \r
+ //fCorrectionsSinP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,\r
+ // oneSinP1nPsiPtEta,dmPtEta);\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ //fCorrectionsSinP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,\r
+ // oneSinP1nPsiPtEta,dmPtEta);\r
+ }\r
+ } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)\r
+ \r
+ /*\r
+ \r
+ // 4'-particle correlation:\r
+ Double_t four1n1n1n1nPtEta = 0.;\r
+ if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
+ {\r
+ four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)\r
+ - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
+ - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n\r
+ - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
+ + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
+ - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)\r
+ - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta \r
+ + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n) \r
+ + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n) \r
+ + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n) \r
+ + 2.*dmPrimePrimePtEta*dMult \r
+ - 6.*dmPrimePrimePtEta) \r
+ / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ \r
+ // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
+ if(type == "POI")\r
+ {\r
+ f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ }\r
+ } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)\r
+ // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ \r
+ */\r
+ \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)\r
+{\r
+ // evaluate the nested loops relevant for differential flow (needed for cross-checking the results)\r
+ \r
+ Int_t nPrim = anEvent->NumberOfTracks(); \r
+ AliFlowTrackSimple *aftsTrack = NULL;\r
+ \r
+ Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
+ Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
+ \r
+ Int_t n = fHarmonic; // to be improved\r
+ \r
+ // ********************************************\r
+ // **** NESTED LOOPS FOR DIFFERENTIAL FLOW ****\r
+ // ******************************************** \r
+ \r
+ // Remark 1: (pt,eta) bin in which the cross-checking will be performed is given by 1.1 < pt < 1.2 GeV and -0.55 < eta < -0.525 \r
+ \r
+ // Remark 2: multi-particle correlations needed for diff. flow calculated with nested loops without weights are stored in 1D profile \r
+ // fDirectCorrelationsDiffFlow\r
+ \r
+ // Remark 3: multi-particle correlations needed for diff. flow calculated with nested loops with weights are stored in 1D profile \r
+ // fDirectCorrelationsDiffFlowW;\r
+ \r
+ // Remark 4: binning of fDirectCorrelationsDiffFlow is organized as follows:\r
+ //......................................................................................\r
+ // ---- bins 1-20: 2-particle correlations ----\r
+ // 1st bin: <2'>_{1n|1n} = twoPrime1n1n = <cos(n*(psi1-phi2))>\r
+ // ---- bins 21-40: 3-particle correlations ----\r
+ // ---- bins 41-60: 4-particle correlations ----\r
+ // 41st bin: <4'>_{1n,1n|1n,1n} = fourPrime1n1n1n1n = <cos(n*(psi1+phi2-phi3-phi4))>\r
+ //......................................................................................\r
+ \r
+ // Remark 5: binning of fDirectCorrelationsDiffFlow is organized as follows:\r
+ //......................................................................................\r
+ // ---- bins 1-20: 2-particle correlations ----\r
+ // 1st bin: twoPrime1n1nW0W1 = <w2 cos(n*(psi1-phi2))>\r
+ // ---- bins 21-40: 3-particle correlations ----\r
+ // ---- bins 41-60: 4-particle correlations ----\r
+ // 41st bin: fourPrime1n1n1n1nW0W1W1W1 = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>\r
+ //......................................................................................\r
+ \r
+ // 2'-particle:\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ // POI condition (first particle in the correlator must be POI): \r
+ if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;\r
+ psi1=aftsTrack->Phi(); \r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ fDirectCorrectionsDiffFlowCos->Fill(0.,cos(1.*n*(psi1)),1.); // <<cos(n*(psi1))>>\r
+ fDirectCorrectionsDiffFlowSin->Fill(0.,sin(1.*n*(psi1)),1.); // <<sin(n*(psi1))>>\r
+ \r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ // RP condition (!(first) particle in the correlator must be RP):\r
+ if(!(aftsTrack->InRPSelection()))continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted: \r
+ //..................................................................................... \r
+ fDirectCorrelationsDiffFlow->Fill(0.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))>\r
+ //..................................................................................... \r
+ // weighted:\r
+ //..................................................................................... \r
+ if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(0.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))>\r
+ //..................................................................................... \r
+ \r
+ //fDirectCorrelations->Fill(103.,cos(1.*n*(phi1-phi2)),pow(wPhi1,2)*wPhi2);//<2'>_{n,n}\r
+ //fDirectCorrelations->Fill(104.,cos(2.*n*(phi1-phi2)),wPhi1*pow(wPhi2,2));//<2'>_{n,n}\r
+ //fDirectCorrelations->Fill(105.,cos(1.*n*(phi1-phi2)),pow(wPhi2,3));//<2'>_{n,n} \r
+ //fDirectCorrelations->Fill(41.,cos(2.*n*(phi1-phi2)),1);//<2'>_{2n,2n}\r
+ //fDirectCorrelations->Fill(42.,cos(3.*n*(phi1-phi2)),1);//<2'>_{3n,3n}\r
+ //fDirectCorrelations->Fill(43.,cos(4.*n*(phi1-phi2)),1);//<2'>_{4n,4n} \r
+ \r
+ }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
+ }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
+ \r
+ \r
+ \r
+ /*\r
+ \r
+ //<3'>_{2n|n,n}\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition\r
+ psi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ {\r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ //fill the fDirectCorrelations: \r
+ \r
+ // 2-p\r
+ //fDirectCorrelations->Fill(101.,cos(n*(phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(phi2-phi3))>\r
+ //fDirectCorrelations->Fill(102.,cos(n*(phi1-phi3)),pow(wPhi2,2.)*wPhi3); // <w2^2 w3 cos(n(psi1-phi2))>\r
+ \r
+ // 3-p \r
+ //fDirectCorrelations->Fill(110.,cos(n*(2.*phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))>\r
+ //fDirectCorrelations->Fill(111.,cos(n*(phi1+phi2-2.*phi3)),wPhi2*pow(wPhi3,2.)); // <w2 w3^2 cos(n(psi1+phi2-2.*phi3))>\r
+ \r
+ \r
+ //fDirectCorrelations->Fill(46.,cos(n*(phi1+phi2-2.*phi3)),1);//<3'>_{n,n|2n} \r
+ }//end of for(Int_t i3=0;i3<nPrim;i3++) \r
+ }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
+ }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
+ */\r
+ \r
+ // 4'-particle:\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ // POI condition (first particle in the correlator must be POI): \r
+ if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;\r
+ psi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ // RP condition (!(first) particle in the correlator must be RP): \r
+ if(!(aftsTrack->InRPSelection()))continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ { \r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ // RP condition (!(first) particle in the correlator must be RP):\r
+ if(!(aftsTrack->InRPSelection()))continue;\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ // RP condition (!(first) particle in the correlator must be RP):\r
+ if(!(aftsTrack->InRPSelection()))continue; \r
+ phi4=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted:\r
+ //.........................................................................................................................\r
+ fDirectCorrelationsDiffFlow->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi1-phi2-phi3))> \r
+ //......................................................................................................................... \r
+ // weighted:\r
+ //...............................................................................................................................\r
+ if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4); // <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> \r
+ //............................................................................................................................... \r
+ \r
+ }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
+ }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
+ }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
+ }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
+ \r
+ /* \r
+ //<5'>_{2n,n|n,n,n}\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition\r
+ phi1=aftsTrack->Phi();\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi2=aftsTrack->Phi();\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ { \r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi3=aftsTrack->Phi();\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi4=aftsTrack->Phi();//\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi5=aftsTrack->Phi(); \r
+ //fill the fDirectCorrelations:if(bNestedLoops)\r
+ //fDirectCorrelations->Fill(55.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1);//<5'>_{2n,n|n,n,n}\r
+ }//end of for(Int_t i5=0;i5<nPrim;i5++) \r
+ }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
+ }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
+ }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
+ }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
+ \r
+\r
+ \r
+ */\r
+ /*\r
+ \r
+ \r
+ \r
+ //<6'>_{n,n,n|n,n,n}\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition\r
+ phi1=aftsTrack->Phi();\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi2=aftsTrack->Phi();\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ { \r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi3=aftsTrack->Phi();\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi4=aftsTrack->Phi();\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi5=aftsTrack->Phi(); \r
+ for(Int_t i6=0;i6<nPrim;i6++)\r
+ {\r
+ if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
+ aftsTrack=anEvent->GetTrack(i6);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi6=aftsTrack->Phi(); \r
+ //fill the fDirectCorrelations:\r
+ //fDirectCorrelations->Fill(60.,cos(n*(phi1+phi2+phi3-phi4-phi5-phi6)),1);//<6'>_{n,n,n|n,n,n}\r
+ }//end of for(Int_t i6=0;i6<nPrim;i6++) \r
+ }//end of for(Int_t i5=0;i5<nPrim;i5++) \r
+ }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
+ }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
+ }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
+ }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
+\r
+ \r
+ */\r
+ /* \r
+ \r
+ \r
+ //<7'>_{2n,n,n|n,n,n,n}\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition\r
+ phi1=aftsTrack->Phi();\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi2=aftsTrack->Phi();\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ { \r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi3=aftsTrack->Phi();\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi4=aftsTrack->Phi();\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi5=aftsTrack->Phi(); \r
+ for(Int_t i6=0;i6<nPrim;i6++)\r
+ {\r
+ if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
+ aftsTrack=anEvent->GetTrack(i6);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi6=aftsTrack->Phi();\r
+ for(Int_t i7=0;i7<nPrim;i7++)\r
+ {\r
+ if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
+ aftsTrack=anEvent->GetTrack(i7);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi7=aftsTrack->Phi(); \r
+ //fill the fDirectCorrelations:\r
+ //fDirectCorrelations->Fill(65.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1);//<7'>_{2n,n,n|n,n,n,n}\r
+ }//end of for(Int_t i7=0;i7<nPrim;i7++) \r
+ }//end of for(Int_t i6=0;i6<nPrim;i6++) \r
+ }//end of for(Int_t i5=0;i5<nPrim;i5++) \r
+ }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
+ }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
+ }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
+ }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
+\r
+ \r
+ \r
+ */\r
+ /* \r
+ \r
+ \r
+ \r
+ //<8'>_{n,n,n,n|n,n,n,n}\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition\r
+ phi1=aftsTrack->Phi();\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi2=aftsTrack->Phi();\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ { \r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi3=aftsTrack->Phi();\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi4=aftsTrack->Phi();\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi5=aftsTrack->Phi(); \r
+ for(Int_t i6=0;i6<nPrim;i6++)\r
+ {\r
+ if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
+ aftsTrack=anEvent->GetTrack(i6);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi6=aftsTrack->Phi();\r
+ for(Int_t i7=0;i7<nPrim;i7++)\r
+ {\r
+ if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
+ aftsTrack=anEvent->GetTrack(i7);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi7=aftsTrack->Phi();\r
+ for(Int_t i8=0;i8<nPrim;i8++)\r
+ {\r
+ if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;\r
+ aftsTrack=anEvent->GetTrack(i8);\r
+ if(!(aftsTrack->InRPSelection()))continue;//RP condition \r
+ phi8=aftsTrack->Phi(); \r
+ //fill the fDirectCorrelations:\r
+ //fDirectCorrelations->Fill(70.,cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8)),1);//<8'>_{n,n,n,n|n,n,n,n}\r
+ }//end of for(Int_t i8=0;i8<nPrim;i8++) \r
+ }//end of for(Int_t i7=0;i7<nPrim;i7++) \r
+ }//end of for(Int_t i6=0;i6<nPrim;i6++) \r
+ }//end of for(Int_t i5=0;i5<nPrim;i5++) \r
+ }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
+ }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
+ }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
+ }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
+ \r
+ \r
+ \r
+ */ \r
+ \r
+ \r
+ \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)\r
+{\r
+ // a) Get pointers for common control and common result histograms and profiles.\r
+ // b) Get pointers for histograms with particle weights.\r
+ // c) Get pointers for histograms and profiles relevant for integrated flow.\r
+ // d) Get pointers for histograms and profiles relevant for differental flow.\r
+ // e) Get pointers for histograms and profiles holding results obtained with nested loops.\r
+ \r
+ if(outputListHistos)\r
+ { \r
+ this->GetPointersForCommonHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
+ this->GetPointersForParticleWeightsHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
+ this->GetPointersForIntFlowHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
+ this->GetPointersForDiffFlowHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
+ this->GetPointersForNestedLoopsHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
+ }\r
+ \r
+ \r
+ /*\r
+ \r
+ \r
+ // profiles and results: \r
+ diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));\r
+ diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));\r
+ } else\r
+ {\r
+ cout<<"WARNING: diffFlowList is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ } \r
+ \r
+ // nested list in the list of profiles fDiffFlowListProfiles "Profiles":\r
+ TList *dfpType[2] = {NULL};\r
+ TList *dfpParticleWeights[2][2] = {{NULL}};\r
+ TList *dfpEventWeights[2][2][2] = {{{NULL}}};\r
+ TList *diffFlowCorrelations[2][2][2] = {{{NULL}}};\r
+ TList *diffFlowProductsOfCorrelations[2][2][2] = {{{NULL}}};\r
+ TList *diffFlowCorrectionTerms[2][2][2][2] = {{{{NULL}}}};\r
+ \r
+ if(diffFlowListProfiles)\r
+ {\r
+ for(Int_t t=0;t<2;t++)\r
+ {\r
+ dfpType[t] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(typeFlag[t].Data()));\r
+ if(dfpType[t])\r
+ {\r
+ for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)\r
+ {\r
+ dfpParticleWeights[t][pW] = dynamic_cast<TList*>(dfpType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));\r
+ if(dfpParticleWeights[t][pW])\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ dfpEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfpParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));\r
+ if(dfpEventWeights[t][pW][eW])\r
+ {\r
+ // correlations: \r
+ diffFlowCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));\r
+ // products of correlations:\r
+ diffFlowProductsOfCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Products of correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));\r
+ // correction terms:\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ diffFlowCorrectionTerms[t][pW][eW][sc] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Corrections for NUA (%s, pWeights %s, eWeights %s, %s terms)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data())));\r
+ //this->SetDiffFlowCorrectionTerms(diffFlowCorrectionTerms[t][pW][sc],t,pW,sc); \r
+ }\r
+ } else // to if(dfpEventWeights[t][pW][eW])\r
+ {\r
+ cout<<"WARNING: dfpEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ }\r
+ } // end of for(Int_t eW=0;eW<2;eW++) \r
+ } else // to if(dfpParticleWeights[t][pW])\r
+ {\r
+ cout<<"WARNING: dfpParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ }\r
+ } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++) \r
+ } else // if(dfpType[t]) \r
+ {\r
+ cout<<"WARNING: dfpType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ }\r
+ } // end of for(Int_t t=0;t<2;t++)\r
+ } else // to if(diffFlowListProfiles)\r
+ {\r
+ cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ } \r
+ \r
+ TProfile2D *correlationsPro[2][2][2][4] = {{{{NULL}}}};\r
+ TProfile2D *productsOfCorrelationsPro[2][2][2][5] = {{{{NULL}}}};\r
+ TProfile2D *correctionTermsPro[2][2][2][2][2] = {{{{{NULL}}}}};\r
+ \r
+ TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
+ TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};\r
+ TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};\r
+ TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};\r
+ TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};\r
+ TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};\r
+ TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
+ TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
+ \r
+ for(Int_t t=0;t<2;t++)\r
+ {\r
+ for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ // correlations:\r
+ if(diffFlowCorrelations[t][pW][eW])\r
+ {\r
+ for(Int_t correlIndex=0;correlIndex<4;correlIndex++)\r
+ {\r
+ correlationsPro[t][pW][eW][correlIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrelations[t][pW][eW]->FindObject(correlationName[correlIndex].Data()));\r
+ if(correlationsPro[t][pW][eW][correlIndex])\r
+ {\r
+ this->SetCorrelationsPro(correlationsPro[t][pW][eW][correlIndex],t,pW,eW,correlIndex);\r
+ } else // to if(correlationsPro[t][pW][ew][correlIndex])\r
+ {\r
+ cout<<"WARNING: correlationsPro[t][pW][eW][correlIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"ci = "<<correlIndex<<endl;\r
+ } \r
+ }\r
+ } else // to if(diffFlowCorrelations[t][pW][eW])\r
+ {\r
+ cout<<"WARNING: diffFlowCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ } \r
+ // products of correlations:\r
+ if(diffFlowProductsOfCorrelations[t][pW][eW])\r
+ {\r
+ for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)\r
+ {\r
+ productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = dynamic_cast<TProfile2D*>(diffFlowProductsOfCorrelations[t][pW][eW]->FindObject(productOfCorrelationsName[productOfCorrelationsIndex].Data()));\r
+ if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])\r
+ {\r
+ this->SetProductsOfCorrelationsPro(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex],t,pW,eW,productOfCorrelationsIndex);\r
+ } else // to if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])\r
+ {\r
+ cout<<"WARNING: productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"ci = "<<productOfCorrelationsIndex<<endl;\r
+ } \r
+ }\r
+ } else // to if(diffFlowProductsOfCorrelations[t][pW][eW])\r
+ {\r
+ cout<<"WARNING: diffFlowProductsOfCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ }\r
+ // correction terms:\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ if(diffFlowCorrectionTerms[t][pW][eW][sc])\r
+ {\r
+ for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)\r
+ {\r
+ if(sc==0)\r
+ {\r
+ correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsSinTermsName[correctionIndex].Data())); \r
+ if(correctionTermsPro[t][pW][eW][sc][correctionIndex])\r
+ {\r
+ this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);\r
+ } else \r
+ {\r
+ cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"sc = "<<sc<<endl;\r
+ cout<<"ci = "<<correctionIndex<<endl;\r
+ }\r
+ } \r
+ if(sc==1)\r
+ {\r
+ correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsCosTermsName[correctionIndex].Data())); \r
+ if(correctionTermsPro[t][pW][eW][sc][correctionIndex])\r
+ {\r
+ this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);\r
+ } else \r
+ {\r
+ cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"sc = "<<sc<<endl;\r
+ cout<<"ci = "<<correctionIndex<<endl;\r
+ } \r
+ } \r
+ } // end of for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)\r
+ } else // to if(diffFlowCorrectionTerms[t][pW][eW][sc])\r
+ {\r
+ cout<<"WARNING: diffFlowCorrectionTerms[t][pW][eW][sc] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"sc = "<<sc<<endl;\r
+ }\r
+ } // end of for(Int_t sc=0;sc<2;sc++) \r
+ } // end of for(Int_t eW=0;eW<2;eW++)\r
+ } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)\r
+ } // end of for(Int_t t=0;t<2;t++)\r
+ \r
+ // nested list in the list of results fDiffFlowListResults "Results":\r
+ TList *dfrType[2] = {NULL};\r
+ TList *dfrParticleWeights[2][2] = {{NULL}};\r
+ TList *dfrEventWeights[2][2][2] = {{{NULL}}};\r
+ TList *dfrCorrections[2][2][2][2] = {{{{NULL}}}}; \r
+ TList *diffFlowFinalCorrelations[2][2][2] = {{{NULL}}}; \r
+ TList *diffFlowFinalCorrections[2][2][2] = {{{NULL}}}; \r
+ TList *diffFlowFinalCovariances[2][2][2] = {{{NULL}}}; \r
+ TList *diffFlowFinalCumulants[2][2][2][2] = {{{{NULL}}}}; \r
+ TList *diffFlowFinalFlow[2][2][2][2] = {{{{NULL}}}}; \r
+ \r
+ if(diffFlowListResults)\r
+ {\r
+ for(Int_t t=0;t<2;t++)\r
+ {\r
+ dfrType[t] = dynamic_cast<TList*>(diffFlowListResults->FindObject(typeFlag[t].Data()));\r
+ if(dfrType[t])\r
+ {\r
+ for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)\r
+ {\r
+ dfrParticleWeights[t][pW] = dynamic_cast<TList*>(dfrType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));\r
+ if(dfrParticleWeights[t][pW])\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ dfrEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfrParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));\r
+ if(dfrEventWeights[t][pW][eW])\r
+ {\r
+ diffFlowFinalCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));\r
+ diffFlowFinalCorrections[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Corrections (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));\r
+ diffFlowFinalCovariances[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Covariances (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()))); \r
+ for(Int_t nua=0;nua<2;nua++)\r
+ {\r
+ dfrCorrections[t][pW][eW][nua] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("%s, pWeights %s, eWeights %s, %s for NUA",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));\r
+ if(dfrCorrections[t][pW][eW][nua])\r
+ {\r
+ diffFlowFinalCumulants[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Cumulants (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));\r
+ diffFlowFinalFlow[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Differential Flow (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));\r
+ } else // to if(dfrCorrections[t][pW][eW][nua])\r
+ {\r
+ cout<<"WARNING: dfrCorrections[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ }\r
+ } // end of for(Int_t nua=0;nua<2;nua++)\r
+ } else // to if(dfrEventWeights[t][pW][eW])\r
+ {\r
+ cout<<"WARNING: dfrEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ }\r
+ } // end of for(Int_t eW=0;eW<2;eW++)\r
+ } else // to if(dfrParticleWeights[t][pW])\r
+ {\r
+ cout<<"WARNING: dfrParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ }\r
+ } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)\r
+ } else // to if(dfrType[t])\r
+ {\r
+ cout<<"WARNING: dfrType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ }\r
+ } // end of for(Int_t t=0;t<2;t++)\r
+ } else // to if(diffFlowListResults)\r
+ {\r
+ cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ }\r
+ \r
+ TH2D *finalCorrelations2D[2][2][2][4] = {{{{NULL}}}};\r
+ TH1D *finalCorrelations1D[2][2][2][2][4] = {{{{{NULL}}}}}; \r
+ TH2D *finalCumulants2D[2][2][2][2][4] = {{{{{NULL}}}}};\r
+ TH1D *finalCumulantsPt[2][2][2][2][4] = {{{{{NULL}}}}}; \r
+ TH1D *finalCumulantsEta[2][2][2][2][4] = {{{{{NULL}}}}}; \r
+ TH2D *finalCorrections2D[2][2][2][4] = {{{{NULL}}}};\r
+ TH1D *finalCorrections1D[2][2][2][2][4] = {{{{{NULL}}}}}; \r
+ TH2D *finalCovariances2D[2][2][2][4] = {{{{NULL}}}};\r
+ TH1D *finalCovariances1D[2][2][2][2][5] = {{{{{NULL}}}}}; \r
+ TH2D *finalFlow2D[2][2][2][2][4] = {{{{{NULL}}}}};\r
+ TH1D *finalFlowPt[2][2][2][2][4] = {{{{{NULL}}}}}; \r
+ TH1D *finalFlowEta[2][2][2][2][4] = {{{{{NULL}}}}}; \r
+ TH2D *nonEmptyBins2D[2] = {NULL};\r
+ //TH1D *nonEmptyBins1D[2][2] = {{NULL}};\r
+ \r
+ for(Int_t t=0;t<2;t++)\r
+ {\r
+ // 2D:\r
+ nonEmptyBins2D[t] = dynamic_cast<TH2D*>(dfrType[t]->FindObject(Form("%s, (p_{t},#eta)",typeFlag[t].Data())));\r
+ if(nonEmptyBins2D[t])\r
+ {\r
+ this->SetNonEmptyBins2D(nonEmptyBins2D[t],t);\r
+ } else\r
+ { \r
+ cout<<"WARNING: nonEmptyBins2D[t] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ }\r
+ // 1D:\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ */\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ /*\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ nonEmptyBins1D[t][pe] = dynamic_cast<TH1D*>(dfrType[t]->FindObject(Form("%s, %s",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(nonEmptyBins1D[t][pe])\r
+ {\r
+ this->SetNonEmptyBins1D(nonEmptyBins1D[t][pe],t,pe);\r
+ } else\r
+ { \r
+ cout<<"WARNING: nonEmptyBins1D[t][pe] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ }\r
+ } \r
+ */ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ /*\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ // correlations:\r
+ if(diffFlowFinalCorrelations[t][pW][eW])\r
+ {\r
+ for(Int_t correlIndex=0;correlIndex<4;correlIndex++)\r
+ {\r
+ // 2D:\r
+ finalCorrelations2D[t][pW][eW][correlIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correlationName[correlIndex].Data())));\r
+ if(finalCorrelations2D[t][pW][eW][correlIndex])\r
+ {\r
+ this->SetFinalCorrelations2D(finalCorrelations2D[t][pW][eW][correlIndex],t,pW,eW,correlIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCorrelations2D[t][pW][eW][correlIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"ci = "<<correlIndex<<endl;\r
+ }\r
+ // 1D\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ if(pe==0)\r
+ {\r
+ finalCorrelations1D[t][pW][eW][pe][correlIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t})",correlationName[correlIndex].Data())));\r
+ }\r
+ if(pe==1)\r
+ {\r
+ finalCorrelations1D[t][pW][eW][pe][correlIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (#eta)",correlationName[correlIndex].Data())));\r
+ } \r
+ if(finalCorrelations1D[t][pW][eW][pe][correlIndex])\r
+ {\r
+ this->SetFinalCorrelations1D(finalCorrelations1D[t][pW][eW][pe][correlIndex],t,pW,eW,pe,correlIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCorrelations1D[t][pW][eW][pe][correlIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"ci = "<<correlIndex<<endl;\r
+ } \r
+ } // end of for(Int_t pe=0;pe<2;pe++) \r
+ } // end of for(Int_t correlIndex=0;correlIndex<4;correlIndex++)\r
+ } else // to if(diffFlowFinalCorrelations[t][pW][eW])\r
+ { \r
+ cout<<"WARNING: diffFlowFinalCorrelations[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ }\r
+ // corrections:\r
+ if(diffFlowFinalCorrections[t][pW][eW])\r
+ {\r
+ for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)\r
+ {\r
+ // 2D:\r
+ finalCorrections2D[t][pW][eW][correctionIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data())));\r
+ if(finalCorrections2D[t][pW][eW][correctionIndex])\r
+ {\r
+ this->SetFinalCorrections2D(finalCorrections2D[t][pW][eW][correctionIndex],t,pW,eW,correctionIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCorrections2D[t][pW][eW][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"ci = "<<correctionIndex<<endl;\r
+ }\r
+ // 1D\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ if(pe==0)\r
+ {\r
+ finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t})",correctionName[correctionIndex].Data())));\r
+ }\r
+ if(pe==1)\r
+ {\r
+ finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (#eta)",correctionName[correctionIndex].Data())));\r
+ } \r
+ if(finalCorrections1D[t][pW][eW][pe][correctionIndex])\r
+ {\r
+ this->SetFinalCorrections1D(finalCorrections1D[t][pW][eW][pe][correctionIndex],t,pW,eW,pe,correctionIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCorrections1D[t][pW][eW][pe][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"ci = "<<correctionIndex<<endl;\r
+ } \r
+ } // end of for(Int_t pe=0;pe<2;pe++) \r
+ } // end of for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)\r
+ } else // to if(diffFlowFinalCorrections[t][pW][eW])\r
+ { \r
+ cout<<"WARNING: diffFlowFinalCorrections[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ } \r
+ // covariances:\r
+ if(diffFlowFinalCovariances[t][pW][eW])\r
+ {\r
+ for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)\r
+ {\r
+ // 2D:\r
+ finalCovariances2D[t][pW][eW][covarianceIndex] = dynamic_cast<TH2D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data())));\r
+ if(finalCovariances2D[t][pW][eW][covarianceIndex])\r
+ {\r
+ this->SetFinalCovariances2D(finalCovariances2D[t][pW][eW][covarianceIndex],t,pW,eW,covarianceIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCovariances2D[t][pW][eW][nua][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"ci = "<<covarianceIndex<<endl;\r
+ }\r
+ // 1D:\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ if(pe==0)\r
+ {\r
+ finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data())));\r
+ }\r
+ if(pe==1)\r
+ {\r
+ finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (#eta)",covarianceName[covarianceIndex].Data())));\r
+ } \r
+ if(finalCovariances1D[t][pW][eW][pe][covarianceIndex])\r
+ {\r
+ this->SetFinalCovariances1D(finalCovariances1D[t][pW][eW][pe][covarianceIndex],t,pW,eW,pe,covarianceIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCovariances1D[t][pW][eW][pe][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"ci = "<<covarianceIndex<<endl;\r
+ } \r
+ } // end of for(Int_t pe=0;pe<2;pe++) \r
+ } // end of for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)\r
+ } else // to if(diffFlowFinalCovariances[t][pW][eW])\r
+ { \r
+ cout<<"WARNING: diffFlowFinalCovariances[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ } \r
+ \r
+ for(Int_t nua=0;nua<2;nua++)\r
+ { \r
+ // cumulants:\r
+ if(diffFlowFinalCumulants[t][pW][eW][nua])\r
+ {\r
+ for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)\r
+ {\r
+ // 2D:\r
+ finalCumulants2D[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH2D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data())));\r
+ if(finalCumulants2D[t][pW][eW][nua][cumulantIndex])\r
+ {\r
+ this->SetFinalCumulants2D(finalCumulants2D[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCumulants2D[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"ci = "<<cumulantIndex<<endl;\r
+ }\r
+ // pt: \r
+ finalCumulantsPt[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data())));\r
+ if(finalCumulantsPt[t][pW][eW][nua][cumulantIndex])\r
+ {\r
+ this->SetFinalCumulantsPt(finalCumulantsPt[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCumulantsPt[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"ci = "<<cumulantIndex<<endl;\r
+ } \r
+ // eta:\r
+ finalCumulantsEta[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",cumulantName[cumulantIndex].Data())));\r
+ if(finalCumulantsEta[t][pW][eW][nua][cumulantIndex])\r
+ {\r
+ this->SetFinalCumulantsEta(finalCumulantsEta[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalCumulantsEta[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"ci = "<<cumulantIndex<<endl;\r
+ } \r
+ } // end of for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)\r
+ } else // to if(diffFlowFinalCumulants[t][pW][eW][nua])\r
+ { \r
+ cout<<"WARNING: diffFlowFinalCumulants[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ } \r
+ // flow:\r
+ if(diffFlowFinalFlow[t][pW][eW][nua])\r
+ {\r
+ for(Int_t flowIndex=0;flowIndex<4;flowIndex++)\r
+ {\r
+ // 2D:\r
+ finalFlow2D[t][pW][eW][nua][flowIndex] = dynamic_cast<TH2D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data())));\r
+ if(finalFlow2D[t][pW][eW][nua][flowIndex])\r
+ {\r
+ this->SetFinalFlow2D(finalFlow2D[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalFlow2D[t][pW][eW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"ci = "<<flowIndex<<endl;\r
+ }\r
+ // pt:\r
+ finalFlowPt[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",flowName[flowIndex].Data())));\r
+ if(finalFlowPt[t][pW][eW][nua][flowIndex])\r
+ {\r
+ this->SetFinalFlowPt(finalFlowPt[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"ci = "<<flowIndex<<endl;\r
+ } \r
+ // eta: \r
+ finalFlowEta[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",flowName[flowIndex].Data()))); \r
+ if(finalFlowEta[t][pW][eW][nua][flowIndex])\r
+ {\r
+ this->SetFinalFlowEta(finalFlowEta[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);\r
+ } else\r
+ {\r
+ cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"ci = "<<flowIndex<<endl;\r
+ } \r
+ } // end of for(Int_t flowIndex=0;flowIndex<4;flowIndex++)\r
+ } else // to if(diffFlowFinalFlow[t][pW][eW][nua])\r
+ { \r
+ cout<<"WARNING: diffFlowFinalFlow[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ } \r
+ } // end of for(Int_t nua=0;nua<2;nua++)\r
+ } // end of for(Int_t eW=0;eW<2;eW++) \r
+ } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)\r
+ } // end of for(Int_t t=0;t<2;t++)\r
+ \r
+ // x.) nested loops:\r
+ TList *nestedLoopsList = dynamic_cast<TList*>(outputListHistos->FindObject("Nested Loops"));\r
+ if(nestedLoopsList) this->SetNestedLoopsList(nestedLoopsList);\r
+ TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fEvaluateNestedLoops"));\r
+ Bool_t bEvaluateNestedLoopsForIntFlow = kFALSE;\r
+ Bool_t bEvaluateNestedLoopsForDiffFlow = kFALSE;\r
+ if(evaluateNestedLoops)\r
+ {\r
+ this->SetEvaluateNestedLoops(evaluateNestedLoops);\r
+ bEvaluateNestedLoopsForIntFlow = (Int_t)evaluateNestedLoops->GetBinContent(1);\r
+ bEvaluateNestedLoopsForDiffFlow = (Int_t)evaluateNestedLoops->GetBinContent(2);\r
+ }\r
+ \r
+ if(bEvaluateNestedLoopsForIntFlow)\r
+ {\r
+ TProfile *directCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelation"));\r
+ if(directCorrelations) this->SetDirectCorrelations(directCorrelations);\r
+ TProfile *directCorrectionsCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCos"));\r
+ if(directCorrectionsCos) this->SetDirectCorrectionsCos(directCorrectionsCos);\r
+ TProfile *directCorrectionsSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSin"));\r
+ if(directCorrectionsSin) this->SetDirectCorrectionsSin(directCorrectionsSin);\r
+ if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)\r
+ {\r
+ TProfile *directCorrelationsW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationW"));\r
+ if(directCorrelationsW) this->SetDirectCorrelationsW(directCorrelationsW);\r
+ TProfile *directCorrectionsCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCosW"));\r
+ if(directCorrectionsCosW) this->SetDirectCorrectionsCosW(directCorrectionsCosW);\r
+ TProfile *directCorrectionsSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSinW")); \r
+ if(directCorrectionsSinW) this->SetDirectCorrectionsSinW(directCorrectionsSinW);\r
+ }\r
+ }\r
+ \r
+ if(bEvaluateNestedLoopsForDiffFlow)\r
+ {\r
+ TProfile *directCorrelationsDiffFlow = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlow"));\r
+ if(directCorrelationsDiffFlow) this->SetDirectCorrelationsDiffFlow(directCorrelationsDiffFlow);\r
+ TProfile *directCorrectionsDiffFlowCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCos"));\r
+ if(directCorrectionsDiffFlowCos) this->SetDirectCorrectionsDiffFlowCos(directCorrectionsDiffFlowCos);\r
+ TProfile *directCorrectionsDiffFlowSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSin"));\r
+ if(directCorrectionsDiffFlowSin) this->SetDirectCorrectionsDiffFlowSin(directCorrectionsDiffFlowSin);\r
+ if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)\r
+ {\r
+ TProfile *directCorrelationsDiffFlowW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlowW")); \r
+ if(directCorrelationsDiffFlowW) this->SetDirectCorrelationsDiffFlowW(directCorrelationsDiffFlowW);\r
+ TProfile *directCorrectionsDiffFlowCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCosW"));\r
+ if(directCorrectionsDiffFlowCosW) this->SetDirectCorrectionsDiffFlowCosW(directCorrectionsDiffFlowCosW);\r
+ TProfile *directCorrectionsDiffFlowSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSinW"));\r
+ if(directCorrectionsDiffFlowSinW) this->SetDirectCorrectionsDiffFlowSinW(directCorrectionsDiffFlowSinW);\r
+ }\r
+ }\r
+ \r
+ } \r
+ \r
+ */\r
+ \r
+\r
+ \r
+}\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const\r
+{\r
+ // project 2D profile onto pt axis to get 1D profile\r
+ \r
+ Int_t nBinsPt = profilePtEta->GetNbinsX();\r
+ Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();\r
+ Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();\r
+ \r
+ Int_t nBinsEta = profilePtEta->GetNbinsY();\r
+ \r
+ TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax); \r
+ \r
+ for(Int_t p=1;p<=nBinsPt;p++)\r
+ {\r
+ Double_t contentPt = 0.;\r
+ Double_t entryPt = 0.;\r
+ Double_t spreadPt = 0.;\r
+ Double_t sum1 = 0.;\r
+ Double_t sum2 = 0.;\r
+ Double_t sum3 = 0.;\r
+ for(Int_t e=1;e<=nBinsEta;e++)\r
+ {\r
+ contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))\r
+ * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
+ entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
+ \r
+ sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))\r
+ * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)\r
+ + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.)); \r
+ sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
+ sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))\r
+ * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e))); \r
+ }\r
+ if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)\r
+ {\r
+ spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);\r
+ }\r
+ profilePt->SetBinContent(p,contentPt);\r
+ profilePt->SetBinEntries(p,entryPt);\r
+ {\r
+ profilePt->SetBinError(p,spreadPt);\r
+ }\r
+ \r
+ }\r
+ \r
+ return profilePt;\r
+ \r
+} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const\r
+{\r
+ // project 2D profile onto eta axis to get 1D profile\r
+ \r
+ Int_t nBinsEta = profilePtEta->GetNbinsY();\r
+ Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();\r
+ Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();\r
+ \r
+ Int_t nBinsPt = profilePtEta->GetNbinsX();\r
+ \r
+ TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax); \r
+ \r
+ for(Int_t e=1;e<=nBinsEta;e++)\r
+ {\r
+ Double_t contentEta = 0.;\r
+ Double_t entryEta = 0.;\r
+ for(Int_t p=1;p<=nBinsPt;p++)\r
+ {\r
+ contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))\r
+ * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
+ entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
+ }\r
+ profileEta->SetBinContent(e,contentEta);\r
+ profileEta->SetBinEntries(e,entryEta);\r
+ }\r
+ \r
+ return profileEta;\r
+ \r
+} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)\r
+{\r
+ \r
+ useParticleWeights=kFALSE;\r
+ type="ac";\r
+ \r
+ // calculate final corrections due to non-uniform acceptance of the detector to reduced multi-particle correlations\r
+ /*\r
+ if(!(useParticleWeights))\r
+ {\r
+ if(type == "POI")\r
+ { \r
+ // **** corrections for non-uniform acceptance for 2nd order QC' for POI's ****\r
+ \r
+ // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:\r
+ if(fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos)\r
+ {\r
+ // pt,eta: \r
+ if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Reset(); // to be improved\r
+ TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaPOI->ProjectionXY("","e")));\r
+ correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPtEta1stTerm;\r
+ // pt:\r
+ if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Reset(); // to be improved\r
+ TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPt1stTerm;\r
+ // eta:\r
+ if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Reset(); // to be improved \r
+ TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionEta1stTerm; \r
+ } else\r
+ { \r
+ cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos && f2pFinalCorrectionsForNUAPtEtaPOI) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;\r
+ cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;\r
+ } \r
+ \r
+ // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>: \r
+ if(fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin)\r
+ {\r
+ // pt,eta:\r
+ TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaPOI->ProjectionXY("","e")));\r
+ correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPtEta2ndTerm;\r
+ // pt:\r
+ TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPt2ndTerm;\r
+ // eta:\r
+ TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionEta2ndTerm; \r
+ } else\r
+ { \r
+ cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;\r
+ cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;\r
+ } \r
+ } else if(type == "RP")\r
+ {\r
+ // **** corrections for non-uniform acceptance for 2nd order QC' for RP's ****\r
+ \r
+ // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:\r
+ if(fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos)\r
+ {\r
+ // pt,eta: \r
+ if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Reset(); // to be improved\r
+ TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaRP->ProjectionXY("","e")));\r
+ correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPtEta1stTerm;\r
+ // pt:\r
+ if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Reset(); // to be improved\r
+ TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPt1stTerm;\r
+ // eta:\r
+ if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Reset(); // to be improved\r
+ TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionEta1stTerm; \r
+ } else\r
+ { \r
+ cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;\r
+ cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;\r
+ } \r
+ // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>: \r
+ if(fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin)\r
+ {\r
+ // pt,eta: \r
+ TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaRP->ProjectionXY("","e")));\r
+ correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPtEta2ndTerm;\r
+ // pt:\r
+ TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionPt2ndTerm;\r
+ // eta:\r
+ TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here? \r
+ correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here? \r
+ if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)\r
+ delete correctionEta2ndTerm; \r
+ } else\r
+ { \r
+ cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;\r
+ cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;\r
+ } \r
+ } else // to else if(type == "RP")\r
+ {\r
+ cout<<"WARNING: Type must be either POI or RP in QC::CFCFNUAFDF() !!!! "<<endl;\r
+ cout<<" Corrections for non-uniform acceptance for differential flow were not calculated."<<endl;\r
+ } \r
+ } else // to if(!(useParticleWeights))\r
+ {\r
+ // ...\r
+ }\r
+ */\r
+} // end of AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)\r
+\r
+\r
+//==================================================================================================================================\r
+\r
+/*\r
+void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(\r
+ TH2D *flowPtEta, TH1D *flowPt, TH1D *flowEta, \r
+ TProfile2D *profile2ndPtEta, TProfile2D *profile4thPtEta, \r
+ TProfile2D *profile6thPtEta, TProfile2D *profile8thPtEta)\r
+{\r
+ // calculate and store the final results for integrated flow\r
+ \r
+ TString *namePtEta = new TString();\r
+ TString *type = new TString();\r
+ TString *order2nd = new TString();\r
+ TString *order4th = new TString();\r
+ TString *order6th = new TString();\r
+ TString *order8th = new TString(); \r
+ TString *pW = new TString();\r
+\r
+ if(profile2ndPtEta) *namePtEta = profile2ndPtEta->GetName();\r
+ if(namePtEta->Contains("POI")) *type = "POI";\r
+ if(namePtEta->Contains("RP")) *type = "RP";\r
+ if(namePtEta->Contains("W")) *pW = "W";\r
+ if(namePtEta->Contains("2")) *order2nd = "2";\r
+ if(profile4thPtEta) *namePtEta = profile4thPtEta->GetName();\r
+ if(namePtEta->Contains("4")) *order4th = "4";\r
+\r
+ if(profile6thPtEta) *namePtEta = profile6thPtEta->GetName();\r
+ if(namePtEta->Contains("6")) *order6th = "6";\r
+ \r
+ if(profile8thPtEta) *namePtEta = profile8thPtEta->GetName();\r
+ if(namePtEta->Contains("8")) *order8th = "8";\r
+\r
+ TProfile *profile2ndPt = NULL;\r
+ TProfile *profile4thPt = NULL;\r
+ TProfile *profile6thPt = NULL;\r
+ TProfile *profile8thPt = NULL;\r
+\r
+ TProfile *profile2ndEta = NULL;\r
+ TProfile *profile4thEta = NULL;\r
+ TProfile *profile6thEta = NULL;\r
+ TProfile *profile8thEta = NULL;\r
+ \r
+ if(*order2nd == "2")\r
+ {\r
+ profile2ndPt = new TProfile(*(this->MakePtProjection(profile2ndPtEta))); \r
+ profile2ndEta = new TProfile(*(this->MakeEtaProjection(profile2ndPtEta))); \r
+ if(*order4th == "4")\r
+ {\r
+ profile4thPt = new TProfile(*(this->MakePtProjection(profile4thPtEta))); \r
+ profile4thEta = new TProfile(*(this->MakeEtaProjection(profile4thPtEta))); \r
+ if(*order6th == "6")\r
+ {\r
+ profile6thPt = new TProfile(*(this->MakePtProjection(profile6thPtEta))); \r
+ profile6thEta = new TProfile(*(this->MakeEtaProjection(profile6thPtEta))); \r
+ if(*order8th == "8")\r
+ {\r
+ profile8thPt = new TProfile(*(this->MakePtProjection(profile8thPtEta))); \r
+ profile8thEta = new TProfile(*(this->MakeEtaProjection(profile8thPtEta))); \r
+ } \r
+ } \r
+ } \r
+ }\r
+ \r
+ Int_t nBinsPt = profile2ndPt->GetNbinsX();\r
+ Int_t nBinsEta = profile2ndEta->GetNbinsX();\r
+ \r
+ Double_t dV2 = 0.;\r
+ Double_t dV4 = 0.;\r
+ Double_t dV6 = 0.;\r
+ Double_t dV8 = 0.; \r
+ \r
+ if(!(*pW == "W"))\r
+ {\r
+ dV2 = fIntFlowResultsQC->GetBinContent(1); \r
+ dV4 = fIntFlowResultsQC->GetBinContent(2); \r
+ dV6 = fIntFlowResultsQC->GetBinContent(3); \r
+ dV8 = fIntFlowResultsQC->GetBinContent(4); \r
+ } \r
+ else if(*pW == "W")\r
+ {\r
+ dV2 = fIntFlowResultsQCW->GetBinContent(1); \r
+ dV4 = fIntFlowResultsQCW->GetBinContent(2); \r
+ dV6 = fIntFlowResultsQCW->GetBinContent(3); \r
+ dV8 = fIntFlowResultsQCW->GetBinContent(4); \r
+ } \r
+ \r
+ // 3D (pt,eta): \r
+ Double_t twoPrimePtEta = 0.; // <<2'>> (pt,eta) \r
+ Double_t fourPrimePtEta = 0.; // <<4'>> (pt,eta) \r
+ //Double_t sixPrimePtEta = 0.; // <<6'>> (pt,eta) \r
+ //Double_t eightPrimePtEta = 0.; // <<8'>> (pt,eta) \r
+ Double_t secondOrderDiffFlowCumulantPtEta = 0.; // d_n{2,Q} (pt,eta)\r
+ Double_t fourthOrderDiffFlowCumulantPtEta = 0.; // d_n{4,Q} (pt,eta) \r
+ //Double_t sixthOrderDiffFlowCumulantPtEta = 0.; // d_n{6,Q} (pt,eta)\r
+ //Double_t eightOrderDiffFlowCumulantPtEta = 0.; // d_n{8,Q} (pt,eta)2nd\r
+ Double_t dv2PtEta = 0.; // v'_n{2} (pt,eta) \r
+ Double_t dv4PtEta = 0.; // v'_n{4} (pt,eta) \r
+ //Double_t dv6PtEta = 0.; // v'_n{6} (pt,eta) \r
+ //Double_t dv8PtEta = 0.; // v'_n{8} (pt,eta) \r
+\r
+ // 2D (pt): \r
+ Double_t twoPrimePt = 0.; // <<2'>> (pt) \r
+ Double_t fourPrimePt = 0.; // <<4'>> (pt) \r
+ //Double_t sixPrimePt = 0.; // <<6'>> (pt) \r
+ //Double_t eightPrimePt = 0.; // <<8'>> (pt) \r
+ Double_t secondOrderDiffFlowCumulantPt = 0.; // d_n{2,Q} (pt) \r
+ Double_t fourthOrderDiffFlowCumulantPt = 0.; // d_n{4,Q} (pt) \r
+ //Double_t sixthOrderDiffFlowCumulantPt = 0.; // d_n{6,Q} (pt)\r
+ //Double_t eightOrderDiffFlowCumulantPt = 0.; // d_n{8,Q} (pt)\r
+ Double_t dv2Pt = 0.; // v'_n{2} (pt)\r
+ Double_t dv4Pt = 0.; // v'_n{4} (pt)\r
+ //Double_t dv6Pt = 0.; // v'_n{6} (pt) \r
+ //Double_t dv8Pt = 0.; // v'_n{8} (pt) \r
+\r
+ // 2D (eta): \r
+ Double_t twoPrimeEta = 0.; // <<2'>> (eta) \r
+ Double_t fourPrimeEta = 0.; // <<4>> (eta) \r
+ //Double_t sixPrimeEta = 0.; // <<6>> (eta) \r
+ //Double_t eightPrimeEta = 0.; // <<8'>> (eta) \r
+ Double_t secondOrderDiffFlowCumulantEta = 0.; // d_n{2,Q} (eta)\r
+ Double_t fourthOrderDiffFlowCumulantEta = 0.; // d_n{4,Q} (eta) \r
+ //Double_t sixthOrderDiffFlowCumulantEta = 0.; // d_n{6,Q} (eta) \r
+ //Double_t eightOrderDiffFlowCumulantEta = 0.; // d_n{8,Q} (eta) \r
+ Double_t dv2Eta = 0.; // v'_n{2} (eta)\r
+ Double_t dv4Eta = 0.; // v'_n{4} (eta)\r
+ //Double_t dv6Eta = 0.; // v'_n{6} (eta) \r
+ //Double_t dv8Eta = 0.; // v'_n{8} (eta)\r
+ \r
+\r
+ // looping over (pt,eta) bins to calculate v'(pt,eta) \r
+ for(Int_t p=1;p<nBinsPt+1;p++)\r
+ {\r
+ for(Int_t e=1;e<nBinsEta+1;e++)\r
+ {\r
+ \r
+ // 2nd order: \r
+ twoPrimePtEta = profile2ndPtEta->GetBinContent(profile2ndPtEta->GetBin(p,e));\r
+ secondOrderDiffFlowCumulantPtEta = twoPrimePtEta;\r
+ \r
+\r
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r
+ // to be improved (applying correction for NUA):\r
+ if(namePtEta->Contains("POI"))\r
+ {\r
+ if(f2pFinalCorrectionsForNUAPtEtaPOI) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta \r
+ - f2pFinalCorrectionsForNUAPtEtaPOI->GetBinContent(f2pFinalCorrectionsForNUAPtEtaPOI->GetBin(p,e)) ;\r
+ } else if (namePtEta->Contains("RP"))\r
+ { \r
+ if(f2pFinalCorrectionsForNUAPtEtaRP) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta \r
+ - f2pFinalCorrectionsForNUAPtEtaRP->GetBinContent(f2pFinalCorrectionsForNUAPtEtaRP->GetBin(p,e));\r
+ }\r
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r
+ \r
+ \r
+ if(dV2)\r
+ {\r
+ dv2PtEta = secondOrderDiffFlowCumulantPtEta/dV2;\r
+ if(*order2nd == "2") \r
+ {\r
+ flowPtEta->SetBinContent(p,e,dv2PtEta); \r
+ } \r
+ }\r
+ \r
+ // 4th order: \r
+ if(*order4th == "4" || *order6th == "6" || *order8th == "8")\r
+ {\r
+ fourPrimePtEta = profile4thPtEta->GetBinContent(profile4thPtEta->GetBin(p,e));\r
+ fourthOrderDiffFlowCumulantPtEta = fourPrimePtEta - 2.*twoPrimePtEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))\r
+ if(dV4)\r
+ {\r
+ dv4PtEta = -fourthOrderDiffFlowCumulantPtEta/pow(dV4,3);\r
+ if(*order4th == "4")\r
+ {\r
+ flowPtEta->SetBinContent(p,e,dv4PtEta);\r
+ } \r
+ }\r
+ } \r
+ \r
+ } // end of for(Int_t e=1;e<nBinsEta+1;e++)\r
+ } // end of for(Int_t p=1;p<nBinsPt+1;p++) \r
+ \r
+ \r
+ // looping over (pt) bins to calcualate v'(pt)\r
+ for(Int_t p=1;p<nBinsPt+1;p++)\r
+ {\r
+ \r
+ // 2nd order: \r
+ twoPrimePt = profile2ndPt->GetBinContent(p);\r
+ secondOrderDiffFlowCumulantPt = twoPrimePt;\r
+ \r
+ \r
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r
+ // to be improved (applying correction for NUA):\r
+ if(namePtEta->Contains("POI"))\r
+ {\r
+ if(f2pFinalCorrectionsForNUAPtPOI) secondOrderDiffFlowCumulantPt = twoPrimePt\r
+ - f2pFinalCorrectionsForNUAPtPOI->GetBinContent(p) ;\r
+ } else if (namePtEta->Contains("RP"))\r
+ {\r
+ if(f2pFinalCorrectionsForNUAPtRP) secondOrderDiffFlowCumulantPt = twoPrimePt\r
+ - f2pFinalCorrectionsForNUAPtRP->GetBinContent(p);\r
+ }\r
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r
+ \r
+ \r
+ if(dV2)\r
+ {\r
+ dv2Pt = secondOrderDiffFlowCumulantPt/dV2;\r
+ if(*order2nd == "2") \r
+ {\r
+ flowPt->SetBinContent(p,dv2Pt);\r
+ }\r
+ \r
+ // common control histos: (to be improved fill only once. now they are filled first without weights and then with weights):\r
+ if(namePtEta->Contains("POI") && *order2nd == "2")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)\r
+ } \r
+ else if(namePtEta->Contains("RP") && *order2nd == "2")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)\r
+ }\r
+ \r
+ }\r
+ \r
+ // 4th order: \r
+ if(*order4th == "4" || *order6th == "6" || *order8th == "8")\r
+ {\r
+ fourPrimePt = profile4thPt->GetBinContent(profile4thPt->GetBin(p));\r
+ fourthOrderDiffFlowCumulantPt = fourPrimePt - 2.*twoPrimePt*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))\r
+ if(dV4)\r
+ {\r
+ dv4Pt = -fourthOrderDiffFlowCumulantPt/pow(dV4,3);\r
+ if(*order4th == "4") \r
+ {\r
+ flowPt->SetBinContent(p,dv4Pt);\r
+ }\r
+ \r
+ // common control histos: (to be improved):\r
+ if(namePtEta->Contains("POI") && *order4th == "4")\r
+ {\r
+ fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)\r
+ } \r
+ else if(namePtEta->Contains("RP") && *order4th == "4" )\r
+ {\r
+ fCommonHistsResults4th->FillDifferentialFlowPtRP(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)\r
+ }\r
+ \r
+ }\r
+ } \r
+ \r
+ } // end of for(Int_t p=1;p<nBinsPt+1;p++) \r
+ \r
+ \r
+ // looping over (eta) bins to calcualate v'(eta)\r
+ for(Int_t e=1;e<nBinsEta+1;e++)\r
+ {\r
+ \r
+ // 2nd order: \r
+ twoPrimeEta = profile2ndEta->GetBinContent(e);\r
+ secondOrderDiffFlowCumulantEta = twoPrimeEta;\r
+ \r
+ \r
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r
+ // to be improved (applying correction for NUA):\r
+ if(namePtEta->Contains("POI"))\r
+ {\r
+ if(f2pFinalCorrectionsForNUAEtaPOI) secondOrderDiffFlowCumulantEta = twoPrimeEta\r
+ - f2pFinalCorrectionsForNUAEtaPOI->GetBinContent(e) ;\r
+ } else if (namePtEta->Contains("RP"))\r
+ {\r
+ if(f2pFinalCorrectionsForNUAEtaRP) secondOrderDiffFlowCumulantEta = twoPrimeEta\r
+ - f2pFinalCorrectionsForNUAEtaRP->GetBinContent(e);\r
+ }\r
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r
+ \r
+ \r
+ if(dV2)\r
+ {\r
+ dv2Eta = secondOrderDiffFlowCumulantEta/dV2;\r
+ if(*order2nd == "2") \r
+ {\r
+ flowEta->SetBinContent(e,dv2Eta);\r
+ }\r
+ \r
+ // common control histos: (to be improved):\r
+ if(namePtEta->Contains("POI") && *order2nd == "2")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)\r
+ } \r
+ else if(namePtEta->Contains("RP") && *order2nd == "2")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)\r
+ }\r
+ \r
+\r
+ }\r
+ \r
+ // 4th order: \r
+ if(*order4th == "4" || *order6th == "6" || *order8th == "8")\r
+ {\r
+ fourPrimeEta = profile4thEta->GetBinContent(profile4thEta->GetBin(e));\r
+ fourthOrderDiffFlowCumulantEta = fourPrimeEta - 2.*twoPrimeEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))\r
+ if(dV4)\r
+ {\r
+ dv4Eta = -fourthOrderDiffFlowCumulantEta/pow(dV4,3);\r
+ if(*order4th == "4")\r
+ {\r
+ flowEta->SetBinContent(e,dv4Eta);\r
+ }\r
+ \r
+ // common control histos: (to be improved):\r
+ if(namePtEta->Contains("POI") && *order4th == "4")\r
+ {\r
+ fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)\r
+ } \r
+ else if(namePtEta->Contains("RP") && *order4th == "4")\r
+ {\r
+ fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)\r
+ }\r
+ \r
+ }\r
+ } \r
+ \r
+ } // end of for(Int_t e=1;e<nBinsEta+1;e++) \r
+ \r
+ delete namePtEta;\r
+ delete type;\r
+ delete order2nd;\r
+ delete order4th;\r
+ delete order6th;\r
+ delete order8th;\r
+ delete pW;\r
+ delete profile2ndPt;\r
+ delete profile4thPt;\r
+ delete profile6thPt;\r
+ delete profile8thPt;\r
+ delete profile2ndEta;\r
+ delete profile4thEta;\r
+ delete profile6thEta;\r
+ delete profile8thEta;\r
+\r
+} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(Bool_t useParticleWeights, TString type)\r
+*/\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)\r
+{\r
+ // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME) \r
+ \r
+ Int_t n = fHarmonic; \r
+ \r
+ if(type == "NONAME" || type == "RP" || type == "POI")\r
+ {\r
+ if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
+ {\r
+ cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;\r
+ cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;\r
+ }\r
+ } else\r
+ {\r
+ cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8} \r
+ Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8} \r
+ \r
+ if(type == "NONAME")\r
+ {\r
+ dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1); \r
+ dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1); \r
+ dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1); \r
+ dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1); \r
+ dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1); \r
+ dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1); \r
+ dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1); \r
+ dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1); \r
+ } else if(type == "RP")\r
+ {\r
+ dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1); \r
+ dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1); \r
+ dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1); \r
+ dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1); \r
+ dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1); \r
+ dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1); \r
+ dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1); \r
+ dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1); \r
+ } else if(type == "POI")\r
+ {\r
+ dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1); \r
+ dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1); \r
+ dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1); \r
+ dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1); \r
+ dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1); \r
+ dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1); \r
+ dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1); \r
+ dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1); \r
+ }\r
+ \r
+ TString title = " flow estimates from Q-cumulants"; \r
+ TString subtitle = " ("; \r
+ \r
+ if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
+ {\r
+ subtitle.Append(type);\r
+ subtitle.Append(", without weights)");\r
+ } else \r
+ {\r
+ subtitle.Append(type);\r
+ subtitle.Append(", with weights)");\r
+ }\r
+ \r
+ cout<<endl;\r
+ cout<<"*************************************"<<endl;\r
+ cout<<"*************************************"<<endl;\r
+ cout<<title.Data()<<endl; \r
+ cout<<subtitle.Data()<<endl; \r
+ cout<<endl;\r
+ \r
+ for(Int_t i=0;i<4;i++)\r
+ {\r
+ if(dVn[i]>=0.)\r
+ {\r
+ cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;\r
+ }\r
+ else\r
+ {\r
+ cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;\r
+ } \r
+ }\r
+\r
+ cout<<endl;\r
+ /*\r
+ if(type == "NONAME")\r
+ {\r
+ cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved\r
+ }\r
+ else if (type == "RP")\r
+ {\r
+ cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved \r
+ } \r
+ else if (type == "POI")\r
+ {\r
+ cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved \r
+ } \r
+ */\r
+ cout<<"*************************************"<<endl;\r
+ cout<<"*************************************"<<endl;\r
+ cout<<endl; \r
+ \r
+}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(Bool_t useParticleWeights)\r
+{\r
+ // compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors\r
+\r
+ cout<<endl;\r
+ cout<<" *************************************"<<endl;\r
+ cout<<" **** cross-checking the formulas ****"<<endl;\r
+ cout<<" **** for differential flow ****"<<endl;\r
+ cout<<" **** ****"<<endl;\r
+ cout<<" **** (pt,eta) bin: ****"<<endl; \r
+ cout<<" **** 1.1 < pt < 1.2 GeV ****"<<endl; \r
+ cout<<" **** -0.55 < eta < -0.525 ****"<<endl; \r
+ cout<<" *************************************"<<endl; \r
+ cout<<endl;\r
+ \r
+ if(!useParticleWeights)\r
+ { \r
+ cout<<"<cos(n(psi1-phi2))> from Q-vectors = "<<fCorrelationsPro[0][0][0][0]->GetBinContent(fCorrelationsPro[0][0][0][0]->GetBin(12,19))<<endl;\r
+ cout<<"<cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(1)<<endl;\r
+ cout<<endl; \r
+ cout<<"<cos(n(psi1+phi2-phi3-phi4))> from Q-vectors = "<<fCorrelationsPro[0][0][0][1]->GetBinContent(fCorrelationsPro[0][0][0][1]->GetBin(12,19))<<endl;\r
+ cout<<"<cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(41)<<endl;\r
+ cout<<endl; \r
+ cout<<"****************************************************"<<endl;\r
+ cout<<"****************************************************"<<endl;\r
+ cout<<endl;\r
+ /*\r
+ cout<<"<cos(n(psi1))> from Q-vectors = "<<fCorrectionsCosP1nPsiPtEtaPOI->GetBinContent(fCorrectionsCosP1nPsiPtEtaPOI->GetBin(12,19))<<endl;\r
+ cout<<"<cos(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowCos->GetBinContent(1)<<endl;\r
+ cout<<endl; \r
+ cout<<"<sin(n(psi1))> from Q-vectors = "<<fCorrectionsSinP1nPsiPtEtaPOI->GetBinContent(fCorrectionsSinP1nPsiPtEtaPOI->GetBin(12,19))<<endl;\r
+ cout<<"<sin(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowSin->GetBinContent(1)<<endl;\r
+ cout<<endl;\r
+ */\r
+ }\r
+ \r
+ if(useParticleWeights)\r
+ {\r
+ cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][0]->GetBinContent(fCorrelationsPro[0][1][0][0]->GetBin(12,19))<<endl;\r
+ cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][0]->GetBinContent(fCorrelationsPro[1][1][0][0]->GetBin(12,19))<<endl;\r
+ cout<<"<w2 cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(1)<<endl;\r
+ cout<<endl; \r
+ cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][1]->GetBinContent(fCorrelationsPro[0][1][0][1]->GetBin(12,19))<<endl;\r
+ cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][1]->GetBinContent(fCorrelationsPro[1][1][0][1]->GetBin(12,19))<<endl;\r
+ cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(41)<<endl;\r
+ cout<<endl; \r
+ }\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)\r
+{\r
+ //store the final results in output .root file\r
+ TFile *output = new TFile(outputFileName.Data(),"RECREATE");\r
+ //output->WriteObject(fHistList, "cobjQC","SingleKey");\r
+ fHistList->Write(fHistList->GetName(), TObject::kSingleKey);\r
+ delete output;\r
+}\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::BookCommonHistograms()\r
+{\r
+ // book common control histograms and common histograms for final results\r
+ \r
+ // common control histogram (ALL events)\r
+ fCommonHists = new AliFlowCommonHist("AliFlowCommonHistQC");\r
+ fHistList->Add(fCommonHists); \r
+ \r
+ // common control histogram (for events with 2 and more particles)\r
+ fCommonHists2nd = new AliFlowCommonHist("AliFlowCommonHist2ndOrderQC");\r
+ fHistList->Add(fCommonHists2nd); \r
+ \r
+ // common control histogram (for events with 4 and more particles)\r
+ fCommonHists4th = new AliFlowCommonHist("AliFlowCommonHist4thOrderQC");\r
+ fHistList->Add(fCommonHists4th); \r
+ \r
+ // common control histogram (for events with 6 and more particles)\r
+ fCommonHists6th = new AliFlowCommonHist("AliFlowCommonHist6thOrderQC");\r
+ fHistList->Add(fCommonHists6th); \r
+ \r
+ // common control histogram (for events with 8 and more particles)\r
+ fCommonHists8th = new AliFlowCommonHist("AliFlowCommonHist8thOrderQC");\r
+ fHistList->Add(fCommonHists8th); \r
+ \r
+ // common histograms for final results (calculated for events with 2 and more particles)\r
+ fCommonHistsResults2nd = new AliFlowCommonHistResults("AliFlowCommonHistResults2ndOrderQC");\r
+ fHistList->Add(fCommonHistsResults2nd); \r
+ \r
+ // common histograms for final results (calculated for events with 4 and more particles)\r
+ fCommonHistsResults4th = new AliFlowCommonHistResults("AliFlowCommonHistResults4thOrderQC");\r
+ fHistList->Add(fCommonHistsResults4th);\r
+ \r
+ // common histograms for final results (calculated for events with 6 and more particles)\r
+ fCommonHistsResults6th = new AliFlowCommonHistResults("AliFlowCommonHistResults6thOrderQC");\r
+ fHistList->Add(fCommonHistsResults6th); \r
+ \r
+ // common histograms for final results (calculated for events with 8 and more particles)\r
+ fCommonHistsResults8th = new AliFlowCommonHistResults("AliFlowCommonHistResults8thOrderQC");\r
+ fHistList->Add(fCommonHistsResults8th); \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()\r
+{\r
+ // book and fill histograms which hold phi, pt and eta weights\r
+\r
+ if(!fWeightsList)\r
+ {\r
+ cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
+ exit(0); \r
+ }\r
+ \r
+ TString fUseParticleWeightsName = "fUseParticleWeightsQC";\r
+ fUseParticleWeightsName += fAnalysisLabel->Data();\r
+ fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);\r
+ fUseParticleWeights->SetLabelSize(0.06);\r
+ (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");\r
+ (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");\r
+ (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");\r
+ fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);\r
+ fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);\r
+ fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);\r
+ fWeightsList->Add(fUseParticleWeights); \r
+ \r
+ if(fUsePhiWeights)\r
+ {\r
+ if(fWeightsList->FindObject("phi_weights"))\r
+ {\r
+ fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));\r
+ if(fPhiWeights->GetBinWidth(1) != fPhiBinWidth)\r
+ {\r
+ cout<<"WARNING: fPhiWeights->GetBinWidth(1) != fPhiBinWidth in AFAWQC::BAFWH() !!!! "<<endl;\r
+ cout<<" This indicates inconsistent binning in phi histograms throughout the code."<<endl;\r
+ exit(0);\r
+ }\r
+ } else \r
+ {\r
+ cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ } // end of if(fUsePhiWeights)\r
+ \r
+ if(fUsePtWeights) \r
+ {\r
+ if(fWeightsList->FindObject("pt_weights"))\r
+ {\r
+ fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));\r
+ if(fPtWeights->GetBinWidth(1) != fPtBinWidth)\r
+ {\r
+ cout<<"WARNING: fPtWeights->GetBinWidth(1) != fPtBinWidth in AFAWQC::BAFWH() !!!! "<<endl;\r
+ cout<<" This indicates insconsistent binning in pt histograms throughout the code."<<endl;\r
+ exit(0);\r
+ }\r
+ } else \r
+ {\r
+ cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ } // end of if(fUsePtWeights) \r
+\r
+ if(fUseEtaWeights) \r
+ {\r
+ if(fWeightsList->FindObject("eta_weights"))\r
+ {\r
+ fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));\r
+ if(fEtaWeights->GetBinWidth(1) != fEtaBinWidth)\r
+ {\r
+ cout<<"WARNING: fEtaWeights->GetBinWidth(1) != fEtaBinWidth in AFAWQC::BAFWH() !!!! "<<endl;\r
+ cout<<" This indicates insconsistent binning in eta histograms throughout the code."<<endl;\r
+ exit(0);\r
+ }\r
+ } else \r
+ {\r
+ cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ } // end of if(fUseEtaWeights)\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()\r
+{\r
+ // Book all objects for integrated flow:\r
+ // a) Book profile to hold all flags for integrated flow.\r
+ // b) Book event-by-event quantities.\r
+ // c) Book profiles. // to be improved (comment)\r
+ // d) Book histograms holding the final results.\r
+ \r
+ TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)\r
+ TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)\r
+ \r
+ // a) Book profile to hold all flags for integrated flow:\r
+ TString intFlowFlagsName = "fIntFlowFlags";\r
+ intFlowFlagsName += fAnalysisLabel->Data();\r
+ fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",3,0,3);\r
+ fIntFlowFlags->SetTickLength(-0.01,"Y");\r
+ fIntFlowFlags->SetMarkerStyle(25);\r
+ fIntFlowFlags->SetLabelSize(0.05);\r
+ fIntFlowFlags->SetLabelOffset(0.02,"Y");\r
+ (fIntFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");\r
+ (fIntFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");\r
+ (fIntFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");\r
+ fIntFlowList->Add(fIntFlowFlags);\r
+\r
+ // b) Book event-by-event quantities:\r
+ // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M: \r
+ fReQ = new TMatrixD(4,9);\r
+ fImQ = new TMatrixD(4,9);\r
+ fSMpk = new TMatrixD(8,9);\r
+ // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):\r
+ TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";\r
+ intFlowCorrelationsEBEName += fAnalysisLabel->Data();\r
+ fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);\r
+ // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):\r
+ TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";\r
+ intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();\r
+ fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);\r
+ // average correction terms for non-uniform acceptance for single event \r
+ // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):\r
+ TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";\r
+ fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();\r
+ for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
+ {\r
+ fIntFlowCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10); \r
+ }\r
+ \r
+ // c) Book profiles: // to be improved (comment)\r
+ // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:\r
+ TString avMultiplicityName = "fAvMultiplicity";\r
+ avMultiplicityName += fAnalysisLabel->Data();\r
+ fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);\r
+ fAvMultiplicity->SetTickLength(-0.01,"Y");\r
+ fAvMultiplicity->SetMarkerStyle(25);\r
+ fAvMultiplicity->SetLabelSize(0.05);\r
+ fAvMultiplicity->SetLabelOffset(0.02,"Y");\r
+ fAvMultiplicity->SetYTitle("Average Multiplicity");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");\r
+ (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");\r
+ fIntFlowProfiles->Add(fAvMultiplicity);\r
+ // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):\r
+ TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";\r
+ intFlowCorrelationsProName += fAnalysisLabel->Data();\r
+ fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");\r
+ fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");\r
+ fIntFlowCorrelationsPro->SetMarkerStyle(25);\r
+ fIntFlowCorrelationsPro->SetLabelSize(0.06);\r
+ fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");\r
+ (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2>>");\r
+ (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<4>>");\r
+ (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<6>>");\r
+ (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<8>>");\r
+ fIntFlowProfiles->Add(fIntFlowCorrelationsPro);\r
+ // average all correlations for all events (with wrong errors!):\r
+ TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";\r
+ intFlowCorrelationsAllProName += fAnalysisLabel->Data();\r
+ fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");\r
+ fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");\r
+ fIntFlowCorrelationsAllPro->SetMarkerStyle(25);\r
+ fIntFlowCorrelationsAllPro->SetLabelSize(0.03);\r
+ fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");\r
+ // 2-p correlations:\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");\r
+ // 3-p correlations:\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");\r
+ // 4-p correlations:\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}"); \r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}"); \r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");\r
+ // 5-p correlations:\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}"); \r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");\r
+ // 6-p correlations:\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");\r
+ // 7-p correlations: \r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");\r
+ // 8-p correlations:\r
+ (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");\r
+ fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);\r
+ // average product of correlations <2>, <4>, <6> and <8>: \r
+ TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";\r
+ intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();\r
+ fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);\r
+ fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");\r
+ fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25); \r
+ fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);\r
+ fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");\r
+ (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2><4>>");\r
+ (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<2><6>>");\r
+ (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<2><8>>");\r
+ (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<4><6>>");\r
+ (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(5,"<<4><8>>");\r
+ (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(6,"<<6><8>>");\r
+ fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);\r
+ // average correction terms for non-uniform acceptance (with wrong errors!):\r
+ for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
+ {\r
+ TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";\r
+ intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
+ fIntFlowCorrectionTermsForNUAPro[sc] = new TProfile(Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10,"s");\r
+ fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");\r
+ fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);\r
+ fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);\r
+ fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");\r
+ // ......................................................................... \r
+ // 1-p terms:\r
+ (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));\r
+ // 2-p terms:\r
+ // 3-p terms:\r
+ // ...\r
+ // ......................................................................... \r
+ fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);\r
+ } // end of for(Int_t sc=0;sc<2;sc++) \r
+ \r
+ // d) Book histograms holding the final results:\r
+ // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):\r
+ TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";\r
+ intFlowCorrelationsHistName += fAnalysisLabel->Data();\r
+ fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);\r
+ fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");\r
+ fIntFlowCorrelationsHist->SetMarkerStyle(25);\r
+ fIntFlowCorrelationsHist->SetLabelSize(0.06);\r
+ fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");\r
+ (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");\r
+ (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");\r
+ (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");\r
+ (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");\r
+ fIntFlowResults->Add(fIntFlowCorrelationsHist);\r
+ // average all correlations for all events (with correct errors!):\r
+ TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";\r
+ intFlowCorrelationsAllHistName += fAnalysisLabel->Data();\r
+ fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);\r
+ fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");\r
+ fIntFlowCorrelationsAllHist->SetMarkerStyle(25);\r
+ fIntFlowCorrelationsAllHist->SetLabelSize(0.03);\r
+ fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");\r
+ // 2-p correlations:\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");\r
+ // 3-p correlations:\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");\r
+ // 4-p correlations:\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}"); \r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}"); \r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");\r
+ // 5-p correlations:\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}"); \r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");\r
+ // 6-p correlations:\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");\r
+ // 7-p correlations: \r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");\r
+ // 8-p correlations:\r
+ (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");\r
+ fIntFlowResults->Add(fIntFlowCorrelationsAllHist);\r
+ // average correction terms for non-uniform acceptance (with correct errors!):\r
+ for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
+ {\r
+ TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";\r
+ intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
+ fIntFlowCorrectionTermsForNUAHist[sc] = new TH1D(Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10);\r
+ fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");\r
+ fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);\r
+ fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);\r
+ fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");\r
+ // ......................................................................... \r
+ // 1-p terms:\r
+ (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));\r
+ // 2-p terms:\r
+ // 3-p terms:\r
+ // ...\r
+ // ......................................................................... \r
+ fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);\r
+ } // end of for(Int_t sc=0;sc<2;sc++) \r
+ // covariances (multiplied with weight dependent prefactor):\r
+ TString intFlowCovariancesName = "fIntFlowCovariances";\r
+ intFlowCovariancesName += fAnalysisLabel->Data();\r
+ fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);\r
+ fIntFlowCovariances->SetLabelSize(0.04);\r
+ fIntFlowCovariances->SetMarkerStyle(25);\r
+ (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");\r
+ (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");\r
+ (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");\r
+ (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");\r
+ (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");\r
+ (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)"); \r
+ fIntFlowResults->Add(fIntFlowCovariances);\r
+ // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:\r
+ TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";\r
+ intFlowSumOfEventWeightsName += fAnalysisLabel->Data();\r
+ for(Int_t power=0;power<2;power++)\r
+ {\r
+ fIntFlowSumOfEventWeights[power] = new TH1D(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data()),Form("Sum of %s event weights for correlations",powerFlag[power].Data()),4,0,4);\r
+ fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);\r
+ fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);\r
+ if(power == 0)\r
+ {\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");\r
+ } else if (power == 1) \r
+ {\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");\r
+ (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");\r
+ }\r
+ fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);\r
+ } \r
+ // sum of products of event weights for correlations <2>, <4>, <6> and <8>: \r
+ TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";\r
+ intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();\r
+ fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);\r
+ fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);\r
+ fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);\r
+ (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");\r
+ (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");\r
+ (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");\r
+ (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");\r
+ (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");\r
+ (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");\r
+ fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);\r
+ // final results for integrated Q-cumulants:\r
+ TString intFlowQcumulantsName = "fIntFlowQcumulants";\r
+ intFlowQcumulantsName += fAnalysisLabel->Data();\r
+ fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);\r
+ fIntFlowQcumulants->SetLabelSize(0.05);\r
+ fIntFlowQcumulants->SetMarkerStyle(25);\r
+ (fIntFlowQcumulants->GetXaxis())->SetBinLabel(1,"QC{2}");\r
+ (fIntFlowQcumulants->GetXaxis())->SetBinLabel(2,"QC{4}");\r
+ (fIntFlowQcumulants->GetXaxis())->SetBinLabel(3,"QC{6}");\r
+ (fIntFlowQcumulants->GetXaxis())->SetBinLabel(4,"QC{8}");\r
+ fIntFlowResults->Add(fIntFlowQcumulants);\r
+ // final integrated flow estimates from Q-cumulants:\r
+ TString intFlowName = "fIntFlow";\r
+ intFlowName += fAnalysisLabel->Data(); \r
+ // integrated flow from Q-cumulants:\r
+ fIntFlow = new TH1D(intFlowName.Data(),"Integrated flow estimates from Q-cumulants",4,0,4);\r
+ fIntFlow->SetLabelSize(0.05);\r
+ fIntFlow->SetMarkerStyle(25);\r
+ (fIntFlow->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}");\r
+ (fIntFlow->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}");\r
+ (fIntFlow->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}");\r
+ (fIntFlow->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}");\r
+ fIntFlowResults->Add(fIntFlow);\r
+\r
+ /* // to be improved (removed):\r
+ // final average weighted multi-particle correlations for all events calculated from Q-vectors\r
+ fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");\r
+ fQCorrelations[1]->SetTickLength(-0.01,"Y");\r
+ fQCorrelations[1]->SetMarkerStyle(25);\r
+ fQCorrelations[1]->SetLabelSize(0.03);\r
+ fQCorrelations[1]->SetLabelOffset(0.01,"Y");\r
+ // 2-particle correlations:\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");\r
+ // 3-particle correlations:\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");\r
+ // 4-particle correlations:\r
+ (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");\r
+ // add fQCorrelations[1] to the list fIntFlowList:\r
+ fIntFlowList->Add(fQCorrelations[1]); \r
+ */\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()\r
+{\r
+ // Book all objects relevant for calculations with nested loops.\r
+\r
+ // to be improved: hardwired names for some objects here\r
+ \r
+ TString evaluateNestedLoopsName = "fEvaluateNestedLoops";\r
+ evaluateNestedLoopsName += fAnalysisLabel->Data();\r
+ fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"1 = evaluate, 0 = do not evaluate",2,0,2);\r
+ fEvaluateNestedLoops->SetLabelSize(0.05);\r
+ (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"Nested Loops (Int. Flow)");\r
+ (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"Nested Loops (Diff. Flow)");\r
+ fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateNestedLoopsForIntFlow);\r
+ fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateNestedLoopsForDiffFlow);\r
+ fNestedLoopsList->Add(fEvaluateNestedLoops);\r
+ // nested loops for integrated flow:\r
+ if(fEvaluateNestedLoopsForIntFlow)\r
+ {\r
+ fDirectCorrelations = new TProfile("fDirectCorrelations","multi-particle correlations with nested loops",100,0,100,"s");\r
+ fNestedLoopsList->Add(fDirectCorrelations);\r
+ fDirectCorrectionsCos = new TProfile("fDirectCorrectionsCos"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsCos);\r
+ fDirectCorrectionsSin = new TProfile("fDirectCorrectionsSin"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsSin); \r
+ if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)\r
+ {\r
+ fDirectCorrelationsW = new TProfile("fDirectCorrelationsW","multi-particle correlations with nested loops",200,0,200,"s"); \r
+ fNestedLoopsList->Add(fDirectCorrelationsW);\r
+ fDirectCorrectionsCosW = new TProfile("fDirectCorrectionsCosW"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsCosW);\r
+ fDirectCorrectionsSinW = new TProfile("fDirectCorrectionsSinW"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsSinW); \r
+ }\r
+ }\r
+ // nested loops for differential flow: \r
+ if(fEvaluateNestedLoopsForDiffFlow)\r
+ {\r
+ fDirectCorrelationsDiffFlow = new TProfile("fDirectCorrelationsDiffFlow","multi-particle correlations with nested loops",200,0,200,"s");\r
+ fNestedLoopsList->Add(fDirectCorrelationsDiffFlow); \r
+ fDirectCorrectionsDiffFlowCos = new TProfile("fDirectCorrectionsDiffFlowCos",\r
+ "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCos); \r
+ fDirectCorrectionsDiffFlowSin = new TProfile("fDirectCorrectionsDiffFlowSin",\r
+ "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSin); \r
+ if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)\r
+ {\r
+ fDirectCorrelationsDiffFlowW = new TProfile("fDirectCorrelationsDiffFlowW","multi-particle correlations with nested loops",200,0,200,"s");\r
+ fNestedLoopsList->Add(fDirectCorrelationsDiffFlowW);\r
+ fDirectCorrectionsDiffFlowCosW = new TProfile("fDirectCorrectionsDiffFlowCosW",\r
+ "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCosW); \r
+ fDirectCorrectionsDiffFlowSinW = new TProfile("fDirectCorrectionsDiffFlowSinW",\r
+ "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");\r
+ fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSinW); \r
+ }\r
+ }\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()\r
+{\r
+ // calculate all correlations needed for integrated flow\r
+ \r
+ // multiplicity:\r
+ Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ Double_t dReQ1n = (*fReQ)(0,0);\r
+ Double_t dReQ2n = (*fReQ)(1,0);\r
+ Double_t dReQ3n = (*fReQ)(2,0);\r
+ Double_t dReQ4n = (*fReQ)(3,0);\r
+ Double_t dImQ1n = (*fImQ)(0,0);\r
+ Double_t dImQ2n = (*fImQ)(1,0);\r
+ Double_t dImQ3n = (*fImQ)(2,0);\r
+ Double_t dImQ4n = (*fImQ)(3,0);\r
+ \r
+ // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:\r
+ // (these expression appear in the Eqs. for the multi-particle correlations bellow)\r
+ \r
+ // Re[Q_{2n} Q_{n}^* Q_{n}^*]\r
+ Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n; \r
+ \r
+ // Im[Q_{2n} Q_{n}^* Q_{n}^*]\r
+ //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n; \r
+ \r
+ // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]\r
+ Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar; \r
+ \r
+ // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]\r
+ Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n) \r
+ + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);\r
+\r
+ // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*] \r
+ //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)\r
+ \r
+ // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]\r
+ Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;\r
+ \r
+ // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
+ Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;\r
+\r
+ // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
+ //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)\r
+ \r
+ // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
+ Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;\r
+ \r
+ // Re[Q_{4n} Q_{3n}^* Q_{n}^*]\r
+ Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);\r
+ \r
+ // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]\r
+ Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;\r
+ \r
+ // Im[Q_{4n} Q_{3n}^* Q_{n}^*]\r
+ //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)\r
+\r
+ // Re[Q_{3n} Q_{2n}^* Q_{n}^*]\r
+ Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n\r
+ + dImQ3n*dImQ2n*dReQ1n;\r
+ \r
+ // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]\r
+ Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;\r
+ \r
+ // Im[Q_{3n} Q_{2n}^* Q_{n}^*]\r
+ //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)\r
+ \r
+ // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)\r
+ + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);\r
+\r
+ // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
+ \r
+ // |Q_{2n}|^2 |Q_{n}|^2\r
+ Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));\r
+ \r
+ // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))\r
+ + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n); \r
+ \r
+ // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
+ //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
+ \r
+ // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))\r
+ + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));\r
+\r
+ // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*] \r
+ //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
+ \r
+ // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
+ * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);\r
+\r
+ // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
+ //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
+ // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);\r
+ \r
+ // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)\r
+ + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n\r
+ - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;\r
+ \r
+ // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)\r
+ // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n\r
+ // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;\r
+ \r
+ // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);\r
+ \r
+ // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
+ //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);\r
+ \r
+ \r
+ // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)\r
+ + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)\r
+ * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)\r
+ - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);\r
+ \r
+ // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)\r
+ // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n\r
+ // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);\r
+ \r
+ // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)\r
+ + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);\r
+ \r
+ // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*] \r
+ //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)\r
+ // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);\r
+ \r
+ // |Q_{2n}|^2 |Q_{n}|^4\r
+ Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);\r
+ \r
+ // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
+ Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
+ * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)\r
+ + 2.*dReQ1n*dImQ1n*dImQ2n);\r
+ \r
+ // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*] \r
+ //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
+ // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)\r
+ // - 2.*dReQ1n*dReQ2n*dImQ1n);\r
+ \r
+ \r
+ \r
+ \r
+ // **************************************\r
+ // **** multi-particle correlations: ****\r
+ // **************************************\r
+ //\r
+ // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0].\r
+ // Remark 2: binning of fQCorrelations[0] is organized as follows:\r
+ // --------------------------------------------------------------------------------------------------------------------\r
+ // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>\r
+ // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>\r
+ // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))> \r
+ // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>\r
+ // 5th bin: ---- EMPTY ----\r
+ // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>\r
+ // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>\r
+ // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
+ // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>\r
+ // 10th bin: ---- EMPTY ----\r
+ // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>\r
+ // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
+ // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>\r
+ // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
+ // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>\r
+ // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>\r
+ // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
+ // 18th bin: ---- EMPTY ----\r
+ // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
+ // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
+ // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
+ // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
+ // 23rd bin: ---- EMPTY ----\r
+ // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
+ // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
+ // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
+ // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
+ // 28th bin: ---- EMPTY ----\r
+ // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
+ // 30th bin: ---- EMPTY ----\r
+ // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
+ // --------------------------------------------------------------------------------------------------------------------\r
+ \r
+ // 2-particle:\r
+ Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>\r
+ Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>\r
+ Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>\r
+ Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>\r
+ \r
+ if(dMult>1)\r
+ {\r
+ two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.)); \r
+ two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.)); \r
+ two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.)); \r
+ two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.)); \r
+ \r
+ // average 2-particle correlations for single event: \r
+ fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);\r
+ \r
+ // average 2-particle correlations for all events: \r
+ fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.)); \r
+ fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.)); \r
+ fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.)); \r
+ fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.)); \r
+ \r
+ // store separetately <2> (to be improved: do I really need this?)\r
+ fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n);\r
+ fIntFlowCorrelationsPro->Fill(0.5,two1n1n,dMult*(dMult-1.));\r
+ \r
+ // distribution of <cos(n*(phi1-phi2))>:\r
+ //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.)); \r
+ } // end of if(dMult>1)\r
+ \r
+ // 3-particle:\r
+ Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>\r
+ Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>\r
+ Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
+ Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>\r
+ \r
+ if(dMult>2)\r
+ {\r
+ three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)); \r
+ three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ - (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
+ - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.));\r
+ three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
+ - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)); \r
+ three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))\r
+ - (pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)); \r
+ \r
+ // average 3-particle correlations for single event: \r
+ fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);\r
+ \r
+ // average 3-particle correlations for all events: \r
+ fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.)); \r
+ fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));\r
+ fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.)); \r
+ fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.)); \r
+ } // end of if(dMult>2)\r
+ \r
+ // 4-particle:\r
+ Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>\r
+ Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
+ Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))> \r
+ Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
+ Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))> \r
+ Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))> \r
+ Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
+ \r
+ if(dMult>3)\r
+ {\r
+ four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)\r
+ + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
+ / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.)); \r
+ four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)\r
+ + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))\r
+ / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));\r
+ four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
+ + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ - 6./((dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ \r
+ // average 4-particle correlations for single event: \r
+ fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);\r
+ \r
+ // average 4-particle correlations for all events: \r
+ fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ \r
+ // store separetately <4> (to be improved: do I really need this?)\r
+ fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n);\r
+ fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ \r
+ // distribution of <cos(n*(phi1+phi2-phi3-phi4))>\r
+ //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ \r
+ } // end of if(dMult>3)\r
+\r
+ // 5-particle:\r
+ Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
+ Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
+ Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
+ Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
+ \r
+ if(dMult>4)\r
+ {\r
+ five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.)) \r
+ - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
+ - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
+ \r
+ five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)\r
+ - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
+ - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)); \r
+\r
+ five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
+ + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
+ \r
+ five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))\r
+ - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)\r
+ + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
+ - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
+ - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
+ + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
+ - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
+ \r
+ // average 5-particle correlations for single event: \r
+ fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);\r
+ \r
+ // average 5-particle correlations for all events: \r
+ fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)); \r
+ fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
+ fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
+ fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
+ } // end of if(dMult>4)\r
+ \r
+ // 6-particle:\r
+ Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
+ Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
+ Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
+ Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
+ \r
+ if(dMult>5)\r
+ {\r
+ six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
+ + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
+ + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
+ - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))\r
+ + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
+ / (dMult*(dMult-1)*(dMult-3)*(dMult-4))\r
+ - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ \r
+ six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
+ * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)\r
+ - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n\r
+ + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n\r
+ + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n\r
+ + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)\r
+ - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.\r
+ + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n\r
+ + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n\r
+ + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n\r
+ + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)\r
+ * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n\r
+ + 1.+2.*two2n2n+1.*two4n4n)-dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
+ \r
+ six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
+ * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)\r
+ * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n\r
+ + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n\r
+ + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n\r
+ + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
+ \r
+ six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
+ * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)\r
+ - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n\r
+ + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)\r
+ - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n\r
+ + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n\r
+ + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n\r
+ + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
+ \r
+ // average 6-particle correlations for single event: \r
+ fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);\r
+ fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);\r
+ \r
+ // average 6-particle correlations for all events: \r
+ fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
+ fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
+ fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));\r
+ fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
+\r
+ // store separetately <6> (to be improved: do I really need this?)\r
+ fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n);\r
+ fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));\r
+ \r
+ // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
+ //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
+ } // end of if(dMult>5)\r
+ \r
+ // 7-particle:\r
+ Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
+ \r
+ if(dMult>6)\r
+ {\r
+ seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)\r
+ * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)\r
+ - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n\r
+ + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n\r
+ + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)\r
+ - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n\r
+ + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n\r
+ + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n\r
+ + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n\r
+ + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n\r
+ + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n\r
+ + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n\r
+ + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n\r
+ + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n\r
+ + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)\r
+ \r
+ // average 7-particle correlations for single event: \r
+ fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);\r
+ \r
+ // average 7-particle correlations for all events: \r
+ fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));\r
+ } // end of if(dMult>6)\r
+ \r
+ // 8-particle:\r
+ Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
+ if(dMult>7)\r
+ {\r
+ eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)\r
+ * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)\r
+ * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)\r
+ - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n\r
+ + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n\r
+ + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)\r
+ * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n\r
+ + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n\r
+ + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n\r
+ + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n\r
+ + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n\r
+ + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)\r
+ / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)\r
+ \r
+ // average 8-particle correlations for single event: \r
+ fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);\r
+ \r
+ // average 8-particle correlations for all events: \r
+ fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));\r
+ \r
+ // store separetately <8> (to be improved: do I really need this?)\r
+ fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n);\r
+ fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));\r
+ \r
+ // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
+ //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));\r
+ } // end of if(dMult>7) \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)\r
+{\r
+ // 1.) Evaluate with nested loops the relevant correlations for integrated flow without and with using the particle weights. \r
+ // Results are stored in profiles fDirectCorrelations and fDirectCorrelationsW, respectively.\r
+ \r
+ // 2.) Evaluate with nested loops corrections for non-uniform acceptance relevant for integrated flow, \r
+ // without and with using the particle weights.\r
+ // Without weights: cos terms are stored in profile fDirectCorrectionsCos, and sin terms in profile fDirectCorrectionsSin.\r
+ // With weights: cos terms are stored in profile fDirectCorrectionsCosW, and sin terms in profile fDirectCorrectionsSinW.\r
+ \r
+ // 3.) Binning of fDirectCorrelations is organized as follows:\r
+ // \r
+ // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>\r
+ // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>\r
+ // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))> \r
+ // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>\r
+ // 5th bin: ---- EMPTY ----\r
+ // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>\r
+ // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>\r
+ // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
+ // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>\r
+ // 10th bin: ---- EMPTY ----\r
+ // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>\r
+ // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
+ // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>\r
+ // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
+ // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>\r
+ // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>\r
+ // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
+ // 18th bin: ---- EMPTY ----\r
+ // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
+ // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
+ // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
+ // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
+ // 23rd bin: ---- EMPTY ----\r
+ // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
+ // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
+ // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
+ // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
+ // 28th bin: ---- EMPTY ----\r
+ // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
+ // 30th bin: ---- EMPTY ----\r
+ // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
+ \r
+ // 4.) Binning of fDirectCorrelationsW is organized as follows:\r
+ // ..............................................................................................\r
+ // ---- bins 1-20: 2-particle correlations ----\r
+ // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>\r
+ // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
+ // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>\r
+ // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
+ // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>\r
+ // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
+ // ---- bins 21-40: 3-particle correlations ----\r
+ // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> \r
+ // ---- bins 41-60: 4-particle correlations ----\r
+ // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
+ // ---- bins 61-80: 5-particle correlations ---- \r
+ // ---- bins 81-100: 6-particle correlations ----\r
+ // ---- bins 101-120: 7-particle correlations ----\r
+ // ---- bins 121-140: 8-particle correlations ----\r
+ // ..............................................................................................\r
+ \r
+ // 5.) Binning of fDirectCorrectionsCos is organized as follows:\r
+ // ..............................................................................................\r
+ // 1st bin: <<cos(n*(phi1))>> = cosP1n\r
+ // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n\r
+ // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n\r
+ // ...\r
+ // ..............................................................................................\r
+ \r
+ // 6.) Binning of fDirectCorrectionsSin is organized as follows:\r
+ // ..............................................................................................\r
+ // 1st bin: <<sin(n*(phi1))>> = sinP1n\r
+ // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n\r
+ // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n\r
+ // ...\r
+ // ..............................................................................................\r
+ \r
+ // 7.) Binning of fDirectCorrectionsCosW is organized as follows:\r
+ // .............................................................................................. \r
+ // ...\r
+ // .............................................................................................. \r
+ \r
+ // 8.) Binning of fDirectCorrectionsSinW is organized as follows:\r
+ // .............................................................................................. \r
+ // ...\r
+ // .............................................................................................. \r
+ \r
+ Int_t nPrim = anEvent->NumberOfTracks(); \r
+ AliFlowTrackSimple *aftsTrack = NULL;\r
+ \r
+ Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;\r
+ Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
+ \r
+ Int_t n = fHarmonic; \r
+ \r
+ // 2-particle correlations and 1- and 2-particle correction terms: \r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // corrections for non-uniform acceptance:\r
+ // non-weighted: \r
+ fDirectCorrectionsCos->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>\r
+ fDirectCorrectionsSin->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)> \r
+ // weighted:\r
+ // fDirectCorrectionsCosW->Fill(0.5,???,1); // to be improved (continued)\r
+ // fDirectCorrectionsSinW->Fill(0.5,???,1); // to be improved (continued)\r
+ \r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted correlations: \r
+ fDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>\r
+ fDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>\r
+ fDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>\r
+ fDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))> \r
+ \r
+ // weighted correlations:\r
+ // ................................................................................................................\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))> \r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(4.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>\r
+ // ...\r
+ // ................................................................................................................\r
+ \r
+ // non-weighted corrections for non-uniform acceptance (cos terms)\r
+ // ................................................................................................................\r
+ fDirectCorrectionsCos->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>\r
+ // ...\r
+ // ................................................................................................................\r
+ \r
+ // non-weighted corrections for non-uniform acceptance (sin terms)\r
+ // ................................................................................................................\r
+ fDirectCorrectionsSin->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>\r
+ // ...\r
+ // ................................................................................................................\r
+ \r
+ // weighted corrections for non-uniform acceptance (cos terms)\r
+ // ................................................................................................................\r
+ // fDirectCorrectionsCosW->Fill(1.5,???,1.); // to be improved (continued)\r
+ // ...\r
+ // ................................................................................................................\r
+ \r
+ // non-weighted corrections for non-uniform acceptance (sin terms)\r
+ // ................................................................................................................\r
+ // fDirectCorrectionsSinW->Fill(1.5,???,1.); // to be improved (continued)\r
+ // ...\r
+ // ................................................................................................................\r
+\r
+ } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
+ } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
+ \r
+ // 3-particle correlations: \r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ {\r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted correlations:\r
+ fDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}\r
+ fDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}\r
+ fDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}\r
+ fDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}\r
+ \r
+ // weighted correlations:\r
+ // ..............................................................................................................................\r
+ // 2-p:\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(5.,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>\r
+ // 3-p:\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(20.,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
+ // ...\r
+ // ..............................................................................................................................\r
+ \r
+ // non-weighted corrections for non-uniform acceptance (cos terms)\r
+ // ................................................................................................................\r
+ fDirectCorrectionsCos->Fill(2.,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>\r
+ // ...\r
+ // ................................................................................................................\r
+ \r
+ // non-weighted corrections for non-uniform acceptance (sin terms)\r
+ // ................................................................................................................\r
+ fDirectCorrectionsSin->Fill(2.,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>\r
+ // ...\r
+ // ................................................................................................................\r
+ \r
+ // weighted corrections for non-uniform acceptance (cos terms)\r
+ // ................................................................................................................\r
+ // ...\r
+ // ................................................................................................................\r
+ \r
+ // weighted corrections for non-uniform acceptance (sin terms)\r
+ // ................................................................................................................\r
+ // ...\r
+ // ................................................................................................................\r
+\r
+ } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
+ } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
+ } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
+\r
+ // 4-particle correlations: \r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ {\r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi4=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted:\r
+ fDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n} \r
+ fDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}\r
+ fDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}\r
+ fDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}\r
+ fDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n} \r
+ fDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}\r
+ fDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}\r
+ \r
+ // weighted:\r
+ //.......................................................................................\r
+ // 4-p:\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(40.,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4); \r
+ // ... \r
+ //.......................................................................................\r
+ \r
+ } \r
+ }\r
+ }\r
+ }\r
+\r
+ // 5-particle correlations: \r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ //cout<<"i1 = "<<i1<<endl;\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!(aftsTrack->InRPSelection())) continue; \r
+ phi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ {\r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi4=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi5=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted:\r
+ //------------------------------------------------------------------------------------------------------\r
+ fDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}\r
+ fDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}\r
+ fDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}\r
+ fDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}\r
+ //------------------------------------------------------------------------------------------------------\r
+ \r
+ // weighted:\r
+ //..............................................................................................................\r
+ // 5-p:\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(60.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),pow(wPhi1,2)*wPhi2*wPhi3*wPhi4*wPhi5); \r
+ //..............................................................................................................\r
+ \r
+ }\r
+ } \r
+ }\r
+ }\r
+ }\r
+ \r
+ // 6-particle correlations:\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ //cout<<"i1 = "<<i1<<endl;\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ {\r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi4=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi5=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i6=0;i6<nPrim;i6++)\r
+ {\r
+ if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
+ aftsTrack=anEvent->GetTrack(i6);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi6=aftsTrack->Phi(); \r
+ if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted:\r
+ //-----------------------------------------------------------------------------------------------------------\r
+ fDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}\r
+ fDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,n,n|2n,n,n}\r
+ fDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,2n|n,n,n,n}\r
+ fDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n} \r
+ //-----------------------------------------------------------------------------------------------------------\r
+\r
+ // weighted:\r
+ //.................................................................................................................\r
+ // 6-p:\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(80.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6);\r
+ //................................................................................................................. \r
+ \r
+ } \r
+ }\r
+ } \r
+ }\r
+ }\r
+ }\r
+ \r
+ // 7-particle correlations:\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ //cout<<"i1 = "<<i1<<endl;\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ {\r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi4=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi5=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i6=0;i6<nPrim;i6++)\r
+ {\r
+ if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
+ aftsTrack=anEvent->GetTrack(i6);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi6=aftsTrack->Phi(); \r
+ if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i7=0;i7<nPrim;i7++)\r
+ {\r
+ if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
+ aftsTrack=anEvent->GetTrack(i7);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi7=aftsTrack->Phi(); \r
+ if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi())));\r
+ \r
+ // non-weighted:\r
+ //---------------------------------------------------------------------------------------------------------------\r
+ fDirectCorrelations->Fill(28.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1.);//<7>_{2n,n,n|n,n,n,n}\r
+ //---------------------------------------------------------------------------------------------------------------\r
+ \r
+ // weighted:\r
+ //..........................................................................................................................................\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(100.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),\r
+ pow(wPhi1,2.)*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7);\r
+ //..........................................................................................................................................\r
+ \r
+ } \r
+ } \r
+ }\r
+ } \r
+ }\r
+ }\r
+ }\r
+ \r
+ cout<<endl;\r
+ \r
+ // 8-particle correlations:\r
+ for(Int_t i1=0;i1<nPrim;i1++)\r
+ {\r
+ cout<<"i1 = "<<i1<<endl;\r
+ aftsTrack=anEvent->GetTrack(i1);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi1=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i2=0;i2<nPrim;i2++)\r
+ {\r
+ if(i2==i1)continue;\r
+ aftsTrack=anEvent->GetTrack(i2);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi2=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i3=0;i3<nPrim;i3++)\r
+ {\r
+ if(i3==i1||i3==i2)continue;\r
+ aftsTrack=anEvent->GetTrack(i3);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi3=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i4=0;i4<nPrim;i4++)\r
+ {\r
+ if(i4==i1||i4==i2||i4==i3)continue;\r
+ aftsTrack=anEvent->GetTrack(i4);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi4=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i5=0;i5<nPrim;i5++)\r
+ {\r
+ if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
+ aftsTrack=anEvent->GetTrack(i5);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi5=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));\r
+ for(Int_t i6=0;i6<nPrim;i6++)\r
+ {\r
+ if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
+ aftsTrack=anEvent->GetTrack(i6);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi6=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi()))); \r
+ for(Int_t i7=0;i7<nPrim;i7++)\r
+ {\r
+ if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
+ aftsTrack=anEvent->GetTrack(i7);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi7=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi()))); \r
+ for(Int_t i8=0;i8<nPrim;i8++)\r
+ {\r
+ if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;\r
+ aftsTrack=anEvent->GetTrack(i8);\r
+ if(!(aftsTrack->InRPSelection())) continue;\r
+ phi8=aftsTrack->Phi();\r
+ if(fUsePhiWeights && fPhiWeights) wPhi8 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi8*fnBinsPhi/TMath::TwoPi()))); \r
+ \r
+ // non-weighted: \r
+ //--------------------------------------------------------------------------------------------------------------------\r
+ fDirectCorrelations->Fill(30.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),1.);//<8>_{n,n,n,n|n,n,n,n}\r
+ //--------------------------------------------------------------------------------------------------------------------\r
+ \r
+ // weighted: \r
+ //...........................................................................................................................................\r
+ if(fUsePhiWeights) fDirectCorrelationsW->Fill(120.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),\r
+ wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7*wPhi8);\r
+ //...........................................................................................................................................\r
+ \r
+ } \r
+ } \r
+ } \r
+ }\r
+ } \r
+ }\r
+ }\r
+ }\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)\r
+{\r
+ // compare results needed for int. flow calculated with nested loops and with those calculated from Q-vectors\r
+\r
+ \r
+ /*\r
+\r
+\r
+ cout<<endl;\r
+ cout<<endl;\r
+ cout<<" *************************************"<<endl;\r
+ cout<<" **** cross-checking the formulas ****"<<endl;\r
+ cout<<" **** for integrated flow ****"<<endl;\r
+ cout<<" *************************************"<<endl;\r
+ cout<<endl;\r
+ cout<<endl;\r
+\r
+ \r
+ */ \r
+ \r
+ if(!(useParticleWeights))\r
+ {\r
+ \r
+ /*\r
+ \r
+ cout<<" **** results for non-weighted correlations: ****"<<endl;\r
+ cout<<endl;\r
+ cout<<"<2>_{1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(1)<<endl;\r
+ cout<<"<2>_{1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(1)<<endl;\r
+ cout<<endl;\r
+ cout<<"<2>_{2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(2)<<endl;\r
+ cout<<"<2>_{2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(2)<<endl;\r
+ cout<<endl;\r
+ cout<<"<2>_{3n,3n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(3)<<endl;\r
+ cout<<"<2>_{3n,3n} from nested loops = "<<fDirectCorrelations->GetBinContent(3)<<endl;\r
+ cout<<endl;\r
+ cout<<"<2>_{4n,4n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(4)<<endl;\r
+ cout<<"<2>_{4n,4n} from nested loops = "<<fDirectCorrelations->GetBinContent(4)<<endl;\r
+ cout<<endl; \r
+ cout<<"<3>_{2n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(6)<<endl;\r
+ cout<<"<3>_{2n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(6)<<endl;\r
+ cout<<endl;\r
+ cout<<"<3>_{3n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(7)<<endl;\r
+ cout<<"<3>_{3n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(7)<<endl;\r
+ cout<<endl;\r
+ cout<<"<3>_{4n,2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(8)<<endl;\r
+ cout<<"<3>_{4n,2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(8)<<endl;\r
+ cout<<endl;\r
+ cout<<"<3>_{4n,3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(9)<<endl;\r
+ cout<<"<3>_{4n,3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(9)<<endl;\r
+ cout<<endl; \r
+ cout<<"<4>_{1n,1n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(11)<<endl;\r
+ cout<<"<4>_{1n,1n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(11)<<endl;\r
+ cout<<endl;\r
+ cout<<"<4>_{2n,1n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(12)<<endl;\r
+ cout<<"<4>_{2n,1n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(12)<<endl;\r
+ cout<<endl;\r
+ cout<<"<4>_{2n,2n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(13)<<endl;\r
+ cout<<"<4>_{2n,2n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(13)<<endl;\r
+ cout<<endl;\r
+ cout<<"<4>_{3n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(14)<<endl;\r
+ cout<<"<4>_{3n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(14)<<endl;\r
+ cout<<endl;\r
+ cout<<"<4>_{3n,1n|3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(15)<<endl;\r
+ cout<<"<4>_{3n,1n|3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(15)<<endl;\r
+ cout<<endl;\r
+ cout<<"<4>_{3n,1n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(16)<<endl;\r
+ cout<<"<4>_{3n,1n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(16)<<endl;\r
+ cout<<endl; \r
+ cout<<"<4>_{4n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(17)<<endl;\r
+ cout<<"<4>_{4n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(17)<<endl;\r
+ cout<<endl;\r
+ cout<<"<5>_{2n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(19)<<endl;\r
+ cout<<"<5>_{2n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(19)<<endl;\r
+ cout<<endl;\r
+ cout<<"<5>_{2n,2n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(20)<<endl;\r
+ cout<<"<5>_{2n,2n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(20)<<endl;\r
+ cout<<endl;\r
+ cout<<"<5>_{3n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(21)<<endl;\r
+ cout<<"<5>_{3n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(21)<<endl;\r
+ cout<<endl;\r
+ cout<<"<5>_{4n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(22)<<endl;\r
+ cout<<"<5>_{4n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(22)<<endl;\r
+ cout<<endl;\r
+ cout<<"<6>_{1n,1n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(24)<<endl;\r
+ cout<<"<6>_{1n,1n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(24)<<endl;\r
+ cout<<endl; \r
+ cout<<"<6>_{2n,1n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(25)<<endl;\r
+ cout<<"<6>_{2n,1n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(25)<<endl;\r
+ cout<<endl;\r
+ cout<<"<6>_{2n,2n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(26)<<endl;\r
+ cout<<"<6>_{2n,2n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(26)<<endl;\r
+ cout<<endl; \r
+ cout<<"<6>_{3n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(27)<<endl;\r
+ cout<<"<6>_{3n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(27)<<endl;\r
+ cout<<endl; \r
+ cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(29)<<endl;\r
+ cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(29)<<endl;\r
+ cout<<endl; \r
+ cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(31)<<endl;\r
+ cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(31)<<endl;\r
+ cout<<endl; \r
+ cout<<endl; \r
+ cout<<" **** results for non-weighted correction terms: ****"<<endl;\r
+ cout<<endl;\r
+ //.........................................................................................\r
+ cout<<"<cos(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(1)<<endl;\r
+ cout<<"<cos(n*phi1)> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(1)<<endl;\r
+ cout<<endl;\r
+ cout<<"<sin(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(1)<<endl;\r
+ cout<<"<sin(n*phi1)> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(1)<<endl;\r
+ cout<<endl; \r
+ cout<<"<cos(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(2)<<endl;\r
+ cout<<"<cos(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(2)<<endl;\r
+ cout<<endl;\r
+ cout<<"<sin(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(2)<<endl;\r
+ cout<<"<sin(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(2)<<endl;\r
+ cout<<endl; \r
+ cout<<"<cos(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(3)<<endl;\r
+ cout<<"<cos(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(3)<<endl;\r
+ cout<<endl;\r
+ cout<<"<sin(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(3)<<endl;\r
+ cout<<"<sin(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(3)<<endl;\r
+ cout<<endl; \r
+ //.........................................................................................\r
+ \r
+ */\r
+ \r
+ }\r
+ \r
+ if(useParticleWeights)\r
+ {\r
+ \r
+ /* \r
+ \r
+ cout<<" **** results for weighted correlations: ****"<<endl;\r
+ cout<<endl;\r
+ //.........................................................................................\r
+ cout<<"<w1 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(1)<<endl;\r
+ cout<<"<<w1 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(1)<<endl;\r
+ cout<<endl;\r
+ cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(2)<<endl;\r
+ cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(2)<<endl;\r
+ cout<<endl;\r
+ cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(3)<<endl;\r
+ cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(3)<<endl;\r
+ cout<<endl;\r
+ cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(4)<<endl;\r
+ cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(4)<<endl;\r
+ cout<<endl; \r
+ \r
+ \r
+ */\r
+ \r
+ \r
+ /*\r
+ cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(5)<<endl;\r
+ cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(5)<<endl;\r
+ cout<<endl;\r
+ cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(6)<<endl;\r
+ cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(6)<<endl;\r
+ cout<<endl;\r
+ cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(21)<<endl;\r
+ cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(21)<<endl;\r
+ cout<<endl;\r
+ */ \r
+ \r
+ \r
+ /*\r
+ \r
+ \r
+ cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(11)<<endl;\r
+ cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(41)<<endl;\r
+ cout<<endl;\r
+ //.........................................................................................\r
+ //cout<<endl; \r
+ //cout<<endl; \r
+ //cout<<" **** results for weighted correction terms: ****"<<endl;\r
+ //cout<<endl;\r
+ //.........................................................................................\r
+\r
+ */\r
+ \r
+ } \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()\r
+{\r
+ // Calculate averages of products of correlations for integrated flow\r
+ \r
+ // a) Binning of fIntFlowProductOfCorrelationsPro is organized as follows:\r
+ // 1st bin: <<2><4>> \r
+ // 2nd bin: <<2><6>>\r
+ // 3rd bin: <<2><8>>\r
+ // 4th bin: <<4><6>>\r
+ // 5th bin: <<4><8>>\r
+ // 6th bin: <<6><8>>\r
+\r
+ Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
+\r
+ Double_t twoEBE = 0.; // <2>\r
+ Double_t fourEBE = 0.; // <4>\r
+ Double_t sixEBE = 0.; // <6>\r
+ Double_t eightEBE = 0.; // <8>\r
+ \r
+ // to be improved (this can be implemented better)\r
+ if(dMult>1)\r
+ {\r
+ twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1);\r
+ if(dMult>3)\r
+ { \r
+ fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2);\r
+ if(dMult>5) \r
+ {\r
+ sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3);\r
+ if(dMult>7) \r
+ { \r
+ eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4);\r
+ }\r
+ }\r
+ }\r
+ } \r
+ \r
+ // <<2><4>>\r
+ if(dMult>3)\r
+ {\r
+ fIntFlowProductOfCorrelationsPro->Fill(0.5,twoEBE*fourEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3));\r
+ }\r
+ \r
+ // <<2><6>>\r
+ if(dMult>5)\r
+ {\r
+ fIntFlowProductOfCorrelationsPro->Fill(1.5,twoEBE*sixEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));\r
+ }\r
+ \r
+ // <<2><8>>\r
+ if(dMult>7)\r
+ {\r
+ fIntFlowProductOfCorrelationsPro->Fill(2.5,twoEBE*eightEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));\r
+ }\r
+ \r
+ // <<4><6>>\r
+ if(dMult>5)\r
+ {\r
+ fIntFlowProductOfCorrelationsPro->Fill(3.5,fourEBE*sixEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));\r
+ }\r
+ \r
+ // <<4><8>>\r
+ if(dMult>7)\r
+ {\r
+ fIntFlowProductOfCorrelationsPro->Fill(4.5,fourEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*\r
+ dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));\r
+ }\r
+ \r
+ // <<6><8>>\r
+ if(dMult>7)\r
+ {\r
+ fIntFlowProductOfCorrelationsPro->Fill(5.5,sixEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*\r
+ dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));\r
+ }\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()\r
+{\r
+ // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)\r
+ // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).\r
+ // b) Store in histogram fIntFlowCovariances for instance the following: \r
+ //\r
+ // Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]\r
+ // \r
+ // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.\r
+ // c) Binning of fIntFlowCovariances is organized as follows:\r
+ // \r
+ // 1st bin: Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)] \r
+ // 2nd bin: Cov(<2>,<6>) * (sum_{i=1}^{N} w_{<2>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]\r
+ // 3rd bin: Cov(<2>,<8>) * (sum_{i=1}^{N} w_{<2>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]\r
+ // 4th bin: Cov(<4>,<6>) * (sum_{i=1}^{N} w_{<4>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]\r
+ // 5th bin: Cov(<4>,<8>) * (sum_{i=1}^{N} w_{<4>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]\r
+ // 6th bin: Cov(<6>,<8>) * (sum_{i=1}^{N} w_{<6>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<6>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]\r
+ \r
+ for(Int_t power=0;power<2;power++)\r
+ { \r
+ if(!(fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro \r
+ && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights\r
+ && fIntFlowCovariances)) \r
+ {\r
+ cout<<"WARNING: fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro "<<endl;\r
+ cout<<" && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights"<<endl;\r
+ cout<<" && fIntFlowCovariances is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
+ cout<<"power = "<<power<<endl;\r
+ exit(0);\r
+ }\r
+ }\r
+ \r
+ // average 2-, 4-, 6- and 8-particle correlations for all events:\r
+ Double_t correlation[4] = {0.};\r
+ for(Int_t ci=0;ci<4;ci++)\r
+ {\r
+ correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);\r
+ } \r
+ // average products of 2-, 4-, 6- and 8-particle correlations: \r
+ Double_t productOfCorrelations[4][4] = {{0.}};\r
+ Int_t productOfCorrelationsLabel = 1;\r
+ // denominators in the expressions for the unbiased estimator for covariance:\r
+ Double_t denominator[4][4] = {{0.}};\r
+ Int_t sumOfProductOfEventWeightsLabel1 = 1;\r
+ // weight dependent prefactor which multiply unbiased estimators for covariances:\r
+ Double_t wPrefactor[4][4] = {{0.}}; \r
+ Int_t sumOfProductOfEventWeightsLabel2 = 1;\r
+ for(Int_t c1=0;c1<4;c1++)\r
+ {\r
+ for(Int_t c2=c1+1;c2<4;c2++)\r
+ {\r
+ productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);\r
+ if(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) && fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1))\r
+ {\r
+ denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))/\r
+ (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) \r
+ * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));\r
+ \r
+ wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)/ \r
+ (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)\r
+ * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));\r
+ \r
+ \r
+ }\r
+ productOfCorrelationsLabel++;\r
+ sumOfProductOfEventWeightsLabel1++;\r
+ sumOfProductOfEventWeightsLabel2++; \r
+ }\r
+ }\r
+ \r
+ // covariance label:\r
+ Int_t covarianceLabel = 1;\r
+ for(Int_t c1=0;c1<4;c1++)\r
+ {\r
+ for(Int_t c2=c1+1;c2<4;c2++)\r
+ {\r
+ if(denominator[c1][c2])\r
+ {\r
+ // covariances:\r
+ Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2]; \r
+ // covarianced multiplied with weight dependent prefactor:\r
+ Double_t wCov = cov * wPrefactor[c1][c2];\r
+ fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);\r
+ }\r
+ covarianceLabel++;\r
+ }\r
+ }\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow() \r
+{\r
+ // From profile fIntFlowCorrelationsPro access measured correlations and spread, \r
+ // correctly calculate the statistical errors and store the final results and \r
+ // statistical errors for correlations in histogram fIntFlowCorrelationsHist.\r
+ //\r
+ // Remark: Statistical error of correlation is calculated as:\r
+ //\r
+ // statistical error = termA * spread * termB:\r
+ // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)\r
+ // termB = 1/sqrt(1-termA^2) \r
+ \r
+ for(Int_t power=0;power<2;power++)\r
+ { \r
+ if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power])) \r
+ {\r
+ cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
+ cout<<"power = "<<power<<endl;\r
+ exit(0);\r
+ }\r
+ }\r
+ \r
+ for(Int_t ci=1;ci<=4;ci++) // correlation index\r
+ {\r
+ Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);\r
+ Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);\r
+ Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);\r
+ Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);\r
+ Double_t termA = 0.;\r
+ Double_t termB = 0.;\r
+ if(sumOfLinearEventWeights)\r
+ {\r
+ termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;\r
+ } else\r
+ {\r
+ cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;\r
+ cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
+ }\r
+ if(1.-pow(termA,2.) > 0.)\r
+ {\r
+ termB = 1./pow(1-pow(termA,2.),0.5);\r
+ } else\r
+ {\r
+ cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl; \r
+ cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
+ } \r
+ Double_t statisticalError = termA * spread * termB;\r
+ fIntFlowCorrelationsHist->SetBinContent(ci,correlation);\r
+ fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);\r
+ } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)\r
+{\r
+ // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8\r
+ \r
+ // Binning of fAverageMultiplicity is organized as follows:\r
+ // 1st bin: all events (including the empty ones)\r
+ // 2nd bin: event with # of RPs greater or equal to 1\r
+ // 3rd bin: event with # of RPs greater or equal to 2\r
+ // 4th bin: event with # of RPs greater or equal to 3\r
+ // 5th bin: event with # of RPs greater or equal to 4\r
+ // 6th bin: event with # of RPs greater or equal to 5\r
+ // 7th bin: event with # of RPs greater or equal to 6\r
+ // 8th bin: event with # of RPs greater or equal to 7\r
+ // 9th bin: event with # of RPs greater or equal to 8\r
+ \r
+ if(!fAvMultiplicity)\r
+ {\r
+ cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ if(nRP<0)\r
+ {\r
+ cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ for(Int_t i=0;i<9;i++)\r
+ {\r
+ if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);\r
+ }\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()\r
+{\r
+ // a) Calculate Q-cumulants from the measured multiparticle correlations.\r
+ // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants. \r
+ // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!! \r
+ // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)\r
+ // is called afterwards to correct for this bias. \r
+ // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.\r
+ // Binning of fCumulants is organized as follows:\r
+ //\r
+ // 1st bin: QC{2}\r
+ // 2nd bin: QC{4}\r
+ // 3rd bin: QC{6}\r
+ // 4th bin: QC{8}\r
+ \r
+ if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants))\r
+ {\r
+ cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants is NULL in AFAWQC::CCIF() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ // correlations:\r
+ Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>> \r
+ Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>> \r
+ Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>> \r
+ Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>> \r
+ \r
+ // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:\r
+ Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2> \r
+ Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4> \r
+ Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6> \r
+ Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8> \r
+ \r
+ // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):\r
+ Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)\r
+ Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)\r
+ Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)\r
+ Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)\r
+ Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)\r
+ Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)\r
+ \r
+ // Q-cumulants: \r
+ Double_t qc2 = 0.; // QC{2}\r
+ Double_t qc4 = 0.; // QC{4}\r
+ Double_t qc6 = 0.; // QC{6}\r
+ Double_t qc8 = 0.; // QC{8}\r
+ if(two) qc2 = two; \r
+ if(four) qc4 = four-2.*pow(two,2.); \r
+ if(six) qc6 = six-9.*two*four+12.*pow(two,3.); \r
+ if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.); \r
+ \r
+ // statistical errors of Q-cumulants: \r
+ Double_t qc2Error = 0.;\r
+ Double_t qc4Error = 0.;\r
+ Double_t qc6Error = 0.;\r
+ Double_t qc8Error = 0.;\r
+ \r
+ // squared statistical errors of Q-cumulants: \r
+ //Double_t qc2ErrorSquared = 0.;\r
+ Double_t qc4ErrorSquared = 0.;\r
+ Double_t qc6ErrorSquared = 0.;\r
+ Double_t qc8ErrorSquared = 0.;\r
+ \r
+ // statistical error of QC{2}: \r
+ qc2Error = twoError; \r
+ \r
+ // statistical error of QC{4}: \r
+ qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)\r
+ - 8.*two*wCov24; \r
+ if(qc4ErrorSquared>=0.)\r
+ {\r
+ qc4Error = pow(qc4ErrorSquared,0.5);\r
+ } else \r
+ {\r
+ cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;\r
+ }\r
+ \r
+ // statistical error of QC{6}: \r
+ qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)\r
+ + 81.*pow(two,2.)*pow(fourError,2.)\r
+ + pow(sixError,2.)\r
+ - 162.*two*(4.*pow(two,2.)-four)*wCov24\r
+ + 18.*(4.*pow(two,2.)-four)*wCov26\r
+ - 18.*two*wCov46; \r
+ \r
+ if(qc6ErrorSquared>=0.)\r
+ {\r
+ qc6Error = pow(qc6ErrorSquared,0.5);\r
+ } else \r
+ {\r
+ cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;\r
+ }\r
+ \r
+ // statistical error of QC{8}: \r
+ qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)\r
+ + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)\r
+ + 256.*pow(two,2.)*pow(sixError,2.)\r
+ + pow(eightError,2.)\r
+ - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24\r
+ + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26\r
+ - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28\r
+ - 1152.*two*(4.*pow(two,2.)-four)*wCov46\r
+ + 72.*(4.*pow(two,2.)-four)*wCov48\r
+ - 32.*two*wCov68; \r
+ if(qc8ErrorSquared>=0.)\r
+ {\r
+ qc8Error = pow(qc8ErrorSquared,0.5);\r
+ } else \r
+ {\r
+ cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;\r
+ }\r
+\r
+ // store the results and statistical errors for Q-cumulants:\r
+ fIntFlowQcumulants->SetBinContent(1,qc2);\r
+ fIntFlowQcumulants->SetBinError(1,qc2Error);\r
+ fIntFlowQcumulants->SetBinContent(2,qc4);\r
+ fIntFlowQcumulants->SetBinError(2,qc4Error);\r
+ fIntFlowQcumulants->SetBinContent(3,qc6);\r
+ fIntFlowQcumulants->SetBinError(3,qc6Error);\r
+ fIntFlowQcumulants->SetBinContent(4,qc8); \r
+ fIntFlowQcumulants->SetBinError(4,qc8Error); \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()\r
+\r
+\r
+//================================================================================================================================ \r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlow()\r
+{\r
+ // a) Calculate the final results for integrated flow estimates from Q-cumulants.\r
+ // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of integrated flow estimates. \r
+ // c) Store the results and statistical errors of integrated flow estimates in histogram fIntFlow.\r
+ // Binning of fIntFlow is organized as follows:\r
+ //\r
+ // 1st bin: v{2,QC}\r
+ // 2nd bin: v{4,QC}\r
+ // 3rd bin: v{6,QC}\r
+ // 4th bin: v{8,QC}\r
+ \r
+ if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))\r
+ {\r
+ cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ // Q-cumulants:\r
+ Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2} \r
+ Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4} \r
+ Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6} \r
+ Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}\r
+ \r
+ // correlations:\r
+ Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>> \r
+ Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>> \r
+ Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>> \r
+ Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>> \r
+ \r
+ // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:\r
+ Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2> \r
+ Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4> \r
+ Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6> \r
+ Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8> \r
+ \r
+ // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):\r
+ Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)\r
+ Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)\r
+ Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)\r
+ Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)\r
+ Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)\r
+ Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)\r
+ \r
+ // integrated flow estimates:\r
+ Double_t v2 = 0.; // v{2,QC} \r
+ Double_t v4 = 0.; // v{4,QC} \r
+ Double_t v6 = 0.; // v{6,QC} \r
+ Double_t v8 = 0.; // v{8,QC}\r
+ \r
+ // calculate integrated flow estimates from Q-cumulants: \r
+ if(qc2>=0.) v2 = pow(qc2,1./2.); \r
+ if(qc4<=0.) v4 = pow(-1.*qc4,1./4.); \r
+ if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.); \r
+ if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.); \r
+ \r
+ // statistical errors of integrated flow estimates:\r
+ Double_t v2Error = 0.; // statistical error of v{2,QC} \r
+ Double_t v4Error = 0.; // statistical error of v{4,QC} \r
+ Double_t v6Error = 0.; // statistical error of v{6,QC} \r
+ Double_t v8Error = 0.; // statistical error of v{8,QC}\r
+ \r
+ // squares of statistical errors of integrated flow estimates:\r
+ Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC} \r
+ Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC} \r
+ Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC} \r
+ Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC} \r
+ \r
+ // calculate squared statistical errors of integrated flow estimates:\r
+ if(two != 0.) \r
+ { \r
+ v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);\r
+ } \r
+ if(2.*pow(two,2.)-four > 0.)\r
+ {\r
+ v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*\r
+ (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);\r
+ }\r
+ if(six-9.*four*two+12.*pow(two,3.) > 0.) \r
+ {\r
+ v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*\r
+ ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.) \r
+ + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)\r
+ - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46); \r
+ }\r
+ if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.) \r
+ {\r
+ v8ErrorSquared = (4./pow(33,1./4.))*(1./pow(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.),7./4.))*\r
+ (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)\r
+ + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)\r
+ + pow(two,2.)*pow(sixError,2.)\r
+ + (1./256.)*pow(eightError,2.)\r
+ - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24\r
+ + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26\r
+ - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28 \r
+ - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46 \r
+ + (9./32.)*(4.*pow(two,2.)-four)*wCov48 \r
+ - (1./8.)*two*wCov68);\r
+ } \r
+\r
+ // calculate statistical errors of integrated flow estimates: \r
+ if(v2ErrorSquared >= 0.)\r
+ {\r
+ v2Error = pow(v2ErrorSquared,0.5);\r
+ } else\r
+ {\r
+ cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;\r
+ } \r
+ if(v4ErrorSquared >= 0.)\r
+ {\r
+ v4Error = pow(v4ErrorSquared,0.5);\r
+ } else\r
+ {\r
+ cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;\r
+ } \r
+ if(v6ErrorSquared >= 0.)\r
+ {\r
+ v6Error = pow(v6ErrorSquared,0.5);\r
+ } else\r
+ {\r
+ cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;\r
+ } \r
+ if(v8ErrorSquared >= 0.)\r
+ {\r
+ v8Error = pow(v8ErrorSquared,0.5);\r
+ } else\r
+ {\r
+ cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;\r
+ } \r
+ \r
+ // store the results and statistical errors of integrated flow estimates:\r
+ fIntFlow->SetBinContent(1,v2);\r
+ fIntFlow->SetBinError(1,v2Error);\r
+ fIntFlow->SetBinContent(2,v4);\r
+ fIntFlow->SetBinError(2,v4Error);\r
+ fIntFlow->SetBinContent(3,v6);\r
+ fIntFlow->SetBinError(3,v6Error);\r
+ fIntFlow->SetBinContent(4,v8);\r
+ fIntFlow->SetBinError(4,v8Error);\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()\r
+\r
+\r
+//================================================================================================================================ \r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()\r
+{\r
+ // Fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))\r
+ \r
+ if(!fIntFlow)\r
+ {\r
+ cout<<"WARNING: fIntFlow is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
+ exit(0); \r
+ } \r
+ \r
+ if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
+ {\r
+ cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl; \r
+ cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ Double_t v2 = fIntFlow->GetBinContent(1);\r
+ Double_t v4 = fIntFlow->GetBinContent(2);\r
+ Double_t v6 = fIntFlow->GetBinContent(3);\r
+ Double_t v8 = fIntFlow->GetBinContent(4);\r
+ \r
+ Double_t v2Error = fIntFlow->GetBinError(1);\r
+ Double_t v4Error = fIntFlow->GetBinError(2);\r
+ Double_t v6Error = fIntFlow->GetBinError(3);\r
+ Double_t v8Error = fIntFlow->GetBinError(4);\r
+ \r
+ fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error); // to be improved (hardwired 2nd in the name) \r
+ fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error); // to be improved (hardwired 4th in the name)\r
+ fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error); // to be improved (hardwired 6th in the name)\r
+ fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error); // to be improved (hardwired 8th in the name) \r
+\r
+} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()\r
+\r
+\r
+//================================================================================================================================ \r
+\r
+\r
+/*\r
+void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)\r
+{\r
+ // apply correction for non-uniform acceptance to cumulants for integrated flow \r
+ // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])\r
+ \r
+ // shortcuts for the flags:\r
+ Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used\r
+ Int_t eW = -1;\r
+ \r
+ if(eventWeights == "exact")\r
+ {\r
+ eW = 0;\r
+ }\r
+ \r
+ if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))\r
+ {\r
+ cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ exit(0);\r
+ } \r
+ \r
+ // non-corrected cumulants:\r
+ Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1); \r
+ Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2); \r
+ Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3); \r
+ Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4); \r
+ // statistical error of non-corrected cumulants: \r
+ Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1); \r
+ Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2); \r
+ Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3); \r
+ Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4); \r
+ // corrections for non-uniform acceptance:\r
+ Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1); \r
+ Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2); \r
+ Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3); \r
+ Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4); \r
+ // corrected cumulants:\r
+ Double_t qc2Corrected = qc2 + qc2Correction;\r
+ Double_t qc4Corrected = qc4 + qc4Correction;\r
+ Double_t qc6Corrected = qc6 + qc6Correction;\r
+ Double_t qc8Corrected = qc8 + qc8Correction;\r
+ \r
+ // ... to be improved (I need here also to correct error of QCs for NUA. \r
+ // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)\r
+ \r
+ // store corrected results and statistical errors for cumulants: \r
+ fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);\r
+ fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);\r
+ fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);\r
+ fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);\r
+ fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)\r
+ fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)\r
+ fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)\r
+ fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA) \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)\r
+*/\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+/* \r
+void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)\r
+{\r
+ // print on the screen QC{n,biased}/QC{n,corrected}\r
+ \r
+ // shortcuts for the flags:\r
+ Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used\r
+ \r
+ Int_t eW = -1;\r
+ \r
+ if(eventWeights == "exact")\r
+ {\r
+ eW = 0;\r
+ } \r
+ \r
+ if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))\r
+ {\r
+ cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ cout<<endl;\r
+ cout<<" Quantifying the bias to Q-cumulants from"<<endl;\r
+ cout<<" non-uniform acceptance of the detector:"<<endl;\r
+ cout<<endl;\r
+ \r
+ if(fCumulants[pW][eW][1]->GetBinContent(1)) \r
+ { \r
+ cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl; \r
+ }\r
+ if(fCumulants[pW][eW][1]->GetBinContent(2)) \r
+ { \r
+ cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl; \r
+ }\r
+ \r
+ cout<<endl;\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)\r
+*/\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()\r
+{\r
+ // calculate all weighted correlations needed for integrated flow and store them in 1D profile fQCorrelations[1][eW] and fQExtraCorrelations[1][eW]\r
+ \r
+ /*\r
+ \r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ if(!(fQCorrelationsEBE[1] && fQCorrelations[1][eW]))\r
+ {\r
+ cout<<"WARNING: fQCorrelationsEBE[1] && fQCorrelations[1][eW] is NULL in AFAWQC::CWCFIF() !!!!"<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ exit(0);\r
+ }\r
+ }\r
+ \r
+ // Remark 1: binning of fQCorrelations[W] is organized as follows:\r
+ //..............................................................................................\r
+ // ---- bins 1-20: 2-particle correlations ----\r
+ // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>\r
+ // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
+ // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>\r
+ // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
+ // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>\r
+ // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
+ // ---- bins 21-40: 3-particle correlations ----\r
+ // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> \r
+ // ---- bins 41-60: 4-particle correlations ----\r
+ // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
+ // ---- bins 61-80: 5-particle correlations ---- \r
+ // ---- bins 81-100: 6-particle correlations ----\r
+ // ---- bins 101-120: 7-particle correlations ----\r
+ // ---- bins 121-140: 8-particle correlations ----\r
+ //..............................................................................................\r
+ \r
+ // multiplicity (number of particles used to determine the reaction plane)\r
+ Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ Double_t dReQ1n1k = (*fReQ)(0,1);\r
+ Double_t dReQ2n2k = (*fReQ)(1,2);\r
+ Double_t dReQ3n3k = (*fReQ)(2,3);\r
+ Double_t dReQ4n4k = (*fReQ)(3,4);\r
+ Double_t dReQ1n3k = (*fReQ)(0,3);\r
+ Double_t dImQ1n1k = (*fImQ)(0,1);\r
+ Double_t dImQ2n2k = (*fImQ)(1,2);\r
+ Double_t dImQ3n3k = (*fImQ)(2,3);\r
+ Double_t dImQ4n4k = (*fImQ)(3,4);\r
+ Double_t dImQ1n3k = (*fImQ)(0,3);\r
+\r
+ // dMs are variables introduced in order to simplify some Eqs. bellow:\r
+ //..............................................................................................\r
+ Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
+ Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2\r
+ Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3\r
+ Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4\r
+ Double_t dM31 = (*fSMpk)(0,3)*(*fSMpk)(0,1)-(*fSMpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j\r
+ Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
+ - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k\r
+ Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
+ + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
+ + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l\r
+ //..............................................................................................\r
+\r
+ // ***********************************************\r
+ // **** weighted multi-particle correlations: ****\r
+ // ***********************************************\r
+ //.............................................................................................. \r
+ // weighted 2-particle correlations:\r
+ Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>\r
+ Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
+ Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>\r
+ Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
+ Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>\r
+ Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
+ \r
+ if(dMult>1) \r
+ { \r
+ if(dM11)\r
+ {\r
+ two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11; \r
+ \r
+ // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for single event: \r
+ fQCorrelationsEBE[1]->SetBinContent(1,two1n1nW1W1);\r
+\r
+ // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for all events:\r
+ //fQCorrelationsW->Fill(0.,two1n1nW1W1,dM11);\r
+ fQCorrelations[1][0]->Fill(0.5,two1n1nW1W1,dM11);\r
+ }\r
+ if(dM22)\r
+ {\r
+ two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22; \r
+ //fQCorrelationsW->Fill(1.,two2n2nW2W2,dM22); \r
+ fQCorrelations[1][0]->Fill(1.5,two2n2nW2W2,dM22);\r
+ }\r
+ if(dM33)\r
+ {\r
+ two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;\r
+ //fQCorrelationsW->Fill(2.,two3n3nW3W3,dM33);\r
+ fQCorrelations[1][0]->Fill(2.5,two3n3nW3W3,dM33);\r
+ }\r
+ if(dM44)\r
+ {\r
+ two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44; \r
+ //fQCorrelationsW->Fill(3.,two4n4nW4W4,dM44); \r
+ fQCorrelations[1][0]->Fill(3.5,two4n4nW4W4,dM44); \r
+ } \r
+ if(dM31)\r
+ {\r
+ two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31; \r
+ //fQCorrelationsW->Fill(4.,two1n1nW3W1,dM31); \r
+ } \r
+ if(dM211)\r
+ {\r
+ two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))\r
+ - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k\r
+ - (*fSMpk)(0,4)))/dM211;\r
+ //fQCorrelationsW->Fill(5.,two1n1nW1W1W2,dM211); \r
+ } \r
+ } // end of if(dMult>1)\r
+ //..............................................................................................\r
+ \r
+ //..............................................................................................\r
+ // weighted 3-particle correlations:\r
+ Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
+ \r
+ if(dMult>2) \r
+ { \r
+ if(dM211)\r
+ { \r
+ three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k\r
+ - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)\r
+ - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)\r
+ + 2.*(*fSMpk)(0,4))/dM211; \r
+ //fQCorrelationsW->Fill(20.,three2n1n1nW2W1W1,dM211);\r
+ } \r
+ } // end of if(dMult>2) \r
+ //..............................................................................................\r
+ \r
+ //..............................................................................................\r
+ // weighted 4-particle correlations:\r
+ Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
+ if(dMult>3) \r
+ { \r
+ if(dM1111)\r
+ { \r
+ four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)\r
+ - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)\r
+ + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)\r
+ + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))\r
+ - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))\r
+ - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111; \r
+ \r
+ // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event: \r
+ fQCorrelationsEBE[1]->SetBinContent(11,four1n1n1n1nW1W1W1W1);\r
+\r
+ // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events: \r
+ //fQCorrelationsW->Fill(40.,four1n1n1n1nW1W1W1W1,dM1111);\r
+ \r
+ fQCorrelations[1][0]->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);\r
+ } \r
+ } // end of if(dMult>3) \r
+ //..............................................................................................\r
+ \r
+ */\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)\r
+{\r
+ // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances \r
+ // Remark: here we take weighted correlations!\r
+ \r
+ /*\r
+ \r
+ // binning of fQProductsW is organized as follows:\r
+ // \r
+ // 1st bin: <2><4> \r
+ // 2nd bin: <2><6>\r
+ // 3rd bin: <2><8>\r
+ // 4th bin: <4><6>\r
+ // 5th bin: <4><8>\r
+ // 6th bin: <6><8>\r
+ \r
+ Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)\r
+\r
+ Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
+ Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
+ + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
+ + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l\r
+\r
+ Double_t twoEBEW = 0.; // <2>\r
+ Double_t fourEBEW = 0.; // <4>\r
+ \r
+ twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);\r
+ fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);\r
+ \r
+ // <2><4>\r
+ if(dMult>3)\r
+ {\r
+ fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);\r
+ }\r
+ \r
+ */\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() \r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()\r
+{\r
+ // Initialize all arrays used to calculate integrated flow.\r
+ \r
+ for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
+ {\r
+ fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;\r
+ fIntFlowCorrectionTermsForNUAPro[sc] = NULL;\r
+ fIntFlowCorrectionTermsForNUAHist[sc] = NULL;\r
+ }\r
+ \r
+ for(Int_t power=0;power<2;power++) // linear or quadratic \r
+ {\r
+ fIntFlowSumOfEventWeights[power] = NULL; \r
+ }\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()\r
+{\r
+ // Initialize all arrays needed to calculate differential flow.\r
+ // a) Initialize lists holding profiles;\r
+ // b) Initialize lists holding histograms;\r
+ // c) Initialize event-by-event quantities;\r
+ // d) Initialize profiles;\r
+ // e) Initialize histograms holding final results.\r
+ \r
+ // a) Initialize lists holding profiles;\r
+ for(Int_t t=0;t<2;t++) // type (RP, POI)\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ fDiffFlowCorrelationsProList[t][pe] = NULL;\r
+ fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;\r
+ fDiffFlowCorrectionsProList[t][pe] = NULL;\r
+ }\r
+ } \r
+ \r
+ // b) Initialize lists holding histograms;\r
+ for(Int_t t=0;t<2;t++) // type (RP, POI)\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ fDiffFlowCorrelationsHistList[t][pe] = NULL;\r
+ for(Int_t power=0;power<2;power++)\r
+ {\r
+ fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;\r
+ } // end of for(Int_t power=0;power<2;power++) \r
+ fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;\r
+ fDiffFlowCovariancesHistList[t][pe] = NULL;\r
+ fDiffFlowCumulantsHistList[t][pe] = NULL;\r
+ fDiffFlowHistList[t][pe] = NULL;\r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI) \r
+ \r
+ // c) Initialize event-by-event quantities:\r
+ // 1D:\r
+ for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ { \r
+ for(Int_t m=0;m<4;m++) // multiple of harmonic\r
+ {\r
+ for(Int_t k=0;k<9;k++) // power of weight\r
+ {\r
+ fReRPQ1dEBE[t][pe][m][k] = NULL;\r
+ fImRPQ1dEBE[t][pe][m][k] = NULL;\r
+ fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)\r
+ } \r
+ }\r
+ }\r
+ }\r
+ // 2D: \r
+ for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
+ {\r
+ for(Int_t m=0;m<4;m++) // multiple of harmonic\r
+ {\r
+ for(Int_t k=0;k<9;k++) // power of weight\r
+ {\r
+ fReRPQ2dEBE[t][m][k] = NULL;\r
+ fImRPQ2dEBE[t][m][k] = NULL;\r
+ fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)\r
+ } \r
+ }\r
+ }\r
+ \r
+ // d) Initialize profiles:\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t ci=0;ci<4;ci++) // correlation index\r
+ {\r
+ fDiffFlowCorrelationsPro[t][pe][ci] = NULL;\r
+ } // end of for(Int_t ci=0;ci<4;ci++) \r
+ for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
+ {\r
+ for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
+ {\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;\r
+ } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
+ } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ \r
+ // e) Initialize histograms holding final results.\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t ci=0;ci<4;ci++) // correlation index\r
+ {\r
+ fDiffFlowCorrelationsHist[t][pe][ci] = NULL;\r
+ fDiffFlowCumulants[t][pe][ci] = NULL;\r
+ fDiffFlow[t][pe][ci] = NULL;\r
+ } // end of for(Int_t ci=0;ci<4;ci++) \r
+ for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++) \r
+ {\r
+ fDiffFlowCovariances[t][pe][covarianceIndex] = NULL; \r
+ } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++) \r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
+\r
+ \r
+ // sum of event weights for reduced correlations:\r
+ for(Int_t t=0;t<2;t++) // type = RP or POI\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t p=0;p<2;p++) // power of weight is 1 or 2\r
+ {\r
+ for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations\r
+ {\r
+ fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;\r
+ } \r
+ } \r
+ }\r
+ }\r
+ // product of event weights for both types of correlations:\r
+ for(Int_t t=0;t<2;t++) // type = RP or POI\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
+ {\r
+ for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
+ {\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;\r
+ } \r
+ } \r
+ }\r
+ }\r
+\r
+ \r
+ \r
+ \r
+ /*\r
+ \r
+ // nested lists in fDiffFlowProfiles:\r
+ for(Int_t t=0;t<2;t++)\r
+ {\r
+ fDFPType[t] = NULL;\r
+ for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
+ {\r
+ fDFPParticleWeights[t][pW] = NULL;\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ { \r
+ fDFPEventWeights[t][pW][eW] = NULL;\r
+ fDiffFlowCorrelations[t][pW][eW] = NULL;\r
+ fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;\r
+ }\r
+ } \r
+ }\r
+ } \r
+ \r
+ \r
+ */\r
+ \r
+ \r
+ \r
+ /*\r
+ for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ // correlations:\r
+ for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)\r
+ {\r
+ fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;\r
+ }\r
+ // products of correlations:\r
+ for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)\r
+ {\r
+ fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;\r
+ }\r
+ // correction terms:\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)\r
+ {\r
+ fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;\r
+ } \r
+ } \r
+ }\r
+ } \r
+ */\r
+ \r
+\r
+ \r
+ \r
+ \r
+ /*\r
+ \r
+ \r
+ \r
+ // nested lists in fDiffFlowResults:\r
+ for(Int_t t=0;t<2;t++)\r
+ {\r
+ fDFRType[t] = NULL;\r
+ for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
+ {\r
+ fDFRParticleWeights[t][pW] = NULL;\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ { \r
+ fDFREventWeights[t][pW][eW] = NULL;\r
+ fDiffFlowFinalCorrelations[t][pW][eW] = NULL;\r
+ fDiffFlowFinalCorrections[t][pW][eW] = NULL;\r
+ fDiffFlowFinalCovariances[t][pW][eW] = NULL;\r
+ for(Int_t nua=0;nua<2;nua++)\r
+ {\r
+ fDFRCorrections[t][pW][eW][nua] = NULL; \r
+ fDiffFlowFinalCumulants[t][pW][eW][nua] = NULL; \r
+ fDiffFlowFinalFlow[t][pW][eW][nua] = NULL;\r
+ }\r
+ } \r
+ }\r
+ } \r
+ \r
+ // 2D and 1D histograms in nested lists in fDiffFlowResults:\r
+ for(Int_t t=0;t<2;t++) \r
+ {\r
+ fNonEmptyBins2D[t] = NULL;\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ fNonEmptyBins1D[t][pe] = NULL;\r
+ }\r
+ for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ // correlations:\r
+ for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++) \r
+ {\r
+ fFinalCorrelations2D[t][pW][eW][correlationIndex] = NULL;\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = NULL; \r
+ }\r
+ }\r
+ // corrections:\r
+ for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++) \r
+ {\r
+ fFinalCorrections2D[t][pW][eW][correctionIndex] = NULL;\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = NULL; \r
+ }\r
+ }\r
+ // covariances:\r
+ for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++) \r
+ {\r
+ fFinalCovariances2D[t][pW][eW][covarianceIndex] = NULL;\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = NULL; \r
+ }\r
+ }\r
+ for(Int_t nua=0;nua<2;nua++) \r
+ { \r
+ // cumulants:\r
+ for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++) \r
+ {\r
+ fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = NULL;\r
+ fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = NULL; \r
+ fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = NULL; \r
+ }\r
+ // final flow:\r
+ for(Int_t finalFlowIndex=0;finalFlowIndex<4;finalFlowIndex++) \r
+ {\r
+ fFinalFlow2D[t][pW][eW][nua][finalFlowIndex] = NULL;\r
+ fFinalFlowPt[t][pW][eW][nua][finalFlowIndex] = NULL; \r
+ fFinalFlowEta[t][pW][eW][nua][finalFlowIndex] = NULL; \r
+ }\r
+ } \r
+ } \r
+ }\r
+ }\r
+ \r
+ \r
+ */\r
+ \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)\r
+{\r
+ // calculate all reduced correlations needed for differential flow for each (pt,eta) bin: \r
+ \r
+ if(type == "RP") // to be improved (removed)\r
+ {\r
+ cout<<endl;\r
+ }\r
+ // ... \r
+ \r
+ /*\r
+ \r
+ Int_t typeFlag = -1; \r
+ \r
+ // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:\r
+ // index:\r
+ // 0: <2'>\r
+ // 1: <4'>\r
+\r
+ // multiplicity:\r
+ Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ Double_t dReQ1n = (*fReQ)(0,0);\r
+ Double_t dReQ2n = (*fReQ)(1,0);\r
+ //Double_t dReQ3n = (*fReQ)(2,0);\r
+ //Double_t dReQ4n = (*fReQ)(3,0);\r
+ Double_t dImQ1n = (*fImQ)(0,0);\r
+ Double_t dImQ2n = (*fImQ)(1,0);\r
+ //Double_t dImQ3n = (*fImQ)(2,0);\r
+ //Double_t dImQ4n = (*fImQ)(3,0);\r
+\r
+ // looping over all (pt,eta) bins and calculating correlations needed for differential flow: \r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
+ Double_t p1n0kRe = 0.;\r
+ Double_t p1n0kIm = 0.;\r
+\r
+ // number of POIs in particular (pt,eta) bin:\r
+ Double_t mp = 0.;\r
+\r
+ // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin):\r
+ Double_t q1n0kRe = 0.;\r
+ Double_t q1n0kIm = 0.;\r
+ Double_t q2n0kRe = 0.;\r
+ Double_t q2n0kIm = 0.;\r
+\r
+ // number of particles which are both RPs and POIs in particular (pt,eta) bin:\r
+ Double_t mq = 0.;\r
+ \r
+ // q_{m*n,0}:\r
+ q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))\r
+ * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));\r
+ q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))\r
+ * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));\r
+ q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))\r
+ * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));\r
+ q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))\r
+ * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));\r
+ \r
+ mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)\r
+ \r
+ if(type == "POI")\r
+ {\r
+ // p_{m*n,0}:\r
+ p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))\r
+ * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
+ p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e)) \r
+ * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));\r
+ \r
+ mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)\r
+ \r
+ typeFlag = 1;\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ // p_{m*n,0} = q_{m*n,0}:\r
+ p1n0kRe = q1n0kRe; \r
+ p1n0kIm = q1n0kIm; \r
+ mp = mq; \r
+ \r
+ typeFlag = 0;\r
+ }\r
+ \r
+ // count events with non-empty (pt,eta) bin:\r
+ if(mp>0)\r
+ {\r
+ fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);\r
+ }\r
+ \r
+ // 2'-particle correlation for particular (pt,eta) bin:\r
+ Double_t two1n1nPtEta = 0.;\r
+ if(mp*dMult-mq)\r
+ {\r
+ two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)\r
+ / (mp*dMult-mq);\r
+ \r
+ // fill the 2D profile to get the average correlation for each (pt,eta) bin:\r
+ if(type == "POI")\r
+ { \r
+ //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
+ \r
+ fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq); \r
+ fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
+ }\r
+ } // end of if(mp*dMult-mq)\r
+ \r
+ // 4'-particle correlation:\r
+ Double_t four1n1n1n1nPtEta = 0.;\r
+ if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
+ {\r
+ four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
+ - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
+ - 2.*q2n0kIm*dReQ1n*dImQ1n\r
+ - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
+ + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
+ - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
+ - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq \r
+ + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n) \r
+ + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n) \r
+ + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n) \r
+ + 2.*mq*dMult \r
+ - 6.*mq) \r
+ / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ \r
+ // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
+ if(type == "POI")\r
+ {\r
+ //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ \r
+ fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ \r
+ fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
+ (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ }\r
+ } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+\r
+ \r
+ \r
+ */\r
+ \r
+ \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)\r
+{\r
+ // calculate all weighted correlations needed for differential flow \r
+ \r
+ if(type == "RP") // to be improved (removed)\r
+ {\r
+ cout<<endl;\r
+ }\r
+ // ... \r
+ \r
+ /*\r
+ \r
+ \r
+ \r
+ // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ Double_t dReQ1n1k = (*fReQ)(0,1);\r
+ Double_t dReQ2n2k = (*fReQ)(1,2);\r
+ Double_t dReQ1n3k = (*fReQ)(0,3);\r
+ //Double_t dReQ4n4k = (*fReQ)(3,4);\r
+ Double_t dImQ1n1k = (*fImQ)(0,1);\r
+ Double_t dImQ2n2k = (*fImQ)(1,2);\r
+ Double_t dImQ1n3k = (*fImQ)(0,3);\r
+ //Double_t dImQ4n4k = (*fImQ)(3,4);\r
+ \r
+ // S^M_{p,k} (see .h file for the definition of fSMpk):\r
+ Double_t dSM1p1k = (*fSMpk)(0,1);\r
+ Double_t dSM1p2k = (*fSMpk)(0,2);\r
+ Double_t dSM1p3k = (*fSMpk)(0,3);\r
+ Double_t dSM2p1k = (*fSMpk)(1,1);\r
+ Double_t dSM3p1k = (*fSMpk)(2,1);\r
+ \r
+ // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow: \r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
+ Double_t p1n0kRe = 0.;\r
+ Double_t p1n0kIm = 0.;\r
+\r
+ // number of POIs in particular (pt,eta) bin):\r
+ Double_t mp = 0.;\r
+\r
+ // real and imaginary parts of q_{m*n,k}: \r
+ // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)\r
+ Double_t q1n2kRe = 0.;\r
+ Double_t q1n2kIm = 0.;\r
+ Double_t q2n1kRe = 0.;\r
+ Double_t q2n1kIm = 0.;\r
+\r
+ // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
+ Double_t s1p1k = 0.; \r
+ Double_t s1p2k = 0.; \r
+ Double_t s1p3k = 0.; \r
+ \r
+ // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
+ Double_t dM0111 = 0.;\r
+ \r
+ if(type == "POI")\r
+ {\r
+ // p_{m*n,0}:\r
+ p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))\r
+ * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
+ p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))\r
+ * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e)); \r
+ \r
+ mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
+ \r
+ // q_{m*n,k}: \r
+ q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))\r
+ * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));\r
+ q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))\r
+ * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));\r
+ q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))\r
+ * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e)); \r
+ q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))\r
+ * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));\r
+ \r
+ // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
+ s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.); \r
+ s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.); \r
+ s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.); \r
+ \r
+ // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
+ dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
+ - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
+ + 2.*(s1p3k-s1p2k*dSM1p1k));\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))\r
+ * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));\r
+ p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))\r
+ * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));\r
+ \r
+ mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));\r
+ \r
+ // q_{m*n,k}: \r
+ q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))\r
+ * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));\r
+ q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))\r
+ * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));\r
+ q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))\r
+ * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));\r
+ q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))\r
+ * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));\r
+ \r
+ // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
+ s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.); \r
+ s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.); \r
+ s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.); \r
+ \r
+ // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
+ dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
+ - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
+ + 2.*(s1p3k-s1p2k*dSM1p1k));\r
+ //............................................................................................... \r
+ }\r
+ \r
+ // 2'-particle correlation:\r
+ Double_t two1n1nW0W1PtEta = 0.;\r
+ if(mp*dSM1p1k-s1p1k)\r
+ {\r
+ two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)\r
+ / (mp*dSM1p1k-s1p1k);\r
+ \r
+ // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
+ if(type == "POI")\r
+ {\r
+ //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,\r
+ // mp*dSM1p1k-s1p1k);\r
+ fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,\r
+ // mp*dSM1p1k-s1p1k); \r
+ fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k); \r
+ }\r
+ } // end of if(mp*dMult-dmPrimePrimePtEta)\r
+ \r
+ // 4'-particle correlation:\r
+ Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;\r
+ if(dM0111)\r
+ {\r
+ four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
+ - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))\r
+ - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k\r
+ - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)\r
+ + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)\r
+ - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
+ - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k \r
+ + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k) \r
+ + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k) \r
+ + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k) \r
+ + 2.*s1p1k*dSM1p2k \r
+ - 6.*s1p3k) \r
+ / dM0111; // to be imropoved (notation of dM0111)\r
+ \r
+ // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
+ if(type == "POI")\r
+ {\r
+ //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);\r
+ fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111); \r
+ fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111); \r
+ }\r
+ } // end of if(dM0111)\r
+ \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ \r
+ \r
+ */ \r
+ \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+/*\r
+void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)\r
+{\r
+ // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;\r
+ // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;\r
+ // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms. \r
+ \r
+ Int_t typeFlag = -1;\r
+ Int_t pWeightsFlag = -1;\r
+ Int_t eWeightsFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } else \r
+ {\r
+ cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ if(!useParticleWeights)\r
+ {\r
+ pWeightsFlag = 0;\r
+ } else \r
+ {\r
+ pWeightsFlag = 1; \r
+ } \r
+ \r
+ if(eventWeights == "exact")\r
+ {\r
+ eWeightsFlag = 0;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pW = pWeightsFlag;\r
+ Int_t eW = eWeightsFlag;\r
+ \r
+ // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else)) \r
+ // pt:\r
+ for(Int_t p=1;p<fnBinsPt;p++)\r
+ {\r
+ Double_t contentPt = 0.;\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e))); \r
+ }\r
+ fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);\r
+ }\r
+ // eta:\r
+ for(Int_t e=1;e<fnBinsEta;e++)\r
+ {\r
+ Double_t contentEta = 0.;\r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e))); \r
+ }\r
+ fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);\r
+ }\r
+ \r
+ // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):\r
+ TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)\r
+ \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t ci=0;ci<4;ci++) // correlation index\r
+ {\r
+ if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);\r
+ if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);\r
+ }\r
+ }\r
+ \r
+ // transfer 2D profile into 2D histogram:\r
+ // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram) \r
+ for(Int_t ci=0;ci<4;ci++)\r
+ {\r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e)); \r
+ Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));\r
+ Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));\r
+ Double_t error = 0.;\r
+ fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation); \r
+ if(nEvts>0)\r
+ {\r
+ error = spread/pow(nEvts,0.5);\r
+ fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);\r
+ }\r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ } // end of for(Int_t ci=0;ci<4;ci++)\r
+ \r
+ // transfer 1D profile into 1D histogram (pt):\r
+ // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram) \r
+ for(Int_t ci=0;ci<4;ci++)\r
+ {\r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ if(profile[0][ci])\r
+ {\r
+ Double_t correlation = profile[0][ci]->GetBinContent(p); \r
+ Double_t spread = profile[0][ci]->GetBinError(p);\r
+ Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);\r
+ Double_t error = 0.;\r
+ fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation); \r
+ if(nEvts>0)\r
+ {\r
+ error = spread/pow(nEvts,0.5);\r
+ fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);\r
+ } \r
+ } \r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ } // end of for(Int_t ci=0;ci<4;ci++)\r
+ \r
+ // transfer 1D profile into 1D histogram (eta):\r
+ // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram) \r
+ for(Int_t ci=0;ci<4;ci++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ if(profile[1][ci])\r
+ {\r
+ Double_t correlation = profile[1][ci]->GetBinContent(e); \r
+ fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation); \r
+ } \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t ci=0;ci<4;ci++)\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)\r
+*/\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)\r
+{\r
+ // calcualate cumulants for differential flow from measured correlations\r
+ // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...\r
+ // to be improved (description) \r
+ \r
+ Int_t typeFlag = -1;\r
+ Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ if(ptOrEta == "Pt")\r
+ {\r
+ ptEtaFlag = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ ptEtaFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pe = ptEtaFlag;\r
+ \r
+ // common:\r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ \r
+ // correlation <<2>>: \r
+ Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);\r
+ \r
+ // 1D:\r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ {\r
+ // reduced correlations: \r
+ Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)\r
+ Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)\r
+ // final statistical error of reduced correlations:\r
+ //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p); \r
+ // QC{2'}:\r
+ Double_t qc2Prime = twoPrime; // QC{2'}\r
+ //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}\r
+ fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime); \r
+ //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError); \r
+ // QC{4'}:\r
+ Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>\r
+ fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime); \r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ \r
+ \r
+ /*\r
+ // 1D (eta):\r
+ // to be improved (see documentation if I can do all this without looping)\r
+ // to be improved (treat pt and eta in one go)\r
+ // to be improved (combine loops over nua for 2D and 1D)\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ // reduced correlations: \r
+ Double_t twoPrime = fFinalCorrelations1D[t][pW][eW][1][0]->GetBinContent(e); // <<2'>>(eta)\r
+ Double_t fourPrime = fFinalCorrelations1D[t][pW][eW][1][1]->GetBinContent(e); // <<4'>>(eta)\r
+ // final statistical error of reduced correlations:\r
+ Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][1][0]->GetBinError(e); \r
+ for(Int_t nua=0;nua<2;nua++)\r
+ {\r
+ // QC{2'}:\r
+ Double_t qc2Prime = twoPrime; // QC{2'}\r
+ Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}\r
+ fFinalCumulantsEta[t][pW][eW][nua][0]->SetBinContent(e,qc2Prime); \r
+ fFinalCumulantsEta[t][pW][eW][nua][0]->SetBinError(e,qc2PrimeError); \r
+ // QC{4'}:\r
+ Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>\r
+ fFinalCumulantsEta[t][pW][eW][nua][1]->SetBinContent(e,qc4Prime);\r
+ } // end of for(Int_t nua=0;nua<2;nua++) \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ */ \r
+\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ /* \r
+ // 2D (pt,eta):\r
+ // to be improved (see documentation if I can do all this without looping)\r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++) \r
+ { \r
+ // reduced correlations: \r
+ Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)\r
+ Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)\r
+ for(Int_t nua=0;nua<2;nua++)\r
+ {\r
+ // QC{2'}:\r
+ Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>\r
+ fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime); \r
+ // QC{4'}:\r
+ Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>\r
+ fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime); \r
+ } // end of for(Int_t nua=0;nua<2;nua++) \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ */\r
+ \r
+ \r
+ /*\r
+ \r
+ \r
+ \r
+ */\r
+ \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights); \r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)\r
+{\r
+ // calculate final results for integrated flow of RPs and POIs \r
+ \r
+ Int_t typeFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } else \r
+ {\r
+ cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ \r
+ // pt yield: \r
+ TH1F *yield2ndPt = NULL;\r
+ TH1F *yield4thPt = NULL;\r
+ TH1F *yield6thPt = NULL;\r
+ TH1F *yield8thPt = NULL;\r
+ \r
+ if(type == "POI")\r
+ {\r
+ yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();\r
+ yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();\r
+ yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();\r
+ yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone(); \r
+ } \r
+ else if(type == "RP")\r
+ {\r
+ yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();\r
+ yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();\r
+ yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();\r
+ yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone(); \r
+ } \r
+ \r
+ Int_t nBinsPt = yield2ndPt->GetNbinsX();\r
+ \r
+ TH1D *flow2ndPt = NULL;\r
+ TH1D *flow4thPt = NULL;\r
+ TH1D *flow6thPt = NULL;\r
+ TH1D *flow8thPt = NULL;\r
+ \r
+ // to be improved (hardwired pt index)\r
+ flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();\r
+ flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();\r
+ flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();\r
+ flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone(); \r
+ \r
+ Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow\r
+ Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow\r
+ \r
+ Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow \r
+ Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow\r
+\r
+ Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield \r
+ Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow\r
+ \r
+ // looping over pt bins:\r
+ for(Int_t p=1;p<nBinsPt+1;p++)\r
+ {\r
+ dvn2nd = flow2ndPt->GetBinContent(p);\r
+ dvn4th = flow4thPt->GetBinContent(p);\r
+ dvn6th = flow6thPt->GetBinContent(p);\r
+ dvn8th = flow8thPt->GetBinContent(p);\r
+ \r
+ dErrvn2nd = flow2ndPt->GetBinError(p);\r
+ dErrvn4th = flow4thPt->GetBinError(p);\r
+ dErrvn6th = flow6thPt->GetBinError(p);\r
+ dErrvn8th = flow8thPt->GetBinError(p);\r
+\r
+ dYield2nd = yield2ndPt->GetBinContent(p); \r
+ dYield4th = yield4thPt->GetBinContent(p);\r
+ dYield6th = yield6thPt->GetBinContent(p);\r
+ dYield8th = yield8thPt->GetBinContent(p);\r
+ \r
+ dVn2nd += dvn2nd*dYield2nd;\r
+ dVn4th += dvn4th*dYield4th;\r
+ dVn6th += dvn6th*dYield6th;\r
+ dVn8th += dvn8th*dYield8th;\r
+ \r
+ dSum2nd += dYield2nd;\r
+ dSum4th += dYield4th;\r
+ dSum6th += dYield6th;\r
+ dSum8th += dYield8th;\r
+ \r
+ dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)\r
+ dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;\r
+ dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;\r
+ dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;\r
+ \r
+ } // end of for(Int_t p=1;p<nBinsPt+1;p++)\r
+\r
+ // normalizing the results for integrated flow:\r
+ if(dSum2nd) \r
+ {\r
+ dVn2nd /= dSum2nd;\r
+ dErrVn2nd /= (dSum2nd*dSum2nd);\r
+ dErrVn2nd = TMath::Sqrt(dErrVn2nd);\r
+ } \r
+ if(dSum4th) \r
+ {\r
+ dVn4th /= dSum4th;\r
+ dErrVn4th /= (dSum4th*dSum4th);\r
+ dErrVn4th = TMath::Sqrt(dErrVn4th);\r
+ } \r
+ //if(dSum6th) dVn6th/=dSum6th;\r
+ //if(dSum8th) dVn8th/=dSum8th;\r
+ \r
+ \r
+ /* \r
+ // storing the results for integrated flow: // to be improved (make a new method for this!)\r
+ if(!(useParticleWeights))\r
+ {\r
+ if(type == "POI")\r
+ {\r
+ // 2nd:\r
+ fIntFlowResultsPOIQC->SetBinContent(1,dVn2nd);\r
+ fIntFlowResultsPOIQC->SetBinError(1,dSd2nd);\r
+ // 4th:\r
+ fIntFlowResultsPOIQC->SetBinContent(2,dVn4th);\r
+ fIntFlowResultsPOIQC->SetBinError(2,dSd4th);\r
+ // 6th:\r
+ fIntFlowResultsPOIQC->SetBinContent(3,dVn6th);\r
+ fIntFlowResultsPOIQC->SetBinError(3,dSd6th);\r
+ // 8th:\r
+ fIntFlowResultsPOIQC->SetBinContent(4,dVn8th);\r
+ fIntFlowResultsPOIQC->SetBinError(4,dSd8th);\r
+ }\r
+ else if (type == "RP")\r
+ {\r
+ // 2nd:\r
+ fIntFlowResultsRPQC->SetBinContent(1,dVn2nd);\r
+ fIntFlowResultsRPQC->SetBinError(1,dSd2nd);\r
+ // 4th:\r
+ fIntFlowResultsRPQC->SetBinContent(2,dVn4th);\r
+ fIntFlowResultsRPQC->SetBinError(2,dSd4th);\r
+ // 6th:\r
+ fIntFlowResultsRPQC->SetBinContent(3,dVn6th);\r
+ fIntFlowResultsRPQC->SetBinError(3,dSd6th);\r
+ // 8th:\r
+ fIntFlowResultsRPQC->SetBinContent(4,dVn8th);\r
+ fIntFlowResultsRPQC->SetBinError(4,dSd8th);\r
+ }\r
+ } \r
+ else if (useParticleWeights)\r
+ {\r
+ if(type == "POI")\r
+ {\r
+ // 2nd:\r
+ fIntFlowResultsPOIQCW->SetBinContent(1,dVn2nd);\r
+ fIntFlowResultsPOIQCW->SetBinError(1,dSd2nd);\r
+ // 4th:\r
+ fIntFlowResultsPOIQCW->SetBinContent(2,dVn4th);\r
+ fIntFlowResultsPOIQCW->SetBinError(2,dSd4th);\r
+ // 6th:\r
+ fIntFlowResultsPOIQCW->SetBinContent(3,dVn6th);\r
+ fIntFlowResultsPOIQCW->SetBinError(3,dSd6th);\r
+ // 8th:\r
+ fIntFlowResultsPOIQCW->SetBinContent(4,dVn8th);\r
+ fIntFlowResultsPOIQCW->SetBinError(4,dSd8th);\r
+ }\r
+ else if (type == "RP")\r
+ {\r
+ // 2nd:\r
+ fIntFlowResultsRPQCW->SetBinContent(1,dVn2nd);\r
+ fIntFlowResultsRPQCW->SetBinError(1,dSd2nd);\r
+ // 4th:\r
+ fIntFlowResultsRPQCW->SetBinContent(2,dVn4th);\r
+ fIntFlowResultsRPQCW->SetBinError(2,dSd4th);\r
+ // 6th:\r
+ fIntFlowResultsRPQCW->SetBinContent(3,dVn6th);\r
+ fIntFlowResultsRPQCW->SetBinError(3,dSd6th);\r
+ // 8th:\r
+ fIntFlowResultsRPQCW->SetBinContent(4,dVn8th);\r
+ fIntFlowResultsRPQCW->SetBinError(4,dSd8th);\r
+ }\r
+ }\r
+ */\r
+ \r
+ \r
+ \r
+ // storing the results for integrated flow in common histos: (to be improved: new method for this?)\r
+ if(type == "POI")\r
+ {\r
+ fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd); \r
+ fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th); \r
+ fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)\r
+ fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)\r
+ }\r
+ else if (type == "RP")\r
+ {\r
+ fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd); \r
+ fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);\r
+ fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)\r
+ fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)\r
+ }\r
+ \r
+ delete flow2ndPt;\r
+ delete flow4thPt;\r
+ //delete flow6thPt;\r
+ //delete flow8thPt;\r
+ \r
+ delete yield2ndPt;\r
+ delete yield4thPt;\r
+ delete yield6thPt;\r
+ delete yield8thPt;\r
+ \r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()\r
+{\r
+ // initialize arrays used for distributions:\r
+ \r
+ /*\r
+ \r
+ for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ for(Int_t di=0;di<4;di++) // distribution index\r
+ {\r
+ fDistributions[pW][eW][di] = NULL;\r
+ }\r
+ } \r
+ }\r
+ \r
+ */\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()\r
+{\r
+ // book all histograms for distributions\r
+ \r
+ /*\r
+ //weighted <2>_{n|n} distribution\r
+ f2pDistribution = new TH1D("f2pDistribution","<2>_{n|n} distribution",100000,-0.02,0.1);\r
+ f2pDistribution->SetXTitle("<2>_{n|n}");\r
+ f2pDistribution->SetYTitle("Counts");\r
+ fHistList->Add(f2pDistribution);\r
+\r
+ //weighted <4>_{n,n|n,n} distribution\r
+ f4pDistribution = new TH1D("f4pDistribution","<4>_{n,n|n,n} distribution",100000,-0.00025,0.002);\r
+ f4pDistribution->SetXTitle("<4>_{n,n|n,n}");\r
+ f4pDistribution->SetYTitle("Counts");\r
+ fHistList->Add(f4pDistribution); \r
+ \r
+ //weighted <6>_{n,n,n|n,n,n} distribution\r
+ f6pDistribution = new TH1D("f6pDistribution","<6>_{n,n,n|n,n,n} distribution",100000,-0.000005,0.000025);\r
+ f6pDistribution->SetXTitle("<6>_{n,n,n|n,n,n}");\r
+ f6pDistribution->SetYTitle("Counts");\r
+ fHistList->Add(f6pDistribution);\r
+ \r
+ //weighted <8>_{n,n,n,n|n,n,n,n} distribution\r
+ f8pDistribution = new TH1D("f8pDistribution","<8>_{n,n,n,n|n,n,n,n} distribution",100000,-0.000000001,0.00000001);\r
+ f8pDistribution->SetXTitle("<8>_{n,n,n,n|n,n,n,n}");\r
+ f8pDistribution->SetYTitle("Counts");\r
+ fHistList->Add(f8pDistribution);\r
+ */\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()\r
+{\r
+ // Book and nest all lists nested in the base list fHistList.\r
+ // a) Book and nest lists for integrated flow;\r
+ // b) Book and nest lists for differential flow;\r
+ // c) Book and nest list for particle weights;\r
+ // d) Book and nest list for distributions;\r
+ // e) Book and nest list for nested loops;\r
+ \r
+ // a) Book and nest all lists for integrated flow:\r
+ // base list for integrated flow:\r
+ fIntFlowList = new TList();\r
+ fIntFlowList->SetName("Integrated Flow");\r
+ fIntFlowList->SetOwner(kTRUE);\r
+ fHistList->Add(fIntFlowList);\r
+ // list holding profiles: \r
+ fIntFlowProfiles = new TList();\r
+ fIntFlowProfiles->SetName("Profiles");\r
+ fIntFlowProfiles->SetOwner(kTRUE);\r
+ fIntFlowList->Add(fIntFlowProfiles);\r
+ // list holding histograms with results:\r
+ fIntFlowResults = new TList();\r
+ fIntFlowResults->SetName("Results");\r
+ fIntFlowResults->SetOwner(kTRUE);\r
+ fIntFlowList->Add(fIntFlowResults);\r
+ \r
+ // b) Book and nest lists for differential flow;\r
+ fDiffFlowList = new TList();\r
+ fDiffFlowList->SetName("Differential Flow");\r
+ fDiffFlowList->SetOwner(kTRUE); \r
+ fHistList->Add(fDiffFlowList);\r
+ // list holding profiles: \r
+ fDiffFlowProfiles = new TList(); \r
+ fDiffFlowProfiles->SetName("Profiles");\r
+ fDiffFlowProfiles->SetOwner(kTRUE);\r
+ fDiffFlowList->Add(fDiffFlowProfiles);\r
+ // list holding histograms with results: \r
+ fDiffFlowResults = new TList();\r
+ fDiffFlowResults->SetName("Results");\r
+ fDiffFlowResults->SetOwner(kTRUE);\r
+ fDiffFlowList->Add(fDiffFlowResults);\r
+ // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults: \r
+ TList list;\r
+ list.SetOwner(kTRUE);\r
+ TString typeFlag[2] = {"RP","POI"}; \r
+ TString ptEtaFlag[2] = {"p_{T}","#eta"}; \r
+ TString powerFlag[2] = {"linear","quadratic"}; \r
+ // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ // list holding profiles with correlations:\r
+ fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);\r
+ // list holding profiles with products of correlations:\r
+ fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);\r
+ // list holding profiles with correlations:\r
+ fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]); \r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
+ // nested lists in fDiffFlowResults (~/Differential Flow/Results):\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ // list holding histograms with correlations:\r
+ fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);\r
+ for(Int_t power=0;power<2;power++)\r
+ {\r
+ // list holding histograms with sums of event weights:\r
+ fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();\r
+ fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]); \r
+ } // end of for(Int_t power=0;power<2;power++)\r
+ // list holding histograms with sums of products of event weights:\r
+ fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);\r
+ // list holding histograms with covariances of correlations:\r
+ fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);\r
+ // list holding histograms with differential Q-cumulants:\r
+ fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]); \r
+ // list holding histograms with differential flow estimates from Q-cumulants:\r
+ fDiffFlowHistList[t][pe] = (TList*)list.Clone();\r
+ fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
+ fDiffFlowResults->Add(fDiffFlowHistList[t][pe]); \r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ \r
+ // c) Book and nest list for particle weights:\r
+ fWeightsList->SetName("Weights");\r
+ fWeightsList->SetOwner(kTRUE); \r
+ fHistList->Add(fWeightsList); \r
+\r
+ // d) Book and nest list for distributions:\r
+ fDistributionsList = new TList();\r
+ fDistributionsList->SetName("Distributions");\r
+ fDistributionsList->SetOwner(kTRUE);\r
+ fHistList->Add(fDistributionsList);\r
+ \r
+ // e) Book and nest list for nested loops:\r
+ fNestedLoopsList = new TList();\r
+ fNestedLoopsList->SetName("Nested Loops");\r
+ fNestedLoopsList->SetOwner(kTRUE);\r
+ fHistList->Add(fNestedLoopsList);\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)\r
+{\r
+ // fill common result histograms for differential flow\r
+ \r
+ Int_t typeFlag = -1;\r
+ //Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ //Int_t pe = ptEtaFlag;\r
+\r
+ /* // to be improved (implement protection here)\r
+ for(Int_t o=0;o<4;o++) // order\r
+ {\r
+ if(!fFinalFlowPt[t][pW][eW][nua][o])\r
+ {\r
+ cout<<"WARNING: fFinalFlowPt[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"o = "<<o<<endl;\r
+ exit(0); \r
+ }\r
+ if(!fFinalFlowEta[t][pW][eW][nua][o])\r
+ {\r
+ cout<<"WARNING: fFinalFlowEta[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"nua = "<<nua<<endl;\r
+ cout<<"o = "<<o<<endl;\r
+ exit(0); \r
+ } \r
+ } \r
+ */\r
+ \r
+ if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
+ {\r
+ cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl; \r
+ cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ // pt:\r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);\r
+ Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);\r
+ Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);\r
+ Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);\r
+ \r
+ Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);\r
+ Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);\r
+ //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);\r
+ //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);\r
+ \r
+ if(type == "RP")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);\r
+ fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);\r
+ fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);\r
+ fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);\r
+ } else if(type == "POI")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);\r
+ fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);\r
+ fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);\r
+ fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);\r
+ }\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++) \r
+ \r
+ // eta:\r
+ for(Int_t e=1;e<=fnBinsEta;e++)\r
+ {\r
+ Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);\r
+ Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);\r
+ Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);\r
+ Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);\r
+ \r
+ Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);\r
+ Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);\r
+ //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);\r
+ //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);\r
+ \r
+ if(type == "RP")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);\r
+ fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);\r
+ fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);\r
+ fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);\r
+ } else if(type == "POI")\r
+ {\r
+ fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);\r
+ fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);\r
+ fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);\r
+ fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);\r
+ }\r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++) \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::AccessConstants()\r
+{\r
+ // access needed common constants from AliFlowCommonConstants\r
+ \r
+ fnBinsPhi = AliFlowCommonConstants::GetNbinsPhi();\r
+ fPhiMin = AliFlowCommonConstants::GetPhiMin(); \r
+ fPhiMax = AliFlowCommonConstants::GetPhiMax();\r
+ if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi; \r
+ fnBinsPt = AliFlowCommonConstants::GetNbinsPt();\r
+ fPtMin = AliFlowCommonConstants::GetPtMin(); \r
+ fPtMax = AliFlowCommonConstants::GetPtMax();\r
+ if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt; \r
+ fnBinsEta = AliFlowCommonConstants::GetNbinsEta();\r
+ fEtaMin = AliFlowCommonConstants::GetEtaMin(); \r
+ fEtaMax = AliFlowCommonConstants::GetEtaMax();\r
+ if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta; \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()\r
+{\r
+ // Calculate sum of linear and quadratic event weights for correlations\r
+ \r
+ Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
+\r
+ Double_t eventWeight[4] = {0}; \r
+ eventWeight[0] = dMult*(dMult-1); // event weight for <2> \r
+ eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
+ eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
+ eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
+ \r
+ for(Int_t p=0;p<2;p++) // power-1\r
+ {\r
+ for(Int_t ci=0;ci<4;ci++) // correlation index\r
+ { \r
+ fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(eventWeight[ci],p+1)); \r
+ }\r
+ }\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()\r
+{\r
+ // Calculate sum of product of event weights for correlations\r
+\r
+ Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
+\r
+ Double_t eventWeight[4] = {0}; \r
+ eventWeight[0] = dMult*(dMult-1); // event weight for <2> \r
+ eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
+ eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
+ eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
+\r
+ fIntFlowSumOfProductOfEventWeights->Fill(0.5,eventWeight[0]*eventWeight[1]); \r
+ fIntFlowSumOfProductOfEventWeights->Fill(1.5,eventWeight[0]*eventWeight[2]); \r
+ fIntFlowSumOfProductOfEventWeights->Fill(2.5,eventWeight[0]*eventWeight[3]); \r
+ fIntFlowSumOfProductOfEventWeights->Fill(3.5,eventWeight[1]*eventWeight[2]); \r
+ fIntFlowSumOfProductOfEventWeights->Fill(4.5,eventWeight[1]*eventWeight[3]); \r
+ fIntFlowSumOfProductOfEventWeights->Fill(5.5,eventWeight[2]*eventWeight[3]); \r
+\r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeights()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateReducedCorrelations1D(TString type, TString ptOrEta)\r
+{\r
+ // calculate reduced correlations for RPs or POIs in pt or eta bins\r
+\r
+ // multiplicity:\r
+ Double_t dMult = (*fSMpk)(0,0);\r
+ \r
+ // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
+ Double_t dReQ1n = (*fReQ)(0,0);\r
+ Double_t dReQ2n = (*fReQ)(1,0);\r
+ //Double_t dReQ3n = (*fReQ)(2,0);\r
+ //Double_t dReQ4n = (*fReQ)(3,0);\r
+ Double_t dImQ1n = (*fImQ)(0,0);\r
+ Double_t dImQ2n = (*fImQ)(1,0);\r
+ //Double_t dImQ3n = (*fImQ)(2,0);\r
+ //Double_t dImQ4n = (*fImQ)(3,0);\r
+\r
+ // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:\r
+ // \r
+ // 0: <<2'>>\r
+ // 1: <<4'>>\r
+ // 2: <<6'>>\r
+ // 3: <<8'>>\r
+ \r
+ Int_t t = -1; // type flag \r
+ Int_t pe = -1; // ptEta flag\r
+ \r
+ if(type == "RP")\r
+ {\r
+ t = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ t = 1;\r
+ }\r
+\r
+ if(ptOrEta == "Pt")\r
+ {\r
+ pe = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ pe = 1;\r
+ }\r
+ \r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
+ //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
+ Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
+\r
+ // looping over all bins and calculating reduced correlations: \r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ {\r
+ // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
+ Double_t p1n0kRe = 0.;\r
+ Double_t p1n0kIm = 0.;\r
+\r
+ // number of POIs in particular pt or eta bin:\r
+ Double_t mp = 0.;\r
+\r
+ // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):\r
+ Double_t q1n0kRe = 0.;\r
+ Double_t q1n0kIm = 0.;\r
+ Double_t q2n0kRe = 0.;\r
+ Double_t q2n0kIm = 0.;\r
+\r
+ // number of particles which are both RPs and POIs in particular pt or eta bin:\r
+ Double_t mq = 0.;\r
+ \r
+ // q_{m*n,0}:\r
+ q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
+ * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
+ q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
+ * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
+ q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
+ * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));\r
+ q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
+ * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b)); \r
+ \r
+ mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
+ \r
+ if(type == "POI")\r
+ {\r
+ // p_{m*n,0}:\r
+ p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
+ * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
+ p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
+ * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
+ \r
+ mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
+ \r
+ t = 1; // typeFlag = RP or POI\r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ // p_{m*n,0} = q_{m*n,0}:\r
+ p1n0kRe = q1n0kRe; \r
+ p1n0kIm = q1n0kIm; \r
+ mp = mq; \r
+ \r
+ t = 0; // typeFlag = RP or POI\r
+ }\r
+ \r
+ // 2'-particle correlation for particular (pt,eta) bin:\r
+ Double_t two1n1nPtEta = 0.;\r
+ if(mp*dMult-mq)\r
+ {\r
+ two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)\r
+ / (mp*dMult-mq);\r
+ \r
+ if(type == "POI")\r
+ { \r
+ // fill profile to get <<2'>> for POIs\r
+ fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);\r
+ // histogram to store <2'> for POIs e-b-e (needed in some other methods):\r
+ fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta); \r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ // profile to get <<2'>> for RPs:\r
+ fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);\r
+ // histogram to store <2'> for RPs e-b-e (needed in some other methods):\r
+ fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta); \r
+ }\r
+ } // end of if(mp*dMult-mq)\r
+ \r
+ // 4'-particle correlation:\r
+ Double_t four1n1n1n1nPtEta = 0.;\r
+ if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
+ {\r
+ four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
+ - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
+ - 2.*q2n0kIm*dReQ1n*dImQ1n\r
+ - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
+ + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
+ - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
+ - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq \r
+ + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n) \r
+ + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n) \r
+ + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n) \r
+ + 2.*mq*dMult \r
+ - 6.*mq) \r
+ / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ \r
+ if(type == "POI")\r
+ {\r
+ // profile to get <<4'>> for POIs:\r
+ fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,\r
+ (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ // histogram to store <4'> for POIs e-b-e (needed in some other methods):\r
+ fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta); \r
+ }\r
+ else if(type == "RP")\r
+ {\r
+ // profile to get <<4'>> for RPs:\r
+ fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,\r
+ (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
+ // histogram to store <4'> for RPs e-b-e (needed in some other methods):\r
+ fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta); \r
+ }\r
+ } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
+ \r
+ } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateReducedCorrelations1D(TString type, TString ptOrEta);\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)\r
+{\r
+ // Calculate sums of various event weights for reduced correlations. \r
+ // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)\r
+\r
+ Int_t typeFlag = -1;\r
+ Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ if(ptOrEta == "Pt")\r
+ {\r
+ ptEtaFlag = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ ptEtaFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pe = ptEtaFlag;\r
+ \r
+ // binning:\r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
+ //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
+ Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
+ \r
+ for(Int_t rpq=0;rpq<3;rpq++)\r
+ {\r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ if(!fReRPQ1dEBE[rpq][pe][m][k])\r
+ {\r
+ cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"rpq = "<<rpq<<endl;\r
+ cout<<"m = "<<m<<endl;\r
+ cout<<"k = "<<k<<endl;\r
+ exit(0); \r
+ }\r
+ }\r
+ }\r
+ } \r
+\r
+ // multiplicities:\r
+ Double_t dMult = (*fSMpk)(0,0); // total event multiplicity\r
+ Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
+ Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
+ Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
+ \r
+ // event weights for reduced correlations:\r
+ Double_t dw2 = 0.; // event weight for <2'>\r
+ Double_t dw4 = 0.; // event weight for <4'>\r
+ //Double_t dw6 = 0.; // event weight for <6'>\r
+ //Double_t dw8 = 0.; // event weight for <8'>\r
+\r
+ // looping over bins:\r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ {\r
+ if(type == "RP")\r
+ {\r
+ mr = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
+ mp = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
+ mq = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
+ } else if(type == "POI")\r
+ {\r
+ mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
+ mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
+ }\r
+ \r
+ // event weight for <2'>:\r
+ dw2 = mp*dMult-mq; \r
+ fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);\r
+ fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));\r
+ \r
+ // event weight for <4'>:\r
+ dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); \r
+ fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);\r
+ fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));\r
+ \r
+ // event weight for <6'>:\r
+ //dw6 = ...; \r
+ //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);\r
+ //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));\r
+ \r
+ // event weight for <8'>:\r
+ //dw8 = ...; \r
+ //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);\r
+ //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.)); \r
+ } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++) \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)\r
+{\r
+ // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow). \r
+ // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)\r
+ //\r
+ // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints: \r
+ // 1.) i<j \r
+ // 2.) do not store terms which DO NOT include reduced correlations;\r
+ // Table:\r
+ // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]\r
+ \r
+ Int_t typeFlag = -1;\r
+ Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ if(ptOrEta == "Pt")\r
+ {\r
+ ptEtaFlag = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ ptEtaFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pe = ptEtaFlag;\r
+ \r
+ // binning:\r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
+ //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
+ Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
+ \r
+ // protection:\r
+ for(Int_t rpq=0;rpq<3;rpq++)\r
+ {\r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ if(!fReRPQ1dEBE[rpq][pe][m][k])\r
+ {\r
+ cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"rpq = "<<rpq<<endl;\r
+ cout<<"m = "<<m<<endl;\r
+ cout<<"k = "<<k<<endl;\r
+ exit(0); \r
+ }\r
+ }\r
+ }\r
+ } \r
+ \r
+ // multiplicities:\r
+ Double_t dMult = (*fSMpk)(0,0); // total event multiplicity\r
+ Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
+ Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
+ Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
+ \r
+ // event weights for correlations:\r
+ Double_t dW2 = dMult*(dMult-1); // event weight for <2> \r
+ Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
+ Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
+ Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
+\r
+ // event weights for reduced correlations:\r
+ Double_t dw2 = 0.; // event weight for <2'>\r
+ Double_t dw4 = 0.; // event weight for <4'>\r
+ //Double_t dw6 = 0.; // event weight for <6'>\r
+ //Double_t dw8 = 0.; // event weight for <8'>\r
+ \r
+ // looping over bins:\r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ {\r
+ if(type == "RP")\r
+ {\r
+ mr = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
+ mp = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
+ mq = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
+ } else if(type == "POI")\r
+ {\r
+ mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
+ mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
+ }\r
+ \r
+ // event weight for <2'>:\r
+ dw2 = mp*dMult-mq; \r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>\r
+ \r
+ // event weight for <4'>:\r
+ dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); \r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'> \r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>\r
+\r
+ // event weight for <6'>:\r
+ //dw6 = ...; \r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'> \r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>\r
+\r
+ // event weight for <8'>:\r
+ //dw8 = ...; \r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'> \r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>\r
+ //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>\r
+ \r
+ // Table:\r
+ // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]\r
+ \r
+ } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ \r
+\r
+\r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)\r
+{\r
+ // Transfer profiles into histograms and calculate statistical errors correctly.\r
+\r
+ Int_t typeFlag = -1;\r
+ Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ if(ptOrEta == "Pt")\r
+ {\r
+ ptEtaFlag = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ ptEtaFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pe = ptEtaFlag;\r
+ \r
+ for(Int_t rci=0;rci<4;rci++)\r
+ {\r
+ if(!fDiffFlowCorrelationsPro[t][pe][rci])\r
+ {\r
+ cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl; \r
+ cout<<"pe = "<<pe<<endl; \r
+ cout<<"rci = "<<rci<<endl;\r
+ exit(0); \r
+ }\r
+ for(Int_t power=0;power<2;power++)\r
+ {\r
+ if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])\r
+ {\r
+ cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl; \r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"power = "<<power<<endl; \r
+ cout<<"rci = "<<rci<<endl;\r
+ exit(0); \r
+ } \r
+ } // end of for(Int_t power=0;power<2;power++)\r
+ } // end of for(Int_t rci=0;rci<4;rci++)\r
+ \r
+ // common:\r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ \r
+ // transfer 1D profile into 1D histogram:\r
+ Double_t correlation = 0.;\r
+ Double_t spread = 0.;\r
+ Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin\r
+ Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin\r
+ Double_t error = 0.; // error = termA * spread * termB\r
+ // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights) \r
+ // termB = 1/pow(1-termA^2,0.5)\r
+ Double_t termA = 0.; \r
+ Double_t termB = 0.; \r
+ for(Int_t rci=0;rci<4;rci++) // index of reduced correlation\r
+ {\r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins\r
+ {\r
+ correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b); \r
+ spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);\r
+ sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);\r
+ sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);\r
+ if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);\r
+ if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5); \r
+ error = termA*spread*termB; // final error (unbiased estimator for standard deviation)\r
+ fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation); \r
+ fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error); \r
+ } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ } // end of for(Int_t rci=0;rci<4;rci++)\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)\r
+{\r
+ // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>, \r
+ // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,\r
+ // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>, \r
+ // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>, \r
+ // <6'><8'>, <8><8'>.\r
+ \r
+ Int_t typeFlag = -1;\r
+ Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ if(ptOrEta == "Pt")\r
+ {\r
+ ptEtaFlag = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ ptEtaFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pe = ptEtaFlag;\r
+ \r
+ // common:\r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
+ Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
+ \r
+ // protections // to be improved (add protection for all pointers in this method)\r
+ if(!fIntFlowCorrelationsEBE)\r
+ {\r
+ cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;\r
+ exit(0);\r
+ } \r
+ \r
+ Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)\r
+ Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
+ Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
+ Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
+\r
+ // e-b-e correlations:\r
+ Double_t twoEBE = 0.; // <2>\r
+ Double_t fourEBE = 0.; // <4>\r
+ Double_t sixEBE = 0.; // <6>\r
+ Double_t eightEBE = 0.; // <8>\r
+ \r
+ if(dMult>1)\r
+ { \r
+ twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1);\r
+ if(dMult>3)\r
+ {\r
+ fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2);\r
+ if(dMult>5) \r
+ {\r
+ sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3);\r
+ if(dMult>7) \r
+ { \r
+ eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4);\r
+ }\r
+ }\r
+ }\r
+ } \r
+ \r
+ // event weights for correlations:\r
+ Double_t dW2 = dMult*(dMult-1); // event weight for <2> \r
+ Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
+ Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
+ Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
+ \r
+ // e-b-e reduced correlations:\r
+ Double_t twoReducedEBE = 0.; // <2'>\r
+ Double_t fourReducedEBE = 0.; // <4'>\r
+ Double_t sixReducedEBE = 0.; // <6'>\r
+ Double_t eightReducedEBE = 0.; // <8'> \r
+ \r
+ // event weights for reduced correlations:\r
+ Double_t dw2 = 0.; // event weight for <2'>\r
+ Double_t dw4 = 0.; // event weight for <4'>\r
+ //Double_t dw6 = 0.; // event weight for <6'>\r
+ //Double_t dw8 = 0.; // event weight for <8'>\r
+\r
+ // looping over bins:\r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ {\r
+ // e-b-e reduced correlations:\r
+ twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);\r
+ fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);\r
+ sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);\r
+ eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);\r
+\r
+ // to be improved (I should not do this here again)\r
+ if(type == "RP")\r
+ {\r
+ mr = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
+ mp = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
+ mq = mr; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
+ } else if(type == "POI")\r
+ {\r
+ mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
+ mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
+ }\r
+ \r
+ // event weights for reduced correlations:\r
+ dw2 = mp*dMult-mq; // weight for <2'> \r
+ dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
+ + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>\r
+ //dw6 = ... \r
+ //dw8 = ... \r
+ \r
+ // storing all products:\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>\r
+ \r
+ // event weight for <4'>:\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'> \r
+ fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>\r
+\r
+ // event weight for <6'>:\r
+ //dw6 = ...; \r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'> \r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>\r
+\r
+ // event weight for <8'>:\r
+ //dw8 = ...; \r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'> \r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>\r
+ //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'> \r
+ } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++ \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)\r
+\r
+\r
+//================================================================================================================================\r
+ \r
+ \r
+void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)\r
+{\r
+ // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)\r
+ // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>). \r
+ // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following: \r
+ //\r
+ // Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]\r
+ // \r
+ // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.\r
+ // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:\r
+ // \r
+ // 1st bin: Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)] \r
+ // 2nd bin: Cov(<2>,<4'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)] \r
+ // 3rd bin: Cov(<4>,<2'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)] \r
+ // 4th bin: Cov(<4>,<4'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)] \r
+ // 5th bin: Cov(<2'>,<4'>) * (sum_{i=1}^{N} w_{<2'>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2'>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)] \r
+ // ...\r
+ \r
+ Int_t typeFlag = -1;\r
+ Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ if(ptOrEta == "Pt")\r
+ {\r
+ ptEtaFlag = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ ptEtaFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pe = ptEtaFlag;\r
+ \r
+ // common:\r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ //Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
+ //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
+ //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
+ \r
+ // average correlations:\r
+ Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
+ Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
+ //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>\r
+ //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>\r
+ \r
+ // sum of weights for correlation:\r
+ Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}\r
+ Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}\r
+ //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}\r
+ //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}\r
+ \r
+ // average reduced correlations:\r
+ Double_t twoReduced = 0.; // <<2'>> \r
+ Double_t fourReduced = 0.; // <<4'>>\r
+ //Double_t sixReduced = 0.; // <<6'>>\r
+ //Double_t eightReduced = 0.; // <<8'>>\r
+\r
+ // sum of weights for reduced correlation:\r
+ Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}\r
+ Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}\r
+ //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}\r
+ //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}\r
+ \r
+ // product of weights for reduced correlation:\r
+ Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}\r
+ Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}\r
+ Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}\r
+ Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}\r
+ Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}\r
+ // ...\r
+ \r
+ // products for differential flow:\r
+ Double_t twoTwoReduced = 0; // <<2><2'>> \r
+ Double_t twoFourReduced = 0; // <<2><4'>> \r
+ Double_t fourTwoReduced = 0; // <<4><2'>> \r
+ Double_t fourFourReduced = 0; // <<4><4'>> \r
+ Double_t twoReducedFourReduced = 0; // <<2'><4'>> \r
+\r
+ // denominators in the expressions for the unbiased estimators for covariances:\r
+ // denominator = 1 - term1/(term2*term3)\r
+ // prefactor = term1/(term2*term3)\r
+ Double_t denominator = 0.; \r
+ Double_t prefactor = 0.;\r
+ Double_t term1 = 0.; \r
+ Double_t term2 = 0.; \r
+ Double_t term3 = 0.; \r
+ \r
+ // unbiased estimators for covariances for differential flow:\r
+ Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)\r
+ Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})\r
+ Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)\r
+ Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})\r
+ Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)\r
+ Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})\r
+ Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)\r
+ Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})\r
+ Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)\r
+ Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})\r
+ \r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ {\r
+ // average reduced corelations:\r
+ twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);\r
+ fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);\r
+ // average products:\r
+ twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);\r
+ twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);\r
+ fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);\r
+ fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);\r
+ twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b); \r
+ // sum of weights for reduced correlations:\r
+ sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);\r
+ sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);\r
+ // products of weights for correlations:\r
+ productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b); \r
+ productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);\r
+ productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);\r
+ productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);\r
+ productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);\r
+ // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3) \r
+ // prefactor (multiplies Cov's) = term1/(term2*term3) \r
+ // <2>,<2'>:\r
+ term1 = productOfWeightsForTwoTwoReduced; \r
+ term2 = sumOfWeightsForTwo;\r
+ term3 = sumOfWeightsForTwoReduced; \r
+ if(term2*term3>0.)\r
+ {\r
+ denominator = 1.-term1/(term2*term3);\r
+ prefactor = term1/(term2*term3);\r
+ if(denominator!=0.)\r
+ {\r
+ covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator; \r
+ wCovTwoTwoReduced = covTwoTwoReduced*prefactor; \r
+ fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);\r
+ }\r
+ }\r
+ // <2>,<4'>:\r
+ term1 = productOfWeightsForTwoFourReduced; \r
+ term2 = sumOfWeightsForTwo;\r
+ term3 = sumOfWeightsForFourReduced; \r
+ if(term2*term3>0.)\r
+ {\r
+ denominator = 1.-term1/(term2*term3);\r
+ prefactor = term1/(term2*term3);\r
+ if(denominator!=0.)\r
+ {\r
+ covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator; \r
+ wCovTwoFourReduced = covTwoFourReduced*prefactor; \r
+ fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);\r
+ }\r
+ }\r
+ // <4>,<2'>:\r
+ term1 = productOfWeightsForFourTwoReduced; \r
+ term2 = sumOfWeightsForFour;\r
+ term3 = sumOfWeightsForTwoReduced; \r
+ if(term2*term3>0.)\r
+ {\r
+ denominator = 1.-term1/(term2*term3);\r
+ prefactor = term1/(term2*term3);\r
+ if(denominator!=0.)\r
+ {\r
+ covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator; \r
+ wCovFourTwoReduced = covFourTwoReduced*prefactor; \r
+ fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);\r
+ }\r
+ }\r
+ // <4>,<4'>:\r
+ term1 = productOfWeightsForFourFourReduced; \r
+ term2 = sumOfWeightsForFour;\r
+ term3 = sumOfWeightsForFourReduced; \r
+ if(term2*term3>0.)\r
+ {\r
+ denominator = 1.-term1/(term2*term3);\r
+ prefactor = term1/(term2*term3);\r
+ if(denominator!=0.)\r
+ {\r
+ covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator; \r
+ wCovFourFourReduced = covFourFourReduced*prefactor; \r
+ fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);\r
+ }\r
+ }\r
+ // <2'>,<4'>:\r
+ term1 = productOfWeightsForTwoReducedFourReduced; \r
+ term2 = sumOfWeightsForTwoReduced;\r
+ term3 = sumOfWeightsForFourReduced; \r
+ if(term2*term3>0.)\r
+ {\r
+ denominator = 1.-term1/(term2*term3);\r
+ prefactor = term1/(term2*term3);\r
+ if(denominator!=0.)\r
+ {\r
+ covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator; \r
+ wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor; \r
+ fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);\r
+ }\r
+ }\r
+ \r
+ } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ \r
+ \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)\r
+{\r
+ // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)\r
+ \r
+ Int_t typeFlag = -1;\r
+ Int_t ptEtaFlag = -1;\r
+\r
+ if(type == "RP")\r
+ {\r
+ typeFlag = 0;\r
+ } else if(type == "POI")\r
+ {\r
+ typeFlag = 1;\r
+ } \r
+ \r
+ if(ptOrEta == "Pt")\r
+ {\r
+ ptEtaFlag = 0;\r
+ } else if(ptOrEta == "Eta")\r
+ {\r
+ ptEtaFlag = 1;\r
+ } \r
+ \r
+ // shortcuts:\r
+ Int_t t = typeFlag;\r
+ Int_t pe = ptEtaFlag;\r
+ \r
+ // common:\r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ \r
+ // correlations:\r
+ Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
+ Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
+ \r
+ // statistical errors of correlations:\r
+ Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);\r
+ Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); \r
+ \r
+ // reduced correlations:\r
+ Double_t twoReduced = 0.; // <<2'>>\r
+ Double_t fourReduced = 0.; // <<4'>>\r
+ \r
+ // statistical errors of reduced correlations:\r
+ Double_t twoReducedError = 0.; \r
+ Double_t fourReducedError = 0.; \r
+\r
+ // covariances:\r
+ Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)\r
+ Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)\r
+ Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)\r
+ Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)\r
+ Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)\r
+ Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)\r
+ \r
+ // differential flow:\r
+ Double_t v2Prime = 0.; // v'{2} \r
+ Double_t v4Prime = 0.; // v'{4}\r
+ \r
+ // statistical error of differential flow:\r
+ Double_t v2PrimeError = 0.; \r
+ Double_t v4PrimeError = 0.; \r
+ \r
+ // squared statistical error of differential flow:\r
+ Double_t v2PrimeErrorSquared = 0.; \r
+ Double_t v4PrimeErrorSquared = 0.; \r
+ \r
+ // loop over pt or eta bins:\r
+ for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
+ {\r
+ // reduced correlations and statistical errors:\r
+ twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);\r
+ twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);\r
+ fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);\r
+ fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);\r
+ // covariances:\r
+ wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);\r
+ wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);\r
+ wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);\r
+ wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);\r
+ wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);\r
+ // differential flow:\r
+ // v'{2}:\r
+ if(two>0.) \r
+ {\r
+ v2Prime = twoReduced/pow(two,0.5);\r
+ v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*\r
+ (pow(twoReduced,2.)*pow(twoError,2.)\r
+ + 4.*pow(two,2.)*pow(twoReducedError,2.)\r
+ - 4.*two*twoReduced*wCovTwoTwoReduced);\r
+ \r
+ \r
+ if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);\r
+ fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime); \r
+ fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError); \r
+ }\r
+ // differential flow:\r
+ // v'{4}\r
+ if(2.*pow(two,2.)-four > 0.) \r
+ {\r
+ v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);\r
+ v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*\r
+ (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)\r
+ + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)\r
+ + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)\r
+ + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.) \r
+ - (3./2.)*(2.*two*twoReduced-fourReduced)\r
+ * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour\r
+ - 4.*two*(2.*pow(two,2.)-four)\r
+ * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced\r
+ + 2.*(2.*pow(two,2.)-four)\r
+ * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced\r
+ + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced\r
+ - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced \r
+ - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced); \r
+ if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5); \r
+ fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);\r
+ fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError); \r
+ }\r
+ \r
+ } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)\r
+ \r
+ \r
+ \r
+ \r
+ /*\r
+ // 2D:\r
+ for(Int_t nua=0;nua<2;nua++)\r
+ {\r
+ for(Int_t p=1;p<=fnBinsPt;p++)\r
+ {\r
+ for(Int_t e=1;e<=fnBinsEta;e++) \r
+ { \r
+ // differential cumulants:\r
+ Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'} \r
+ Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}\r
+ // differential flow:\r
+ Double_t v2Prime = 0.; \r
+ Double_t v4Prime = 0.; \r
+ if(v2) \r
+ {\r
+ v2Prime = qc2Prime/v2;\r
+ fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime); \r
+ } \r
+ if(v4)\r
+ {\r
+ v4Prime = -qc4Prime/pow(v4,3.); \r
+ fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime); \r
+ } \r
+ } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
+ } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
+ } // end of for(Int_t nua=0;nua<2;nua++)\r
+ */\r
+ \r
+ \r
+\r
+} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)\r
+\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()\r
+{\r
+ // a) Store all flags for integrated flow in profile fIntFlowFlags.\r
+ \r
+ if(!fIntFlowFlags)\r
+ {\r
+ cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;\r
+ exit(0);\r
+ } \r
+\r
+ fIntFlowFlags->SetBinContent(1,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not\r
+ //fIntFlowFlags->SetBinContent(2,""); // which event weight was used? // to be improved\r
+ fIntFlowFlags->SetBinContent(3,(Int_t)fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()\r
+{\r
+ // Store all flags for differential flow in the profile fDiffFlowFlags.\r
+ \r
+ if(!fDiffFlowFlags)\r
+ {\r
+ cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;\r
+ exit(0);\r
+ } \r
+ \r
+ fDiffFlowFlags->SetBinContent(1,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not\r
+ //fDiffFlowFlags->SetBinContent(2,""); // which event weight was used? // to be improved\r
+ fDiffFlowFlags->SetBinContent(3,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not\r
+ fDiffFlowFlags->SetBinContent(4,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms(TList *outputListHistos) \r
+{\r
+ // a) Access all pointers to common control and common result histograms and profiles.\r
+ \r
+ if(outputListHistos) \r
+ {\r
+ AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHistQC"));\r
+ if(commonHist) this->SetCommonHists(commonHist); \r
+ AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist2ndOrderQC"));\r
+ if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd); \r
+ AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist4thOrderQC"));\r
+ if(commonHist4th) this->SetCommonHists4th(commonHist4th);\r
+ AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist6thOrderQC"));\r
+ if(commonHist6th) this->SetCommonHists6th(commonHist6th);\r
+ AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist8thOrderQC"));\r
+ if(commonHist8th) this->SetCommonHists8th(commonHist8th);\r
+ AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>\r
+ (outputListHistos->FindObject("AliFlowCommonHistResults2ndOrderQC"));\r
+ if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd); \r
+ AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>\r
+ (outputListHistos->FindObject("AliFlowCommonHistResults4thOrderQC"));\r
+ if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);\r
+ AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>\r
+ (outputListHistos->FindObject("AliFlowCommonHistResults6thOrderQC"));\r
+ if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);\r
+ AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>\r
+ (outputListHistos->FindObject("AliFlowCommonHistResults8thOrderQC")); \r
+ if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);\r
+ } else\r
+ {\r
+ cout<<"WARNING: outputListHistos is NULL in AFAWQC::GPFCH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms(TList *outputListHistos) \r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms(TList *outputListHistos) \r
+{\r
+ // Get pointers for histograms with particle weights.\r
+\r
+ if(outputListHistos)\r
+ {\r
+ TList *weightsList = dynamic_cast<TList*>(outputListHistos->FindObject("Weights"));\r
+ if(weightsList) this->SetWeightsList(weightsList);\r
+ Bool_t bUsePhiWeights = kFALSE;\r
+ Bool_t bUsePtWeights = kFALSE;\r
+ Bool_t bUseEtaWeights = kFALSE;\r
+ TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)\r
+ fUseParticleWeightsName += fAnalysisLabel->Data();\r
+ TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));\r
+ if(useParticleWeights)\r
+ {\r
+ this->SetUseParticleWeights(useParticleWeights); \r
+ bUsePhiWeights = (Int_t)useParticleWeights->GetBinContent(1);\r
+ bUsePtWeights = (Int_t)useParticleWeights->GetBinContent(2);\r
+ bUseEtaWeights = (Int_t)useParticleWeights->GetBinContent(3);\r
+ }\r
+ } else\r
+ {\r
+ cout<<"WARNING: outputListHistos is NULL in AFAWQC::GPFPWH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+\r
+} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms(TList *outputListHistos); \r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms(TList *outputListHistos) \r
+{\r
+ // Get pointers for histograms and profiles relevant for integrated flow:\r
+ // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.\r
+ // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.\r
+ // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds. \r
+ // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds. \r
+ \r
+ TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)\r
+ TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)\r
+ \r
+ if(outputListHistos)\r
+ {\r
+ // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:\r
+ TList *intFlowList = NULL;\r
+ intFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Integrated Flow"));\r
+ if(!intFlowList) \r
+ {\r
+ cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ exit(0); \r
+ } \r
+ \r
+ // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:\r
+ TString intFlowFlagsName = "fIntFlowFlags";\r
+ intFlowFlagsName += fAnalysisLabel->Data();\r
+ TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));\r
+ Bool_t bApplyCorrectionForNUA = kFALSE;\r
+ if(intFlowFlags)\r
+ {\r
+ this->SetIntFlowFlags(intFlowFlags); \r
+ bApplyCorrectionForNUA = (Int_t)intFlowFlags->GetBinContent(3); \r
+ this->SetApplyCorrectionForNUA(bApplyCorrectionForNUA); \r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;\r
+ }\r
+ \r
+ // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:\r
+ TList *intFlowProfiles = NULL;\r
+ intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));\r
+ if(intFlowProfiles) \r
+ {\r
+ // average multiplicities:\r
+ TString avMultiplicityName = "fAvMultiplicity";\r
+ avMultiplicityName += fAnalysisLabel->Data();\r
+ TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));\r
+ if(avMultiplicity) \r
+ {\r
+ this->SetAvMultiplicity(avMultiplicity);\r
+ } else \r
+ {\r
+ cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ }\r
+ // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):\r
+ TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";\r
+ intFlowCorrelationsProName += fAnalysisLabel->Data();\r
+ TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));\r
+ if(intFlowCorrelationsPro) \r
+ {\r
+ this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // average all correlations for integrated flow (with wrong errors!):\r
+ TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";\r
+ intFlowCorrelationsAllProName += fAnalysisLabel->Data();\r
+ TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));\r
+ if(intFlowCorrelationsAllPro) \r
+ {\r
+ this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // average products of correlations <2>, <4>, <6> and <8>: \r
+ TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";\r
+ intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();\r
+ TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));\r
+ if(intFlowProductOfCorrelationsPro) \r
+ {\r
+ this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // average correction terms for non-uniform acceptance (with wrong errors!):\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";\r
+ intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
+ TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));\r
+ if(intFlowCorrectionTermsForNUAPro) \r
+ {\r
+ this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ cout<<"sc = "<<sc<<endl;\r
+ } \r
+ } // end of for(Int_t sc=0;sc<2;sc++) \r
+ } else // to if(intFlowProfiles) \r
+ {\r
+ cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ }\r
+ \r
+ // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds. \r
+ TList *intFlowResults = NULL;\r
+ intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));\r
+ if(intFlowResults)\r
+ {\r
+ // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):\r
+ TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";\r
+ intFlowCorrelationsHistName += fAnalysisLabel->Data();\r
+ TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));\r
+ if(intFlowCorrelationsHist) \r
+ {\r
+ this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // average all correlations for integrated flow (with correct errors!):\r
+ TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";\r
+ intFlowCorrelationsAllHistName += fAnalysisLabel->Data();\r
+ TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));\r
+ if(intFlowCorrelationsAllHist) \r
+ {\r
+ this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // average correction terms for non-uniform acceptance (with correct errors!):\r
+ TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";\r
+ intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));\r
+ if(intFlowCorrectionTermsForNUAHist) \r
+ {\r
+ this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ cout<<"sc = "<<sc<<endl;\r
+ } \r
+ } // end of for(Int_t sc=0;sc<2;sc++) \r
+ // covariances (multiplied with weight dependent prefactor):\r
+ TString intFlowCovariancesName = "fIntFlowCovariances";\r
+ intFlowCovariancesName += fAnalysisLabel->Data();\r
+ TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));\r
+ if(intFlowCovariances) \r
+ {\r
+ this->SetIntFlowCovariances(intFlowCovariances); \r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:\r
+ TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";\r
+ intFlowSumOfEventWeightsName += fAnalysisLabel->Data();\r
+ for(Int_t power=0;power<2;power++)\r
+ {\r
+ TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));\r
+ if(intFlowSumOfEventWeights) \r
+ {\r
+ this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ cout<<"power = "<<power<<endl;\r
+ } \r
+ } // end of for(Int_t power=0;power<2;power++) \r
+ // sum of products of event weights for correlations <2>, <4>, <6> and <8>: \r
+ TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";\r
+ intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();\r
+ TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));\r
+ if(intFlowSumOfProductOfEventWeights) \r
+ {\r
+ this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // final results for integrated Q-cumulants:\r
+ TString intFlowQcumulantsName = "fIntFlowQcumulants";\r
+ intFlowQcumulantsName += fAnalysisLabel->Data();\r
+ TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));\r
+ if(intFlowQcumulants) \r
+ {\r
+ this->SetIntFlowQcumulants(intFlowQcumulants);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ } \r
+ // final integrated flow estimates from Q-cumulants:\r
+ TString intFlowName = "fIntFlow";\r
+ intFlowName += fAnalysisLabel->Data();\r
+ TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));\r
+ if(intFlow) \r
+ {\r
+ this->SetIntFlow(intFlow);\r
+ } else \r
+ {\r
+ cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl; \r
+ } \r
+ } else // to if(intFlowResults)\r
+ {\r
+ cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
+ }\r
+ } // end of if(outputListHistos)\r
+\r
+} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms(TList *outputListHistos)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms(TList *outputListHistos)\r
+{\r
+ // Get pointer to all objects relevant for differential flow.\r
+ // a) Define flags locally (to be improved: should I promote flags to data members?);\r
+ // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;\r
+ // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;\r
+ // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;\r
+ // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.\r
+ \r
+ // a) Define flags locally (to be improved: should I promote flags to data members?): \r
+ TString typeFlag[2] = {"RP","POI"}; \r
+ TString ptEtaFlag[2] = {"p_{T}","#eta"};\r
+ TString powerFlag[2] = {"linear","quadratic"};\r
+ TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"}; \r
+ TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
+ TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
+ TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};\r
+ TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
+ \r
+ // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:\r
+ TList *diffFlowList = NULL;\r
+ diffFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Differential Flow")); \r
+ if(!diffFlowList)\r
+ { \r
+ cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ // list holding nested lists containing profiles:\r
+ TList *diffFlowListProfiles = NULL;\r
+ diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));\r
+ if(!diffFlowListProfiles)\r
+ { \r
+ cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ // list holding nested lists containing 2D and 1D histograms with final results:\r
+ TList *diffFlowListResults = NULL;\r
+ diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));\r
+ if(!diffFlowListResults)\r
+ { \r
+ cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ \r
+ // c) Get pointer to profile holding all flags for differential flow;\r
+ TString diffFlowFlagsName = "fDiffFlowFlags";\r
+ diffFlowFlagsName += fAnalysisLabel->Data();\r
+ TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));\r
+ Bool_t bCalculate2DFlow = kFALSE;\r
+ if(diffFlowFlags)\r
+ {\r
+ this->SetDiffFlowFlags(diffFlowFlags); \r
+ bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);\r
+ this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?) \r
+ }\r
+ \r
+ // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;\r
+ // correlations:\r
+ TList *diffFlowCorrelationsProList[2][2] = {{NULL}};\r
+ TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";\r
+ diffFlowCorrelationsProName += fAnalysisLabel->Data();\r
+ TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}}; \r
+ // products of correlations:\r
+ TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};\r
+ TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";\r
+ diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data(); \r
+ TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}}; \r
+ // corrections:\r
+ TList *diffFlowCorrectionsProList[2][2] = {{NULL}};\r
+ // ...\r
+ for(Int_t t=0;t<2;t++)\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++)\r
+ {\r
+ diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowCorrelationsProList[t][pe])\r
+ { \r
+ cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t ci=0;ci<4;ci++) // correlation index\r
+ {\r
+ diffFlowCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));\r
+ if(diffFlowCorrelationsPro[t][pe][ci])\r
+ {\r
+ this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);\r
+ } else\r
+ {\r
+ cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl; \r
+ cout<<"ci = "<<ci<<endl;\r
+ } \r
+ } // end of for(Int_t ci=0;ci<4;ci++) // correlation index \r
+ // products of correlations: \r
+ diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()))); \r
+ if(!diffFlowProductOfCorrelationsProList[t][pe])\r
+ { \r
+ cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
+ {\r
+ for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
+ {\r
+ diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = dynamic_cast<TProfile*>(diffFlowProductOfCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));\r
+ if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])\r
+ {\r
+ this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);\r
+ } else\r
+ {\r
+ cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl; \r
+ cout<<"mci1 = "<<mci1<<endl;\r
+ cout<<"mci2 = "<<mci2<<endl;\r
+ }\r
+ if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
+ } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
+ } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
+ // corrections:\r
+ diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowCorrectionsProList[t][pe])\r
+ { \r
+ cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ // ... \r
+ } // end of for(Int_t pe=0;pe<2;pe++)\r
+ } // end of for(Int_t t=0;t<2;t++)\r
+ \r
+ // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.\r
+ // reduced correlations:\r
+ TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};\r
+ TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";\r
+ diffFlowCorrelationsHistName += fAnalysisLabel->Data(); \r
+ TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};\r
+ // differential Q-cumulants:\r
+ TList *diffFlowCumulantsHistList[2][2] = {{NULL}};\r
+ TString diffFlowCumulantsName = "fDiffFlowCumulants";\r
+ diffFlowCumulantsName += fAnalysisLabel->Data(); \r
+ TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};\r
+ // differential flow estimates from Q-cumulants:\r
+ TList *diffFlowHistList[2][2] = {{NULL}};\r
+ TString diffFlowName = "fDiffFlow";\r
+ diffFlowName += fAnalysisLabel->Data(); \r
+ TH1D *diffFlow[2][2][4] = {{{NULL}}};\r
+ // differential covariances:\r
+ TList *diffFlowCovariancesHistList[2][2] = {{NULL}};\r
+ TString diffFlowCovariancesName = "fDiffFlowCovariances";\r
+ diffFlowCovariancesName += fAnalysisLabel->Data(); \r
+ TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ // reduced correlations:\r
+ diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowCorrelationsHistList[t][pe])\r
+ { \r
+ cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t index=0;index<4;index++) \r
+ {\r
+ diffFlowCorrelationsHist[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCorrelationsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data())));\r
+ if(diffFlowCorrelationsHist[t][pe][index])\r
+ {\r
+ this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);\r
+ } else \r
+ {\r
+ cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"index = "<<index<<endl;\r
+ exit(0); \r
+ } \r
+ } // end of for(Int_t index=0;index<4;index++)\r
+ // differential Q-cumulants:\r
+ diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowCumulantsHistList[t][pe])\r
+ { \r
+ cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t index=0;index<4;index++) \r
+ {\r
+ diffFlowCumulants[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCumulantsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data())));\r
+ if(diffFlowCumulants[t][pe][index])\r
+ {\r
+ this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);\r
+ } else \r
+ {\r
+ cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"index = "<<index<<endl;\r
+ exit(0); \r
+ } \r
+ } // end of for(Int_t index=0;index<4;index++)\r
+ // differential flow estimates from Q-cumulants:\r
+ diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowHistList[t][pe])\r
+ { \r
+ cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t index=0;index<4;index++) \r
+ {\r
+ diffFlow[t][pe][index] = dynamic_cast<TH1D*>(diffFlowHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data())));\r
+ if(diffFlow[t][pe][index])\r
+ {\r
+ this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);\r
+ } else \r
+ {\r
+ cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"index = "<<index<<endl;\r
+ exit(0); \r
+ } \r
+ } // end of for(Int_t index=0;index<4;index++)\r
+ // differential covariances:\r
+ diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowCovariancesHistList[t][pe])\r
+ { \r
+ cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t covIndex=0;covIndex<5;covIndex++) \r
+ {\r
+ diffFlowCovariances[t][pe][covIndex] = dynamic_cast<TH1D*>(diffFlowCovariancesHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data())));\r
+ if(diffFlowCovariances[t][pe][covIndex])\r
+ {\r
+ this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);\r
+ } else \r
+ {\r
+ cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"covIndex = "<<covIndex<<endl;\r
+ exit(0); \r
+ } \r
+ } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index \r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
+ // sum of event weights for reduced correlations:\r
+ TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};\r
+ TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";\r
+ diffFlowSumOfEventWeightsName += fAnalysisLabel->Data(); \r
+ TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};\r
+ for(Int_t t=0;t<2;t++) // type is RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ { \r
+ for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2\r
+ {\r
+ diffFlowSumOfEventWeightsHistList[t][pe][p] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of %s event weights (%s, %s)",powerFlag[p].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowSumOfEventWeightsHistList[t][pe][p])\r
+ { \r
+ cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"power = "<<p<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t ew=0;ew<4;ew++) // index of reduced correlation\r
+ {\r
+ diffFlowSumOfEventWeights[t][pe][p][ew] = dynamic_cast<TH1D*>(diffFlowSumOfEventWeightsHistList[t][pe][p]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()))); \r
+ if(diffFlowSumOfEventWeights[t][pe][p][ew])\r
+ {\r
+ this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);\r
+ } else \r
+ {\r
+ cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"power = "<<p<<endl;\r
+ cout<<"ew = "<<ew<<endl;\r
+ exit(0); \r
+ } \r
+ }\r
+ } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2\r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ } // end of for(Int_t t=0;t<2;t++) // type is RP or POI\r
+ // \r
+ TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};\r
+ TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";\r
+ diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data(); \r
+ TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};\r
+ for(Int_t t=0;t<2;t++) // type is RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ { \r
+ diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
+ if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])\r
+ { \r
+ cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ exit(0);\r
+ }\r
+ for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
+ {\r
+ for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
+ {\r
+ diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = dynamic_cast<TH1D*>(diffFlowSumOfProductOfEventWeightsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()))); \r
+ if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])\r
+ {\r
+ this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);\r
+ } else \r
+ {\r
+ cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
+ cout<<"t = "<<t<<endl;\r
+ cout<<"pe = "<<pe<<endl;\r
+ cout<<"mci1 = "<<mci1<<endl;\r
+ cout<<"mci2 = "<<mci2<<endl;\r
+ exit(0); \r
+ } \r
+ if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
+ } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
+ } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ } // end of for(Int_t t=0;t<2;t++) // type is RP or POI\r
+\r
+} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms(TList *outputListHistos)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()\r
+{\r
+ // Book all histograms and profiles needed for differential flow.\r
+ // a) Define flags locally (to be improved: should I promote flags to data members?);\r
+ // b) Book profile to hold all flags for differential flow;\r
+ // c) Book e-b-e quantities;\r
+ // d) Book profiles;\r
+ // e) Book histograms holding final results. \r
+ \r
+ // a) Define flags locally (to be improved: should I promote flags to data members?): \r
+ TString typeFlag[2] = {"RP","POI"}; \r
+ TString ptEtaFlag[2] = {"p_{T}","#eta"};\r
+ TString powerFlag[2] = {"linear","quadratic"};\r
+ TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"}; \r
+ TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
+ TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
+ TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};\r
+ TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
+ Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
+ Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
+ Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
+ \r
+ // b) Book profile to hold all flags for differential flow:\r
+ TString diffFlowFlagsName = "fDiffFlowFlags";\r
+ diffFlowFlagsName += fAnalysisLabel->Data();\r
+ fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);\r
+ fDiffFlowFlags->SetTickLength(-0.01,"Y");\r
+ fDiffFlowFlags->SetMarkerStyle(25);\r
+ fDiffFlowFlags->SetLabelSize(0.05);\r
+ fDiffFlowFlags->SetLabelOffset(0.02,"Y");\r
+ (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");\r
+ (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");\r
+ (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");\r
+ (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");\r
+ fDiffFlowList->Add(fDiffFlowFlags);\r
+\r
+ // c) Book e-b-e quantities:\r
+ // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)\r
+ // Explanantion of notation:\r
+ // 1.) n is harmonic, m is multiple of harmonic;\r
+ // 2.) k is power of particle weight;\r
+ // 3.) r_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for RPs in particular (pt,eta) bin (i-th RP is weighted with w_i^k); \r
+ // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin \r
+ // (if i-th POI is also RP, than it is weighted with w_i^k); \r
+ // 5.) q_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for particles which are both RPs and POIs in particular (pt,eta) bin \r
+ // (i-th RP&&POI is weighted with w_i^k) \r
+ \r
+ // 1D:\r
+ for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t m=0;m<4;m++) // multiple of harmonic\r
+ {\r
+ for(Int_t k=0;k<9;k++) // power of particle weight\r
+ {\r
+ fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),\r
+ Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
+ fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),\r
+ Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
+ }\r
+ }\r
+ }\r
+ } \r
+ // to be improved (add explanation of fs1dEBE[t][pe][k]): \r
+ for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t k=0;k<9;k++) // power of particle weight\r
+ {\r
+ fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),\r
+ Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
+ }\r
+ }\r
+ } \r
+ // 2D:\r
+ TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
+ TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
+ for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
+ { \r
+ for(Int_t m=0;m<4;m++)\r
+ {\r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k)); \r
+ fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));\r
+ }\r
+ } \r
+ } \r
+ TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
+ for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
+ { \r
+ for(Int_t k=0;k<9;k++)\r
+ {\r
+ fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));\r
+ }\r
+ }\r
+ // reduced correlations e-b-e:\r
+ TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";\r
+ diffFlowCorrelationsEBEName += fAnalysisLabel->Data();\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
+ {\r
+ fDiffFlowCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
+ } // end of for(Int_t ci=0;ci<4;ci++) // correlation index\r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ \r
+ // d) Book profiles;\r
+ // reduced correlations:\r
+ TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";\r
+ diffFlowCorrelationsProName += fAnalysisLabel->Data();\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
+ {\r
+ // reduced correlations:\r
+ fDiffFlowCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");\r
+ fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)\r
+ } // end of for(Int_t rci=0;rci<4;rci++) // correlation index\r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ \r
+ // e) Book histograms holding final results. \r
+ // reduced correlations:\r
+ TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";\r
+ diffFlowCorrelationsHistName += fAnalysisLabel->Data();\r
+ // differential covariances:\r
+ TString diffFlowCovariancesName = "fDiffFlowCovariances";\r
+ diffFlowCovariancesName += fAnalysisLabel->Data();\r
+ // differential Q-cumulants:\r
+ TString diffFlowCumulantsName = "fDiffFlowCumulants";\r
+ diffFlowCumulantsName += fAnalysisLabel->Data();\r
+ // differential flow:\r
+ TString diffFlowName = "fDiffFlow";\r
+ diffFlowName += fAnalysisLabel->Data();\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ {\r
+ for(Int_t index=0;index<4;index++) \r
+ {\r
+ // reduced correlations:\r
+ fDiffFlowCorrelationsHist[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
+ fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]); \r
+ // differential Q-cumulants:\r
+ fDiffFlowCumulants[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
+ fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]); \r
+ // differential flow estimates from Q-cumulants:\r
+ fDiffFlow[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
+ fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]); \r
+ } // end of for(Int_t index=0;index<4;index++) \r
+ for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index \r
+ {\r
+ // differential covariances:\r
+ fDiffFlowCovariances[t][pe][covIndex] = new TH1D(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
+ fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]); \r
+ } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index\r
+ // products of both types of correlations: \r
+ TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";\r
+ diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data(); \r
+ for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
+ {\r
+ for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
+ {\r
+ fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = new TProfile(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
+ fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]); \r
+ if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
+ } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
+ } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
+ } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
+ } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ // sums of event weights for reduced correlations: \r
+ TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";\r
+ diffFlowSumOfEventWeightsName += fAnalysisLabel->Data(); \r
+ for(Int_t t=0;t<2;t++) // type is RP or POI\r
+ { \r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ { \r
+ for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2\r
+ {\r
+ for(Int_t ew=0;ew<4;ew++) // index of reduced correlation\r
+ {\r
+ fDiffFlowSumOfEventWeights[t][pe][p][ew] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),Form("%s, %s, %s, power = %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
+ fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)\r
+ }\r
+ }\r
+ }\r
+ } \r
+ // sum of products of event weights for both types of correlations: \r
+ TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";\r
+ diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data(); \r
+ for(Int_t t=0;t<2;t++) // type is RP or POI\r
+ {\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta\r
+ { \r
+ for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
+ {\r
+ for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
+ {\r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
+ fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());\r
+ fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]); \r
+ if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
+ }\r
+ }\r
+ }\r
+ } \r
+ \r
+ \r
+ \r
+ /*\r
+ \r
+ \r
+\r
+ \r
+ TString pWeightsFlag[2] = {"not used","used"}; // to be improved (do I need this here?)\r
+ TString eWeightsFlag[2] = {"exact","non-exact"}; // to be improved (do I need this here?)\r
+ //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (do I need this here?)\r
+ TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance // to be improved (do I need this here?)\r
+ \r
+ // book all 1D profiles:\r
+ // pt:\r
+ TProfile styleProfilePt("","",fnBinsPt,fPtMin,fPtMax);\r
+ styleProfilePt.SetXTitle("p_{t}");\r
+ // eta:\r
+ TProfile styleProfileEta("","",fnBinsEta,fEtaMin,fEtaMax);\r
+ styleProfileEta.SetXTitle("#eta");\r
+\r
+\r
+ \r
+ // book all 2D profiles and add to appropriate lists:\r
+ TProfile2D styleProfile("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
+ styleProfile.SetXTitle("p_{t}");\r
+ styleProfile.SetYTitle("#eta");\r
+ TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
+ TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};\r
+ TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};\r
+ TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};\r
+ TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};\r
+ TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};\r
+ TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
+ TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
+ \r
+ // profile to hold flags for diffrential flow:\r
+ TString fFlagsForDiffFlowName = "fFlagsForDiffFlowQC";\r
+ fFlagsForDiffFlowName += fAnalysisLabel->Data();\r
+ fFlagsForDiffFlow = new TProfile(fFlagsForDiffFlowName.Data(),"Flags for differential flow",10,0,10);\r
+ fFlagsForDiffFlow->SetLabelSize(0.06);\r
+ (fFlagsForDiffFlow->GetXaxis())->SetBinLabel(1,"2D Flow");\r
+ fFlagsForDiffFlow->Fill(0.5,(Int_t)fCalculate2DFlow);\r
+ fDiffFlowList->Add(fFlagsForDiffFlow); \r
+\r
+ for(Int_t t=0;t<2;t++) // type: RP or POI\r
+ { \r
+ for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // weights: not used or used \r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ // correlations:\r
+ for(Int_t correlIndex=0;correlIndex<4;correlIndex++)\r
+ {\r
+ fCorrelationsPro[t][pW][eW][correlIndex] = (TProfile2D*)styleProfile.Clone(correlationName[correlIndex].Data());\r
+ fCorrelationsPro[t][pW][eW][correlIndex]->SetTitle(correlationName[correlIndex].Data()); \r
+ fDiffFlowCorrelations[t][pW][eW]->Add(fCorrelationsPro[t][pW][eW][correlIndex]);\r
+ }\r
+ // products of correlations:\r
+ for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)\r
+ {\r
+ fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = (TProfile2D*)styleProfile.Clone(productOfCorrelationsName[productOfCorrelationsIndex].Data());\r
+ fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]->SetTitle(productOfCorrelationsName[productOfCorrelationsIndex].Data()); \r
+ fDiffFlowProductsOfCorrelations[t][pW][eW]->Add(fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]);\r
+ }\r
+ // correction terms:\r
+ for(Int_t sc=0;sc<2;sc++)\r
+ {\r
+ for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)\r
+ {\r
+ if(sc==0)\r
+ {\r
+ fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsSinTermsName[correctionsIndex].Data());\r
+ fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsSinTermsName[correctionsIndex].Data());\r
+ fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);\r
+ }\r
+ if(sc==1)\r
+ {\r
+ fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsCosTermsName[correctionsIndex].Data());\r
+ fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsCosTermsName[correctionsIndex].Data());\r
+ fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);\r
+ } \r
+ }\r
+ }\r
+ } \r
+ } \r
+ }\r
+ \r
+ // book all 2D and 1D histograms for final results and store them in appropriate lists:\r
+ TH2D styleHistPtEta("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
+ styleHistPtEta.SetXTitle("p_{t}");\r
+ styleHistPtEta.SetYTitle("#eta");\r
+ TH1D styleHistPt("","",fnBinsPt,fPtMin,fPtMax);\r
+ styleHistPt.SetXTitle("p_{t}");\r
+ TH1D styleHistEta("","",fnBinsEta,fEtaMin,fEtaMax);\r
+ styleHistEta.SetXTitle("#eta");\r
+ for(Int_t t=0;t<2;t++) // RP or POI\r
+ {\r
+ // 2D:\r
+ fNonEmptyBins2D[t] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",typeFlag[t].Data()));\r
+ fNonEmptyBins2D[t]->SetTitle(Form("Non-empty bins: %s (p_{t},#eta)",typeFlag[t].Data())); \r
+ fDFRType[t]->Add(fNonEmptyBins2D[t]); \r
+ // 1D:\r
+ fNonEmptyBins1D[t][0] = (TH1D*)styleHistPt.Clone(Form("%s, p_{t}",typeFlag[t].Data()));\r
+ fNonEmptyBins1D[t][0]->SetTitle(Form("Non-empty bins: %s (p_{t})",typeFlag[t].Data())); \r
+ fDFRType[t]->Add(fNonEmptyBins1D[t][0]); \r
+ fNonEmptyBins1D[t][1] = (TH1D*)styleHistEta.Clone(Form("%s, #eta",typeFlag[t].Data()));\r
+ fNonEmptyBins1D[t][1]->SetTitle(Form("Non-empty bins: %s (#eta)",typeFlag[t].Data())); \r
+ fDFRType[t]->Add(fNonEmptyBins1D[t][1]); \r
+ \r
+ for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used or used\r
+ {\r
+ for(Int_t eW=0;eW<2;eW++)\r
+ {\r
+ // correlations:\r
+ for(Int_t correlIndex=0;correlIndex<4;correlIndex++)\r
+ {\r
+ // 2D:\r
+ fFinalCorrelations2D[t][pW][eW][correlIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correlationName[correlIndex].Data()));\r
+ fFinalCorrelations2D[t][pW][eW][correlIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correlationName[correlIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations2D[t][pW][eW][correlIndex]); \r
+ // 1D:\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta:\r
+ {\r
+ if(pe==0) \r
+ { \r
+ fFinalCorrelations1D[t][pW][eW][pe][correlIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correlationName[correlIndex].Data()));\r
+ fFinalCorrelations1D[t][pW][eW][pe][correlIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correlationName[correlIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlIndex]); \r
+ }\r
+ if(pe==1)\r
+ {\r
+ fFinalCorrelations1D[t][pW][eW][pe][correlIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correlationName[correlIndex].Data()));\r
+ fFinalCorrelations1D[t][pW][eW][pe][correlIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correlationName[correlIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlIndex]); \r
+ } \r
+ } \r
+ } \r
+ // corrections:\r
+ for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)\r
+ {\r
+ // 2D:\r
+ fFinalCorrections2D[t][pW][eW][correctionIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data()));\r
+ fFinalCorrections2D[t][pW][eW][correctionIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections2D[t][pW][eW][correctionIndex]); \r
+ // 1D:\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta:\r
+ {\r
+ if(pe==0) \r
+ { \r
+ fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correctionName[correctionIndex].Data()));\r
+ fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]); \r
+ }\r
+ if(pe==1)\r
+ {\r
+ fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correctionName[correctionIndex].Data()));\r
+ fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]); \r
+ } \r
+ } \r
+ }\r
+ // covariances:\r
+ for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)\r
+ {\r
+ // 2D:\r
+ fFinalCovariances2D[t][pW][eW][covarianceIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data()));\r
+ fFinalCovariances2D[t][pW][eW][covarianceIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances2D[t][pW][eW][covarianceIndex]); \r
+ // 1D:\r
+ for(Int_t pe=0;pe<2;pe++) // pt or eta:\r
+ {\r
+ if(pe==0) \r
+ { \r
+ fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data()));\r
+ fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]); \r
+ }\r
+ if(pe==1)\r
+ {\r
+ fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",covarianceName[covarianceIndex].Data()));\r
+ fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())); \r
+ fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]); \r
+ } \r
+ } \r
+ }\r
+ for(Int_t nua=0;nua<2;nua++) // corrected or not \r
+ {\r
+ // cumulants:\r
+ for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)\r
+ {\r
+ // 2D:\r
+ fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data()));\r
+ fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())); \r
+ fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]); \r
+ // pt:\r
+ fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data()));\r
+ fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())); \r
+ fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]); \r
+ // eta: \r
+ fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",cumulantName[cumulantIndex].Data()));\r
+ fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())); \r
+ fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]); \r
+ } \r
+ // flow:\r
+ for(Int_t flowIndex=0;flowIndex<4;flowIndex++)\r
+ {\r
+ // 2D:\r
+ fFinalFlow2D[t][pW][eW][nua][flowIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data()));\r
+ fFinalFlow2D[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())); \r
+ fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlow2D[t][pW][eW][nua][flowIndex]); \r
+ // pt: \r
+ fFinalFlowPt[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",flowName[flowIndex].Data()));\r
+ fFinalFlowPt[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())); \r
+ fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowPt[t][pW][eW][nua][flowIndex]); \r
+ // eta:\r
+ fFinalFlowEta[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",flowName[flowIndex].Data()));\r
+ fFinalFlowEta[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())); \r
+ fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowEta[t][pW][eW][nua][flowIndex]); \r
+ }\r
+ } \r
+ } \r
+ } \r
+ } \r
+ \r
+ \r
+\r
+ */ \r
+ \r
+ \r
+\r
+ \r
+} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+/*\r
+void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)\r
+{\r
+ // Calculate final corrections for non-uniform acceptance for Q-cumulants.\r
+ \r
+ // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,\r
+ // binning of fCorrectionsForNUA is organized as follows:\r
+ //\r
+ // 1st bin: correction to QC{2}\r
+ // 2nd bin: correction to QC{4}\r
+ // 3rd bin: correction to QC{6}\r
+ // 4th bin: correction to QC{8}\r
+ \r
+ // shortcuts flags:\r
+ Int_t pW = (Int_t)(useParticleWeights);\r
+ \r
+ Int_t eW = -1;\r
+ \r
+ if(eventWeights == "exact")\r
+ {\r
+ eW = 0;\r
+ }\r
+\r
+ for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag\r
+ {\r
+ if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))\r
+ {\r
+ cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;\r
+ cout<<"pW = "<<pW<<endl;\r
+ cout<<"eW = "<<eW<<endl;\r
+ cout<<"sc = "<<sc<<endl;\r
+ exit(0);\r
+ }\r
+ } \r
+\r
+ // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):\r
+ Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>\r
+ //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>\r
+ //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>\r
+ //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>\r
+ \r
+ // correction terms to QC{2}:\r
+ // <<cos(n*phi1)>>^2\r
+ Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2); \r
+ // <<sin(n*phi1)>>^2\r
+ Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2); \r
+ // final corrections for non-uniform acceptance to QC{2}:\r
+ Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;\r
+ fCorrections[pW][eW]->SetBinContent(1,correctionQC2); \r
+ \r
+ // correction terms to QC{4}:\r
+ // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>\r
+ Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3); \r
+ // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>\r
+ Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3); \r
+ // <<cos(n*(phi1+phi2))>>^2\r
+ Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2); \r
+ // <<sin(n*(phi1+phi2))>>^2\r
+ Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2); \r
+ // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)\r
+ Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)\r
+ * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));\r
+ // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>\r
+ Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)\r
+ * fQCorrections[pW][eW][1]->GetBinContent(1)\r
+ * fQCorrections[pW][eW][0]->GetBinContent(1); \r
+ // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)\r
+ Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2)); \r
+ // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2\r
+ Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2); \r
+ // final correction to QC{4}:\r
+ Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm\r
+ + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm; \r
+ fCorrections[pW][eW]->SetBinContent(2,correctionQC4); \r
+\r
+ // ... to be improved (continued for 6th and 8th order) \r
+\r
+\r
+} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()\r
+*/\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()\r
+{\r
+ // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).\r
+ \r
+ // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):\r
+ Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
+ Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
+ //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>\r
+ //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>\r
+ \r
+ // statistical error of measured 2-, 4-, 6- and 8-particle correlations:\r
+ //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>\r
+ //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>\r
+ //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>\r
+ //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>\r
+\r
+ // QC{2}:\r
+ // <<cos(n*phi1)>>^2\r
+ Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2); \r
+ //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2); \r
+ // <<sin(n*phi1)>>^2\r
+ Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2); \r
+ //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2); \r
+ // generalized QC{2}:\r
+ Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)\r
+ fIntFlowQcumulants->SetBinContent(1,gQC2); \r
+ //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error) \r
+ \r
+ // QC{4}:\r
+ // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>\r
+ Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)\r
+ * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); \r
+ // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>\r
+ Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)\r
+ * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); \r
+ // <<cos(n*(phi1+phi2))>>^2\r
+ Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2); \r
+ // <<sin(n*(phi1+phi2))>>^2\r
+ Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2); \r
+ // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)\r
+ Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)\r
+ * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
+ - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));\r
+ // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>\r
+ Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)\r
+ * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)\r
+ * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); \r
+ // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)\r
+ Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
+ + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2)); \r
+ // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2\r
+ Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
+ + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2); \r
+ // generalized QC{4}:\r
+ Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm\r
+ - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm; \r
+ fIntFlowQcumulants->SetBinContent(2,gQC4); \r
+ //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error) \r
+\r
+ // ... to be improved (continued for 6th and 8th order) \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()\r
+{\r
+ // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).\r
+ \r
+ // to be improved: add protection for NULL pointers, propagate statistical errors from \r
+ // measured correlations and correction terms\r
+ \r
+ // generalized Q-cumulants:\r
+ Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2} \r
+ Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4} \r
+ //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6} \r
+ //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}\r
+ \r
+ // integrated flow estimates:\r
+ Double_t v2 = 0.; // v{2,QC} \r
+ Double_t v4 = 0.; // v{4,QC} \r
+ //Double_t v6 = 0.; // v{6,QC} \r
+ //Double_t v8 = 0.; // v{8,QC}\r
+\r
+ // calculate integrated flow estimates from generalized Q-cumulants: \r
+ if(qc2>=0.) v2 = pow(qc2,1./2.); \r
+ if(qc4<=0.) v4 = pow(-1.*qc4,1./4.); \r
+ //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.); \r
+ //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.); \r
+\r
+ // store integrated flow estimates from generalized Q-cumulants:\r
+ fIntFlow->SetBinContent(1,v2);\r
+ fIntFlow->SetBinContent(2,v4);\r
+ //fIntFlow->SetBinContent(3,v6);\r
+ //fIntFlow->SetBinContent(4,v8);\r
+\r
+} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()\r
+\r
+ \r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow() \r
+{\r
+ // From profile fIntFlowCorrectionTermsForNUAPro[2] access measured corretion terms\r
+ // and their spread, correctly calculate the statistical errors and store the final \r
+ // results and statistical errors for correction terms in histogram fIntFlowCorrectionTermsForNUAHist[2].\r
+ //\r
+ // Remark: Statistical error of correction temrs is calculated as:\r
+ //\r
+ // statistical error = termA * spread * termB:\r
+ // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)\r
+ // termB = 1/sqrt(1-termA^2) \r
+ \r
+ /* // to be improved (implement protection here)\r
+ for(Int_t power=0;power<2;power++)\r
+ { \r
+ if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power])) \r
+ {\r
+ cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
+ cout<<"power = "<<power<<endl;\r
+ exit(0);\r
+ }\r
+ }\r
+ */\r
+ \r
+ for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms \r
+ {\r
+ for(Int_t ci=1;ci<=10;ci++) // correction term index\r
+ {\r
+ Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);\r
+ //Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);\r
+ //Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);\r
+ //Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);\r
+ //Double_t termA = 0.;\r
+ //Double_t termB = 0.;\r
+ //if(sumOfLinearEventWeights)\r
+ //{\r
+ // termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;\r
+ //} else\r
+ // {\r
+ // cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;\r
+ // cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
+ // }\r
+ /*\r
+ if(1.-pow(termA,2.) > 0.)\r
+ {\r
+ termB = 1./pow(1-pow(termA,2.),0.5);\r
+ } else\r
+ {\r
+ cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl; \r
+ cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
+ } \r
+ Double_t statisticalError = termA * spread * termB;\r
+ */\r
+ fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);\r
+ //fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);\r
+ } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index\r
+ } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms \r
+ \r
+} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms(TList *outputListHistos)\r
+{\r
+ // Get pointers to all objects relevant for calculations with nested loops.\r
+\r
+ // to be improved: harwired names for some objects here (fix this in paralel with method BookEverythingForNestedLoops())\r
+ \r
+ if(outputListHistos)\r
+ {\r
+ TList *nestedLoopsList = dynamic_cast<TList*>(outputListHistos->FindObject("Nested Loops"));\r
+ if(nestedLoopsList) \r
+ {\r
+ this->SetNestedLoopsList(nestedLoopsList);\r
+ } else\r
+ {\r
+ cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+ TString evaluateNestedLoopsName = "fEvaluateNestedLoops";\r
+ evaluateNestedLoopsName += fAnalysisLabel->Data(); \r
+ TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));\r
+ Bool_t bEvaluateNestedLoopsForIntFlow = kFALSE;\r
+ Bool_t bEvaluateNestedLoopsForDiffFlow = kFALSE;\r
+ if(evaluateNestedLoops)\r
+ {\r
+ this->SetEvaluateNestedLoops(evaluateNestedLoops);\r
+ bEvaluateNestedLoopsForIntFlow = (Int_t)evaluateNestedLoops->GetBinContent(1);\r
+ bEvaluateNestedLoopsForDiffFlow = (Int_t)evaluateNestedLoops->GetBinContent(2);\r
+ }\r
+ // nested loops relevant for integrated flow: \r
+ if(bEvaluateNestedLoopsForIntFlow)\r
+ {\r
+ TProfile *directCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelation"));\r
+ if(directCorrelations) this->SetDirectCorrelations(directCorrelations);\r
+ TProfile *directCorrectionsCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCos"));\r
+ if(directCorrectionsCos) this->SetDirectCorrectionsCos(directCorrectionsCos);\r
+ TProfile *directCorrectionsSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSin"));\r
+ if(directCorrectionsSin) this->SetDirectCorrectionsSin(directCorrectionsSin);\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) // to be improved (this is a weak point, because now this method MUST be called after GPFWG where these booleans are set)\r
+ {\r
+ TProfile *directCorrelationsW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationW"));\r
+ if(directCorrelationsW) this->SetDirectCorrelationsW(directCorrelationsW);\r
+ TProfile *directCorrectionsCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCosW"));\r
+ if(directCorrectionsCosW) this->SetDirectCorrectionsCosW(directCorrectionsCosW);\r
+ TProfile *directCorrectionsSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSinW")); \r
+ if(directCorrectionsSinW) this->SetDirectCorrectionsSinW(directCorrectionsSinW);\r
+ }\r
+ }\r
+ // nested loops relevant for differential flow: \r
+ if(bEvaluateNestedLoopsForDiffFlow)\r
+ {\r
+ TProfile *directCorrelationsDiffFlow = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlow"));\r
+ if(directCorrelationsDiffFlow) this->SetDirectCorrelationsDiffFlow(directCorrelationsDiffFlow);\r
+ TProfile *directCorrectionsDiffFlowCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCos"));\r
+ if(directCorrectionsDiffFlowCos) this->SetDirectCorrectionsDiffFlowCos(directCorrectionsDiffFlowCos);\r
+ TProfile *directCorrectionsDiffFlowSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSin"));\r
+ if(directCorrectionsDiffFlowSin) this->SetDirectCorrectionsDiffFlowSin(directCorrectionsDiffFlowSin);\r
+ if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) // to be improved (this is a weak point, because now this method MUST be called after GPFWG where these booleans are set)\r
+ {\r
+ TProfile *directCorrelationsDiffFlowW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlowW")); \r
+ if(directCorrelationsDiffFlowW) this->SetDirectCorrelationsDiffFlowW(directCorrelationsDiffFlowW);\r
+ TProfile *directCorrectionsDiffFlowCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCosW"));\r
+ if(directCorrectionsDiffFlowCosW) this->SetDirectCorrectionsDiffFlowCosW(directCorrectionsDiffFlowCosW);\r
+ TProfile *directCorrectionsDiffFlowSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSinW"));\r
+ if(directCorrectionsDiffFlowSinW) this->SetDirectCorrectionsDiffFlowSinW(directCorrectionsDiffFlowSinW);\r
+ }\r
+ } // end of if(bEvaluateNestedLoopsForDiffFlow)\r
+ } else\r
+ {\r
+ cout<<"WARNING: outputListHistos is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
+ exit(0);\r
+ }\r
+\r
+} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms(TList *outputListHistos)\r
+\r
+\r
+//================================================================================================================================\r
+\r
+\r
+void AliFlowAnalysisWithQCumulants::StoreHarmonic()\r
+{\r
+ // Store flow harmonic in common control histograms.\r
+\r
+ (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);\r
+ (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);\r
+ (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);\r
+ (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);\r
+ (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);\r
+\r
+} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()\r
+\r
+\r
+\r