]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
Updated trigger study class for normalization studies in pp@7TeV
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithQCumulants.cxx
CommitLineData
489d5531 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/**********************************
17 * flow analysis with Q-cumulants *
18 * *
ff70ca91 19 * author: Ante Bilandzic *
20 * (abilandzic@gmail.com) *
489d5531 21 *********************************/
22
23#define AliFlowAnalysisWithQCumulants_cxx
24
25#include "Riostream.h"
26#include "AliFlowCommonConstants.h"
27#include "AliFlowCommonHist.h"
28#include "AliFlowCommonHistResults.h"
29#include "TChain.h"
30
31#include "TFile.h"
32#include "TList.h"
33#include "TGraph.h"
34#include "TParticle.h"
35#include "TRandom3.h"
36#include "TStyle.h"
37#include "TProfile.h"
38#include "TProfile2D.h"
489d5531 39#include "TMath.h"
40#include "TArrow.h"
41#include "TPaveLabel.h"
42#include "TCanvas.h"
43#include "AliFlowEventSimple.h"
44#include "AliFlowTrackSimple.h"
45#include "AliFlowAnalysisWithQCumulants.h"
46#include "TArrayD.h"
47#include "TRandom.h"
48#include "TF1.h"
49
50class TH1;
51class TH2;
52class TGraph;
53class TPave;
54class TLatex;
55class TMarker;
56class TRandom3;
57class TObjArray;
58class TList;
59class TCanvas;
60class TSystem;
61class TROOT;
62class AliFlowVector;
63class TVector;
64
489d5531 65//================================================================================================================
66
489d5531 67ClassImp(AliFlowAnalysisWithQCumulants)
68
69AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
70 // 0.) base:
71 fHistList(NULL),
72 // 1.) common:
73 fCommonHists(NULL),
74 fCommonHists2nd(NULL),
75 fCommonHists4th(NULL),
76 fCommonHists6th(NULL),
77 fCommonHists8th(NULL),
78 fCommonHistsResults2nd(NULL),
79 fCommonHistsResults4th(NULL),
80 fCommonHistsResults6th(NULL),
81 fCommonHistsResults8th(NULL),
82 fnBinsPhi(0),
83 fPhiMin(0),
84 fPhiMax(0),
85 fPhiBinWidth(0),
86 fnBinsPt(0),
87 fPtMin(0),
88 fPtMax(0),
89 fPtBinWidth(0),
90 fnBinsEta(0),
91 fEtaMin(0),
92 fEtaMax(0),
93 fEtaBinWidth(0),
1268c371 94 fCommonConstants(NULL),
dd442cd2 95 fFillMultipleControlHistograms(kFALSE),
489d5531 96 fHarmonic(2),
97 fAnalysisLabel(NULL),
98 // 2a.) particle weights:
99 fWeightsList(NULL),
100 fUsePhiWeights(kFALSE),
101 fUsePtWeights(kFALSE),
102 fUseEtaWeights(kFALSE),
103 fUseParticleWeights(NULL),
104 fPhiWeights(NULL),
105 fPtWeights(NULL),
106 fEtaWeights(NULL),
107 // 2b.) event weights:
108 fMultiplicityWeight(NULL),
109 // 3.) integrated flow:
110 fIntFlowList(NULL),
111 fIntFlowProfiles(NULL),
112 fIntFlowResults(NULL),
113 fIntFlowFlags(NULL),
b92ea2b9 114 fApplyCorrectionForNUA(kFALSE),
2001bc3a 115 fApplyCorrectionForNUAVsM(kFALSE),
9da1a4f3 116 fnBinsMult(10000),
067e9bc8 117 fMinMult(0.),
118 fMaxMult(10000.),
b77b6434 119 fPropagateErrorAlsoFromNIT(kFALSE),
8ed4edc7 120 fCalculateCumulantsVsM(kFALSE),
0dd3b008 121 fMinimumBiasReferenceFlow(kTRUE),
e5834fcb 122 fForgetAboutCovariances(kFALSE),
123 fStorePhiDistributionForOneEvent(kFALSE),
489d5531 124 fReQ(NULL),
125 fImQ(NULL),
1268c371 126 fSpk(NULL),
489d5531 127 fIntFlowCorrelationsEBE(NULL),
128 fIntFlowEventWeightsForCorrelationsEBE(NULL),
129 fIntFlowCorrelationsAllEBE(NULL),
e5834fcb 130 fReferenceMultiplicityEBE(0.),
489d5531 131 fAvMultiplicity(NULL),
132 fIntFlowCorrelationsPro(NULL),
b40a910e 133 fIntFlowSquaredCorrelationsPro(NULL),
489d5531 134 fIntFlowCorrelationsAllPro(NULL),
135 fIntFlowExtraCorrelationsPro(NULL),
136 fIntFlowProductOfCorrelationsPro(NULL),
0328db2d 137 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
489d5531 138 fIntFlowCorrelationsHist(NULL),
139 fIntFlowCorrelationsAllHist(NULL),
140 fIntFlowCovariances(NULL),
141 fIntFlowSumOfProductOfEventWeights(NULL),
0328db2d 142 fIntFlowCovariancesNUA(NULL),
143 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
489d5531 144 fIntFlowQcumulants(NULL),
b92ea2b9 145 fIntFlowQcumulantsRebinnedInM(NULL),
146 fIntFlowQcumulantsErrorSquaredRatio(NULL),
489d5531 147 fIntFlow(NULL),
b3dacf6b 148 fIntFlowRebinnedInM(NULL),
2001bc3a 149 fIntFlowDetectorBias(NULL),
489d5531 150 // 4.) differential flow:
151 fDiffFlowList(NULL),
152 fDiffFlowProfiles(NULL),
153 fDiffFlowResults(NULL),
1268c371 154 fDiffFlow2D(NULL),
489d5531 155 fDiffFlowFlags(NULL),
1268c371 156 fCalculateDiffFlow(kTRUE),
157 fCalculate2DDiffFlow(kFALSE),
489d5531 158 // 5.) distributions:
57340a27 159 fDistributionsList(NULL),
160 fDistributionsFlags(NULL),
489d5531 161 fStoreDistributions(kFALSE),
e5834fcb 162 // 6.) various:
163 fVariousList(NULL),
164 fPhiDistributionForOneEvent(NULL),
489d5531 165 // x.) debugging and cross-checking:
166 fNestedLoopsList(NULL),
167 fEvaluateIntFlowNestedLoops(kFALSE),
168 fEvaluateDiffFlowNestedLoops(kFALSE),
169 fMaxAllowedMultiplicity(10),
170 fEvaluateNestedLoops(NULL),
171 fIntFlowDirectCorrelations(NULL),
172 fIntFlowExtraDirectCorrelations(NULL),
173 fCrossCheckInPtBinNo(10),
3b552efe 174 fCrossCheckInEtaBinNo(20),
489d5531 175 fNoOfParticlesInBin(NULL)
176 {
177 // constructor
178
179 // base list to hold all output objects:
180 fHistList = new TList();
181 fHistList->SetName("cobjQC");
182 fHistList->SetOwner(kTRUE);
183
184 // list to hold histograms with phi, pt and eta weights:
185 fWeightsList = new TList();
186
187 // multiplicity weight:
188 fMultiplicityWeight = new TString("combinations");
189
190 // analysis label;
191 fAnalysisLabel = new TString();
192
193 // initialize all arrays:
194 this->InitializeArraysForIntFlow();
195 this->InitializeArraysForDiffFlow();
196 this->InitializeArraysForDistributions();
e5834fcb 197 this->InitializeArraysForVarious();
489d5531 198 this->InitializeArraysForNestedLoops();
199
200 } // end of constructor
201
489d5531 202//================================================================================================================
203
489d5531 204AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
205{
206 // destructor
207
208 delete fHistList;
209
210} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
211
489d5531 212//================================================================================================================
213
489d5531 214void AliFlowAnalysisWithQCumulants::Init()
215{
3b552efe 216 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 217 // b) Access all common constants;
218 // c) Book all objects;
3b552efe 219 // d) Store flags for integrated and differential flow;
489d5531 220 // e) Store flags for distributions of corelations;
221 // f) Store harmonic which will be estimated.
3b552efe 222
489d5531 223 //save old value and prevent histograms from being added to directory
224 //to avoid name clashes in case multiple analaysis objects are used
225 //in an analysis
226 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
227 TH1::AddDirectory(kFALSE);
228
3b552efe 229 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 230 this->CrossCheckSettings();
1268c371 231 // b) Access all common constants and book a profile to hold them:
232 this->CommonConstants("Init");
489d5531 233 // c) Book all objects:
1268c371 234 this->BookAndFillWeightsHistograms();
489d5531 235 this->BookAndNestAllLists();
236 this->BookCommonHistograms();
237 this->BookEverythingForIntegratedFlow();
238 this->BookEverythingForDifferentialFlow();
1268c371 239 this->BookEverythingFor2DDifferentialFlow();
489d5531 240 this->BookEverythingForDistributions();
e5834fcb 241 this->BookEverythingForVarious();
489d5531 242 this->BookEverythingForNestedLoops();
243 // d) Store flags for integrated and differential flow:
244 this->StoreIntFlowFlags();
3b552efe 245 this->StoreDiffFlowFlags();
489d5531 246 // e) Store flags for distributions of corelations:
247 this->StoreFlagsForDistributions();
248 // f) Store harmonic which will be estimated:
249 this->StoreHarmonic();
250
251 TH1::AddDirectory(oldHistAddStatus);
252} // end of void AliFlowAnalysisWithQCumulants::Init()
253
489d5531 254//================================================================================================================
255
489d5531 256void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
257{
258 // Running over data only in this method.
259
b3dacf6b 260 // a) Check all pointers used in this method;
261 // b) Define local variables;
262 // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
1268c371 263 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k};
264 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!);
265 // f) Call the methods which calculate correlations for reference flow;
266 // g) Call the methods which calculate correlations for differential flow;
267 // h) Call the methods which calculate correlations for 2D differential flow;
268 // i) Distributions of correlations;
269 // j) Store phi distribution for one event to illustrate flow;
270 // k) Cross-check with nested loops correlators for reference flow;
271 // l) Cross-check with nested loops correlators for differential flow;
272 // m) Reset all event-by-event quantities (very important !!!!).
489d5531 273
b3dacf6b 274 // a) Check all pointers used in this method:
275 this->CheckPointersUsedInMake();
276
277 // b) Define local variables:
489d5531 278 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
279 Double_t dPt = 0.; // transverse momentum
280 Double_t dEta = 0.; // pseudorapidity
489d5531 281 Double_t wPhi = 1.; // phi weight
282 Double_t wPt = 1.; // pt weight
283 Double_t wEta = 1.; // eta weight
38a1e8b3 284 Double_t wTrack = 1.; // track weight
1268c371 285 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of reference particles)
e5834fcb 286 fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
1268c371 287 Double_t ptEta[2] = {0.,0.}; // 0 = dPt, 1 = dEta
9f33751d 288
b3dacf6b 289 // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
489d5531 290 this->FillCommonControlHistograms(anEvent);
291 this->FillAverageMultiplicities(nRP);
292
1268c371 293 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k}:
9f33751d 294 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
1268c371 295 // nRP = # of reference particles;
296 // nPOI = # of particles of interest.
489d5531 297 AliFlowTrackSimple *aftsTrack = NULL;
1268c371 298 Int_t n = fHarmonic; // shortcut for the harmonic
489d5531 299 for(Int_t i=0;i<nPrim;i++)
300 {
301 aftsTrack=anEvent->GetTrack(i);
302 if(aftsTrack)
303 {
1268c371 304 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())){continue;} // safety measure: consider only tracks which are RPs or POIs
489d5531 305 if(aftsTrack->InRPSelection()) // RP condition:
306 {
307 dPhi = aftsTrack->Phi();
308 dPt = aftsTrack->Pt();
309 dEta = aftsTrack->Eta();
310 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
311 {
312 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
313 }
314 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
315 {
316 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
317 }
318 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
319 {
320 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
38a1e8b3 321 }
322 // Access track weight:
323 wTrack = aftsTrack->Weight();
1268c371 324 // Calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}] for this event (m = 1,2,...,6, k = 0,1,...,8):
325 for(Int_t m=0;m<6;m++) // to be improved - hardwired 6
489d5531 326 {
1268c371 327 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 328 {
38a1e8b3 329 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1)*n*dPhi);
330 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1)*n*dPhi);
489d5531 331 }
332 }
1268c371 333 // Calculate S_{p,k} for this event (Remark: final calculation of S_{p,k} follows after the loop over data bellow):
489d5531 334 for(Int_t p=0;p<8;p++)
335 {
336 for(Int_t k=0;k<9;k++)
337 {
38a1e8b3 338 (*fSpk)(p,k)+=pow(wPhi*wPt*wEta*wTrack,k);
489d5531 339 }
340 }
1268c371 341 // Differential flow:
342 if(fCalculateDiffFlow || fCalculate2DDiffFlow)
489d5531 343 {
1268c371 344 ptEta[0] = dPt;
345 ptEta[1] = dEta;
346 // Calculate r_{m*n,k} and s_{p,k} (r_{m,k} is 'p-vector' for RPs):
347 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 348 {
1268c371 349 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 350 {
1268c371 351 if(fCalculateDiffFlow)
352 {
353 for(Int_t pe=0;pe<2;pe++) // pt or eta
354 {
38a1e8b3 355 fReRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
356 fImRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 357 if(m==0) // s_{p,k} does not depend on index m
358 {
38a1e8b3 359 fs1dEBE[0][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 360 } // end of if(m==0) // s_{p,k} does not depend on index m
361 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
362 } // end of if(fCalculateDiffFlow)
363 if(fCalculate2DDiffFlow)
364 {
38a1e8b3 365 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
366 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 367 if(m==0) // s_{p,k} does not depend on index m
368 {
38a1e8b3 369 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 370 } // end of if(m==0) // s_{p,k} does not depend on index m
371 } // end of if(fCalculate2DDiffFlow)
372 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
373 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
374 // Checking if RP particle is also POI particle:
375 if(aftsTrack->InPOISelection())
489d5531 376 {
1268c371 377 // Calculate q_{m*n,k} and s_{p,k} ('q-vector' and 's' for RPs && POIs):
378 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 379 {
1268c371 380 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 381 {
1268c371 382 if(fCalculateDiffFlow)
383 {
384 for(Int_t pe=0;pe<2;pe++) // pt or eta
385 {
38a1e8b3 386 fReRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
387 fImRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 388 if(m==0) // s_{p,k} does not depend on index m
389 {
38a1e8b3 390 fs1dEBE[2][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 391 } // end of if(m==0) // s_{p,k} does not depend on index m
392 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
393 } // end of if(fCalculateDiffFlow)
394 if(fCalculate2DDiffFlow)
395 {
38a1e8b3 396 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
397 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 398 if(m==0) // s_{p,k} does not depend on index m
399 {
38a1e8b3 400 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 401 } // end of if(m==0) // s_{p,k} does not depend on index m
402 } // end of if(fCalculate2DDiffFlow)
403 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
404 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
405 } // end of if(aftsTrack->InPOISelection())
406 } // end of if(fCalculateDiffFlow || fCalculate2DDiffFlow)
489d5531 407 } // end of if(pTrack->InRPSelection())
489d5531 408 if(aftsTrack->InPOISelection())
409 {
410 dPhi = aftsTrack->Phi();
411 dPt = aftsTrack->Pt();
412 dEta = aftsTrack->Eta();
38a1e8b3 413 wPhi = 1.;
414 wPt = 1.;
415 wEta = 1.;
416 wTrack = 1.;
417 if(fUsePhiWeights && fPhiWeights && fnBinsPhi && aftsTrack->InRPSelection()) // determine phi weight for POI && RP particle:
418 {
419 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
420 }
421 if(fUsePtWeights && fPtWeights && fnBinsPt && aftsTrack->InRPSelection()) // determine pt weight for POI && RP particle:
422 {
423 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
424 }
425 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth && aftsTrack->InRPSelection()) // determine eta weight for POI && RP particle:
426 {
427 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
428 }
429 // Access track weight for POI && RP particle:
430 if(aftsTrack->InRPSelection())
431 {
432 wTrack = aftsTrack->Weight();
433 }
1268c371 434 ptEta[0] = dPt;
435 ptEta[1] = dEta;
436 // Calculate p_{m*n,k} ('p-vector' for POIs):
437 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 438 {
1268c371 439 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 440 {
1268c371 441 if(fCalculateDiffFlow)
442 {
443 for(Int_t pe=0;pe<2;pe++) // pt or eta
444 {
38a1e8b3 445 fReRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
446 fImRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 447 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
448 } // end of if(fCalculateDiffFlow)
449 if(fCalculate2DDiffFlow)
450 {
38a1e8b3 451 fReRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
452 fImRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 453 } // end of if(fCalculate2DDiffFlow)
454 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
455 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
b77b6434 456 } // end of if(pTrack->InPOISelection())
489d5531 457 } else // to if(aftsTrack)
458 {
38a1e8b3 459 printf("\n WARNING (QC): No particle (i.e. aftsTrack is a NULL pointer in AFAWQC::Make())!!!!\n\n");
489d5531 460 }
461 } // end of for(Int_t i=0;i<nPrim;i++)
462
1268c371 463 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!):
489d5531 464 for(Int_t p=0;p<8;p++)
465 {
466 for(Int_t k=0;k<9;k++)
467 {
1268c371 468 (*fSpk)(p,k)=pow((*fSpk)(p,k),p+1);
469 // ... for the time being s_{p,k} dosn't need higher powers, so no need to finalize it here ...
470 } // end of for(Int_t k=0;k<9;k++)
471 } // end of for(Int_t p=0;p<8;p++)
489d5531 472
1268c371 473 // f) Call the methods which calculate correlations for reference flow:
489d5531 474 if(!fEvaluateIntFlowNestedLoops)
475 {
476 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
477 {
1268c371 478 if(nRP>1){this->CalculateIntFlowCorrelations();} // without using particle weights
0328db2d 479 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 480 {
1268c371 481 if(nRP>1){this->CalculateIntFlowCorrelationsUsingParticleWeights();} // with using particle weights
482 }
483 // Whether or not using particle weights the following is calculated in the same way:
484 if(nRP>3){this->CalculateIntFlowProductOfCorrelations();}
485 if(nRP>1){this->CalculateIntFlowSumOfEventWeights();}
486 if(nRP>1){this->CalculateIntFlowSumOfProductOfEventWeights();}
487 // Non-isotropic terms:
b92ea2b9 488 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 489 {
1268c371 490 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTerms();}
491 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTerms();}
b92ea2b9 492 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
493 {
1268c371 494 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();}
495 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();}
496 }
497 // Whether or not using particle weights the following is calculated in the same way:
498 if(nRP>0){this->CalculateIntFlowProductOfCorrectionTermsForNUA();}
499 if(nRP>0){this->CalculateIntFlowSumOfEventWeightsNUA();}
500 if(nRP>0){this->CalculateIntFlowSumOfProductOfEventWeightsNUA();}
489d5531 501 } // end of if(!fEvaluateIntFlowNestedLoops)
502
1268c371 503 // g) Call the methods which calculate correlations for differential flow:
504 if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 505 {
506 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
507 {
1268c371 508 // Without using particle weights:
489d5531 509 this->CalculateDiffFlowCorrelations("RP","Pt");
510 this->CalculateDiffFlowCorrelations("RP","Eta");
511 this->CalculateDiffFlowCorrelations("POI","Pt");
57340a27 512 this->CalculateDiffFlowCorrelations("POI","Eta");
1268c371 513 // Non-isotropic terms:
b92ea2b9 514 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
515 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
516 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
517 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
518 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
519 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
520 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
521 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
489d5531 522 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
523 {
1268c371 524 // With using particle weights:
489d5531 525 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
526 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
527 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
528 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
1268c371 529 // Non-isotropic terms:
b92ea2b9 530 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
531 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
532 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
533 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
534 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
535 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
536 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
537 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
1268c371 538 }
539 // Whether or not using particle weights the following is calculated in the same way:
489d5531 540 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
541 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
542 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
543 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
544 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
545 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
546 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
547 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
548 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
549 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
550 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
551 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
1268c371 552 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 553
1268c371 554 // h) Call the methods which calculate correlations for 2D differential flow:
555 if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
556 {
557 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 558 {
1268c371 559 // Without using particle weights:
560 this->Calculate2DDiffFlowCorrelations("RP");
561 this->Calculate2DDiffFlowCorrelations("POI");
562 // Non-isotropic terms:
563 // ... to be ctd ...
564 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
565 {
566 // With using particle weights:
567 // ... to be ctd ...
568 // Non-isotropic terms:
569 // ... to be ctd ...
570 }
571 // Whether or not using particle weights the following is calculated in the same way:
572 // ... to be ctd ...
573 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
574
575 // i) Distributions of correlations:
e5834fcb 576 if(fStoreDistributions){this->StoreDistributionsOfCorrelations();}
577
1268c371 578 // j) Store phi distribution for one event to illustrate flow:
e5834fcb 579 if(fStorePhiDistributionForOneEvent){this->StorePhiDistributionForOneEvent(anEvent);}
1268c371 580
581 // k) Cross-check with nested loops correlators for reference flow:
582 if(fEvaluateIntFlowNestedLoops){this->EvaluateIntFlowNestedLoops(anEvent);}
583
584 // l) Cross-check with nested loops correlators for differential flow:
585 if(fEvaluateDiffFlowNestedLoops){this->EvaluateDiffFlowNestedLoops(anEvent);}
489d5531 586
1268c371 587 // m) Reset all event-by-event quantities (very important !!!!):
489d5531 588 this->ResetEventByEventQuantities();
589
590} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
591
489d5531 592//================================================================================================================================
593
489d5531 594void AliFlowAnalysisWithQCumulants::Finish()
595{
596 // Calculate the final results.
489d5531 597
b3dacf6b 598 // a) Check all pointers used in this method;
599 // b) Acces the constants;
600 // c) Access the flags;
b92ea2b9 601 // d) Calculate reference cumulants (not corrected for detector effects);
602 // e) Correct reference cumulants for detector effects;
603 // f) Calculate reference flow;
b77b6434 604 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
b92ea2b9 605 // h) Calculate the final results for differential flow (without/with weights);
606 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
607 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
608 // k) Store results for differential flow in AliFlowCommonHistResults;
609 // l) Print the final results for integrated flow (RP/POI) on the screen;
610 // m) Cross-checking: Results from Q-vectors vs results from nested loops.
b3dacf6b 611
612 // a) Check all pointers used in this method:
613 this->CheckPointersUsedInFinish();
614
615 // b) Acces the constants:
1268c371 616 this->CommonConstants("Finish");
489d5531 617
b3dacf6b 618 if(fCommonHists && fCommonHists->GetHarmonic()) // to be improved (moved somewhere else)
489d5531 619 {
b3dacf6b 620 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
489d5531 621 }
b3dacf6b 622
1268c371 623 // c) Access the flags: // to be improved (implement a method for this? should I store again the flags becose they can get modified with redoFinish?)
b3dacf6b 624 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
625 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
626 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
627 fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
628 fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
629 fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
630 fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
631 fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
632 fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
b77b6434 633 fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
0dd3b008 634 fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
635 fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
e5834fcb 636 fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
637 fStorePhiDistributionForOneEvent = (Bool_t)fIntFlowFlags->GetBinContent(13);
dd442cd2 638 fFillMultipleControlHistograms = (Bool_t)fIntFlowFlags->GetBinContent(14);
b3dacf6b 639 fEvaluateIntFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(1);
640 fEvaluateDiffFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(2);
489d5531 641 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
642 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
1268c371 643
b92ea2b9 644 // d) Calculate reference cumulants (not corrected for detector effects):
489d5531 645 this->FinalizeCorrelationsIntFlow();
646 this->CalculateCovariancesIntFlow();
647 this->CalculateCumulantsIntFlow();
489d5531 648
b92ea2b9 649 // e) Correct reference cumulants for detector effects:
650 this->FinalizeCorrectionTermsForNUAIntFlow();
651 this->CalculateCovariancesNUAIntFlow();
652 this->CalculateQcumulantsCorrectedForNUAIntFlow();
653
654 // f) Calculate reference flow:
655 this->CalculateReferenceFlow();
489d5531 656
b77b6434 657 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
489d5531 658 this->FillCommonHistResultsIntFlow();
b3dacf6b 659 if(fPrintFinalResults[0]){this->PrintFinalResultsForIntegratedFlow("RF");}
660 if(fPrintFinalResults[3] && fCalculateCumulantsVsM){this->PrintFinalResultsForIntegratedFlow("RF, rebinned in M");}
489d5531 661
1268c371 662 // h) Calculate the final results for differential flow (without/with weights):
663 if(fCalculateDiffFlow)
664 {
665 this->FinalizeReducedCorrelations("RP","Pt");
666 this->FinalizeReducedCorrelations("RP","Eta");
667 this->FinalizeReducedCorrelations("POI","Pt");
668 this->FinalizeReducedCorrelations("POI","Eta");
669 this->CalculateDiffFlowCovariances("RP","Pt");
670 this->CalculateDiffFlowCovariances("RP","Eta");
671 this->CalculateDiffFlowCovariances("POI","Pt");
672 this->CalculateDiffFlowCovariances("POI","Eta");
673 this->CalculateDiffFlowCumulants("RP","Pt");
674 this->CalculateDiffFlowCumulants("RP","Eta");
675 this->CalculateDiffFlowCumulants("POI","Pt");
676 this->CalculateDiffFlowCumulants("POI","Eta");
677 this->CalculateDiffFlow("RP","Pt");
678 this->CalculateDiffFlow("RP","Eta");
679 this->CalculateDiffFlow("POI","Pt");
680 this->CalculateDiffFlow("POI","Eta");
681 } // if(fCalculateDiffFlow)
682
683 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
684 if(fCalculateDiffFlow)
489d5531 685 {
686 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
687 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
688 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
689 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
690 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
691 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
692 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
693 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
1268c371 694 if(fApplyCorrectionForNUA)
695 {
696 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
697 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
698 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
699 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
700 }
701 } // end of if(fCalculateDiffFlow && fApplyCorrectionForNUA)
702
703 // i) Calcualate final results for 2D differential flow:
704 if(fCalculate2DDiffFlow)
705 {
706 this->Calculate2DDiffFlowCumulants("RP");
707 this->Calculate2DDiffFlowCumulants("POI");
708 this->Calculate2DDiffFlow("RP");
709 this->Calculate2DDiffFlow("POI");
710 } // end of if(fCalculate2DDiffFlow)
711
712 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
713 if(fCalculateDiffFlow)
714 {
715 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
716 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
3b552efe 717 }
489d5531 718
1268c371 719 // k) Store results for differential flow in AliFlowCommonHistResults:
720 if(fCalculateDiffFlow)
721 {
722 this->FillCommonHistResultsDiffFlow("RP");
723 this->FillCommonHistResultsDiffFlow("POI");
724 }
725
726 // l) Print the final results for integrated flow (RP/POI) on the screen:
727 if(fPrintFinalResults[1] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("RP");}
728 if(fPrintFinalResults[2] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("POI");}
729
730 // m) Cross-checking: Results from Q-vectors vs results from nested loops:
731 // m1) Reference flow:
489d5531 732 if(fEvaluateIntFlowNestedLoops)
733 {
734 this->CrossCheckIntFlowCorrelations();
735 this->CrossCheckIntFlowCorrectionTermsForNUA();
1268c371 736 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights){this->CrossCheckIntFlowExtraCorrelations();}
489d5531 737 } // end of if(fEvaluateIntFlowNestedLoops)
1268c371 738 // m2) Differential flow:
739 if(fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 740 {
b3dacf6b 741 // Correlations:
489d5531 742 this->PrintNumberOfParticlesInSelectedBin();
743 this->CrossCheckDiffFlowCorrelations("RP","Pt");
744 this->CrossCheckDiffFlowCorrelations("RP","Eta");
745 this->CrossCheckDiffFlowCorrelations("POI","Pt");
746 this->CrossCheckDiffFlowCorrelations("POI","Eta");
b3dacf6b 747 // Correction terms for non-uniform acceptance:
489d5531 748 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
749 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
750 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
751 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
752 } // end of if(fEvaluateDiffFlowNestedLoops)
753
754} // end of AliFlowAnalysisWithQCumulants::Finish()
755
489d5531 756//================================================================================================================================
757
1268c371 758void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
759{
760 // Evalauted all correlators for reference flow with nested loops.
761
762 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
763 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
764 {
765 // Without using particle weights:
766 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
767 {
768 // Correlations:
769 this->CalculateIntFlowCorrelations(); // from Q-vectors
770 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
771 // Correction for non-uniform acceptance:
772 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
773 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
774 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
775 }
776 // Using particle weights:
777 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
778 {
779 // Correlations
780 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
781 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
782 // Correction for non-uniform acceptance:
783 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
784 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
785 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
786 }
787 } else if(nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
788 {
789 cout<<endl;
790 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
791 } else
792 {
793 cout<<endl;
794 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
795 }
796
797} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
798
799//================================================================================================================================
800
801void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
802{
803 // Evalauted all correlators for differential flow with nested loops.
804
805 if(!fCalculateDiffFlow){return;}
806
807 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
808 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
809 {
810 // Without using particle weights:
811 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
812 {
813 // Reduced correlations:
814 // Q-vectors:
815 this->CalculateDiffFlowCorrelations("RP","Pt");
816 this->CalculateDiffFlowCorrelations("RP","Eta");
817 this->CalculateDiffFlowCorrelations("POI","Pt");
818 this->CalculateDiffFlowCorrelations("POI","Eta");
819 // Nested loops:
820 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
821 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
822 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
823 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
824 // Reduced corrections for non-uniform acceptance:
825 // Q-vectors:
826 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
827 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
828 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
829 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
830 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
831 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
832 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
833 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
834 // Nested loops:
835 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
836 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
837 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
838 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
839 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
840 // Using particle weights:
841 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
842 {
843 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
844 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
845 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
846 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
847 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
848 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
849 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
850 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
851 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
852 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
853 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
854 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
855 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
856 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
857 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
858 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
859 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
860 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
861 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
862 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
863 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
864 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
865
866} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
867
868//================================================================================================================================
869
489d5531 870void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
871{
b92ea2b9 872 // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
489d5531 873
874 // multiplicity:
1268c371 875 Double_t dMult = (*fSpk)(0,0);
489d5531 876
877 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
878 Double_t dReQ1n = (*fReQ)(0,0);
879 Double_t dReQ2n = (*fReQ)(1,0);
880 //Double_t dReQ3n = (*fReQ)(2,0);
881 //Double_t dReQ4n = (*fReQ)(3,0);
882 Double_t dImQ1n = (*fImQ)(0,0);
883 Double_t dImQ2n = (*fImQ)(1,0);
884 //Double_t dImQ3n = (*fImQ)(2,0);
885 //Double_t dImQ4n = (*fImQ)(3,0);
886
887 // *************************************************************
888 // **** corrections for non-uniform acceptance (cos terms): ****
889 // *************************************************************
890 //
891 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
892 // are stored in 1D profile fQCorrectionsCos.
893 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
894 // --------------------------------------------------------------------------------------------------------------------
895 // 1st bin: <<cos(n*(phi1))>> = cosP1n
896 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
897 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
898 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
899 // --------------------------------------------------------------------------------------------------------------------
900
901 // 1-particle:
902 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
903
904 if(dMult>0)
905 {
906 cosP1n = dReQ1n/dMult;
907
908 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
909 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
0328db2d 910 // event weights for NUA terms:
911 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
489d5531 912
913 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
914 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
b3dacf6b 915 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);}
489d5531 916 }
917
918 // 2-particle:
3b552efe 919 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
489d5531 920 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
921
922 if(dMult>1)
923 {
924 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
925 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
926
927 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
3b552efe 928 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
489d5531 929 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
0328db2d 930 // event weights for NUA terms:
931 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
932 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
933
489d5531 934 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
3b552efe 935 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
489d5531 936 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
b3dacf6b 937 if(fCalculateCumulantsVsM)
938 {
939 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
940 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
941 }
489d5531 942 }
943
944 // 3-particle:
945 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
946
947 if(dMult>2)
948 {
949 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
950 / (dMult*(dMult-1)*(dMult-2));
951
952 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
953 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
0328db2d 954 // event weights for NUA terms:
955 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 956
957 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
2001bc3a 958 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 959 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 960 }
961
962} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
963
964
965//================================================================================================================================
966
967
968void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
969{
970 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
971
972 // multiplicity:
1268c371 973 Double_t dMult = (*fSpk)(0,0);
489d5531 974
975 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
976 Double_t dReQ1n = (*fReQ)(0,0);
977 Double_t dReQ2n = (*fReQ)(1,0);
978 //Double_t dReQ3n = (*fReQ)(2,0);
979 //Double_t dReQ4n = (*fReQ)(3,0);
980 Double_t dImQ1n = (*fImQ)(0,0);
981 Double_t dImQ2n = (*fImQ)(1,0);
982 //Double_t dImQ3n = (*fImQ)(2,0);
983 //Double_t dImQ4n = (*fImQ)(3,0);
984
985 // *************************************************************
986 // **** corrections for non-uniform acceptance (sin terms): ****
987 // *************************************************************
988 //
989 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
990 // are stored in 1D profile fQCorrectionsSin.
991 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
992 // --------------------------------------------------------------------------------------------------------------------
993 // 1st bin: <<sin(n*(phi1))>> = sinP1n
994 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
995 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
996 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
997 // --------------------------------------------------------------------------------------------------------------------
998
999 // 1-particle:
1000 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1001
1002 if(dMult>0)
1003 {
1004 sinP1n = dImQ1n/dMult;
1005
1006 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
0328db2d 1007 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1008 // event weights for NUA terms:
1009 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
489d5531 1010
1011 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1012 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
b3dacf6b 1013 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);}
489d5531 1014 }
1015
1016 // 2-particle:
1017 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1018 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1019 if(dMult>1)
1020 {
3b552efe 1021 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
489d5531 1022 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1023
1024 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1025 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
3b552efe 1026 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
0328db2d 1027 // event weights for NUA terms:
1028 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1029 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
489d5531 1030
1031 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1032 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1033 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
b3dacf6b 1034 if(fCalculateCumulantsVsM)
1035 {
1036 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1037 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
1038 }
489d5531 1039 }
1040
1041 // 3-particle:
1042 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1043
1044 if(dMult>2)
1045 {
1046 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1047 / (dMult*(dMult-1)*(dMult-2));
1048
1049 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1050 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
0328db2d 1051 // event weights for NUA terms:
1052 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1053
1054 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
2001bc3a 1055 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 1056 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 1057 }
1058
1059} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1060
489d5531 1061//================================================================================================================================
1062
489d5531 1063void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1064{
1268c371 1065 // a) Get pointers for common control and common result histograms;
1066 // b) Get pointers for histograms holding particle weights;
1067 // c) Get pointers for reference flow histograms;
1068 // d) Get pointers for differential flow histograms;
1069 // e) Get pointers for 2D differential flow histograms;
1070 // f) Get pointers for nested loops' histograms.
489d5531 1071
1072 if(outputListHistos)
3b552efe 1073 {
1074 this->SetHistList(outputListHistos);
1075 if(!fHistList)
1076 {
1268c371 1077 printf("\n WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!\n\n");
3b552efe 1078 exit(0);
489d5531 1079 }
1080 this->GetPointersForCommonHistograms();
1081 this->GetPointersForParticleWeightsHistograms();
1082 this->GetPointersForIntFlowHistograms();
1083 this->GetPointersForDiffFlowHistograms();
1268c371 1084 this->GetPointersFor2DDiffFlowHistograms();
489d5531 1085 this->GetPointersForNestedLoopsHistograms();
3b552efe 1086 } else
1087 {
1268c371 1088 printf("\n WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!\n\n");
3b552efe 1089 exit(0);
489d5531 1090 }
1091
1092} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
ad87ae62 1093
489d5531 1094//================================================================================================================================
1095
489d5531 1096TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
ad87ae62 1097{
489d5531 1098 // project 2D profile onto pt axis to get 1D profile
1099
1100 Int_t nBinsPt = profilePtEta->GetNbinsX();
1101 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1102 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1103
1104 Int_t nBinsEta = profilePtEta->GetNbinsY();
1105
1106 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1107
1108 for(Int_t p=1;p<=nBinsPt;p++)
1109 {
1110 Double_t contentPt = 0.;
1111 Double_t entryPt = 0.;
1112 Double_t spreadPt = 0.;
1113 Double_t sum1 = 0.;
1114 Double_t sum2 = 0.;
1115 Double_t sum3 = 0.;
1116 for(Int_t e=1;e<=nBinsEta;e++)
1117 {
1118 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1119 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1120 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1121
1122 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1123 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1124 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1125 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1126 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1127 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1128 }
1129 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1130 {
1131 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1132 }
1133 profilePt->SetBinContent(p,contentPt);
1134 profilePt->SetBinEntries(p,entryPt);
1135 {
1136 profilePt->SetBinError(p,spreadPt);
1137 }
1138
1139 }
1140
1141 return profilePt;
1142
1143} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1144
1145
1146//================================================================================================================================
1147
1148
1149TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1150{
1151 // project 2D profile onto eta axis to get 1D profile
1152
1153 Int_t nBinsEta = profilePtEta->GetNbinsY();
1154 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1155 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1156
1157 Int_t nBinsPt = profilePtEta->GetNbinsX();
1158
1159 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1160
1161 for(Int_t e=1;e<=nBinsEta;e++)
1162 {
1163 Double_t contentEta = 0.;
1164 Double_t entryEta = 0.;
1165 for(Int_t p=1;p<=nBinsPt;p++)
1166 {
1167 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1168 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1169 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1170 }
1171 profileEta->SetBinContent(e,contentEta);
1172 profileEta->SetBinEntries(e,entryEta);
1173 }
1174
1175 return profileEta;
1176
1177} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1178
489d5531 1179//================================================================================================================================
1180
489d5531 1181void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1182{
2001bc3a 1183 // Printing on the screen the final results for integrated flow (RF, POI and RP).
489d5531 1184
1185 Int_t n = fHarmonic;
1186
489d5531 1187 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1188 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1189
2001bc3a 1190 if(type == "RF")
489d5531 1191 {
0dd3b008 1192 for(Int_t b=0;b<4;b++)
1193 {
b77b6434 1194 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1195 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1196 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1197 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1198 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1199 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1200 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1201 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
0dd3b008 1202 }
489d5531 1203 } else if(type == "RP")
1204 {
1205 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1206 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1207 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1208 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1209 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1210 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1211 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1212 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1213 } else if(type == "POI")
1214 {
1215 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1216 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1217 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1218 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1219 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1220 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1221 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1222 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
b77b6434 1223 } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
b3dacf6b 1224 {
0dd3b008 1225 for(Int_t b=0;b<4;b++)
1226 {
1227 dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
1228 dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
1229 }
b3dacf6b 1230 }
489d5531 1231
1232 TString title = " flow estimates from Q-cumulants";
1233 TString subtitle = " (";
b3dacf6b 1234 TString subtitle2 = " (rebinned in M)";
489d5531 1235
b3dacf6b 1236 if(type != "RF, rebinned in M")
489d5531 1237 {
b3dacf6b 1238 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1239 {
1240 subtitle.Append(type);
1241 subtitle.Append(", without weights)");
1242 } else
1243 {
1244 subtitle.Append(type);
1245 subtitle.Append(", with weights)");
1246 }
1247 } else
489d5531 1248 {
b3dacf6b 1249 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1250 {
1251 subtitle.Append("RF");
1252 subtitle.Append(", without weights)");
1253 } else
1254 {
1255 subtitle.Append("RF");
1256 subtitle.Append(", with weights)");
1257 }
1258 }
1259
489d5531 1260 cout<<endl;
1261 cout<<"*************************************"<<endl;
1262 cout<<"*************************************"<<endl;
1263 cout<<title.Data()<<endl;
1264 cout<<subtitle.Data()<<endl;
b3dacf6b 1265 if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
489d5531 1266 cout<<endl;
1267
1268 for(Int_t i=0;i<4;i++)
1269 {
2001bc3a 1270 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
489d5531 1271 }
2001bc3a 1272
489d5531 1273 cout<<endl;
b92ea2b9 1274 if(type == "RF")
1275 {
b77b6434 1276 if(fApplyCorrectionForNUA)
1277 {
1278 cout<<" detector bias (corrected for): "<<endl;
1279 } else
1280 {
1281 cout<<" detector bias (not corrected for):"<<endl;
1282 }
b92ea2b9 1283 cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
1284 cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
1285 cout<<endl;
1286 }
b3dacf6b 1287 if(type == "RF" || type == "RF, rebinned in M")
489d5531 1288 {
2001bc3a 1289 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1290 }
1291 else if (type == "RP")
1292 {
2001bc3a 1293 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1294 }
1295 else if (type == "POI")
1296 {
2001bc3a 1297 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1298 }
1299
489d5531 1300 cout<<"*************************************"<<endl;
1301 cout<<"*************************************"<<endl;
1302 cout<<endl;
1303
2001bc3a 1304}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
489d5531 1305
1306//================================================================================================================================
1307
489d5531 1308void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1309{
1310 //store the final results in output .root file
1311 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1312 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1313 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1314 delete output;
1315}
1316
1317
1318//================================================================================================================================
1319
1320
1321void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1322{
1323 //store the final results in output .root file
1324 fHistList->SetName("cobjQC");
1325 fHistList->SetOwner(kTRUE);
1326 outputFileName->Add(fHistList);
1327 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1328}
1329
489d5531 1330//================================================================================================================================
1331
489d5531 1332void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1333{
1334 // Book common control histograms and common histograms for final results.
1268c371 1335 // a) Book common control histograms;
1336 // b) Book common result histograms.
1337
1338 // a) Book common control histograms:
1339 // Common control histograms (all events):
489d5531 1340 TString commonHistsName = "AliFlowCommonHistQC";
1341 commonHistsName += fAnalysisLabel->Data();
1342 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1343 fHistList->Add(fCommonHists);
1268c371 1344 // Common control histograms (selected events):
dd442cd2 1345 if(fFillMultipleControlHistograms)
1346 {
1268c371 1347 // Common control histogram filled for events with 2 and more reference particles:
dd442cd2 1348 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1349 commonHists2ndOrderName += fAnalysisLabel->Data();
1350 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1351 fHistList->Add(fCommonHists2nd);
1268c371 1352 // Common control histogram filled for events with 2 and more reference particles:
dd442cd2 1353 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1354 commonHists4thOrderName += fAnalysisLabel->Data();
1355 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1356 fHistList->Add(fCommonHists4th);
1268c371 1357 // Common control histogram filled for events with 6 and more reference particles:
dd442cd2 1358 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1359 commonHists6thOrderName += fAnalysisLabel->Data();
1360 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1361 fHistList->Add(fCommonHists6th);
1268c371 1362 // Common control histogram filled for events with 8 and more reference particles:
dd442cd2 1363 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1364 commonHists8thOrderName += fAnalysisLabel->Data();
1365 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1366 fHistList->Add(fCommonHists8th);
1367 } // end of if(fFillMultipleControlHistograms)
1368
1268c371 1369 // b) Book common result histograms:
1370 // Common result histograms for QC{2}:
489d5531 1371 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1372 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1373 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1374 fHistList->Add(fCommonHistsResults2nd);
1268c371 1375 // Common result histograms for QC{4}:
489d5531 1376 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1377 commonHistResults4thOrderName += fAnalysisLabel->Data();
1378 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1379 fHistList->Add(fCommonHistsResults4th);
1268c371 1380 // Common result histograms for QC{6}:
489d5531 1381 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1382 commonHistResults6thOrderName += fAnalysisLabel->Data();
1383 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1384 fHistList->Add(fCommonHistsResults6th);
1268c371 1385 // Common result histograms for QC{8}:
489d5531 1386 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1387 commonHistResults8thOrderName += fAnalysisLabel->Data();
1388 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1389 fHistList->Add(fCommonHistsResults8th);
1390
1391} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1392
489d5531 1393//================================================================================================================================
1394
489d5531 1395void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1396{
1268c371 1397 // Book and fill histograms which hold phi, pt and eta weights.
489d5531 1398
1399 if(!fWeightsList)
1400 {
1268c371 1401 printf("\n WARNING (QC): fWeightsList is NULL in AFAWQC::BAFWH() !!!! \n\n");
489d5531 1402 exit(0);
1403 }
1404
1405 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1406 fUseParticleWeightsName += fAnalysisLabel->Data();
1407 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1408 fUseParticleWeights->SetLabelSize(0.06);
1409 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1410 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1411 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1412 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1413 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1414 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1415 fWeightsList->Add(fUseParticleWeights);
1416
1417 if(fUsePhiWeights)
1418 {
1419 if(fWeightsList->FindObject("phi_weights"))
1420 {
1421 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1268c371 1422 if(!fPhiWeights)
1423 {
1424 printf("\n WARNING (QC): fPhiWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1425 exit(0);
1426 }
489d5531 1427 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1428 {
1429 cout<<endl;
1430 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1431 cout<<endl;
6fbbbbf1 1432 //exit(0);
489d5531 1433 }
1434 } else
1435 {
1436 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1437 exit(0);
1438 }
1439 } // end of if(fUsePhiWeights)
1440
1441 if(fUsePtWeights)
1442 {
1443 if(fWeightsList->FindObject("pt_weights"))
1444 {
1445 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1268c371 1446 if(!fPtWeights)
1447 {
1448 printf("\n WARNING (QC): fPtWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1449 exit(0);
1450 }
489d5531 1451 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1452 {
1453 cout<<endl;
1454 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1455 cout<<endl;
6fbbbbf1 1456 //exit(0);
489d5531 1457 }
1458 } else
1459 {
1460 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1461 exit(0);
1462 }
1463 } // end of if(fUsePtWeights)
1464
1465 if(fUseEtaWeights)
1466 {
1467 if(fWeightsList->FindObject("eta_weights"))
1468 {
1469 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1268c371 1470 if(!fEtaWeights)
1471 {
1472 printf("\n WARNING (QC): fEtaWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1473 exit(0);
1474 }
489d5531 1475 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1476 {
1477 cout<<endl;
1478 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1479 cout<<endl;
6fbbbbf1 1480 //exit(0);
489d5531 1481 }
1482 } else
1483 {
1484 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1485 exit(0);
1486 }
1487 } // end of if(fUseEtaWeights)
1488
1489} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1490
489d5531 1491//================================================================================================================================
1492
489d5531 1493void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1494{
1495 // Book all objects for integrated flow:
e5834fcb 1496 // a) Book profile to hold all flags for integrated flow;
1497 // b) Book event-by-event quantities;
1498 // c) Book profiles; // to be improved (comment)
489d5531 1499 // d) Book histograms holding the final results.
1500
1501 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1502 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1503
1504 // a) Book profile to hold all flags for integrated flow:
1505 TString intFlowFlagsName = "fIntFlowFlags";
1506 intFlowFlagsName += fAnalysisLabel->Data();
dd442cd2 1507 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",14,0,14);
489d5531 1508 fIntFlowFlags->SetTickLength(-0.01,"Y");
1509 fIntFlowFlags->SetMarkerStyle(25);
1510 fIntFlowFlags->SetLabelSize(0.05);
1511 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1512 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1513 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1514 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
b3dacf6b 1515 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
489d5531 1516 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
3b552efe 1517 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
b3dacf6b 1518 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
1519 fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
1520 fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
1521 fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
0dd3b008 1522 fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
8e1cefdd 1523 fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
e5834fcb 1524 fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStorePhiDistributionForOneEvent");
dd442cd2 1525 fIntFlowFlags->GetXaxis()->SetBinLabel(14,"fFillMultipleControlHistograms");
489d5531 1526 fIntFlowList->Add(fIntFlowFlags);
1527
1528 // b) Book event-by-event quantities:
1529 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
8ed4edc7 1530 fReQ = new TMatrixD(6,9);
1531 fImQ = new TMatrixD(6,9);
1268c371 1532 fSpk = new TMatrixD(8,9);
489d5531 1533 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1534 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1535 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1536 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1537 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1538 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1539 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1540 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1541 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1542 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1543 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
8ed4edc7 1544 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),34,0,34);
489d5531 1545 // average correction terms for non-uniform acceptance for single event
1546 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1547 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1548 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1549 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1550 {
b92ea2b9 1551 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()),4,0,4);
489d5531 1552 }
0328db2d 1553 // event weights for terms for non-uniform acceptance:
1554 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1555 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1556 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1557 {
b92ea2b9 1558 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowEventWeightForCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Event weights for terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4); // to be improved - 4
0328db2d 1559 }
489d5531 1560 // c) Book profiles: // to be improved (comment)
1561 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1562 TString avMultiplicityName = "fAvMultiplicity";
1563 avMultiplicityName += fAnalysisLabel->Data();
1564 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1565 fAvMultiplicity->SetTickLength(-0.01,"Y");
1566 fAvMultiplicity->SetMarkerStyle(25);
1567 fAvMultiplicity->SetLabelSize(0.05);
1568 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1569 fAvMultiplicity->SetYTitle("Average Multiplicity");
1570 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1571 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1572 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1573 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1574 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1575 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1576 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1577 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1578 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1579 fIntFlowProfiles->Add(fAvMultiplicity);
b40a910e 1580 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1581 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
489d5531 1582 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1583 intFlowCorrelationsProName += fAnalysisLabel->Data();
1584 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
b40a910e 1585 fIntFlowCorrelationsPro->Sumw2();
489d5531 1586 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1587 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1588 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1589 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 1590 for(Int_t b=0;b<4;b++)
b3dacf6b 1591 {
68a3b4b1 1592 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
b3dacf6b 1593 }
489d5531 1594 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
b40a910e 1595 // Average correlations squared <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> for all events:
1596 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"};
1597 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
1598 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
1599 fIntFlowSquaredCorrelationsPro = new TProfile(intFlowSquaredCorrelationsProName.Data(),"Average squared correlations for all events",4,0,4,"s");
1600 fIntFlowSquaredCorrelationsPro->Sumw2();
1601 fIntFlowSquaredCorrelationsPro->SetTickLength(-0.01,"Y");
1602 fIntFlowSquaredCorrelationsPro->SetMarkerStyle(25);
1603 fIntFlowSquaredCorrelationsPro->SetLabelSize(0.06);
1604 fIntFlowSquaredCorrelationsPro->SetLabelOffset(0.01,"Y");
1605 for(Int_t b=0;b<4;b++)
1606 {
1607 (fIntFlowSquaredCorrelationsPro->GetXaxis())->SetBinLabel(b+1,squaredCorrelationFlag[b].Data());
1608 }
1609 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsPro);
b3dacf6b 1610 if(fCalculateCumulantsVsM)
1611 {
1612 for(Int_t ci=0;ci<4;ci++) // correlation index
1613 {
b40a910e 1614 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
b3dacf6b 1615 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1616 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1617 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1618 Form("%s vs multiplicity",correlationFlag[ci].Data()),
b40a910e 1619 fnBinsMult,fMinMult,fMaxMult,"s");
1620 fIntFlowCorrelationsVsMPro[ci]->Sumw2();
b3dacf6b 1621 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1622 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1623 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
b40a910e 1624 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
1625 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
1626 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
1627 fIntFlowSquaredCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data()),
1628 Form("%s vs multiplicity",squaredCorrelationFlag[ci].Data()),
1629 fnBinsMult,fMinMult,fMaxMult,"s");
1630 fIntFlowSquaredCorrelationsVsMPro[ci]->Sumw2();
1631 fIntFlowSquaredCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(squaredCorrelationFlag[ci].Data());
1632 fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1633 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsVsMPro[ci]);
b3dacf6b 1634 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1635 } // end of if(fCalculateCumulantsVsM)
489d5531 1636 // averaged all correlations for all events (with wrong errors!):
1637 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1638 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
8ed4edc7 1639 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",34,0,34,"s");
489d5531 1640 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1641 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1642 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1643 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1644 // 2-p correlations:
1645 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1646 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1647 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1648 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1649 // 3-p correlations:
1650 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1651 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1652 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1653 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1654 // 4-p correlations:
1655 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1656 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1657 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1658 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1659 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1660 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1661 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1662 // 5-p correlations:
1663 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1664 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1665 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1666 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1667 // 6-p correlations:
1668 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1669 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1670 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1671 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1672 // 7-p correlations:
1673 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1674 // 8-p correlations:
1675 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
8ed4edc7 1676 // EXTRA correlations:
1677 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(33,"<<4>>_{4n,2n|3n,3n}");
1678 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(34,"<<5>>_{2n,2n,2n|3n,3n}");
489d5531 1679 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1680 // when particle weights are used some extra correlations appear:
1681 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1682 {
1683 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1684 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1685 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1686 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1687 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1688 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1689 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1690 // extra 2-p correlations:
1691 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1692 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1693 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1694 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1695 // average product of correlations <2>, <4>, <6> and <8>:
b3dacf6b 1696 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
489d5531 1697 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1698 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1699 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1700 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1701 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1702 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1703 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 1704 for(Int_t b=0;b<6;b++)
b3dacf6b 1705 {
68a3b4b1 1706 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
b3dacf6b 1707 }
1708 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
ff70ca91 1709 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1710 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 1711 if(fCalculateCumulantsVsM)
1712 {
1713 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1714 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1715 for(Int_t pi=0;pi<6;pi++)
1716 {
1717 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1718 Form("%s versus multiplicity",productFlag[pi].Data()),
1719 fnBinsMult,fMinMult,fMaxMult);
1720 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1721 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1722 } // end of for(Int_t pi=0;pi<6;pi++)
1723 } // end of if(fCalculateCumulantsVsM)
0328db2d 1724 // average product of correction terms for NUA:
1725 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1726 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1727 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1728 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1729 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1730 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1731 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1732 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1733 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1734 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1735 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1736 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1737 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1738 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1739 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1740 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1741 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1742 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1743 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1744 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1745 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1746 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1747 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1748 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1749 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1750 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1751 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1752 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1753 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1754 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1755 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1756 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1757 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1758 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1759 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
489d5531 1760 // average correction terms for non-uniform acceptance (with wrong errors!):
1761 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1762 {
1763 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1764 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b92ea2b9 1765 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()),4,0,4,"s");
489d5531 1766 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1767 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1768 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1769 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
b92ea2b9 1770 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(phi1))#GT#GT",sinCosFlag[sc].Data()));
1771 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1772 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1773 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
489d5531 1774 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
2001bc3a 1775 // versus multiplicity:
b3dacf6b 1776 if(fCalculateCumulantsVsM)
1777 {
1778 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
1779 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
1780 {
1781 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
1782 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
1783 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = new TProfile(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data()),Form("#LT#LT%s%s#GT#GT vs M",sinCosFlag[sc].Data(),correctionTermFlag[ci].Data()),fnBinsMult,fMinMult,fMaxMult,"s");
1784 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
1785 }
1786 } // end of if(fCalculateCumulantsVsM)
489d5531 1787 } // end of for(Int_t sc=0;sc<2;sc++)
1788
1789 // d) Book histograms holding the final results:
1790 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1791 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1792 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1793 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1794 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1795 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1796 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1797 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1798 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1799 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1800 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1801 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1802 fIntFlowResults->Add(fIntFlowCorrelationsHist);
ff70ca91 1803 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
b3dacf6b 1804 if(fCalculateCumulantsVsM)
1805 {
1806 for(Int_t ci=0;ci<4;ci++) // correlation index
1807 {
1808 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1809 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1810 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1811 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1812 fnBinsMult,fMinMult,fMaxMult);
1813 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1814 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1815 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1816 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1817 } // end of if(fCalculateCumulantsVsM)
489d5531 1818 // average all correlations for all events (with correct errors!):
1819 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1820 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
8ed4edc7 1821 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",34,0,34);
489d5531 1822 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1823 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1824 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1825 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1826 // 2-p correlations:
1827 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1828 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1829 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1830 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1831 // 3-p correlations:
1832 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1833 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1834 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1835 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1836 // 4-p correlations:
1837 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1838 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1839 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1840 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1841 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1842 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1843 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1844 // 5-p correlations:
1845 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1846 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1847 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1848 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1849 // 6-p correlations:
1850 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1851 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1852 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1853 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1854 // 7-p correlations:
1855 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1856 // 8-p correlations:
1857 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1858 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1859 // average correction terms for non-uniform acceptance (with correct errors!):
1860 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1861 {
1862 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1863 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
b92ea2b9 1864 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()),4,0,4);
489d5531 1865 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1866 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1867 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1868 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
b92ea2b9 1869 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
1870 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1871 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1872 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
489d5531 1873 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1874 } // end of for(Int_t sc=0;sc<2;sc++)
1875 // covariances (multiplied with weight dependent prefactor):
1876 TString intFlowCovariancesName = "fIntFlowCovariances";
1877 intFlowCovariancesName += fAnalysisLabel->Data();
1878 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1879 fIntFlowCovariances->SetLabelSize(0.04);
1880 fIntFlowCovariances->SetMarkerStyle(25);
1881 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1882 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1883 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1884 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1885 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1886 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1887 fIntFlowResults->Add(fIntFlowCovariances);
1888 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1889 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1890 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1891 for(Int_t power=0;power<2;power++)
1892 {
1893 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);
1894 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1895 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1896 if(power == 0)
1897 {
1898 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1899 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1900 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1901 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1902 } else if (power == 1)
1903 {
1904 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1905 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1906 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1907 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1908 }
1909 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1910 }
1911 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1912 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1913 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1914 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1915 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1916 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1917 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1918 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1919 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1920 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1921 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1922 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1923 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
ff70ca91 1924 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1925 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
b3dacf6b 1926 if(fCalculateCumulantsVsM)
ff70ca91 1927 {
b3dacf6b 1928 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1929 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1930 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1931 for(Int_t ci=0;ci<6;ci++)
1932 {
1933 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1934 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
1935 fnBinsMult,fMinMult,fMaxMult);
1936 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1937 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1938 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1939 }
1940 } // end of if(fCalculateCumulantsVsM)
ff70ca91 1941 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1942 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
b3dacf6b 1943 if(fCalculateCumulantsVsM)
ff70ca91 1944 {
b3dacf6b 1945 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1946 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1947 TString sumFlag[2][4] = {{"#sum_{i=1}^{N} w_{<2>}","#sum_{i=1}^{N} w_{<4>}","#sum_{i=1}^{N} w_{<6>}","#sum_{i=1}^{N} w_{<8>}"},
1948 {"#sum_{i=1}^{N} w_{<2>}^{2}","#sum_{i=1}^{N} w_{<4>}^{2}","#sum_{i=1}^{N} w_{<6>}^{2}","#sum_{i=1}^{N} w_{<8>}^{2}"}};
1949 for(Int_t si=0;si<4;si++)
ff70ca91 1950 {
b3dacf6b 1951 for(Int_t power=0;power<2;power++)
1952 {
1953 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1954 Form("%s vs multiplicity",sumFlag[power][si].Data()),
1955 fnBinsMult,fMinMult,fMaxMult);
1956 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1957 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1958 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1959 } // end of for(Int_t power=0;power<2;power++)
1960 } // end of for(Int_t si=0;si<4;si++)
1961 } // end of if(fCalculateCumulantsVsM)
ff70ca91 1962 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1963 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1964 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 1965 if(fCalculateCumulantsVsM)
1966 {
1967 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1968 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1969 TString sopowFlag[6] = {"#sum_{i=1}^{N} w_{<2>} w_{<4>}","#sum_{i=1}^{N} w_{<2>} w_{<6>}","#sum_{i=1}^{N} w_{<2>} w_{<8>}",
1970 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1971 for(Int_t pi=0;pi<6;pi++)
1972 {
1973 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1974 Form("%s versus multiplicity",sopowFlag[pi].Data()),
1975 fnBinsMult,fMinMult,fMaxMult);
1976 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1977 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1978 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1979 } // end of for(Int_t pi=0;pi<6;pi++)
1980 } // end of if(fCalculateCumulantsVsM)
0328db2d 1981 // covariances of NUA terms (multiplied with weight dependent prefactor):
1982 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1983 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1984 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1985 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1986 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1987 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1988 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1989 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1990 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1991 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1992 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1993 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1994 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1995 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1996 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1997 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1998 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1999 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2000 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2001 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2002 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2003 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2004 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2005 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2006 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2007 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2008 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2009 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2010 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2011 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2012 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2013 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2014 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2015 fIntFlowResults->Add(fIntFlowCovariancesNUA);
2016 // sum of linear and quadratic event weights for NUA terms:
2017 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
2018 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
2019 for(Int_t sc=0;sc<2;sc++)
2020 {
2021 for(Int_t power=0;power<2;power++)
2022 {
b92ea2b9 2023 fIntFlowSumOfEventWeightsNUA[sc][power] = new TH1D(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data()),Form("Sum of %s event weights for NUA %s terms",powerFlag[power].Data(),sinCosFlag[sc].Data()),4,0,4); // to be improved - 4
0328db2d 2024 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
2025 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
2026 if(power == 0)
2027 {
2028 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
2029 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
b92ea2b9 2030 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
2031 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
0328db2d 2032 } else if(power == 1)
2033 {
2034 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
2035 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
2036 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
b92ea2b9 2037 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
0328db2d 2038 }
2039 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
2040 }
2041 }
2042 // sum of products of event weights for NUA terms:
2043 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
2044 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
2045 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
2046 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
2047 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
2048 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
2049 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
2050 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
2051 // ....
2052 // to be improved - add labels for remaining bins
2053 // ....
2054 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
b3dacf6b 2055 // Final results for reference Q-cumulants:
2056 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
489d5531 2057 TString intFlowQcumulantsName = "fIntFlowQcumulants";
2058 intFlowQcumulantsName += fAnalysisLabel->Data();
b92ea2b9 2059 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
b77b6434 2060 if(fPropagateErrorAlsoFromNIT)
b92ea2b9 2061 {
b77b6434 2062 fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
b92ea2b9 2063 }
489d5531 2064 fIntFlowQcumulants->SetLabelSize(0.05);
2065 fIntFlowQcumulants->SetMarkerStyle(25);
68a3b4b1 2066 for(Int_t b=0;b<4;b++)
b3dacf6b 2067 {
68a3b4b1 2068 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2069 }
489d5531 2070 fIntFlowResults->Add(fIntFlowQcumulants);
b3dacf6b 2071 // Final results for reference Q-cumulants rebinned in M:
2072 if(fCalculateCumulantsVsM)
2073 {
2074 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
2075 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
2076 fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
2077 fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
2078 fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2079 for(Int_t b=0;b<4;b++)
b3dacf6b 2080 {
68a3b4b1 2081 (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2082 }
2083 fIntFlowResults->Add(fIntFlowQcumulantsRebinnedInM);
2084 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 2085 // Ratio between error squared: with/without non-isotropic terms:
2086 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
2087 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
2088 fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
2089 fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
2090 fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
2091 for(Int_t b=0;b<4;b++)
2092 {
2093 (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2094 }
2095 fIntFlowResults->Add(fIntFlowQcumulantsErrorSquaredRatio);
ff70ca91 2096 // final results for integrated Q-cumulants versus multiplicity:
b3dacf6b 2097 if(fCalculateCumulantsVsM)
2098 {
2099 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
2100 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2101 for(Int_t co=0;co<4;co++) // cumulant order
2102 {
2103 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2104 Form("%s vs multipicity",cumulantFlag[co].Data()),
2105 fnBinsMult,fMinMult,fMaxMult);
2106 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2107 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2108 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2109 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2110 } // end of if(fCalculateCumulantsVsM)
489d5531 2111 // final integrated flow estimates from Q-cumulants:
b3dacf6b 2112 TString flowFlag[4] = {Form("v_{%d}{2,QC}",fHarmonic),Form("v_{%d}{4,QC}",fHarmonic),Form("v_{%d}{6,QC}",fHarmonic),Form("v_{%d}{8,QC}",fHarmonic)};
489d5531 2113 TString intFlowName = "fIntFlow";
2114 intFlowName += fAnalysisLabel->Data();
2115 // integrated flow from Q-cumulants:
b3dacf6b 2116 fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
489d5531 2117 fIntFlow->SetLabelSize(0.05);
2118 fIntFlow->SetMarkerStyle(25);
68a3b4b1 2119 for(Int_t b=0;b<4;b++)
b3dacf6b 2120 {
68a3b4b1 2121 (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2122 }
ff70ca91 2123 fIntFlowResults->Add(fIntFlow);
b3dacf6b 2124 // Reference flow vs M rebinned in one huge bin:
2125 if(fCalculateCumulantsVsM)
2126 {
2127 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
2128 intFlowRebinnedInMName += fAnalysisLabel->Data();
2129 fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
2130 fIntFlowRebinnedInM->SetLabelSize(0.05);
2131 fIntFlowRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2132 for(Int_t b=0;b<4;b++)
b3dacf6b 2133 {
68a3b4b1 2134 (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2135 }
2136 fIntFlowResults->Add(fIntFlowRebinnedInM);
2137 }
ff70ca91 2138 // integrated flow from Q-cumulants: versus multiplicity:
b3dacf6b 2139 if(fCalculateCumulantsVsM)
2140 {
2141 TString intFlowVsMName = "fIntFlowVsM";
2142 intFlowVsMName += fAnalysisLabel->Data();
2143 for(Int_t co=0;co<4;co++) // cumulant order
2144 {
2145 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2146 Form("%s vs multipicity",flowFlag[co].Data()),
2147 fnBinsMult,fMinMult,fMaxMult);
2148 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2149 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2150 fIntFlowResults->Add(fIntFlowVsM[co]);
2151 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2152 } // end of if(fCalculateCumulantsVsM)
2001bc3a 2153 // quantifying detector effects effects to correlations:
2154 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2155 intFlowDetectorBiasName += fAnalysisLabel->Data();
2156 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2157 fIntFlowDetectorBias->SetLabelSize(0.05);
2158 fIntFlowDetectorBias->SetMarkerStyle(25);
2159 for(Int_t ci=0;ci<4;ci++)
2160 {
2161 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2162 }
2163 fIntFlowResults->Add(fIntFlowDetectorBias);
2164 // quantifying detector effects to correlations versus multiplicity:
b3dacf6b 2165 if(fCalculateCumulantsVsM)
2001bc3a 2166 {
b3dacf6b 2167 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2168 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2169 for(Int_t ci=0;ci<4;ci++) // correlation index
2170 {
2171 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2172 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2173 fnBinsMult,fMinMult,fMaxMult);
2174 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2175 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
b77b6434 2176 fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);
b3dacf6b 2177 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2178 } // end of if(fCalculateCumulantsVsM)
1268c371 2179
489d5531 2180} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2181
489d5531 2182//================================================================================================================================
2183
489d5531 2184void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2185{
2186 // Initialize arrays of all objects relevant for calculations with nested loops.
2187
2188 // integrated flow:
2189 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2190 {
2191 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2192 }
2193
2194 // differential flow:
2195 // correlations:
2196 for(Int_t t=0;t<2;t++) // type: RP or POI
2197 {
2198 for(Int_t pe=0;pe<2;pe++) // pt or eta
2199 {
2200 for(Int_t ci=0;ci<4;ci++) // correlation index
2201 {
2202 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2203 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2204 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2205 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2206 // correction terms for non-uniform acceptance:
2207 for(Int_t t=0;t<2;t++) // type: RP or POI
2208 {
2209 for(Int_t pe=0;pe<2;pe++) // pt or eta
2210 {
2211 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2212 {
2213 for(Int_t cti=0;cti<9;cti++) // correction term index
2214 {
2215 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2216 }
2217 }
2218 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2219 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2220
2221
2222} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2223
2224
2225//================================================================================================================================
2226
2227
2228void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2229{
2230 // Book all objects relevant for calculations with nested loops.
2231
2232 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2233 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2234 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2235 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2236 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2237 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2238
2239 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2240 evaluateNestedLoopsName += fAnalysisLabel->Data();
2241 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2242 fEvaluateNestedLoops->SetLabelSize(0.03);
2243 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2244 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2245 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2246 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2247 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2248 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2249 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2250 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2251 fNestedLoopsList->Add(fEvaluateNestedLoops);
2252 // nested loops for integrated flow:
2253 if(fEvaluateIntFlowNestedLoops)
2254 {
2255 // correlations:
2256 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2257 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
8ed4edc7 2258 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",34,0,34,"s");
489d5531 2259 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2260 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2261 {
2262 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2263 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2264 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2265 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2266 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2267 // correction terms for non-uniform acceptance:
2268 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2269 {
2270 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2271 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2272 fIntFlowDirectCorrectionTermsForNUA[sc] = new TProfile(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10,"s");
2273 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2274 } // end of for(Int_t sc=0;sc<2;sc++)
2275 } // end of if(fEvaluateIntFlowNestedLoops)
2276
2277 // nested loops for differential flow:
2278 if(fEvaluateDiffFlowNestedLoops)
2279 {
2280 // reduced correlations:
2281 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2282 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2283 for(Int_t t=0;t<2;t++) // type: RP or POI
2284 {
2285 for(Int_t pe=0;pe<2;pe++) // pt or eta
2286 {
2287 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2288 {
2289 // reduced correlations:
2290 fDiffFlowDirectCorrelations[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s");
2291 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2292 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2293 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2294 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2295 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2296 // correction terms for non-uniform acceptance:
2297 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2298 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2299 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2300 {
2301 for(Int_t pe=0;pe<2;pe++) // pt or eta
2302 {
2303 for(Int_t sc=0;sc<2;sc++) // sin or cos
2304 {
2305 for(Int_t cti=0;cti<9;cti++) // correction term index
2306 {
2307 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s");
2308 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2309 }
2310 }
2311 }
3b552efe 2312 }
2313 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2314 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2315 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
489d5531 2316 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2317 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2318 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
3b552efe 2319 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
489d5531 2320 fNestedLoopsList->Add(fNoOfParticlesInBin);
2321 } // end of if(fEvaluateDiffFlowNestedLoops)
2322
2323} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2324
2325
2326//================================================================================================================================
2327
2328
2329void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2330{
2331 // calculate all correlations needed for integrated flow
57340a27 2332
489d5531 2333 // multiplicity:
1268c371 2334 Double_t dMult = (*fSpk)(0,0);
57340a27 2335
489d5531 2336 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2337 Double_t dReQ1n = (*fReQ)(0,0);
2338 Double_t dReQ2n = (*fReQ)(1,0);
2339 Double_t dReQ3n = (*fReQ)(2,0);
2340 Double_t dReQ4n = (*fReQ)(3,0);
8ed4edc7 2341 //Double_t dReQ5n = (*fReQ)(4,0);
2342 Double_t dReQ6n = (*fReQ)(5,0);
489d5531 2343 Double_t dImQ1n = (*fImQ)(0,0);
2344 Double_t dImQ2n = (*fImQ)(1,0);
2345 Double_t dImQ3n = (*fImQ)(2,0);
2346 Double_t dImQ4n = (*fImQ)(3,0);
8ed4edc7 2347 //Double_t dImQ5n = (*fImQ)(4,0);
2348 Double_t dImQ6n = (*fImQ)(5,0);
489d5531 2349
2350 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2351 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2352
2353 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2354 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2355
2356 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2357 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2358
2359 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2360 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2361
2362 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2363 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2364 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2365
2366 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2367 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2368
2369 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2370 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2371
2372 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2373 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2374
2375 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2376 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2377
2378 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2379 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2380
2381 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2382 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2383
2384 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2385 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2386
2387 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2388 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2389
2390 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2391 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2392 + dImQ3n*dImQ2n*dReQ1n;
2393
2394 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2395 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2396
2397 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2398 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2399
2400 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2401 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2402 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2403
2404 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2405 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2406
2407 // |Q_{2n}|^2 |Q_{n}|^2
2408 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2409
2410 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2411 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2412 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2413
2414 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2415 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2416
2417 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2418 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2419 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2420
2421 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2422 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2423
2424 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2425 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2426 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2427
2428 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2429 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2430 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2431
2432 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2433 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2434 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2435 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2436
2437 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2438 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2439 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2440 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2441
2442 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2443 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2444 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2445
2446 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2447 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2448 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2449
2450
2451 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2452 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2453 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2454 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2455 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2456
2457 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2458 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2459 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2460 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2461
2462 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2463 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2464 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2465 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2466
2467 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2468 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2469 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2470 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2471
2472 // |Q_{2n}|^2 |Q_{n}|^4
2473 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2474
2475 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2476 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2477 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2478 + 2.*dReQ1n*dImQ1n*dImQ2n);
2479
2480 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2481 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2482 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2483 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2484
2485
2486
2487
2488 // **************************************
2489 // **** multi-particle correlations: ****
2490 // **************************************
2491 //
8ed4edc7 2492 // Remark 1: All multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fIntFlowCorrelationsAllPro;
2493 // Remark 2: There is a special profile fIntFlowCorrelationsPro holding results ONLY for same harmonic's <<2>>, <<4>>, <<6>> and <<8>>;
2494 // Remark 3: Binning of fIntFlowCorrelationsAllPro is organized as follows:
489d5531 2495 // --------------------------------------------------------------------------------------------------------------------
2496 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2497 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2498 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2499 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2500 // 5th bin: ---- EMPTY ----
2501 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2502 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2503 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2504 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2505 // 10th bin: ---- EMPTY ----
2506 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2507 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2508 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2509 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2510 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2511 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2512 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2513 // 18th bin: ---- EMPTY ----
2514 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2515 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2516 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2517 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2518 // 23rd bin: ---- EMPTY ----
2519 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2520 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2521 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2522 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2523 // 28th bin: ---- EMPTY ----
2524 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2525 // 30th bin: ---- EMPTY ----
2526 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
8ed4edc7 2527 // 32nd bin: ---- EMPTY ----
2528 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2529 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
489d5531 2530 // --------------------------------------------------------------------------------------------------------------------
2531
2532 // 2-particle:
2533 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2534 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2535 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2536 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2537
2538 if(dMult>1)
2539 {
2540 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2541 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2542 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2543 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2544
2545 // average 2-particle correlations for single event:
2546 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2547 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2548 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2549 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2550
2551 // average 2-particle correlations for all events:
2552 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2553 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2554 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2555 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2556
2557 // store separetately <2> (to be improved: do I really need this?)
2558 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2559
2560 // to be improved (this can be implemented better):
2561 Double_t mWeight2p = 0.;
2562 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2563 {
2564 mWeight2p = dMult*(dMult-1.);
2565 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2566 {
2567 mWeight2p = 1.;
2568 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2569 {
2570 mWeight2p = dMult;
2571 }
2572
2573 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2574 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
b40a910e 2575 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1n*two1n1n,mWeight2p);
2576 if(fCalculateCumulantsVsM)
2577 {
2578 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2579 fIntFlowSquaredCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n*two1n1n,mWeight2p);
2580 }
489d5531 2581 // distribution of <cos(n*(phi1-phi2))>:
2582 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2583 } // end of if(dMult>1)
2584
2585 // 3-particle:
2586 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2587 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2588 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2589 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2590
2591 if(dMult>2)
2592 {
2593 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2594 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2595 / (dMult*(dMult-1.)*(dMult-2.));
2596 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2597 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2598 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2599 / (dMult*(dMult-1.)*(dMult-2.));
2600 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2601 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2602 / (dMult*(dMult-1.)*(dMult-2.));
2603 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2604 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2605 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2606 / (dMult*(dMult-1.)*(dMult-2.));
2607
2608 // average 3-particle correlations for single event:
2609 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2610 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2611 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2612 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2613
2614 // average 3-particle correlations for all events:
2615 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2616 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2617 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2618 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2619 } // end of if(dMult>2)
2620
2621 // 4-particle:
2622 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2623 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2624 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2625 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2626 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2627 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2628 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2629
2630 if(dMult>3)
2631 {
2632 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2633 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2634 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2635 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2636 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2637 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2638 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2639 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2640 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2641 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2642 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2643 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2644 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2645 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2646 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2647 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2648 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2649 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2650 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2651 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2652 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2653 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2654 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2655 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2656 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2657 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2658 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2659 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2660 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2661 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2662 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2663 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2664 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2665 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2666 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2667 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2668
2669 // average 4-particle correlations for single event:
2670 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2671 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2672 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2673 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2674 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2675 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2676 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2677
2678 // average 4-particle correlations for all events:
2679 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2680 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2681 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2682 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2683 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2684 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2685 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2686
2687 // store separetately <4> (to be improved: do I really need this?)
2688 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2689
2690 // to be improved (this can be implemented better):
2691 Double_t mWeight4p = 0.;
2692 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2693 {
2694 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2695 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2696 {
2697 mWeight4p = 1.;
2698 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2699 {
2700 mWeight4p = dMult;
2701 }
2702
2703 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2704 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
b40a910e 2705 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
2706 if(fCalculateCumulantsVsM)
2707 {
2708 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
2709 fIntFlowSquaredCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
2710 }
489d5531 2711 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2712 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2713
2714 } // end of if(dMult>3)
2715
2716 // 5-particle:
2717 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2718 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2719 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2720 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2721
2722 if(dMult>4)
2723 {
2724 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2725 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2726 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2727 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2728 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2729 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2730 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2731 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2732 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2733 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2734 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2735
2736 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2737 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2738 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2739 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2740 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2741 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2742 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2743 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2744 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2745 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2746 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2747 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2748 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2749
2750 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2751 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2752 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2753 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2754 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2755 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2756 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2757
2758 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2759 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2760 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2761 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2762 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2763 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2764 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2765 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2766 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2767 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2768 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2769 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2770 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2771 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2772 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2773 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2774
2775 // average 5-particle correlations for single event:
2776 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2777 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2778 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2779 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2780
2781 // average 5-particle correlations for all events:
2782 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2783 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2784 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2785 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2786 } // end of if(dMult>4)
2787
2788 // 6-particle:
2789 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2790 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2791 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2792 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2793
2794 if(dMult>5)
2795 {
2796 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2797 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2798 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2799 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2800 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2801 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2802 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2803 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2804 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2805 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2806 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2807
2808 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2809 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2810 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2811 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2812 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2813 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2814 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2815 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2816 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2817 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2818 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2819 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2820 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2821 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2822
2823 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2824 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2825 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2826 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2827 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2828 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2829 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2830
2831 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2832 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2833 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2834 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2835 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2836 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2837 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2838 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2839
2840 // average 6-particle correlations for single event:
2841 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2842 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2843 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2844 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2845
2846 // average 6-particle correlations for all events:
2847 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2848 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2849 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2850 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2851
2852 // store separetately <6> (to be improved: do I really need this?)
2853 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2854
2855 // to be improved (this can be implemented better):
2856 Double_t mWeight6p = 0.;
2857 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2858 {
2859 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2860 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2861 {
2862 mWeight6p = 1.;
2863 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2864 {
2865 mWeight6p = dMult;
2866 }
2867
2868 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2869 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
b40a910e 2870 fIntFlowSquaredCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
2871 if(fCalculateCumulantsVsM)
2872 {
2873 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
2874 fIntFlowSquaredCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
2875 }
489d5531 2876 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2877 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2878 } // end of if(dMult>5)
2879
2880 // 7-particle:
2881 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2882
2883 if(dMult>6)
2884 {
2885 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2886 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2887 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2888 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2889 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2890 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2891 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2892 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2893 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2894 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2895 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2896 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2897 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2898 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2899 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2900 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2901
2902 // average 7-particle correlations for single event:
2903 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2904
2905 // average 7-particle correlations for all events:
2906 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2907 } // end of if(dMult>6)
2908
2909 // 8-particle:
2910 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2911 if(dMult>7)
2912 {
2913 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2914 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2915 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2916 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2917 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2918 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2919 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2920 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2921 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2922 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2923 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2924 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2925 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2926
2927 // average 8-particle correlations for single event:
2928 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2929
2930 // average 8-particle correlations for all events:
2931 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2932
2933 // store separetately <8> (to be improved: do I really need this?)
2934 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2935
2936 // to be improved (this can be implemented better):
2937 Double_t mWeight8p = 0.;
2938 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2939 {
2940 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2941 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2942 {
2943 mWeight8p = 1.;
2944 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2945 {
2946 mWeight8p = dMult;
2947 }
2948
2949 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
b40a910e 2950 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2951 fIntFlowSquaredCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
2952 if(fCalculateCumulantsVsM)
2953 {
2954 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2955 fIntFlowSquaredCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
2956 }
489d5531 2957 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2958 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2959 } // end of if(dMult>7)
2960
11d3e40e 2961 // EXTRA: // to be improved (reorganized)
8ed4edc7 2962
2963 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2964 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
2965
2966 // 4-particle:
2967 Double_t four4n2n3n3n = 0.; // <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2968 Double_t reQ4nQ2nQ3nstarQ3nstar = (dReQ4n*dReQ2n-dImQ4n*dImQ2n)*(dReQ3n*dReQ3n-dImQ3n*dImQ3n)
2969 + 2.*(dReQ4n*dImQ2n+dImQ4n*dReQ2n)*dReQ3n*dImQ3n;
8ed4edc7 2970 Double_t reQ6nQ4nstarQ2nstar = dReQ6n*dReQ4n*dReQ2n-dReQ6n*dImQ4n*dImQ2n+dImQ6n*dReQ4n*dImQ2n
2971 + dImQ6n*dImQ4n*dReQ2n;
11d3e40e 2972 Double_t reQ6nQ3nstarQ3nstar = pow(dReQ3n,2.)*dReQ6n + 2.*dReQ3n*dImQ3n*dImQ6n
2973 - pow(dImQ3n,2.)*dReQ6n;
8ed4edc7 2974 if(dMult>3.)
2975 {
11d3e40e 2976 four4n2n3n3n = (reQ4nQ2nQ3nstarQ3nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar
2977 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
2978 + (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2979 + 2.*(2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2980 + (pow(dReQ1n,2.)+pow(dImQ1n,2.))-3.*dMult))
2981 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2982
8ed4edc7 2983 fIntFlowCorrelationsAllPro->Fill(32.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
11d3e40e 2984 } // end of if(dMult>3.)
8ed4edc7 2985
2986 // 5-particle:
2987 Double_t five2n2n2n3n3n = 0.; // <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
2988 Double_t reQ2nQ2nQ2nQ3nstarQ3nstar = pow(dReQ2n,3.)*pow(dReQ3n,2.)
11d3e40e 2989 - 3.*dReQ2n*pow(dReQ3n,2.)*pow(dImQ2n,2.)
2990 + 6.*pow(dReQ2n,2.)*dReQ3n*dImQ2n*dImQ3n
2991 - 2.*dReQ3n*pow(dImQ2n,3.)*dImQ3n-pow(dReQ2n,3.)*pow(dImQ3n,2.)
2992 + 3.*dReQ2n*pow(dImQ2n,2.)*pow(dImQ3n,2.);
2993 Double_t reQ2nQ2nQ2nQ6nstar = dReQ6n*pow(dReQ2n,3)-3.*dReQ2n*dReQ6n*pow(dImQ2n,2)
2994 + 3.*dImQ2n*dImQ6n*pow(dReQ2n,2)-dImQ6n*pow(dImQ2n,3);
2995 Double_t reQ2nQ2nQ1nstarQ3nstar = reQ3nQ1nQ2nstarQ2nstar;
2996 Double_t reQ4nQ2nQ6nstar = reQ6nQ4nstarQ2nstar;
2997 Double_t reQ4nQ1nstarQ3nstar = reQ3nQ1nQ4nstar;
8ed4edc7 2998 if(dMult>4.)
2999 {
11d3e40e 3000 five2n2n2n3n3n = (reQ2nQ2nQ2nQ3nstarQ3nstar-reQ2nQ2nQ2nQ6nstar-3.*reQ4nQ2nQ3nstarQ3nstar
3001 - 6.*reQ2nQ2nQ1nstarQ3nstar+2.*reQ6nQ3nstarQ3nstar+3.*reQ4nQ2nQ6nstar
3002 + 6.*reQ4nQ1nstarQ3nstar+6.*reQ2nQ2nQ4nstar
3003 + 12.*reQ2nQ1nQ3nstar+6.*reQ2nQ1nstarQ1nstar
3004 - 2.*((pow(dReQ6n,2.)+pow(dImQ6n,2.))
3005 + 3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3006 + 6.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3007 + 9.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3008 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-12.*dMult))
3009 /(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3010
8ed4edc7 3011 fIntFlowCorrelationsAllPro->Fill(33.5,five2n2n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
11d3e40e 3012 } // end of if(dMult>4.)
8ed4edc7 3013
489d5531 3014} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
3015
489d5531 3016//================================================================================================================================
3017
e5834fcb 3018void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3019{
3020 // Store phi distribution for one event to illustrate flow.
3021
3022 if(fPhiDistributionForOneEvent->GetEntries()>0){return;} // store only phi distribution for one event
3023
3024 Double_t vMin = fPhiDistributionForOneEventSettings[0];
3025 Double_t vMax = fPhiDistributionForOneEventSettings[1];
3026 Double_t refMultMin = fPhiDistributionForOneEventSettings[2];
3027 Double_t refMultMax = fPhiDistributionForOneEventSettings[3];
3028
3029 Double_t vEBE = 0.;
3030 Double_t cumulant4thEBE = fIntFlowCorrelationsEBE->GetBinContent(2)-2.*pow(fIntFlowCorrelationsEBE->GetBinContent(1),2.);
3031 if(cumulant4thEBE<0.)
3032 {
3033 vEBE = pow(-1.*cumulant4thEBE,0.25);
3034 if((vEBE>vMin && vEBE<vMax) && (fReferenceMultiplicityEBE>refMultMin && fReferenceMultiplicityEBE<refMultMax))
3035 {
3958eee6 3036 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f",fHarmonic,vEBE));
e5834fcb 3037 for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3038 {
3039 if(anEvent->GetTrack(p)->InRPSelection())
3040 {
3041 fPhiDistributionForOneEvent->Fill(anEvent->GetTrack(p)->Phi());
3042 }
3043 } // end of for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3958eee6 3044 } else
3045 {
3046 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f, out of specified boundaries",fHarmonic,vEBE));
3047 }
3048
e5834fcb 3049 } // end of if(cumulant4thEBE<0.)
3050
3051} // end of void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3052
3053//================================================================================================================================
489d5531 3054
3055void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3056{
0328db2d 3057 // Calculate averages of products of correlations for integrated flow.
489d5531 3058
2001bc3a 3059 // multiplicity:
1268c371 3060 Double_t dMult = (*fSpk)(0,0);
2001bc3a 3061
489d5531 3062 Int_t counter = 0;
3063
3064 for(Int_t ci1=1;ci1<4;ci1++)
3065 {
3066 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
3067 {
ff70ca91 3068 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
3069 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3070 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3071 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3072 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3073 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 3074 if(fCalculateCumulantsVsM)
3075 {
3076 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
3077 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3078 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3079 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3080 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3081 } // end of if(fCalculateCumulantsVsM)
ff70ca91 3082 counter++;
489d5531 3083 }
3084 }
3085
3086} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3087
3088
3089//================================================================================================================================
3090
3091
0328db2d 3092void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3093{
3094 // Calculate averages of products of correction terms for NUA.
3095
3096 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
3097 // 1st bin: <<2><cos(phi)>>
3098 // 2nd bin: <<2><sin(phi)>>
3099 // 3rd bin: <<cos(phi)><sin(phi)>>
3100 // 4th bin: <<2><cos(phi1+phi2)>>
3101 // 5th bin: <<2><sin(phi1+phi2)>>
3102 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
3103 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
3104 // 8th bin: <<4><cos(phi1)>>
3105 // 9th bin: <<4><sin(phi1)>>
3106 // 10th bin: <<4><cos(phi1+phi2)>>
3107 // 11th bin: <<4><sin(phi1+phi2)>>
3108 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
3109 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
3110 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
3111 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
3112 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
3113 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
3114 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
3115 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
3116 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
3117 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
3118 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
3119 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3120 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3121 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3122 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3123 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3124
3125 // <<2><cos(phi)>>:
3126 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
3127 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3128 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3129 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3130 // <<2><sin(phi)>>:
3131 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
3132 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3133 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3134 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3135 // <<cos(phi)><sin(phi)>>:
3136 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
3137 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3138 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3139 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3140 // <<2><cos(phi1+phi2)>>:
3141 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
3142 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3143 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3144 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3145 // <<2><sin(phi1+phi2)>>:
3146 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
3147 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3148 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3149 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3150 // <<2><cos(phi1-phi2-phi3)>>:
3151 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
3152 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3153 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3154 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3155 // <<2><sin(phi1-phi2-phi3)>>:
3156 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3157 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3158 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3159 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3160 // <<4><cos(phi1)>>:
3161 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3162 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3163 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3164 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3165 // <<4><sin(phi1)>>:
3166 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3167 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3168 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3169 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3170 // <<4><cos(phi1+phi2)>>:
3171 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3172 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3173 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3174 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3175 // <<4><sin(phi1+phi2)>>:
3176 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3177 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3178 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3179 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3180 // <<4><cos(phi1-phi2-phi3)>>:
3181 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3182 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3183 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3184 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3185 // <<4><sin(phi1-phi2-phi3)>>:
3186 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3187 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3188 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3189 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3190 // <<cos(phi1)><cos(phi1+phi2)>>:
3191 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3192 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3193 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3194 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3195 // <<cos(phi1)><sin(phi1+phi2)>>:
3196 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3197 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3198 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3199 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3200 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3201 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3202 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3203 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3204 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3205 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3206 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3207 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3208 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3209 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3210 // <<sin(phi1)><cos(phi1+phi2)>>:
3211 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3212 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3213 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3214 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3215 // <<sin(phi1)><sin(phi1+phi2)>>:
3216 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3217 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3218 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3219 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3220 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3221 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3222 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3223 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3224 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3225 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3226 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3227 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3228 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3229 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3230 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3231 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3232 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3233 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3234 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3235 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3236 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3237 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3238 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3239 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3240 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3241 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3242 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3243 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3244 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3245 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3246 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3247 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3248 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3249 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3250 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3251 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3252 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3253 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3254 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3255 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3256 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3257 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3258 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3259 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3260
3261} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3262
0328db2d 3263//================================================================================================================================
3264
489d5531 3265void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3266{
3267 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3268 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3269 // b) Store in histogram fIntFlowCovariances for instance the following:
3270 //
3271 // 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)]
3272 //
3273 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3274 // c) Binning of fIntFlowCovariances is organized as follows:
3275 //
3276 // 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)]
3277 // 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)]
3278 // 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)]
3279 // 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)]
3280 // 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)]
3281 // 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)]
b3dacf6b 3282 //
489d5531 3283
b3dacf6b 3284 // Average 2-, 4-, 6- and 8-particle correlations for all events:
489d5531 3285 Double_t correlation[4] = {0.};
3286 for(Int_t ci=0;ci<4;ci++)
3287 {
3288 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3289 }
b3dacf6b 3290 // Average products of 2-, 4-, 6- and 8-particle correlations:
489d5531 3291 Double_t productOfCorrelations[4][4] = {{0.}};
3292 Int_t productOfCorrelationsLabel = 1;
b3dacf6b 3293 // Denominators in the expressions for the unbiased estimator for covariance:
489d5531 3294 Double_t denominator[4][4] = {{0.}};
3295 Int_t sumOfProductOfEventWeightsLabel1 = 1;
b3dacf6b 3296 // Weight dependent prefactor which multiply unbiased estimators for covariances:
489d5531 3297 Double_t wPrefactor[4][4] = {{0.}};
3298 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3299 for(Int_t c1=0;c1<4;c1++)
3300 {
3301 for(Int_t c2=c1+1;c2<4;c2++)
3302 {
3303 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
b3dacf6b 3304 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
3305 {
3306 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
3307 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3308 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3309 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
3310 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3311 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
489d5531 3312 }
b3dacf6b 3313 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
489d5531 3314 sumOfProductOfEventWeightsLabel1++;
3315 sumOfProductOfEventWeightsLabel2++;
b3dacf6b 3316 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3317 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 3318
489d5531 3319 Int_t covarianceLabel = 1;
3320 for(Int_t c1=0;c1<4;c1++)
3321 {
3322 for(Int_t c2=c1+1;c2<4;c2++)
3323 {
b3dacf6b 3324 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
489d5531 3325 {
b3dacf6b 3326 // Covariances:
489d5531 3327 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
b3dacf6b 3328 // Covariances multiplied with weight dependent prefactor:
489d5531 3329 Double_t wCov = cov * wPrefactor[c1][c2];
3330 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3331 }
3332 covarianceLabel++;
b3dacf6b 3333 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3334 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 3335
b3dacf6b 3336 // Versus multiplicity:
3337 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 3338 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3339 for(Int_t b=1;b<=nBins;b++)
3340 {
b3dacf6b 3341 // Average 2-, 4-, 6- and 8-particle correlations for all events:
9da1a4f3 3342 Double_t correlationVsM[4] = {0.};
3343 for(Int_t ci=0;ci<4;ci++)
3344 {
3345 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3346 } // end of for(Int_t ci=0;ci<4;ci++)
b3dacf6b 3347 // Average products of 2-, 4-, 6- and 8-particle correlations:
9da1a4f3 3348 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
3349 Int_t productOfCorrelationsLabelVsM = 1;
b3dacf6b 3350 // Denominators in the expressions for the unbiased estimator for covariance:
9da1a4f3 3351 Double_t denominatorVsM[4][4] = {{0.}};
3352 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
b3dacf6b 3353 // Weight dependent prefactor which multiply unbiased estimators for covariances:
9da1a4f3 3354 Double_t wPrefactorVsM[4][4] = {{0.}};
3355 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
3356 for(Int_t c1=0;c1<4;c1++)
3357 {
3358 for(Int_t c2=c1+1;c2<4;c2++)
3359 {
3360 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
b3dacf6b 3361 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
3362 {
3363 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
3364 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3365 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3366 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
3367 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3368 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
9da1a4f3 3369 }
3370 productOfCorrelationsLabelVsM++;
3371 sumOfProductOfEventWeightsLabel1VsM++;
3372 sumOfProductOfEventWeightsLabel2VsM++;
3373 } // end of for(Int_t c1=0;c1<4;c1++)
3374 } // end of for(Int_t c2=c1+1;c2<4;c2++)
b3dacf6b 3375
9da1a4f3 3376 Int_t covarianceLabelVsM = 1;
3377 for(Int_t c1=0;c1<4;c1++)
3378 {
3379 for(Int_t c2=c1+1;c2<4;c2++)
3380 {
b3dacf6b 3381 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
9da1a4f3 3382 {
b3dacf6b 3383 // Covariances:
9da1a4f3 3384 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
b3dacf6b 3385 // Covariances multiplied with weight dependent prefactor:
9da1a4f3 3386 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
3387 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
3388 }
3389 covarianceLabelVsM++;
b3dacf6b 3390 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3391 } // end of for(Int_t c1=0;c1<4;c1++)
9da1a4f3 3392 } // end of for(Int_t b=1;b<=nBins;b++)
3393
489d5531 3394} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3395
489d5531 3396//================================================================================================================================
3397
0328db2d 3398void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3399{
3400 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3401 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3402 //
3403 // Cov(<2>,<cos(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<cos(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<cos(phi)>}_j)]
3404 //
3405 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3406 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3407 //
3408 // 1st bin: Cov(<2>,<cos(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<cos(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<cos(phi)>}_j)]
3409 // 2nd bin: Cov(<2>,<sin(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<sin(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<sin(phi)>}_j)]
3410 // 3rd bin: Cov(<cos(phi)>,<sin(phi)>) * (sum_{i=1}^{N} w_{<cos(phi)>}_i w_{<sin(phi)>}_i )/[(sum_{i=1}^{N} w_{<cos(phi)>}_i) * (sum_{j=1}^{N} w_{<sin(phi)>}_j)]
3411 // ...
3412
3413 // Cov(<2>,<cos(phi)>):
3414 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3415 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3416 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3417 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3418 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3419 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3420 // numerator in the expression for the the unbiased estimator for covariance:
3421 Double_t numerator1 = product1 - term1st1*term2nd1;
3422 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3423 Double_t denominator1 = 0.;
3424 if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3425 {
3426 denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3427 if(TMath::Abs(denominator1)>0.)
3428 {
3429 // covariance:
3430 Double_t covariance1 = numerator1/denominator1;
3431 // weight dependent prefactor for covariance:
3432 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3433 // finally, store "weighted" covariance:
3434 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3435 } // end of if(TMath::Abs(denominator)>0.)
3436 } // end of if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3437
0328db2d 3438 // Cov(<2>,<sin(phi)>):
3439 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3440 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3441 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3442 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3443 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3444 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3445 // numerator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3446 Double_t numerator2 = product2 - term1st2*term2nd2;
0328db2d 3447 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3448 Double_t denominator2 = 0.;
3449 if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
3450 {
3451 denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3452 if(TMath::Abs(denominator2)>0.)
3453 {
3454 // covariance:
3455 Double_t covariance2 = numerator2/denominator2;
3456 // weight dependent prefactor for covariance:
3457 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3458 // finally, store "weighted" covariance:
3459 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3460 } // end of if(TMath::Abs(denominator2)>0.)
3461 } // end of if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
0328db2d 3462
3463 // Cov(<cos(phi)>,<sin(phi)>):
3464 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3465 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3466 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3467 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3468 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3469 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3470 // numerator in the expression for the the unbiased estimator for covariance:
3471 Double_t numerator3 = product3 - term1st3*term2nd3;
3472 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3473 Double_t denominator3 = 0;
3474 if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
3475 {
3476 denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3477 if(TMath::Abs(denominator3)>0.)
3478 {
3479 // covariance:
3480 Double_t covariance3 = numerator3/denominator3;
3481 // weight dependent prefactor for covariance:
3482 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3483 // finally, store "weighted" covariance:
3484 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3485 } // end of if(TMath::Abs(denominator3)>0.)
3486 } // end of if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
0328db2d 3487
3488 // Cov(<2>,<cos(phi1+phi2)>):
3489 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3490 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3491 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3492 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3493 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3494 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3495 // numerator in the expression for the the unbiased estimator for covariance:
3496 Double_t numerator4 = product4 - term1st4*term2nd4;
3497 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3498 Double_t denominator4 = 0.;
3499 if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3500 {
3501 denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3502 if(TMath::Abs(denominator4)>0.)
3503 {
3504 // covariance:
3505 Double_t covariance4 = numerator4/denominator4;
3506 // weight dependent prefactor for covariance:
3507 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3508 // finally, store "weighted" covariance:
3509 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3510 } // end of if(TMath::Abs(denominator4)>0.)
3511 } // end of if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3512
0328db2d 3513 // Cov(<2>,<sin(phi1+phi2)>):
3514 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3515 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3516 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3517 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3518 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3519 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3520 // numerator in the expression for the the unbiased estimator for covariance:
3521 Double_t numerator5 = product5 - term1st5*term2nd5;
3522 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3523 Double_t denominator5 = 0.;
3524 if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3525 {
3526 denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3527 if(TMath::Abs(denominator5)>0.)
3528 {
3529 // covariance:
3530 Double_t covariance5 = numerator5/denominator5;
3531 // weight dependent prefactor for covariance:
3532 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3533 // finally, store "weighted" covariance:
3534 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3535 } // end of if(TMath::Abs(denominator5)>0.)
3536 } // end of if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3537
0328db2d 3538 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3539 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3540 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3541 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3542 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3543 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3544 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3545 // numerator in the expression for the the unbiased estimator for covariance:
3546 Double_t numerator6 = product6 - term1st6*term2nd6;
3547 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3548 Double_t denominator6 = 0.;
3549 if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3550 {
3551 denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3552 if(TMath::Abs(denominator6)>0.)
3553 {
3554 // covariance:
3555 Double_t covariance6 = numerator6/denominator6;
3556 // weight dependent prefactor for covariance:
3557 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3558 // finally, store "weighted" covariance:
3559 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3560 } // end of if(TMath::Abs(denominator6)>0.)
3561 } // end of if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3562
0328db2d 3563 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3564 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3565 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3566 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3567 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3568 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3569 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3570 // numerator in the expression for the the unbiased estimator for covariance:
3571 Double_t numerator7 = product7 - term1st7*term2nd7;
3572 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3573 Double_t denominator7 = 0.;
3574 if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3575 {
3576 denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3577 if(TMath::Abs(denominator7)>0.)
3578 {
3579 // covariance:
3580 Double_t covariance7 = numerator7/denominator7;
3581 // weight dependent prefactor for covariance:
3582 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3583 // finally, store "weighted" covariance:
3584 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3585 } // end of if(TMath::Abs(denominator7)>0.)
3586 } // end of if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3587
0328db2d 3588 // Cov(<4>,<cos(phi1>):
3589 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3590 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3591 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3592 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3593 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3594 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3595 // numerator in the expression for the the unbiased estimator for covariance:
3596 Double_t numerator8 = product8 - term1st8*term2nd8;
3597 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3598 Double_t denominator8 = 0.;
3599 if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3600 {
3601 denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3602 if(TMath::Abs(denominator8)>0.)
3603 {
3604 // covariance:
3605 Double_t covariance8 = numerator8/denominator8;
3606 // weight dependent prefactor for covariance:
3607 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3608 // finally, store "weighted" covariance:
3609 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3610 } // end of if(TMath::Abs(denominator8)>0.)
3611 } // end of if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3612
0328db2d 3613 // Cov(<4>,<sin(phi1)>):
3614 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3615 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3616 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3617 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3618 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3619 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3620 // numerator in the expression for the the unbiased estimator for covariance:
3621 Double_t numerator9 = product9 - term1st9*term2nd9;
3622 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3623 Double_t denominator9 = 0.;
3624 if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3625 {
3626 denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3627 if(TMath::Abs(denominator9)>0.)
3628 {
3629 // covariance:
3630 Double_t covariance9 = numerator9/denominator9;
3631 // weight dependent prefactor for covariance:
3632 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3633 // finally, store "weighted" covariance:
3634 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3635 }
3636 } // end of if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3637
0328db2d 3638 // Cov(<4>,<cos(phi1+phi2)>):
3639 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3640 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3641 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3642 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3643 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3644 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3645 // numerator in the expression for the the unbiased estimator for covariance:
3646 Double_t numerator10 = product10 - term1st10*term2nd10;
3647 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3648 Double_t denominator10 = 0.;
3649 if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3650 {
3651 denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3652 if(TMath::Abs(denominator10)>0.)
3653 {
3654 // covariance:
3655 Double_t covariance10 = numerator10/denominator10;
3656 // weight dependent prefactor for covariance:
3657 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3658 // finally, store "weighted" covariance:
3659 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3660 } // end of if(TMath::Abs(denominator10)>0.)
3661 } // end of if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3662
0328db2d 3663 // Cov(<4>,<sin(phi1+phi2)>):
3664 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3665 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3666 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3667 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3668 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3669 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3670 // numerator in the expression for the the unbiased estimator for covariance:
3671 Double_t numerator11 = product11 - term1st11*term2nd11;
3672 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3673 Double_t denominator11 = 0.;
3674 if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
3675 {
3676 denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3677 if(TMath::Abs(denominator11)>0.)
3678 {
3679 // covariance:
3680 Double_t covariance11 = numerator11/denominator11;
3681 // weight dependent prefactor for covariance:
3682 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3683 // finally, store "weighted" covariance:
3684 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3685 } // end of if(TMath::Abs(denominator11)>0.)
3686 } // end of if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
0328db2d 3687
3688 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3689 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3690 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3691 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3692 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3693 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3694 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3695 // numerator in the expression for the the unbiased estimator for covariance:
3696 Double_t numerator12 = product12 - term1st12*term2nd12;
3697 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3698 Double_t denominator12 = 0.;
3699 if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
3700 {
3701 denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3702 if(TMath::Abs(denominator12)>0.)
3703 {
3704 // covariance:
3705 Double_t covariance12 = numerator12/denominator12;
3706 // weight dependent prefactor for covariance:
3707 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3708 // finally, store "weighted" covariance:
3709 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3710 } // end of if(TMath::Abs(denominator12)>0.)
3711 } // end of if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
0328db2d 3712
3713 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3714 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3715 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3716 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3717 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3718 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3719 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3720 // numerator in the expression for the the unbiased estimator for covariance:
3721 Double_t numerator13 = product13 - term1st13*term2nd13;
3722 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3723 Double_t denominator13 = 0.;
3724 if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
3725 {
3726 denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3727 if(TMath::Abs(denominator13)>0.)
3728 {
3729 // covariance:
3730 Double_t covariance13 = numerator13/denominator13;
3731 // weight dependent prefactor for covariance:
3732 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3733 // finally, store "weighted" covariance:
3734 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3735 } // end of if(TMath::Abs(denominator13)>0.)
3736 } // end of if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
0328db2d 3737
3738 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3739 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3740 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3741 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3742 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3743 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3744 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3745 // numerator in the expression for the the unbiased estimator for covariance:
3746 Double_t numerator14 = product14 - term1st14*term2nd14;
3747 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3748 Double_t denominator14 = 0.;
3749 if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
3750 {
3751 denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3752 if(TMath::Abs(denominator14)>0.)
3753 {
3754 // covariance:
3755 Double_t covariance14 = numerator14/denominator14;
3756 // weight dependent prefactor for covariance:
3757 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3758 // finally, store "weighted" covariance:
3759 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3760 } // end of if(TMath::Abs(denominator14)>0.)
3761 } // end of if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
0328db2d 3762
3763 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3764 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3765 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3766 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3767 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3768 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3769 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3770 // numerator in the expression for the the unbiased estimator for covariance:
3771 Double_t numerator15 = product15 - term1st15*term2nd15;
3772 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3773 Double_t denominator15 = 0.;
3774 if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3775 {
3776 denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3777 if(TMath::Abs(denominator15)>0.)
3778 {
3779 // covariance:
3780 Double_t covariance15 = numerator15/denominator15;
3781 // weight dependent prefactor for covariance:
3782 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3783 // finally, store "weighted" covariance:
3784 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3785 } // end of if(TMath::Abs(denominator15)>0.)
3786 } // end of if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3787
0328db2d 3788 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3789 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3790 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3791 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3792 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3793 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3794 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3795 // numerator in the expression for the the unbiased estimator for covariance:
3796 Double_t numerator16 = product16 - term1st16*term2nd16;
3797 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3798 Double_t denominator16 = 0.;
3799 if(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3800 {
3801 denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3802 if(TMath::Abs(denominator16)>0.)
3803 {
3804 // covariance:
3805 Double_t covariance16 = numerator16/denominator16;
3806 // weight dependent prefactor for covariance:
3807 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3808 // finally, store "weighted" covariance:
3809 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3810 } // end of if(TMath::Abs(denominator16)>0.)
3811 } // end ofif(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3812
0328db2d 3813 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3814 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3815 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3816 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3817 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3818 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3819 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3820 // numerator in the expression for the the unbiased estimator for covariance:
3821 Double_t numerator17 = product17 - term1st17*term2nd17;
3822 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3823 Double_t denominator17 = 0.;
3824 if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
3825 {
3826 denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3827 if(TMath::Abs(denominator17)>0.)
3828 {
3829 // covariance:
3830 Double_t covariance17 = numerator17/denominator17;
3831 // weight dependent prefactor for covariance:
3832 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3833 // finally, store "weighted" covariance:
3834 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3835 } // end of if(TMath::Abs(denominator17)>0.)
3836 } // end of if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
0328db2d 3837
3838 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3839 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3840 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3841 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3842 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3843 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3844 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3845 // numerator in the expression for the the unbiased estimator for covariance:
3846 Double_t numerator18 = product18 - term1st18*term2nd18;
3847 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3848 Double_t denominator18 = 0.;
3849 if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
3850 {
3851 denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3852 if(TMath::Abs(denominator18)>0.)
3853 {
3854 // covariance:
3855 Double_t covariance18 = numerator18/denominator18;
3856 // weight dependent prefactor for covariance:
3857 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3858 // finally, store "weighted" covariance:
3859 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3860 } // end of if(TMath::Abs(denominator18)>0.)
3861 } // end of if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
0328db2d 3862
3863 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3864 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3865 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3866 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3867 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3868 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3869 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3870 // numerator in the expression for the the unbiased estimator for covariance:
3871 Double_t numerator19 = product19 - term1st19*term2nd19;
3872 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3873 Double_t denominator19 = 0.;
3874 if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3875 {
3876 denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3877 if(TMath::Abs(denominator19)>0.)
3878 {
3879 // covariance:
3880 Double_t covariance19 = numerator19/denominator19;
3881 // weight dependent prefactor for covariance:
3882 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3883 // finally, store "weighted" covariance:
3884 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3885 } // end of if(TMath::Abs(denominator19)>0.)
3886 } // end of if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3887
0328db2d 3888 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3889 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3890 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3891 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3892 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3893 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3894 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3895 // numerator in the expression for the the unbiased estimator for covariance:
3896 Double_t numerator20 = product20 - term1st20*term2nd20;
3897 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3898 Double_t denominator20 = 0.;
3899 if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
3900 {
3901 denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3902 if(TMath::Abs(denominator20)>0.)
3903 {
3904 // covariance:
3905 Double_t covariance20 = numerator20/denominator20;
3906 // weight dependent prefactor for covariance:
3907 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3908 // finally, store "weighted" covariance:
3909 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3910 } // end of if(TMath::Abs(denominator20)>0.)
3911 } // end of if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
0328db2d 3912
3913 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3914 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3915 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3916 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3917 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3918 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3919 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3920 // numerator in the expression for the the unbiased estimator for covariance:
3921 Double_t numerator21 = product21 - term1st21*term2nd21;
3922 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3923 Double_t denominator21 = 0.;
3924 if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
3925 {
3926 denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3927 if(TMath::Abs(denominator21)>0.)
3928 {
3929 // covariance:
3930 Double_t covariance21 = numerator21/denominator21;
3931 // weight dependent prefactor for covariance:
3932 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3933 // finally, store "weighted" covariance:
3934 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3935 } // end of if(TMath::Abs(denominator21)>0.)
3936 } // end of if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
0328db2d 3937
3938 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3939 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3940 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3941 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3942 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3943 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3944 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3945 // numerator in the expression for the the unbiased estimator for covariance:
3946 Double_t numerator22 = product22 - term1st22*term2nd22;
3947 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3948 Double_t denominator22 = 0.;
3949 if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
3950 {
3951 denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3952 if(TMath::Abs(denominator22)>0.)
3953 {
3954 // covariance:
3955 Double_t covariance22 = numerator22/denominator22;
3956 // weight dependent prefactor for covariance:
3957 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3958 // finally, store "weighted" covariance:
3959 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3960 } // end of if(TMath::Abs(denominator22)>0.)
3961 } // end of if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
0328db2d 3962
3963 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3964 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3965 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3966 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3967 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3968 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3969 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3970 // numerator in the expression for the the unbiased estimator for covariance:
3971 Double_t numerator23 = product23 - term1st23*term2nd23;
3972 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3973 Double_t denominator23 = 0.;
3974 if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
3975 {
3976 denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3977 if(TMath::Abs(denominator23)>0.)
3978 {
3979 // covariance:
3980 Double_t covariance23 = numerator23/denominator23;
3981 // weight dependent prefactor for covariance:
3982 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3983 // finally, store "weighted" covariance:
3984 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
3985 } // end of if(TMath::Abs(denominator23)>0.)
3986 } // end of if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
3987
0328db2d 3988 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3989 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3990 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3991 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3992 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3993 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3994 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3995 // numerator in the expression for the the unbiased estimator for covariance:
3996 Double_t numerator24 = product24 - term1st24*term2nd24;
3997 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3998 Double_t denominator24 = 0.;
3999 if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4000 {
4001 denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4002 if(TMath::Abs(denominator24)>0.)
4003 {
4004 // covariance:
4005 Double_t covariance24 = numerator24/denominator24;
4006 // weight dependent prefactor for covariance:
4007 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4008 // finally, store "weighted" covariance:
4009 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
4010 } // end of if(TMath::Abs(denominator24)>0.)
4011 } // end of if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
0328db2d 4012
4013 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4014 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
4015 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4016 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4017 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4018 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4019 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4020 // numerator in the expression for the the unbiased estimator for covariance:
4021 Double_t numerator25 = product25 - term1st25*term2nd25;
4022 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4023 Double_t denominator25 = 0.;
4024 if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4025 {
4026 denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4027 if(TMath::Abs(denominator25)>0.)
4028 {
4029 // covariance:
4030 Double_t covariance25 = numerator25/denominator25;
4031 // weight dependent prefactor for covariance:
4032 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4033 // finally, store "weighted" covariance:
4034 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
4035 } // end of if(TMath::Abs(denominator25)>0.)
4036 } // end of if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4037
0328db2d 4038 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4039 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
4040 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4041 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4042 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4043 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4044 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4045 // numerator in the expression for the the unbiased estimator for covariance:
4046 Double_t numerator26 = product26 - term1st26*term2nd26;
4047 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4048 Double_t denominator26 = 0.;
4049 if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4050 {
4051 denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4052 if(TMath::Abs(denominator26)>0.)
4053 {
4054 // covariance:
4055 Double_t covariance26 = numerator26/denominator26;
4056 // weight dependent prefactor for covariance:
4057 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4058 // finally, store "weighted" covariance:
4059 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
4060 } // end of if(TMath::Abs(denominator26)>0.)
4061 } // end of if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4062
0328db2d 4063 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
4064 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
b92ea2b9 4065 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
0328db2d 4066 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
b92ea2b9 4067 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
0328db2d 4068 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4069 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
4070 // numerator in the expression for the the unbiased estimator for covariance:
4071 Double_t numerator27 = product27 - term1st27*term2nd27;
4072 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4073 Double_t denominator27 = 0.;
4074 if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4075 {
4076 denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4077 if(TMath::Abs(denominator27)>0.)
4078 {
4079 // covariance:
4080 Double_t covariance27 = numerator27/denominator27;
4081 // weight dependent prefactor for covariance:
4082 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4083 // finally, store "weighted" covariance:
4084 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
4085 } // end of if(TMath::Abs(denominator27)>0.)
4086 } // end of if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4087
0328db2d 4088} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4089
0328db2d 4090//================================================================================================================================
4091
489d5531 4092void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4093{
4094 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
4095 // correctly calculate the statistical errors and store the final results and
4096 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
4097 //
4098 // Remark: Statistical error of correlation is calculated as:
4099 //
4100 // statistical error = termA * spread * termB:
4101 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
4102 // termB = 1/sqrt(1-termA^2)
b3dacf6b 4103 //
4104
489d5531 4105 for(Int_t ci=1;ci<=4;ci++) // correlation index
4106 {
b40a910e 4107 if(fIntFlowCorrelationsPro->GetBinEffectiveEntries(ci) < 2 || fIntFlowSquaredCorrelationsPro->GetBinEffectiveEntries(ci) < 2)
4108 {
4109 fIntFlowCorrelationsPro->SetBinError(ci,0.);
4110 fIntFlowSquaredCorrelationsPro->SetBinError(ci,0.);
4111 continue;
4112 }
489d5531 4113 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
b40a910e 4114 Double_t squaredCorrelation = fIntFlowSquaredCorrelationsPro->GetBinContent(ci);
4115 Double_t spread = 0.;
4116 if(squaredCorrelation-correlation*correlation >= 0.)
4117 {
4118 spread = pow(squaredCorrelation-correlation*correlation,0.5);
4119 } else
4120 {
4121 cout<<endl;
4122 cout<<Form(" WARNING: Imaginary 'spread' for %d-particle correlation!!!! ",2*ci)<<endl;
4123 cout<<endl;
4124 }
489d5531 4125 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
4126 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
4127 Double_t termA = 0.;
4128 Double_t termB = 0.;
b3dacf6b 4129 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
489d5531 4130 {
4131 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
4132 } else
4133 {
b3dacf6b 4134 cout<<endl;
4135 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4136 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4137 cout<<endl;
489d5531 4138 }
4139 if(1.-pow(termA,2.) > 0.)
4140 {
4141 termB = 1./pow(1-pow(termA,2.),0.5);
4142 } else
4143 {
b3dacf6b 4144 cout<<endl;
4145 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4146 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4147 cout<<endl;
489d5531 4148 }
4149 Double_t statisticalError = termA * spread * termB;
4150 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
4151 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
ff70ca91 4152 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4153
b3dacf6b 4154 // Versus multiplicity:
4155 if(!fCalculateCumulantsVsM){return;}
ff70ca91 4156 for(Int_t ci=0;ci<=3;ci++) // correlation index
4157 {
4158 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
4159 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
4160 {
b40a910e 4161 if(fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2 || fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2)
4162 {
4163 fIntFlowCorrelationsVsMPro[ci]->SetBinError(b,0.);
4164 fIntFlowSquaredCorrelationsVsMPro[ci]->SetBinError(b,0.);
4165 continue;
4166 }
ff70ca91 4167 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
b40a910e 4168 Double_t squaredCorrelationVsM = fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinContent(b);
4169 Double_t spreadVsM = 0.;
4170 if(squaredCorrelationVsM-correlationVsM*correlationVsM >= 0.)
4171 {
4172 spreadVsM = pow(squaredCorrelationVsM-correlationVsM*correlationVsM,0.5);
4173 } else
4174 {
4175 cout<<endl;
4176 cout<<Form(" WARNING (QC): Imaginary 'spreadVsM' for ci = %d, bin = %d, entries = %f !!!!",
4177 ci,b,fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b))<<endl;
4178 cout<<endl;
4179 }
ff70ca91 4180 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
4181 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
4182 Double_t termAVsM = 0.;
4183 Double_t termBVsM = 0.;
b40a910e 4184 if(sumOfLinearEventWeightsVsM > 0.)
ff70ca91 4185 {
4186 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
b3dacf6b 4187 }
ff70ca91 4188 if(1.-pow(termAVsM,2.) > 0.)
4189 {
4190 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
b3dacf6b 4191 }
ff70ca91 4192 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
4193 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
4194 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
4195 } // end of for(Int_t b=1;b<=nBins;b++)
4196 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4197
489d5531 4198} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4199
489d5531 4200//================================================================================================================================
4201
489d5531 4202void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
4203{
b77b6434 4204 // Fill profile fAverageMultiplicity to hold average multiplicities and
4205 // number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
489d5531 4206
4207 // Binning of fAverageMultiplicity is organized as follows:
4208 // 1st bin: all events (including the empty ones)
4209 // 2nd bin: event with # of RPs greater or equal to 1
4210 // 3rd bin: event with # of RPs greater or equal to 2
4211 // 4th bin: event with # of RPs greater or equal to 3
4212 // 5th bin: event with # of RPs greater or equal to 4
4213 // 6th bin: event with # of RPs greater or equal to 5
4214 // 7th bin: event with # of RPs greater or equal to 6
4215 // 8th bin: event with # of RPs greater or equal to 7
4216 // 9th bin: event with # of RPs greater or equal to 8
4217
489d5531 4218 if(nRP<0)
4219 {
b77b6434 4220 cout<<endl;
4221 cout<<" WARNING (QC): nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
4222 cout<<endl;
489d5531 4223 exit(0);
4224 }
4225
4226 for(Int_t i=0;i<9;i++)
4227 {
b77b6434 4228 if(nRP>=i){fAvMultiplicity->Fill(i+0.5,nRP,1);}
489d5531 4229 }
4230
4231} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
4232
489d5531 4233//================================================================================================================================
4234
489d5531 4235void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
b3dacf6b 4236{
b92ea2b9 4237 // a) Calculate Q-cumulants from the measured multiparticle correlations;
4238 // b) Propagate the statistical errors from measured multiparticle correlations to statistical errors of Q-cumulants;
4239 // c) Remark: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
4240 // Method CalculateQcumulantsCorrectedForNUAIntFlow() is called afterwards to correct for this bias;
4241 // d) Store the results and statistical error of Q-cumulants in histogram fIntFlowQcumulants.
4242 // Binning of fIntFlowQcumulants is organized as follows:
489d5531 4243 //
b3dacf6b 4244 // 1st bin: QC{2}
4245 // 2nd bin: QC{4}
4246 // 3rd bin: QC{6}
4247 // 4th bin: QC{8}
4248 //
489d5531 4249
b3dacf6b 4250 // Correlations:
489d5531 4251 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4252 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4253 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4254 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
b3dacf6b 4255 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
489d5531 4256 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4257 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4258 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4259 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
b3dacf6b 4260 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 4261 Double_t wCov24 = 0.; // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4262 Double_t wCov26 = 0.; // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4263 Double_t wCov28 = 0.; // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4264 Double_t wCov46 = 0.; // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4265 Double_t wCov48 = 0.; // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4266 Double_t wCov68 = 0.; // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4267 if(!fForgetAboutCovariances)
4268 {
4269 wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4270 wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4271 wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4272 wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4273 wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4274 wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4275 }
489d5531 4276 // Q-cumulants:
4277 Double_t qc2 = 0.; // QC{2}
4278 Double_t qc4 = 0.; // QC{4}
4279 Double_t qc6 = 0.; // QC{6}
4280 Double_t qc8 = 0.; // QC{8}
b3dacf6b 4281 if(TMath::Abs(two) > 0.){qc2 = two;}
4282 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4283 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4284 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4285 // Statistical errors of Q-cumulants:
489d5531 4286 Double_t qc2Error = 0.;
4287 Double_t qc4Error = 0.;
4288 Double_t qc6Error = 0.;
b3dacf6b 4289 Double_t qc8Error = 0.;
4290 // Squared statistical errors of Q-cumulants:
489d5531 4291 //Double_t qc2ErrorSquared = 0.;
4292 Double_t qc4ErrorSquared = 0.;
4293 Double_t qc6ErrorSquared = 0.;
b3dacf6b 4294 Double_t qc8ErrorSquared = 0.;
4295 // Statistical error of QC{2}:
4296 qc2Error = twoError;
4297 // Statistical error of QC{4}:
489d5531 4298 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4299 - 8.*two*wCov24;
4300 if(qc4ErrorSquared>0.)
4301 {
4302 qc4Error = pow(qc4ErrorSquared,0.5);
4303 } else
4304 {
b3dacf6b 4305 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
4306 }
4307 // Statistical error of QC{6}:
489d5531 4308 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4309 + 81.*pow(two,2.)*pow(fourError,2.)
4310 + pow(sixError,2.)
4311 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4312 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 4313 - 18.*two*wCov46;
489d5531 4314 if(qc6ErrorSquared>0.)
4315 {
4316 qc6Error = pow(qc6ErrorSquared,0.5);
4317 } else
4318 {
b3dacf6b 4319 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
4320 }
4321 // Statistical error of QC{8}:
489d5531 4322 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4323 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4324 + 256.*pow(two,2.)*pow(sixError,2.)
4325 + pow(eightError,2.)
4326 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4327 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4328 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4329 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4330 + 72.*(4.*pow(two,2.)-four)*wCov48
4331 - 32.*two*wCov68;
4332 if(qc8ErrorSquared>0.)
4333 {
4334 qc8Error = pow(qc8ErrorSquared,0.5);
4335 } else
4336 {
b3dacf6b 4337 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
489d5531 4338 }
b3dacf6b 4339 // Store the results and statistical errors for Q-cumulants:
4340 if(TMath::Abs(qc2)>0.)
4341 {
4342 fIntFlowQcumulants->SetBinContent(1,qc2);
4343 fIntFlowQcumulants->SetBinError(1,qc2Error);
4344 }
4345 if(TMath::Abs(qc4)>0.)
4346 {
4347 fIntFlowQcumulants->SetBinContent(2,qc4);
4348 fIntFlowQcumulants->SetBinError(2,qc4Error);
4349 }
4350 if(TMath::Abs(qc6)>0.)
4351 {
4352 fIntFlowQcumulants->SetBinContent(3,qc6);
4353 fIntFlowQcumulants->SetBinError(3,qc6Error);
4354 }
4355 if(TMath::Abs(qc8)>0.)
4356 {
4357 fIntFlowQcumulants->SetBinContent(4,qc8);
4358 fIntFlowQcumulants->SetBinError(4,qc8Error);
4359 }
4360
4361 // Versus multiplicity:
4362 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 4363 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b3dacf6b 4364 Double_t value[4] = {0.}; // QCs vs M
4365 Double_t error[4] = {0.}; // error of QCs vs M
4366 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
4367 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
9da1a4f3 4368 for(Int_t b=1;b<=nBins;b++)
4369 {
b3dacf6b 4370 // Correlations:
9da1a4f3 4371 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
4372 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
4373 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
4374 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
b3dacf6b 4375 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
9da1a4f3 4376 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
4377 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
4378 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
4379 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
b3dacf6b 4380 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 4381 if(!fForgetAboutCovariances)
4382 {
4383 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4384 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4385 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4386 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4387 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4388 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4389 }
9da1a4f3 4390 // Q-cumulants:
4391 qc2 = 0.; // QC{2}
4392 qc4 = 0.; // QC{4}
4393 qc6 = 0.; // QC{6}
4394 qc8 = 0.; // QC{8}
b3dacf6b 4395 if(TMath::Abs(two) > 0.){qc2 = two;}
4396 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4397 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4398 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4399 // Statistical errors of Q-cumulants:
9da1a4f3 4400 qc2Error = 0.;
4401 qc4Error = 0.;
4402 qc6Error = 0.;
b3dacf6b 4403 qc8Error = 0.;
4404 // Squared statistical errors of Q-cumulants:
9da1a4f3 4405 //Double_t qc2ErrorSquared = 0.;
4406 qc4ErrorSquared = 0.;
4407 qc6ErrorSquared = 0.;
b3dacf6b 4408 qc8ErrorSquared = 0.;
4409 // Statistical error of QC{2}:
4410 qc2Error = twoError;
4411 // Statistical error of QC{4}:
9da1a4f3 4412 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4413 - 8.*two*wCov24;
4414 if(qc4ErrorSquared>0.)
4415 {
4416 qc4Error = pow(qc4ErrorSquared,0.5);
4417 } else
4418 {
4419 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 4420 }
4421 // Statistical error of QC{6}:
9da1a4f3 4422 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4423 + 81.*pow(two,2.)*pow(fourError,2.)
4424 + pow(sixError,2.)
4425 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4426 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 4427 - 18.*two*wCov46;
9da1a4f3 4428 if(qc6ErrorSquared>0.)
4429 {
4430 qc6Error = pow(qc6ErrorSquared,0.5);
4431 } else
4432 {
4433 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 4434 }
4435 // Statistical error of QC{8}:
9da1a4f3 4436 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4437 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4438 + 256.*pow(two,2.)*pow(sixError,2.)
4439 + pow(eightError,2.)
4440 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4441 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4442 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4443 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4444 + 72.*(4.*pow(two,2.)-four)*wCov48
4445 - 32.*two*wCov68;
4446 if(qc8ErrorSquared>0.)
4447 {
4448 qc8Error = pow(qc8ErrorSquared,0.5);
4449 } else
4450 {
4451 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4452 }
b3dacf6b 4453 // Store the results and statistical errors for Q-cumulants:
4454 if(TMath::Abs(qc2)>0.)
4455 {
4456 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
4457 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
4458 }
4459 if(TMath::Abs(qc4)>0.)
4460 {
4461 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
4462 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
4463 }
4464 if(TMath::Abs(qc6)>0.)
4465 {
4466 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
4467 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
4468 }
4469 if(TMath::Abs(qc8)>0.)
4470 {
4471 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
4472 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
4473 }
4474 // Rebin in M:
4475 for(Int_t co=0;co<4;co++)
4476 {
b40a910e 4477 if(fIntFlowCorrelationsVsMPro[co]->GetBinEffectiveEntries(b)<2){continue;}
b3dacf6b 4478 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
4479 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
4480 if(error[co]>0.)
4481 {
4482 dSum1[co]+=value[co]/(error[co]*error[co]);
4483 dSum2[co]+=1./(error[co]*error[co]);
4484 }
4485 } // end of for(Int_t co=0;co<4;co++)
9da1a4f3 4486 } // end of for(Int_t b=1;b<=nBins;b++)
b3dacf6b 4487 // Store rebinned Q-cumulants:
4488 for(Int_t co=0;co<4;co++)
4489 {
4490 if(dSum2[co]>0.)
4491 {
4492 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
4493 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
4494 }
4495 } // end of for(Int_t co=0;co<4;co++)
4496
489d5531 4497} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4498
489d5531 4499//================================================================================================================================
4500
b92ea2b9 4501void AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 4502{
b92ea2b9 4503 // a) Calculate the final results for reference flow estimates from Q-cumulants;
4504 // b) Propagate the statistical errors to reference flow estimates from statistical error of Q-cumulants;
0328db2d 4505 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
489d5531 4506 // Binning of fIntFlow is organized as follows:
4507 //
b3dacf6b 4508 // 1st bin: v{2,QC}
4509 // 2nd bin: v{4,QC}
4510 // 3rd bin: v{6,QC}
4511 // 4th bin: v{8,QC}
4512 //
489d5531 4513
b3dacf6b 4514 // Reference flow estimates:
489d5531 4515 Double_t v2 = 0.; // v{2,QC}
4516 Double_t v4 = 0.; // v{4,QC}
4517 Double_t v6 = 0.; // v{6,QC}
4518 Double_t v8 = 0.; // v{8,QC}
b3dacf6b 4519 // Reference flow's statistical errors:
4520 Double_t v2Error = 0.; // v{2,QC} stat. error
4521 Double_t v4Error = 0.; // v{4,QC} stat. error
4522 Double_t v6Error = 0.; // v{6,QC} stat. error
4523 Double_t v8Error = 0.; // v{8,QC} stat. error
4524
b92ea2b9 4525 // Q-cumulants:
4526 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
4527 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
4528 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
4529 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
4530 // Q-cumulants's statistical errors:
4531 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
4532 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
4533 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
4534 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
4535 // Calculate reference flow estimates from Q-cumulants:
1268c371 4536 if(qc2>=0.){v2 = pow(qc2,0.5);}
b92ea2b9 4537 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
4538 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
4539 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
4540 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 4541 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-0.5)*qc2Error;}
b92ea2b9 4542 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
4543 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
4544 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
4545 // Print warnings for the 'wrong sign' cumulants:
4546 if(TMath::Abs(v2) < 1.e-44)
4547 {
4548 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
4549 }
4550 if(TMath::Abs(v4) < 1.e-44)
4551 {
4552 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
4553 }
4554 if(TMath::Abs(v6) < 1.e-44)
4555 {
4556 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
4557 }
4558 if(TMath::Abs(v8) < 1.e-44)
4559 {
4560 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
4561 }
4562 // Store the results and statistical errors of integrated flow estimates:
4563 fIntFlow->SetBinContent(1,v2);
4564 fIntFlow->SetBinError(1,v2Error);
4565 fIntFlow->SetBinContent(2,v4);
4566 fIntFlow->SetBinError(2,v4Error);
4567 fIntFlow->SetBinContent(3,v6);
4568 fIntFlow->SetBinError(3,v6Error);
4569 fIntFlow->SetBinContent(4,v8);
4570 fIntFlow->SetBinError(4,v8Error);
4571
4572 // Versus multiplicity:
4573 if(!fCalculateCumulantsVsM){return;}
4574 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4575 for(Int_t b=1;b<=nBins;b++)
9da1a4f3 4576 {
4577 // Q-cumulants:
b92ea2b9 4578 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
4579 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
4580 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
4581 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
b3dacf6b 4582 // Q-cumulants's statistical errors:
b92ea2b9 4583 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
4584 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
4585 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
4586 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
b3dacf6b 4587 // Reference flow estimates:
b92ea2b9 4588 Double_t v2VsM = 0.; // v{2,QC}
4589 Double_t v4VsM = 0.; // v{4,QC}
4590 Double_t v6VsM = 0.; // v{6,QC}
4591 Double_t v8VsM = 0.; // v{8,QC}
4592 // Reference flow estimates errors:
4593 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
4594 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
4595 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
4596 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
b3dacf6b 4597 // Calculate reference flow estimates from Q-cumulants:
1268c371 4598 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,0.5);}
b92ea2b9 4599 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
4600 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
4601 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
b3dacf6b 4602 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 4603 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-0.5)*qc2ErrorVsM;}
b92ea2b9 4604 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
4605 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
4606 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
b3dacf6b 4607 // Store the results and statistical errors of integrated flow estimates:
b92ea2b9 4608 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
4609 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
4610 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
4611 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
4612 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
4613 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
4614 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
4615 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
4616 } // end of for(Int_t b=1;b<=nBins;b++)
4617
4618 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
4619 // Reference flow estimates:
4620 Double_t v2RebinnedInM = 0.; // v{2,QC}
4621 Double_t v4RebinnedInM = 0.; // v{4,QC}
4622 Double_t v6RebinnedInM = 0.; // v{6,QC}
4623 Double_t v8RebinnedInM = 0.; // v{8,QC}
4624 // Reference flow's statistical errors:
4625 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
4626 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
4627 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
4628 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
4629 // Q-cumulants:
4630 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
4631 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
4632 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
4633 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
4634 // Q-cumulants's statistical errors:
4635 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
4636 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
4637 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
4638 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
4639 // Calculate reference flow estimates from Q-cumulants:
1268c371 4640 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,0.5);}
b92ea2b9 4641 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
4642 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
4643 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
4644 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 4645 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-0.5)*qc2ErrorRebinnedInM;}
b92ea2b9 4646 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
4647 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
4648 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
4649 // Print warnings for the 'wrong sign' cumulants:
4650 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
4651 {
4652 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
4653 }
4654 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
4655 {
4656 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
4657 }
4658 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
4659 {
4660 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
4661 }
4662 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
4663 {
4664 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
4665 }
4666 // Store the results and statistical errors of integrated flow estimates:
4667 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
4668 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
4669 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
4670 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
4671 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
4672 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
4673 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
4674 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
4675
4676} // end of AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 4677
489d5531 4678//================================================================================================================================
4679
489d5531 4680void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4681{
0dd3b008 4682 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
489d5531 4683
0dd3b008 4684 // There are two possibilities here:
4685 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
4686 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
4687 // also stored in local histogram fIntFlow;
4688 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
4689 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
4690 // is also stored in local histogram fIntFlowRebinnedInM.
489d5531 4691
0dd3b008 4692 // Reference flow estimates:
4693 Double_t v[4] = {0.};
4694 // Statistical errors of reference flow estimates:
4695 Double_t vError[4] = {0.};
489d5531 4696
0dd3b008 4697 for(Int_t b=0;b<4;b++)
4698 {
4699 if(fMinimumBiasReferenceFlow)
4700 {
4701 v[b] = fIntFlow->GetBinContent(b+1);
4702 vError[b] = fIntFlow->GetBinError(b+1);
4703 } else
4704 {
4705 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
4706 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
4707 }
4708 } // end of for(Int_t b=0;b<4;b++)
4709
4710 // Fill AliFlowCommonHistResults histogram:
4711 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
4712 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
489d5531 4713 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4714 {
0dd3b008 4715 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
4716 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
489d5531 4717 }
4718
4719} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4720
489d5531 4721//================================================================================================================================
4722
489d5531 4723void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4724{
4725 // Calculate all correlations needed for integrated flow using particle weights.
4726
4727 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4728 //
4729 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4730 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4731 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4732 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4733 // 5th bin: ---- EMPTY ----
4734 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4735 // 7th bin: <3>_{3n|2n,1n} = ...
4736 // 8th bin: <3>_{4n|2n,2n} = ...
4737 // 9th bin: <3>_{4n|3n,1n} = ...
4738 // 10th bin: ---- EMPTY ----
4739 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4740 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4741 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4742 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4743 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4744 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4745 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4746 // 18th bin: ---- EMPTY ----
4747 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4748 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4749 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4750 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4751 // 23rd bin: ---- EMPTY ----
4752 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4753 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4754 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4755 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4756 // 28th bin: ---- EMPTY ----
4757 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4758 // 30th bin: ---- EMPTY ----
4759 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4760
4761 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4762 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4763
4764 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4765 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4766
4767 // multiplicity (number of particles used to determine the reaction plane)
1268c371 4768 Double_t dMult = (*fSpk)(0,0);
489d5531 4769
4770 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4771 Double_t dReQ1n1k = (*fReQ)(0,1);
4772 Double_t dReQ2n2k = (*fReQ)(1,2);
4773 Double_t dReQ3n3k = (*fReQ)(2,3);
4774 Double_t dReQ4n4k = (*fReQ)(3,4);
4775 Double_t dReQ1n3k = (*fReQ)(0,3);
4776 Double_t dImQ1n1k = (*fImQ)(0,1);
4777 Double_t dImQ2n2k = (*fImQ)(1,2);
4778 Double_t dImQ3n3k = (*fImQ)(2,3);
4779 Double_t dImQ4n4k = (*fImQ)(3,4);
4780 Double_t dImQ1n3k = (*fImQ)(0,3);
4781
4782 // dMs are variables introduced in order to simplify some Eqs. bellow:
4783 //..............................................................................................
1268c371 4784 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4785 Double_t dM22 = (*fSpk)(1,2)-(*fSpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4786 Double_t dM33 = (*fSpk)(1,3)-(*fSpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4787 Double_t dM44 = (*fSpk)(1,4)-(*fSpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4788 Double_t dM31 = (*fSpk)(0,3)*(*fSpk)(0,1)-(*fSpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j
4789 Double_t dM211 = (*fSpk)(0,2)*(*fSpk)(1,1)-2.*(*fSpk)(0,3)*(*fSpk)(0,1)
4790 - (*fSpk)(1,2)+2.*(*fSpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4791 Double_t dM1111 = (*fSpk)(3,1)-6.*(*fSpk)(0,2)*(*fSpk)(1,1)
4792 + 8.*(*fSpk)(0,3)*(*fSpk)(0,1)
4793 + 3.*(*fSpk)(1,2)-6.*(*fSpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
489d5531 4794 //..............................................................................................
4795
4796 // 2-particle correlations:
4797 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4798 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4799 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4800 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4801 if(dMult>1)
4802 {
4803 if(dM11)
4804 {
1268c371 4805 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))/dM11;
489d5531 4806 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4807 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4808 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4809 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
b40a910e 4810 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4811 // average squared correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4812 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1nW1W1*two1n1nW1W1,dM11);
489d5531 4813 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4814 }
4815 if(dM22)
4816 {
1268c371 4817 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSpk)(0,4))/dM22;
489d5531 4818 // ...
4819 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4820 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4821 }
4822 if(dM33)
4823 {
1268c371 4824 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSpk)(0,6))/dM33;
489d5531 4825 // ...
4826 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4827 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4828 }
4829 if(dM44)
4830 {
1268c371 4831 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSpk)(0,8))/dM44;
489d5531 4832 // ...
4833 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4834 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4835 }
4836 } // end of if(dMult>1)
4837
4838 // extra 2-particle correlations:
4839 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4840 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4841 if(dMult>1)
4842 {
4843 if(dM31)
4844 {
1268c371 4845 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSpk)(0,4))/dM31;
489d5531 4846 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4847 }
4848 if(dM211)
4849 {
1268c371 4850 two1n1nW1W1W2 = ((*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))
489d5531 4851 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
1268c371 4852 - (*fSpk)(0,4)))/dM211;
489d5531 4853 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4854 }
4855 } // end of if(dMult>1)
4856 //..............................................................................................
4857
4858 //..............................................................................................
4859 // 3-particle correlations:
4860 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4861
4862 if(dMult>2)
4863 {
4864 if(dM211)
4865 {
4866 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4867 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4868 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
1268c371 4869 + 2.*(*fSpk)(0,4))/dM211;
489d5531 4870 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4871 }
4872 } // end of if(dMult>2)
4873 //..............................................................................................
4874
4875 //..............................................................................................
4876 // 4-particle correlations:
4877 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4878 if(dMult>3)
4879 {
4880 if(dM1111)
4881 {
4882 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4883 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4884 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4885 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
1268c371 4886 - 4.*(*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4887 - 6.*(*fSpk)(0,4)+2.*(*fSpk)(1,2))/dM1111;
489d5531 4888
4889 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4890 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4891 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4892 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4893 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
b40a910e 4894 // average squared correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4895 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1*four1n1n1n1nW1W1W1W1,dM1111);
489d5531 4896 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4897 }
4898 } // end of if(dMult>3)
4899 //..............................................................................................
4900
4901} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4902
489d5531 4903//================================================================================================================================
4904
489d5531 4905void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4906{
4907 // Initialize all arrays used to calculate integrated flow.
4908
4909 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4910 {
4911 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
0328db2d 4912 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
489d5531 4913 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4914 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
b92ea2b9 4915 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 4916 {
4917 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
4918 }
0328db2d 4919 for(Int_t power=0;power<2;power++) // linear or quadratic
4920 {
4921 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4922 }
489d5531 4923 }
4924 for(Int_t power=0;power<2;power++) // linear or quadratic
4925 {
4926 fIntFlowSumOfEventWeights[power] = NULL;
4927 }
b3dacf6b 4928 for(Int_t i=0;i<4;i++) // print on the screen the final results (0=RF, 1=RP, 2=POI, 3=RF (rebbined in M))
489d5531 4929 {
4930 fPrintFinalResults[i] = kTRUE;
4931 }
ff70ca91 4932 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4933 {
4934 fIntFlowCorrelationsVsMPro[ci] = NULL;
b40a910e 4935 fIntFlowSquaredCorrelationsVsMPro[ci] = NULL;
ff70ca91 4936 fIntFlowCorrelationsVsMHist[ci] = NULL;
4937 fIntFlowQcumulantsVsM[ci] = NULL;
4938 fIntFlowVsM[ci] = NULL;
2001bc3a 4939 fIntFlowDetectorBiasVsM[ci] = NULL;
ff70ca91 4940 for(Int_t lc=0;lc<2;lc++)
4941 {
4942 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4943 }
4944 }
4945 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4946 {
4947 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4948 fIntFlowCovariancesVsM[pi] = NULL;
4949 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4950 }
e5834fcb 4951
489d5531 4952} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4953
489d5531 4954//================================================================================================================================
4955
489d5531 4956void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4957{
4958 // Initialize all arrays needed to calculate differential flow.
4959 // a) Initialize lists holding profiles;
4960 // b) Initialize lists holding histograms;
4961 // c) Initialize event-by-event quantities;
4962 // d) Initialize profiles;
4963 // e) Initialize histograms holding final results.
4964
4965 // a) Initialize lists holding profiles;
4966 for(Int_t t=0;t<2;t++) // type (RP, POI)
4967 {
4968 for(Int_t pe=0;pe<2;pe++) // pt or eta
4969 {
4970 fDiffFlowCorrelationsProList[t][pe] = NULL;
4971 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4972 fDiffFlowCorrectionsProList[t][pe] = NULL;
4973 }
1268c371 4974 // 2D:
4975 f2DDiffFlowCorrelationsProList[t] = NULL;
489d5531 4976 }
4977
4978 // b) Initialize lists holding histograms;
4979 for(Int_t t=0;t<2;t++) // type (RP, POI)
4980 {
4981 for(Int_t pe=0;pe<2;pe++) // pt or eta
4982 {
4983 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4984 for(Int_t power=0;power<2;power++)
4985 {
4986 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
4987 } // end of for(Int_t power=0;power<2;power++)
4988 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
4989 fDiffFlowCorrectionsHistList[t][pe] = NULL;
4990 fDiffFlowCovariancesHistList[t][pe] = NULL;
4991 fDiffFlowCumulantsHistList[t][pe] = NULL;
1268c371 4992 fDiffFlowDetectorBiasHistList[t][pe] = NULL;
489d5531 4993 fDiffFlowHistList[t][pe] = NULL;
4994 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4995 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
4996
4997 // c) Initialize event-by-event quantities:
4998 // 1D:
4999 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5000 {
5001 for(Int_t pe=0;pe<2;pe++) // pt or eta
5002 {
5003 for(Int_t m=0;m<4;m++) // multiple of harmonic
5004 {
5005 for(Int_t k=0;k<9;k++) // power of weight
5006 {
5007 fReRPQ1dEBE[t][pe][m][k] = NULL;
5008 fImRPQ1dEBE[t][pe][m][k] = NULL;
5009 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5010 }
5011 }
5012 }
5013 }
5014 // 1D:
5015 for(Int_t t=0;t<2;t++) // type (RP or POI)
5016 {
5017 for(Int_t pe=0;pe<2;pe++) // pt or eta
5018 {
5019 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5020 {
5021 for(Int_t cti=0;cti<9;cti++) // correction term index
5022 {
5023 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
5024 }
5025 }
5026 }
5027 }
5028 // 2D:
5029 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5030 {
5031 for(Int_t m=0;m<4;m++) // multiple of harmonic
5032 {
5033 for(Int_t k=0;k<9;k++) // power of weight
5034 {
5035 fReRPQ2dEBE[t][m][k] = NULL;
5036 fImRPQ2dEBE[t][m][k] = NULL;
5037 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5038 }
5039 }
5040 }
5041
5042 // d) Initialize profiles:
5043 for(Int_t t=0;t<2;t++) // type: RP or POI
5044 {
5045 for(Int_t pe=0;pe<2;pe++) // pt or eta
5046 {
5047 for(Int_t ci=0;ci<4;ci++) // correlation index
5048 {
5049 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
b40a910e 5050 fDiffFlowSquaredCorrelationsPro[t][pe][ci] = NULL;
489d5531 5051 } // end of for(Int_t ci=0;ci<4;ci++)
5052 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5053 {
5054 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5055 {
5056 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
5057 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5058 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5059 // correction terms for nua:
5060 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5061 {
5062 for(Int_t cti=0;cti<9;cti++) // correction term index
5063 {
5064 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
5065 }
5066 }
5067 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1268c371 5068 for(Int_t ci=0;ci<4;ci++) // correlation index
5069 {
5070 f2DDiffFlowCorrelationsPro[t][ci] = NULL;
5071 }
489d5531 5072 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5073
5074 // e) Initialize histograms holding final results.
5075 for(Int_t t=0;t<2;t++) // type: RP or POI
5076 {
5077 for(Int_t pe=0;pe<2;pe++) // pt or eta
5078 {
5079 for(Int_t ci=0;ci<4;ci++) // correlation index
5080 {
5081 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
5082 fDiffFlowCumulants[t][pe][ci] = NULL;
1268c371 5083 fDiffFlowDetectorBias[t][pe][ci] = NULL;
489d5531 5084 fDiffFlow[t][pe][ci] = NULL;
5085 } // end of for(Int_t ci=0;ci<4;ci++)
5086 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5087 {
5088 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
5089 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5090 // correction terms for nua:
5091 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5092 {
5093 for(Int_t cti=0;cti<9;cti++) // correction term index
5094 {
5095 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
5096 }
5097 }
5098 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1268c371 5099 for(Int_t ci=0;ci<4;ci++) // correlation index
5100 {
5101 f2DDiffFlowCumulants[t][ci] = NULL;
5102 f2DDiffFlow[t][ci] = NULL;
5103 }
489d5531 5104 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5105
5106 // sum of event weights for reduced correlations:
5107 for(Int_t t=0;t<2;t++) // type = RP or POI
5108 {
5109 for(Int_t pe=0;pe<2;pe++) // pt or eta
5110 {
5111 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
5112 {
5113 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
5114 {
5115 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
5116 }
5117 }
5118 }
5119 }
5120 // product of event weights for both types of correlations:
5121 for(Int_t t=0;t<2;t++) // type = RP or POI
5122 {
5123 for(Int_t pe=0;pe<2;pe++) // pt or eta
5124 {
5125 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5126 {
5127 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5128 {
5129 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
5130 }
5131 }
5132 }
5133 }
1268c371 5134
5135} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5136
5137//================================================================================================================================
489d5531 5138
1268c371 5139void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5140{
5141 // Calculate differential flow cumulants from measured multiparticle correlations.
489d5531 5142
1268c371 5143 // REMARK: Cumulants calculated in this method are NOT corrected for non-uniform acceptance.
5144 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied
5145 // in the method CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
489d5531 5146
1268c371 5147 Int_t t = 0;
5148 Int_t pe = 0;
5149
5150 if(type == "RP")
5151 {
5152 t = 0;
5153 } else if(type == "POI")
5154 {
5155 t = 1;
5156 }
5157
5158 if(ptOrEta == "Pt")
5159 {
5160 pe = 0;
5161 } else if(ptOrEta == "Eta")
5162 {
5163 pe = 1;
5164 }
5165
5166 // Common:
5167 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 5168
1268c371 5169 // Correlation <<2>>:
5170 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5171 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
489d5531 5172
1268c371 5173 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
489d5531 5174 {
1268c371 5175 // Reduced correlations:
5176 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
5177 Double_t twoPrimeError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b); // stat. error of <<2'>>
5178 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
5179 Double_t fourPrimeError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b); // stat. error of <<4'>>
5180 // Covariances:
5181 Double_t wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b); // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
5182 Double_t wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b); // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
5183 Double_t wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b); // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
5184 // QC{2'}:
5185 Double_t qc2Prime = twoPrime; // QC{2'}
5186 Double_t qc2PrimeError = twoPrimeError; // stat. error of QC{2'}
5187 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5188 fDiffFlowCumulants[t][pe][0]->SetBinError(b,qc2PrimeError);
5189 // QC{4'}:
5190 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5191 Double_t qc4PrimeError = 0.; // stat. error of QC{4'}
5192 Double_t qc4PrimeErrorSquared = 4.*pow(twoPrime,2.)*pow(twoError,2.)
5193 + 4.*pow(two,2.)*pow(twoPrimeError,2.)
5194 + pow(fourPrimeError,2.)
5195 + 8.*two*twoPrime*wCovTwoTwoReduced
5196 - 4.*twoPrime*wCovTwoFourReduced
5197 - 4.*two*wCovTwoReducedFourReduced;
5198 if(qc4PrimeErrorSquared>0.)
5199 {
5200 qc4PrimeError = pow(qc4PrimeErrorSquared,0.5);
489d5531 5201 }
1268c371 5202 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5203 fDiffFlowCumulants[t][pe][1]->SetBinError(b,qc4PrimeError);
489d5531 5204 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 5205
1268c371 5206} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
489d5531 5207
5208//================================================================================================================================
5209
1268c371 5210void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
489d5531 5211{
1268c371 5212 // Calculate 2D differential cumulants.
489d5531 5213
1268c371 5214 // Remark: correction for detector effects and error propagation not implemented yet for 2D differential cumulants.
489d5531 5215
1268c371 5216 Int_t t = 0;
489d5531 5217
5218 if(type == "RP")
5219 {
1268c371 5220 t = 0;
489d5531 5221 } else if(type == "POI")
5222 {
1268c371 5223 t = 1;
5224 }
5225
5226 // Reference correlation <<2>>:
5227 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
489d5531 5228
1268c371 5229 // Looping over all (pt,eta) bins and calculating differential flow cumulants:
5230 for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 5231 {
5232 for(Int_t e=1;e<=fnBinsEta;e++)
5233 {
1268c371 5234 // Reduced correlations:
5235 Double_t twoPrime = f2DDiffFlowCorrelationsPro[t][0]->GetBinContent(f2DDiffFlowCorrelationsPro[t][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5236 Double_t fourPrime = f2DDiffFlowCorrelationsPro[t][1]->GetBinContent(f2DDiffFlowCorrelationsPro[t][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5237 // Cumulants:
5238 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5239 f2DDiffFlowCumulants[t][0]->SetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e),qc2Prime);
5240 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5241 f2DDiffFlowCumulants[t][1]->SetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e),qc4Prime);
489d5531 5242 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
489d5531 5243 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5244
1268c371 5245} // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
489d5531 5246
489d5531 5247//================================================================================================================================
5248
489d5531 5249void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5250{
1268c371 5251 // Calculate final results for integrated flow of RPs and POIs.
489d5531 5252
1268c371 5253 // to be improved - check if the integrated flow calculation here is actually correct
5254
5255 Int_t t = 0; // RP = 0, POI = 1
489d5531 5256
5257 if(type == "RP")
5258 {
1268c371 5259 t = 0;
489d5531 5260 } else if(type == "POI")
5261 {
1268c371 5262 t = 1;
5263 }
489d5531 5264
489d5531 5265 // pt yield:
5266 TH1F *yield2ndPt = NULL;
5267 TH1F *yield4thPt = NULL;
5268 TH1F *yield6thPt = NULL;
5269 TH1F *yield8thPt = NULL;
5270
5271 if(type == "POI")
5272 {
dd442cd2 5273 if(fFillMultipleControlHistograms)
5274 {
5275 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5276 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5277 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5278 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5279 } else
5280 {
5281 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5282 yield4thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5283 yield6thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5284 yield8thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5285 }
489d5531 5286 }
5287 else if(type == "RP")
5288 {
dd442cd2 5289 if(fFillMultipleControlHistograms)
5290 {
5291 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5292 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5293 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5294 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5295 } else
5296 {
5297 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5298 yield4thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5299 yield6thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5300 yield8thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5301 }
489d5531 5302 }
5303
0d11c335 5304 if(!yield2ndPt){return;}
5305 if(!yield4thPt){return;}
5306 if(!yield6thPt){return;}
5307 if(!yield8thPt){return;}
5308
489d5531 5309 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5310
5311 TH1D *flow2ndPt = NULL;
5312 TH1D *flow4thPt = NULL;
5313 TH1D *flow6thPt = NULL;
5314 TH1D *flow8thPt = NULL;
5315
5316 // to be improved (hardwired pt index)
5317 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5318 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5319 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5320 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
0d11c335 5321
5322 if(!flow2ndPt){return;}
5323 if(!flow4thPt){return;}
5324 if(!flow6thPt){return;}
5325 if(!flow8thPt){return;}
489d5531 5326
5327 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5328 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5329
5330 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5331 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5332
5333 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5334 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5335
5336 // looping over pt bins:
5337 for(Int_t p=1;p<nBinsPt+1;p++)
5338 {
5339 dvn2nd = flow2ndPt->GetBinContent(p);
5340 dvn4th = flow4thPt->GetBinContent(p);
5341 dvn6th = flow6thPt->GetBinContent(p);
5342 dvn8th = flow8thPt->GetBinContent(p);
5343
5344 dErrvn2nd = flow2ndPt->GetBinError(p);
5345 dErrvn4th = flow4thPt->GetBinError(p);
5346 dErrvn6th = flow6thPt->GetBinError(p);
5347 dErrvn8th = flow8thPt->GetBinError(p);
5348
5349 dYield2nd = yield2ndPt->GetBinContent(p);
5350 dYield4th = yield4thPt->GetBinContent(p);
5351 dYield6th = yield6thPt->GetBinContent(p);
5352 dYield8th = yield8thPt->GetBinContent(p);
5353
5354 dVn2nd += dvn2nd*dYield2nd;
5355 dVn4th += dvn4th*dYield4th;
5356 dVn6th += dvn6th*dYield6th;
5357 dVn8th += dvn8th*dYield8th;
5358
5359 dSum2nd += dYield2nd;
5360 dSum4th += dYield4th;
5361 dSum6th += dYield6th;
5362 dSum8th += dYield8th;
5363
5364 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5365 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5366 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5367 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5368
5369 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5370
5371 // normalizing the results for integrated flow:
5372 if(dSum2nd)
5373 {
5374 dVn2nd /= dSum2nd;
5375 dErrVn2nd /= (dSum2nd*dSum2nd);
5376 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5377 }
5378 if(dSum4th)
5379 {
5380 dVn4th /= dSum4th;
5381 dErrVn4th /= (dSum4th*dSum4th);
5382 dErrVn4th = TMath::Sqrt(dErrVn4th);
5383 }
5384 //if(dSum6th) dVn6th/=dSum6th;
5385 //if(dSum8th) dVn8th/=dSum8th;
5386
5387 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5388 if(type == "POI")
5389 {
5390 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5391 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5392 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5393 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5394 }
5395 else if (type == "RP")
5396 {
5397 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5398 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5399 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5400 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5401 }
5402
5403 delete flow2ndPt;
5404 delete flow4thPt;
5405 //delete flow6thPt;
5406 //delete flow8thPt;
5407
5408 delete yield2ndPt;
5409 delete yield4thPt;
5410 delete yield6thPt;
5411 delete yield8thPt;
5412
5413} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5414
489d5531 5415//================================================================================================================================
5416
489d5531 5417void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5418{
5419 // Initialize all arrays used for distributions.
5420
5421 // a) Initialize arrays of histograms used to hold distributions of correlations;
5422 // b) Initialize array to hold min and max values of correlations.
5423
5424 // a) Initialize arrays of histograms used to hold distributions of correlations:
5425 for(Int_t di=0;di<4;di++) // distribution index
5426 {
5427 fDistributions[di] = NULL;
5428 }
5429
5430 // b) Initialize default min and max values of correlations:
5431 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5432 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5433 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5434 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5435 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5436 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5437 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5438 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5439 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5440
5441} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5442
489d5531 5443//================================================================================================================================
5444
e5834fcb 5445void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5446{
5447 // Initialize all arrays used for various unclassified objects.
5448
5449 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
5450 {
5451 fPhiDistributionForOneEventSettings[p] = 0.;
5452 }
5453
5454} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5455
5456//================================================================================================================================
489d5531 5457
5458void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5459{
5460 // a) Book profile to hold all flags for distributions of correlations;
5461 // b) Book all histograms to hold distributions of correlations.
5462
5463 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5464
5465 // a) Book profile to hold all flags for distributions of correlations:
5466 TString distributionsFlagsName = "fDistributionsFlags";
5467 distributionsFlagsName += fAnalysisLabel->Data();
5468 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5469 fDistributionsFlags->SetTickLength(-0.01,"Y");
5470 fDistributionsFlags->SetMarkerStyle(25);
5471 fDistributionsFlags->SetLabelSize(0.05);
5472 fDistributionsFlags->SetLabelOffset(0.02,"Y");
5473 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
5474 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
5475 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
5476 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
5477 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
5478 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
5479 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
5480 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
5481 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
5482 fDistributionsList->Add(fDistributionsFlags);
5483
5484 // b) Book all histograms to hold distributions of correlations.
5485 if(fStoreDistributions)
5486 {
5487 TString distributionsName = "fDistributions";
5488 distributionsName += fAnalysisLabel->Data();
5489 for(Int_t di=0;di<4;di++) // distribution index
5490 {
5491 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
5492 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
5493 fDistributionsList->Add(fDistributions[di]);
5494 } // end of for(Int_t di=0;di<4;di++) // distribution index
5495 } // end of if(fStoreDistributions)
5496
5497} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5498
489d5531 5499//================================================================================================================================
5500
e5834fcb 5501void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
5502{
5503 // Book all objects for various unclassified quantities.
5504
5505 if(!fStorePhiDistributionForOneEvent){return;}
5506
5507 // a) Book histogram holding phi distribution for single event to illustrate flow.
5508
5509 // a) Book histogram holding phi distribution for single event to illustrate flow:
5510 fPhiDistributionForOneEvent = new TH1D("fPhiDistributionForOneEvent","",360,0.,TMath::TwoPi());
5511 fPhiDistributionForOneEvent->GetXaxis()->SetTitle("#phi");
5512 fVariousList->Add(fPhiDistributionForOneEvent);
5513
5514} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
5515
5516//================================================================================================================================
489d5531 5517
5518void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5519{
5520 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
5521
5522 if(!fDistributionsFlags)
5523 {
5524 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
5525 exit(0);
5526 }
5527
5528 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
5529 // store min and max values of correlations:
5530 for(Int_t di=0;di<4;di++) // distribution index
5531 {
5532 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
5533 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
5534 }
5535
5536} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5537
489d5531 5538//================================================================================================================================
5539
489d5531 5540void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5541{
5542 // Store distributions of correlations.
5543
5544 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
5545 {
5546 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
5547 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
5548 exit(0);
5549 }
5550
5551 for(Int_t di=0;di<4;di++) // distribution index
5552 {
5553 if(!fDistributions[di])
5554 {
5555 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
5556 cout<<"di = "<<di<<endl;
5557 exit(0);
5558 } else
5559 {
5560 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
5561 }
5562 } // end of for(Int_t di=0;di<4;di++) // distribution index
5563
5564} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5565
489d5531 5566//================================================================================================================================
5567
489d5531 5568void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5569{
5570 // Book and nest all lists nested in the base list fHistList.
5571 // a) Book and nest lists for integrated flow;
5572 // b) Book and nest lists for differential flow;
5573 // c) Book and nest list for particle weights;
5574 // d) Book and nest list for distributions;
e5834fcb 5575 // e) Book and nest list for various unclassified objects;
5576 // f) Book and nest list for nested loops.
489d5531 5577
5578 // a) Book and nest all lists for integrated flow:
1268c371 5579 // Base list for integrated flow:
489d5531 5580 fIntFlowList = new TList();
5581 fIntFlowList->SetName("Integrated Flow");
5582 fIntFlowList->SetOwner(kTRUE);
5583 fHistList->Add(fIntFlowList);
1268c371 5584 // List holding profiles:
489d5531 5585 fIntFlowProfiles = new TList();
5586 fIntFlowProfiles->SetName("Profiles");
5587 fIntFlowProfiles->SetOwner(kTRUE);
5588 fIntFlowList->Add(fIntFlowProfiles);
1268c371 5589 // List holding histograms with results:
489d5531 5590 fIntFlowResults = new TList();
5591 fIntFlowResults->SetName("Results");
5592 fIntFlowResults->SetOwner(kTRUE);
5593 fIntFlowList->Add(fIntFlowResults);
5594
1268c371 5595 // b) Book and nest lists for differential flow:
5596 this->BookAndNestListsForDifferentialFlow();
5597
5598 // c) Book and nest list for particle weights:
5599 fWeightsList->SetName("Weights");
5600 fWeightsList->SetOwner(kTRUE);
5601 fHistList->Add(fWeightsList);
5602
5603 // d) Book and nest list for distributions:
5604 fDistributionsList = new TList();
5605 fDistributionsList->SetName("Distributions");
5606 fDistributionsList->SetOwner(kTRUE);
5607 fHistList->Add(fDistributionsList);
5608
5609 // e) Book and nest list for various unclassified objects:
5610 if(fStorePhiDistributionForOneEvent)
5611 {
5612 fVariousList = new TList();
5613 fVariousList->SetName("Various");
5614 fVariousList->SetOwner(kTRUE);
5615 fHistList->Add(fVariousList);
5616 }
5617
5618 // f) Book and nest list for nested loops:
5619 fNestedLoopsList = new TList();
5620 fNestedLoopsList->SetName("Nested Loops");
5621 fNestedLoopsList->SetOwner(kTRUE);
5622 fHistList->Add(fNestedLoopsList);
5623
5624} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5625
5626//================================================================================================================================
5627
5628void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
5629{
5630 // Book and nest lists for differential flow.
5631
5632 // Base list for differential flow objects:
489d5531 5633 fDiffFlowList = new TList();
5634 fDiffFlowList->SetName("Differential Flow");
5635 fDiffFlowList->SetOwner(kTRUE);
5636 fHistList->Add(fDiffFlowList);
1268c371 5637
5638 // Local flags:
5639 TString typeFlag[2] = {"RP","POI"};
5640 TString ptEtaFlag[2] = {"p_{T}","#eta"};
5641 TString powerFlag[2] = {"linear","quadratic"};
5642
5643 // 2D:
5644 if(fCalculate2DDiffFlow)
5645 {
5646 fDiffFlow2D = new TList();
5647 fDiffFlow2D->SetName("2D");
5648 fDiffFlow2D->SetOwner(kTRUE);
5649 fDiffFlowList->Add(fDiffFlow2D);
5650 for(Int_t t=0;t<2;t++)
5651 {
5652 f2DDiffFlowCorrelationsProList[t] = new TList();
5653 f2DDiffFlowCorrelationsProList[t]->SetOwner(kTRUE);
5654 f2DDiffFlowCorrelationsProList[t]->SetName(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data()));
5655 fDiffFlow2D->Add(f2DDiffFlowCorrelationsProList[t]);
5656 } // end of for(Int_t t=0;t<2;t++)
5657 } // end of if(fCalculate2DDiffFlow)
5658
5659 // What follows bellow in this method is relevant only for 1D differential flow:
5660 if(!fCalculateDiffFlow){return;}
5661
5662 // List holding profiles:
489d5531 5663 fDiffFlowProfiles = new TList();
5664 fDiffFlowProfiles->SetName("Profiles");
5665 fDiffFlowProfiles->SetOwner(kTRUE);
5666 fDiffFlowList->Add(fDiffFlowProfiles);
1268c371 5667 // List holding histograms with results:
489d5531 5668 fDiffFlowResults = new TList();
5669 fDiffFlowResults->SetName("Results");
5670 fDiffFlowResults->SetOwner(kTRUE);
5671 fDiffFlowList->Add(fDiffFlowResults);
1268c371 5672 // Flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
489d5531 5673 TList list;
5674 list.SetOwner(kTRUE);
1268c371 5675 // Nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
489d5531 5676 for(Int_t t=0;t<2;t++) // type: RP or POI
5677 {
5678 for(Int_t pe=0;pe<2;pe++) // pt or eta
5679 {
5680 // list holding profiles with correlations:
5681 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
5682 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5683 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
5684 // list holding profiles with products of correlations:
5685 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
5686 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5687 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
5688 // list holding profiles with corrections:
5689 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
5690 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5691 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
5692 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5693 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5694 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
5695 for(Int_t t=0;t<2;t++) // type: RP or POI
5696 {
5697 for(Int_t pe=0;pe<2;pe++) // pt or eta
5698 {
5699 // list holding histograms with correlations:
5700 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
5701 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5702 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
5703 // list holding histograms with corrections:
5704 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
5705 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5706 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
5707 for(Int_t power=0;power<2;power++)
5708 {
5709 // list holding histograms with sums of event weights:
5710 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
5711 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5712 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
5713 } // end of for(Int_t power=0;power<2;power++)
5714 // list holding histograms with sums of products of event weights:
5715 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
5716 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5717 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
5718 // list holding histograms with covariances of correlations:
5719 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
5720 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5721 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
5722 // list holding histograms with differential Q-cumulants:
5723 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
5724 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5725 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
1268c371 5726 // list holding histograms which quantify detector bias to differential Q-cumulants:
5727 fDiffFlowDetectorBiasHistList[t][pe] = (TList*)list.Clone();
5728 fDiffFlowDetectorBiasHistList[t][pe]->SetName(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5729 fDiffFlowResults->Add(fDiffFlowDetectorBiasHistList[t][pe]);
489d5531 5730 // list holding histograms with differential flow estimates from Q-cumulants:
5731 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
5732 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5733 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
5734 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5735 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5736
1268c371 5737} // end of void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
489d5531 5738
5739//================================================================================================================================
5740
489d5531 5741void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
5742{
1268c371 5743 // Fill common result histograms for differential flow.
489d5531 5744
1268c371 5745 Int_t t = 0;
489d5531 5746
5747 if(type == "RP")
5748 {
1268c371 5749 t = 0;
489d5531 5750 } else if(type == "POI")
5751 {
1268c371 5752 t = 1;
489d5531 5753 }
1268c371 5754
5755 // to be improved - check all pointers used in this method
489d5531 5756
5757 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
5758 {
5759 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
5760 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5761 exit(0);
5762 }
5763
5764 // pt:
5765 for(Int_t p=1;p<=fnBinsPt;p++)
5766 {
5767 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
5768 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
5769 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
5770 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
5771
5772 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
5773 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
5774 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
5775 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
5776
5777 if(type == "RP")
5778 {
5779 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
5780 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
5781 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
5782 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
5783 } else if(type == "POI")
5784 {
5785 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
5786 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
5787 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
5788 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
5789 }
5790 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5791
5792 // eta:
5793 for(Int_t e=1;e<=fnBinsEta;e++)
5794 {
5795 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
5796 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
5797 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
5798 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
5799
5800 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
5801 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
5802 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
5803 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
5804
5805 if(type == "RP")
5806 {
5807 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
5808 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
5809 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
5810 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
5811 } else if(type == "POI")
5812 {
5813 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
5814 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
5815 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
5816 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
5817 }
5818 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5819
5820} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5821
489d5531 5822//================================================================================================================================
5823
1268c371 5824void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
489d5531 5825{
1268c371 5826 // Access and store common constants.
5827
5828 // a) If this method was called in Init() access common constants from AliFlowCommonConstants;
5829 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a);
5830 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b).
5831
5832 if(method == "Init")
5833 {
5834 // a) If this method was called in Init() access common constants from AliFlowCommonConstants:
5835 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
5836 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
5837 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
5838 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
5839 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
5840 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
5841 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
5842 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
5843 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
5844 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
5845 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
5846 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
5847
5848 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a):
5849 TString fCommonConstantsName = "fCommonConstants";
5850 fCommonConstantsName += fAnalysisLabel->Data();
5851 fCommonConstants = new TProfile(fCommonConstantsName.Data(),"Common constants",9,0.,9.);
5852 fCommonConstants->SetLabelSize(0.05);
5853 fCommonConstants->GetXaxis()->SetBinLabel(1,"nBins (#phi)");
5854 fCommonConstants->Fill(0.5,fnBinsPhi);
5855 fCommonConstants->GetXaxis()->SetBinLabel(2,"#phi_{min}");
5856 fCommonConstants->Fill(1.5,fPhiMin);
5857 fCommonConstants->GetXaxis()->SetBinLabel(3,"#phi_{max}");
5858 fCommonConstants->Fill(2.5,fPhiMax);
5859 fCommonConstants->GetXaxis()->SetBinLabel(4,"nBins (p_{t})");
5860 fCommonConstants->Fill(3.5,fnBinsPt);
5861 fCommonConstants->GetXaxis()->SetBinLabel(5,"(p_{t})_{min}");
5862 fCommonConstants->Fill(4.5,fPtMin);
5863 fCommonConstants->GetXaxis()->SetBinLabel(6,"(p_{t})_{max}");
5864 fCommonConstants->Fill(5.5,fPtMax);
5865 fCommonConstants->GetXaxis()->SetBinLabel(7,"nBins (#eta)");
5866 fCommonConstants->Fill(6.5,fnBinsEta);
5867 fCommonConstants->GetXaxis()->SetBinLabel(8,"#eta_{min}");
5868 fCommonConstants->Fill(7.5,fEtaMin);
5869 fCommonConstants->GetXaxis()->SetBinLabel(9,"#eta_{max}");
5870 fCommonConstants->Fill(8.5,fEtaMax);
5871 fHistList->Add(fCommonConstants);
5872 } // end of if(method == "Init")
5873 else if(method == "Finish")
5874 {
5875 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b):
5876 if(!fCommonConstants)
5877 {
5878 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::AC(\"%s\") !!!!\n\n",method.Data());
5879 exit(0);
5880 }
5881 fnBinsPhi = (Int_t)fCommonConstants->GetBinContent(1);
5882 fPhiMin = fCommonConstants->GetBinContent(2);
5883 fPhiMax = fCommonConstants->GetBinContent(3);
5884 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
5885 fnBinsPt = (Int_t)fCommonConstants->GetBinContent(4);
5886 fPtMin = fCommonConstants->GetBinContent(5);
5887 fPtMax = fCommonConstants->GetBinContent(6);
5888 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
5889 fnBinsEta = (Int_t)fCommonConstants->GetBinContent(7);
5890 fEtaMin = fCommonConstants->GetBinContent(8);
5891 fEtaMax = fCommonConstants->GetBinContent(9);
5892 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
5893 } // end of else if(method == "Finish")
5894
5895} // end of void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
489d5531 5896
489d5531 5897//================================================================================================================================
5898
489d5531 5899void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
5900{
1268c371 5901 // a) Cross check if the choice for multiplicity weights make sense.
489d5531 5902
5903 // a) Cross check if the choice for multiplicity weights make sense:
5904 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
5905 strcmp(fMultiplicityWeight->Data(),"unit") &&
5906 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
5907 {
5908 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
5909 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
5910 exit(0);
5911 }
5912
5913} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
5914
489d5531 5915//================================================================================================================================
5916
489d5531 5917void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
5918{
0328db2d 5919 // Calculate sum of linear and quadratic event weights for correlations.
2001bc3a 5920
5921 // multiplicity:
1268c371 5922 Double_t dMult = (*fSpk)(0,0);
9f33751d 5923
489d5531 5924 for(Int_t p=0;p<2;p++) // power-1
5925 {
5926 for(Int_t ci=0;ci<4;ci++) // correlation index
5927 {
5928 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
b3dacf6b 5929 if(fCalculateCumulantsVsM)
5930 {
5931 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
5932 }
489d5531 5933 }
5934 }
5935
5936} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
5937
489d5531 5938//================================================================================================================================
5939
0328db2d 5940void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 5941{
0328db2d 5942 // Calculate sum of linear and quadratic event weights for NUA terms.
5943
5944 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
489d5531 5945 {
0328db2d 5946 for(Int_t p=0;p<2;p++) // power-1
5947 {
b92ea2b9 5948 for(Int_t ci=0;ci<4;ci++) // nua term index
0328db2d 5949 {
5950 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
489d5531 5951 }
0328db2d 5952 }
5953 }
5954
5955} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 5956
0328db2d 5957//================================================================================================================================
5958
0328db2d 5959void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
5960{
ff70ca91 5961 // Calculate sum of product of event weights for correlations.
2001bc3a 5962
5963 // multiplicity:
1268c371 5964 Double_t dMult = (*fSpk)(0,0);
2001bc3a 5965
489d5531 5966 Int_t counter = 0;
5967
5968 for(Int_t ci1=1;ci1<4;ci1++)
5969 {
5970 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
5971 {
ff70ca91 5972 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
5973 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
b3dacf6b 5974 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
5975 if(fCalculateCumulantsVsM)
5976 {
5977 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
5978 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
5979 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
5980 } // end of if(fCalculateCumulantsVsM)
ff70ca91 5981 counter++;
489d5531 5982 }
5983 }
5984
0328db2d 5985} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
5986
0328db2d 5987//================================================================================================================================
5988
0328db2d 5989void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
5990{
5991 // Calculate sum of product of event weights for NUA terms.
5992
5993 // w_{<2>} * w_{<cos(#phi)>}:
5994 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5995 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
5996 // w_{<2>} * w_{<sin(#phi)>}:
5997 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5998 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
5999 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6000 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6001 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6002 // w_{<2>} * w{<cos(phi1+phi2)>}
6003 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6004 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6005 // w_{<2>} * w{<sin(phi1+phi2)>}
6006 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6007 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6008 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6009 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6010 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6011 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6012 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6013 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6014 // w_{<4>} * w{<cos(phi1)>}
6015 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6016 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6017 // w_{<4>} * w{<sin(phi1)>}
6018 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6019 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6020 // w_{<4>} * w{<cos(phi1+phi2)>}
6021 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6022 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6023 // w_{<4>} * w{<sin(phi1+phi2)>}
6024 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6025 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6026 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6027 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6028 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6029 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6030 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6031 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6032 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6033 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6034 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6035 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6036 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6037 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6038 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6039 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6040 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6041 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6042 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6043 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6044 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6045 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6046 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6047 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6048 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6049 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6050 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6051 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6052 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6053 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6054 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6055 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6056 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6057 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6058 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6059 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6060 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6061 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6062 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6063 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6064 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6065 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6066 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6067 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6068 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6069 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6070 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6071 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6072 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6073 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6074
6075} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
489d5531 6076
489d5531 6077//================================================================================================================================
6078
489d5531 6079void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6080{
1268c371 6081 // Calculate reduced correlations for RPs or POIs for all pt and eta bins.
489d5531 6082
1268c371 6083 // Multiplicity:
6084 Double_t dMult = (*fSpk)(0,0);
489d5531 6085
6086 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6087 Double_t dReQ1n = (*fReQ)(0,0);
6088 Double_t dReQ2n = (*fReQ)(1,0);
6089 //Double_t dReQ3n = (*fReQ)(2,0);
6090 //Double_t dReQ4n = (*fReQ)(3,0);
6091 Double_t dImQ1n = (*fImQ)(0,0);
6092 Double_t dImQ2n = (*fImQ)(1,0);
6093 //Double_t dImQ3n = (*fImQ)(2,0);
6094 //Double_t dImQ4n = (*fImQ)(3,0);
6095
6096 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6097 //
6098 // 0: <<2'>>
6099 // 1: <<4'>>
6100 // 2: <<6'>>
6101 // 3: <<8'>>
6102
2a98ceb8 6103 Int_t t = 0; // type flag
6104 Int_t pe = 0; // ptEta flag
489d5531 6105
6106 if(type == "RP")
6107 {
6108 t = 0;
6109 } else if(type == "POI")
6110 {
6111 t = 1;
6112 }
6113
6114 if(ptOrEta == "Pt")
6115 {
6116 pe = 0;
6117 } else if(ptOrEta == "Eta")
6118 {
6119 pe = 1;
6120 }
6121
6122 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6123 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6124 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6125 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6126
6127 // looping over all bins and calculating reduced correlations:
6128 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6129 {
6130 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6131 Double_t p1n0kRe = 0.;
6132 Double_t p1n0kIm = 0.;
6133
6134 // number of POIs in particular pt or eta bin:
6135 Double_t mp = 0.;
6136
6137 // 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):
6138 Double_t q1n0kRe = 0.;
6139 Double_t q1n0kIm = 0.;
6140 Double_t q2n0kRe = 0.;
6141 Double_t q2n0kIm = 0.;
6142
6143 // number of particles which are both RPs and POIs in particular pt or eta bin:
6144 Double_t mq = 0.;
6145
6146 if(type == "POI")
6147 {
6148 // q_{m*n,0}:
6149 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6150 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6151 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6152 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6153 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6154 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6155 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6156 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6157
6158 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6159 }
6160 else if(type == "RP")
6161 {
6162 // q_{m*n,0}:
6163 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6164 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6165 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6166 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6167 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6168 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6169 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6170 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6171
6172 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6173 }
6174
6175 if(type == "POI")
6176 {
6177 // p_{m*n,0}:
6178 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6179 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6180 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6181 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6182
6183 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6184
6185 t = 1; // typeFlag = RP or POI
6186 }
6187 else if(type == "RP")
6188 {
6189 // p_{m*n,0} = q_{m*n,0}:
6190 p1n0kRe = q1n0kRe;
6191 p1n0kIm = q1n0kIm;
6192
6193 mp = mq;
6194
6195 t = 0; // typeFlag = RP or POI
6196 }
6197
1268c371 6198 // 2'-particle correlation for particular pt or eta bin:
489d5531 6199 Double_t two1n1nPtEta = 0.;
b40a910e 6200 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
489d5531 6201 if(mp*dMult-mq)
6202 {
6203 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6204 / (mp*dMult-mq);
b40a910e 6205 // determine multiplicity weight:
6206 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6207 {
6208 mWeight2pPrime = mp*dMult-mq;
6209 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6210 {
6211 mWeight2pPrime = 1.;
6212 }
489d5531 6213 if(type == "POI") // to be improved (I do not this if)
6214 {
6215 // fill profile to get <<2'>> for POIs
b40a910e 6216 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6217 // fill profile to get <<2'>^2> for POIs
6218 fDiffFlowSquaredCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
489d5531 6219 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6220 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
b40a910e 6221 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mWeight2pPrime);
489d5531 6222 }
6223 else if(type == "RP") // to be improved (I do not this if)
6224 {
6225 // profile to get <<2'>> for RPs:
b40a910e 6226 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6227 // profile to get <<2'>^2> for RPs:
6228 fDiffFlowSquaredCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
489d5531 6229 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6230 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
b40a910e 6231 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mWeight2pPrime);
489d5531 6232 }
6233 } // end of if(mp*dMult-mq)
6234
6235 // 4'-particle correlation:
6236 Double_t four1n1n1n1nPtEta = 0.;
b40a910e 6237 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
489d5531 6238 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6239 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6240 {
6241 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6242 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6243 - 2.*q2n0kIm*dReQ1n*dImQ1n
6244 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6245 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6246 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6247 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6248 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6249 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6250 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6251 + 2.*mq*dMult
6252 - 6.*mq)
6253 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6254 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
b40a910e 6255 // determine multiplicity weight:
6256 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6257 {
6258 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6259 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6260 {
6261 mWeight4pPrime = 1.;
6262 }
489d5531 6263 if(type == "POI")
6264 {
6265 // profile to get <<4'>> for POIs:
b40a910e 6266 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6267 // profile to get <<4'>^2> for POIs:
6268 fDiffFlowSquaredCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
489d5531 6269 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6270 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
b40a910e 6271 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,mWeight4pPrime);
489d5531 6272 }
6273 else if(type == "RP")
6274 {
6275 // profile to get <<4'>> for RPs:
b40a910e 6276 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6277 // profile to get <<4'>^2> for RPs:
6278 fDiffFlowSquaredCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
489d5531 6279 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6280 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
b40a910e 6281 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,mWeight4pPrime);
489d5531 6282 }
6283 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6284 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6285
6286 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6287
6288
6289} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6290
489d5531 6291//================================================================================================================================
6292
1268c371 6293void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
6294{
6295 // Calculate all reduced correlations needed for 2D differential flow for each (pt,eta) bin.
6296
6297 // Multiplicity:
6298 Double_t dMult = (*fSpk)(0,0);
6299 // Real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6300 Double_t dReQ1n = (*fReQ)(0,0);
6301 Double_t dReQ2n = (*fReQ)(1,0);
6302 //Double_t dReQ3n = (*fReQ)(2,0);
6303 //Double_t dReQ4n = (*fReQ)(3,0);
6304 Double_t dImQ1n = (*fImQ)(0,0);
6305 Double_t dImQ2n = (*fImQ)(1,0);
6306 //Double_t dImQ3n = (*fImQ)(2,0);
6307 //Double_t dImQ4n = (*fImQ)(3,0);
6308
6309 // 2D reduced correlations are stored in TProfile2D f2DDiffFlowCorrelationsPro[0=RP,1=POI][correlation index].
6310 // Correlation index runs as follows:
6311 // 0: <<2'>>
6312 // 1: <<4'>>
6313 // 2: <<6'>>
6314 // 3: <<8'>>
6315
6316 Int_t t = 0; // type flag
6317 if(type == "RP")
6318 {
6319 t = 0;
6320 } else if(type == "POI")
6321 {
6322 t = 1;
6323 }
6324
6325 // Looping over all (pt,eta) bins and calculating correlations needed for differential flow:
6326 for(Int_t p=1;p<=fnBinsPt;p++)
6327 {
6328 for(Int_t e=1;e<=fnBinsEta;e++)
6329 {
6330 // Real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
6331 Double_t p1n0kRe = 0.;
6332 Double_t p1n0kIm = 0.;
6333 // Number of POIs in particular pt or eta bin:
6334 Double_t mp = 0.;
6335 // Real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for 'RP && POI particles' in particular pt or eta bin):
6336 Double_t q1n0kRe = 0.;
6337 Double_t q1n0kIm = 0.;
6338 Double_t q2n0kRe = 0.;
6339 Double_t q2n0kIm = 0.;
6340 // Number of 'RP && POI particles' in particular pt or eta bin:
6341 Double_t mq = 0.;
6342 if(type == "POI")
6343 {
6344 // q_{m*n,0}:
6345 q1n0kRe = fReRPQ2dEBE[2][0][0]->GetBinContent(fReRPQ2dEBE[2][0][0]->GetBin(p,e))
6346 * fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e));
6347 q1n0kIm = fImRPQ2dEBE[2][0][0]->GetBinContent(fImRPQ2dEBE[2][0][0]->GetBin(p,e))
6348 * fImRPQ2dEBE[2][0][0]->GetBinEntries(fImRPQ2dEBE[2][0][0]->GetBin(p,e));
6349 q2n0kRe = fReRPQ2dEBE[2][1][0]->GetBinContent(fReRPQ2dEBE[2][1][0]->GetBin(p,e))
6350 * fReRPQ2dEBE[2][1][0]->GetBinEntries(fReRPQ2dEBE[2][1][0]->GetBin(p,e));
6351 q2n0kIm = fImRPQ2dEBE[2][1][0]->GetBinContent(fImRPQ2dEBE[2][1][0]->GetBin(p,e))
6352 * fImRPQ2dEBE[2][1][0]->GetBinEntries(fImRPQ2dEBE[2][1][0]->GetBin(p,e));
6353 // m_{q}:
6354 mq = fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6355 } // end of if(type == "POI")
6356 else if(type == "RP")
6357 {
6358 // q_{m*n,0}:
6359 q1n0kRe = fReRPQ2dEBE[0][0][0]->GetBinContent(fReRPQ2dEBE[0][0][0]->GetBin(p,e))
6360 * fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e));
6361 q1n0kIm = fImRPQ2dEBE[0][0][0]->GetBinContent(fImRPQ2dEBE[0][0][0]->GetBin(p,e))
6362 * fImRPQ2dEBE[0][0][0]->GetBinEntries(fImRPQ2dEBE[0][0][0]->GetBin(p,e));
6363 q2n0kRe = fReRPQ2dEBE[0][1][0]->GetBinContent(fReRPQ2dEBE[0][1][0]->GetBin(p,e))
6364 * fReRPQ2dEBE[0][1][0]->GetBinEntries(fReRPQ2dEBE[0][1][0]->GetBin(p,e));
6365 q2n0kIm = fImRPQ2dEBE[0][1][0]->GetBinContent(fImRPQ2dEBE[0][1][0]->GetBin(p,e))
6366 * fImRPQ2dEBE[0][1][0]->GetBinEntries(fImRPQ2dEBE[0][1][0]->GetBin(p,e));
6367 // m_{q}:
6368 mq = fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6369 } // end of else if(type == "RP")
6370 if(type == "POI")
6371 {
6372 // p_{m*n,0}:
6373 p1n0kRe = fReRPQ2dEBE[1][0][0]->GetBinContent(fReRPQ2dEBE[1][0][0]->GetBin(p,e))
6374 * fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e));
6375 p1n0kIm = fImRPQ2dEBE[1][0][0]->GetBinContent(fImRPQ2dEBE[1][0][0]->GetBin(p,e))
6376 * fImRPQ2dEBE[1][0][0]->GetBinEntries(fImRPQ2dEBE[1][0][0]->GetBin(p,e));
6377 // m_{p}
6378 mp = fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6379
6380 t = 1; // typeFlag = RP or POI
6381 } // end of if(type == "POI")
6382 else if(type == "RP")
6383 {
6384 // p_{m*n,0} = q_{m*n,0}:
6385 p1n0kRe = q1n0kRe;
6386 p1n0kIm = q1n0kIm;
6387 // m_{p} = m_{q}:
6388 mp = mq;
6389
6390 t = 0; // typeFlag = RP or POI
6391 } // end of if(type == "RP")
6392
6393 // 2'-particle correlation for particular (pt,eta) bin:
6394 Double_t two1n1nPtEta = 0.;
6395 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
6396 if(mp*dMult-mq)
6397 {
6398 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6399 / (mp*dMult-mq);
6400 // Determine multiplicity weight:
6401 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6402 {
6403 mWeight2pPrime = mp*dMult-mq;
6404 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6405 {
6406 mWeight2pPrime = 1.;
6407 }
6408 // Fill 2D profile holding <<2'>>:
6409 f2DDiffFlowCorrelationsPro[t][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mWeight2pPrime);
6410 } // end of if(mp*dMult-mq)
6411
6412 // 4'-particle correlation:
6413 Double_t four1n1n1n1nPtEta = 0.;
6414 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
6415 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6416 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6417 {
6418 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6419 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6420 - 2.*q2n0kIm*dReQ1n*dImQ1n
6421 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6422 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6423 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6424 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6425 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6426 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6427 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6428 + 2.*mq*dMult
6429 - 6.*mq)
6430 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6431 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6432 // Determine multiplicity weight:
6433 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6434 {
6435 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6436 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6437 {
6438 mWeight4pPrime = 1.;
6439 }
6440 // Fill 2D profile holding <<4'>>:
6441 f2DDiffFlowCorrelationsPro[t][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,mWeight4pPrime);
6442 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6443 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6444 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6445 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6446
6447} // end of AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
6448
6449//================================================================================================================================
6450
489d5531 6451void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6452{
6453 // Calculate sums of various event weights for reduced correlations.
6454 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6455
2a98ceb8 6456 Int_t typeFlag = 0;
6457 Int_t ptEtaFlag = 0;
489d5531 6458
6459 if(type == "RP")
6460 {
6461 typeFlag = 0;
6462 } else if(type == "POI")
6463 {
6464 typeFlag = 1;
6465 }
6466
6467 if(ptOrEta == "Pt")
6468 {
6469 ptEtaFlag = 0;
6470 } else if(ptOrEta == "Eta")
6471 {
6472 ptEtaFlag = 1;
6473 }
6474
6475 // shortcuts:
6476 Int_t t = typeFlag;
6477 Int_t pe = ptEtaFlag;
6478
6479 // binning:
6480 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6481 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6482 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6483 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6484
6485 for(Int_t rpq=0;rpq<3;rpq++)
6486 {
6487 for(Int_t m=0;m<4;m++)
6488 {
6489 for(Int_t k=0;k<9;k++)
6490 {
6491 if(!fReRPQ1dEBE[rpq][pe][m][k])
6492 {
6493 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6494 cout<<"pe = "<<pe<<endl;
6495 cout<<"rpq = "<<rpq<<endl;
6496 cout<<"m = "<<m<<endl;
6497 cout<<"k = "<<k<<endl;
6498 exit(0);
6499 }
6500 }
6501 }
6502 }
6503
6504 // multiplicities:
1268c371 6505 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
489d5531 6506 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6507 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6508 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6509
6510 // event weights for reduced correlations:
6511 Double_t dw2 = 0.; // event weight for <2'>
6512 Double_t dw4 = 0.; // event weight for <4'>
6513 //Double_t dw6 = 0.; // event weight for <6'>
6514 //Double_t dw8 = 0.; // event weight for <8'>
6515
6516 // looping over bins:
6517 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6518 {
6519 if(type == "RP")
6520 {
6521 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6522 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6523 } else if(type == "POI")
6524 {
6525 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6526 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6527 }
6528
6529 // event weight for <2'>:
6530 dw2 = mp*dMult-mq;
6531 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6532 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6533
6534 // event weight for <4'>:
6535 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6536 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6537 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6538 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6539
6540 // event weight for <6'>:
6541 //dw6 = ...;
6542 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6543 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6544
6545 // event weight for <8'>:
6546 //dw8 = ...;
6547 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6548 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6549 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6550
6551} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6552
6553
6554//================================================================================================================================
6555
6556
6557void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6558{
6559 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6560 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6561 //
6562 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6563 // 1.) i<j
6564 // 2.) do not store terms which DO NOT include reduced correlations;
6565 // Table:
6566 // [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'>]
6567
2a98ceb8 6568 Int_t typeFlag = 0;
6569 Int_t ptEtaFlag = 0;
489d5531 6570
6571 if(type == "RP")
6572 {
6573 typeFlag = 0;
6574 } else if(type == "POI")
6575 {
6576 typeFlag = 1;
6577 }
6578
6579 if(ptOrEta == "Pt")
6580 {
6581 ptEtaFlag = 0;
6582 } else if(ptOrEta == "Eta")
6583 {
6584 ptEtaFlag = 1;
6585 }
6586
6587 // shortcuts:
6588 Int_t t = typeFlag;
6589 Int_t pe = ptEtaFlag;
6590
6591 // binning:
6592 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6593 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6594 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6595 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6596
6597 // protection:
6598 for(Int_t rpq=0;rpq<3;rpq++)
6599 {
6600 for(Int_t m=0;m<4;m++)
6601 {
6602 for(Int_t k=0;k<9;k++)
6603 {
6604 if(!fReRPQ1dEBE[rpq][pe][m][k])
6605 {
6606 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6607 cout<<"pe = "<<pe<<endl;
6608 cout<<"rpq = "<<rpq<<endl;
6609 cout<<"m = "<<m<<endl;
6610 cout<<"k = "<<k<<endl;
6611 exit(0);
6612 }
6613 }
6614 }
6615 }
6616
6617 // multiplicities:
1268c371 6618 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
489d5531 6619 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6620 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6621 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6622
6623 // event weights for correlations:
6624 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6625 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6626 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6627 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6628
6629 // event weights for reduced correlations:
6630 Double_t dw2 = 0.; // event weight for <2'>
6631 Double_t dw4 = 0.; // event weight for <4'>
6632 //Double_t dw6 = 0.; // event weight for <6'>
6633 //Double_t dw8 = 0.; // event weight for <8'>
6634
6635 // looping over bins:
6636 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6637 {
6638 if(type == "RP")
6639 {
6640 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6641 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6642 } else if(type == "POI")
6643 {
6644 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6645 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6646 }
6647
6648 // event weight for <2'>:
6649 dw2 = mp*dMult-mq;
6650 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6651 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6652 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6653 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6654
6655 // event weight for <4'>:
6656 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6657 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6658 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6659 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6660 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6661 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6662 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6663
6664 // event weight for <6'>:
6665 //dw6 = ...;
6666 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6667 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6668 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6669 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6670 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6671 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6672 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6673
6674 // event weight for <8'>:
6675 //dw8 = ...;
6676 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6677 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6678 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6679 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6680 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6681 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6682 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6683
6684 // Table:
6685 // [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'>]
6686
6687 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6688
6689
6690
6691} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6692
489d5531 6693//================================================================================================================================
6694
489d5531 6695void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6696{
6697 // Transfer profiles into histograms and calculate statistical errors correctly.
6698
1268c371 6699 Int_t t = 0; // RP or POI
6700 Int_t pe = 0; // pt or eta
489d5531 6701
6702 if(type == "RP")
6703 {
1268c371 6704 t = 0;
489d5531 6705 } else if(type == "POI")
6706 {
1268c371 6707 t = 1;
489d5531 6708 }
6709
6710 if(ptOrEta == "Pt")
6711 {
1268c371 6712 pe = 0;
489d5531 6713 } else if(ptOrEta == "Eta")
6714 {
1268c371 6715 pe = 1;
489d5531 6716 }
1268c371 6717
6718 for(Int_t rci=0;rci<4;rci++) // to be improved - moved into the method CheckPointersUsedInFinish()
489d5531 6719 {
6720 if(!fDiffFlowCorrelationsPro[t][pe][rci])
6721 {
6722 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6723 cout<<"t = "<<t<<endl;
6724 cout<<"pe = "<<pe<<endl;
6725 cout<<"rci = "<<rci<<endl;
6726 exit(0);
6727 }
b40a910e 6728 if(!fDiffFlowSquaredCorrelationsPro[t][pe][rci])
6729 {
6730 cout<<"WARNING: fDiffFlowSquaredCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6731 cout<<"t = "<<t<<endl;
6732 cout<<"pe = "<<pe<<endl;
6733 cout<<"rci = "<<rci<<endl;
6734 exit(0);
6735 }
489d5531 6736 for(Int_t power=0;power<2;power++)
6737 {
6738 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
6739 {
6740 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6741 cout<<"t = "<<t<<endl;
6742 cout<<"pe = "<<pe<<endl;
6743 cout<<"power = "<<power<<endl;
6744 cout<<"rci = "<<rci<<endl;
6745 exit(0);
6746 }
6747 } // end of for(Int_t power=0;power<2;power++)
6748 } // end of for(Int_t rci=0;rci<4;rci++)
6749
6750 // common:
b40a910e 6751 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 6752 // transfer 1D profile into 1D histogram:
6753 Double_t correlation = 0.;
b40a910e 6754 Double_t squaredCorrelation = 0.;
489d5531 6755 Double_t spread = 0.;
6756 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
6757 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
6758 Double_t error = 0.; // error = termA * spread * termB
6759 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
6760 // termB = 1/pow(1-termA^2,0.5)
6761 Double_t termA = 0.;
6762 Double_t termB = 0.;
6763 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
6764 {
6765 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
6766 {
b40a910e 6767 if(fDiffFlowCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2 ||
6768 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2)
6769 {
6770 fDiffFlowCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
6771 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
6772 continue; // to be improved - should I ignore results in pt bins with one entry for reduced correlations or not?
6773 }
489d5531 6774 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
b40a910e 6775 squaredCorrelation = fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinContent(b);
6776 if(squaredCorrelation-correlation*correlation >= 0.)
6777 {
6778 spread = pow(squaredCorrelation-correlation*correlation,0.5);
6779 } else
6780 {
6781 cout<<endl;
6782 cout<<Form(" WARNING: Imaginary 'spread' for rci = %d, pe = %d, bin = %d !!!!",rci,pe,b)<<endl;
6783 cout<<endl;
6784 }
489d5531 6785 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
6786 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
1268c371 6787 if(TMath::Abs(sumOfWeights)>0.){termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);}
6788 if(1.-pow(termA,2.)>0.){termB = 1./pow(1.-pow(termA,2.),0.5);}
489d5531 6789 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
6790 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
6791 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
6792 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6793 } // end of for(Int_t rci=0;rci<4;rci++)
6794
6795} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6796
489d5531 6797//================================================================================================================================
6798
489d5531 6799void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6800{
6801 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
6802 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
6803 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
6804 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
6805 // <6'><8'>, <8><8'>.
6806
2a98ceb8 6807 Int_t typeFlag = 0;
6808 Int_t ptEtaFlag = 0;
489d5531 6809
6810 if(type == "RP")
6811 {
6812 typeFlag = 0;
6813 } else if(type == "POI")
6814 {
6815 typeFlag = 1;
6816 }
6817
6818 if(ptOrEta == "Pt")
6819 {
6820 ptEtaFlag = 0;
6821 } else if(ptOrEta == "Eta")
6822 {
6823 ptEtaFlag = 1;
6824 }
6825
6826 // shortcuts:
6827 Int_t t = typeFlag;
6828 Int_t pe = ptEtaFlag;
6829
6830 // common:
6831 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6832 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6833 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6834
6835 // protections // to be improved (add protection for all pointers in this method)
6836 if(!fIntFlowCorrelationsEBE)
6837 {
6838 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
6839 exit(0);
6840 }
6841
6842 /*
1268c371 6843 Double_t dMult = (*fSpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
489d5531 6844 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6845 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6846 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6847 */
6848
6849 // e-b-e correlations:
6850 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
6851 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
6852 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
6853 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
6854
6855 // event weights for correlations:
6856 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
6857 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
6858 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
6859 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
6860
6861 // e-b-e reduced correlations:
6862 Double_t twoReducedEBE = 0.; // <2'>
6863 Double_t fourReducedEBE = 0.; // <4'>
6864 Double_t sixReducedEBE = 0.; // <6'>
6865 Double_t eightReducedEBE = 0.; // <8'>
6866
6867 // event weights for reduced correlations:
6868 Double_t dw2 = 0.; // event weight for <2'>
6869 Double_t dw4 = 0.; // event weight for <4'>
6870 //Double_t dw6 = 0.; // event weight for <6'>
6871 //Double_t dw8 = 0.; // event weight for <8'>
6872
6873 // looping over bins:
6874 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6875 {
6876 // e-b-e reduced correlations:
6877 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
6878 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
6879 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
6880 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
6881
6882 /*
6883 // to be improved (I should not do this here again)
6884 if(type == "RP")
6885 {
6886 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6887 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6888 } else if(type == "POI")
6889 {
6890 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6891 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6892 }
6893
6894 // event weights for reduced correlations:
6895 dw2 = mp*dMult-mq; // weight for <2'>
6896 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6897 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
6898 //dw6 = ...
6899 //dw8 = ...
6900
6901 */
6902
6903 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
6904 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
6905
6906 // storing all products:
6907 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
6908 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
6909 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
6910 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
6911
6912 // event weight for <4'>:
6913 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
6914 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
6915 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
6916 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
6917 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
6918
6919 // event weight for <6'>:
6920 //dw6 = ...;
6921 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
6922 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
6923 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
6924 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
6925 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
6926 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
6927 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6928
6929 // event weight for <8'>:
6930 //dw8 = ...;
6931 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
6932 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
6933 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
6934 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
6935 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
6936 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6937 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
6938 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
6939
6940} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6941
489d5531 6942//================================================================================================================================
6943
489d5531 6944void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
6945{
6946 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
6947 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
6948 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
6949 //
6950 // 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)]
6951 //
6952 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
6953 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
6954 //
6955 // 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)]
6956 // 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)]
6957 // 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)]
6958 // 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)]
6959 // 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)]
6960 // ...
6961
2a98ceb8 6962 Int_t typeFlag = 0;
6963 Int_t ptEtaFlag = 0;
489d5531 6964
6965 if(type == "RP")
6966 {
6967 typeFlag = 0;
6968 } else if(type == "POI")
6969 {
6970 typeFlag = 1;
6971 }
6972
6973 if(ptOrEta == "Pt")
6974 {
6975 ptEtaFlag = 0;
6976 } else if(ptOrEta == "Eta")
6977 {
6978 ptEtaFlag = 1;
6979 }
6980
6981 // shortcuts:
6982 Int_t t = typeFlag;
6983 Int_t pe = ptEtaFlag;
6984
6985 // common:
6986 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6987 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
6988 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6989 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6990
6991 // average correlations:
6992 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
6993 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
6994 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
6995 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
6996
6997 // sum of weights for correlation:
6998 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
6999 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7000 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7001 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7002
7003 // average reduced correlations:
7004 Double_t twoReduced = 0.; // <<2'>>
7005 Double_t fourReduced = 0.; // <<4'>>
7006 //Double_t sixReduced = 0.; // <<6'>>
7007 //Double_t eightReduced = 0.; // <<8'>>
7008
7009 // sum of weights for reduced correlation:
7010 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7011 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7012 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7013 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7014
7015 // product of weights for reduced correlation:
7016 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7017 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7018 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7019 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7020 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7021 // ...
7022
7023 // products for differential flow:
7024 Double_t twoTwoReduced = 0; // <<2><2'>>
7025 Double_t twoFourReduced = 0; // <<2><4'>>
7026 Double_t fourTwoReduced = 0; // <<4><2'>>
7027 Double_t fourFourReduced = 0; // <<4><4'>>
7028 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7029
7030 // denominators in the expressions for the unbiased estimators for covariances:
7031 // denominator = 1 - term1/(term2*term3)
7032 // prefactor = term1/(term2*term3)
7033 Double_t denominator = 0.;
7034 Double_t prefactor = 0.;
7035 Double_t term1 = 0.;
7036 Double_t term2 = 0.;
7037 Double_t term3 = 0.;
7038
7039 // unbiased estimators for covariances for differential flow:
7040 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7041 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7042 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7043 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7044 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7045 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7046 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7047 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7048 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7049 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7050
7051 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7052 {
7053 // average reduced corelations:
7054 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7055 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7056 // average products:
7057 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7058 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7059 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7060 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7061 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7062 // sum of weights for reduced correlations:
7063 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7064 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7065 // products of weights for correlations:
7066 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7067 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7068 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7069 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7070 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7071 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7072 // prefactor (multiplies Cov's) = term1/(term2*term3)
7073 // <2>,<2'>:
7074 term1 = productOfWeightsForTwoTwoReduced;
7075 term2 = sumOfWeightsForTwo;
7076 term3 = sumOfWeightsForTwoReduced;
7077 if(term2*term3>0.)
7078 {
7079 denominator = 1.-term1/(term2*term3);
7080 prefactor = term1/(term2*term3);
1268c371 7081 if(TMath::Abs(denominator)>1.e-6)
489d5531 7082 {
7083 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7084 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7085 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7086 }
7087 }
7088 // <2>,<4'>:
7089 term1 = productOfWeightsForTwoFourReduced;
7090 term2 = sumOfWeightsForTwo;
7091 term3 = sumOfWeightsForFourReduced;
7092 if(term2*term3>0.)
7093 {
7094 denominator = 1.-term1/(term2*term3);
7095 prefactor = term1/(term2*term3);
1268c371 7096 if(TMath::Abs(denominator)>1.e-6)
489d5531 7097 {
7098 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7099 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7100 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7101 }
7102 }
7103 // <4>,<2'>:
7104 term1 = productOfWeightsForFourTwoReduced;
7105 term2 = sumOfWeightsForFour;
7106 term3 = sumOfWeightsForTwoReduced;
7107 if(term2*term3>0.)
7108 {
7109 denominator = 1.-term1/(term2*term3);
7110 prefactor = term1/(term2*term3);
1268c371 7111 if(TMath::Abs(denominator)>1.e-6)
489d5531 7112 {
7113 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7114 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7115 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7116 }
7117 }
7118 // <4>,<4'>:
7119 term1 = productOfWeightsForFourFourReduced;
7120 term2 = sumOfWeightsForFour;
7121 term3 = sumOfWeightsForFourReduced;
7122 if(term2*term3>0.)
7123 {
7124 denominator = 1.-term1/(term2*term3);
7125 prefactor = term1/(term2*term3);
1268c371 7126 if(TMath::Abs(denominator)>1.e-6)
489d5531 7127 {
7128 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7129 wCovFourFourReduced = covFourFourReduced*prefactor;
7130 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7131 }
7132 }
7133 // <2'>,<4'>:
7134 term1 = productOfWeightsForTwoReducedFourReduced;
7135 term2 = sumOfWeightsForTwoReduced;
7136 term3 = sumOfWeightsForFourReduced;
7137 if(term2*term3>0.)
7138 {
7139 denominator = 1.-term1/(term2*term3);
7140 prefactor = term1/(term2*term3);
1268c371 7141 if(TMath::Abs(denominator)>1.e-6)
489d5531 7142 {
7143 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7144 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7145 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7146 }
7147 }
7148 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7149
7150} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
7151
489d5531 7152//================================================================================================================================
7153
489d5531 7154void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
7155{
1268c371 7156 // Calculate final results for differential flow.
489d5531 7157
1268c371 7158 // REMARK: Differential flow calculated in this method is NOT corrected for non-uniform acceptance.
7159 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied in the method
7160 // CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
7161
7162 Int_t t = 0; // RP or POI
7163 Int_t pe = 0; // pt or eta
489d5531 7164
7165 if(type == "RP")
7166 {
1268c371 7167 t = 0;
489d5531 7168 } else if(type == "POI")
7169 {
1268c371 7170 t = 1;
489d5531 7171 }
7172
7173 if(ptOrEta == "Pt")
7174 {
1268c371 7175 pe = 0;
489d5531 7176 } else if(ptOrEta == "Eta")
7177 {
1268c371 7178 pe = 1;
489d5531 7179 }
1268c371 7180
7181 // Common:
489d5531 7182 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
1268c371 7183 // Correlations:
489d5531 7184 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
1268c371 7185 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7186 // Statistical errors of correlations:
489d5531 7187 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
7188 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
1268c371 7189 // Reduced correlations:
489d5531 7190 Double_t twoReduced = 0.; // <<2'>>
7191 Double_t fourReduced = 0.; // <<4'>>
1268c371 7192 // Statistical errors of reduced correlations:
489d5531 7193 Double_t twoReducedError = 0.;
7194 Double_t fourReducedError = 0.;
1268c371 7195 // Covariances:
8e1cefdd 7196 Double_t wCovTwoFour = 0.; // Cov(<2>,<4>) * prefactor(<2>,<4>)
7197 if(!fForgetAboutCovariances)
7198 {
7199 wCovTwoFour = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(<2>,<4>)
7200 }
489d5531 7201 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
7202 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
7203 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
7204 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
7205 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
1268c371 7206 // Differential flow:
489d5531 7207 Double_t v2Prime = 0.; // v'{2}
7208 Double_t v4Prime = 0.; // v'{4}
1268c371 7209 // Statistical error of differential flow:
489d5531 7210 Double_t v2PrimeError = 0.;
7211 Double_t v4PrimeError = 0.;
1268c371 7212 // Squared statistical error of differential flow:
489d5531 7213 Double_t v2PrimeErrorSquared = 0.;
7214 Double_t v4PrimeErrorSquared = 0.;
1268c371 7215 // Loop over pt or eta bins:
489d5531 7216 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7217 {
1268c371 7218 // Reduced correlations and statistical errors:
489d5531 7219 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7220 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
7221 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7222 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
1268c371 7223 // Covariances:
8e1cefdd 7224 if(!fForgetAboutCovariances)
7225 {
7226 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
7227 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
7228 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
7229 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
7230 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
7231 }
1268c371 7232 // Differential flow:
489d5531 7233 // v'{2}:
7234 if(two>0.)
7235 {
7236 v2Prime = twoReduced/pow(two,0.5);
1268c371 7237 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*(pow(twoReduced,2.)*pow(twoError,2.)
7238 + 4.*pow(two,2.)*pow(twoReducedError,2.)
7239 - 4.*two*twoReduced*wCovTwoTwoReduced);
7240 if(v2PrimeErrorSquared>0.){v2PrimeError = pow(v2PrimeErrorSquared,0.5);}
7241 if(TMath::Abs(v2Prime)>0.)
7242 {
7243 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
7244 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
7245 }
7246 } // end of if(two>0.)
489d5531 7247 // differential flow:
7248 // v'{4}
7249 if(2.*pow(two,2.)-four > 0.)
7250 {
7251 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
1268c371 7252 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)
7253 * (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
7254 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
7255 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
7256 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
7257 - (3./2.)*(2.*two*twoReduced-fourReduced)
7258 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
7259 - 4.*two*(2.*pow(two,2.)-four)
7260 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
7261 + 2.*(2.*pow(two,2.)-four)
7262 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
7263 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
7264 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
7265 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
7266 if(v4PrimeErrorSquared>0.){v4PrimeError = pow(v4PrimeErrorSquared,0.5);}
7267 if(TMath::Abs(v4Prime)>0.)
7268 {
7269 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
7270 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
7271 }
7272 } // end of if(2.*pow(two,2.)-four > 0.)
489d5531 7273 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
1268c371 7274
7275} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7276
7277//================================================================================================================================
7278
7279void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
7280{
7281 // Calculate final results for 2D diferential flow.
7282
7283 // to be improved - check pointers used in this method
7284
7285 Int_t t = 0; // RP or POI
7286
7287 if(type == "RP")
7288 {
7289 t = 0;
7290 } else if(type == "POI")
7291 {
7292 t = 1;
7293 }
489d5531 7294
1268c371 7295 // Differential flow:
7296 Double_t v2Prime = 0.; // v'{2}
7297 Double_t v4Prime = 0.; // v'{4}
7298 // Differential cumulants:
7299 Double_t qc2Prime = 0.; // QC{2'}
7300 Double_t qc4Prime = 0.; // QC{4'}
7301 // Looping over all (pt,eta) bins and calculating differential flow:
7302 for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 7303 {
1268c371 7304 for(Int_t e=1;e<=fnBinsEta;e++)
489d5531 7305 {
1268c371 7306 // QC{2'}:
7307 qc2Prime = f2DDiffFlowCumulants[t][0]->GetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e));
7308 if(qc2Prime>=0.)
7309 {
7310 v2Prime = pow(qc2Prime,0.5);
7311 f2DDiffFlow[t][0]->SetBinContent(f2DDiffFlow[t][0]->GetBin(p,e),v2Prime);
7312 }
7313 // QC{4'}:
7314 qc4Prime = f2DDiffFlowCumulants[t][1]->GetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e));
7315 if(qc4Prime<=0.)
7316 {
7317 v4Prime = pow(-1.*qc4Prime,1./4.);
7318 f2DDiffFlow[t][1]->SetBinContent(f2DDiffFlow[t][1]->GetBin(p,e),v4Prime);
7319 }
7320 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7321 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7322
7323} // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
489d5531 7324
489d5531 7325//================================================================================================================================
7326
489d5531 7327void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7328{
7329 // a) Store all flags for integrated flow in profile fIntFlowFlags.
7330
7331 if(!fIntFlowFlags)
7332 {
7333 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
7334 exit(0);
7335 }
7336
7337 // particle weights used or not:
7338 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
7339 // which event weights were used:
7340 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
7341 {
7342 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
7343 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
7344 {
7345 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
7346 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
7347 {
7348 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7349 }
489d5531 7350 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7351 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7352 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7353 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
b3dacf6b 7354 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
7355 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
b77b6434 7356 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorAlsoFromNIT);
b3dacf6b 7357 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
0dd3b008 7358 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
8e1cefdd 7359 fIntFlowFlags->Fill(11.5,(Int_t)fForgetAboutCovariances);
e5834fcb 7360 fIntFlowFlags->Fill(12.5,(Int_t)fStorePhiDistributionForOneEvent);
dd442cd2 7361 fIntFlowFlags->Fill(13.5,(Int_t)fFillMultipleControlHistograms);
489d5531 7362} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7363
489d5531 7364//================================================================================================================================
7365
489d5531 7366void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7367{
7368 // Store all flags for differential flow in the profile fDiffFlowFlags.
7369
7370 if(!fDiffFlowFlags)
7371 {
1268c371 7372 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::SDFF() !!!!\n\n");
489d5531 7373 exit(0);
7374 }
7375
1268c371 7376 fDiffFlowFlags->Fill(0.5,fCalculateDiffFlow); // calculate differential flow
7377 fDiffFlowFlags->Fill(1.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not?
7378 //fDiffFlowFlags->Fill(2.5,""); // which event weight was used? ("combinations", "unit" or "multiplicity") to be improved - finalized
7379 fDiffFlowFlags->Fill(3.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7380 fDiffFlowFlags->Fill(4.5,fCalculate2DDiffFlow); // calculate also 2D differential flow vs (pt,eta)
7381
489d5531 7382} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7383
489d5531 7384//================================================================================================================================
7385
489d5531 7386void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7387{
7388 // Access all pointers to common control and common result histograms and profiles.
7389
1268c371 7390 TString sCommonConstantsName = "fCommonConstants";
7391 sCommonConstantsName += fAnalysisLabel->Data();
7392 fCommonConstants = dynamic_cast<TProfile*>(fHistList->FindObject(sCommonConstantsName.Data()));
7393 if(!fCommonConstants)
7394 {
7395 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::GPFCH() !!!!\n\n");
7396 exit(0);
7397 }
7398
7399 // to be improved - lines bellow can be implemented better.
7400
489d5531 7401 TString commonHistsName = "AliFlowCommonHistQC";
7402 commonHistsName += fAnalysisLabel->Data();
7403 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
b77b6434 7404 if(commonHist)
7405 {
7406 this->SetCommonHists(commonHist);
7407 if(fCommonHists->GetHarmonic())
7408 {
7409 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
7410 }
7411 } // end of if(commonHist)
489d5531 7412 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7413 commonHists2ndOrderName += fAnalysisLabel->Data();
7414 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7415 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7416 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7417 commonHists4thOrderName += fAnalysisLabel->Data();
7418 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7419 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7420 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7421 commonHists6thOrderName += fAnalysisLabel->Data();
7422 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7423 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7424 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7425 commonHists8thOrderName += fAnalysisLabel->Data();
7426 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
dd442cd2 7427 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7428
489d5531 7429 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7430 commonHistResults2ndOrderName += fAnalysisLabel->Data();
b77b6434 7431 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
7432 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
489d5531 7433 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7434 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7435 commonHistResults4thOrderName += fAnalysisLabel->Data();
7436 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7437 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7438 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7439 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7440 commonHistResults6thOrderName += fAnalysisLabel->Data();
7441 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7442 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7443 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7444 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7445 commonHistResults8thOrderName += fAnalysisLabel->Data();
7446 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7447 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7448 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7449
7450} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7451
7452
7453//================================================================================================================================
7454
7455
7456void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7457{
7458 // Get pointers for histograms with particle weights.
7459
7460 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
ca5f47e7 7461 if(!weightsList){printf("\n WARNING (QC): weightsList is NULL in AFAWQC::GPFPWH() !!!!\n");exit(0);}
7462 this->SetWeightsList(weightsList);
489d5531 7463 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7464 fUseParticleWeightsName += fAnalysisLabel->Data();
7465 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7466 if(useParticleWeights)
7467 {
7468 this->SetUseParticleWeights(useParticleWeights);
7469 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7470 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7471 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7472 }
7473} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7474
7475
7476//================================================================================================================================
7477
7478
7479void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7480{
7481 // Get pointers for histograms and profiles relevant for integrated flow:
7482 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7483 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7484 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7485 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7486
7487 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7488 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
b40a910e 7489 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"}; // to be improved (should I promote this to data member?)
7490 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"}; // to be improved (should I promote this to data member?)
489d5531 7491
7492 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7493 TList *intFlowList = NULL;
7494 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7495 if(!intFlowList)
7496 {
7497 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7498 exit(0);
7499 }
7500
b92ea2b9 7501 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7502 TString intFlowFlagsName = "fIntFlowFlags";
7503 intFlowFlagsName += fAnalysisLabel->Data();
7504 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7505 if(intFlowFlags)
7506 {
7507 this->SetIntFlowFlags(intFlowFlags);
7508 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
7509 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
7510 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
7511 } else
7512 {
7513 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7514 }
489d5531 7515
7516 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7517 TList *intFlowProfiles = NULL;
7518 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7519 if(intFlowProfiles)
7520 {
7521 // average multiplicities:
7522 TString avMultiplicityName = "fAvMultiplicity";
7523 avMultiplicityName += fAnalysisLabel->Data();
7524 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7525 if(avMultiplicity)
7526 {
7527 this->SetAvMultiplicity(avMultiplicity);
7528 } else
7529 {
7530 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7531 }
7532 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7533 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7534 intFlowCorrelationsProName += fAnalysisLabel->Data();
7535 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7536 if(intFlowCorrelationsPro)
7537 {
7538 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7539 } else
7540 {
7541 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7542 }
b40a910e 7543 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8^2>>:
7544 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
7545 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
7546 TProfile *intFlowSquaredCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowSquaredCorrelationsProName.Data()));
7547 if(intFlowSquaredCorrelationsPro)
7548 {
7549 this->SetIntFlowSquaredCorrelationsPro(intFlowSquaredCorrelationsPro);
7550 } else
7551 {
7552 cout<<"WARNING: intFlowSquaredCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7553 }
b3dacf6b 7554 if(fCalculateCumulantsVsM)
ff70ca91 7555 {
b40a910e 7556 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
b3dacf6b 7557 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7558 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7559 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7560 {
b3dacf6b 7561 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7562 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7563 if(intFlowCorrelationsVsMPro)
7564 {
7565 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7566 } else
7567 {
7568 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7569 }
7570 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b40a910e 7571 // Average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
7572 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
7573 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
7574 for(Int_t ci=0;ci<4;ci++) // correlation index
7575 {
7576 TProfile *intFlowSquaredCorrelationsVsMPro = dynamic_cast<TProfile*>
7577 (intFlowProfiles->FindObject(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data())));
7578 if(intFlowSquaredCorrelationsVsMPro)
7579 {
7580 this->SetIntFlowSquaredCorrelationsVsMPro(intFlowSquaredCorrelationsVsMPro,ci);
7581 } else
7582 {
7583 cout<<"WARNING: "<<Form("intFlowSquaredCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7584 }
7585 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b3dacf6b 7586 } // end of if(fCalculateCumulantsVsM)
489d5531 7587 // average all correlations for integrated flow (with wrong errors!):
7588 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7589 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7590 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7591 if(intFlowCorrelationsAllPro)
7592 {
7593 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7594 } else
7595 {
7596 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7597 }
7598 // average extra correlations for integrated flow (which appear only when particle weights are used):
7599 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7600 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7601 {
7602 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7603 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7604 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7605 if(intFlowExtraCorrelationsPro)
7606 {
7607 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7608 } else
7609 {
7610 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7611 }
7612 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7613 // average products of correlations <2>, <4>, <6> and <8>:
7614 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7615 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7616 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7617 if(intFlowProductOfCorrelationsPro)
7618 {
7619 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7620 } else
7621 {
7622 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7623 }
7624 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7625 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 7626 if(fCalculateCumulantsVsM)
7627 {
7628 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7629 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7630 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7631 for(Int_t pi=0;pi<6;pi++)
7632 {
7633 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7634 if(intFlowProductOfCorrelationsVsMPro)
7635 {
7636 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7637 } else
7638 {
7639 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7640 }
7641 } // end of for(Int_t pi=0;pi<6;pi++)
7642 } // end of if(fCalculateCumulantsVsM)
489d5531 7643 // average correction terms for non-uniform acceptance (with wrong errors!):
7644 for(Int_t sc=0;sc<2;sc++)
7645 {
7646 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7647 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7648 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7649 if(intFlowCorrectionTermsForNUAPro)
7650 {
7651 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7652 } else
7653 {
7654 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7655 cout<<"sc = "<<sc<<endl;
7656 }
2001bc3a 7657 // versus multiplicity:
b3dacf6b 7658 if(fCalculateCumulantsVsM)
2001bc3a 7659 {
b3dacf6b 7660 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
7661 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
7662 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
7663 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 7664 {
b3dacf6b 7665 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
7666 if(intFlowCorrectionTermsForNUAVsMPro)
7667 {
7668 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
7669 } else
7670 {
7671 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7672 cout<<"sc = "<<sc<<endl;
7673 cout<<"ci = "<<ci<<endl;
7674 }
7675 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7676 } // end of if(fCalculateCumulantsVsM)
489d5531 7677 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 7678 // average products of correction terms for NUA:
7679 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7680 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7681 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7682 if(intFlowProductOfCorrectionTermsForNUAPro)
7683 {
7684 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7685 } else
7686 {
7687 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7688 }
489d5531 7689 } else // to if(intFlowProfiles)
7690 {
7691 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7692 }
7693
7694 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7695 TList *intFlowResults = NULL;
7696 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7697 if(intFlowResults)
7698 {
7699 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7700 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7701 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7702 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7703 if(intFlowCorrelationsHist)
7704 {
7705 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7706 } else
7707 {
7708 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7709 }
ff70ca91 7710 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
b3dacf6b 7711 if(fCalculateCumulantsVsM)
ff70ca91 7712 {
b3dacf6b 7713 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7714 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7715 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7716 {
b3dacf6b 7717 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7718 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7719 if(intFlowCorrelationsVsMHist)
7720 {
7721 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7722 } else
7723 {
7724 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7725 }
7726 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7727 } // end of if(fCalculateCumulantsVsM)
489d5531 7728 // average all correlations for integrated flow (with correct errors!):
7729 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7730 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7731 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7732 if(intFlowCorrelationsAllHist)
7733 {
7734 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7735 } else
7736 {
7737 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7738 }
7739 // average correction terms for non-uniform acceptance (with correct errors!):
7740 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7741 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7742 for(Int_t sc=0;sc<2;sc++)
7743 {
7744 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7745 if(intFlowCorrectionTermsForNUAHist)
7746 {
7747 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7748 } else
7749 {
7750 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7751 cout<<"sc = "<<sc<<endl;
7752 }
7753 } // end of for(Int_t sc=0;sc<2;sc++)
7754 // covariances (multiplied with weight dependent prefactor):
7755 TString intFlowCovariancesName = "fIntFlowCovariances";
7756 intFlowCovariancesName += fAnalysisLabel->Data();
7757 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7758 if(intFlowCovariances)
7759 {
7760 this->SetIntFlowCovariances(intFlowCovariances);
7761 } else
7762 {
7763 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7764 }
7765 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7766 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7767 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7768 for(Int_t power=0;power<2;power++)
7769 {
7770 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7771 if(intFlowSumOfEventWeights)
7772 {
7773 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7774 } else
7775 {
7776 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7777 cout<<"power = "<<power<<endl;
7778 }
7779 } // end of for(Int_t power=0;power<2;power++)
7780 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7781 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7782 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7783 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7784 if(intFlowSumOfProductOfEventWeights)
7785 {
7786 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7787 } else
7788 {
7789 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7790 }
ff70ca91 7791 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7792 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
b3dacf6b 7793 if(fCalculateCumulantsVsM)
ff70ca91 7794 {
b3dacf6b 7795 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7796 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7797 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7798 for(Int_t ci=0;ci<6;ci++)
7799 {
7800 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7801 if(intFlowCovariancesVsM)
ff70ca91 7802 {
b3dacf6b 7803 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
ff70ca91 7804 } else
7805 {
b3dacf6b 7806 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7807 }
b3dacf6b 7808 } // end of for(Int_t ci=0;ci<6;ci++)
7809 } // end of if(fCalculateCumulantsVsM)
7810 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7811 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7812 if(fCalculateCumulantsVsM)
7813 {
7814 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7815 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7816 TString sumFlag[2][4] = {{"#sum_{i=1}^{N} w_{<2>}","#sum_{i=1}^{N} w_{<4>}","#sum_{i=1}^{N} w_{<6>}","#sum_{i=1}^{N} w_{<8>}"},
7817 {"#sum_{i=1}^{N} w_{<2>}^{2}","#sum_{i=1}^{N} w_{<4>}^{2}","#sum_{i=1}^{N} w_{<6>}^{2}","#sum_{i=1}^{N} w_{<8>}^{2}"}};
7818 for(Int_t si=0;si<4;si++)
7819 {
7820 for(Int_t power=0;power<2;power++)
7821 {
7822 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7823 if(intFlowSumOfEventWeightsVsM)
7824 {
7825 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7826 } else
7827 {
7828 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7829 }
7830 } // end of for(Int_t power=0;power<2;power++)
7831 } // end of for(Int_t si=0;si<4;si++)
7832 } // end of if(fCalculateCumulantsVsM)
ff70ca91 7833 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7834 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7835 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 7836 if(fCalculateCumulantsVsM)
ff70ca91 7837 {
b3dacf6b 7838 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7839 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7840 TString sopowFlag[6] = {"#sum_{i=1}^{N} w_{<2>} w_{<4>}","#sum_{i=1}^{N} w_{<2>} w_{<6>}","#sum_{i=1}^{N} w_{<2>} w_{<8>}",
7841 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7842 for(Int_t pi=0;pi<6;pi++)
ff70ca91 7843 {
b3dacf6b 7844 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7845 if(intFlowSumOfProductOfEventWeightsVsM)
7846 {
7847 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7848 } else
7849 {
7850 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7851 }
7852 } // end of for(Int_t pi=0;pi<6;pi++)
7853 } // end of if(fCalculateCumulantsVsM)
0328db2d 7854 // covariances for NUA (multiplied with weight dependent prefactor):
7855 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7856 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7857 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7858 if(intFlowCovariancesNUA)
7859 {
7860 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7861 } else
7862 {
7863 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7864 }
7865 // sum of linear and quadratic event weights NUA terms:
7866 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7867 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7868 for(Int_t sc=0;sc<2;sc++)
7869 {
7870 for(Int_t power=0;power<2;power++)
7871 {
7872 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7873 if(intFlowSumOfEventWeightsNUA)
7874 {
7875 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7876 } else
7877 {
7878 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7879 cout<<"sc = "<<sc<<endl;
7880 cout<<"power = "<<power<<endl;
7881 }
7882 } // end of for(Int_t power=0;power<2;power++)
7883 } // end of for(Int_t sc=0;sc<2;sc++)
7884 // sum of products of event weights for NUA terms:
7885 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7886 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7887 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7888 if(intFlowSumOfProductOfEventWeightsNUA)
7889 {
7890 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7891 } else
7892 {
7893 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7894 }
b3dacf6b 7895 // Final results for reference Q-cumulants:
489d5531 7896 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7897 intFlowQcumulantsName += fAnalysisLabel->Data();
7898 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7899 if(intFlowQcumulants)
7900 {
7901 this->SetIntFlowQcumulants(intFlowQcumulants);
7902 } else
7903 {
7904 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7905 }
b3dacf6b 7906 // Final results for reference Q-cumulants rebinned in M:
7907 if(fCalculateCumulantsVsM)
7908 {
7909 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
7910 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
7911 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
7912 if(intFlowQcumulantsRebinnedInM)
7913 {
7914 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
7915 } else
7916 {
7917 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7918 }
7919 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 7920 // Ratio between error squared: with/without non-isotropic terms:
7921 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
7922 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
7923 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
7924 if(intFlowQcumulantsErrorSquaredRatio)
7925 {
7926 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
7927 } else
7928 {
7929 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7930 }
ff70ca91 7931 // final results for integrated Q-cumulants versus multiplicity:
ff70ca91 7932 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
b3dacf6b 7933 if(fCalculateCumulantsVsM)
ff70ca91 7934 {
b3dacf6b 7935 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7936 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7937 for(Int_t co=0;co<4;co++) // cumulant order
ff70ca91 7938 {
b3dacf6b 7939 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7940 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7941 if(intFlowQcumulantsVsM)
7942 {
7943 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7944 } else
7945 {
7946 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7947 }
7948 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7949 } // end of if(fCalculateCumulantsVsM)
7950 // Final reference flow estimates from Q-cumulants:
489d5531 7951 TString intFlowName = "fIntFlow";
7952 intFlowName += fAnalysisLabel->Data();
7953 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7954 if(intFlow)
7955 {
7956 this->SetIntFlow(intFlow);
7957 } else
7958 {
7959 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7960 }
b3dacf6b 7961 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
7962 if(fCalculateCumulantsVsM)
ff70ca91 7963 {
b3dacf6b 7964 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
7965 intFlowRebinnedInMName += fAnalysisLabel->Data();
7966 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
7967 if(intFlowRebinnedInM)
ff70ca91 7968 {
b3dacf6b 7969 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
7970 } else
ff70ca91 7971 {
b3dacf6b 7972 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7973 }
7974 } // end of if(fCalculateCumulantsVsM)
7975 // integrated flow from Q-cumulants versus multiplicity:
7976 if(fCalculateCumulantsVsM)
7977 {
7978 TString intFlowVsMName = "fIntFlowVsM";
7979 intFlowVsMName += fAnalysisLabel->Data();
b77b6434 7980 TString flowFlag[4] = {Form("v_{%d}{2,QC}",fHarmonic),Form("v_{%d}{4,QC}",fHarmonic),Form("v_{%d}{6,QC}",fHarmonic),Form("v_{%d}{8,QC}",fHarmonic)};
b3dacf6b 7981 for(Int_t co=0;co<4;co++) // cumulant order
7982 {
7983 TH1D *intFlowVsM = dynamic_cast<TH1D*>
b77b6434 7984 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
b3dacf6b 7985 if(intFlowVsM)
7986 {
7987 this->SetIntFlowVsM(intFlowVsM,co);
7988 } else
7989 {
7990 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7991 }
7992 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7993 } // end of if(fCalculateCumulantsVsM)
2001bc3a 7994 // quantifying detector effects effects to correlations:
7995 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
7996 intFlowDetectorBiasName += fAnalysisLabel->Data();
7997 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
7998 if(intFlowDetectorBias)
7999 {
8000 this->SetIntFlowDetectorBias(intFlowDetectorBias);
8001 } else
8002 {
8003 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8004 }
8005 // quantifying detector effects effects to correlations vs multiplicity:
b77b6434 8006 if(fCalculateCumulantsVsM)
2001bc3a 8007 {
3c5d5752 8008 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
8009 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
8010 for(Int_t ci=0;ci<4;ci++) // correlation index
2001bc3a 8011 {
3c5d5752 8012 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
8013 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
8014 if(intFlowDetectorBiasVsM)
8015 {
8016 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
8017 } else
8018 {
8019 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8020 }
8021 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b77b6434 8022 } // end of if(fCalculateCumulantsVsM)
489d5531 8023 } else // to if(intFlowResults)
8024 {
8025 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8026 }
ff70ca91 8027
489d5531 8028} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8029
489d5531 8030//================================================================================================================================
8031
1268c371 8032void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8033{
8034 // Get pointers for 2D differential flow histograms.
8035 // a) Check pointers used in this method;
8036 // b) Get pointers to 2D differential flow lists;
8037 // c) Get pointers to 2D differential flow profiles;
8038 // d) Get pointers to 2D differential flow histograms.
8039
8040 // a) Check pointers used in this method:
8041 if(!fDiffFlowList)
8042 {
8043 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPF2DDFH() !!!!\n");
8044 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8045 exit(0);
8046 }
8047 if(!fDiffFlowFlags)
8048 {
8049 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPF2DDFH() !!!!\n\n");
8050 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8051 exit(0);
8052 }
8053
8054 // b) Get pointers to 2D differential flow lists:
8055 this->SetCalculate2DDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(5)); // to be improved - hardwired 5
8056 if(!fCalculate2DDiffFlow){return;}
8057 TString typeFlag[2] = {"RP","POI"};
8058 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8059 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8060 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8061 // Base list:
8062 TString diffFlow2DListName = "2D";
8063 diffFlow2DListName += fAnalysisLabel->Data();
8064 fDiffFlow2D = dynamic_cast<TList*>(fDiffFlowList->FindObject(diffFlow2DListName.Data()));
8065 if(!fDiffFlow2D)
8066 {
8067 printf("\n WARNING (QC): fDiffFlow2D is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8068 exit(0);
8069 }
8070 // Lists holding profiles with 2D correlations:
8071 TString s2DDiffFlowCorrelationsProListName = "Profiles with 2D correlations";
8072 s2DDiffFlowCorrelationsProListName += fAnalysisLabel->Data(); // to be improved
8073 for(Int_t t=0;t<2;t++)
8074 {
8075 f2DDiffFlowCorrelationsProList[t] = dynamic_cast<TList*>(fDiffFlow2D->FindObject(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data())));
8076 if(!f2DDiffFlowCorrelationsProList[t])
8077 {
8078 printf("\n WARNING (QC): f2DDiffFlowCorrelationsProList[%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t);
8079 exit(0);
8080 }
8081 } // end of for(Int_t t=0;t<2;t++)
8082
8083 // c) Get pointers to 2D differential flow profiles:
8084 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8085 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8086 for(Int_t t=0;t<2;t++) // type: RP or POI
8087 {
8088 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8089 {
8090 f2DDiffFlowCorrelationsPro[t][rci] = dynamic_cast<TProfile2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data())));
8091 if(!f2DDiffFlowCorrelationsPro[t][rci])
8092 {
8093 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8094 exit(0);
8095 } else
8096 {
8097 this->Set2DDiffFlowCorrelationsPro(f2DDiffFlowCorrelationsPro[t][rci],t,rci);
8098 }
8099 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8100 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8101
8102 // d) Get pointers to 2D differential flow histograms:
8103 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8104 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8105 TString s2DDiffFlowName = "f2DDiffFlow";
8106 s2DDiffFlowName += fAnalysisLabel->Data();
8107 for(Int_t t=0;t<2;t++) // type: RP or POI
8108 {
8109 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8110 {
8111 // 2D differential cumulants:
8112 f2DDiffFlowCumulants[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data())));
8113 if(!f2DDiffFlowCumulants[t][rci])
8114 {
8115 printf("\n WARNING (QC): f2DDiffFlowCumulants[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8116 exit(0);
8117 } else
8118 {
8119 this->Set2DDiffFlowCumulants(f2DDiffFlowCumulants[t][rci],t,rci);
8120 }
8121 // 2D differential flow:
8122 f2DDiffFlow[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data())));
8123 if(!f2DDiffFlow[t][rci])
8124 {
8125 printf("\n WARNING (QC): f2DDiffFlow[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8126 exit(0);
8127 } else
8128 {
8129 this->Set2DDiffFlow(f2DDiffFlow[t][rci],t,rci);
8130 }
8131 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8132 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8133
8134} // end of void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8135
8136//================================================================================================================================
8137
489d5531 8138void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8139{
8140 // Get pointer to all objects relevant for differential flow.
1268c371 8141 // a) Get pointer to base list for differential flow fDiffFlowList;
8142 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags;
8143 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults;
8144 // d) Define flags locally (to be improved: should I promote these flags to data members?);
8145 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8146 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8147
8148 // a) Get pointer to base list for differential flow fDiffFlowList:
8149 fDiffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
8150 if(!fDiffFlowList)
489d5531 8151 {
1268c371 8152 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8153 exit(0);
8154 }
1268c371 8155
8156 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags:
8157 TString diffFlowFlagsName = "fDiffFlowFlags";
8158 diffFlowFlagsName += fAnalysisLabel->Data();
8159 fDiffFlowFlags = dynamic_cast<TProfile*>(fDiffFlowList->FindObject(diffFlowFlagsName.Data()));
8160 if(fDiffFlowFlags)
8161 {
8162 this->SetCalculateDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(1)); // to be improved - hardwired 5
8163 } else
8164 {
8165 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8166 printf("\n Flags in method Finish() are wrong.\n\n");
8167 exit(0);
8168 }
8169
8170 if(!fCalculateDiffFlow){return;} // IMPORTANT: do not move this anywhere above in this method (to be improved)
8171
8172 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults:
8173 // List holding nested lists holding profiles:
489d5531 8174 TList *diffFlowListProfiles = NULL;
1268c371 8175 diffFlowListProfiles = dynamic_cast<TList*>(fDiffFlowList->FindObject("Profiles"));
489d5531 8176 if(!diffFlowListProfiles)
8177 {
1268c371 8178 printf("\n WARNING (QC): diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8179 exit(0);
8180 }
1268c371 8181 // List holding nested lists holding histograms with final results:
489d5531 8182 TList *diffFlowListResults = NULL;
1268c371 8183 diffFlowListResults = dynamic_cast<TList*>(fDiffFlowList->FindObject("Results"));
489d5531 8184 if(!diffFlowListResults)
8185 {
1268c371 8186 printf("\n WARNING (QC): diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8187 exit(0);
8188 }
8189
1268c371 8190 // d) Define flags locally (to be improved: should I promote these flags to data members?):
8191 TString typeFlag[2] = {"RP","POI"};
8192 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8193 TString powerFlag[2] = {"linear","quadratic"};
8194 TString sinCosFlag[2] = {"sin","cos"};
8195 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8196 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8197 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8198 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
8199 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8200 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
489d5531 8201
1268c371 8202 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold:
489d5531 8203 // correlations:
8204 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
8205 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8206 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 8207 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
8208 // squared correlations:
8209 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8210 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8211 TProfile *diffFlowSquaredCorrelationsPro[2][2][4] = {{{NULL}}};
489d5531 8212 // products of correlations:
8213 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
8214 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8215 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8216 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
8217 // corrections:
8218 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
8219 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8220 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8221 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
8222 for(Int_t t=0;t<2;t++)
8223 {
8224 for(Int_t pe=0;pe<2;pe++)
8225 {
8226 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8227 if(!diffFlowCorrelationsProList[t][pe])
8228 {
8229 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8230 cout<<"t = "<<t<<endl;
8231 cout<<"pe = "<<pe<<endl;
8232 exit(0);
8233 }
8234 for(Int_t ci=0;ci<4;ci++) // correlation index
8235 {
b40a910e 8236 // reduced correlations:
489d5531 8237 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())));
8238 if(diffFlowCorrelationsPro[t][pe][ci])
8239 {
8240 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
8241 } else
8242 {
8243 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8244 cout<<"t = "<<t<<endl;
8245 cout<<"pe = "<<pe<<endl;
8246 cout<<"ci = "<<ci<<endl;
8247 }
b40a910e 8248 // reduced squared correlations:
8249 diffFlowSquaredCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[ci].Data())));
8250 if(diffFlowSquaredCorrelationsPro[t][pe][ci])
8251 {
8252 this->SetDiffFlowSquaredCorrelationsPro(diffFlowSquaredCorrelationsPro[t][pe][ci],t,pe,ci);
8253 } else
8254 {
8255 cout<<"WARNING: diffFlowSquaredCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8256 cout<<"t = "<<t<<endl;
8257 cout<<"pe = "<<pe<<endl;
8258 cout<<"ci = "<<ci<<endl;
8259 }
489d5531 8260 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8261 // products of correlations:
8262 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8263 if(!diffFlowProductOfCorrelationsProList[t][pe])
8264 {
8265 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8266 cout<<"t = "<<t<<endl;
8267 cout<<"pe = "<<pe<<endl;
8268 exit(0);
8269 }
8270 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8271 {
8272 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8273 {
8274 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())));
8275 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
8276 {
8277 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
8278 } else
8279 {
b40a910e 8280 cout<<"WARNING: diffFlowProductOfCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
489d5531 8281 cout<<"t = "<<t<<endl;
8282 cout<<"pe = "<<pe<<endl;
8283 cout<<"mci1 = "<<mci1<<endl;
8284 cout<<"mci2 = "<<mci2<<endl;
8285 }
8286 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8287 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8288 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8289 // corrections:
8290 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8291 if(!diffFlowCorrectionsProList[t][pe])
8292 {
8293 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8294 cout<<"t = "<<t<<endl;
8295 cout<<"pe = "<<pe<<endl;
8296 exit(0);
8297 }
8298 // correction terms for NUA:
8299 for(Int_t sc=0;sc<2;sc++) // sin or cos
8300 {
8301 for(Int_t cti=0;cti<9;cti++) // correction term index
8302 {
8303 diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = dynamic_cast<TProfile*>(diffFlowCorrectionsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
8304 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
8305 {
8306 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
8307 } else
8308 {
8309 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8310 cout<<"t = "<<t<<endl;
8311 cout<<"pe = "<<pe<<endl;
8312 cout<<"sc = "<<sc<<endl;
8313 cout<<"cti = "<<cti<<endl;
8314 }
8315 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8316 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8317 // ...
8318 } // end of for(Int_t pe=0;pe<2;pe++)
8319 } // end of for(Int_t t=0;t<2;t++)
8320
1268c371 8321 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold:
489d5531 8322 // reduced correlations:
8323 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
8324 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8325 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8326 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
8327 // corrections for NUA:
8328 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
8329 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8330 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8331 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
8332 // differential Q-cumulants:
8333 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
8334 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8335 diffFlowCumulantsName += fAnalysisLabel->Data();
8336 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1268c371 8337 // detector bias to differential Q-cumulants:
8338 TList *diffFlowDetectorBiasHistList[2][2] = {{NULL}};
8339 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
8340 diffFlowDetectorBiasName += fAnalysisLabel->Data();
8341 TH1D *diffFlowDetectorBias[2][2][4] = {{{NULL}}};
489d5531 8342 // differential flow estimates from Q-cumulants:
8343 TList *diffFlowHistList[2][2] = {{NULL}};
8344 TString diffFlowName = "fDiffFlow";
8345 diffFlowName += fAnalysisLabel->Data();
8346 TH1D *diffFlow[2][2][4] = {{{NULL}}};
8347 // differential covariances:
8348 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
8349 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8350 diffFlowCovariancesName += fAnalysisLabel->Data();
8351 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
8352 for(Int_t t=0;t<2;t++) // type: RP or POI
8353 {
8354 for(Int_t pe=0;pe<2;pe++) // pt or eta
8355 {
8356 // reduced correlations:
8357 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8358 if(!diffFlowCorrelationsHistList[t][pe])
8359 {
8360 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8361 cout<<"t = "<<t<<endl;
8362 cout<<"pe = "<<pe<<endl;
8363 exit(0);
8364 }
8365 for(Int_t index=0;index<4;index++)
8366 {
8367 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())));
8368 if(diffFlowCorrelationsHist[t][pe][index])
8369 {
8370 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8371 } else
8372 {
8373 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8374 cout<<"t = "<<t<<endl;
8375 cout<<"pe = "<<pe<<endl;
8376 cout<<"index = "<<index<<endl;
8377 exit(0);
8378 }
8379 } // end of for(Int_t index=0;index<4;index++)
8380 // corrections:
8381 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8382 if(!diffFlowCorrectionsHistList[t][pe])
8383 {
8384 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8385 cout<<"t = "<<t<<endl;
8386 cout<<"pe = "<<pe<<endl;
8387 exit(0);
8388 }
8389 // correction terms for NUA:
8390 for(Int_t sc=0;sc<2;sc++) // sin or cos
8391 {
8392 for(Int_t cti=0;cti<9;cti++) // correction term index
8393 {
8394 diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = dynamic_cast<TH1D*>(diffFlowCorrectionsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
8395 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8396 {
8397 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8398 } else
8399 {
8400 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8401 cout<<"t = "<<t<<endl;
8402 cout<<"pe = "<<pe<<endl;
8403 cout<<"sc = "<<sc<<endl;
8404 cout<<"cti = "<<cti<<endl;
8405 }
8406 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8407 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8408 // ...
8409 // differential Q-cumulants:
8410 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8411 if(!diffFlowCumulantsHistList[t][pe])
8412 {
8413 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8414 cout<<"t = "<<t<<endl;
8415 cout<<"pe = "<<pe<<endl;
8416 exit(0);
8417 }
8418 for(Int_t index=0;index<4;index++)
8419 {
8420 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())));
8421 if(diffFlowCumulants[t][pe][index])
8422 {
8423 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8424 } else
8425 {
8426 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8427 cout<<"t = "<<t<<endl;
8428 cout<<"pe = "<<pe<<endl;
8429 cout<<"index = "<<index<<endl;
8430 exit(0);
8431 }
8432 } // end of for(Int_t index=0;index<4;index++)
1268c371 8433 // Detector bias to differential Q-cumulants:
8434 diffFlowDetectorBiasHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8435 if(!diffFlowDetectorBiasHistList[t][pe])
8436 {
8437 cout<<"WARNING: diffFlowDetectorBiasHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8438 cout<<"t = "<<t<<endl;
8439 cout<<"pe = "<<pe<<endl;
8440 exit(0);
8441 }
8442 for(Int_t index=0;index<4;index++)
8443 {
8444 diffFlowDetectorBias[t][pe][index] = dynamic_cast<TH1D*>(diffFlowDetectorBiasHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data())));
8445 if(diffFlowDetectorBias[t][pe][index])
8446 {
8447 this->SetDiffFlowDetectorBias(diffFlowDetectorBias[t][pe][index],t,pe,index);
8448 } else
8449 {
8450 cout<<"WARNING: diffFlowDetectorBias[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8451 cout<<"t = "<<t<<endl;
8452 cout<<"pe = "<<pe<<endl;
8453 cout<<"index = "<<index<<endl;
8454 exit(0);
8455 }
8456 } // end of for(Int_t index=0;index<4;index++)
489d5531 8457 // differential flow estimates from Q-cumulants:
8458 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8459 if(!diffFlowHistList[t][pe])
8460 {
8461 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8462 cout<<"t = "<<t<<endl;
8463 cout<<"pe = "<<pe<<endl;
8464 exit(0);
8465 }
8466 for(Int_t index=0;index<4;index++)
8467 {
8468 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())));
8469 if(diffFlow[t][pe][index])
8470 {
8471 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8472 } else
8473 {
8474 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8475 cout<<"t = "<<t<<endl;
8476 cout<<"pe = "<<pe<<endl;
8477 cout<<"index = "<<index<<endl;
8478 exit(0);
8479 }
8480 } // end of for(Int_t index=0;index<4;index++)
8481 // differential covariances:
8482 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8483 if(!diffFlowCovariancesHistList[t][pe])
8484 {
8485 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8486 cout<<"t = "<<t<<endl;
8487 cout<<"pe = "<<pe<<endl;
8488 exit(0);
8489 }
8490 for(Int_t covIndex=0;covIndex<5;covIndex++)
8491 {
8492 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())));
8493 if(diffFlowCovariances[t][pe][covIndex])
8494 {
8495 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8496 } else
8497 {
8498 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8499 cout<<"t = "<<t<<endl;
8500 cout<<"pe = "<<pe<<endl;
8501 cout<<"covIndex = "<<covIndex<<endl;
8502 exit(0);
8503 }
8504 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8505 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8506 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8507 // sum of event weights for reduced correlations:
8508 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8509 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8510 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8511 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8512 for(Int_t t=0;t<2;t++) // type is RP or POI
8513 {
8514 for(Int_t pe=0;pe<2;pe++) // pt or eta
8515 {
8516 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8517 {
8518 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())));
8519 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8520 {
8521 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8522 cout<<"t = "<<t<<endl;
8523 cout<<"pe = "<<pe<<endl;
8524 cout<<"power = "<<p<<endl;
8525 exit(0);
8526 }
8527 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8528 {
8529 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())));
8530 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8531 {
8532 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8533 } else
8534 {
8535 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8536 cout<<"t = "<<t<<endl;
8537 cout<<"pe = "<<pe<<endl;
8538 cout<<"power = "<<p<<endl;
8539 cout<<"ew = "<<ew<<endl;
8540 exit(0);
8541 }
8542 }
8543 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8544 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8545 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8546 //
8547 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8548 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8549 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8550 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8551 for(Int_t t=0;t<2;t++) // type is RP or POI
8552 {
8553 for(Int_t pe=0;pe<2;pe++) // pt or eta
8554 {
8555 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8556 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8557 {
8558 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8559 cout<<"t = "<<t<<endl;
8560 cout<<"pe = "<<pe<<endl;
8561 exit(0);
8562 }
8563 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8564 {
8565 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8566 {
8567 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())));
8568 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8569 {
8570 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8571 } else
8572 {
8573 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8574 cout<<"t = "<<t<<endl;
8575 cout<<"pe = "<<pe<<endl;
8576 cout<<"mci1 = "<<mci1<<endl;
8577 cout<<"mci2 = "<<mci2<<endl;
8578 exit(0);
8579 }
8580 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8581 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8582 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8583 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8584 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8585
8586} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8587
489d5531 8588//================================================================================================================================
8589
1268c371 8590void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
8591{
8592 // Book all objects needed for 2D differential flow.
8593 // a) Define flags locally (to be improved: should I promote flags to data members?);
8594 // b) Book e-b-e quantities;
8595 // c) Book 2D profiles;
8596 // d) Book 2D histograms.
8597
8598 if(!fCalculate2DDiffFlow){return;}
8599
8600 // a) Define flags locally (to be improved: should I promote flags to data members?):
8601 TString typeFlag[2] = {"RP","POI"};
8602 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8603 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8604 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8605
8606 // b) Book e-b-e quantities:
8607 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8608 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8609 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8610 {
8611 for(Int_t m=0;m<4;m++)
8612 {
8613 for(Int_t k=0;k<9;k++)
8614 {
8615 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8616 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8617 }
8618 }
8619 }
8620 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8621 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8622 {
8623 for(Int_t k=0;k<9;k++)
8624 {
8625 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8626 }
8627 }
8628
8629 // c) Book 2D profiles:
8630 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8631 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8632 for(Int_t t=0;t<2;t++) // type: RP or POI
8633 {
8634 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8635 {
8636 f2DDiffFlowCorrelationsPro[t][rci] = new TProfile2D(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax,"");
8637 f2DDiffFlowCorrelationsPro[t][rci]->Sumw2();
8638 f2DDiffFlowCorrelationsPro[t][rci]->SetXTitle("p_{t}");
8639 f2DDiffFlowCorrelationsPro[t][rci]->SetYTitle("#eta");
8640 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCorrelationsPro[t][rci]);
8641 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8642 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
8643
8644 // d) Book 2D histograms:
8645 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8646 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8647 TString s2DDiffFlowName = "f2DDiffFlow";
8648 s2DDiffFlowName += fAnalysisLabel->Data();
8649 for(Int_t t=0;t<2;t++) // type: RP or POI
8650 {
8651 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8652 {
8653 // 2D diferential cumulants:
8654 f2DDiffFlowCumulants[t][rci] = new TH2D(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8655 f2DDiffFlowCumulants[t][rci]->SetXTitle("p_{t}");
8656 f2DDiffFlowCumulants[t][rci]->SetYTitle("#eta");
8657 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCumulants[t][rci]); // to be improved - moved to another list
8658 // 2D differential flow:
8659 f2DDiffFlow[t][rci] = new TH2D(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8660 f2DDiffFlow[t][rci]->SetXTitle("p_{t}");
8661 f2DDiffFlow[t][rci]->SetYTitle("#eta");
8662 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlow[t][rci]); // to be improved - moved to another list
8663 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8664 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
8665
8666} // void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
8667
8668//================================================================================================================================
489d5531 8669
8670void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8671{
8672 // Book all histograms and profiles needed for differential flow.
1268c371 8673 // a) Book profile to hold all flags for differential flow;
8674 // b) Define flags locally (to be improved: should I promote flags to data members?);
489d5531 8675 // c) Book e-b-e quantities;
8676 // d) Book profiles;
8677 // e) Book histograms holding final results.
8678
1268c371 8679 // a) Book profile to hold all flags for differential flow:
8680 TString diffFlowFlagsName = "fDiffFlowFlags";
8681 diffFlowFlagsName += fAnalysisLabel->Data();
8682 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for differential flow",5,0,5);
8683 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8684 fDiffFlowFlags->SetMarkerStyle(25);
8685 fDiffFlowFlags->SetLabelSize(0.04,"X");
8686 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8687 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"Calculate diff. flow");
8688 fDiffFlowFlags->GetXaxis()->SetBinLabel(2,"Particle weights");
8689 fDiffFlowFlags->GetXaxis()->SetBinLabel(3,"Event weights");
8690 fDiffFlowFlags->GetXaxis()->SetBinLabel(4,"Correct for NUA");
8691 fDiffFlowFlags->GetXaxis()->SetBinLabel(5,"Calculate 2D diff. flow");
8692 fDiffFlowList->Add(fDiffFlowFlags);
8693
8694 if(!fCalculateDiffFlow){return;}
8695
8696 // b) Define flags locally (to be improved: should I promote flags to data members?):
489d5531 8697 TString typeFlag[2] = {"RP","POI"};
8698 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8699 TString powerFlag[2] = {"linear","quadratic"};
8700 TString sinCosFlag[2] = {"sin","cos"};
8701 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8702 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8703 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
b40a910e 8704 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
489d5531 8705 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8706 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8707 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8708 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8709 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
1268c371 8710
489d5531 8711 // c) Book e-b-e quantities:
8712 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8713 // Explanantion of notation:
8714 // 1.) n is harmonic, m is multiple of harmonic;
8715 // 2.) k is power of particle weight;
8716 // 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);
8717 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8718 // (if i-th POI is also RP, than it is weighted with w_i^k);
8719 // 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
8720 // (i-th RP&&POI is weighted with w_i^k)
8721
8722 // 1D:
8723 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8724 {
8725 for(Int_t pe=0;pe<2;pe++) // pt or eta
8726 {
8727 for(Int_t m=0;m<4;m++) // multiple of harmonic
8728 {
8729 for(Int_t k=0;k<9;k++) // power of particle weight
8730 {
8731 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8732 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8733 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8734 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8735 }
8736 }
8737 }
8738 }
8739 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8740 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8741 {
8742 for(Int_t pe=0;pe<2;pe++) // pt or eta
8743 {
8744 for(Int_t k=0;k<9;k++) // power of particle weight
8745 {
8746 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8747 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8748 }
8749 }
8750 }
8751 // correction terms for nua:
8752 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8753 {
8754 for(Int_t pe=0;pe<2;pe++) // pt or eta
8755 {
8756 for(Int_t sc=0;sc<2;sc++) // sin or cos
8757 {
8758 for(Int_t cti=0;cti<9;cti++) // correction term index
8759 {
8760 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8761 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8762 }
8763 }
8764 }
8765 }
489d5531 8766 // reduced correlations e-b-e:
8767 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8768 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8769 for(Int_t t=0;t<2;t++) // type: RP or POI
8770 {
8771 for(Int_t pe=0;pe<2;pe++) // pt or eta
8772 {
8773 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8774 {
8775 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]);
8776 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8777 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8778 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8779 // event weights for reduced correlations e-b-e:
8780 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8781 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8782 for(Int_t t=0;t<2;t++) // type: RP or POI
8783 {
8784 for(Int_t pe=0;pe<2;pe++) // pt or eta
8785 {
8786 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8787 {
8788 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8789 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8790 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8791 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8792
8793 // d) Book profiles;
8794 // reduced correlations:
8795 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8796 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 8797 // reduced squared correlations:
8798 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8799 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
489d5531 8800 // corrections terms:
8801 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8802 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b40a910e 8803 // reduced correlations:
489d5531 8804 for(Int_t t=0;t<2;t++) // type: RP or POI
8805 {
8806 for(Int_t pe=0;pe<2;pe++) // pt or eta
8807 {
8808 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8809 {
489d5531 8810 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");
b40a910e 8811 fDiffFlowCorrelationsPro[t][pe][rci]->Sumw2();
489d5531 8812 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8813 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8814 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8815 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8816 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
b40a910e 8817 // reduced squared correlations:
8818 for(Int_t t=0;t<2;t++) // type: RP or POI
8819 {
8820 for(Int_t pe=0;pe<2;pe++) // pt or eta
8821 {
8822 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8823 {
8824 fDiffFlowSquaredCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
8825 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->Sumw2();
8826 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8827 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowSquaredCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8828 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8829 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8830 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
489d5531 8831 // correction terms for nua:
8832 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8833 {
8834 for(Int_t pe=0;pe<2;pe++) // pt or eta
8835 {
8836 for(Int_t sc=0;sc<2;sc++) // sin or cos
8837 {
8838 for(Int_t cti=0;cti<9;cti++) // correction term index
8839 {
8840 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8841 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8842 }
8843 }
8844 }
8845 }
8846 // e) Book histograms holding final results.
8847 // reduced correlations:
8848 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8849 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8850 // corrections terms:
8851 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8852 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8853 // differential covariances:
8854 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8855 diffFlowCovariancesName += fAnalysisLabel->Data();
8856 // differential Q-cumulants:
8857 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8858 diffFlowCumulantsName += fAnalysisLabel->Data();
1268c371 8859 // Detector bias to differential Q-cumulants:
8860 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
8861 diffFlowDetectorBiasName += fAnalysisLabel->Data();
489d5531 8862 // differential flow:
8863 TString diffFlowName = "fDiffFlow";
8864 diffFlowName += fAnalysisLabel->Data();
8865 for(Int_t t=0;t<2;t++) // type: RP or POI
8866 {
8867 for(Int_t pe=0;pe<2;pe++) // pt or eta
8868 {
8869 for(Int_t index=0;index<4;index++)
8870 {
8871 // reduced correlations:
8872 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]);
8873 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8874 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8875 // differential Q-cumulants:
8876 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]);
8877 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8878 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
1268c371 8879 // Detector bias to differential Q-cumulants:
8880 fDiffFlowDetectorBias[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8881 fDiffFlowDetectorBias[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8882 fDiffFlowDetectorBias[t][pe][index]->SetTitle(Form("#frac{corrected}{measured} %s",differentialCumulantIndex[index].Data()));
8883 fDiffFlowDetectorBiasHistList[t][pe]->Add(fDiffFlowDetectorBias[t][pe][index]);
489d5531 8884 // differential flow estimates from Q-cumulants:
8885 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]);
8886 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8887 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8888 } // end of for(Int_t index=0;index<4;index++)
8889 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8890 {
8891 // differential covariances:
8892 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]);
8893 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8894 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8895 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8896 // products of both types of correlations:
8897 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8898 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8899 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8900 {
8901 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8902 {
8903 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]);
8904 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8905 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8906 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8907 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8908 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8909 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8910 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8911 // sums of event weights for reduced correlations:
8912 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8913 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8914 for(Int_t t=0;t<2;t++) // type is RP or POI
8915 {
8916 for(Int_t pe=0;pe<2;pe++) // pt or eta
8917 {
8918 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8919 {
8920 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8921 {
8922 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]);
8923 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8924 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8925 }
8926 }
8927 }
8928 }
8929 // sum of products of event weights for both types of correlations:
8930 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8931 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8932 for(Int_t t=0;t<2;t++) // type is RP or POI
8933 {
8934 for(Int_t pe=0;pe<2;pe++) // pt or eta
8935 {
8936 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8937 {
8938 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8939 {
8940 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]);
8941 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8942 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8943 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8944 }
8945 }
8946 }
8947 }
8948 // correction terms for nua:
8949 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8950 {
8951 for(Int_t pe=0;pe<2;pe++) // pt or eta
8952 {
8953 for(Int_t sc=0;sc<2;sc++) // sin or cos
8954 {
8955 for(Int_t cti=0;cti<9;cti++) // correction term index
8956 {
8957 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = new TH1D(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8958 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8959 }
8960 }
8961 }
8962 }
8963
8964} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8965
489d5531 8966//================================================================================================================================
8967
489d5531 8968void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8969{
8970 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8971
b92ea2b9 8972 // Isotropic cumulants:
8973 Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
8974 Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
8975 Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
8976 Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
8977 //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
8978 //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
8979 //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
8980 //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
8981
8982 // Measured 2-, 4-, 6- and 8-particle correlations:
489d5531 8983 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
b92ea2b9 8984 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
489d5531 8985 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
b92ea2b9 8986 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
489d5531 8987 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
489d5531 8988 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
b92ea2b9 8989 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
489d5531 8990 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
b92ea2b9 8991
8992 // Non-isotropic terms:
8993 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
8994 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
8995 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
8996 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
8997 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
8998 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
8999 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
9000 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
9001 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
9002 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
9003 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
9004 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
9005
9006 // Shortcuts:
9007 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
9008 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
9009 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
9010 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
9011 Double_t a5 = 4.*c1*s1-s2;
9012
9013 // Covariances (including weight dependent prefactor):
8e1cefdd 9014 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
9015 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
9016 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
9017 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
9018 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9019 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9020 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9021 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9022 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
9023 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9024 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9025 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
9026 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9027 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9028 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9029 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9030 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9031 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9032 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9033 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9034 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9035 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9036 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9037 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9038 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9039 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9040 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9041 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9042 if(!fForgetAboutCovariances)
9043 {
9044 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
9045 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
9046 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
9047 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
9048 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9049 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9050 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9051 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9052 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
9053 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9054 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9055 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
9056 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9057 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9058 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9059 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9060 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9061 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9062 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9063 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9064 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9065 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9066 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9067 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9068 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9069 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9070 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9071 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9072 } // end of if(!fForgetAboutCovariances)
9073
b92ea2b9 9074 // Calculating generalized QC{2}:
9075 // Generalized QC{2}:
9076 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
9077 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
9078 // Statistical error of generalized QC{2}:
9079 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
9080 + 4.*pow(s1,2.)*pow(s1Error,2.)
9081 - 4*c1*wCov1-4*s1*wCov2
9082 + 8.*c1*s1*wCov3;
9083 // Store ratio of error squared - with/without NUA terms:
9084 Double_t ratioErrorSquaredQC2 = 0.;
9085 if(fIntFlowQcumulants->GetBinError(1)>0.)
9086 {
9087 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
9088 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
9089 }
9090 // If enabled, store error by including non-isotropic terms:
b77b6434 9091 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9092 {
9093 if(gQC2ErrorSquared>=0.)
9094 {
9095 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
9096 } else
9097 {
9098 fIntFlowQcumulants->SetBinError(1,0.);
9099 cout<<endl;
9100 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
9101 cout<<endl;
9102 }
b77b6434 9103 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9104 // Quantify detector bias to QC{2}:
9105 if(TMath::Abs(QC2)>0.)
9106 {
9107 fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2);
9108 if(QC2Error>0.)
9109 {
9110 Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
9111 if(errorSquared>0.)
9112 {
9113 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
9114 }
9115 }
9116 } // end of if(TMath::Abs(QC2)>0.)
9117
9118 // Calculating generalized QC{4}:
9119 // Generalized QC{4}:
9120 Double_t gQC4 = four-2.*pow(two,2.)
9121 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9122 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9123 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
9124 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
9125 // Statistical error of generalized QC{4}:
9126 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
9127 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
9128 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
9129 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
9130 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
9131 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
9132 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
9133 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
9134 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
9135 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
9136 // Store ratio of error squared - with/without NUA terms:
9137 Double_t ratioErrorSquaredQC4 = 0.;
9138 if(fIntFlowQcumulants->GetBinError(2)>0.)
9139 {
9140 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
9141 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
9142 }
b77b6434 9143 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9144 {
9145 if(gQC4ErrorSquared>=0.)
9146 {
9147 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
9148 } else
9149 {
9150 fIntFlowQcumulants->SetBinError(2,0.);
9151 cout<<endl;
9152 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
9153 cout<<endl;
9154 }
b77b6434 9155 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9156 // Quantify detector bias to QC{4}:
9157 if(TMath::Abs(QC4)>0.)
9158 {
9159 fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4);
9160 if(QC4Error>0.)
9161 {
9162 Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
9163 if(errorSquared>0.)
9164 {
9165 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
9166 }
9167 }
9168 } // end of if(TMath::Abs(QC4)>0.)
489d5531 9169
b92ea2b9 9170
9171 // .... to be improved (continued for 6th and 8th order) ....
9172
9173
2001bc3a 9174 // versus multiplicity:
b77b6434 9175 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
2001bc3a 9176 {
9177 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b77b6434 9178 Double_t value[4] = {0.}; // QCs vs M
9179 Double_t error[4] = {0.}; // error of QCs vs M
9180 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
9181 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
2001bc3a 9182 for(Int_t b=1;b<=nBins;b++)
9183 {
b92ea2b9 9184 // Measured correlations:
2001bc3a 9185 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
9186 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
b92ea2b9 9187 // Isotropic cumulants:
9188 QC2 = two;
9189 QC4 = four-2.*pow(two,2.);
9190 // Non-isotropic terms:
9191 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
9192 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
9193 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
9194 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
9195 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
9196 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
9197 // Generalized QC{2} vs M:
9198 gQC2 = two - pow(c1,2.) - pow(s1,2.);
b77b6434 9199 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
b92ea2b9 9200 // Generalized QC{4} vs M:
9201 gQC4 = four-2.*pow(two,2.)
9202 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9203 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9204 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
b77b6434 9205 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
b92ea2b9 9206 // Detector bias vs M:
9207 if(TMath::Abs(QC2)>0.)
9208 {
9209 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2);
9210 } // end of if(TMath::Abs(QC2)>0.)
9211 if(TMath::Abs(QC4)>0.)
9212 {
9213 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4);
b77b6434 9214 } // end of if(TMath::Abs(QC4)>0.)
9215 // Rebin in M:
9216 for(Int_t co=0;co<4;co++)
9217 {
9218 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
9219 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
9220 if(error[co]>0.)
9221 {
9222 dSum1[co]+=value[co]/(error[co]*error[co]);
9223 dSum2[co]+=1./(error[co]*error[co]);
9224 }
9225 } // end of for(Int_t co=0;co<4;co++)
9226 } // end of for(Int_t b=1;b<=nBins;b++)
9227 // Store rebinned Q-cumulants:
9228 if(fApplyCorrectionForNUAVsM)
9229 {
9230 for(Int_t co=0;co<4;co++)
9231 {
9232 if(dSum2[co]>0.)
9233 {
9234 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
9235 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
9236 }
9237 } // end of for(Int_t co=0;co<4;co++)
9238 } // end of if(fApplyCorrectionForNUAVsM)
9239 } // end of if(fCalculateCumulantsVsM)
2001bc3a 9240
489d5531 9241} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
0328db2d 9242
489d5531 9243//================================================================================================================================
9244
489d5531 9245void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9246{
0328db2d 9247 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 9248 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 9249 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 9250 //
9251 // Remark: Statistical error of correction temrs is calculated as:
9252 //
9253 // statistical error = termA * spread * termB:
9254 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
9255 // termB = 1/sqrt(1-termA^2)
9256
b92ea2b9 9257 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
9258 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
9259
489d5531 9260 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
9261 {
b92ea2b9 9262 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 9263 {
9264 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 9265 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
9266 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
9267 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
9268 Double_t termA = 0.;
9269 Double_t termB = 0.;
b92ea2b9 9270 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
0328db2d 9271 {
9272 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
9273 } else
9274 {
b92ea2b9 9275 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9276 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
0328db2d 9277 }
489d5531 9278 if(1.-pow(termA,2.) > 0.)
9279 {
9280 termB = 1./pow(1-pow(termA,2.),0.5);
9281 } else
9282 {
b92ea2b9 9283 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9284 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
489d5531 9285 }
9286 Double_t statisticalError = termA * spread * termB;
489d5531 9287 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 9288 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
b92ea2b9 9289 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
489d5531 9290 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
9291
9292} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9293
489d5531 9294//================================================================================================================================
9295
489d5531 9296void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9297{
9298 // Get pointers to all objects relevant for calculations with nested loops.
9299
9300 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
9301 if(nestedLoopsList)
9302 {
9303 this->SetNestedLoopsList(nestedLoopsList);
9304 } else
9305 {
9306 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9307 exit(0);
9308 }
9309
9310 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
9311 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
9312 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
9313 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
9314
9315 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
9316 evaluateNestedLoopsName += fAnalysisLabel->Data();
9317 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
9318 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
9319 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
9320 if(evaluateNestedLoops)
9321 {
9322 this->SetEvaluateNestedLoops(evaluateNestedLoops);
9323 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
9324 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
9325 }
9326 // nested loops relevant for integrated flow:
9327 if(bEvaluateIntFlowNestedLoops)
9328 {
9329 // correlations:
9330 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
9331 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
9332 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
9333 if(intFlowDirectCorrelations)
9334 {
9335 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
9336 } else
9337 {
9338 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9339 exit(0);
9340 }
9341 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9342 {
9343 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
9344 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
9345 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
9346 if(intFlowExtraDirectCorrelations)
9347 {
9348 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
9349 } else
9350 {
9351 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9352 exit(0);
9353 }
9354 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9355 // correction terms for non-uniform acceptance:
9356 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
9357 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9358 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
9359 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9360 {
9361 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
9362 if(intFlowDirectCorrectionTermsForNUA[sc])
9363 {
9364 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
9365 } else
9366 {
9367 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9368 cout<<"sc = "<<sc<<endl;
9369 exit(0);
9370 }
9371 } // end of for(Int_t sc=0;sc<2;sc++)
9372 } // end of if(bEvaluateIntFlowNestedLoops)
9373
9374 // nested loops relevant for differential flow:
9375 if(bEvaluateDiffFlowNestedLoops)
9376 {
9377 // correlations:
9378 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
9379 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
9380 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
9381 for(Int_t t=0;t<2;t++)
9382 {
9383 for(Int_t pe=0;pe<2;pe++)
9384 {
9385 for(Int_t ci=0;ci<4;ci++) // correlation index
9386 {
9387 diffFlowDirectCorrelations[t][pe][ci] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));
9388 if(diffFlowDirectCorrelations[t][pe][ci])
9389 {
9390 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
9391 } else
9392 {
9393 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9394 cout<<"t = "<<t<<endl;
9395 cout<<"pe = "<<pe<<endl;
9396 cout<<"ci = "<<ci<<endl;
9397 }
9398 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9399 } // end of for(Int_t pe=0;pe<2;pe++)
9400 } // end of for(Int_t t=0;t<2;t++)
9401 // correction terms for non-uniform acceptance:
9402 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
9403 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9404 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
9405 for(Int_t t=0;t<2;t++)
9406 {
9407 for(Int_t pe=0;pe<2;pe++)
9408 {
9409 // correction terms for NUA:
9410 for(Int_t sc=0;sc<2;sc++) // sin or cos
9411 {
9412 for(Int_t cti=0;cti<9;cti++) // correction term index
9413 {
9414 diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
9415 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
9416 {
9417 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
9418 } else
9419 {
9420 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9421 cout<<"t = "<<t<<endl;
9422 cout<<"pe = "<<pe<<endl;
9423 cout<<"sc = "<<sc<<endl;
9424 cout<<"cti = "<<cti<<endl;
9425 }
9426 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9427 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9428 } // end of for(Int_t pe=0;pe<2;pe++)
9429 } // end of for(Int_t t=0;t<2;t++)
9430 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
9431 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
9432 TH1D *noOfParticlesInBin = NULL;
9433 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
9434 if(noOfParticlesInBin)
9435 {
9436 this->SetNoOfParticlesInBin(noOfParticlesInBin);
9437 } else
9438 {
9439 cout<<endl;
9440 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9441 cout<<endl;
9442 }
9443 } // end of if(bEvaluateDiffFlowNestedLoops)
9444
9445} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9446
489d5531 9447//================================================================================================================================
9448
489d5531 9449void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9450{
9451 // Store flow harmonic in common control histograms.
9452
9453 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
dd442cd2 9454 if(fFillMultipleControlHistograms)
9455 {
9456 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
9457 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
9458 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
9459 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9460 }
9461
489d5531 9462} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9463
489d5531 9464//================================================================================================================================
9465
489d5531 9466void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9467{
9468 // Calculate all correlations needed for differential flow using particle weights.
9469
2a98ceb8 9470 Int_t t = 0; // type flag
9471 Int_t pe = 0; // ptEta flag
489d5531 9472
9473 if(type == "RP")
9474 {
9475 t = 0;
9476 } else if(type == "POI")
9477 {
9478 t = 1;
9479 }
9480
9481 if(ptOrEta == "Pt")
9482 {
9483 pe = 0;
9484 } else if(ptOrEta == "Eta")
9485 {
9486 pe = 1;
9487 }
9488
9489 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9490 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9491 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9492 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9493
9494 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9495 Double_t dReQ1n1k = (*fReQ)(0,1);
9496 Double_t dReQ2n2k = (*fReQ)(1,2);
9497 Double_t dReQ1n3k = (*fReQ)(0,3);
9498 //Double_t dReQ4n4k = (*fReQ)(3,4);
9499 Double_t dImQ1n1k = (*fImQ)(0,1);
9500 Double_t dImQ2n2k = (*fImQ)(1,2);
9501 Double_t dImQ1n3k = (*fImQ)(0,3);
9502 //Double_t dImQ4n4k = (*fImQ)(3,4);
9503
1268c371 9504 // S^M_{p,k} (see .h file for the definition of fSpk):
9505 Double_t dSM1p1k = (*fSpk)(0,1);
9506 Double_t dSM1p2k = (*fSpk)(0,2);
9507 Double_t dSM1p3k = (*fSpk)(0,3);
9508 Double_t dSM2p1k = (*fSpk)(1,1);
9509 Double_t dSM3p1k = (*fSpk)(2,1);
489d5531 9510
9511 // looping over all bins and calculating reduced correlations:
9512 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9513 {
9514 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9515 Double_t p1n0kRe = 0.;
9516 Double_t p1n0kIm = 0.;
9517
9518 // number of POIs in particular (pt,eta) bin):
9519 Double_t mp = 0.;
9520
9521 // real and imaginary parts of q_{m*n,k}:
9522 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9523 Double_t q1n2kRe = 0.;
9524 Double_t q1n2kIm = 0.;
9525 Double_t q2n1kRe = 0.;
9526 Double_t q2n1kIm = 0.;
9527
9528 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9529 Double_t s1p1k = 0.;
9530 Double_t s1p2k = 0.;
9531 Double_t s1p3k = 0.;
9532
9533 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9534 Double_t dM0111 = 0.;
9535
9536 if(type == "POI")
9537 {
9538 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9539 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9540 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9541 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9542
9543 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9544
9545 t = 1; // typeFlag = RP or POI
9546
9547 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9548 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9549 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9550 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9551 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9552 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9553 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9554 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9555 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9556
9557 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9558 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9559 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9560 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9561
9562 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9563 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9564 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9565 + 2.*(s1p3k-s1p2k*dSM1p1k));
9566 }
9567 else if(type == "RP")
9568 {
9569 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9570 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9571 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9572 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9573 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9574 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9575 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9576 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9577 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9578
9579 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9580 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9581 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9582 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9583
9584 // to be improved (cross-checked):
9585 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9586 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9587 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9588 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9589
9590 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9591
9592 t = 0; // typeFlag = RP or POI
9593
9594 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9595 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9596 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9597 + 2.*(s1p3k-s1p2k*dSM1p1k));
9598 //...............................................................................................
9599 }
9600
9601 // 2'-particle correlation:
9602 Double_t two1n1nW0W1 = 0.;
9603 if(mp*dSM1p1k-s1p1k)
9604 {
9605 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9606 / (mp*dSM1p1k-s1p1k);
9607
9608 // fill profile to get <<2'>>
b40a910e 9609 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9610 // fill profile to get <<2'>^2>
9611 fDiffFlowSquaredCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1*two1n1nW0W1,mp*dSM1p1k-s1p1k);
489d5531 9612 // histogram to store <2'> e-b-e (needed in some other methods):
9613 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9614 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9615 } // end of if(mp*dSM1p1k-s1p1k)
9616
9617 // 4'-particle correlation:
9618 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9619 if(dM0111)
9620 {
9621 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9622 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9623 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9624 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9625 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9626 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9627 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9628 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9629 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9630 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9631 + 2.*s1p1k*dSM1p2k
9632 - 6.*s1p3k)
9633 / dM0111; // to be improved (notation of dM0111)
9634
9635 // fill profile to get <<4'>>
b40a910e 9636 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9637 // fill profile to get <<4'>^2>
9638 fDiffFlowSquaredCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1*four1n1n1n1nW0W1W1W1,dM0111);
489d5531 9639 // histogram to store <4'> e-b-e (needed in some other methods):
9640 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9641 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9642 } // end of if(dM0111)
9643 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9644
9645} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9646
489d5531 9647//================================================================================================================================
9648
489d5531 9649void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9650{
9651 // Fill common control histograms.
9652
9653 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9654 fCommonHists->FillControlHistograms(anEvent);
dd442cd2 9655 if(fFillMultipleControlHistograms)
489d5531 9656 {
dd442cd2 9657 if(nRP>1)
489d5531 9658 {
dd442cd2 9659 fCommonHists2nd->FillControlHistograms(anEvent);
9660 if(nRP>3)
489d5531 9661 {
dd442cd2 9662 fCommonHists4th->FillControlHistograms(anEvent);
9663 if(nRP>5)
489d5531 9664 {
dd442cd2 9665 fCommonHists6th->FillControlHistograms(anEvent);
9666 if(nRP>7)
9667 {
9668 fCommonHists8th->FillControlHistograms(anEvent);
9669 } // end of if(nRP>7)
9670 } // end of if(nRP>5)
9671 } // end of if(nRP>3)
9672 } // end of if(nRP>1)
9673 } // end of if(fFillMultipleControlHistograms)
489d5531 9674
9675} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9676
489d5531 9677//================================================================================================================================
9678
489d5531 9679void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9680{
9681 // Reset all event by event quantities.
9682
1268c371 9683 // Reference flow:
489d5531 9684 fReQ->Zero();
9685 fImQ->Zero();
1268c371 9686 fSpk->Zero();
489d5531 9687 fIntFlowCorrelationsEBE->Reset();
9688 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9689 fIntFlowCorrelationsAllEBE->Reset();
9690
b92ea2b9 9691 for(Int_t sc=0;sc<2;sc++)
489d5531 9692 {
b92ea2b9 9693 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
9694 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 9695 }
9696
1268c371 9697 // Differential flow:
9698 if(fCalculateDiffFlow)
489d5531 9699 {
1268c371 9700 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
489d5531 9701 {
1268c371 9702 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 9703 {
1268c371 9704 for(Int_t m=0;m<4;m++) // multiple of harmonic
489d5531 9705 {
1268c371 9706 for(Int_t k=0;k<9;k++) // power of weight
9707 {
9708 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9709 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9710 }
9711 }
489d5531 9712 }
1268c371 9713 }
9714 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9715 {
9716 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 9717 {
1268c371 9718 for(Int_t k=0;k<9;k++)
9719 {
9720 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9721 }
489d5531 9722 }
9723 }
1268c371 9724 // e-b-e reduced correlations:
9725 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9726 {
9727 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 9728 {
1268c371 9729 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9730 {
9731 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9732 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9733 }
489d5531 9734 }
1268c371 9735 }
9736 // correction terms for NUA:
9737 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9738 {
9739 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 9740 {
1268c371 9741 for(Int_t sc=0;sc<2;sc++) // sin or cos
489d5531 9742 {
1268c371 9743 for(Int_t cti=0;cti<9;cti++) // correction term index
9744 {
489d5531 9745 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
1268c371 9746 }
489d5531 9747 }
1268c371 9748 }
9749 }
9750 } // end of if(fCalculateDiffFlow)
9751
489d5531 9752 // 2D (pt,eta)
1268c371 9753 if(fCalculate2DDiffFlow)
489d5531 9754 {
9755 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9756 {
9757 for(Int_t m=0;m<4;m++) // multiple of harmonic
9758 {
9759 for(Int_t k=0;k<9;k++) // power of weight
9760 {
b77b6434 9761 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
9762 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
489d5531 9763 }
9764 }
9765 }
9766 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9767 {
9768 for(Int_t k=0;k<9;k++)
9769 {
b77b6434 9770 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
489d5531 9771 }
9772 }
1268c371 9773 } // end of if(fCalculate2DDiffFlow)
489d5531 9774
9775} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9776
489d5531 9777//================================================================================================================================
9778
489d5531 9779void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9780{
9781 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9782
9783 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9784 // 0: <<sin n(psi1)>>
9785 // 1: <<sin n(psi1+phi2)>>
9786 // 2: <<sin n(psi1+phi2-phi3)>>
9787 // 3: <<sin n(psi1-phi2-phi3)>>:
9788 // 4:
9789 // 5:
9790 // 6:
9791
9792 // multiplicity:
1268c371 9793 Double_t dMult = (*fSpk)(0,0);
489d5531 9794
9795 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9796 Double_t dReQ1n = (*fReQ)(0,0);
9797 Double_t dReQ2n = (*fReQ)(1,0);
9798 //Double_t dReQ3n = (*fReQ)(2,0);
9799 //Double_t dReQ4n = (*fReQ)(3,0);
9800 Double_t dImQ1n = (*fImQ)(0,0);
9801 Double_t dImQ2n = (*fImQ)(1,0);
9802 //Double_t dImQ3n = (*fImQ)(2,0);
9803 //Double_t dImQ4n = (*fImQ)(3,0);
9804
2a98ceb8 9805 Int_t t = 0; // type flag
9806 Int_t pe = 0; // ptEta flag
489d5531 9807
9808 if(type == "RP")
9809 {
9810 t = 0;
9811 } else if(type == "POI")
9812 {
9813 t = 1;
9814 }
9815
9816 if(ptOrEta == "Pt")
9817 {
9818 pe = 0;
9819 } else if(ptOrEta == "Eta")
9820 {
9821 pe = 1;
9822 }
9823
9824 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9825 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9826 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9827 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9828
9829 // looping over all bins and calculating correction terms:
9830 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9831 {
9832 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9833 Double_t p1n0kRe = 0.;
9834 Double_t p1n0kIm = 0.;
9835
9836 // number of POIs in particular pt or eta bin:
9837 Double_t mp = 0.;
9838
9839 // 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):
9840 Double_t q1n0kRe = 0.;
9841 Double_t q1n0kIm = 0.;
9842 Double_t q2n0kRe = 0.;
9843 Double_t q2n0kIm = 0.;
9844
9845 // number of particles which are both RPs and POIs in particular pt or eta bin:
9846 Double_t mq = 0.;
9847
9848 if(type == "POI")
9849 {
9850 // q_{m*n,0}:
9851 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9852 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9853 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9854 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9855 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9856 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9857 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9858 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9859
9860 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9861 }
9862 else if(type == "RP")
9863 {
9864 // q_{m*n,0}:
9865 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9866 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9867 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9868 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9869 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9870 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9871 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9872 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9873
9874 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9875 }
9876 if(type == "POI")
9877 {
9878 // p_{m*n,0}:
9879 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9880 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9881 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9882 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9883
9884 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9885
9886 t = 1; // typeFlag = RP or POI
9887 }
9888 else if(type == "RP")
9889 {
9890 // p_{m*n,0} = q_{m*n,0}:
9891 p1n0kRe = q1n0kRe;
9892 p1n0kIm = q1n0kIm;
9893
9894 mp = mq;
9895
9896 t = 0; // typeFlag = RP or POI
9897 }
9898
9899 // <<sin n(psi1)>>:
9900 Double_t sinP1nPsi = 0.;
9901 if(mp)
9902 {
9903 sinP1nPsi = p1n0kIm/mp;
9904 // fill profile for <<sin n(psi1)>>:
9905 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9906 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9907 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9908 } // end of if(mp)
9909
9910 // <<sin n(psi1+phi2)>>:
9911 Double_t sinP1nPsiP1nPhi = 0.;
9912 if(mp*dMult-mq)
9913 {
9914 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9915 // fill profile for <<sin n(psi1+phi2)>>:
9916 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9917 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9918 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9919 } // end of if(mp*dMult-mq)
9920
9921 // <<sin n(psi1+phi2-phi3)>>:
9922 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9923 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9924 {
9925 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9926 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9927 - mq*dImQ1n+2.*q1n0kIm)
9928 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9929 // fill profile for <<sin n(psi1+phi2)>>:
9930 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9931 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9932 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9933 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9934
9935 // <<sin n(psi1-phi2-phi3)>>:
9936 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9937 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9938 {
9939 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9940 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9941 + 2.*mq*dImQ1n-2.*q1n0kIm)
9942 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9943 // fill profile for <<sin n(psi1+phi2)>>:
9944 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9945 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9946 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9947 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9948 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9949
9950} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9951
9952
9953//================================================================================================================================
9954
9955
9956void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9957{
9958 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9959
9960 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9961 // 0: <<cos n(psi)>>
9962 // 1: <<cos n(psi1+phi2)>>
9963 // 2: <<cos n(psi1+phi2-phi3)>>
9964 // 3: <<cos n(psi1-phi2-phi3)>>
9965 // 4:
9966 // 5:
9967 // 6:
9968
9969 // multiplicity:
1268c371 9970 Double_t dMult = (*fSpk)(0,0);
489d5531 9971
9972 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9973 Double_t dReQ1n = (*fReQ)(0,0);
9974 Double_t dReQ2n = (*fReQ)(1,0);
9975 //Double_t dReQ3n = (*fReQ)(2,0);
9976 //Double_t dReQ4n = (*fReQ)(3,0);
9977 Double_t dImQ1n = (*fImQ)(0,0);
9978 Double_t dImQ2n = (*fImQ)(1,0);
9979 //Double_t dImQ3n = (*fImQ)(2,0);
9980 //Double_t dImQ4n = (*fImQ)(3,0);
9981
2a98ceb8 9982 Int_t t = 0; // type flag
9983 Int_t pe = 0; // ptEta flag
489d5531 9984
9985 if(type == "RP")
9986 {
9987 t = 0;
9988 } else if(type == "POI")
9989 {
9990 t = 1;
9991 }
9992
9993 if(ptOrEta == "Pt")
9994 {
9995 pe = 0;
9996 } else if(ptOrEta == "Eta")
9997 {
9998 pe = 1;
9999 }
10000
10001 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10002 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10003 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10004 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10005
10006 // looping over all bins and calculating correction terms:
10007 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10008 {
10009 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10010 Double_t p1n0kRe = 0.;
10011 Double_t p1n0kIm = 0.;
10012
10013 // number of POIs in particular pt or eta bin:
10014 Double_t mp = 0.;
10015
10016 // 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):
10017 Double_t q1n0kRe = 0.;
10018 Double_t q1n0kIm = 0.;
10019 Double_t q2n0kRe = 0.;
10020 Double_t q2n0kIm = 0.;
10021
10022 // number of particles which are both RPs and POIs in particular pt or eta bin:
10023 Double_t mq = 0.;
10024
10025 if(type == "POI")
10026 {
10027 // q_{m*n,0}:
10028 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10029 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10030 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10031 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10032 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10033 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10034 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10035 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10036
10037 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10038 }
10039 else if(type == "RP")
10040 {
10041 // q_{m*n,0}:
10042 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10043 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10044 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10045 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10046 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10047 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10048 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10049 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10050
10051 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10052 }
10053 if(type == "POI")
10054 {
10055 // p_{m*n,0}:
10056 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10057 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10058 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10059 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10060
10061 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10062
10063 t = 1; // typeFlag = RP or POI
10064 }
10065 else if(type == "RP")
10066 {
10067 // p_{m*n,0} = q_{m*n,0}:
10068 p1n0kRe = q1n0kRe;
10069 p1n0kIm = q1n0kIm;
10070
10071 mp = mq;
10072
10073 t = 0; // typeFlag = RP or POI
10074 }
10075
10076 // <<cos n(psi1)>>:
10077 Double_t cosP1nPsi = 0.;
10078 if(mp)
10079 {
10080 cosP1nPsi = p1n0kRe/mp;
10081
10082 // fill profile for <<cos n(psi1)>>:
10083 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
10084 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
10085 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
10086 } // end of if(mp)
10087
10088 // <<cos n(psi1+phi2)>>:
10089 Double_t cosP1nPsiP1nPhi = 0.;
10090 if(mp*dMult-mq)
10091 {
10092 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
10093 // fill profile for <<sin n(psi1+phi2)>>:
10094 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
10095 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10096 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
10097 } // end of if(mp*dMult-mq)
10098
10099 // <<cos n(psi1+phi2-phi3)>>:
10100 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
10101 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10102 {
10103 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10104 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
10105 - mq*dReQ1n+2.*q1n0kRe)
10106 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10107 // fill profile for <<sin n(psi1+phi2)>>:
10108 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10109 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10110 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
10111 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10112
10113 // <<cos n(psi1-phi2-phi3)>>:
10114 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
10115 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10116 {
10117 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
10118 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
10119 - 2.*mq*dReQ1n+2.*q1n0kRe)
10120 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10121 // fill profile for <<sin n(psi1+phi2)>>:
10122 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10123 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10124 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
10125 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10126 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10127
10128} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
10129
489d5531 10130//==================================================================================================================================
10131
489d5531 10132void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10133{
1268c371 10134 // Transfer profiles into histogams and correctly propagate the error.
489d5531 10135
2a98ceb8 10136 Int_t t = 0; // type flag
10137 Int_t pe = 0; // ptEta flag
489d5531 10138
10139 if(type == "RP")
10140 {
10141 t = 0;
10142 } else if(type == "POI")
10143 {
10144 t = 1;
10145 }
10146
10147 if(ptOrEta == "Pt")
10148 {
10149 pe = 0;
10150 } else if(ptOrEta == "Eta")
10151 {
10152 pe = 1;
10153 }
10154
10155 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10156 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
10157 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10158 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10159
10160 for(Int_t sc=0;sc<2;sc++) // sin or cos
10161 {
10162 for(Int_t cti=0;cti<9;cti++) // correction term index
10163 {
10164 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10165 {
10166 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
10167 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
10168 // to be improved (propagate error correctly)
10169 // ...
10170 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10171 } // correction term index
10172 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10173
10174}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10175
489d5531 10176//==================================================================================================================================
10177
489d5531 10178void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10179{
1268c371 10180 // Calculate generalized differential flow cumulants (corrected for non-uniform acceptance).
10181
10182 // to be improved - propagate error also from non-isotropic terms
489d5531 10183
1268c371 10184 Int_t t = 0; // RP = 0, POI = 1
10185 Int_t pe = 0; // pt = 0, eta = 1
489d5531 10186
10187 if(type == "RP")
10188 {
1268c371 10189 t = 0;
489d5531 10190 } else if(type == "POI")
10191 {
1268c371 10192 t = 1;
489d5531 10193 }
10194
10195 if(ptOrEta == "Pt")
10196 {
1268c371 10197 pe = 0;
489d5531 10198 } else if(ptOrEta == "Eta")
10199 {
1268c371 10200 pe = 1;
489d5531 10201 }
1268c371 10202
10203 // Common:
489d5531 10204 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 10205 // 2-particle correlation:
10206 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
1268c371 10207 // sinus terms coming from reference flow:
489d5531 10208 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
10209 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
10210 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
1268c371 10211 // cosinus terms coming from reference flow:
489d5531 10212 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
10213 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
10214 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
10215
10216 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10217 {
10218 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
10219 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
10220 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
10221 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
10222 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
10223 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
10224 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
10225 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
10226 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
10227 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
1268c371 10228 // Generalized QC{2'}:
489d5531 10229 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
1268c371 10230 if(fApplyCorrectionForNUA)
10231 {
10232 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
10233 }
10234 if(TMath::Abs(twoPrime)>0.)
10235 {
10236 fDiffFlowDetectorBias[t][pe][0]->SetBinContent(b,qc2Prime/twoPrime); // detector bias = generalized/isotropic cumulant.
10237 }
10238 // Generalized QC{4'}:
489d5531 10239 Double_t qc4Prime = fourPrime-2.*twoPrime*two
10240 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
10241 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
10242 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
10243 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
10244 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
10245 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
10246 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
10247 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
10248 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10249 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
10250 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
10251 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10252 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
10253 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
10254 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10255 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10256 - 12.*cosP1nPhi*sinP1nPhi
10257 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
1268c371 10258 if(fApplyCorrectionForNUA)
10259 {
10260 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
10261 }
10262 if(TMath::Abs(fourPrime-2.*twoPrime*two)>0.)
10263 {
10264 fDiffFlowDetectorBias[t][pe][1]->SetBinContent(b,qc4Prime/(fourPrime-2.*twoPrime*two)); // detector bias = generalized/isotropic cumulant.
10265 }
489d5531 10266 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
10267
10268} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10269
1268c371 10270//==================================================================================================================================
489d5531 10271
10272void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
10273{
10274 // Calculate differential flow corrected for non-uniform acceptance.
10275
1268c371 10276 // to be improved: eventually I will have to access here masured correlations and NUA terms
10277 // instead of cumulants in order to propagate statistical error correctly also
10278 // to NUA terms (propagating errors directly from cumulants is WRONG for
10279 // differential flow becuase that doesn't account at all cross-covariance terms)
489d5531 10280
1268c371 10281 // REMARK: When NUA correction is apllied error for differential flow DOES NOT get corrected,
10282 // i.e. only value is being corrected, error is still the one relevant for isotropic
10283 // case. This eventually will be resolved.
10284
10285
10286 Int_t t = 0; // RP or POI
10287 Int_t pe = 0; // pt or eta
489d5531 10288
10289 if(type == "RP")
10290 {
1268c371 10291 t = 0;
489d5531 10292 } else if(type == "POI")
10293 {
1268c371 10294 t = 1;
10295 }
489d5531 10296 if(ptOrEta == "Pt")
10297 {
1268c371 10298 pe = 0;
489d5531 10299 } else if(ptOrEta == "Eta")
10300 {
1268c371 10301 pe = 1;
489d5531 10302 }
10303
1268c371 10304 // Common:
489d5531 10305 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
1268c371 10306 // Reference Q-cumulants
10307 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
10308 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
10309 // Loop over pt or eta bins:
489d5531 10310 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10311 {
1268c371 10312 // Differential Q-cumulants:
10313 Double_t qc2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b); // QC{2'}
10314 Double_t qc4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b); // QC{4'}
489d5531 10315 // v'{2}:
1268c371 10316 if(qc2>0.)
489d5531 10317 {
1268c371 10318 Double_t v2Prime = qc2Prime/pow(qc2,0.5);
10319 if(TMath::Abs(v2Prime)>0.){fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);}
489d5531 10320 }
489d5531 10321 // v'{4}:
1268c371 10322 if(qc4<0.)
489d5531 10323 {
1268c371 10324 Double_t v4Prime = -qc4Prime/pow(-qc4,3./4.);
10325 if(TMath::Abs(v4Prime)>0.){fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);}
489d5531 10326 }
10327 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
10328
10329} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
10330
489d5531 10331//==================================================================================================================================
10332
0328db2d 10333void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10334{
10335 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
10336
10337 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
10338 //
10339 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
10340 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
10341 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
10342 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
10343 // 5th bin: ---- EMPTY ----
10344 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
10345 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
10346 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
10347 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
10348 // 10th bin: ---- EMPTY ----
10349 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
10350 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
10351 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
10352 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
10353 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
10354 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
10355 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
10356 // 18th bin: ---- EMPTY ----
10357 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
10358 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
10359 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
10360 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
10361 // 23rd bin: ---- EMPTY ----
10362 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
10363 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
10364 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
10365 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
10366 // 28th bin: ---- EMPTY ----
10367 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
10368 // 30th bin: ---- EMPTY ----
10369 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
8ed4edc7 10370 // 32nd bin: ---- EMPTY ----
10371 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
10372 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
10373
489d5531 10374 Int_t nPrim = anEvent->NumberOfTracks();
10375 AliFlowTrackSimple *aftsTrack = NULL;
10376 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10377 Int_t n = fHarmonic;
10378 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 10379 Double_t dMult = (*fSpk)(0,0);
489d5531 10380 cout<<endl;
10381 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10382 if(dMult<2)
10383 {
10384 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10385 } else if (dMult>fMaxAllowedMultiplicity)
10386 {
10387 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10388 } else
10389 {
10390 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10391 }
10392
10393 // 2-particle correlations:
10394 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10395 {
10396 for(Int_t i1=0;i1<nPrim;i1++)
10397 {
10398 aftsTrack=anEvent->GetTrack(i1);
10399 if(!(aftsTrack->InRPSelection())) continue;
10400 phi1=aftsTrack->Phi();
10401 for(Int_t i2=0;i2<nPrim;i2++)
10402 {
10403 if(i2==i1)continue;
10404 aftsTrack=anEvent->GetTrack(i2);
10405 if(!(aftsTrack->InRPSelection())) continue;
10406 phi2=aftsTrack->Phi();
10407 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10408 // fill the profile with 2-p correlations:
10409 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
10410 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
10411 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
10412 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
10413 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10414 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10415 } // end of if(nPrim>=2)
10416
10417 // 3-particle correlations:
10418 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10419 {
10420 for(Int_t i1=0;i1<nPrim;i1++)
10421 {
10422 aftsTrack=anEvent->GetTrack(i1);
10423 if(!(aftsTrack->InRPSelection())) continue;
10424 phi1=aftsTrack->Phi();
10425 for(Int_t i2=0;i2<nPrim;i2++)
10426 {
10427 if(i2==i1)continue;
10428 aftsTrack=anEvent->GetTrack(i2);
10429 if(!(aftsTrack->InRPSelection())) continue;
10430 phi2=aftsTrack->Phi();
10431 for(Int_t i3=0;i3<nPrim;i3++)
10432 {
10433 if(i3==i1||i3==i2)continue;
10434 aftsTrack=anEvent->GetTrack(i3);
10435 if(!(aftsTrack->InRPSelection())) continue;
10436 phi3=aftsTrack->Phi();
10437 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10438 // fill the profile with 3-p correlations:
10439 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
10440 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
10441 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
10442 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
10443 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10444 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10445 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10446 } // end of if(nPrim>=3)
10447
10448 // 4-particle correlations:
10449 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10450 {
10451 for(Int_t i1=0;i1<nPrim;i1++)
10452 {
10453 aftsTrack=anEvent->GetTrack(i1);
10454 if(!(aftsTrack->InRPSelection())) continue;
10455 phi1=aftsTrack->Phi();
10456 for(Int_t i2=0;i2<nPrim;i2++)
10457 {
10458 if(i2==i1)continue;
10459 aftsTrack=anEvent->GetTrack(i2);
10460 if(!(aftsTrack->InRPSelection())) continue;
10461 phi2=aftsTrack->Phi();
10462 for(Int_t i3=0;i3<nPrim;i3++)
10463 {
10464 if(i3==i1||i3==i2)continue;
10465 aftsTrack=anEvent->GetTrack(i3);
10466 if(!(aftsTrack->InRPSelection())) continue;
10467 phi3=aftsTrack->Phi();
10468 for(Int_t i4=0;i4<nPrim;i4++)
10469 {
10470 if(i4==i1||i4==i2||i4==i3)continue;
10471 aftsTrack=anEvent->GetTrack(i4);
10472 if(!(aftsTrack->InRPSelection())) continue;
10473 phi4=aftsTrack->Phi();
10474 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10475 // fill the profile with 4-p correlations:
10476 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10477 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10478 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10479 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10480 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10481 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10482 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
8ed4edc7 10483 fIntFlowDirectCorrelations->Fill(32.,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
489d5531 10484 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10485 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10486 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10487 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10488 } // end of if(nPrim>=)
10489
10490 // 5-particle correlations:
10491 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10492 {
10493 for(Int_t i1=0;i1<nPrim;i1++)
10494 {
10495 aftsTrack=anEvent->GetTrack(i1);
10496 if(!(aftsTrack->InRPSelection())) continue;
10497 phi1=aftsTrack->Phi();
10498 for(Int_t i2=0;i2<nPrim;i2++)
10499 {
10500 if(i2==i1)continue;
10501 aftsTrack=anEvent->GetTrack(i2);
10502 if(!(aftsTrack->InRPSelection())) continue;
10503 phi2=aftsTrack->Phi();
10504 for(Int_t i3=0;i3<nPrim;i3++)
10505 {
10506 if(i3==i1||i3==i2)continue;
10507 aftsTrack=anEvent->GetTrack(i3);
10508 if(!(aftsTrack->InRPSelection())) continue;
10509 phi3=aftsTrack->Phi();
10510 for(Int_t i4=0;i4<nPrim;i4++)
10511 {
10512 if(i4==i1||i4==i2||i4==i3)continue;
10513 aftsTrack=anEvent->GetTrack(i4);
10514 if(!(aftsTrack->InRPSelection())) continue;
10515 phi4=aftsTrack->Phi();
10516 for(Int_t i5=0;i5<nPrim;i5++)
10517 {
10518 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10519 aftsTrack=anEvent->GetTrack(i5);
10520 if(!(aftsTrack->InRPSelection())) continue;
10521 phi5=aftsTrack->Phi();
10522 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10523 // fill the profile with 5-p correlations:
10524 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10525 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10526 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10527 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
8ed4edc7 10528 fIntFlowDirectCorrelations->Fill(33.,cos(2.*n*phi1+2.*n*phi2+2.*n*phi3-3.*n*phi4-3.*n*phi5),1.);
489d5531 10529 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10530 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10531 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10532 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10533 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10534 } // end of if(nPrim>=5)
10535
10536 // 6-particle correlations:
10537 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10538 {
10539 for(Int_t i1=0;i1<nPrim;i1++)
10540 {
10541 aftsTrack=anEvent->GetTrack(i1);
10542 if(!(aftsTrack->InRPSelection())) continue;
10543 phi1=aftsTrack->Phi();
10544 for(Int_t i2=0;i2<nPrim;i2++)
10545 {
10546 if(i2==i1)continue;
10547 aftsTrack=anEvent->GetTrack(i2);
10548 if(!(aftsTrack->InRPSelection())) continue;
10549 phi2=aftsTrack->Phi();
10550 for(Int_t i3=0;i3<nPrim;i3++)
10551 {
10552 if(i3==i1||i3==i2)continue;
10553 aftsTrack=anEvent->GetTrack(i3);
10554 if(!(aftsTrack->InRPSelection())) continue;
10555 phi3=aftsTrack->Phi();
10556 for(Int_t i4=0;i4<nPrim;i4++)
10557 {
10558 if(i4==i1||i4==i2||i4==i3)continue;
10559 aftsTrack=anEvent->GetTrack(i4);
10560 if(!(aftsTrack->InRPSelection())) continue;
10561 phi4=aftsTrack->Phi();
10562 for(Int_t i5=0;i5<nPrim;i5++)
10563 {
10564 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10565 aftsTrack=anEvent->GetTrack(i5);
10566 if(!(aftsTrack->InRPSelection())) continue;
10567 phi5=aftsTrack->Phi();
10568 for(Int_t i6=0;i6<nPrim;i6++)
10569 {
10570 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10571 aftsTrack=anEvent->GetTrack(i6);
10572 if(!(aftsTrack->InRPSelection())) continue;
10573 phi6=aftsTrack->Phi();
10574 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10575 // fill the profile with 6-p correlations:
10576 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10577 fIntFlowDirectCorrelations->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}
10578 fIntFlowDirectCorrelations->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}
10579 fIntFlowDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n}
10580 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10581 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10582 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10583 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10584 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10585 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10586 } // end of if(nPrim>=6)
10587
10588 // 7-particle correlations:
10589 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10590 {
10591 for(Int_t i1=0;i1<nPrim;i1++)
10592 {
10593 aftsTrack=anEvent->GetTrack(i1);
10594 if(!(aftsTrack->InRPSelection())) continue;
10595 phi1=aftsTrack->Phi();
10596 for(Int_t i2=0;i2<nPrim;i2++)
10597 {
10598 if(i2==i1)continue;
10599 aftsTrack=anEvent->GetTrack(i2);
10600 if(!(aftsTrack->InRPSelection())) continue;
10601 phi2=aftsTrack->Phi();
10602 for(Int_t i3=0;i3<nPrim;i3++)
10603 {
10604 if(i3==i1||i3==i2)continue;
10605 aftsTrack=anEvent->GetTrack(i3);
10606 if(!(aftsTrack->InRPSelection())) continue;
10607 phi3=aftsTrack->Phi();
10608 for(Int_t i4=0;i4<nPrim;i4++)
10609 {
10610 if(i4==i1||i4==i2||i4==i3)continue;
10611 aftsTrack=anEvent->GetTrack(i4);
10612 if(!(aftsTrack->InRPSelection())) continue;
10613 phi4=aftsTrack->Phi();
10614 for(Int_t i5=0;i5<nPrim;i5++)
10615 {
10616 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10617 aftsTrack=anEvent->GetTrack(i5);
10618 if(!(aftsTrack->InRPSelection())) continue;
10619 phi5=aftsTrack->Phi();
10620 for(Int_t i6=0;i6<nPrim;i6++)
10621 {
10622 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10623 aftsTrack=anEvent->GetTrack(i6);
10624 if(!(aftsTrack->InRPSelection())) continue;
10625 phi6=aftsTrack->Phi();
10626 for(Int_t i7=0;i7<nPrim;i7++)
10627 {
10628 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10629 aftsTrack=anEvent->GetTrack(i7);
10630 if(!(aftsTrack->InRPSelection())) continue;
10631 phi7=aftsTrack->Phi();
10632 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10633 // fill the profile with 7-p correlation:
10634 fIntFlowDirectCorrelations->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}
10635 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10636 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10637 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10638 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10639 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10640 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10641 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10642 } // end of if(nPrim>=7)
10643
10644 // 8-particle correlations:
10645 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10646 {
10647 for(Int_t i1=0;i1<nPrim;i1++)
10648 {
10649 aftsTrack=anEvent->GetTrack(i1);
10650 if(!(aftsTrack->InRPSelection())) continue;
10651 phi1=aftsTrack->Phi();
10652 for(Int_t i2=0;i2<nPrim;i2++)
10653 {
10654 if(i2==i1)continue;
10655 aftsTrack=anEvent->GetTrack(i2);
10656 if(!(aftsTrack->InRPSelection())) continue;
10657 phi2=aftsTrack->Phi();
10658 for(Int_t i3=0;i3<nPrim;i3++)
10659 {
10660 if(i3==i1||i3==i2)continue;
10661 aftsTrack=anEvent->GetTrack(i3);
10662 if(!(aftsTrack->InRPSelection())) continue;
10663 phi3=aftsTrack->Phi();
10664 for(Int_t i4=0;i4<nPrim;i4++)
10665 {
10666 if(i4==i1||i4==i2||i4==i3)continue;
10667 aftsTrack=anEvent->GetTrack(i4);
10668 if(!(aftsTrack->InRPSelection())) continue;
10669 phi4=aftsTrack->Phi();
10670 for(Int_t i5=0;i5<nPrim;i5++)
10671 {
10672 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10673 aftsTrack=anEvent->GetTrack(i5);
10674 if(!(aftsTrack->InRPSelection())) continue;
10675 phi5=aftsTrack->Phi();
10676 for(Int_t i6=0;i6<nPrim;i6++)
10677 {
10678 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10679 aftsTrack=anEvent->GetTrack(i6);
10680 if(!(aftsTrack->InRPSelection())) continue;
10681 phi6=aftsTrack->Phi();
10682 for(Int_t i7=0;i7<nPrim;i7++)
10683 {
10684 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10685 aftsTrack=anEvent->GetTrack(i7);
10686 if(!(aftsTrack->InRPSelection())) continue;
10687 phi7=aftsTrack->Phi();
10688 for(Int_t i8=0;i8<nPrim;i8++)
10689 {
10690 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10691 aftsTrack=anEvent->GetTrack(i8);
10692 if(!(aftsTrack->InRPSelection())) continue;
10693 phi8=aftsTrack->Phi();
10694 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10695 // fill the profile with 8-p correlation:
10696 fIntFlowDirectCorrelations->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}
10697 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10698 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10699 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10700 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10701 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10702 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10703 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10704 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10705 } // end of if(nPrim>=8)
10706
10707 cout<<endl;
10708
10709} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10710
10711
10712//==================================================================================================================================
10713
10714
10715void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10716{
10717 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10718
10719 cout<<endl;
10720 cout<<endl;
10721 cout<<" *****************************************"<<endl;
10722 cout<<" **** cross-checking the correlations ****"<<endl;
10723 cout<<" **** for integrated flow ****"<<endl;
10724 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10725 {
10726 cout<<" **** (particle weights not used) ****"<<endl;
10727 } else
10728 {
10729 cout<<" **** (particle weights used) ****"<<endl;
10730 }
10731 cout<<" *****************************************"<<endl;
10732 cout<<endl;
10733 cout<<endl;
10734
8ed4edc7 10735 Int_t ciMax = 34; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
489d5531 10736
10737 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10738 {
10739 ciMax = 11;
10740 }
10741
10742 for(Int_t ci=1;ci<=ciMax;ci++)
10743 {
10744 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10745 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10746 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10747 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10748 cout<<endl;
10749 }
10750
10751} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10752
10753
10754//================================================================================================================================
10755
10756
10757void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10758{
10759 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10760
10761 cout<<endl;
10762 cout<<endl;
10763 cout<<" *********************************************"<<endl;
10764 cout<<" **** cross-checking the correction terms ****"<<endl;
10765 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10766 cout<<" **** for integrated flow ****"<<endl;
10767 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10768 {
10769 cout<<" **** (particle weights not used) ****"<<endl;
10770 } else
10771 {
10772 cout<<" **** (particle weights used) ****"<<endl;
10773 }
10774 cout<<" *********************************************"<<endl;
10775 cout<<endl;
10776 cout<<endl;
10777
b92ea2b9 10778 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 10779 {
10780 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10781 {
10782 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10783 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10784 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10785 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10786 cout<<endl;
10787 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10788 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10789
10790} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10791
10792
10793//================================================================================================================================
10794
10795
0328db2d 10796void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 10797{
10798 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10799
10800 // Results are stored in profile fIntFlowDirectCorrelations.
10801 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10802 //
10803 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10804 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10805 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10806 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10807 // 5th bin: ---- EMPTY ----
10808 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10809 // 7th bin: <3>_{3n|2n,1n} = ...
10810 // 8th bin: <3>_{4n|2n,2n} = ...
10811 // 9th bin: <3>_{4n|3n,1n} = ...
10812 // 10th bin: ---- EMPTY ----
10813 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10814 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10815 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10816 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10817 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10818 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10819 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10820 // 18th bin: ---- EMPTY ----
10821 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10822 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10823 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10824 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10825 // 23rd bin: ---- EMPTY ----
10826 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10827 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10828 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10829 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10830 // 28th bin: ---- EMPTY ----
10831 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10832 // 30th bin: ---- EMPTY ----
10833 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 10834
489d5531 10835 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10836 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 10837
489d5531 10838 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10839 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10840 // ...
57340a27 10841
489d5531 10842 Int_t nPrim = anEvent->NumberOfTracks();
10843 AliFlowTrackSimple *aftsTrack = NULL;
10844 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10845 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10846 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10847 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10848 Int_t n = fHarmonic;
10849 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 10850 Double_t dMult = (*fSpk)(0,0);
489d5531 10851 cout<<endl;
10852 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10853 if(dMult<2)
10854 {
10855 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10856 } else if (dMult>fMaxAllowedMultiplicity)
10857 {
10858 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10859 } else
10860 {
10861 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10862 }
10863
10864 // 2-particle correlations:
10865 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10866 {
10867 // 2 nested loops multiparticle correlations using particle weights:
10868 for(Int_t i1=0;i1<nPrim;i1++)
10869 {
10870 aftsTrack=anEvent->GetTrack(i1);
10871 if(!(aftsTrack->InRPSelection())) continue;
10872 phi1=aftsTrack->Phi();
10873 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10874 for(Int_t i2=0;i2<nPrim;i2++)
10875 {
10876 if(i2==i1)continue;
10877 aftsTrack=anEvent->GetTrack(i2);
10878 if(!(aftsTrack->InRPSelection())) continue;
10879 phi2=aftsTrack->Phi();
10880 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10881 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10882 // 2-p correlations using particle weights:
10883 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10884 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>
10885 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>
10886 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))>
10887 // extra correlations:
10888 // 2-p extra correlations (do not appear if particle weights are not used):
10889 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10890 // ...
10891 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10892 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10893 } // end of if(nPrim>=2)
10894
10895 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 10896 {
489d5531 10897 // 3 nested loops multiparticle correlations using particle weights:
10898 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10899 {
489d5531 10900 aftsTrack=anEvent->GetTrack(i1);
10901 if(!(aftsTrack->InRPSelection())) continue;
10902 phi1=aftsTrack->Phi();
10903 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10904 for(Int_t i2=0;i2<nPrim;i2++)
10905 {
10906 if(i2==i1)continue;
10907 aftsTrack=anEvent->GetTrack(i2);
10908 if(!(aftsTrack->InRPSelection())) continue;
10909 phi2=aftsTrack->Phi();
10910 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10911 for(Int_t i3=0;i3<nPrim;i3++)
10912 {
10913 if(i3==i1||i3==i2)continue;
10914 aftsTrack=anEvent->GetTrack(i3);
10915 if(!(aftsTrack->InRPSelection())) continue;
10916 phi3=aftsTrack->Phi();
10917 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10918 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10919 // 3-p correlations using particle weights:
10920 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(5.5,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10921 // ...
10922 // extra correlations:
10923 // 2-p extra correlations (do not appear if particle weights are not used):
10924 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10925 // ...
10926 // 3-p extra correlations (do not appear if particle weights are not used):
10927 // ...
10928 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10929 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10930 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10931 } // end of if(nPrim>=3)
57340a27 10932
489d5531 10933 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10934 {
10935 // 4 nested loops multiparticle correlations using particle weights:
10936 for(Int_t i1=0;i1<nPrim;i1++)
10937 {
10938 aftsTrack=anEvent->GetTrack(i1);
10939 if(!(aftsTrack->InRPSelection())) continue;
10940 phi1=aftsTrack->Phi();
10941 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10942 for(Int_t i2=0;i2<nPrim;i2++)
10943 {
10944 if(i2==i1)continue;
10945 aftsTrack=anEvent->GetTrack(i2);
10946 if(!(aftsTrack->InRPSelection())) continue;
10947 phi2=aftsTrack->Phi();
10948 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10949 for(Int_t i3=0;i3<nPrim;i3++)
10950 {
10951 if(i3==i1||i3==i2)continue;
10952 aftsTrack=anEvent->GetTrack(i3);
10953 if(!(aftsTrack->InRPSelection())) continue;
10954 phi3=aftsTrack->Phi();
10955 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10956 for(Int_t i4=0;i4<nPrim;i4++)
10957 {
10958 if(i4==i1||i4==i2||i4==i3)continue;
10959 aftsTrack=anEvent->GetTrack(i4);
10960 if(!(aftsTrack->InRPSelection())) continue;
10961 phi4=aftsTrack->Phi();
10962 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10963 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10964 // 4-p correlations using particle weights:
10965 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10966 // extra correlations:
10967 // 2-p extra correlations (do not appear if particle weights are not used):
10968 // ...
10969 // 3-p extra correlations (do not appear if particle weights are not used):
10970 // ...
10971 // 4-p extra correlations (do not appear if particle weights are not used):
10972 // ...
10973 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10974 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10975 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10976 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10977 } // end of if(nPrim>=4)
57340a27 10978
489d5531 10979 cout<<endl;
57340a27 10980
489d5531 10981} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 10982
489d5531 10983
10984//================================================================================================================================
10985
10986
10987void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10988{
489d5531 10989 // Cross-check results for extra multiparticle correlations needed for int. flow
10990 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 10991
489d5531 10992 cout<<endl;
10993 cout<<endl;
10994 cout<<" ***********************************************"<<endl;
10995 cout<<" **** cross-checking the extra correlations ****"<<endl;
10996 cout<<" **** for integrated flow ****"<<endl;
10997 cout<<" ***********************************************"<<endl;
10998 cout<<endl;
10999 cout<<endl;
11000
11001 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 11002 {
489d5531 11003 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
11004 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
11005 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
11006 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
11007 cout<<endl;
11008 }
57340a27 11009
489d5531 11010} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 11011
11012
489d5531 11013//================================================================================================================================
3b552efe 11014
11015
0328db2d 11016void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 11017{
11018 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
11019 //
11020 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
11021 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
11022 // (sc stands for either sin or cos):
11023
11024 // 1st bin: <<sc(n*(phi1))>>
11025 // 2nd bin: <<sc(n*(phi1+phi2))>>
11026 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
11027 // 4th bin: <<sc(n*(2phi1-phi2))>>
11028
11029 Int_t nPrim = anEvent->NumberOfTracks();
11030 AliFlowTrackSimple *aftsTrack = NULL;
11031 Double_t phi1=0., phi2=0., phi3=0.;
11032 Int_t n = fHarmonic;
11033 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 11034 Double_t dMult = (*fSpk)(0,0);
489d5531 11035 cout<<endl;
11036 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11037 if(dMult<1)
3b552efe 11038 {
489d5531 11039 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11040 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 11041 {
489d5531 11042 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11043 } else
11044 {
11045 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
11046 }
11047
11048 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11049 {
11050 // 1-particle correction terms for non-uniform acceptance:
11051 for(Int_t i1=0;i1<nPrim;i1++)
11052 {
11053 aftsTrack=anEvent->GetTrack(i1);
11054 if(!(aftsTrack->InRPSelection())) continue;
11055 phi1=aftsTrack->Phi();
11056 if(nPrim==1) cout<<i1<<"\r"<<flush;
11057 // sin terms:
11058 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
11059 // cos terms:
11060 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
11061 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11062 } // end of if(nPrim>=1)
11063
11064 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11065 {
11066 // 2-particle correction terms for non-uniform acceptance:
11067 for(Int_t i1=0;i1<nPrim;i1++)
11068 {
11069 aftsTrack=anEvent->GetTrack(i1);
11070 if(!(aftsTrack->InRPSelection())) continue;
11071 phi1=aftsTrack->Phi();
11072 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 11073 {
489d5531 11074 if(i2==i1)continue;
11075 aftsTrack=anEvent->GetTrack(i2);
11076 if(!(aftsTrack->InRPSelection())) continue;
11077 phi2=aftsTrack->Phi();
11078 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11079 // sin terms:
3b552efe 11080 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 11081 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
11082 // cos terms:
3b552efe 11083 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 11084 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
11085 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11086 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11087 } // end of if(nPrim>=2)
11088
11089 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11090 {
11091 // 3-particle correction terms for non-uniform acceptance:
11092 for(Int_t i1=0;i1<nPrim;i1++)
11093 {
11094 aftsTrack=anEvent->GetTrack(i1);
11095 if(!(aftsTrack->InRPSelection())) continue;
11096 phi1=aftsTrack->Phi();
11097 for(Int_t i2=0;i2<nPrim;i2++)
11098 {
11099 if(i2==i1)continue;
11100 aftsTrack=anEvent->GetTrack(i2);
11101 if(!(aftsTrack->InRPSelection())) continue;
11102 phi2=aftsTrack->Phi();
11103 for(Int_t i3=0;i3<nPrim;i3++)
11104 {
11105 if(i3==i1||i3==i2)continue;
11106 aftsTrack=anEvent->GetTrack(i3);
11107 if(!(aftsTrack->InRPSelection())) continue;
11108 phi3=aftsTrack->Phi();
11109 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
11110 // sin terms:
11111 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
11112 // cos terms:
11113 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
11114 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11115 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11116 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11117 } // end of if(nPrim>=3)
11118
11119 cout<<endl;
11120}
11121//================================================================================================================================
0328db2d 11122void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11123{
11124 // Evaluate reduced correlations with nested loops without using the particle weights.
11125
11126 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11127 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11128 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11129 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
11130 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
11131 // ...
11132
2a98ceb8 11133 Int_t typeFlag = 0;
11134 Int_t ptEtaFlag = 0;
489d5531 11135 if(type == "RP")
11136 {
11137 typeFlag = 0;
11138 } else if(type == "POI")
11139 {
11140 typeFlag = 1;
11141 }
11142 if(ptOrEta == "Pt")
11143 {
11144 ptEtaFlag = 0;
11145 } else if(ptOrEta == "Eta")
11146 {
11147 ptEtaFlag = 1;
11148 }
11149 // shortcuts:
11150 Int_t t = typeFlag;
11151 Int_t pe = ptEtaFlag;
11152
11153 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11154 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11155 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11156
11157 Int_t nPrim = anEvent->NumberOfTracks();
11158 AliFlowTrackSimple *aftsTrack = NULL;
11159
11160 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11161
3b552efe 11162 Int_t n = fHarmonic;
489d5531 11163
11164 // 2'-particle correlations:
11165 for(Int_t i1=0;i1<nPrim;i1++)
11166 {
11167 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11168 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11169 if(typeFlag==1) // this is diff flow of POIs
489d5531 11170 {
11171 if(ptOrEta == "Pt")
11172 {
11173 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11174 } else if (ptOrEta == "Eta")
11175 {
11176 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11177 }
11178 } else // this is diff flow of RPs
11179 {
489d5531 11180 if(ptOrEta == "Pt")
11181 {
11182 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11183 } else if (ptOrEta == "Eta")
11184 {
11185 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11186 }
11187 }
489d5531 11188
11189 psi1=aftsTrack->Phi();
11190 for(Int_t i2=0;i2<nPrim;i2++)
11191 {
11192 if(i2==i1)continue;
11193 aftsTrack=anEvent->GetTrack(i2);
11194 // RP condition (!(first) particle in the correlator must be RP):
11195 if(!(aftsTrack->InRPSelection()))continue;
11196 phi2=aftsTrack->Phi();
11197 // 2'-particle correlations:
11198 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
11199 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11200 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11201
11202 /*
11203
11204 // 3'-particle correlations:
11205 for(Int_t i1=0;i1<nPrim;i1++)
11206 {
11207 aftsTrack=anEvent->GetTrack(i1);
11208 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11209 if(ptOrEta == "Pt")
11210 {
11211 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11212 } else if (ptOrEta == "Eta")
11213 {
11214 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11215 }
11216 psi1=aftsTrack->Phi();
11217 for(Int_t i2=0;i2<nPrim;i2++)
11218 {
11219 if(i2==i1)continue;
11220 aftsTrack=anEvent->GetTrack(i2);
11221 // RP condition (!(first) particle in the correlator must be RP):
11222 if(!(aftsTrack->InRPSelection())) continue;
11223 phi2=aftsTrack->Phi();
11224 for(Int_t i3=0;i3<nPrim;i3++)
11225 {
11226 if(i3==i1||i3==i2)continue;
11227 aftsTrack=anEvent->GetTrack(i3);
11228 // RP condition (!(first) particle in the correlator must be RP):
11229 if(!(aftsTrack->InRPSelection())) continue;
11230 phi3=aftsTrack->Phi();
11231 // to be improved : where to store it? ->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(2.*phi1-phi2-phi3)),1.); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))>
11232 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11233 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11234 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11235
11236 */
11237
11238 // 4'-particle correlations:
11239 for(Int_t i1=0;i1<nPrim;i1++)
11240 {
11241 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11242 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11243 if(typeFlag==1) // this is diff flow of POIs
489d5531 11244 {
11245 if(ptOrEta == "Pt")
11246 {
11247 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11248 } else if (ptOrEta == "Eta")
11249 {
11250 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11251 }
11252 } else // this is diff flow of RPs
11253 {
489d5531 11254 if(ptOrEta == "Pt")
11255 {
11256 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11257 } else if (ptOrEta == "Eta")
11258 {
11259 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11260 }
11261 }
489d5531 11262
11263 psi1=aftsTrack->Phi();
11264 for(Int_t i2=0;i2<nPrim;i2++)
11265 {
11266 if(i2==i1) continue;
11267 aftsTrack=anEvent->GetTrack(i2);
11268 // RP condition (!(first) particle in the correlator must be RP):
11269 if(!(aftsTrack->InRPSelection())) continue;
11270 phi2=aftsTrack->Phi();
11271 for(Int_t i3=0;i3<nPrim;i3++)
11272 {
11273 if(i3==i1||i3==i2) continue;
11274 aftsTrack=anEvent->GetTrack(i3);
11275 // RP condition (!(first) particle in the correlator must be RP):
11276 if(!(aftsTrack->InRPSelection())) continue;
11277 phi3=aftsTrack->Phi();
11278 for(Int_t i4=0;i4<nPrim;i4++)
11279 {
11280 if(i4==i1||i4==i2||i4==i3) continue;
11281 aftsTrack=anEvent->GetTrack(i4);
11282 // RP condition (!(first) particle in the correlator must be RP):
11283 if(!(aftsTrack->InRPSelection())) continue;
11284 phi4=aftsTrack->Phi();
11285 // 4'-particle correlations:
11286 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
11287 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11288 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11289 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11290 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11291
11292 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 11293 for(Int_t i=0;i<nPrim;i++)
11294 {
11295 aftsTrack=anEvent->GetTrack(i);
11296 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11297 if(typeFlag==1) // this is diff flow of POIs
489d5531 11298 {
11299 if(ptOrEta == "Pt")
11300 {
11301 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11302 } else if (ptOrEta == "Eta")
11303 {
11304 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11305 }
11306 } else // this is diff flow of RPs
11307 {
489d5531 11308 if(ptOrEta == "Pt")
11309 {
11310 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11311 } else if (ptOrEta == "Eta")
11312 {
11313 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11314 }
11315 }
11316 if(t==1)t++;
11317 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 11318 }
11319
11320} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11321
11322
11323//================================================================================================================================
11324
11325
11326void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11327{
11328 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11329
2a98ceb8 11330 Int_t typeFlag = 0;
11331 Int_t ptEtaFlag = 0;
489d5531 11332 if(type == "RP")
11333 {
11334 typeFlag = 0;
11335 } else if(type == "POI")
11336 {
11337 typeFlag = 1;
11338 }
11339 if(ptOrEta == "Pt")
11340 {
11341 ptEtaFlag = 0;
11342 } else if(ptOrEta == "Eta")
11343 {
11344 ptEtaFlag = 1;
11345 }
11346 // shortcuts:
11347 Int_t t = typeFlag;
11348 Int_t pe = ptEtaFlag;
11349
11350 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11351 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11352 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
11353 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11354 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11355
11356 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11357
11358
11359 cout<<endl;
11360 cout<<" *****************************************"<<endl;
11361 cout<<" **** cross-checking the correlations ****"<<endl;
11362 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11363 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11364 {
11365 cout<<" **** (particle weights not used) ****"<<endl;
11366 } else
11367 {
11368 cout<<" **** (particle weights used) ****"<<endl;
11369 }
11370 cout<<" *****************************************"<<endl;
11371 cout<<endl;
11372 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11373 cout<<endl;
11374
11375 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
11376 {
11377 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
11378 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11379 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
11380 cout<<endl;
11381 } // end of for(Int_t rci=0;rci<4;rci++)
11382
11383} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11384
3b552efe 11385//================================================================================================================================
11386
489d5531 11387void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 11388{
11389 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
11390
11391 cout<<endl;
11392 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
11393 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
11394 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
11395 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
11396
489d5531 11397} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11398
3b552efe 11399//================================================================================================================================
11400
0328db2d 11401void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11402{
11403 // Evaluate reduced correlations with nested loops without using the particle weights.
11404
11405 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11406 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11407 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11408 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
11409 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
11410 // ...
11411
2a98ceb8 11412 Int_t typeFlag = 0;
11413 Int_t ptEtaFlag = 0;
489d5531 11414 if(type == "RP")
11415 {
11416 typeFlag = 0;
11417 } else if(type == "POI")
11418 {
11419 typeFlag = 1;
11420 }
11421 if(ptOrEta == "Pt")
11422 {
11423 ptEtaFlag = 0;
11424 } else if(ptOrEta == "Eta")
11425 {
11426 ptEtaFlag = 1;
11427 }
11428 // shortcuts:
11429 Int_t t = typeFlag;
11430 Int_t pe = ptEtaFlag;
11431
11432 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11433 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11434 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11435
11436 Int_t nPrim = anEvent->NumberOfTracks();
11437 AliFlowTrackSimple *aftsTrack = NULL;
11438
11439 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11440 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11441
11442 Int_t n = fHarmonic;
11443
11444 // 2'-particle correlations:
11445 for(Int_t i1=0;i1<nPrim;i1++)
11446 {
11447 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11448 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11449 if(typeFlag==1) // this is diff flow of POIs
489d5531 11450 {
11451 if(ptOrEta == "Pt")
11452 {
11453 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11454 } else if (ptOrEta == "Eta")
11455 {
11456 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11457 }
11458 } else // this is diff flow of RPs
11459 {
489d5531 11460 if(ptOrEta == "Pt")
11461 {
11462 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11463 } else if (ptOrEta == "Eta")
11464 {
11465 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11466 }
489d5531 11467 }
11468 psi1=aftsTrack->Phi();
11469 for(Int_t i2=0;i2<nPrim;i2++)
11470 {
11471 if(i2==i1) continue;
11472 aftsTrack=anEvent->GetTrack(i2);
11473 // RP condition (!(first) particle in the correlator must be RP):
11474 if(!(aftsTrack->InRPSelection())) continue;
11475 phi2=aftsTrack->Phi();
11476 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11477 // 2'-particle correlations:
11478 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11479 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11480 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11481
11482 // 4'-particle correlations:
11483 for(Int_t i1=0;i1<nPrim;i1++)
11484 {
11485 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11486 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11487 if(typeFlag==1) // this is diff flow of POIs
489d5531 11488 {
11489 if(ptOrEta == "Pt")
11490 {
11491 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11492 } else if (ptOrEta == "Eta")
11493 {
11494 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11495 }
11496 } else // this is diff flow of RPs
11497 {
489d5531 11498 if(ptOrEta == "Pt")
11499 {
11500 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11501 } else if (ptOrEta == "Eta")
11502 {
11503 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11504 }
489d5531 11505 }
11506 psi1=aftsTrack->Phi();
11507 for(Int_t i2=0;i2<nPrim;i2++)
11508 {
11509 if(i2==i1) continue;
11510 aftsTrack=anEvent->GetTrack(i2);
11511 // RP condition (!(first) particle in the correlator must be RP):
11512 if(!(aftsTrack->InRPSelection())) continue;
11513 phi2=aftsTrack->Phi();
11514 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11515 for(Int_t i3=0;i3<nPrim;i3++)
11516 {
11517 if(i3==i1||i3==i2) continue;
11518 aftsTrack=anEvent->GetTrack(i3);
11519 // RP condition (!(first) particle in the correlator must be RP):
11520 if(!(aftsTrack->InRPSelection())) continue;
11521 phi3=aftsTrack->Phi();
11522 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11523 for(Int_t i4=0;i4<nPrim;i4++)
11524 {
11525 if(i4==i1||i4==i2||i4==i3) continue;
11526 aftsTrack=anEvent->GetTrack(i4);
11527 // RP condition (!(first) particle in the correlator must be RP):
11528 if(!(aftsTrack->InRPSelection())) continue;
11529 phi4=aftsTrack->Phi();
11530 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11531 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11532 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11533 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11534 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11535 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11536 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11537
11538 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 11539 for(Int_t i=0;i<nPrim;i++)
11540 {
489d5531 11541 aftsTrack=anEvent->GetTrack(i);
11542 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11543 if(typeFlag==1) // this is diff flow of POIs
11544 {
11545 if(ptOrEta == "Pt")
11546 {
11547 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11548 } else if (ptOrEta == "Eta")
11549 {
11550 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11551 }
11552 } else // this is diff flow of RPs
11553 {
11554 if(ptOrEta == "Pt")
11555 {
11556 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11557 } else if (ptOrEta == "Eta")
11558 {
11559 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11560 }
11561 }
11562 if(t==1)t++;
11563 fNoOfParticlesInBin->Fill(t+pe+0.5);
11564 }
11565
11566} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11567
11568
11569//================================================================================================================================
11570
11571
0328db2d 11572void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11573{
11574 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11575
11576 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11577 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11578 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11579 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11580 // cti:
11581 // 0: <<sc n(psi1)>>
11582 // 1: <<sc n(psi1+phi2)>>
11583 // 2: <<sc n(psi1+phi2-phi3)>>
11584 // 3: <<sc n(psi1-phi2-phi3)>>
11585 // 4:
11586 // 5:
11587 // 6:
11588
2a98ceb8 11589 Int_t typeFlag = 0;
11590 Int_t ptEtaFlag = 0;
489d5531 11591 if(type == "RP")
11592 {
11593 typeFlag = 0;
11594 } else if(type == "POI")
11595 {
11596 typeFlag = 1;
11597 }
11598 if(ptOrEta == "Pt")
11599 {
11600 ptEtaFlag = 0;
11601 } else if(ptOrEta == "Eta")
11602 {
11603 ptEtaFlag = 1;
11604 }
11605 // shortcuts:
11606 Int_t t = typeFlag;
11607 Int_t pe = ptEtaFlag;
11608
11609 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11610 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11611 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11612
11613 Int_t nPrim = anEvent->NumberOfTracks();
11614 AliFlowTrackSimple *aftsTrack = NULL;
11615
11616 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11617
11618 Int_t n = fHarmonic;
11619
11620 // 1-particle correction terms:
11621 for(Int_t i1=0;i1<nPrim;i1++)
11622 {
11623 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11624 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11625 if(typeFlag==1) // this is diff flow of POIs
489d5531 11626 {
11627 if(ptOrEta == "Pt")
11628 {
11629 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11630 } else if (ptOrEta == "Eta")
11631 {
11632 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11633 }
11634 } else // this is diff flow of RPs
11635 {
489d5531 11636 if(ptOrEta == "Pt")
11637 {
11638 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11639 } else if (ptOrEta == "Eta")
11640 {
11641 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11642 }
11643 }
489d5531 11644 psi1=aftsTrack->Phi();
11645 // sin terms:
11646 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11647 // cos terms:
11648 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11649 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11650
11651 // 2-particle correction terms:
11652 for(Int_t i1=0;i1<nPrim;i1++)
11653 {
11654 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11655 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11656 if(typeFlag==1) // this is diff flow of POIs
489d5531 11657 {
11658 if(ptOrEta == "Pt")
11659 {
11660 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11661 } else if (ptOrEta == "Eta")
11662 {
11663 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11664 }
11665 } else // this is diff flow of RPs
11666 {
489d5531 11667 if(ptOrEta == "Pt")
11668 {
11669 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11670 } else if (ptOrEta == "Eta")
11671 {
11672 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11673 }
489d5531 11674 }
11675 psi1=aftsTrack->Phi();
11676 for(Int_t i2=0;i2<nPrim;i2++)
11677 {
11678 if(i2==i1) continue;
11679 aftsTrack=anEvent->GetTrack(i2);
11680 // RP condition (!(first) particle in the correlator must be RP):
11681 if(!(aftsTrack->InRPSelection())) continue;
11682 phi2=aftsTrack->Phi();
11683 // sin terms:
11684 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11685 // cos terms:
11686 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11687 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11688 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11689
11690 // 3-particle correction terms:
11691 for(Int_t i1=0;i1<nPrim;i1++)
11692 {
11693 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11694 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11695 if(typeFlag==1) // this is diff flow of POIs
489d5531 11696 {
11697 if(ptOrEta == "Pt")
11698 {
11699 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11700 } else if (ptOrEta == "Eta")
11701 {
11702 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11703 }
11704 } else // this is diff flow of RPs
11705 {
489d5531 11706 if(ptOrEta == "Pt")
11707 {
11708 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11709 } else if (ptOrEta == "Eta")
11710 {
11711 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11712 }
489d5531 11713 }
11714 psi1=aftsTrack->Phi();
11715 for(Int_t i2=0;i2<nPrim;i2++)
11716 {
11717 if(i2==i1) continue;
11718 aftsTrack=anEvent->GetTrack(i2);
11719 // RP condition (!(first) particle in the correlator must be RP):
11720 if(!(aftsTrack->InRPSelection())) continue;
11721 phi2=aftsTrack->Phi();
11722 for(Int_t i3=0;i3<nPrim;i3++)
11723 {
11724 if(i3==i1||i3==i2) continue;
11725 aftsTrack=anEvent->GetTrack(i3);
11726 // RP condition (!(first) particle in the correlator must be RP):
11727 if(!(aftsTrack->InRPSelection())) continue;
11728 phi3=aftsTrack->Phi();
11729 // sin terms:
11730 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11731 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11732 // cos terms:
11733 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11734 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11735 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11736 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11737 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11738
11739} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11740
11741
11742//================================================================================================================================
11743
11744
11745void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11746{
11747 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11748
2a98ceb8 11749 Int_t typeFlag = 0;
11750 Int_t ptEtaFlag = 0;
489d5531 11751 if(type == "RP")
11752 {
11753 typeFlag = 0;
11754 } else if(type == "POI")
11755 {
11756 typeFlag = 1;
11757 }
11758 if(ptOrEta == "Pt")
11759 {
11760 ptEtaFlag = 0;
11761 } else if(ptOrEta == "Eta")
11762 {
11763 ptEtaFlag = 1;
11764 }
11765 // shortcuts:
11766 Int_t t = typeFlag;
11767 Int_t pe = ptEtaFlag;
11768
11769 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11770 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11771 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11772 TString reducedCorrectionSinTerms[4] = {"<<sin(n(psi1))>>","<<sin(n(psi1+phi2))>>","<<sin(n*(psi1+phi2-phi3))>>","<<sin(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)
11773 TString reducedCorrectionCosTerms[4] = {"<<cos(n(psi1))>>","<<cos(n(psi1+phi2))>>","<<cos(n*(psi1+phi2-phi3))>>","<<cos(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)
11774 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11775 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11776
11777 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11778
11779 cout<<endl;
11780 cout<<" ******************************************"<<endl;
11781 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 11782 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 11783 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11784 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11785 {
11786 cout<<" **** (particle weights not used) ****"<<endl;
11787 } else
11788 {
11789 cout<<" **** (particle weights used) ****"<<endl;
11790 }
11791 cout<<" ******************************************"<<endl;
11792 cout<<endl;
11793 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11794 cout<<endl;
11795
11796 for(Int_t cti=0;cti<4;cti++) // correction term index
11797 {
11798 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11799 {
11800 if(sc==0) // to be improved (this can be implemented better)
11801 {
11802 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11803 } else
11804 {
11805 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11806 }
11807 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11808 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11809 cout<<endl;
11810 }
11811 } // end of for(Int_t rci=0;rci<4;rci++)
11812
11813} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11814
11815
57340a27 11816//================================================================================================================================
11817
489d5531 11818
11819void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11820{
11821 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11822
11823 // **********************************************************************
11824 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11825 // **********************************************************************
57340a27 11826
489d5531 11827 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 11828 //
489d5531 11829 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11830 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11831 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11832 // ...
11833
11834 // multiplicity (number of particles used to determine the reaction plane)
1268c371 11835 Double_t dMult = (*fSpk)(0,0);
489d5531 11836
11837 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11838 Double_t dReQ1n1k = (*fReQ)(0,1);
11839 Double_t dReQ2n2k = (*fReQ)(1,2);
11840 //Double_t dReQ3n3k = (*fReQ)(2,3);
11841 //Double_t dReQ4n4k = (*fReQ)(3,4);
11842 Double_t dReQ1n3k = (*fReQ)(0,3);
11843 Double_t dImQ1n1k = (*fImQ)(0,1);
11844 Double_t dImQ2n2k = (*fImQ)(1,2);
11845 //Double_t dImQ3n3k = (*fImQ)(2,3);
11846 //Double_t dImQ4n4k = (*fImQ)(3,4);
11847 //Double_t dImQ1n3k = (*fImQ)(0,3);
11848
11849 // dMs are variables introduced in order to simplify some Eqs. bellow:
11850 //..............................................................................................
1268c371 11851 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11852 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
11853 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 11854 //..............................................................................................
ecac11c2 11855 // 1-particle:
489d5531 11856 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11857
1268c371 11858 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 11859 {
1268c371 11860 cosP1nW1 = dReQ1n1k/(*fSpk)(0,1);
489d5531 11861
11862 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11863 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11864
11865 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
1268c371 11866 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSpk)(0,1));
489d5531 11867 }
11868
11869 // 2-particle:
11870 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11871
1268c371 11872 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 11873 {
11874 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11875
11876 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11877 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11878
11879 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11880 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11881 }
11882
11883 // 3-particle:
11884 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11885
1268c371 11886 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 11887 {
57340a27 11888 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11889 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
1268c371 11890 - 2.*((*fSpk)(0,2))*dReQ1n1k
489d5531 11891 + 2.*dReQ1n3k)
11892 / dM111;
11893
11894 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11895 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11896
11897 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11898 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11899 }
11900
11901} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11902
11903
11904//================================================================================================================================
11905
11906
11907void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11908{
11909 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11910
11911 // **********************************************************************
11912 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11913 // **********************************************************************
11914
11915 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 11916 //
489d5531 11917 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11918 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11919 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11920 // ...
11921
11922 // multiplicity (number of particles used to determine the reaction plane)
1268c371 11923 Double_t dMult = (*fSpk)(0,0);
489d5531 11924
11925 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11926 Double_t dReQ1n1k = (*fReQ)(0,1);
11927 Double_t dReQ2n2k = (*fReQ)(1,2);
11928 //Double_t dReQ3n3k = (*fReQ)(2,3);
11929 //Double_t dReQ4n4k = (*fReQ)(3,4);
11930 //Double_t dReQ1n3k = (*fReQ)(0,3);
11931 Double_t dImQ1n1k = (*fImQ)(0,1);
11932 Double_t dImQ2n2k = (*fImQ)(1,2);
11933 //Double_t dImQ3n3k = (*fImQ)(2,3);
11934 //Double_t dImQ4n4k = (*fImQ)(3,4);
11935 Double_t dImQ1n3k = (*fImQ)(0,3);
11936
11937 // dMs are variables introduced in order to simplify some Eqs. bellow:
11938 //..............................................................................................
1268c371 11939 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11940 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
11941 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 11942 //..............................................................................................
11943
11944 // 1-particle:
11945 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11946
1268c371 11947 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 11948 {
1268c371 11949 sinP1nW1 = dImQ1n1k/((*fSpk)(0,1));
489d5531 11950
11951 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11952 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11953
11954 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1268c371 11955 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSpk)(0,1));
489d5531 11956 }
11957
11958 // 2-particle:
11959 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11960
1268c371 11961 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 11962 {
11963 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11964
11965 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11966 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11967
11968 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11969 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11970 }
11971
11972 // 3-particle:
11973 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11974
1268c371 11975 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 11976 {
57340a27 11977 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11978 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
1268c371 11979 + 2.*((*fSpk)(0,2))*dImQ1n1k
489d5531 11980 - 2.*dImQ1n3k)
11981 / dM111;
11982
11983 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11984 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11985
11986 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11987 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11988 }
11989
11990} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11991
57340a27 11992//================================================================================================================================
489d5531 11993
0328db2d 11994void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11995{
11996 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11997
57340a27 11998 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11999 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 12000
57340a27 12001 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 12002 // organized as follows (sc stands for either sin or cos):
12003 //
12004 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
12005 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
12006 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 12007 // ...
489d5531 12008
12009 Int_t nPrim = anEvent->NumberOfTracks();
12010 AliFlowTrackSimple *aftsTrack = NULL;
12011 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
12012 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
12013 Double_t phi1=0., phi2=0., phi3=0.;
12014 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
12015 Int_t n = fHarmonic;
12016 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 12017 Double_t dMult = (*fSpk)(0,0);
489d5531 12018 cout<<endl;
12019 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
12020 if(dMult<1)
12021 {
12022 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
12023 } else if (dMult>fMaxAllowedMultiplicity)
12024 {
12025 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
12026 } else
12027 {
12028 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
12029 }
12030
12031 // 1-particle correction terms using particle weights:
12032 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12033 {
12034 for(Int_t i1=0;i1<nPrim;i1++)
12035 {
12036 aftsTrack=anEvent->GetTrack(i1);
12037 if(!(aftsTrack->InRPSelection())) continue;
12038 phi1=aftsTrack->Phi();
12039 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 12040 // 1-particle correction terms using particle weights:
489d5531 12041 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
12042 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 12043 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12044 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12045
489d5531 12046 // 2-particle correction terms using particle weights:
12047 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
12048 {
12049 for(Int_t i1=0;i1<nPrim;i1++)
12050 {
12051 aftsTrack=anEvent->GetTrack(i1);
12052 if(!(aftsTrack->InRPSelection())) continue;
12053 phi1=aftsTrack->Phi();
12054 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12055 for(Int_t i2=0;i2<nPrim;i2++)
12056 {
12057 if(i2==i1)continue;
12058 aftsTrack=anEvent->GetTrack(i2);
12059 if(!(aftsTrack->InRPSelection())) continue;
12060 phi2=aftsTrack->Phi();
12061 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12062 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 12063 // 2-p correction terms using particle weights:
489d5531 12064 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
12065 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
12066 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12067 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12068 } // end of if(nPrim>=2)
12069
12070 // 3-particle correction terms using particle weights:
12071 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12072 {
12073 for(Int_t i1=0;i1<nPrim;i1++)
12074 {
12075 aftsTrack=anEvent->GetTrack(i1);
12076 if(!(aftsTrack->InRPSelection())) continue;
12077 phi1=aftsTrack->Phi();
12078 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12079 for(Int_t i2=0;i2<nPrim;i2++)
12080 {
12081 if(i2==i1)continue;
12082 aftsTrack=anEvent->GetTrack(i2);
12083 if(!(aftsTrack->InRPSelection())) continue;
12084 phi2=aftsTrack->Phi();
12085 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12086 for(Int_t i3=0;i3<nPrim;i3++)
12087 {
12088 if(i3==i1||i3==i2)continue;
12089 aftsTrack=anEvent->GetTrack(i3);
12090 if(!(aftsTrack->InRPSelection())) continue;
12091 phi3=aftsTrack->Phi();
12092 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12093 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 12094 // 3-p correction terms using particle weights:
489d5531 12095 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
12096 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
12097 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12098 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12099 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12100 } // end of if(nPrim>=3)
12101
57340a27 12102 /*
12103
489d5531 12104 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
12105 {
12106 // 4 nested loops multiparticle correlations using particle weights:
12107 for(Int_t i1=0;i1<nPrim;i1++)
12108 {
12109 aftsTrack=anEvent->GetTrack(i1);
12110 if(!(aftsTrack->InRPSelection())) continue;
12111 phi1=aftsTrack->Phi();
12112 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12113 for(Int_t i2=0;i2<nPrim;i2++)
12114 {
12115 if(i2==i1)continue;
12116 aftsTrack=anEvent->GetTrack(i2);
12117 if(!(aftsTrack->InRPSelection())) continue;
12118 phi2=aftsTrack->Phi();
12119 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12120 for(Int_t i3=0;i3<nPrim;i3++)
12121 {
12122 if(i3==i1||i3==i2)continue;
12123 aftsTrack=anEvent->GetTrack(i3);
12124 if(!(aftsTrack->InRPSelection())) continue;
12125 phi3=aftsTrack->Phi();
12126 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12127 for(Int_t i4=0;i4<nPrim;i4++)
12128 {
12129 if(i4==i1||i4==i2||i4==i3)continue;
12130 aftsTrack=anEvent->GetTrack(i4);
12131 if(!(aftsTrack->InRPSelection())) continue;
12132 phi4=aftsTrack->Phi();
12133 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12134 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
12135 // 4-p correlations using particle weights:
12136 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
12137 // extra correlations:
12138 // 2-p extra correlations (do not appear if particle weights are not used):
12139 // ...
12140 // 3-p extra correlations (do not appear if particle weights are not used):
12141 // ...
12142 // 4-p extra correlations (do not appear if particle weights are not used):
12143 // ...
12144 } // end of for(Int_t i4=0;i4<nPrim;i4++)
12145 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12146 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12147 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12148 } // end of if(nPrim>=4)
12149
12150 */
12151
12152 cout<<endl;
12153
12154} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
12155
57340a27 12156//================================================================================================================================
489d5531 12157
489d5531 12158void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12159{
12160 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 12161
489d5531 12162 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 12163 //
489d5531 12164 // 0: <<cos n(psi)>>
12165 // 1: <<w2 cos n(psi1+phi2)>>
12166 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
12167 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
12168 // 4:
12169 // 5:
12170 // 6:
12171
12172 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12173 Double_t dReQ1n1k = (*fReQ)(0,1);
12174 Double_t dReQ2n2k = (*fReQ)(1,2);
12175 //Double_t dReQ1n3k = (*fReQ)(0,3);
12176 //Double_t dReQ4n4k = (*fReQ)(3,4);
12177 Double_t dImQ1n1k = (*fImQ)(0,1);
12178 Double_t dImQ2n2k = (*fImQ)(1,2);
12179 //Double_t dImQ1n3k = (*fImQ)(0,3);
12180 //Double_t dImQ4n4k = (*fImQ)(3,4);
12181
1268c371 12182 // S^M_{p,k} (see .h file for the definition of fSpk):
12183 Double_t dSM1p1k = (*fSpk)(0,1);
12184 Double_t dSM1p2k = (*fSpk)(0,2);
12185 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 12186
2a98ceb8 12187 Int_t t = 0; // type flag
12188 Int_t pe = 0; // ptEta flag
489d5531 12189
12190 if(type == "RP")
12191 {
12192 t = 0;
12193 } else if(type == "POI")
12194 {
12195 t = 1;
12196 }
12197
12198 if(ptOrEta == "Pt")
12199 {
12200 pe = 0;
12201 } else if(ptOrEta == "Eta")
12202 {
12203 pe = 1;
12204 }
12205
12206 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12207 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12208 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12209 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12210
12211 // looping over all bins and calculating correction terms:
12212 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12213 {
12214 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12215 Double_t p1n0kRe = 0.;
12216 Double_t p1n0kIm = 0.;
12217
12218 // number of POIs in particular pt or eta bin:
12219 Double_t mp = 0.;
12220
12221 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
12222 Double_t q1n2kRe = 0.;
12223 Double_t q1n2kIm = 0.;
12224 Double_t q2n1kRe = 0.;
12225 Double_t q2n1kIm = 0.;
46b94261 12226
489d5531 12227 // s_{1,1}, s_{1,2} // to be improved (add explanation)
12228 Double_t s1p1k = 0.;
12229 Double_t s1p2k = 0.;
46b94261 12230
489d5531 12231 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12232 Double_t mq = 0.;
489d5531 12233
12234 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12235 Double_t dM01 = 0.;
12236 Double_t dM011 = 0.;
12237
12238 if(type == "POI")
12239 {
12240 // q_{m*n,k}:
12241 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12242 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12243 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12244 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12245 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12246 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12247 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12248 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12249 mq = fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
46b94261 12250
489d5531 12251 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12252 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12253 }else if(type == "RP")
12254 {
12255 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12256 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12257 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12258 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12259 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12260 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12261 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12262 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12263 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12264 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12265 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12266 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 12267 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12268
489d5531 12269 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12270 }
3b552efe 12271
489d5531 12272 if(type == "POI")
3b552efe 12273 {
12274 // p_{m*n,k}:
489d5531 12275 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12276 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12277 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12278 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12279 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
489d5531 12280 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12281 dM01 = mp*dSM1p1k-s1p1k;
12282 dM011 = mp*(dSM2p1k-dSM1p2k)
12283 - 2.*(s1p1k*dSM1p1k-s1p2k);
12284
12285 // typeFlag = RP (0) or POI (1):
12286 t = 1;
12287 } else if(type == "RP")
489d5531 12288 {
12289 // to be improved (cross-checked):
12290 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12291 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12292 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12293 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12294 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12295 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12296 dM01 = mp*dSM1p1k-s1p1k;
12297 dM011 = mp*(dSM2p1k-dSM1p2k)
12298 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 12299 // typeFlag = RP (0) or POI (1):
3b552efe 12300 t = 0;
12301 }
489d5531 12302
12303 // <<cos n(psi1)>>:
12304 Double_t cosP1nPsi = 0.;
12305 if(mp)
12306 {
12307 cosP1nPsi = p1n0kRe/mp;
12308
12309 // fill profile for <<cos n(psi1)>>:
12310 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
12311 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
12312 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 12313 } // end of if(mp)
57340a27 12314
489d5531 12315 // <<w2 cos n(psi1+phi2)>>:
12316 Double_t cosP1nPsiP1nPhiW2 = 0.;
12317 if(dM01)
12318 {
12319 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
12320 // fill profile for <<w2 cos n(psi1+phi2)>>:
12321 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
12322 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12323 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
12324 } // end of if(dM01)
12325
12326 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
12327 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12328 if(dM011)
12329 {
46b94261 12330 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12331 - p1n0kRe*dSM1p2k
12332 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
12333 - s1p1k*dReQ1n1k
12334 + 2.*q1n2kRe)
12335 / dM011;
489d5531 12336 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12337 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12338 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12339 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
12340 } // end of if(dM011)
12341
12342 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
12343 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12344 if(dM011)
12345 {
12346 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
12347 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 12348 - 2.*s1p1k*dReQ1n1k
489d5531 12349 + 2.*q1n2kRe)
12350 / dM011;
12351 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12352 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12353 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12354 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
12355 } // end of if(dM011)
12356
12357 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 12358
57340a27 12359} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12360
489d5531 12361
12362//================================================================================================================================
12363
12364
12365void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12366{
12367 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
12368
12369 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
12370 // 0: <<sin n(psi1)>>
12371 // 1: <<w2 sin n(psi1+phi2)>>
12372 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
12373 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
12374 // 4:
12375 // 5:
12376 // 6:
12377
12378 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12379 Double_t dReQ1n1k = (*fReQ)(0,1);
12380 Double_t dReQ2n2k = (*fReQ)(1,2);
12381 //Double_t dReQ1n3k = (*fReQ)(0,3);
12382 //Double_t dReQ4n4k = (*fReQ)(3,4);
12383 Double_t dImQ1n1k = (*fImQ)(0,1);
12384 Double_t dImQ2n2k = (*fImQ)(1,2);
12385 //Double_t dImQ1n3k = (*fImQ)(0,3);
12386 //Double_t dImQ4n4k = (*fImQ)(3,4);
12387
1268c371 12388 // S^M_{p,k} (see .h file for the definition of fSpk):
12389 Double_t dSM1p1k = (*fSpk)(0,1);
12390 Double_t dSM1p2k = (*fSpk)(0,2);
12391 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 12392
2a98ceb8 12393 Int_t t = 0; // type flag
12394 Int_t pe = 0; // ptEta flag
489d5531 12395
12396 if(type == "RP")
12397 {
12398 t = 0;
12399 } else if(type == "POI")
12400 {
12401 t = 1;
12402 }
12403
12404 if(ptOrEta == "Pt")
12405 {
12406 pe = 0;
12407 } else if(ptOrEta == "Eta")
12408 {
12409 pe = 1;
12410 }
12411
12412 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12413 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12414 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12415 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12416
12417 // looping over all bins and calculating correction terms:
12418 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12419 {
12420 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12421 Double_t p1n0kRe = 0.;
12422 Double_t p1n0kIm = 0.;
12423
12424 // number of POIs in particular pt or eta bin:
12425 Double_t mp = 0.;
12426
12427 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
12428 Double_t q1n2kRe = 0.;
12429 Double_t q1n2kIm = 0.;
12430 Double_t q2n1kRe = 0.;
12431 Double_t q2n1kIm = 0.;
46b94261 12432
489d5531 12433 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12434 Double_t s1p1k = 0.;
12435 Double_t s1p2k = 0.;
46b94261 12436
489d5531 12437 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12438 Double_t mq = 0.;
489d5531 12439
12440 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12441 Double_t dM01 = 0.;
12442 Double_t dM011 = 0.;
12443
12444 if(type == "POI")
12445 {
12446 // q_{m*n,k}:
12447 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12448 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12449 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12450 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12451 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12452 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12453 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12454 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12455 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
46b94261 12456
489d5531 12457 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12458 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12459 }else if(type == "RP")
12460 {
12461 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12462 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12463 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12464 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12465 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12466 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12467 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12468 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12469 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12470 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12471 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12472 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12473 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 12474 }
12475
12476 if(type == "POI")
12477 {
12478 // p_{m*n,k}:
489d5531 12479 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12480 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12481 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12482 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12483 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
489d5531 12484 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12485 dM01 = mp*dSM1p1k-s1p1k;
12486 dM011 = mp*(dSM2p1k-dSM1p2k)
12487 - 2.*(s1p1k*dSM1p1k-s1p2k);
12488 // typeFlag = RP (0) or POI (1):
12489 t = 1;
489d5531 12490 } else if(type == "RP")
3b552efe 12491 {
489d5531 12492 // to be improved (cross-checked):
12493 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12494 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12495 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12496 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12497 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12498 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12499 dM01 = mp*dSM1p1k-s1p1k;
12500 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 12501 - 2.*(s1p1k*dSM1p1k-s1p2k);
12502 // typeFlag = RP (0) or POI (1):
3b552efe 12503 t = 0;
12504 }
12505
489d5531 12506 // <<sin n(psi1)>>:
12507 Double_t sinP1nPsi = 0.;
12508 if(mp)
12509 {
12510 sinP1nPsi = p1n0kIm/mp;
12511
12512 // fill profile for <<sin n(psi1)>>:
12513 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12514 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12515 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 12516 } // end of if(mp)
12517
489d5531 12518 // <<w2 sin n(psi1+phi2)>>:
12519 Double_t sinP1nPsiP1nPhiW2 = 0.;
12520 if(dM01)
12521 {
12522 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12523 // fill profile for <<w2 sin n(psi1+phi2)>>:
12524 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12525 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12526 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12527 } // end of if(mp*dMult-mq)
12528
12529 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12530 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12531 if(dM011)
12532 {
46b94261 12533 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12534 - p1n0kIm*dSM1p2k
12535 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12536 - s1p1k*dImQ1n1k
12537 + 2.*q1n2kIm)
12538 / dM011;
489d5531 12539 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12540 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12541 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12542 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12543 } // end of if(dM011)
12544
12545 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12546 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12547 if(dM011)
12548 {
12549 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12550 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 12551 + 2.*s1p1k*dImQ1n1k
489d5531 12552 - 2.*q1n2kIm)
12553 / dM011;
12554 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12555 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12556 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12557 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12558 } // end of if(dM011)
12559
12560 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12561
12562} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12563
12564
12565//================================================================================================================================
12566
12567
0328db2d 12568void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12569{
57340a27 12570 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 12571 // with using particle weights (both sin and cos terms) relevant for differential flow.
12572
57340a27 12573 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12574 // flagged both as POI and RP.
489d5531 12575 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12576 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12577 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12578 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12579 // cti:
12580 // 0: <<sc n(psi1)>>
12581 // 1: <<w2 sc n(psi1+phi2)>>
12582 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12583 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12584 // 4:
12585 // 5:
12586 // 6:
46b94261 12587
2a98ceb8 12588 Int_t typeFlag = 0;
12589 Int_t ptEtaFlag = 0;
489d5531 12590 if(type == "RP")
12591 {
12592 typeFlag = 0;
12593 } else if(type == "POI")
12594 {
12595 typeFlag = 1;
12596 }
12597 if(ptOrEta == "Pt")
12598 {
12599 ptEtaFlag = 0;
12600 } else if(ptOrEta == "Eta")
12601 {
12602 ptEtaFlag = 1;
12603 }
12604 // shortcuts:
12605 Int_t t = typeFlag;
12606 Int_t pe = ptEtaFlag;
12607
12608 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12609 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12610 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12611
12612 Int_t nPrim = anEvent->NumberOfTracks();
12613 AliFlowTrackSimple *aftsTrack = NULL;
12614
12615 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12616 Double_t wPhi2=1., wPhi3=1.;
12617
12618 Int_t n = fHarmonic;
12619
12620 // 1'-particle correction terms:
12621 for(Int_t i1=0;i1<nPrim;i1++)
12622 {
12623 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12624 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12625 if(typeFlag==1) // this is diff flow of POIs
489d5531 12626 {
12627 if(ptOrEta == "Pt")
12628 {
12629 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12630 } else if (ptOrEta == "Eta")
12631 {
12632 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12633 }
12634 } else // this is diff flow of RPs
12635 {
489d5531 12636 if(ptOrEta == "Pt")
12637 {
12638 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12639 } else if (ptOrEta == "Eta")
12640 {
12641 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12642 }
489d5531 12643 }
12644 psi1=aftsTrack->Phi();
12645 // sin terms:
12646 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12647 // cos terms:
12648 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12649 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12650
12651 // 2'-particle correction terms:
12652 for(Int_t i1=0;i1<nPrim;i1++)
12653 {
12654 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12655 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12656 if(typeFlag==1) // this is diff flow of POIs
489d5531 12657 {
12658 if(ptOrEta == "Pt")
12659 {
12660 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12661 } else if (ptOrEta == "Eta")
12662 {
12663 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12664 }
12665 } else // this is diff flow of RPs
12666 {
489d5531 12667 if(ptOrEta == "Pt")
12668 {
12669 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12670 } else if (ptOrEta == "Eta")
12671 {
12672 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12673 }
489d5531 12674 }
12675 psi1=aftsTrack->Phi();
12676 for(Int_t i2=0;i2<nPrim;i2++)
12677 {
12678 if(i2==i1) continue;
12679 aftsTrack=anEvent->GetTrack(i2);
12680 // RP condition (!(first) particle in the correlator must be RP):
12681 if(!(aftsTrack->InRPSelection())) continue;
46b94261 12682 phi2=aftsTrack->Phi();
489d5531 12683 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12684 // sin terms:
12685 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12686 // cos terms:
12687 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12688 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12689 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12690
12691 // 3'-particle correction terms:
12692 for(Int_t i1=0;i1<nPrim;i1++)
12693 {
12694 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12695 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12696 if(typeFlag==1) // this is diff flow of POIs
489d5531 12697 {
12698 if(ptOrEta == "Pt")
12699 {
12700 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12701 } else if (ptOrEta == "Eta")
12702 {
12703 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12704 }
12705 } else // this is diff flow of RPs
12706 {
489d5531 12707 if(ptOrEta == "Pt")
12708 {
12709 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12710 } else if (ptOrEta == "Eta")
12711 {
12712 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12713 }
489d5531 12714 }
12715 psi1=aftsTrack->Phi();
12716 for(Int_t i2=0;i2<nPrim;i2++)
12717 {
12718 if(i2==i1) continue;
12719 aftsTrack=anEvent->GetTrack(i2);
12720 // RP condition (!(first) particle in the correlator must be RP):
12721 if(!(aftsTrack->InRPSelection())) continue;
12722 phi2=aftsTrack->Phi();
12723 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12724 for(Int_t i3=0;i3<nPrim;i3++)
12725 {
12726 if(i3==i1||i3==i2) continue;
12727 aftsTrack=anEvent->GetTrack(i3);
12728 // RP condition (!(first) particle in the correlator must be RP):
12729 if(!(aftsTrack->InRPSelection())) continue;
12730 phi3=aftsTrack->Phi();
12731 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12732 // sin terms:
12733 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1+phi2-phi3))>>
12734 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1-phi2-phi3))>>
12735 // cos terms:
12736 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1+phi2-phi3))>>
12737 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1-phi2-phi3))>>
12738 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12739 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 12740 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 12741
12742} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12743
2001bc3a 12744//================================================================================================================================
12745
b3dacf6b 12746void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12747{
12748 // Check all pointers used in method Finish().
12749
b77b6434 12750 if(!fAvMultiplicity)
12751 {
12752 cout<<endl;
12753 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12754 cout<<endl;
12755 exit(0);
12756 }
b3dacf6b 12757 if(!fIntFlowCorrelationsPro)
12758 {
12759 cout<<endl;
12760 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12761 cout<<endl;
12762 exit(0);
12763 }
b40a910e 12764 if(!fIntFlowSquaredCorrelationsPro)
12765 {
12766 cout<<endl;
12767 cout<<" WARNING (QC): fIntFlowSquaredCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12768 cout<<endl;
12769 exit(0);
12770 }
b3dacf6b 12771 if(!fIntFlowCorrelationsHist)
12772 {
12773 cout<<endl;
12774 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12775 cout<<endl;
12776 exit(0);
12777 }
b77b6434 12778 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12779 {
12780 cout<<endl;
12781 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12782 cout<<endl;
12783 exit(0);
12784 }
b3dacf6b 12785 for(Int_t power=0;power<2;power++)
12786 {
12787 if(!fIntFlowSumOfEventWeights[power])
12788 {
12789 cout<<endl;
12790 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
12791 cout<<endl;
12792 exit(0);
12793 }
12794 } // end of for(Int_t power=0;power<2;power++)
12795 if(!fIntFlowProductOfCorrelationsPro)
12796 {
12797 cout<<endl;
12798 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12799 cout<<endl;
12800 exit(0);
12801 }
12802 if(!fIntFlowSumOfProductOfEventWeights)
12803 {
12804 cout<<endl;
12805 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12806 cout<<endl;
12807 exit(0);
12808 }
12809 if(!fIntFlowCovariances)
12810 {
12811 cout<<endl;
12812 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12813 cout<<endl;
12814 exit(0);
12815 }
12816 if(!fIntFlowQcumulants)
12817 {
12818 cout<<endl;
12819 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12820 cout<<endl;
12821 exit(0);
12822 }
0dd3b008 12823 if(!fIntFlow)
12824 {
12825 cout<<endl;
12826 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12827 cout<<endl;
12828 exit(0);
12829 }
12830 if(!fCommonHists)
12831 {
12832 cout<<endl;
12833 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12834 cout<<endl;
12835 exit(0);
12836 }
12837 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
12838 {
12839 cout<<endl;
12840 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
12841 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12842 cout<<endl;
12843 exit(0);
12844 }
b3dacf6b 12845
b92ea2b9 12846 // NUA stuff:
12847 for(Int_t sc=0;sc<2;sc++) // sin/cos
12848 {
12849 if(!fIntFlowCorrectionTermsForNUAPro[sc])
12850 {
12851 cout<<endl;
12852 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12853 cout<<endl;
12854 exit(0);
12855 }
12856 if(!fIntFlowCorrectionTermsForNUAHist[sc])
12857 {
12858 cout<<endl;
12859 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12860 cout<<endl;
12861 exit(0);
12862 }
12863 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12864 {
12865 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
12866 {
12867 cout<<endl;
12868 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
12869 cout<<endl;
12870 exit(0);
12871 }
12872 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12873 } // end of for(Int_t power=0;power<2;power++)
12874 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
12875 {
12876 cout<<endl;
12877 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12878 cout<<endl;
12879 exit(0);
12880 }
12881 if(!fIntFlowSumOfProductOfEventWeightsNUA)
12882 {
12883 cout<<endl;
12884 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12885 cout<<endl;
12886 exit(0);
12887 }
12888 if(!fIntFlowCovariancesNUA)
12889 {
12890 cout<<endl;
12891 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12892 cout<<endl;
12893 exit(0);
12894 }
12895 if(!fIntFlowQcumulantsErrorSquaredRatio)
12896 {
12897 cout<<endl;
12898 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12899 cout<<endl;
12900 exit(0);
12901 }
12902 if(!fIntFlowDetectorBias)
12903 {
12904 cout<<endl;
12905 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12906 cout<<endl;
12907 exit(0);
12908 }
12909
b3dacf6b 12910 // Versus multiplicity:
12911 if(!fCalculateCumulantsVsM){return;}
b77b6434 12912 for(Int_t co=0;co<=3;co++) // cumulant order
b3dacf6b 12913 {
b77b6434 12914 if(!fIntFlowQcumulantsVsM[co])
b3dacf6b 12915 {
12916 cout<<endl;
b77b6434 12917 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
b3dacf6b 12918 cout<<endl;
12919 exit(0);
12920 }
b77b6434 12921 if(!fIntFlowVsM[co])
b3dacf6b 12922 {
12923 cout<<endl;
b77b6434 12924 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12925 cout<<endl;
12926 exit(0);
12927 }
12928 if(!fIntFlowDetectorBiasVsM[co])
12929 {
12930 cout<<endl;
12931 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12932 cout<<endl;
12933 exit(0);
12934 }
12935 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
12936 for(Int_t ci=0;ci<=3;ci++) // correlation index
12937 {
12938 if(!fIntFlowCorrelationsVsMPro[ci])
12939 {
12940 cout<<endl;
12941 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b3dacf6b 12942 cout<<endl;
12943 exit(0);
12944 }
b40a910e 12945 if(!fIntFlowSquaredCorrelationsVsMPro[ci])
12946 {
12947 cout<<endl;
12948 cout<<Form(" WARNING (QC): fIntFlowSquaredCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
12949 cout<<endl;
12950 exit(0);
12951 }
b77b6434 12952 if(!fIntFlowCorrelationsVsMHist[ci])
b92ea2b9 12953 {
12954 cout<<endl;
b77b6434 12955 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b92ea2b9 12956 cout<<endl;
12957 exit(0);
12958 }
b3dacf6b 12959 for(Int_t power=0;power<2;power++)
12960 {
12961 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
12962 {
12963 cout<<endl;
12964 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
12965 cout<<endl;
12966 exit(0);
12967 }
12968 } // end of for(Int_t power=0;power<2;power++)
12969 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
12970 for(Int_t i=0;i<6;i++)
12971 {
12972 if(!fIntFlowProductOfCorrelationsVsMPro[i])
12973 {
12974 cout<<endl;
12975 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12976 cout<<endl;
12977 exit(0);
12978 }
12979 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
12980 {
12981 cout<<endl;
12982 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12983 cout<<endl;
12984 exit(0);
12985 }
12986 if(!fIntFlowCovariancesVsM[i])
12987 {
12988 cout<<endl;
12989 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12990 cout<<endl;
12991 exit(0);
12992 }
12993 } // end of for(Int_t i=0;i<6;i++)
12994 if(!fIntFlowRebinnedInM)
12995 {
12996 cout<<endl;
12997 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12998 cout<<endl;
12999 exit(0);
13000 }
13001 if(!fIntFlowQcumulantsRebinnedInM)
13002 {
13003 cout<<endl;
13004 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13005 cout<<endl;
13006 exit(0);
13007 }
13008
13009} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
13010
13011//================================================================================================================================
13012
13013void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
13014{
1268c371 13015 // Check all pointers used in method Make(). // to be improved - check other pointers as well
b3dacf6b 13016
b77b6434 13017 if(!fAvMultiplicity)
13018 {
1268c371 13019 printf("\n WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 13020 exit(0);
13021 }
13022 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
13023 {
1268c371 13024 printf("\n WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 13025 exit(0);
13026 }
1268c371 13027 // 2D:
13028 if(fCalculate2DDiffFlow)
13029 {
13030 for(Int_t t=0;t<2;t++) // type = RP or POI
13031 {
13032 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
13033 {
13034 if(!f2DDiffFlowCorrelationsPro[t][rci])
13035 {
13036 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in CheckPointersUsedInMake() !!!!\n\n",t,rci);
13037 exit(0);
13038 } // end of if(!f2DDiffFlowCorrelationsPro[t][rci])
13039 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
13040 } // end of for(Int_t t=0;t<2;t++)
13041 } // end of if(fCalculate2DDiffFlow)
b3dacf6b 13042
13043} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
13044
57340a27 13045