]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
Correct DCA propagation
[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),
403e3389 103 fUseTrackWeights(kFALSE),
489d5531 104 fUseParticleWeights(NULL),
105 fPhiWeights(NULL),
106 fPtWeights(NULL),
107 fEtaWeights(NULL),
108 // 2b.) event weights:
109 fMultiplicityWeight(NULL),
110 // 3.) integrated flow:
111 fIntFlowList(NULL),
112 fIntFlowProfiles(NULL),
113 fIntFlowResults(NULL),
3435cacb 114 fIntFlowAllCorrelationsVsM(NULL),
489d5531 115 fIntFlowFlags(NULL),
b92ea2b9 116 fApplyCorrectionForNUA(kFALSE),
2001bc3a 117 fApplyCorrectionForNUAVsM(kFALSE),
9da1a4f3 118 fnBinsMult(10000),
067e9bc8 119 fMinMult(0.),
120 fMaxMult(10000.),
b77b6434 121 fPropagateErrorAlsoFromNIT(kFALSE),
8ed4edc7 122 fCalculateCumulantsVsM(kFALSE),
3435cacb 123 fCalculateAllCorrelationsVsM(kFALSE),
0dd3b008 124 fMinimumBiasReferenceFlow(kTRUE),
e5834fcb 125 fForgetAboutCovariances(kFALSE),
126 fStorePhiDistributionForOneEvent(kFALSE),
489d5531 127 fReQ(NULL),
128 fImQ(NULL),
1268c371 129 fSpk(NULL),
489d5531 130 fIntFlowCorrelationsEBE(NULL),
131 fIntFlowEventWeightsForCorrelationsEBE(NULL),
132 fIntFlowCorrelationsAllEBE(NULL),
e5834fcb 133 fReferenceMultiplicityEBE(0.),
489d5531 134 fAvMultiplicity(NULL),
135 fIntFlowCorrelationsPro(NULL),
b40a910e 136 fIntFlowSquaredCorrelationsPro(NULL),
489d5531 137 fIntFlowCorrelationsAllPro(NULL),
138 fIntFlowExtraCorrelationsPro(NULL),
139 fIntFlowProductOfCorrelationsPro(NULL),
0328db2d 140 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
489d5531 141 fIntFlowCorrelationsHist(NULL),
142 fIntFlowCorrelationsAllHist(NULL),
143 fIntFlowCovariances(NULL),
144 fIntFlowSumOfProductOfEventWeights(NULL),
0328db2d 145 fIntFlowCovariancesNUA(NULL),
146 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
489d5531 147 fIntFlowQcumulants(NULL),
b92ea2b9 148 fIntFlowQcumulantsRebinnedInM(NULL),
149 fIntFlowQcumulantsErrorSquaredRatio(NULL),
489d5531 150 fIntFlow(NULL),
b3dacf6b 151 fIntFlowRebinnedInM(NULL),
2001bc3a 152 fIntFlowDetectorBias(NULL),
489d5531 153 // 4.) differential flow:
154 fDiffFlowList(NULL),
155 fDiffFlowProfiles(NULL),
156 fDiffFlowResults(NULL),
1268c371 157 fDiffFlow2D(NULL),
489d5531 158 fDiffFlowFlags(NULL),
1268c371 159 fCalculateDiffFlow(kTRUE),
160 fCalculate2DDiffFlow(kFALSE),
64e500e3 161 // 5.) other differential correlators:
162 fOtherDiffCorrelatorsList(NULL),
163 // 6.) distributions:
57340a27 164 fDistributionsList(NULL),
165 fDistributionsFlags(NULL),
489d5531 166 fStoreDistributions(kFALSE),
64e500e3 167 // 7.) various:
e5834fcb 168 fVariousList(NULL),
169 fPhiDistributionForOneEvent(NULL),
489d5531 170 // x.) debugging and cross-checking:
171 fNestedLoopsList(NULL),
172 fEvaluateIntFlowNestedLoops(kFALSE),
173 fEvaluateDiffFlowNestedLoops(kFALSE),
174 fMaxAllowedMultiplicity(10),
175 fEvaluateNestedLoops(NULL),
176 fIntFlowDirectCorrelations(NULL),
177 fIntFlowExtraDirectCorrelations(NULL),
178 fCrossCheckInPtBinNo(10),
3b552efe 179 fCrossCheckInEtaBinNo(20),
489d5531 180 fNoOfParticlesInBin(NULL)
181 {
182 // constructor
183
184 // base list to hold all output objects:
185 fHistList = new TList();
186 fHistList->SetName("cobjQC");
187 fHistList->SetOwner(kTRUE);
188
189 // list to hold histograms with phi, pt and eta weights:
190 fWeightsList = new TList();
191
192 // multiplicity weight:
193 fMultiplicityWeight = new TString("combinations");
194
195 // analysis label;
196 fAnalysisLabel = new TString();
197
198 // initialize all arrays:
199 this->InitializeArraysForIntFlow();
200 this->InitializeArraysForDiffFlow();
201 this->InitializeArraysForDistributions();
e5834fcb 202 this->InitializeArraysForVarious();
489d5531 203 this->InitializeArraysForNestedLoops();
204
205 } // end of constructor
206
489d5531 207//================================================================================================================
208
489d5531 209AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
210{
211 // destructor
212
213 delete fHistList;
214
215} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
216
489d5531 217//================================================================================================================
218
489d5531 219void AliFlowAnalysisWithQCumulants::Init()
220{
3b552efe 221 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 222 // b) Access all common constants;
223 // c) Book all objects;
3b552efe 224 // d) Store flags for integrated and differential flow;
489d5531 225 // e) Store flags for distributions of corelations;
226 // f) Store harmonic which will be estimated.
3b552efe 227
489d5531 228 //save old value and prevent histograms from being added to directory
229 //to avoid name clashes in case multiple analaysis objects are used
230 //in an analysis
231 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
232 TH1::AddDirectory(kFALSE);
233
3b552efe 234 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 235 this->CrossCheckSettings();
1268c371 236 // b) Access all common constants and book a profile to hold them:
237 this->CommonConstants("Init");
489d5531 238 // c) Book all objects:
1268c371 239 this->BookAndFillWeightsHistograms();
489d5531 240 this->BookAndNestAllLists();
241 this->BookCommonHistograms();
242 this->BookEverythingForIntegratedFlow();
243 this->BookEverythingForDifferentialFlow();
1268c371 244 this->BookEverythingFor2DDifferentialFlow();
489d5531 245 this->BookEverythingForDistributions();
e5834fcb 246 this->BookEverythingForVarious();
489d5531 247 this->BookEverythingForNestedLoops();
248 // d) Store flags for integrated and differential flow:
249 this->StoreIntFlowFlags();
3b552efe 250 this->StoreDiffFlowFlags();
489d5531 251 // e) Store flags for distributions of corelations:
252 this->StoreFlagsForDistributions();
253 // f) Store harmonic which will be estimated:
254 this->StoreHarmonic();
255
256 TH1::AddDirectory(oldHistAddStatus);
257} // end of void AliFlowAnalysisWithQCumulants::Init()
258
489d5531 259//================================================================================================================
260
489d5531 261void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
262{
263 // Running over data only in this method.
264
b3dacf6b 265 // a) Check all pointers used in this method;
266 // b) Define local variables;
267 // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
1268c371 268 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k};
269 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!);
270 // f) Call the methods which calculate correlations for reference flow;
271 // g) Call the methods which calculate correlations for differential flow;
272 // h) Call the methods which calculate correlations for 2D differential flow;
64e500e3 273 // i) Call the methods which calculate other differential correlators;
274 // j) Distributions of correlations;
275 // k) Store phi distribution for one event to illustrate flow;
276 // l) Cross-check with nested loops correlators for reference flow;
277 // m) Cross-check with nested loops correlators for differential flow;
278 // n) Reset all event-by-event quantities (very important !!!!).
489d5531 279
b3dacf6b 280 // a) Check all pointers used in this method:
281 this->CheckPointersUsedInMake();
282
283 // b) Define local variables:
489d5531 284 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
285 Double_t dPt = 0.; // transverse momentum
286 Double_t dEta = 0.; // pseudorapidity
489d5531 287 Double_t wPhi = 1.; // phi weight
288 Double_t wPt = 1.; // pt weight
289 Double_t wEta = 1.; // eta weight
38a1e8b3 290 Double_t wTrack = 1.; // track weight
1268c371 291 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of reference particles)
e5834fcb 292 fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
1268c371 293 Double_t ptEta[2] = {0.,0.}; // 0 = dPt, 1 = dEta
9f33751d 294
b3dacf6b 295 // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
489d5531 296 this->FillCommonControlHistograms(anEvent);
297 this->FillAverageMultiplicities(nRP);
298
1268c371 299 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k}:
9f33751d 300 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
1268c371 301 // nRP = # of reference particles;
302 // nPOI = # of particles of interest.
489d5531 303 AliFlowTrackSimple *aftsTrack = NULL;
1268c371 304 Int_t n = fHarmonic; // shortcut for the harmonic
489d5531 305 for(Int_t i=0;i<nPrim;i++)
306 {
307 aftsTrack=anEvent->GetTrack(i);
308 if(aftsTrack)
309 {
1268c371 310 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())){continue;} // safety measure: consider only tracks which are RPs or POIs
489d5531 311 if(aftsTrack->InRPSelection()) // RP condition:
312 {
313 dPhi = aftsTrack->Phi();
314 dPt = aftsTrack->Pt();
315 dEta = aftsTrack->Eta();
316 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
317 {
318 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
319 }
320 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
321 {
322 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
323 }
324 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
325 {
326 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
38a1e8b3 327 }
328 // Access track weight:
403e3389 329 if(fUseTrackWeights)
330 {
331 wTrack = aftsTrack->Weight();
332 }
1268c371 333 // Calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}] for this event (m = 1,2,...,6, k = 0,1,...,8):
334 for(Int_t m=0;m<6;m++) // to be improved - hardwired 6
489d5531 335 {
1268c371 336 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 337 {
38a1e8b3 338 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1)*n*dPhi);
339 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1)*n*dPhi);
489d5531 340 }
341 }
1268c371 342 // Calculate S_{p,k} for this event (Remark: final calculation of S_{p,k} follows after the loop over data bellow):
489d5531 343 for(Int_t p=0;p<8;p++)
344 {
345 for(Int_t k=0;k<9;k++)
346 {
38a1e8b3 347 (*fSpk)(p,k)+=pow(wPhi*wPt*wEta*wTrack,k);
489d5531 348 }
349 }
1268c371 350 // Differential flow:
351 if(fCalculateDiffFlow || fCalculate2DDiffFlow)
489d5531 352 {
1268c371 353 ptEta[0] = dPt;
354 ptEta[1] = dEta;
355 // Calculate r_{m*n,k} and s_{p,k} (r_{m,k} is 'p-vector' for RPs):
356 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 357 {
1268c371 358 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 359 {
1268c371 360 if(fCalculateDiffFlow)
361 {
362 for(Int_t pe=0;pe<2;pe++) // pt or eta
363 {
38a1e8b3 364 fReRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
365 fImRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 366 if(m==0) // s_{p,k} does not depend on index m
367 {
38a1e8b3 368 fs1dEBE[0][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 369 } // end of if(m==0) // s_{p,k} does not depend on index m
370 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
371 } // end of if(fCalculateDiffFlow)
372 if(fCalculate2DDiffFlow)
373 {
38a1e8b3 374 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
375 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 376 if(m==0) // s_{p,k} does not depend on index m
377 {
38a1e8b3 378 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 379 } // end of if(m==0) // s_{p,k} does not depend on index m
380 } // end of if(fCalculate2DDiffFlow)
381 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
382 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
383 // Checking if RP particle is also POI particle:
384 if(aftsTrack->InPOISelection())
489d5531 385 {
1268c371 386 // Calculate q_{m*n,k} and s_{p,k} ('q-vector' and 's' for RPs && POIs):
387 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 388 {
1268c371 389 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 390 {
1268c371 391 if(fCalculateDiffFlow)
392 {
393 for(Int_t pe=0;pe<2;pe++) // pt or eta
394 {
38a1e8b3 395 fReRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
396 fImRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 397 if(m==0) // s_{p,k} does not depend on index m
398 {
38a1e8b3 399 fs1dEBE[2][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 400 } // end of if(m==0) // s_{p,k} does not depend on index m
401 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
402 } // end of if(fCalculateDiffFlow)
403 if(fCalculate2DDiffFlow)
404 {
38a1e8b3 405 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
406 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 407 if(m==0) // s_{p,k} does not depend on index m
408 {
38a1e8b3 409 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k),1.);
1268c371 410 } // end of if(m==0) // s_{p,k} does not depend on index m
411 } // end of if(fCalculate2DDiffFlow)
412 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
413 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
414 } // end of if(aftsTrack->InPOISelection())
415 } // end of if(fCalculateDiffFlow || fCalculate2DDiffFlow)
489d5531 416 } // end of if(pTrack->InRPSelection())
489d5531 417 if(aftsTrack->InPOISelection())
418 {
419 dPhi = aftsTrack->Phi();
420 dPt = aftsTrack->Pt();
421 dEta = aftsTrack->Eta();
38a1e8b3 422 wPhi = 1.;
423 wPt = 1.;
424 wEta = 1.;
425 wTrack = 1.;
426 if(fUsePhiWeights && fPhiWeights && fnBinsPhi && aftsTrack->InRPSelection()) // determine phi weight for POI && RP particle:
427 {
428 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
429 }
430 if(fUsePtWeights && fPtWeights && fnBinsPt && aftsTrack->InRPSelection()) // determine pt weight for POI && RP particle:
431 {
432 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
433 }
434 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth && aftsTrack->InRPSelection()) // determine eta weight for POI && RP particle:
435 {
436 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
437 }
438 // Access track weight for POI && RP particle:
403e3389 439 if(aftsTrack->InRPSelection() && fUseTrackWeights)
38a1e8b3 440 {
441 wTrack = aftsTrack->Weight();
442 }
1268c371 443 ptEta[0] = dPt;
444 ptEta[1] = dEta;
445 // Calculate p_{m*n,k} ('p-vector' for POIs):
446 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 447 {
1268c371 448 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 449 {
1268c371 450 if(fCalculateDiffFlow)
451 {
452 for(Int_t pe=0;pe<2;pe++) // pt or eta
453 {
38a1e8b3 454 fReRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
455 fImRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 456 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
457 } // end of if(fCalculateDiffFlow)
458 if(fCalculate2DDiffFlow)
459 {
38a1e8b3 460 fReRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
461 fImRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
1268c371 462 } // end of if(fCalculate2DDiffFlow)
463 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
464 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
b77b6434 465 } // end of if(pTrack->InPOISelection())
489d5531 466 } else // to if(aftsTrack)
467 {
38a1e8b3 468 printf("\n WARNING (QC): No particle (i.e. aftsTrack is a NULL pointer in AFAWQC::Make())!!!!\n\n");
489d5531 469 }
470 } // end of for(Int_t i=0;i<nPrim;i++)
471
1268c371 472 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!):
489d5531 473 for(Int_t p=0;p<8;p++)
474 {
475 for(Int_t k=0;k<9;k++)
476 {
1268c371 477 (*fSpk)(p,k)=pow((*fSpk)(p,k),p+1);
478 // ... for the time being s_{p,k} dosn't need higher powers, so no need to finalize it here ...
479 } // end of for(Int_t k=0;k<9;k++)
480 } // end of for(Int_t p=0;p<8;p++)
489d5531 481
1268c371 482 // f) Call the methods which calculate correlations for reference flow:
489d5531 483 if(!fEvaluateIntFlowNestedLoops)
484 {
403e3389 485 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 486 {
1268c371 487 if(nRP>1){this->CalculateIntFlowCorrelations();} // without using particle weights
403e3389 488 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 489 {
1268c371 490 if(nRP>1){this->CalculateIntFlowCorrelationsUsingParticleWeights();} // with using particle weights
491 }
492 // Whether or not using particle weights the following is calculated in the same way:
493 if(nRP>3){this->CalculateIntFlowProductOfCorrelations();}
494 if(nRP>1){this->CalculateIntFlowSumOfEventWeights();}
495 if(nRP>1){this->CalculateIntFlowSumOfProductOfEventWeights();}
496 // Non-isotropic terms:
403e3389 497 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 498 {
1268c371 499 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTerms();}
500 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTerms();}
403e3389 501 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
b92ea2b9 502 {
1268c371 503 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();}
504 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();}
505 }
506 // Whether or not using particle weights the following is calculated in the same way:
507 if(nRP>0){this->CalculateIntFlowProductOfCorrectionTermsForNUA();}
508 if(nRP>0){this->CalculateIntFlowSumOfEventWeightsNUA();}
509 if(nRP>0){this->CalculateIntFlowSumOfProductOfEventWeightsNUA();}
489d5531 510 } // end of if(!fEvaluateIntFlowNestedLoops)
511
1268c371 512 // g) Call the methods which calculate correlations for differential flow:
513 if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 514 {
403e3389 515 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 516 {
1268c371 517 // Without using particle weights:
489d5531 518 this->CalculateDiffFlowCorrelations("RP","Pt");
519 this->CalculateDiffFlowCorrelations("RP","Eta");
520 this->CalculateDiffFlowCorrelations("POI","Pt");
57340a27 521 this->CalculateDiffFlowCorrelations("POI","Eta");
1268c371 522 // Non-isotropic terms:
b92ea2b9 523 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
524 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
525 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
526 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
527 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
528 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
529 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
530 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
403e3389 531 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 532 {
1268c371 533 // With using particle weights:
489d5531 534 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
535 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
536 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
537 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
1268c371 538 // Non-isotropic terms:
b92ea2b9 539 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
540 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
541 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
542 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
543 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
544 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
545 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
546 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
1268c371 547 }
548 // Whether or not using particle weights the following is calculated in the same way:
489d5531 549 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
550 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
551 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
552 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
553 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
554 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
555 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
556 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
557 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
558 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
559 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
560 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
1268c371 561 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 562
1268c371 563 // h) Call the methods which calculate correlations for 2D differential flow:
564 if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
565 {
403e3389 566 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 567 {
1268c371 568 // Without using particle weights:
569 this->Calculate2DDiffFlowCorrelations("RP");
570 this->Calculate2DDiffFlowCorrelations("POI");
571 // Non-isotropic terms:
572 // ... to be ctd ...
403e3389 573 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1268c371 574 {
575 // With using particle weights:
576 // ... to be ctd ...
577 // Non-isotropic terms:
578 // ... to be ctd ...
579 }
580 // Whether or not using particle weights the following is calculated in the same way:
581 // ... to be ctd ...
582 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
64e500e3 583
584 // i) Call the methods which calculate other differential correlators:
b84464d3 585 if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
64e500e3 586 {
403e3389 587 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
64e500e3 588 {
589 // Without using particle weights:
590 this->CalculateOtherDiffCorrelators("RP","Pt");
591 this->CalculateOtherDiffCorrelators("RP","Eta");
592 this->CalculateOtherDiffCorrelators("POI","Pt");
593 this->CalculateOtherDiffCorrelators("POI","Eta");
403e3389 594 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
64e500e3 595 {
596 // With using particle weights:
597 // ... to be ctd ...
598 }
599 // Whether or not using particle weights the following is calculated in the same way:
600 // ... to be ctd ...
601 } // end of if(!fEvaluateDiffFlowNestedLoops)
602
603 // j) Distributions of correlations:
e5834fcb 604 if(fStoreDistributions){this->StoreDistributionsOfCorrelations();}
605
64e500e3 606 // k) Store phi distribution for one event to illustrate flow:
e5834fcb 607 if(fStorePhiDistributionForOneEvent){this->StorePhiDistributionForOneEvent(anEvent);}
1268c371 608
64e500e3 609 // l) Cross-check with nested loops correlators for reference flow:
1268c371 610 if(fEvaluateIntFlowNestedLoops){this->EvaluateIntFlowNestedLoops(anEvent);}
611
64e500e3 612 // m) Cross-check with nested loops correlators for differential flow:
1268c371 613 if(fEvaluateDiffFlowNestedLoops){this->EvaluateDiffFlowNestedLoops(anEvent);}
489d5531 614
64e500e3 615 // n) Reset all event-by-event quantities (very important !!!!):
489d5531 616 this->ResetEventByEventQuantities();
617
618} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
619
489d5531 620//================================================================================================================================
621
489d5531 622void AliFlowAnalysisWithQCumulants::Finish()
623{
624 // Calculate the final results.
489d5531 625
b3dacf6b 626 // a) Check all pointers used in this method;
627 // b) Acces the constants;
628 // c) Access the flags;
b92ea2b9 629 // d) Calculate reference cumulants (not corrected for detector effects);
630 // e) Correct reference cumulants for detector effects;
631 // f) Calculate reference flow;
b77b6434 632 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
b92ea2b9 633 // h) Calculate the final results for differential flow (without/with weights);
634 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
635 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
636 // k) Store results for differential flow in AliFlowCommonHistResults;
637 // l) Print the final results for integrated flow (RP/POI) on the screen;
638 // m) Cross-checking: Results from Q-vectors vs results from nested loops.
b3dacf6b 639
640 // a) Check all pointers used in this method:
641 this->CheckPointersUsedInFinish();
642
643 // b) Acces the constants:
1268c371 644 this->CommonConstants("Finish");
489d5531 645
b3dacf6b 646 if(fCommonHists && fCommonHists->GetHarmonic()) // to be improved (moved somewhere else)
489d5531 647 {
b3dacf6b 648 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
489d5531 649 }
b3dacf6b 650
1268c371 651 // 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 652 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
653 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
654 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
403e3389 655 fUseTrackWeights = (Bool_t)fUseParticleWeights->GetBinContent(4);
b3dacf6b 656 fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
657 fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
658 fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
659 fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
660 fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
661 fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
b77b6434 662 fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
0dd3b008 663 fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
664 fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
e5834fcb 665 fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
666 fStorePhiDistributionForOneEvent = (Bool_t)fIntFlowFlags->GetBinContent(13);
3435cacb 667 fFillMultipleControlHistograms = (Bool_t)fIntFlowFlags->GetBinContent(14);
668 fCalculateAllCorrelationsVsM = (Bool_t)fIntFlowFlags->GetBinContent(15);
b3dacf6b 669 fEvaluateIntFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(1);
670 fEvaluateDiffFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(2);
489d5531 671 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
672 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
1268c371 673
b92ea2b9 674 // d) Calculate reference cumulants (not corrected for detector effects):
489d5531 675 this->FinalizeCorrelationsIntFlow();
676 this->CalculateCovariancesIntFlow();
677 this->CalculateCumulantsIntFlow();
489d5531 678
b92ea2b9 679 // e) Correct reference cumulants for detector effects:
680 this->FinalizeCorrectionTermsForNUAIntFlow();
681 this->CalculateCovariancesNUAIntFlow();
682 this->CalculateQcumulantsCorrectedForNUAIntFlow();
683
684 // f) Calculate reference flow:
685 this->CalculateReferenceFlow();
489d5531 686
b77b6434 687 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
489d5531 688 this->FillCommonHistResultsIntFlow();
b3dacf6b 689 if(fPrintFinalResults[0]){this->PrintFinalResultsForIntegratedFlow("RF");}
690 if(fPrintFinalResults[3] && fCalculateCumulantsVsM){this->PrintFinalResultsForIntegratedFlow("RF, rebinned in M");}
489d5531 691
1268c371 692 // h) Calculate the final results for differential flow (without/with weights):
693 if(fCalculateDiffFlow)
694 {
695 this->FinalizeReducedCorrelations("RP","Pt");
696 this->FinalizeReducedCorrelations("RP","Eta");
697 this->FinalizeReducedCorrelations("POI","Pt");
698 this->FinalizeReducedCorrelations("POI","Eta");
699 this->CalculateDiffFlowCovariances("RP","Pt");
700 this->CalculateDiffFlowCovariances("RP","Eta");
701 this->CalculateDiffFlowCovariances("POI","Pt");
702 this->CalculateDiffFlowCovariances("POI","Eta");
703 this->CalculateDiffFlowCumulants("RP","Pt");
704 this->CalculateDiffFlowCumulants("RP","Eta");
705 this->CalculateDiffFlowCumulants("POI","Pt");
706 this->CalculateDiffFlowCumulants("POI","Eta");
707 this->CalculateDiffFlow("RP","Pt");
708 this->CalculateDiffFlow("RP","Eta");
709 this->CalculateDiffFlow("POI","Pt");
710 this->CalculateDiffFlow("POI","Eta");
711 } // if(fCalculateDiffFlow)
712
713 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
714 if(fCalculateDiffFlow)
489d5531 715 {
716 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
717 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
718 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
719 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
720 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
721 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
722 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
723 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
1268c371 724 if(fApplyCorrectionForNUA)
725 {
726 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
727 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
728 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
729 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
730 }
731 } // end of if(fCalculateDiffFlow && fApplyCorrectionForNUA)
732
733 // i) Calcualate final results for 2D differential flow:
734 if(fCalculate2DDiffFlow)
735 {
736 this->Calculate2DDiffFlowCumulants("RP");
737 this->Calculate2DDiffFlowCumulants("POI");
738 this->Calculate2DDiffFlow("RP");
739 this->Calculate2DDiffFlow("POI");
740 } // end of if(fCalculate2DDiffFlow)
741
742 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
743 if(fCalculateDiffFlow)
744 {
745 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
746 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
3b552efe 747 }
489d5531 748
1268c371 749 // k) Store results for differential flow in AliFlowCommonHistResults:
750 if(fCalculateDiffFlow)
751 {
752 this->FillCommonHistResultsDiffFlow("RP");
753 this->FillCommonHistResultsDiffFlow("POI");
754 }
755
756 // l) Print the final results for integrated flow (RP/POI) on the screen:
757 if(fPrintFinalResults[1] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("RP");}
758 if(fPrintFinalResults[2] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("POI");}
759
760 // m) Cross-checking: Results from Q-vectors vs results from nested loops:
761 // m1) Reference flow:
489d5531 762 if(fEvaluateIntFlowNestedLoops)
763 {
764 this->CrossCheckIntFlowCorrelations();
765 this->CrossCheckIntFlowCorrectionTermsForNUA();
403e3389 766 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights){this->CrossCheckIntFlowExtraCorrelations();}
489d5531 767 } // end of if(fEvaluateIntFlowNestedLoops)
1268c371 768 // m2) Differential flow:
769 if(fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 770 {
b3dacf6b 771 // Correlations:
489d5531 772 this->PrintNumberOfParticlesInSelectedBin();
773 this->CrossCheckDiffFlowCorrelations("RP","Pt");
774 this->CrossCheckDiffFlowCorrelations("RP","Eta");
775 this->CrossCheckDiffFlowCorrelations("POI","Pt");
776 this->CrossCheckDiffFlowCorrelations("POI","Eta");
b3dacf6b 777 // Correction terms for non-uniform acceptance:
489d5531 778 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
779 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
780 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
64e500e3 781 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
782 // Other differential correlators:
783 this->CrossCheckOtherDiffCorrelators("RP","Pt");
784 this->CrossCheckOtherDiffCorrelators("RP","Eta");
785 this->CrossCheckOtherDiffCorrelators("POI","Pt");
786 this->CrossCheckOtherDiffCorrelators("POI","Eta");
489d5531 787 } // end of if(fEvaluateDiffFlowNestedLoops)
788
789} // end of AliFlowAnalysisWithQCumulants::Finish()
790
489d5531 791//================================================================================================================================
792
1268c371 793void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
794{
795 // Evalauted all correlators for reference flow with nested loops.
796
797 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
798 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
799 {
800 // Without using particle weights:
403e3389 801 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1268c371 802 {
803 // Correlations:
804 this->CalculateIntFlowCorrelations(); // from Q-vectors
805 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
806 // Correction for non-uniform acceptance:
807 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
808 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
809 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
810 }
811 // Using particle weights:
403e3389 812 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
1268c371 813 {
814 // Correlations
815 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
816 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
817 // Correction for non-uniform acceptance:
818 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
819 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
820 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
821 }
822 } else if(nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
823 {
824 cout<<endl;
825 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
826 } else
827 {
828 cout<<endl;
829 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
830 }
831
832} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
833
834//================================================================================================================================
835
836void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
837{
838 // Evalauted all correlators for differential flow with nested loops.
839
840 if(!fCalculateDiffFlow){return;}
841
842 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
843 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
844 {
845 // Without using particle weights:
403e3389 846 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1268c371 847 {
64e500e3 848 // 1.) Reduced correlations:
1268c371 849 // Q-vectors:
850 this->CalculateDiffFlowCorrelations("RP","Pt");
851 this->CalculateDiffFlowCorrelations("RP","Eta");
852 this->CalculateDiffFlowCorrelations("POI","Pt");
853 this->CalculateDiffFlowCorrelations("POI","Eta");
854 // Nested loops:
855 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
856 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
857 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
858 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
64e500e3 859 // 2.) Reduced corrections for non-uniform acceptance:
1268c371 860 // Q-vectors:
861 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
862 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
863 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
864 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
865 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
866 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
867 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
868 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
869 // Nested loops:
870 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
871 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
872 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
873 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
64e500e3 874 // 3.) Other differential correlators:
875 // Q-vectors:
876 this->CalculateOtherDiffCorrelators("RP","Pt");
877 this->CalculateOtherDiffCorrelators("RP","Eta");
878 this->CalculateOtherDiffCorrelators("POI","Pt");
879 this->CalculateOtherDiffCorrelators("POI","Eta");
880 // Nested loops:
881 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Pt");
882 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Eta");
883 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Pt");
884 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Eta");
403e3389 885 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1268c371 886 // Using particle weights:
403e3389 887 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
1268c371 888 {
889 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
890 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
891 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
892 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
893 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
894 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
895 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
896 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
897 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
898 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
899 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
900 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
901 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
902 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
903 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
904 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
905 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
906 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
907 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
908 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
403e3389 909 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
1268c371 910 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
911
912} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
913
914//================================================================================================================================
915
489d5531 916void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
917{
b92ea2b9 918 // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
489d5531 919
920 // multiplicity:
1268c371 921 Double_t dMult = (*fSpk)(0,0);
489d5531 922
923 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
924 Double_t dReQ1n = (*fReQ)(0,0);
925 Double_t dReQ2n = (*fReQ)(1,0);
926 //Double_t dReQ3n = (*fReQ)(2,0);
927 //Double_t dReQ4n = (*fReQ)(3,0);
928 Double_t dImQ1n = (*fImQ)(0,0);
929 Double_t dImQ2n = (*fImQ)(1,0);
930 //Double_t dImQ3n = (*fImQ)(2,0);
931 //Double_t dImQ4n = (*fImQ)(3,0);
932
933 // *************************************************************
934 // **** corrections for non-uniform acceptance (cos terms): ****
935 // *************************************************************
936 //
937 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
938 // are stored in 1D profile fQCorrectionsCos.
939 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
940 // --------------------------------------------------------------------------------------------------------------------
941 // 1st bin: <<cos(n*(phi1))>> = cosP1n
942 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
943 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
944 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
945 // --------------------------------------------------------------------------------------------------------------------
946
947 // 1-particle:
948 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
949
950 if(dMult>0)
951 {
952 cosP1n = dReQ1n/dMult;
953
954 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
955 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
0328db2d 956 // event weights for NUA terms:
957 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
489d5531 958
959 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
960 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
b3dacf6b 961 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);}
489d5531 962 }
963
964 // 2-particle:
3b552efe 965 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
489d5531 966 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
967
968 if(dMult>1)
969 {
970 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
971 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
972
973 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
3b552efe 974 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
489d5531 975 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
0328db2d 976 // event weights for NUA terms:
977 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
978 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
979
489d5531 980 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
3b552efe 981 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
489d5531 982 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
b3dacf6b 983 if(fCalculateCumulantsVsM)
984 {
985 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
986 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
987 }
489d5531 988 }
989
990 // 3-particle:
991 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
992
993 if(dMult>2)
994 {
995 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
996 / (dMult*(dMult-1)*(dMult-2));
997
998 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
999 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
0328db2d 1000 // event weights for NUA terms:
1001 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1002
1003 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
2001bc3a 1004 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 1005 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 1006 }
1007
1008} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
1009
1010
1011//================================================================================================================================
1012
1013
1014void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1015{
1016 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
1017
1018 // multiplicity:
1268c371 1019 Double_t dMult = (*fSpk)(0,0);
489d5531 1020
1021 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1022 Double_t dReQ1n = (*fReQ)(0,0);
1023 Double_t dReQ2n = (*fReQ)(1,0);
1024 //Double_t dReQ3n = (*fReQ)(2,0);
1025 //Double_t dReQ4n = (*fReQ)(3,0);
1026 Double_t dImQ1n = (*fImQ)(0,0);
1027 Double_t dImQ2n = (*fImQ)(1,0);
1028 //Double_t dImQ3n = (*fImQ)(2,0);
1029 //Double_t dImQ4n = (*fImQ)(3,0);
1030
1031 // *************************************************************
1032 // **** corrections for non-uniform acceptance (sin terms): ****
1033 // *************************************************************
1034 //
1035 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
1036 // are stored in 1D profile fQCorrectionsSin.
1037 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
1038 // --------------------------------------------------------------------------------------------------------------------
1039 // 1st bin: <<sin(n*(phi1))>> = sinP1n
1040 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1041 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1042 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1043 // --------------------------------------------------------------------------------------------------------------------
1044
1045 // 1-particle:
1046 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1047
1048 if(dMult>0)
1049 {
1050 sinP1n = dImQ1n/dMult;
1051
1052 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
0328db2d 1053 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1054 // event weights for NUA terms:
1055 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
489d5531 1056
1057 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1058 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
b3dacf6b 1059 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);}
489d5531 1060 }
1061
1062 // 2-particle:
1063 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1064 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1065 if(dMult>1)
1066 {
3b552efe 1067 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
489d5531 1068 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1069
1070 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1071 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
3b552efe 1072 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
0328db2d 1073 // event weights for NUA terms:
1074 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1075 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
489d5531 1076
1077 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1078 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1079 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
b3dacf6b 1080 if(fCalculateCumulantsVsM)
1081 {
1082 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1083 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
1084 }
489d5531 1085 }
1086
1087 // 3-particle:
1088 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1089
1090 if(dMult>2)
1091 {
1092 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1093 / (dMult*(dMult-1)*(dMult-2));
1094
1095 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1096 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
0328db2d 1097 // event weights for NUA terms:
1098 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1099
1100 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
2001bc3a 1101 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 1102 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 1103 }
1104
1105} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1106
489d5531 1107//================================================================================================================================
1108
489d5531 1109void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1110{
1268c371 1111 // a) Get pointers for common control and common result histograms;
1112 // b) Get pointers for histograms holding particle weights;
1113 // c) Get pointers for reference flow histograms;
1114 // d) Get pointers for differential flow histograms;
1115 // e) Get pointers for 2D differential flow histograms;
64e500e3 1116 // f) Get pointers for other differential correlators;
1117 // g) Get pointers for nested loops' histograms.
489d5531 1118
1119 if(outputListHistos)
3b552efe 1120 {
1121 this->SetHistList(outputListHistos);
1122 if(!fHistList)
1123 {
1268c371 1124 printf("\n WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!\n\n");
3b552efe 1125 exit(0);
489d5531 1126 }
1127 this->GetPointersForCommonHistograms();
1128 this->GetPointersForParticleWeightsHistograms();
1129 this->GetPointersForIntFlowHistograms();
1130 this->GetPointersForDiffFlowHistograms();
1268c371 1131 this->GetPointersFor2DDiffFlowHistograms();
64e500e3 1132 this->GetPointersForOtherDiffCorrelators();
489d5531 1133 this->GetPointersForNestedLoopsHistograms();
3b552efe 1134 } else
1135 {
1268c371 1136 printf("\n WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!\n\n");
3b552efe 1137 exit(0);
489d5531 1138 }
1139
1140} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
ad87ae62 1141
489d5531 1142//================================================================================================================================
1143
489d5531 1144TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
ad87ae62 1145{
489d5531 1146 // project 2D profile onto pt axis to get 1D profile
1147
1148 Int_t nBinsPt = profilePtEta->GetNbinsX();
1149 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1150 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1151
1152 Int_t nBinsEta = profilePtEta->GetNbinsY();
1153
1154 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1155
1156 for(Int_t p=1;p<=nBinsPt;p++)
1157 {
1158 Double_t contentPt = 0.;
1159 Double_t entryPt = 0.;
1160 Double_t spreadPt = 0.;
1161 Double_t sum1 = 0.;
1162 Double_t sum2 = 0.;
1163 Double_t sum3 = 0.;
1164 for(Int_t e=1;e<=nBinsEta;e++)
1165 {
1166 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1167 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1168 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1169
1170 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1171 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1172 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1173 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1174 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1175 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1176 }
1177 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1178 {
1179 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1180 }
1181 profilePt->SetBinContent(p,contentPt);
1182 profilePt->SetBinEntries(p,entryPt);
1183 {
1184 profilePt->SetBinError(p,spreadPt);
1185 }
1186
1187 }
1188
1189 return profilePt;
1190
1191} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1192
1193
1194//================================================================================================================================
1195
1196
1197TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1198{
1199 // project 2D profile onto eta axis to get 1D profile
1200
1201 Int_t nBinsEta = profilePtEta->GetNbinsY();
1202 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1203 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1204
1205 Int_t nBinsPt = profilePtEta->GetNbinsX();
1206
1207 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1208
1209 for(Int_t e=1;e<=nBinsEta;e++)
1210 {
1211 Double_t contentEta = 0.;
1212 Double_t entryEta = 0.;
1213 for(Int_t p=1;p<=nBinsPt;p++)
1214 {
1215 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1216 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1217 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1218 }
1219 profileEta->SetBinContent(e,contentEta);
1220 profileEta->SetBinEntries(e,entryEta);
1221 }
1222
1223 return profileEta;
1224
1225} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1226
489d5531 1227//================================================================================================================================
1228
489d5531 1229void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1230{
2001bc3a 1231 // Printing on the screen the final results for integrated flow (RF, POI and RP).
489d5531 1232
1233 Int_t n = fHarmonic;
1234
489d5531 1235 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1236 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1237
2001bc3a 1238 if(type == "RF")
489d5531 1239 {
0dd3b008 1240 for(Int_t b=0;b<4;b++)
1241 {
b77b6434 1242 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1243 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1244 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1245 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1246 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1247 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1248 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1249 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
0dd3b008 1250 }
489d5531 1251 } else if(type == "RP")
1252 {
1253 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1254 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1255 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1256 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1257 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1258 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1259 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1260 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1261 } else if(type == "POI")
1262 {
1263 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1264 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1265 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1266 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1267 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1268 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1269 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1270 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
b77b6434 1271 } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
b3dacf6b 1272 {
0dd3b008 1273 for(Int_t b=0;b<4;b++)
1274 {
1275 dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
1276 dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
1277 }
b3dacf6b 1278 }
489d5531 1279
1280 TString title = " flow estimates from Q-cumulants";
1281 TString subtitle = " (";
b3dacf6b 1282 TString subtitle2 = " (rebinned in M)";
489d5531 1283
b3dacf6b 1284 if(type != "RF, rebinned in M")
489d5531 1285 {
403e3389 1286 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
b3dacf6b 1287 {
1288 subtitle.Append(type);
1289 subtitle.Append(", without weights)");
1290 } else
1291 {
1292 subtitle.Append(type);
1293 subtitle.Append(", with weights)");
1294 }
1295 } else
489d5531 1296 {
403e3389 1297 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
b3dacf6b 1298 {
1299 subtitle.Append("RF");
1300 subtitle.Append(", without weights)");
1301 } else
1302 {
1303 subtitle.Append("RF");
1304 subtitle.Append(", with weights)");
1305 }
1306 }
1307
489d5531 1308 cout<<endl;
1309 cout<<"*************************************"<<endl;
1310 cout<<"*************************************"<<endl;
1311 cout<<title.Data()<<endl;
1312 cout<<subtitle.Data()<<endl;
b3dacf6b 1313 if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
489d5531 1314 cout<<endl;
1315
1316 for(Int_t i=0;i<4;i++)
1317 {
2001bc3a 1318 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
489d5531 1319 }
2001bc3a 1320
489d5531 1321 cout<<endl;
b92ea2b9 1322 if(type == "RF")
1323 {
b77b6434 1324 if(fApplyCorrectionForNUA)
1325 {
1326 cout<<" detector bias (corrected for): "<<endl;
1327 } else
1328 {
1329 cout<<" detector bias (not corrected for):"<<endl;
1330 }
b92ea2b9 1331 cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
1332 cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
1333 cout<<endl;
1334 }
b3dacf6b 1335 if(type == "RF" || type == "RF, rebinned in M")
489d5531 1336 {
2001bc3a 1337 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1338 }
1339 else if (type == "RP")
1340 {
2001bc3a 1341 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1342 }
1343 else if (type == "POI")
1344 {
2001bc3a 1345 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1346 }
1347
489d5531 1348 cout<<"*************************************"<<endl;
1349 cout<<"*************************************"<<endl;
1350 cout<<endl;
1351
2001bc3a 1352}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
489d5531 1353
1354//================================================================================================================================
1355
489d5531 1356void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1357{
1358 //store the final results in output .root file
1359 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1360 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1361 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1362 delete output;
1363}
1364
1365
1366//================================================================================================================================
1367
1368
1369void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1370{
1371 //store the final results in output .root file
1372 fHistList->SetName("cobjQC");
1373 fHistList->SetOwner(kTRUE);
1374 outputFileName->Add(fHistList);
1375 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1376}
1377
489d5531 1378//================================================================================================================================
1379
489d5531 1380void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1381{
1382 // Book common control histograms and common histograms for final results.
1268c371 1383 // a) Book common control histograms;
1384 // b) Book common result histograms.
1385
1386 // a) Book common control histograms:
1387 // Common control histograms (all events):
489d5531 1388 TString commonHistsName = "AliFlowCommonHistQC";
1389 commonHistsName += fAnalysisLabel->Data();
1390 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1391 fHistList->Add(fCommonHists);
1268c371 1392 // Common control histograms (selected events):
dd442cd2 1393 if(fFillMultipleControlHistograms)
1394 {
1268c371 1395 // Common control histogram filled for events with 2 and more reference particles:
dd442cd2 1396 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1397 commonHists2ndOrderName += fAnalysisLabel->Data();
1398 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1399 fHistList->Add(fCommonHists2nd);
1268c371 1400 // Common control histogram filled for events with 2 and more reference particles:
dd442cd2 1401 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1402 commonHists4thOrderName += fAnalysisLabel->Data();
1403 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1404 fHistList->Add(fCommonHists4th);
1268c371 1405 // Common control histogram filled for events with 6 and more reference particles:
dd442cd2 1406 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1407 commonHists6thOrderName += fAnalysisLabel->Data();
1408 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1409 fHistList->Add(fCommonHists6th);
1268c371 1410 // Common control histogram filled for events with 8 and more reference particles:
dd442cd2 1411 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1412 commonHists8thOrderName += fAnalysisLabel->Data();
1413 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1414 fHistList->Add(fCommonHists8th);
1415 } // end of if(fFillMultipleControlHistograms)
1416
1268c371 1417 // b) Book common result histograms:
1418 // Common result histograms for QC{2}:
489d5531 1419 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1420 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1421 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1422 fHistList->Add(fCommonHistsResults2nd);
1268c371 1423 // Common result histograms for QC{4}:
489d5531 1424 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1425 commonHistResults4thOrderName += fAnalysisLabel->Data();
1426 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1427 fHistList->Add(fCommonHistsResults4th);
1268c371 1428 // Common result histograms for QC{6}:
489d5531 1429 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1430 commonHistResults6thOrderName += fAnalysisLabel->Data();
1431 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1432 fHistList->Add(fCommonHistsResults6th);
1268c371 1433 // Common result histograms for QC{8}:
489d5531 1434 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1435 commonHistResults8thOrderName += fAnalysisLabel->Data();
1436 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1437 fHistList->Add(fCommonHistsResults8th);
1438
1439} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1440
489d5531 1441//================================================================================================================================
1442
489d5531 1443void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1444{
1268c371 1445 // Book and fill histograms which hold phi, pt and eta weights.
489d5531 1446
1447 if(!fWeightsList)
1448 {
1268c371 1449 printf("\n WARNING (QC): fWeightsList is NULL in AFAWQC::BAFWH() !!!! \n\n");
489d5531 1450 exit(0);
1451 }
1452
1453 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1454 fUseParticleWeightsName += fAnalysisLabel->Data();
403e3389 1455 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",4,0,4);
489d5531 1456 fUseParticleWeights->SetLabelSize(0.06);
1457 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1458 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1459 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
403e3389 1460 (fUseParticleWeights->GetXaxis())->SetBinLabel(4,"w_{track}");
489d5531 1461 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1462 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1463 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
403e3389 1464 fUseParticleWeights->Fill(3.5,(Int_t)fUseTrackWeights);
489d5531 1465 fWeightsList->Add(fUseParticleWeights);
1466
1467 if(fUsePhiWeights)
1468 {
1469 if(fWeightsList->FindObject("phi_weights"))
1470 {
1471 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1268c371 1472 if(!fPhiWeights)
1473 {
1474 printf("\n WARNING (QC): fPhiWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1475 exit(0);
1476 }
489d5531 1477 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1478 {
1479 cout<<endl;
1480 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1481 cout<<endl;
6fbbbbf1 1482 //exit(0);
489d5531 1483 }
1484 } else
1485 {
1486 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1487 exit(0);
1488 }
1489 } // end of if(fUsePhiWeights)
1490
1491 if(fUsePtWeights)
1492 {
1493 if(fWeightsList->FindObject("pt_weights"))
1494 {
1495 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1268c371 1496 if(!fPtWeights)
1497 {
1498 printf("\n WARNING (QC): fPtWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1499 exit(0);
1500 }
489d5531 1501 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1502 {
1503 cout<<endl;
1504 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1505 cout<<endl;
6fbbbbf1 1506 //exit(0);
489d5531 1507 }
1508 } else
1509 {
1510 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1511 exit(0);
1512 }
1513 } // end of if(fUsePtWeights)
1514
1515 if(fUseEtaWeights)
1516 {
1517 if(fWeightsList->FindObject("eta_weights"))
1518 {
1519 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1268c371 1520 if(!fEtaWeights)
1521 {
1522 printf("\n WARNING (QC): fEtaWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1523 exit(0);
1524 }
489d5531 1525 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1526 {
1527 cout<<endl;
1528 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1529 cout<<endl;
6fbbbbf1 1530 //exit(0);
489d5531 1531 }
1532 } else
1533 {
1534 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1535 exit(0);
1536 }
1537 } // end of if(fUseEtaWeights)
1538
1539} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1540
489d5531 1541//================================================================================================================================
1542
489d5531 1543void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1544{
1545 // Book all objects for integrated flow:
e5834fcb 1546 // a) Book profile to hold all flags for integrated flow;
1547 // b) Book event-by-event quantities;
1548 // c) Book profiles; // to be improved (comment)
489d5531 1549 // d) Book histograms holding the final results.
1550
1551 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1552 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1553
1554 // a) Book profile to hold all flags for integrated flow:
1555 TString intFlowFlagsName = "fIntFlowFlags";
1556 intFlowFlagsName += fAnalysisLabel->Data();
3435cacb 1557 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",15,0,15);
489d5531 1558 fIntFlowFlags->SetTickLength(-0.01,"Y");
1559 fIntFlowFlags->SetMarkerStyle(25);
403e3389 1560 fIntFlowFlags->SetLabelSize(0.04);
489d5531 1561 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1562 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1563 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1564 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
b3dacf6b 1565 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
489d5531 1566 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
3b552efe 1567 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
b3dacf6b 1568 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
1569 fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
1570 fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
1571 fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
0dd3b008 1572 fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
8e1cefdd 1573 fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
e5834fcb 1574 fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStorePhiDistributionForOneEvent");
dd442cd2 1575 fIntFlowFlags->GetXaxis()->SetBinLabel(14,"fFillMultipleControlHistograms");
3435cacb 1576 fIntFlowFlags->GetXaxis()->SetBinLabel(15,"Calculate all correlations vs M");
489d5531 1577 fIntFlowList->Add(fIntFlowFlags);
1578
1579 // b) Book event-by-event quantities:
1580 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
8ed4edc7 1581 fReQ = new TMatrixD(6,9);
1582 fImQ = new TMatrixD(6,9);
1268c371 1583 fSpk = new TMatrixD(8,9);
489d5531 1584 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1585 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1586 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1587 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1588 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1589 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1590 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1591 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1592 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1593 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1594 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
403e3389 1595 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),64,0,64);
489d5531 1596 // average correction terms for non-uniform acceptance for single event
1597 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1598 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1599 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1600 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1601 {
b92ea2b9 1602 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 1603 }
0328db2d 1604 // event weights for terms for non-uniform acceptance:
1605 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1606 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1607 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1608 {
b92ea2b9 1609 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 1610 }
489d5531 1611 // c) Book profiles: // to be improved (comment)
1612 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1613 TString avMultiplicityName = "fAvMultiplicity";
1614 avMultiplicityName += fAnalysisLabel->Data();
403e3389 1615 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average multiplicities of reference particles (RPs)",9,0,9);
489d5531 1616 fAvMultiplicity->SetTickLength(-0.01,"Y");
1617 fAvMultiplicity->SetMarkerStyle(25);
1618 fAvMultiplicity->SetLabelSize(0.05);
1619 fAvMultiplicity->SetLabelOffset(0.02,"Y");
403e3389 1620 fAvMultiplicity->SetYTitle("Average multiplicity");
489d5531 1621 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1622 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1623 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1624 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1625 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1626 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1627 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1628 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1629 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1630 fIntFlowProfiles->Add(fAvMultiplicity);
b40a910e 1631 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1632 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
489d5531 1633 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1634 intFlowCorrelationsProName += fAnalysisLabel->Data();
1635 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
b40a910e 1636 fIntFlowCorrelationsPro->Sumw2();
489d5531 1637 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1638 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1639 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1640 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 1641 for(Int_t b=0;b<4;b++)
b3dacf6b 1642 {
68a3b4b1 1643 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
b3dacf6b 1644 }
489d5531 1645 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
b40a910e 1646 // Average correlations squared <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> for all events:
1647 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"};
1648 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
1649 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
1650 fIntFlowSquaredCorrelationsPro = new TProfile(intFlowSquaredCorrelationsProName.Data(),"Average squared correlations for all events",4,0,4,"s");
1651 fIntFlowSquaredCorrelationsPro->Sumw2();
1652 fIntFlowSquaredCorrelationsPro->SetTickLength(-0.01,"Y");
1653 fIntFlowSquaredCorrelationsPro->SetMarkerStyle(25);
1654 fIntFlowSquaredCorrelationsPro->SetLabelSize(0.06);
1655 fIntFlowSquaredCorrelationsPro->SetLabelOffset(0.01,"Y");
1656 for(Int_t b=0;b<4;b++)
1657 {
1658 (fIntFlowSquaredCorrelationsPro->GetXaxis())->SetBinLabel(b+1,squaredCorrelationFlag[b].Data());
1659 }
1660 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsPro);
b3dacf6b 1661 if(fCalculateCumulantsVsM)
1662 {
1663 for(Int_t ci=0;ci<4;ci++) // correlation index
1664 {
b40a910e 1665 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
b3dacf6b 1666 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1667 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1668 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1669 Form("%s vs multiplicity",correlationFlag[ci].Data()),
b40a910e 1670 fnBinsMult,fMinMult,fMaxMult,"s");
1671 fIntFlowCorrelationsVsMPro[ci]->Sumw2();
b3dacf6b 1672 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1673 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1674 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
b40a910e 1675 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
1676 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
1677 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
1678 fIntFlowSquaredCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data()),
1679 Form("%s vs multiplicity",squaredCorrelationFlag[ci].Data()),
1680 fnBinsMult,fMinMult,fMaxMult,"s");
1681 fIntFlowSquaredCorrelationsVsMPro[ci]->Sumw2();
1682 fIntFlowSquaredCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(squaredCorrelationFlag[ci].Data());
1683 fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1684 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsVsMPro[ci]);
b3dacf6b 1685 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1686 } // end of if(fCalculateCumulantsVsM)
489d5531 1687 // averaged all correlations for all events (with wrong errors!):
1688 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1689 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
403e3389 1690 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average all correlations for all events",64,0,64);
b84464d3 1691 fIntFlowCorrelationsAllPro->Sumw2();
489d5531 1692 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1693 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1694 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1695 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1696 // 2-p correlations:
403e3389 1697 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT_{n|n}");
1698 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"#LT#LT2#GT#GT_{2n|2n}");
1699 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"#LT#LT2#GT#GT_{3n|3n}");
1700 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"#LT#LT2#GT#GT_{4n|4n}");
489d5531 1701 // 3-p correlations:
403e3389 1702 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"#LT#LT3#GT#GT_{2n|n,n}");
1703 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"#LT#LT3#GT#GT_{3n|2n,n}");
1704 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"#LT#LT3#GT#GT_{4n|2n,2n}");
1705 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"#LT#LT3#GT#GT_{4n|3n,n}");
489d5531 1706 // 4-p correlations:
403e3389 1707 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"#LT#LT4#GT#GT_{n,n|n,n}");
1708 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"#LT#LT4#GT#GT_{2n,n|2n,n}");
1709 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"#LT#LT4#GT#GT_{2n,2n|2n,2n}");
1710 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"#LT#LT4#GT#GT_{3n|n,n,n}");
1711 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"#LT#LT4#GT#GT_{3n,n|3n,n}");
1712 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"#LT#LT4#GT#GT_{3n,n|2n,2n}");
1713 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"#LT#LT4#GT#GT_{4n|2n,n,n}");
489d5531 1714 // 5-p correlations:
403e3389 1715 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"#LT#LT5#GT#GT_{2n,n|n,n,n}");
1716 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"#LT#LT5#GT#GT_{2n,2n|2n,n,n}");
1717 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"#LT#LT5#GT#GT_{3n,n|2n,n,n}");
1718 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"#LT#LT5#GT#GT_{4n|n,n,n,n}");
489d5531 1719 // 6-p correlations:
403e3389 1720 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"#LT#LT6#GT#GT_{n,n,n|n,n,n}");
1721 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"#LT#LT6#GT#GT_{2n,n,n|2n,n,n}");
1722 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"#LT#LT6#GT#GT_{2n,2n|n,n,n,n}");
1723 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"#LT#LT6#GT#GT_{3n,n|n,n,n,n}");
489d5531 1724 // 7-p correlations:
403e3389 1725 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}");
489d5531 1726 // 8-p correlations:
403e3389 1727 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}");
b84464d3 1728 // EXTRA correlations for v3{5} study:
403e3389 1729 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(33,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
1730 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(34,"#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}");
b84464d3 1731 // EXTRA correlations for Teaney-Yan study:
403e3389 1732 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(35,"#LT#LT2#GT#GT_{5n|5n}");
1733 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(36,"#LT#LT2#GT#GT_{6n|6n}");
1734 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(37,"#LT#LT3#GT#GT_{5n|3n,2n}");
1735 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(38,"#LT#LT3#GT#GT_{5n|4n,1n}");
1736 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(39,"#LT#LT3#GT#GT_{6n|3n,3n}");
1737 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(40,"#LT#LT3#GT#GT_{6n|4n,2n}");
1738 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(41,"#LT#LT3#GT#GT_{6n|5n,1n}");
1739 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(42,"#LT#LT4#GT#GT_{6n|3n,2n,1n}");
1740 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(43,"#LT#LT4#GT#GT_{3n,2n|3n,2n}");
1741 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(44,"#LT#LT4#GT#GT_{4n,1n|3n,2n}");
1742 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(45,"#LT#LT4#GT#GT_{3n,3n|3n,3n}");
1743 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(46,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
1744 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(47,"#LT#LT4#GT#GT_{5n,1n|3n,3n}");
1745 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(48,"#LT#LT4#GT#GT_{4n,2n|4n,2n}");
1746 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(49,"#LT#LT4#GT#GT_{5n,1n|4n,2n}");
1747 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(50,"#LT#LT4#GT#GT_{5n|3n,1n,1n}");
1748 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(51,"#LT#LT4#GT#GT_{5n|2n,2n,1n}");
1749 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(52,"#LT#LT4#GT#GT_{5n,1n|5n,1n}");
1750 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(53,"#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}");
1751 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(54,"#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}");
1752 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(55,"#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}");
1753 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(56,"#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}");
1754 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(57,"#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}");
1755 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(58,"#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}");
1756 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(59,"#LT#LT4#GT#GT_{6n|4n,1n,1n}");
1757 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(60,"#LT#LT4#GT#GT_{6n|2n,2n,2n}");
1758 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(61,"#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}");
1759 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(62,"#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}");
1760 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(63,"#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}");
489d5531 1761 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
3435cacb 1762 // average all correlations versus multiplicity (errors via Sumw2 - to be improved):
1763 if(fCalculateAllCorrelationsVsM)
1764 {
1765 // 2-p correlations vs M:
1766 fIntFlowCorrelationsAllVsMPro[0] = new TProfile("two1n1n","#LT#LT2#GT#GT_{n|n}",fnBinsMult,fMinMult,fMaxMult);
1767 fIntFlowCorrelationsAllVsMPro[0]->Sumw2();
1768 fIntFlowCorrelationsAllVsMPro[0]->GetXaxis()->SetTitle("M");
1769 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[0]);
1770 fIntFlowCorrelationsAllVsMPro[1] = new TProfile("two2n2n","#LT#LT2#GT#GT_{2n|2n}",fnBinsMult,fMinMult,fMaxMult);
1771 fIntFlowCorrelationsAllVsMPro[1]->Sumw2();
1772 fIntFlowCorrelationsAllVsMPro[1]->GetXaxis()->SetTitle("M");
1773 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[1]);
1774 fIntFlowCorrelationsAllVsMPro[2] = new TProfile("two3n3n","#LT#LT2#GT#GT_{3n|3n}",fnBinsMult,fMinMult,fMaxMult);
1775 fIntFlowCorrelationsAllVsMPro[2]->Sumw2();
1776 fIntFlowCorrelationsAllVsMPro[2]->GetXaxis()->SetTitle("M");
1777 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[2]);
1778 fIntFlowCorrelationsAllVsMPro[3] = new TProfile("two4n4n","#LT#LT2#GT#GT_{4n|4n}",fnBinsMult,fMinMult,fMaxMult);
1779 fIntFlowCorrelationsAllVsMPro[3]->Sumw2();
1780 fIntFlowCorrelationsAllVsMPro[3]->GetXaxis()->SetTitle("M");
1781 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[3]);
1782 // 3-p correlations vs M:
1783 fIntFlowCorrelationsAllVsMPro[5] = new TProfile("three2n1n1n","#LT#LT3#GT#GT_{2n|n,n}",fnBinsMult,fMinMult,fMaxMult);
1784 fIntFlowCorrelationsAllVsMPro[5]->Sumw2();
1785 fIntFlowCorrelationsAllVsMPro[5]->GetXaxis()->SetTitle("M");
1786 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[5]);
1787 fIntFlowCorrelationsAllVsMPro[6] = new TProfile("three3n2n1n","#LT#LT3#GT#GT_{3n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
1788 fIntFlowCorrelationsAllVsMPro[6]->Sumw2();
1789 fIntFlowCorrelationsAllVsMPro[6]->GetXaxis()->SetTitle("M");
1790 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[6]);
1791 fIntFlowCorrelationsAllVsMPro[7] = new TProfile("three4n2n2n","#LT#LT3#GT#GT_{4n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1792 fIntFlowCorrelationsAllVsMPro[7]->Sumw2();
1793 fIntFlowCorrelationsAllVsMPro[7]->GetXaxis()->SetTitle("M");
1794 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[7]);
1795 fIntFlowCorrelationsAllVsMPro[8] = new TProfile("three4n3n1n","#LT#LT3#GT#GT_{4n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
1796 fIntFlowCorrelationsAllVsMPro[8]->Sumw2();
1797 fIntFlowCorrelationsAllVsMPro[8]->GetXaxis()->SetTitle("M");
1798 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[8]);
1799 // 4-p correlations vs M:
1800 fIntFlowCorrelationsAllVsMPro[10] = new TProfile("four1n1n1n1n","#LT#LT4#GT#GT_{n,n|n,n}",fnBinsMult,fMinMult,fMaxMult);
1801 fIntFlowCorrelationsAllVsMPro[10]->Sumw2();
1802 fIntFlowCorrelationsAllVsMPro[10]->GetXaxis()->SetTitle("M");
1803 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[10]);
1804 fIntFlowCorrelationsAllVsMPro[11] = new TProfile("four2n1n2n1n","#LT#LT4#GT#GT_{2n,n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
1805 fIntFlowCorrelationsAllVsMPro[11]->Sumw2();
1806 fIntFlowCorrelationsAllVsMPro[11]->GetXaxis()->SetTitle("M");
1807 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[11]);
1808 fIntFlowCorrelationsAllVsMPro[12] = new TProfile("four2n2n2n2n","#LT#LT4#GT#GT_{2n,2n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1809 fIntFlowCorrelationsAllVsMPro[12]->Sumw2();
1810 fIntFlowCorrelationsAllVsMPro[12]->GetXaxis()->SetTitle("M");
1811 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[12]);
1812 fIntFlowCorrelationsAllVsMPro[13] = new TProfile("four3n1n1n1n","#LT#LT4#GT#GT_{3n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1813 fIntFlowCorrelationsAllVsMPro[13]->Sumw2();
1814 fIntFlowCorrelationsAllVsMPro[13]->GetXaxis()->SetTitle("M");
1815 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[13]);
1816 fIntFlowCorrelationsAllVsMPro[14] = new TProfile("four3n1n3n1n","#LT#LT4#GT#GT_{3n,n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
1817 fIntFlowCorrelationsAllVsMPro[14]->Sumw2();
1818 fIntFlowCorrelationsAllVsMPro[14]->GetXaxis()->SetTitle("M");
1819 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[14]);
1820 fIntFlowCorrelationsAllVsMPro[15] = new TProfile("four3n1n2n2n","#LT#LT4#GT#GT_{3n,n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1821 fIntFlowCorrelationsAllVsMPro[15]->Sumw2();
1822 fIntFlowCorrelationsAllVsMPro[15]->GetXaxis()->SetTitle("M");
1823 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[15]);
1824 fIntFlowCorrelationsAllVsMPro[16] = new TProfile("four4n2n1n1n","#LT#LT4#GT#GT_{4n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1825 fIntFlowCorrelationsAllVsMPro[16]->Sumw2();
1826 fIntFlowCorrelationsAllVsMPro[16]->GetXaxis()->SetTitle("M");
1827 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[16]);
1828 // 5-p correlations vs M:
403e3389 1829 fIntFlowCorrelationsAllVsMPro[18] = new TProfile("five2n1n1n1n1n","#LT#LT5#GT#GT_{2n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
3435cacb 1830 fIntFlowCorrelationsAllVsMPro[18]->Sumw2();
1831 fIntFlowCorrelationsAllVsMPro[18]->GetXaxis()->SetTitle("M");
1832 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[18]);
1833 fIntFlowCorrelationsAllVsMPro[19] = new TProfile("five2n2n2n1n1n","#LT#LT5#GT#GT_{2n,2n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1834 fIntFlowCorrelationsAllVsMPro[19]->Sumw2();
1835 fIntFlowCorrelationsAllVsMPro[19]->GetXaxis()->SetTitle("M");
1836 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[19]);
1837 fIntFlowCorrelationsAllVsMPro[20] = new TProfile("five3n1n2n1n1n","#LT#LT5#GT#GT_{3n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1838 fIntFlowCorrelationsAllVsMPro[20]->Sumw2();
1839 fIntFlowCorrelationsAllVsMPro[20]->GetXaxis()->SetTitle("M");
1840 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[20]);
1841 fIntFlowCorrelationsAllVsMPro[21] = new TProfile("five4n1n1n1n1n","#LT#LT5#GT#GT_{4n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1842 fIntFlowCorrelationsAllVsMPro[21]->Sumw2();
1843 fIntFlowCorrelationsAllVsMPro[21]->GetXaxis()->SetTitle("M");
1844 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[21]);
1845 // 6-p correlations vs M:
1846 fIntFlowCorrelationsAllVsMPro[23] = new TProfile("six1n1n1n1n1n1n","#LT#LT6#GT#GT_{n,n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1847 fIntFlowCorrelationsAllVsMPro[23]->Sumw2();
1848 fIntFlowCorrelationsAllVsMPro[23]->GetXaxis()->SetTitle("M");
1849 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[23]);
1850 fIntFlowCorrelationsAllVsMPro[24] = new TProfile("six2n1n1n2n1n1n","#LT#LT6#GT#GT_{2n,n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1851 fIntFlowCorrelationsAllVsMPro[24]->Sumw2();
1852 fIntFlowCorrelationsAllVsMPro[24]->GetXaxis()->SetTitle("M");
1853 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[24]);
1854 fIntFlowCorrelationsAllVsMPro[25] = new TProfile("six2n2n1n1n1n1n","#LT#LT6#GT#GT_{2n,2n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1855 fIntFlowCorrelationsAllVsMPro[25]->Sumw2();
1856 fIntFlowCorrelationsAllVsMPro[25]->GetXaxis()->SetTitle("M");
1857 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[25]);
1858 fIntFlowCorrelationsAllVsMPro[26] = new TProfile("six3n1n1n1n1n1n","#LT#LT6#GT#GT_{3n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1859 fIntFlowCorrelationsAllVsMPro[26]->Sumw2();
1860 fIntFlowCorrelationsAllVsMPro[26]->GetXaxis()->SetTitle("M");
1861 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[26]);
1862 // 7-p correlations vs M:
1863 fIntFlowCorrelationsAllVsMPro[28] = new TProfile("seven2n1n1n1n1n1n1n","#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1864 fIntFlowCorrelationsAllVsMPro[28]->Sumw2();
1865 fIntFlowCorrelationsAllVsMPro[28]->GetXaxis()->SetTitle("M");
1866 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[28]);
1867 // 8-p correlations vs M:
1868 fIntFlowCorrelationsAllVsMPro[30] = new TProfile("eight1n1n1n1n1n1n1n1n","#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1869 fIntFlowCorrelationsAllVsMPro[30]->Sumw2();
1870 fIntFlowCorrelationsAllVsMPro[30]->GetXaxis()->SetTitle("M");
1871 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[30]);
b84464d3 1872 // EXTRA correlations vs M for v3{5} study (to be improved - put them in a right order somewhere):
3435cacb 1873 fIntFlowCorrelationsAllVsMPro[32] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1874 fIntFlowCorrelationsAllVsMPro[32]->Sumw2();
1875 fIntFlowCorrelationsAllVsMPro[32]->GetXaxis()->SetTitle("M");
1876 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[32]);
b84464d3 1877 fIntFlowCorrelationsAllVsMPro[33] = new TProfile("five3n3n2n2n2n","#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
3435cacb 1878 fIntFlowCorrelationsAllVsMPro[33]->Sumw2();
1879 fIntFlowCorrelationsAllVsMPro[33]->GetXaxis()->SetTitle("M");
1880 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[33]);
b84464d3 1881 // EXTRA correlations vs M for Teaney-Yan study (to be improved - put them in a right order somewhere):
1882 fIntFlowCorrelationsAllVsMPro[34] = new TProfile("two5n5n","#LT#LT2#GT#GT_{5n|5n}",fnBinsMult,fMinMult,fMaxMult);
1883 fIntFlowCorrelationsAllVsMPro[34]->Sumw2();
1884 fIntFlowCorrelationsAllVsMPro[34]->GetXaxis()->SetTitle("M");
1885 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[34]);
1886 fIntFlowCorrelationsAllVsMPro[35] = new TProfile("two6n6n","#LT#LT2#GT#GT_{6n|6n}",fnBinsMult,fMinMult,fMaxMult);
1887 fIntFlowCorrelationsAllVsMPro[35]->Sumw2();
1888 fIntFlowCorrelationsAllVsMPro[35]->GetXaxis()->SetTitle("M");
1889 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[35]);
1890 fIntFlowCorrelationsAllVsMPro[36] = new TProfile("three5n3n2n","#LT#LT3#GT#GT_{5n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
1891 fIntFlowCorrelationsAllVsMPro[36]->Sumw2();
1892 fIntFlowCorrelationsAllVsMPro[36]->GetXaxis()->SetTitle("M");
1893 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[36]);
1894 fIntFlowCorrelationsAllVsMPro[37] = new TProfile("three5n4n1n","#LT#LT3#GT#GT_{5n|4n,1n}",fnBinsMult,fMinMult,fMaxMult);
1895 fIntFlowCorrelationsAllVsMPro[37]->Sumw2();
1896 fIntFlowCorrelationsAllVsMPro[37]->GetXaxis()->SetTitle("M");
1897 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[37]);
1898 fIntFlowCorrelationsAllVsMPro[38] = new TProfile("three6n3n3n","#LT#LT3#GT#GT_{6n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1899 fIntFlowCorrelationsAllVsMPro[38]->Sumw2();
1900 fIntFlowCorrelationsAllVsMPro[38]->GetXaxis()->SetTitle("M");
1901 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[38]);
1902 fIntFlowCorrelationsAllVsMPro[39] = new TProfile("three6n4n2n","#LT#LT3#GT#GT_{6n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
1903 fIntFlowCorrelationsAllVsMPro[39]->Sumw2();
1904 fIntFlowCorrelationsAllVsMPro[39]->GetXaxis()->SetTitle("M");
1905 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[39]);
1906 fIntFlowCorrelationsAllVsMPro[40] = new TProfile("three6n5n1n","#LT#LT3#GT#GT_{6n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
1907 fIntFlowCorrelationsAllVsMPro[40]->Sumw2();
1908 fIntFlowCorrelationsAllVsMPro[40]->GetXaxis()->SetTitle("M");
1909 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[40]);
1910 fIntFlowCorrelationsAllVsMPro[41] = new TProfile("four6n3n2n1n","#LT#LT4#GT#GT_{6n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1911 fIntFlowCorrelationsAllVsMPro[41]->Sumw2();
1912 fIntFlowCorrelationsAllVsMPro[41]->GetXaxis()->SetTitle("M");
1913 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[41]);
1914 fIntFlowCorrelationsAllVsMPro[42] = new TProfile("four3n2n3n2n","#LT#LT4#GT#GT_{3n,2n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
1915 fIntFlowCorrelationsAllVsMPro[42]->Sumw2();
1916 fIntFlowCorrelationsAllVsMPro[42]->GetXaxis()->SetTitle("M");
1917 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[42]);
1918 fIntFlowCorrelationsAllVsMPro[43] = new TProfile("four4n1n3n2n","#LT#LT4#GT#GT_{4n,1n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
1919 fIntFlowCorrelationsAllVsMPro[43]->Sumw2();
1920 fIntFlowCorrelationsAllVsMPro[43]->GetXaxis()->SetTitle("M");
1921 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[43]);
1922 fIntFlowCorrelationsAllVsMPro[44] = new TProfile("four3n3n3n3n","#LT#LT4#GT#GT_{3n,3n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1923 fIntFlowCorrelationsAllVsMPro[44]->Sumw2();
1924 fIntFlowCorrelationsAllVsMPro[44]->GetXaxis()->SetTitle("M");
1925 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[44]);
1926 fIntFlowCorrelationsAllVsMPro[45] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1927 fIntFlowCorrelationsAllVsMPro[45]->Sumw2();
1928 fIntFlowCorrelationsAllVsMPro[45]->GetXaxis()->SetTitle("M");
1929 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[45]);
1930 fIntFlowCorrelationsAllVsMPro[46] = new TProfile("four5n1n3n3n","#LT#LT4#GT#GT_{5n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1931 fIntFlowCorrelationsAllVsMPro[46]->Sumw2();
1932 fIntFlowCorrelationsAllVsMPro[46]->GetXaxis()->SetTitle("M");
1933 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[46]);
1934 fIntFlowCorrelationsAllVsMPro[47] = new TProfile("four4n2n4n2n","#LT#LT4#GT#GT_{4n,2n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
1935 fIntFlowCorrelationsAllVsMPro[47]->Sumw2();
1936 fIntFlowCorrelationsAllVsMPro[47]->GetXaxis()->SetTitle("M");
1937 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[47]);
1938 fIntFlowCorrelationsAllVsMPro[48] = new TProfile("four5n1n4n2n","#LT#LT4#GT#GT_{5n,1n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
1939 fIntFlowCorrelationsAllVsMPro[48]->Sumw2();
1940 fIntFlowCorrelationsAllVsMPro[48]->GetXaxis()->SetTitle("M");
1941 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[48]);
1942 fIntFlowCorrelationsAllVsMPro[49] = new TProfile("four5n3n1n1n","#LT#LT4#GT#GT_{5n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1943 fIntFlowCorrelationsAllVsMPro[49]->Sumw2();
1944 fIntFlowCorrelationsAllVsMPro[49]->GetXaxis()->SetTitle("M");
1945 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[49]);
1946 fIntFlowCorrelationsAllVsMPro[50] = new TProfile("four5n2n2n1n","#LT#LT4#GT#GT_{5n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1947 fIntFlowCorrelationsAllVsMPro[50]->Sumw2();
1948 fIntFlowCorrelationsAllVsMPro[50]->GetXaxis()->SetTitle("M");
1949 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[50]);
1950 fIntFlowCorrelationsAllVsMPro[51] = new TProfile("four5n1n5n1n","#LT#LT4#GT#GT_{5n,1n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
1951 fIntFlowCorrelationsAllVsMPro[51]->Sumw2();
1952 fIntFlowCorrelationsAllVsMPro[51]->GetXaxis()->SetTitle("M");
1953 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[51]);
1954 fIntFlowCorrelationsAllVsMPro[52] = new TProfile("five3n3n3n2n1n","#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1955 fIntFlowCorrelationsAllVsMPro[52]->Sumw2();
1956 fIntFlowCorrelationsAllVsMPro[52]->GetXaxis()->SetTitle("M");
1957 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[52]);
1958 fIntFlowCorrelationsAllVsMPro[53] = new TProfile("five4n2n3n2n1n","#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1959 fIntFlowCorrelationsAllVsMPro[53]->Sumw2();
1960 fIntFlowCorrelationsAllVsMPro[53]->GetXaxis()->SetTitle("M");
1961 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[53]);
1962 fIntFlowCorrelationsAllVsMPro[54] = new TProfile("five3n2n3n1n1n","#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1963 fIntFlowCorrelationsAllVsMPro[54]->Sumw2();
1964 fIntFlowCorrelationsAllVsMPro[54]->GetXaxis()->SetTitle("M");
1965 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[54]);
1966 fIntFlowCorrelationsAllVsMPro[55] = new TProfile("five3n2n2n2n1n","#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1967 fIntFlowCorrelationsAllVsMPro[55]->Sumw2();
1968 fIntFlowCorrelationsAllVsMPro[55]->GetXaxis()->SetTitle("M");
1969 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[55]);
1970 fIntFlowCorrelationsAllVsMPro[56] = new TProfile("five5n1n3n2n1n","#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1971 fIntFlowCorrelationsAllVsMPro[56]->Sumw2();
1972 fIntFlowCorrelationsAllVsMPro[56]->GetXaxis()->SetTitle("M");
1973 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[56]);
1974 fIntFlowCorrelationsAllVsMPro[57] = new TProfile("six3n2n1n3n2n1n","#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1975 fIntFlowCorrelationsAllVsMPro[57]->Sumw2();
1976 fIntFlowCorrelationsAllVsMPro[57]->GetXaxis()->SetTitle("M");
403e3389 1977 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[57]);
1978 fIntFlowCorrelationsAllVsMPro[58] = new TProfile("four6n4n1n1n","#LT#LT4#GT#GT_{6n|4n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1979 fIntFlowCorrelationsAllVsMPro[58]->Sumw2();
1980 fIntFlowCorrelationsAllVsMPro[58]->GetXaxis()->SetTitle("M");
1981 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[58]);
1982 fIntFlowCorrelationsAllVsMPro[59] = new TProfile("four6n2n2n2n","#LT#LT4#GT#GT_{6n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1983 fIntFlowCorrelationsAllVsMPro[59]->Sumw2();
1984 fIntFlowCorrelationsAllVsMPro[59]->GetXaxis()->SetTitle("M");
1985 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[59]);
1986 fIntFlowCorrelationsAllVsMPro[60] = new TProfile("five6n2n2n1n1n","#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1987 fIntFlowCorrelationsAllVsMPro[60]->Sumw2();
1988 fIntFlowCorrelationsAllVsMPro[60]->GetXaxis()->SetTitle("M");
1989 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[60]);
1990 fIntFlowCorrelationsAllVsMPro[61] = new TProfile("five4n1n1n3n3n","#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1991 fIntFlowCorrelationsAllVsMPro[61]->Sumw2();
1992 fIntFlowCorrelationsAllVsMPro[61]->GetXaxis()->SetTitle("M");
1993 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[61]);
1994 fIntFlowCorrelationsAllVsMPro[62] = new TProfile("six3n3n2n2n1n1n","#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1995 fIntFlowCorrelationsAllVsMPro[62]->Sumw2();
1996 fIntFlowCorrelationsAllVsMPro[62]->GetXaxis()->SetTitle("M");
1997 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[62]);
3435cacb 1998 } // end of if(fCalculateAllCorrelationsVsM)
489d5531 1999 // when particle weights are used some extra correlations appear:
403e3389 2000 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 2001 {
2002 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
2003 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
2004 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
2005 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
2006 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
2007 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
2008 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
2009 // extra 2-p correlations:
2010 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
2011 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
2012 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
403e3389 2013 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 2014 // average product of correlations <2>, <4>, <6> and <8>:
403e3389 2015 TString productFlag[6] = {"#LT#LT2#GT#LT4#GT#GT","#LT#LT2#GT#LT6#GT#GT","#LT#LT2#GT#LT8#GT#GT",
2016 "#LT#LT4#GT#LT6#GT#GT","#LT#LT4#GT#LT8#GT#GT","#LT#LT6#GT#LT8#GT#GT"};
489d5531 2017 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
2018 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
2019 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
2020 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
2021 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
2022 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
2023 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 2024 for(Int_t b=0;b<6;b++)
b3dacf6b 2025 {
68a3b4b1 2026 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
b3dacf6b 2027 }
2028 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
ff70ca91 2029 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
2030 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 2031 if(fCalculateCumulantsVsM)
2032 {
2033 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
2034 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
2035 for(Int_t pi=0;pi<6;pi++)
2036 {
2037 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
2038 Form("%s versus multiplicity",productFlag[pi].Data()),
2039 fnBinsMult,fMinMult,fMaxMult);
2040 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
2041 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
2042 } // end of for(Int_t pi=0;pi<6;pi++)
2043 } // end of if(fCalculateCumulantsVsM)
0328db2d 2044 // average product of correction terms for NUA:
2045 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
2046 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
2047 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
2048 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
2049 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
403e3389 2050 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.03);
0328db2d 2051 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
2052 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
2053 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
2054 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
2055 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
2056 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
2057 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2058 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2059 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
2060 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
2061 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
2062 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
2063 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2064 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2065 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2066 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2067 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2068 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2069 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2070 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2071 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2072 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2073 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2074 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2075 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2076 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2077 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2078 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2079 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
489d5531 2080 // average correction terms for non-uniform acceptance (with wrong errors!):
2081 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2082 {
2083 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
2084 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b92ea2b9 2085 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 2086 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
2087 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
403e3389 2088 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.05);
489d5531 2089 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
403e3389 2090 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
2091 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2092 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
2093 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
489d5531 2094 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
2001bc3a 2095 // versus multiplicity:
b3dacf6b 2096 if(fCalculateCumulantsVsM)
2097 {
2098 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
2099 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2100 {
2101 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
2102 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
2103 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");
2104 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
2105 }
2106 } // end of if(fCalculateCumulantsVsM)
489d5531 2107 } // end of for(Int_t sc=0;sc<2;sc++)
2108
2109 // d) Book histograms holding the final results:
2110 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
2111 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
2112 intFlowCorrelationsHistName += fAnalysisLabel->Data();
2113 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
2114 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
2115 fIntFlowCorrelationsHist->SetMarkerStyle(25);
2116 fIntFlowCorrelationsHist->SetLabelSize(0.06);
2117 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
403e3389 2118 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT");
2119 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"#LT#LT4#GT#GT");
2120 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"#LT#LT6#GT#GT");
2121 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"#LT#LT8#GT#GT");
489d5531 2122 fIntFlowResults->Add(fIntFlowCorrelationsHist);
ff70ca91 2123 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
b3dacf6b 2124 if(fCalculateCumulantsVsM)
2125 {
2126 for(Int_t ci=0;ci<4;ci++) // correlation index
2127 {
2128 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
2129 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
2130 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
2131 Form("%s vs multiplicity",correlationFlag[ci].Data()),
2132 fnBinsMult,fMinMult,fMaxMult);
2133 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
2134 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
2135 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
2136 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2137 } // end of if(fCalculateCumulantsVsM)
489d5531 2138 // average all correlations for all events (with correct errors!):
2139 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
2140 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
8ed4edc7 2141 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",34,0,34);
489d5531 2142 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
2143 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
2144 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
2145 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
2146 // 2-p correlations:
2147 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
2148 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
2149 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
2150 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
2151 // 3-p correlations:
2152 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
2153 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
2154 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
2155 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
2156 // 4-p correlations:
2157 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
2158 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
2159 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
2160 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
2161 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
2162 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
2163 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
2164 // 5-p correlations:
2165 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
2166 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
2167 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
2168 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
2169 // 6-p correlations:
2170 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
2171 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
2172 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
2173 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
2174 // 7-p correlations:
2175 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
2176 // 8-p correlations:
2177 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
2178 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
2179 // average correction terms for non-uniform acceptance (with correct errors!):
2180 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2181 {
2182 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
2183 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
b92ea2b9 2184 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 2185 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
2186 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
403e3389 2187 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.05);
489d5531 2188 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
b92ea2b9 2189 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
403e3389 2190 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2191 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
2192 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
489d5531 2193 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
2194 } // end of for(Int_t sc=0;sc<2;sc++)
2195 // covariances (multiplied with weight dependent prefactor):
2196 TString intFlowCovariancesName = "fIntFlowCovariances";
2197 intFlowCovariancesName += fAnalysisLabel->Data();
2198 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
2199 fIntFlowCovariances->SetLabelSize(0.04);
2200 fIntFlowCovariances->SetMarkerStyle(25);
403e3389 2201 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(#LT2#GT,#LT4#GT)");
2202 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(#LT2#GT,#LT6#GT)");
2203 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(#LT2#GT,#LT8#GT)");
2204 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(#LT4#GT,#LT6#GT)");
2205 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(#LT4#GT,#LT8#GT)");
2206 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(#LT6#GT,#LT8#GT)");
489d5531 2207 fIntFlowResults->Add(fIntFlowCovariances);
2208 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
2209 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
2210 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
2211 for(Int_t power=0;power<2;power++)
2212 {
2213 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);
403e3389 2214 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.04);
489d5531 2215 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
2216 if(power == 0)
2217 {
403e3389 2218 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}");
2219 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}");
2220 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}");
2221 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}");
489d5531 2222 } else if (power == 1)
2223 {
403e3389 2224 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}^{2}");
2225 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}^{2}");
2226 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}^{2}");
2227 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}^{2}");
489d5531 2228 }
2229 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
2230 }
2231 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
2232 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
2233 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
2234 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
403e3389 2235 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.04);
489d5531 2236 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
403e3389 2237 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT4#GT}");
2238 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT6#GT}");
2239 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT8#GT}");
2240 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT6#GT}");
2241 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT8#GT}");
2242 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{#LT6#GT} w_{#LT8#GT}");
489d5531 2243 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
ff70ca91 2244 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
2245 // [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 2246 if(fCalculateCumulantsVsM)
ff70ca91 2247 {
b3dacf6b 2248 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
2249 intFlowCovariancesVsMName += fAnalysisLabel->Data();
2250 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
2251 for(Int_t ci=0;ci<6;ci++)
2252 {
2253 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
2254 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
2255 fnBinsMult,fMinMult,fMaxMult);
2256 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
2257 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
2258 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
2259 }
2260 } // end of if(fCalculateCumulantsVsM)
ff70ca91 2261 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
2262 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
b3dacf6b 2263 if(fCalculateCumulantsVsM)
ff70ca91 2264 {
b3dacf6b 2265 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
2266 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
2267 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>}"},
2268 {"#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}"}};
2269 for(Int_t si=0;si<4;si++)
ff70ca91 2270 {
b3dacf6b 2271 for(Int_t power=0;power<2;power++)
2272 {
2273 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
2274 Form("%s vs multiplicity",sumFlag[power][si].Data()),
2275 fnBinsMult,fMinMult,fMaxMult);
2276 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
2277 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
2278 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
2279 } // end of for(Int_t power=0;power<2;power++)
2280 } // end of for(Int_t si=0;si<4;si++)
2281 } // end of if(fCalculateCumulantsVsM)
ff70ca91 2282 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
2283 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
2284 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 2285 if(fCalculateCumulantsVsM)
2286 {
2287 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
2288 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
2289 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>}",
2290 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
2291 for(Int_t pi=0;pi<6;pi++)
2292 {
2293 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
2294 Form("%s versus multiplicity",sopowFlag[pi].Data()),
2295 fnBinsMult,fMinMult,fMaxMult);
2296 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
2297 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
2298 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
2299 } // end of for(Int_t pi=0;pi<6;pi++)
2300 } // end of if(fCalculateCumulantsVsM)
0328db2d 2301 // covariances of NUA terms (multiplied with weight dependent prefactor):
2302 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
2303 intFlowCovariancesNUAName += fAnalysisLabel->Data();
2304 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
2305 fIntFlowCovariancesNUA->SetLabelSize(0.04);
2306 fIntFlowCovariancesNUA->SetMarkerStyle(25);
2307 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
2308 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
2309 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
2310 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
2311 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
2312 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
2313 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2314 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2315 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
2316 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
2317 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
2318 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
2319 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2320 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2321 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2322 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2323 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2324 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2325 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2326 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2327 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2328 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2329 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2330 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2331 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2332 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2333 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2334 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2335 fIntFlowResults->Add(fIntFlowCovariancesNUA);
2336 // sum of linear and quadratic event weights for NUA terms:
2337 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
2338 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
2339 for(Int_t sc=0;sc<2;sc++)
2340 {
2341 for(Int_t power=0;power<2;power++)
2342 {
b92ea2b9 2343 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 2344 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
2345 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
2346 if(power == 0)
2347 {
2348 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
2349 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
b92ea2b9 2350 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
2351 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
0328db2d 2352 } else if(power == 1)
2353 {
2354 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
2355 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
2356 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
b92ea2b9 2357 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
0328db2d 2358 }
2359 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
2360 }
2361 }
2362 // sum of products of event weights for NUA terms:
2363 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
2364 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
2365 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
403e3389 2366 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.02);
0328db2d 2367 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
2368 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
2369 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
2370 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
2371 // ....
2372 // to be improved - add labels for remaining bins
2373 // ....
2374 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
b3dacf6b 2375 // Final results for reference Q-cumulants:
2376 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
489d5531 2377 TString intFlowQcumulantsName = "fIntFlowQcumulants";
2378 intFlowQcumulantsName += fAnalysisLabel->Data();
b92ea2b9 2379 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
b77b6434 2380 if(fPropagateErrorAlsoFromNIT)
b92ea2b9 2381 {
b77b6434 2382 fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
b92ea2b9 2383 }
489d5531 2384 fIntFlowQcumulants->SetLabelSize(0.05);
2385 fIntFlowQcumulants->SetMarkerStyle(25);
68a3b4b1 2386 for(Int_t b=0;b<4;b++)
b3dacf6b 2387 {
68a3b4b1 2388 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2389 }
489d5531 2390 fIntFlowResults->Add(fIntFlowQcumulants);
b3dacf6b 2391 // Final results for reference Q-cumulants rebinned in M:
2392 if(fCalculateCumulantsVsM)
2393 {
2394 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
2395 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
2396 fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
2397 fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
2398 fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2399 for(Int_t b=0;b<4;b++)
b3dacf6b 2400 {
68a3b4b1 2401 (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2402 }
2403 fIntFlowResults->Add(fIntFlowQcumulantsRebinnedInM);
2404 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 2405 // Ratio between error squared: with/without non-isotropic terms:
2406 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
2407 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
2408 fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
2409 fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
2410 fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
2411 for(Int_t b=0;b<4;b++)
2412 {
2413 (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2414 }
2415 fIntFlowResults->Add(fIntFlowQcumulantsErrorSquaredRatio);
ff70ca91 2416 // final results for integrated Q-cumulants versus multiplicity:
b3dacf6b 2417 if(fCalculateCumulantsVsM)
2418 {
2419 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
2420 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2421 for(Int_t co=0;co<4;co++) // cumulant order
2422 {
2423 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2424 Form("%s vs multipicity",cumulantFlag[co].Data()),
2425 fnBinsMult,fMinMult,fMaxMult);
2426 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2427 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2428 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2429 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2430 } // end of if(fCalculateCumulantsVsM)
489d5531 2431 // final integrated flow estimates from Q-cumulants:
b3dacf6b 2432 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 2433 TString intFlowName = "fIntFlow";
2434 intFlowName += fAnalysisLabel->Data();
2435 // integrated flow from Q-cumulants:
b3dacf6b 2436 fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
489d5531 2437 fIntFlow->SetLabelSize(0.05);
2438 fIntFlow->SetMarkerStyle(25);
68a3b4b1 2439 for(Int_t b=0;b<4;b++)
b3dacf6b 2440 {
68a3b4b1 2441 (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2442 }
ff70ca91 2443 fIntFlowResults->Add(fIntFlow);
b3dacf6b 2444 // Reference flow vs M rebinned in one huge bin:
2445 if(fCalculateCumulantsVsM)
2446 {
2447 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
2448 intFlowRebinnedInMName += fAnalysisLabel->Data();
2449 fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
2450 fIntFlowRebinnedInM->SetLabelSize(0.05);
2451 fIntFlowRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2452 for(Int_t b=0;b<4;b++)
b3dacf6b 2453 {
68a3b4b1 2454 (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2455 }
2456 fIntFlowResults->Add(fIntFlowRebinnedInM);
2457 }
ff70ca91 2458 // integrated flow from Q-cumulants: versus multiplicity:
b3dacf6b 2459 if(fCalculateCumulantsVsM)
2460 {
2461 TString intFlowVsMName = "fIntFlowVsM";
2462 intFlowVsMName += fAnalysisLabel->Data();
2463 for(Int_t co=0;co<4;co++) // cumulant order
2464 {
2465 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2466 Form("%s vs multipicity",flowFlag[co].Data()),
2467 fnBinsMult,fMinMult,fMaxMult);
2468 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2469 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2470 fIntFlowResults->Add(fIntFlowVsM[co]);
2471 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2472 } // end of if(fCalculateCumulantsVsM)
2001bc3a 2473 // quantifying detector effects effects to correlations:
2474 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2475 intFlowDetectorBiasName += fAnalysisLabel->Data();
2476 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2477 fIntFlowDetectorBias->SetLabelSize(0.05);
2478 fIntFlowDetectorBias->SetMarkerStyle(25);
2479 for(Int_t ci=0;ci<4;ci++)
2480 {
2481 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2482 }
2483 fIntFlowResults->Add(fIntFlowDetectorBias);
2484 // quantifying detector effects to correlations versus multiplicity:
b3dacf6b 2485 if(fCalculateCumulantsVsM)
2001bc3a 2486 {
b3dacf6b 2487 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2488 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2489 for(Int_t ci=0;ci<4;ci++) // correlation index
2490 {
2491 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2492 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2493 fnBinsMult,fMinMult,fMaxMult);
2494 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2495 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
b77b6434 2496 fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);
b3dacf6b 2497 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2498 } // end of if(fCalculateCumulantsVsM)
1268c371 2499
489d5531 2500} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2501
489d5531 2502//================================================================================================================================
2503
489d5531 2504void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2505{
2506 // Initialize arrays of all objects relevant for calculations with nested loops.
2507
2508 // integrated flow:
2509 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2510 {
2511 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2512 }
2513
2514 // differential flow:
2515 // correlations:
2516 for(Int_t t=0;t<2;t++) // type: RP or POI
2517 {
2518 for(Int_t pe=0;pe<2;pe++) // pt or eta
2519 {
2520 for(Int_t ci=0;ci<4;ci++) // correlation index
2521 {
2522 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2523 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2524 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2525 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2526 // correction terms for non-uniform acceptance:
2527 for(Int_t t=0;t<2;t++) // type: RP or POI
2528 {
2529 for(Int_t pe=0;pe<2;pe++) // pt or eta
2530 {
2531 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2532 {
2533 for(Int_t cti=0;cti<9;cti++) // correction term index
2534 {
2535 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2536 }
2537 }
2538 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2539 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2540
64e500e3 2541 // other differential correlators:
2542 for(Int_t t=0;t<2;t++) // type: RP or POI
2543 {
2544 for(Int_t pe=0;pe<2;pe++) // pt or eta
2545 {
2546 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2547 {
2548 for(Int_t ci=0;ci<1;ci++) // correlator index
2549 {
2550 fOtherDirectDiffCorrelators[t][pe][sc][ci] = NULL;
2551 }
2552 }
2553 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2554 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
489d5531 2555
2556} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2557
489d5531 2558//================================================================================================================================
2559
489d5531 2560void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2561{
2562 // Book all objects relevant for calculations with nested loops.
2563
2564 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2565 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2566 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2567 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2568 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2569 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2570
2571 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2572 evaluateNestedLoopsName += fAnalysisLabel->Data();
2573 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2574 fEvaluateNestedLoops->SetLabelSize(0.03);
2575 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2576 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2577 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2578 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2579 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2580 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2581 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2582 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2583 fNestedLoopsList->Add(fEvaluateNestedLoops);
2584 // nested loops for integrated flow:
2585 if(fEvaluateIntFlowNestedLoops)
2586 {
2587 // correlations:
2588 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2589 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
403e3389 2590 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",64,0,64,"s");
489d5531 2591 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
403e3389 2592 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 2593 {
2594 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2595 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2596 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2597 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
403e3389 2598 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 2599 // correction terms for non-uniform acceptance:
2600 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2601 {
2602 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2603 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2604 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");
2605 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2606 } // end of for(Int_t sc=0;sc<2;sc++)
2607 } // end of if(fEvaluateIntFlowNestedLoops)
2608
2609 // nested loops for differential flow:
2610 if(fEvaluateDiffFlowNestedLoops)
2611 {
2612 // reduced correlations:
2613 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2614 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2615 for(Int_t t=0;t<2;t++) // type: RP or POI
2616 {
2617 for(Int_t pe=0;pe<2;pe++) // pt or eta
2618 {
2619 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2620 {
2621 // reduced correlations:
2622 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");
2623 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2624 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2625 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2626 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2627 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
64e500e3 2628
2629
489d5531 2630 // correction terms for non-uniform acceptance:
2631 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2632 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2633 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2634 {
2635 for(Int_t pe=0;pe<2;pe++) // pt or eta
2636 {
2637 for(Int_t sc=0;sc<2;sc++) // sin or cos
2638 {
2639 for(Int_t cti=0;cti<9;cti++) // correction term index
2640 {
2641 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");
2642 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2643 }
2644 }
2645 }
64e500e3 2646 }
2647 // other differential correlators:
2648 TString otherDirectDiffCorrelatorsName = "fOtherDirectDiffCorrelators";
2649 otherDirectDiffCorrelatorsName += fAnalysisLabel->Data();
2650 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2651 {
2652 for(Int_t pe=0;pe<2;pe++) // pt or eta
2653 {
2654 for(Int_t sc=0;sc<2;sc++) // sin or cos
2655 {
2656 for(Int_t ci=0;ci<1;ci++) // correlator index
2657 {
2658 fOtherDirectDiffCorrelators[t][pe][sc][ci] = new TProfile(Form("%s, %s, %s, %s, ci = %d",otherDirectDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),Form("%s, %s, %s, %s, ci = %d",otherDirectDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe]);
2659 fNestedLoopsList->Add(fOtherDirectDiffCorrelators[t][pe][sc][ci]);
2660 }
2661 }
2662 }
2663 }
3b552efe 2664 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2665 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2666 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
489d5531 2667 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2668 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2669 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
3b552efe 2670 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
489d5531 2671 fNestedLoopsList->Add(fNoOfParticlesInBin);
2672 } // end of if(fEvaluateDiffFlowNestedLoops)
2673
2674} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2675
489d5531 2676//================================================================================================================================
2677
489d5531 2678void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2679{
b84464d3 2680 // Calculate in this method all multiparticle azimuthal correlations.
2681 //
2682 // Remark 1: All multiparticle correlations are stored in TProfile fIntFlowCorrelationsAllPro;
2683 // Remark 2: There is a special TProfile fIntFlowCorrelationsPro holding results
2684 // only for same harmonic's correlations <<2>>, <<4>>, <<6>> and <<8>>;
2685 // Remark 3: Binning of fIntFlowCorrelationsAllPro is organized as follows:
2686 // --------------------------------------------------------------------------------------------------------------------
2687 // 1st bin: <2>_{1n|1n} = two1n1n = cos(1n(phi1-phi2))>
2688 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n(phi1-phi2))>
2689 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n(phi1-phi2))>
2690 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n(phi1-phi2))>
2691 // 5th bin: ---- EMPTY ----
2692 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n(2*phi1-phi2-phi3))>
2693 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n(3*phi1-2*phi2-phi3))>
2694 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n(4*phi1-2*phi2-2*phi3))>
2695 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n(4*phi1-3*phi2-phi3))>
2696 // 10th bin: ---- EMPTY ----
2697 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n(phi1+phi2-phi3-phi4))>
2698 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(n(2*phi1+phi2-2*phi3-phi4))>
2699 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(2n(phi1+phi2-phi3-phi4))>
2700 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n(3*phi1-phi2-phi3-phi4))>
2701 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n(3*phi1+phi2-3*phi3-phi4))>
2702 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n(3*phi1+phi2-2*phi3-2*phi4))>
2703 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n(4*phi1-2*phi2-phi3-phi4))>
2704 // 18th bin: ---- EMPTY ----
2705 // 19th bin: <5>_{2n,1n|1n,1n,1n} = five2n1n1n1n1n = <cos(n(2*phi1+phi2-phi3-phi4-phi5))>
2706 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n(2*phi1+2*phi2-2*phi3-phi4-phi5))>
2707 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n(3*phi1+phi2-2*phi3-phi4-phi5))>
2708 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n(4*phi1-phi2-phi3-phi4-phi5))>
2709 // 23rd bin: ---- EMPTY ----
2710 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n(phi1+phi2+phi3-phi4-phi5-phi6))>
2711 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n(2*phi1+phi2+phi3-2*phi4-phi5-phi6))>
2712 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n(2*phi1+2*phi2-phi3-phi4-phi5-phi6))>
2713 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n(3*phi1+phi2-phi3-phi4-phi5-phi6))>
2714 // 28th bin: ---- EMPTY ----
2715 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n(2*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2716 // 30th bin: ---- EMPTY ----
2717 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2718 // 32nd bin: ---- EMPTY ----
2719 // Extra correlations for v3{5} study:
2720 // 33rd bin: <4>_{4n,2n|3n,3n} = four4n2n3n3n = <cos(n(4*phi1+2*phi2-3*phi3-3*phi4))>
2721 // 34th bin: <5>_{3n,3n|2n,2n,2n} = five3n3n2n2n2n = <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
2722 // Extra correlations for Teaney-Yan study:
2723 // 35th bin: <2>_{5n|5n} = two5n5n = <cos(5n(phi1-phi2)>
2724 // 36th bin: <2>_{6n|6n} = two6n6n = <cos(6n(phi1-phi2)>
2725 // 37th bin: <3>_{5n|3n,2n} = three5n3n2n = <cos(n(5*phi1-3*phi2-2*phi3)>
2726 // 38th bin: <3>_{5n|4n,1n} = three5n4n1n = <cos(n(5*phi1-4*phi2-1*phi3)>
2727 // 39th bin: <3>_{6n|3n,3n} = three6n3n3n = <cos(n(6*phi1-3*phi2-3*phi3)>
2728 // 40th bin: <3>_{6n|4n,2n} = three6n4n2n = <cos(n(6*phi1-4*phi2-2*phi3)>
2729 // 41st bin: <3>_{6n|5n,1n} = three6n5n1n = <cos(n(6*phi1-5*phi2-1*phi3)>
2730 // 42nd bin: <4>_{6n|3n,2n,1n} = four6n3n2n1n = <cos(n(6*phi1-3*phi2-2*phi3-1*phi4)>
2731 // 43rd bin: <4>_{3n,2n|3n,2n} = four3n2n3n2n = <cos(n(3*phi1+2*phi2-3*phi3-2*phi4)>
2732 // 44th bin: <4>_{4n,1n|3n,2n} = four4n1n3n2n = <cos(n(4*phi1+1*phi2-3*phi3-2*phi4)>
2733 // 45th bin: <4>_{3n,3n|3n,3n} = four3n3n3n3n = <cos(3n*(phi1+phi2-phi3-phi4))>
2734 // 46th bin: <4>_{4n,2n|3n,3n} = four4n2n3n3n = <cos(n(4*phi1+2*phi2-3*phi3-3*phi4)>
2735 // 47th bin: <4>_{5n,1n|3n,3n} = four5n1n3n3n = <cos(n(5*phi1+1*phi2-3*phi3-3*phi4)>
2736 // 48th bin: <4>_{4n,2n|4n,2n} = four4n2n4n2n = <cos(n(4*phi1+2*phi2-4*phi3-2*phi4)>
2737 // 49th bin: <4>_{5n,1n|4n,2n} = four5n1n4n2n = <cos(n(5*phi1+1*phi2-4*phi3-2*phi4)>
2738 // 50th bin: <4>_{5n|3n,1n,1n} = four5n3n1n1n = <cos(n(5*phi1-3*phi2-1*phi3-1*phi4)>
2739 // 51st bin: <4>_{5n|2n,2n,1n} = four5n2n2n1n = <cos(n(5*phi1-2*phi2-2*phi3-1*phi4)>
2740 // 52nd bin: <4>_{5n,1n|5n,1n} = four5n1n5n1n = <cos(n(5*phi1+1*phi2-5*phi3-1*phi4)>
2741 // 53rd bin: <5>_{3n,3n|3n,2n,1n} = five3n3n3n2n1n = <cos(n(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
2742 // 54th bin: <5>_{4n,2n|3n,2n,1n} = five4n2n3n2n1n = <cos(n(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
2743 // 55th bin: <5>_{3n,2n|3n,1n,1n} = five3n2n3n1n1n = <cos(n(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
2744 // 56th bin: <5>_{3n,2n|2n,2n,1n} = five3n2n2n2n1n = <cos(n(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
2745 // 57th bin: <5>_{5n,1n|3n,2n,1n} = five5n1n3n2n1n = <cos(n(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
2746 // 58th bin: <6>_{3n,2n,1n|3n,2n,1n} = six3n2n1n3n2n1n = <cos(n(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
403e3389 2747 // Extra correlations for Teaney-Yan study (B):
2748 // 59th bin: <4>_{6n|4n,1n,1n} = four6n4n1n1n = <cos(n(6*phi1-4*phi2-1*phi3-1*phi4)>
2749 // 60th bin: <4>_{6n|2n,2n,2n} = four6n2n2n2n = <cos(n(6*phi1-2*phi2-2*phi3-2*phi4)>
2750 // 61st bin: <5>_{6n|2n,2n,1n,1n} = five6n2n2n1n1n = <cos(n(6*phi1-2*phi2-2*phi3-1*phi4-1*phi5)>
2751 // 62nd bin: <5>_{4n,1n,1n|3n,3n} = five4n1n1n3n3n = <cos(n(4*phi1+1*phi2+1*phi3-3*phi4-3*phi5)>
2752 // 63rd bin: <6>_{3n,3n|2n,2n,1n,1n} = six3n3n2n2n1n1n = <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-1*phi5-1*phi6)>
b84464d3 2753 // --------------------------------------------------------------------------------------------------------------------
403e3389 2754
2755 // Multiplicity of an event:
1268c371 2756 Double_t dMult = (*fSpk)(0,0);
b84464d3 2757 // Real parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n, 4n, 5n and 6n:
489d5531 2758 Double_t dReQ1n = (*fReQ)(0,0);
2759 Double_t dReQ2n = (*fReQ)(1,0);
2760 Double_t dReQ3n = (*fReQ)(2,0);
2761 Double_t dReQ4n = (*fReQ)(3,0);
b84464d3 2762 Double_t dReQ5n = (*fReQ)(4,0);
8ed4edc7 2763 Double_t dReQ6n = (*fReQ)(5,0);
b84464d3 2764 // Imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n, 4n, 5n and 6n:
489d5531 2765 Double_t dImQ1n = (*fImQ)(0,0);
2766 Double_t dImQ2n = (*fImQ)(1,0);
2767 Double_t dImQ3n = (*fImQ)(2,0);
2768 Double_t dImQ4n = (*fImQ)(3,0);
b84464d3 2769 Double_t dImQ5n = (*fImQ)(4,0);
8ed4edc7 2770 Double_t dImQ6n = (*fImQ)(5,0);
489d5531 2771
b84464d3 2772 // Real parts of expressions involving various combinations of Q-vectors which appears
2773 // simultaneously in several equations for multiparticle correlations bellow:
2774 // Re[Q_{2n}Q_{n}^*Q_{n}^*]
2775 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dReQ2n;
2776 // Re[Q_{6n}Q_{3n}^*Q_{3n}^*]
2777 Double_t reQ6nQ3nstarQ3nstar = pow(dReQ3n,2.)*dReQ6n+2.*dReQ3n*dImQ3n*dImQ6n-pow(dImQ3n,2.)*dReQ6n;
2778 // Re[Q_{4n}Q_{2n}^*Q_{2n}^*]
489d5531 2779 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
b84464d3 2780 // Re[Q_{4n}Q_{3n}^*Q_{n}^*]
489d5531 2781 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
b84464d3 2782 // Re[Q_{3n}Q_{2n}^*Q_{n}^*]
489d5531 2783 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
b84464d3 2784 + dImQ3n*dImQ2n*dReQ1n;
2785 // Re[Q_{5n}Q_{3n}^*Q_{2n}^*]
2786 Double_t reQ5nQ3nstarQ2nstar = dReQ5n*dReQ2n*dReQ3n-dReQ5n*dImQ2n*dImQ3n+dImQ5n*dReQ2n*dImQ3n
2787 + dImQ5n*dImQ2n*dReQ3n;
2788 // Re[Q_{5n}Q_{4n}^*Q_{1n}^*]
2789 Double_t reQ5nQ4nstarQ1nstar = dReQ5n*dReQ4n*dReQ1n-dReQ5n*dImQ4n*dImQ1n+dImQ5n*dReQ4n*dImQ1n
2790 + dImQ5n*dImQ4n*dReQ1n;
2791 // Re[Q_{6n}Q_{5n}^*Q_{1n}^*]
2792 Double_t reQ6nQ5nstarQ1nstar = dReQ6n*dReQ5n*dReQ1n-dReQ6n*dImQ5n*dImQ1n+dImQ6n*dReQ5n*dImQ1n
2793 + dImQ6n*dImQ5n*dReQ1n;
2794 // Re[Q_{6n}Q_{4n}^*Q_{2n}^*]
2795 Double_t reQ6nQ4nstarQ2nstar = dReQ6n*dReQ4n*dReQ2n-dReQ6n*dImQ4n*dImQ2n+dImQ6n*dReQ4n*dImQ2n
2796 + dImQ6n*dImQ4n*dReQ2n;
2797 // Re[Q_{3n}Q_{n}Q_{2n}^*Q_{2n}^*]
2798 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2799 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2800 // Re[Q_{3n}Q_{n}^*Q_{n}^*Q_{n}^*]
489d5531 2801 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2802 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
403e3389 2803 // Re[Q_{6n}Q_{2n}^*Q_{2n}^*Q_{2n}^*]
2804 Double_t reQ6nQ2nstarQ2nstarQ2nstar = dReQ6n*pow(dReQ2n,3)-3.*dReQ2n*dReQ6n*pow(dImQ2n,2)
2805 + 3.*dImQ2n*dImQ6n*pow(dReQ2n,2)-dImQ6n*pow(dImQ2n,3);
b84464d3 2806 // Re[Q_{4n}Q_{2n}^*Q_{n}^*Q_{n}^*]
2807 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2808 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2809 // Re[Q_{4n}Q_{2n}^*Q_{3n}^*Q_{3n}^*]
2810 Double_t reQ4nQ2nQ3nstarQ3nstar = (dReQ4n*dReQ2n-dImQ4n*dImQ2n)*(dReQ3n*dReQ3n-dImQ3n*dImQ3n)
2811 + 2.*(dReQ4n*dImQ2n+dImQ4n*dReQ2n)*dReQ3n*dImQ3n;
2812 // Re[Q_{4n}Q_{n}Q_{3n}^*Q_{2n}^*]
2813 Double_t reQ4nQ1nQ3nstarQ2nstar = dImQ1n*dImQ2n*dImQ3n*dImQ4n+dImQ3n*dImQ4n*dReQ1n*dReQ2n
2814 + dImQ2n*dImQ4n*dReQ1n*dReQ3n-dImQ1n*dImQ4n*dReQ2n*dReQ3n
2815 - dImQ2n*dImQ3n*dReQ1n*dReQ4n+dImQ1n*dImQ3n*dReQ2n*dReQ4n
2816 + dImQ1n*dImQ2n*dReQ3n*dReQ4n+dReQ1n*dReQ2n*dReQ3n*dReQ4n;
2817 // Re[Q_{5n}Q_{n}Q_{4n}^*Q_{2n}^*]
2818 Double_t reQ5nQ1nQ4nstarQ2nstar = dImQ1n*dImQ2n*dImQ4n*dImQ5n+dImQ4n*dImQ5n*dReQ1n*dReQ2n
2819 + dImQ2n*dImQ5n*dReQ1n*dReQ4n-dImQ1n*dImQ5n*dReQ2n*dReQ4n
2820 - dImQ2n*dImQ4n*dReQ1n*dReQ5n+dImQ1n*dImQ4n*dReQ2n*dReQ5n
2821 + dImQ1n*dImQ2n*dReQ4n*dReQ5n+dReQ1n*dReQ2n*dReQ4n*dReQ5n;
2822 // Re[Q_{5n}Q_{n}Q_{3n}^*Q_{3n}^*]
2823 Double_t reQ5nQ1nQ3nstarQ3nstar = dImQ1n*pow(dImQ3n,2.)*dImQ5n+2.*dImQ3n*dImQ5n*dReQ1n*dReQ3n
2824 - dImQ1n*dImQ5n*pow(dReQ3n,2.)-pow(dImQ3n,2.)*dReQ1n*dReQ5n
2825 + 2.*dImQ1n*dImQ3n*dReQ3n*dReQ5n+dReQ1n*pow(dReQ3n,2.)*dReQ5n;
2826 // Re[Q_{5n}Q_{3n}^*Q_{n}^*Q_{n}^*]
2827 Double_t reQ5nQ3nstarQ1nstarQ1nstar = -pow(dImQ1n,2.)*dImQ3n*dImQ5n+dImQ3n*dImQ5n*pow(dReQ1n,2.)
2828 + 2.*dImQ1n*dImQ5n*dReQ1n*dReQ3n-2.*dImQ1n*dImQ3n*dReQ1n*dReQ5n
2829 - pow(dImQ1n,2.)*dReQ3n*dReQ5n+pow(dReQ1n,2.)*dReQ3n*dReQ5n;
2830 // Re[Q_{5n}Q_{2n}^*Q_{2n}^*Q_{n}^*]
2831 Double_t reQ5nQ2nstarQ2nstarQ1nstar = -pow(dImQ2n,2.)*dImQ1n*dImQ5n+dImQ1n*dImQ5n*pow(dReQ2n,2.)
2832 + 2.*dImQ2n*dImQ5n*dReQ2n*dReQ1n-2.*dImQ2n*dImQ1n*dReQ2n*dReQ5n
403e3389 2833 - pow(dImQ2n,2.)*dReQ1n*dReQ5n+pow(dReQ2n,2.)*dReQ1n*dReQ5n;
2834 // Re[Q_{6n}Q_{4n}^*Q_{n}^*Q_{n}^*]
2835 Double_t reQ6nQ4nstarQ1nstarQ1nstar = -pow(dImQ1n,2.)*dImQ4n*dImQ6n+dImQ4n*dImQ6n*pow(dReQ1n,2.)
2836 + 2.*dImQ1n*dImQ6n*dReQ1n*dReQ4n-2.*dImQ1n*dImQ4n*dReQ1n*dReQ6n
2837 - pow(dImQ1n,2.)*dReQ4n*dReQ6n+pow(dReQ1n,2.)*dReQ4n*dReQ6n;
489d5531 2838 // |Q_{2n}|^2 |Q_{n}|^2
2839 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
b84464d3 2840 // |Q_{4n}|^2 |Q_{2n}|^2
2841 Double_t dQ4nQ2nQ4nstarQ2nstar = (pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.));
2842 // |Q_{3n}|^2 |Q_{2n}|^2
2843 Double_t dQ3nQ2nQ3nstarQ2nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.));
2844 // |Q_{5n}|^2 |Q_{n}|^2
2845 Double_t dQ5nQ1nQ5nstarQ1nstar = (pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2846 // Re[Q_{2n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*]
489d5531 2847 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
b84464d3 2848 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2849 // Re[Q_{2n}Q_{2n}Q_{2n}^*Q_{n}^*Q_{n}^*]
489d5531 2850 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2851 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
b84464d3 2852 // Re[Q_{4n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
489d5531 2853 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2854 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2855 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
b84464d3 2856 // Re[Q_{3n}Q_{n}Q_{2n}^*Q_{n}^*Q_{n}^*]
489d5531 2857 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
b84464d3 2858 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n
2859 + dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2860 // Re[Q_{6n}Q_{n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2861 Double_t reQ6nQ3nstarQ2nstarQ1nstar = dReQ1n*dReQ2n*dReQ3n*dReQ6n-dReQ3n*dReQ6n*dImQ1n*dImQ2n
2862 - dReQ2n*dReQ6n*dImQ1n*dImQ3n-dReQ1n*dReQ6n*dImQ2n*dImQ3n
2863 + dReQ2n*dReQ3n*dImQ1n*dImQ6n+dReQ1n*dReQ3n*dImQ2n*dImQ6n
2864 + dReQ1n*dReQ2n*dImQ3n*dImQ6n-dImQ1n*dImQ2n*dImQ3n*dImQ6n;
2865 // Re[Q_{3n}Q_{3n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2866 Double_t reQ3nQ3nQ3nstarQ2nstarQ1nstar = (pow(dImQ3n,2.)+pow(dReQ3n,2.))
2867 * (dImQ2n*dImQ3n*dReQ1n+dImQ1n*dImQ3n*dReQ2n
2868 - dImQ1n*dImQ2n*dReQ3n+dReQ1n*dReQ2n*dReQ3n);
2869 // Re[Q_{3n}Q_{3n}Q_{2n}^*Q_{2n}^*Q_{2n}^*]
2870 Double_t reQ3nQ3nQ2nstarQ2nstarQ2nstar = pow(dReQ2n,3.)*pow(dReQ3n,2.)
2871 - 3.*dReQ2n*pow(dReQ3n,2.)*pow(dImQ2n,2.)
2872 + 6.*pow(dReQ2n,2.)*dReQ3n*dImQ2n*dImQ3n
2873 - 2.*dReQ3n*pow(dImQ2n,3.)*dImQ3n-pow(dReQ2n,3.)*pow(dImQ3n,2.)
2874 + 3.*dReQ2n*pow(dImQ2n,2.)*pow(dImQ3n,2.);
2875 // Re[Q_{4n}Q_{2n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2876 Double_t reQ4nQ2nQ3nstarQ2nstarQ1nstar = (pow(dImQ2n,2.)+pow(dReQ2n,2.))
2877 * (dImQ3n*dImQ4n*dReQ1n+dImQ1n*dImQ4n*dReQ3n
2878 - dImQ1n*dImQ3n*dReQ4n+dReQ1n*dReQ3n*dReQ4n);
2879 // Re[Q_{3n}Q_{2n}Q_{3n}^*Q_{n}^*Q_{n}^*]
2880 Double_t reQ3nQ2nQ3nstarQ1nstarQ1nstar = -(pow(dImQ3n,2.)+pow(dReQ3n,2.))
2881 * (-2.*dImQ1n*dImQ2n*dReQ1n+pow(dImQ1n,2.)*dReQ2n-pow(dReQ1n,2.)*dReQ2n);
2882 // Re[Q_{3n}Q_{2n}Q_{2n}^*Q_{2n}^*Q_{n}^*]
2883 Double_t reQ3nQ2nQ2nstarQ2nstarQ1nstar = (pow(dImQ2n,2.)+pow(dReQ2n,2.))
2884 * (dImQ2n*dImQ3n*dReQ1n+dImQ1n*dImQ3n*dReQ2n
2885 - dImQ1n*dImQ2n*dReQ3n+dReQ1n*dReQ2n*dReQ3n);
2886 // Re[Q_{5n}Q_{n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2887 Double_t reQ5nQ1nQ3nstarQ2nstarQ1nstar = (pow(dImQ1n,2.)+pow(dReQ1n,2.))
2888 * (dImQ3n*dImQ5n*dReQ2n+dImQ2n*dImQ5n*dReQ3n
2889 - dImQ2n*dImQ3n*dReQ5n+dReQ2n*dReQ3n*dReQ5n);
2890 // Re[Q_{2n}Q_{2n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
489d5531 2891 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2892 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2893 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
b84464d3 2894 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2895 // Re[Q_{3n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
489d5531 2896 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2897 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2898 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
489d5531 2899 // |Q_{2n}|^2 |Q_{n}|^4
b84464d3 2900 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2901 // |Q_{3n}|^2 |Q_{2n}|^2 |Q_{n}|^2
2902 Double_t dQ3nQ2nQ1nQ3nstarQ2nstarQ1nstar = (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2903 * (pow(dReQ1n,2.)+pow(dImQ1n,2.));
2904 // Re[Q_{2n}Q_{n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
489d5531 2905 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2906 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2907 + 2.*dReQ1n*dImQ1n*dImQ2n);
489d5531 2908
b84464d3 2909 // Results for multiparticle azimuthal correlations:
489d5531 2910 // 2-particle:
b84464d3 2911 Double_t two1n1n = 0.; // <cos(n(phi1-phi2))>
2912 Double_t two2n2n = 0.; // <cos(2n(phi1-phi2))>
2913 Double_t two3n3n = 0.; // <cos(3n(phi1-phi2))>
2914 Double_t two4n4n = 0.; // <cos(4n(phi1-phi2))>
489d5531 2915 if(dMult>1)
2916 {
2917 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2918 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2919 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2920 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
b84464d3 2921 // Average 2-particle correlations for single event:
489d5531 2922 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2923 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2924 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
b84464d3 2925 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2926 // Average 2-particle correlations for all events:
2927 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2928 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2929 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2930 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2931 // Store separetately <2>:
2932 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2933 // Testing other multiplicity weights:
489d5531 2934 Double_t mWeight2p = 0.;
2935 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2936 {
2937 mWeight2p = dMult*(dMult-1.);
2938 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2939 {
2940 mWeight2p = 1.;
2941 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2942 {
2943 mWeight2p = dMult;
b84464d3 2944 }
489d5531 2945 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2946 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
b40a910e 2947 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1n*two1n1n,mWeight2p);
2948 if(fCalculateCumulantsVsM)
2949 {
2950 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2951 fIntFlowSquaredCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n*two1n1n,mWeight2p);
2952 }
3435cacb 2953 if(fCalculateAllCorrelationsVsM)
2954 {
2955 fIntFlowCorrelationsAllVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2956 fIntFlowCorrelationsAllVsMPro[1]->Fill(dMult+0.5,two2n2n,mWeight2p);
2957 fIntFlowCorrelationsAllVsMPro[2]->Fill(dMult+0.5,two3n3n,mWeight2p);
2958 fIntFlowCorrelationsAllVsMPro[3]->Fill(dMult+0.5,two4n4n,mWeight2p);
2959 }
489d5531 2960 } // end of if(dMult>1)
2961
2962 // 3-particle:
b84464d3 2963 Double_t three2n1n1n = 0.; // <cos(n(2*phi1-phi2-phi3))>
2964 Double_t three3n2n1n = 0.; // <cos(n(3*phi1-2*phi2-phi3))>
2965 Double_t three4n2n2n = 0.; // <cos(n(4*phi1-2*phi2-2*phi3))>
2966 Double_t three4n3n1n = 0.; // <cos(n(4*phi1-3*phi2-phi3))>
489d5531 2967 if(dMult>2)
2968 {
2969 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2970 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2971 / (dMult*(dMult-1.)*(dMult-2.));
2972 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2973 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2974 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2975 / (dMult*(dMult-1.)*(dMult-2.));
2976 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2977 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2978 / (dMult*(dMult-1.)*(dMult-2.));
2979 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2980 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2981 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
b84464d3 2982 / (dMult*(dMult-1.)*(dMult-2.));
2983 // Average 3-particle correlations for single event:
489d5531 2984 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2985 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2986 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2987 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
b84464d3 2988 // Average 3-particle correlations for all events:
489d5531 2989 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2990 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2991 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
3435cacb 2992 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
b84464d3 2993 // Average 3-particle correlations vs M for all events:
3435cacb 2994 if(fCalculateAllCorrelationsVsM)
2995 {
2996 fIntFlowCorrelationsAllVsMPro[5]->Fill(dMult+0.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2997 fIntFlowCorrelationsAllVsMPro[6]->Fill(dMult+0.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2998 fIntFlowCorrelationsAllVsMPro[7]->Fill(dMult+0.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2999 fIntFlowCorrelationsAllVsMPro[8]->Fill(dMult+0.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
3000 }
489d5531 3001 } // end of if(dMult>2)
3002
3003 // 4-particle:
b84464d3 3004 Double_t four1n1n1n1n = 0.; // <cos(n(phi1+phi2-phi3-phi4))>
3005 Double_t four2n2n2n2n = 0.; // <cos(2n(phi1+phi2-phi3-phi4))>
3006 Double_t four2n1n2n1n = 0.; // <cos(n(2*phi1+phi2-2*phi3-phi4))>
3007 Double_t four3n1n1n1n = 0.; // <cos(n(3*phi1-phi2-phi3-phi4))>
3008 Double_t four4n2n1n1n = 0.; // <cos(n(4*phi1-2*phi2-phi3-phi4))>
3009 Double_t four3n1n2n2n = 0.; // <cos(n(3*phi1+phi2-2*phi3-2*phi4))>
3010 Double_t four3n1n3n1n = 0.; // <cos(n(3*phi1+phi2-3*phi3-phi4))>
489d5531 3011 if(dMult>3)
3012 {
3013 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
3014 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
3015 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3016 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
3017 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
3018 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3019 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
3020 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3021 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3022 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
3023 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3024 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3025 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar
3026 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
489d5531 3027 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3028 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3029 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
3030 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3031 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3032 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3033 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3034 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3035 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
489d5531 3036 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
b84464d3 3037 - (2.*reQ2nQ1nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
489d5531 3038 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3039 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3040 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3041 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
b84464d3 3042 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
3043 + pow(dReQ4n,2.)+pow(dImQ4n,2.)-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3044 + pow(dReQ2n,2.)+pow(dImQ2n,2.)-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3045 + dMult*(dMult-6.))
3046 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3047 // Average 4-particle correlations for single event:
489d5531 3048 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
3049 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
3050 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
3051 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
3052 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
3053 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
b84464d3 3054 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
3055 // Average 4-particle correlations for all events:
489d5531 3056 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3057 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3058 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3059 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3060 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3061 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3062 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3063 // Average 4-particle correlations vs M for all events:
3435cacb 3064 if(fCalculateAllCorrelationsVsM)
3065 {
3066 fIntFlowCorrelationsAllVsMPro[10]->Fill(dMult+0.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3067 fIntFlowCorrelationsAllVsMPro[11]->Fill(dMult+0.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3068 fIntFlowCorrelationsAllVsMPro[12]->Fill(dMult+0.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3069 fIntFlowCorrelationsAllVsMPro[13]->Fill(dMult+0.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3070 fIntFlowCorrelationsAllVsMPro[14]->Fill(dMult+0.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3071 fIntFlowCorrelationsAllVsMPro[15]->Fill(dMult+0.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3072 fIntFlowCorrelationsAllVsMPro[16]->Fill(dMult+0.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3073 }
3074 // Store separetately <4>:
489d5531 3075 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
b84464d3 3076 // Testing other multiplicity weights:
489d5531 3077 Double_t mWeight4p = 0.;
3078 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3079 {
3080 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
3081 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3082 {
3083 mWeight4p = 1.;
3084 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3085 {
3086 mWeight4p = dMult;
b84464d3 3087 }
489d5531 3088 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
3089 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
b40a910e 3090 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
3091 if(fCalculateCumulantsVsM)
3092 {
3093 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
3094 fIntFlowSquaredCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
3095 }
489d5531 3096 } // end of if(dMult>3)
3097
3098 // 5-particle:
b84464d3 3099 Double_t five2n1n1n1n1n = 0.; // <cos(n(2*phi1+phi2-phi3-phi4-phi5))>
3100 Double_t five2n2n2n1n1n = 0.; // <cos(n(2*phi1+2*phi2-2*phi3-phi4-phi5))>
3101 Double_t five3n1n2n1n1n = 0.; // <cos(n(3*phi1+phi2-2*phi3-phi4-phi5))>
3102 Double_t five4n1n1n1n1n = 0.; // <cos(n(4*phi1-phi2-phi3-phi4-phi5))>
489d5531 3103 if(dMult>4)
b84464d3 3104 {
3105 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+5.*reQ3nQ2nstarQ1nstar
3106 - 3.*(dMult-5.)*reQ2nQ1nstarQ1nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3107 - 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3108 + 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3109 - 3.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3110 + 6.*(2.*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult*(dMult-4.))
489d5531 3111 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
b84464d3 3112 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ3nQ1nQ2nstarQ2nstar
3113 + 3.*reQ4nQ2nstarQ2nstar+8.*reQ3nQ2nstarQ1nstar+2.*reQ4nQ3nstarQ1nstar
3114 - 2.*(dMult-6.)*reQ2nQ1nstarQ1nstar
3115 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3116 - pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
3117 + 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3118 - 4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3119 + 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
489d5531 3120 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
b84464d3 3121 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar
3122 + 8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar
3123 - 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3124 - 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+24.*dMult)
3125 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3126 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar
3127 - reQ3nQ1nQ2nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar+reQ4nQ2nstarQ2nstar
3128 - (2.*dMult-13.)*reQ3nQ2nstarQ1nstar+7.*reQ2nQ1nstarQ1nstar
3129 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3130 + 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3131 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3132 + 2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
489d5531 3133 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3134 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
b84464d3 3135 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3136 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3137 // Average 5-particle correlations for single event:
489d5531 3138 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
3139 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
3140 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
b84464d3 3141 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
3142 // Average 5-particle correlations for all events:
489d5531 3143 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3144 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3145 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
b84464d3 3146 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3147 // Average 5-particle correlations vs M for all events:
3435cacb 3148 if(fCalculateAllCorrelationsVsM)
3149 {
3150 fIntFlowCorrelationsAllVsMPro[18]->Fill(dMult+0.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3151 fIntFlowCorrelationsAllVsMPro[19]->Fill(dMult+0.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3152 fIntFlowCorrelationsAllVsMPro[20]->Fill(dMult+0.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3153 fIntFlowCorrelationsAllVsMPro[21]->Fill(dMult+0.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3154 }
489d5531 3155 } // end of if(dMult>4)
3156
3157 // 6-particle:
b84464d3 3158 Double_t six1n1n1n1n1n1n = 0.; // <cos(n(phi1+phi2+phi3-phi4-phi5-phi6))>
3159 Double_t six2n2n1n1n1n1n = 0.; // <cos(n(2*phi1+2*phi2-phi3-phi4-phi5-phi6))>
3160 Double_t six3n1n1n1n1n1n = 0.; // <cos(n(3*phi1+phi2-phi3-phi4-phi5-phi6))>
3161 Double_t six2n1n1n2n1n1n = 0.; // <cos(n(2*phi1+phi2+phi3-2*phi4-phi5-phi6))>
489d5531 3162 if(dMult>5)
3163 {
b84464d3 3164 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3165 + 4.*reQ3nQ1nstarQ1nstarQ1nstar-12.*reQ3nQ2nstarQ1nstar+18.*(dMult-4.)*reQ2nQ1nstarQ1nstar
3166 + 9.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3167 + 4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))-9.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3168 - 9.*(dMult-4.)*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3169 + 18.*(dMult*dMult-7.*dMult+10.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3170 - 6.*dMult*(dMult*dMult-9.*dMult+20.))
3171 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3172 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3173 - 4.*reQ2nQ1nQ1nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ2nstarQ1nstarQ1nstar
3174 + 4.*reQ4nQ2nstarQ1nstarQ1nstar+4.*reQ3nQ1nQ2nstarQ2nstar+4.*reQ3nQ1nstarQ1nstarQ1nstar
3175 - 8.*reQ4nQ3nstarQ1nstar-4.*reQ4nQ2nstarQ2nstar+4.*(2.*dMult-13.)*reQ3nQ2nstarQ1nstar
3176 + 2.*(7.*dMult-34.)*reQ2nQ1nstarQ1nstar+4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3177 - 4.*(dMult-7.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3178 + 4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-4.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3179 + pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+(2.*dMult*dMult-27.*dMult+76.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3180 - (dMult-12.)*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3181 + 4.*(dMult*dMult-15.*dMult+34.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3182 - 2.*dMult*(dMult*dMult-17.*dMult+60.))
3183 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3184 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ1nstarQ1nstarQ1nstarQ1nstar
3185 - 8.*reQ2nQ1nQ1nstarQ1nstarQ1nstar+8.*reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ4nQ2nstarQ1nstarQ1nstar
3186 + 8.*reQ3nQ1nQ2nstarQ2nstar-40.*reQ3nQ2nstarQ1nstar-8.*reQ4nQ3nstarQ1nstar-9.*reQ4nQ2nstarQ2nstar
3187 + 24.*(dMult-4.)*reQ2nQ1nstarQ1nstar+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3188 + 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+16.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3189 + 3.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-12.*(2.*dMult-7.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3190 + 12.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-48.*(dMult-3.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3191 + 24.*dMult*(dMult-5.))
3192 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3193 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ3nQ1nQ2nstarQ1nstarQ1nstar+6.*reQ4nQ2nstarQ1nstarQ1nstar
3194 - reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-4.*reQ2nQ1nQ1nstarQ1nstarQ1nstar+3.*reQ3nQ1nQ2nstarQ2nstar
3195 - 4.*(dMult-5.)*reQ3nQ1nstarQ1nstarQ1nstar-14.*reQ4nQ3nstarQ1nstar
3196 - 3.*reQ4nQ2nstarQ2nstar+4.*(3.*dMult-17.)*reQ3nQ2nstarQ1nstar+12.*(dMult-6.)*reQ2nQ1nstarQ1nstar
3197 + 12.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3198 + 8.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3199 + 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-8.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3200 - 12.*(dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-48.*(dMult-3.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3201 + 12.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+24.*dMult*(dMult-5.))
3202 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3203 // Average 6-particle correlations for single event:
489d5531 3204 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
3205 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
3206 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
3207 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
b84464d3 3208 // Average 6-particle correlations for all events:
489d5531 3209 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3210 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3211 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3212 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
b84464d3 3213 // Average 6-particle correlations vs M for all events:
3435cacb 3214 if(fCalculateAllCorrelationsVsM)
3215 {
3216 fIntFlowCorrelationsAllVsMPro[23]->Fill(dMult+0.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3217 fIntFlowCorrelationsAllVsMPro[24]->Fill(dMult+0.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3218 fIntFlowCorrelationsAllVsMPro[25]->Fill(dMult+0.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3219 fIntFlowCorrelationsAllVsMPro[26]->Fill(dMult+0.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3220 }
b84464d3 3221 // Store separetately <6>:
489d5531 3222 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
b84464d3 3223 // Testing other multiplicity weights:
489d5531 3224 Double_t mWeight6p = 0.;
3225 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3226 {
3227 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
3228 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3229 {
3230 mWeight6p = 1.;
3231 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3232 {
3233 mWeight6p = dMult;
3234 }
489d5531 3235 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
3236 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
b40a910e 3237 fIntFlowSquaredCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
3238 if(fCalculateCumulantsVsM)
3239 {
3240 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
3241 fIntFlowSquaredCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
3242 }
489d5531 3243 } // end of if(dMult>5)
3244
3245 // 7-particle:
b84464d3 3246 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n(2*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
489d5531 3247 if(dMult>6)
3248 {
b84464d3 3249 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-4.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)
3250 - reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-2.*reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar
3251 + 9.*reQ2nQ2nQ2nstarQ1nstarQ1nstar+20.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3252 + 2.*reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-8.*(dMult-8.)*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3253 - 18.*reQ4nQ2nstarQ1nstarQ1nstar-14.*reQ3nQ1nQ2nstarQ2nstar
3254 + 8.*(dMult-7.)*reQ3nQ1nstarQ1nstarQ1nstar+28.*reQ4nQ3nstarQ1nstar
3255 + 12.*reQ4nQ2nstarQ2nstar-8.*(5.*dMult-31.)*reQ3nQ2nstarQ1nstar
3256 + 12.*(dMult*dMult-15.*dMult+46.)*reQ2nQ1nstarQ1nstar
3257 - 16.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3258 - 6.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3259 - 3.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
3260 + 12.*(2.*dMult-13.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3261 - 12.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+16.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3262 - 12.*(dMult-8.)*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3263 + 12.*(3.*dMult-14.)*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)
3264 - 24.*(3.*dMult-7.)*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3265 + 24.*dMult*(dMult-5.)*(dMult-6.))
3266 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
3267 // Average 7-particle correlations for single event:
3268 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
3269 // Average 7-particle correlations for all events:
3270 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3271 *(dMult-4.)*(dMult-5.)*(dMult-6.));
3272 // Average 7-particle correlations vs M for all events:
3435cacb 3273 if(fCalculateAllCorrelationsVsM)
3274 {
b84464d3 3275 fIntFlowCorrelationsAllVsMPro[28]->Fill(dMult+0.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3276 *(dMult-4.)*(dMult-5.)*(dMult-6.));
3435cacb 3277 }
489d5531 3278 } // end of if(dMult>6)
3279
3280 // 8-particle:
b84464d3 3281 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
489d5531 3282 if(dMult>7)
b84464d3 3283 {
3284 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-12.*reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar
3285 + 16.*reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar+6.*reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar
3286 - 12.*reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-36.*reQ2nQ2nQ2nstarQ1nstarQ1nstar
3287 - 96.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3288 + 72.*reQ4nQ2nstarQ1nstarQ1nstar+48.*reQ3nQ1nQ2nstarQ2nstar
3289 - 64.*(dMult-6.)*reQ3nQ1nstarQ1nstarQ1nstar
3290 + 96.*(dMult-6.)*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3291 - 96.*reQ4nQ3nstarQ1nstar-36.*reQ4nQ2nstarQ2nstar
3292 + 192.*(dMult-6.)*reQ3nQ2nstarQ1nstar
3293 - 144.*(dMult-7.)*(dMult-4.)*reQ2nQ1nstarQ1nstar
3294 + 64.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3295 - 144.*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3296 + 72.*(dMult-7.)*(dMult-4.)*(pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)+pow(dReQ2n,2.)+pow(dImQ2n,2.))
3297 - 96.*(dMult-7.)*(dMult-6.)*(dMult-2.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3298 + 36.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3299 + 9.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
3300 - 64.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3301 + 36.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3302 - 16.*(dMult-6.)*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)
3303 + 24.*dMult*(dMult-7.)*(dMult-6.)*(dMult-5.))
3304 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3305 // Average 8-particle correlations for single event:
3306 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
3307 // Average 8-particle correlations for all events:
3308 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3309 *(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3310 // Average 8-particle correlations vs M for all events:
3435cacb 3311 if(fCalculateAllCorrelationsVsM)
3312 {
b84464d3 3313 fIntFlowCorrelationsAllVsMPro[30]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3314 *(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3315 }
3316 // Store separetately <8>:
489d5531 3317 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
b84464d3 3318 // Testing other multiplicity weights:
489d5531 3319 Double_t mWeight8p = 0.;
3320 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3321 {
3322 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
3323 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3324 {
3325 mWeight8p = 1.;
3326 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3327 {
3328 mWeight8p = dMult;
b84464d3 3329 }
489d5531 3330 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
b40a910e 3331 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
3332 fIntFlowSquaredCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
3333 if(fCalculateCumulantsVsM)
3334 {
3335 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
3336 fIntFlowSquaredCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
3337 }
489d5531 3338 } // end of if(dMult>7)
3339
b84464d3 3340 // EXTRA correlations for v3{5} study:
8ed4edc7 3341 // 4-particle:
b84464d3 3342 Double_t four4n2n3n3n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-3*phi4))>
8ed4edc7 3343 if(dMult>3.)
3344 {
11d3e40e 3345 four4n2n3n3n = (reQ4nQ2nQ3nstarQ3nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar
3346 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
3347 + (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3348 + 2.*(2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3349 + (pow(dReQ1n,2.)+pow(dImQ1n,2.))-3.*dMult))
b84464d3 3350 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
8ed4edc7 3351 fIntFlowCorrelationsAllPro->Fill(32.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3352 // Average 4-particle correlations vs M for all events:
3435cacb 3353 if(fCalculateAllCorrelationsVsM)
3354 {
3355 fIntFlowCorrelationsAllVsMPro[32]->Fill(dMult+0.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3356 }
11d3e40e 3357 } // end of if(dMult>3.)
8ed4edc7 3358
3359 // 5-particle:
b84464d3 3360 Double_t five3n3n2n2n2n = 0.; // <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
8ed4edc7 3361 if(dMult>4.)
3362 {
b84464d3 3363 five3n3n2n2n2n = (reQ3nQ3nQ2nstarQ2nstarQ2nstar-reQ6nQ2nstarQ2nstarQ2nstar-3.*reQ4nQ2nQ3nstarQ3nstar
3364 - 6.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ6nQ3nstarQ3nstar+3.*reQ6nQ4nstarQ2nstar
3365 + 6.*reQ4nQ3nstarQ1nstar+6.*reQ4nQ2nstarQ2nstar
3366 + 12.*reQ3nQ2nstarQ1nstar+6.*reQ2nQ1nstarQ1nstar
11d3e40e 3367 - 2.*((pow(dReQ6n,2.)+pow(dImQ6n,2.))
3368 + 3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3369 + 6.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3370 + 9.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3371 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-12.*dMult))
b84464d3 3372 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3373 fIntFlowCorrelationsAllPro->Fill(33.5,five3n3n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3435cacb 3374 if(fCalculateAllCorrelationsVsM)
3375 {
b84464d3 3376 fIntFlowCorrelationsAllVsMPro[33]->Fill(dMult+0.5,five3n3n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3435cacb 3377 }
11d3e40e 3378 } // end of if(dMult>4.)
8ed4edc7 3379
b84464d3 3380 // EXTRA correlations for Teaney-Yan study:
3381 // 2-particle:
3382 Double_t two5n5n = 0.; // <cos(5n(phi1-phi2))>
3383 Double_t two6n6n = 0.; // <cos(6n(phi1-phi2))>
3384 if(dMult>1)
3385 {
3386 two5n5n = (pow(dReQ5n,2.)+pow(dImQ5n,2.)-dMult)/(dMult*(dMult-1.));
3387 two6n6n = (pow(dReQ6n,2.)+pow(dImQ6n,2.)-dMult)/(dMult*(dMult-1.));
3388 // Average 2-particle correlations for all events:
3389 fIntFlowCorrelationsAllPro->Fill(34.5,two5n5n,dMult*(dMult-1.));
3390 fIntFlowCorrelationsAllPro->Fill(35.5,two6n6n,dMult*(dMult-1.));
3391 if(fCalculateAllCorrelationsVsM)
3392 {
3393 fIntFlowCorrelationsAllVsMPro[34]->Fill(dMult+0.5,two5n5n,dMult*(dMult-1.));
3394 fIntFlowCorrelationsAllVsMPro[35]->Fill(dMult+0.5,two6n6n,dMult*(dMult-1.));
3395 }
3396 } // end of if(dMult>1)
3397
3398 // 3-particle:
3399 Double_t three5n3n2n = 0.; // <cos(n(5*phi1-3*phi2-2*phi3)>
3400 Double_t three5n4n1n = 0.; // <cos(n(5*phi1-4*phi2-1*phi3)>
3401 Double_t three6n3n3n = 0.; // <cos(n(6*phi1-3*phi2-3*phi3)>
3402 Double_t three6n4n2n = 0.; // <cos(n(6*phi1-4*phi2-2*phi3)>
3403 Double_t three6n5n1n = 0.; // <cos(n(6*phi1-5*phi2-1*phi3)>
3404 if(dMult>2)
3405 {
3406 three5n3n2n = (reQ5nQ3nstarQ2nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3407 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
3408 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3409 / (dMult*(dMult-1.)*(dMult-2.));
3410 three5n4n1n = (reQ5nQ4nstarQ1nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3411 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))
3412 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3413 / (dMult*(dMult-1.)*(dMult-2.));
3414 three6n3n3n = (reQ6nQ3nstarQ3nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3415 - (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*dMult)
3416 / (dMult*(dMult-1.)*(dMult-2.));
3417 three6n4n2n = (reQ6nQ4nstarQ2nstar-(pow(dReQ6n,2.)+pow(dImQ6n,2.))
3418 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))
3419 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3420 / (dMult*(dMult-1.)*(dMult-2.));
3421 three6n5n1n = (reQ6nQ5nstarQ1nstar-(pow(dReQ6n,2.)+pow(dImQ6n,2.))
3422 - (pow(dReQ5n,2.)+pow(dImQ5n,2.))
3423 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3424 / (dMult*(dMult-1.)*(dMult-2.));
3425 // Average 3-particle correlations for all events:
3426 fIntFlowCorrelationsAllPro->Fill(36.5,three5n3n2n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(5*phi1-3*phi2-2*phi3)>>
3427 fIntFlowCorrelationsAllPro->Fill(37.5,three5n4n1n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(5*phi1-4*phi2-1*phi3)>>
3428 fIntFlowCorrelationsAllPro->Fill(38.5,three6n3n3n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-3*phi2-3*phi3)>>
3429 fIntFlowCorrelationsAllPro->Fill(39.5,three6n4n2n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-4*phi2-2*phi3)>>
3430 fIntFlowCorrelationsAllPro->Fill(40.5,three6n5n1n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-5*phi2-1*phi3)>>
3431 if(fCalculateAllCorrelationsVsM)
3432 {
3433 fIntFlowCorrelationsAllVsMPro[36]->Fill(dMult+0.5,three5n3n2n,dMult*(dMult-1.)*(dMult-2.));
3434 fIntFlowCorrelationsAllVsMPro[37]->Fill(dMult+0.5,three5n4n1n,dMult*(dMult-1.)*(dMult-2.));
3435 fIntFlowCorrelationsAllVsMPro[38]->Fill(dMult+0.5,three6n3n3n,dMult*(dMult-1.)*(dMult-2.));
3436 fIntFlowCorrelationsAllVsMPro[39]->Fill(dMult+0.5,three6n4n2n,dMult*(dMult-1.)*(dMult-2.));
3437 fIntFlowCorrelationsAllVsMPro[40]->Fill(dMult+0.5,three6n5n1n,dMult*(dMult-1.)*(dMult-2.));
3438 }
3439 } // end of if(dMult>2)
3440
3441 // 4-particle:
3442 Double_t four6n3n2n1n = 0.; // <cos(n(6*phi1-3*phi2-2*phi3-1*phi4)>
3443 Double_t four3n2n3n2n = 0.; // <cos(n(3*phi1+2*phi2-3*phi3-2*phi4)>
3444 Double_t four4n1n3n2n = 0.; // <cos(n(4*phi1+1*phi2-3*phi3-2*phi4)>
3445 Double_t four3n3n3n3n = 0.; // <cos(3n(phi1+phi2-phi3-phi4))>
3446 //Double_t four4n2n3n3n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-3*phi4)> // I already have this one above
3447 Double_t four5n1n3n3n = 0.; // <cos(n(5*phi1+1*phi2-3*phi3-3*phi4)>
3448 Double_t four4n2n4n2n = 0.; // <cos(n(4*phi1+2*phi2-4*phi3-2*phi4)>
3449 Double_t four5n1n4n2n = 0.; // <cos(n(5*phi1+1*phi2-4*phi3-2*phi4)>
3450 Double_t four5n3n1n1n = 0.; // <cos(n(5*phi1-3*phi2-1*phi3-1*phi4)>
3451 Double_t four5n2n2n1n = 0.; // <cos(n(5*phi1-2*phi2-2*phi3-1*phi4)>
403e3389 3452 Double_t four5n1n5n1n = 0.; // <cos(n(5*phi1+1*phi2-5*phi3-1*phi4)>
3453 Double_t four6n4n1n1n = 0.; // <cos(n(6*phi1-4*phi2-1*phi3-1*phi4)>
3454 Double_t four6n2n2n2n = 0.; // <cos(n(6*phi1-2*phi2-2*phi3-2*phi4)>
b84464d3 3455 if(dMult>3)
3456 {
3457 four6n3n2n1n = (reQ6nQ3nstarQ2nstarQ1nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar-reQ6nQ5nstarQ1nstar
3458 - reQ5nQ3nstarQ2nstar-reQ4nQ3nstarQ1nstar-reQ3nQ2nstarQ1nstar
3459 + 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+pow(dReQ5n,2.)+pow(dImQ5n,2.)
3460 + pow(dReQ4n,2.)+pow(dImQ4n,2.)+3.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3461 + 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3462 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3463 four3n2n3n2n = (dQ3nQ2nQ3nstarQ2nstar-2.*reQ5nQ3nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar
3464 + pow(dReQ5n,2.)+pow(dImQ5n,2.)+pow(dReQ1n,2.)+pow(dImQ1n,2.)
3465 -(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.)+pow(dReQ2n,2.)+pow(dImQ2n,2.))
3466 + dMult*(dMult-6.))
3467 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3468 four4n1n3n2n = (reQ4nQ1nQ3nstarQ2nstar-reQ5nQ3nstarQ2nstar-reQ5nQ4nstarQ1nstar-reQ4nQ3nstarQ1nstar
3469 - reQ4nQ2nstarQ2nstar-reQ3nQ2nstarQ1nstar-reQ2nQ1nstarQ1nstar
3470 + pow(dReQ5n,2.)+pow(dImQ5n,2.)+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3471 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3472 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3473 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3474 four3n3n3n3n = (2.*dMult*(dMult-3.)+pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ3n,2.)
3475 + pow(dImQ3n,2.))-2.*reQ6nQ3nstarQ3nstar+(pow(dReQ6n,2.)+pow(dImQ6n,2.)))
3476 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3477 //four4n2n3n3n = ; // I already have this one above
3478 four5n1n3n3n = (reQ5nQ1nQ3nstarQ3nstar-reQ6nQ5nstarQ1nstar-reQ6nQ3nstarQ3nstar-2.*reQ5nQ3nstarQ2nstar
3479 - 2.*reQ3nQ2nstarQ1nstar+pow(dReQ6n,2.)+pow(dImQ6n,2.)+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3480 + 4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3481 + 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3482 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3483 four4n2n4n2n = (dQ4nQ2nQ4nstarQ2nstar-2.*reQ6nQ4nstarQ2nstar-2.*reQ4nQ2nstarQ2nstar)
3484 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3485 - ((dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3486 + (dMult-4.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-(pow(dReQ6n,2.)+pow(dImQ6n,2.)))
3487 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3488 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3489 four5n1n4n2n = (reQ5nQ1nQ4nstarQ2nstar-reQ6nQ5nstarQ1nstar-reQ6nQ4nstarQ2nstar-reQ5nQ4nstarQ1nstar
3490 - reQ5nQ3nstarQ2nstar-reQ4nQ3nstarQ1nstar-reQ2nQ1nstarQ1nstar+pow(dReQ6n,2.)+pow(dImQ6n,2.)
3491 + 2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3492 + pow(dReQ3n,2.)+pow(dImQ3n,2.)+2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3493 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3494 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3495 four5n3n1n1n = (reQ5nQ3nstarQ1nstarQ1nstar-2.*reQ5nQ4nstarQ1nstar-reQ5nQ3nstarQ2nstar-2.*reQ4nQ3nstarQ1nstar
3496 - reQ2nQ1nstarQ1nstar+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3497 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+pow(dReQ2n,2.)+pow(dImQ2n,2.)
3498 + 4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3499 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3500 four5n2n2n1n = (reQ5nQ2nstarQ2nstarQ1nstar-reQ5nQ4nstarQ1nstar-2.*reQ5nQ3nstarQ2nstar-reQ4nQ2nstarQ2nstar
3501 - 2.*reQ3nQ2nstarQ1nstar+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+pow(dReQ4n,2.)+pow(dImQ4n,2.)
3502 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3503 + 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3504 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3505 four5n1n5n1n = (dQ5nQ1nQ5nstarQ1nstar-2.*reQ6nQ5nstarQ1nstar-2.*reQ5nQ4nstarQ1nstar
3506 + pow(dReQ6n,2.)+pow(dImQ6n,2.)-(dMult-4.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3507 + pow(dReQ4n,2.)+pow(dImQ4n,2.)-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+dMult*(dMult-6.))
3508 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
403e3389 3509
3510 four6n4n1n1n = (reQ6nQ4nstarQ1nstarQ1nstar
3511 - dMult*(dMult-1.)*(dMult-2.)*(three2n1n1n+2.*three5n4n1n+2.*three6n5n1n+three6n4n2n)
3512 - dMult*(dMult-1.)*(2.*two1n1n+1.*two4n4n+1.*two6n6n+1.*two2n2n+2.*two5n5n)
3513 - 1.*dMult)
3514 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3515
3516 four6n2n2n2n = (reQ6nQ2nstarQ2nstarQ2nstar-3.*reQ6nQ4nstarQ2nstar-3.*reQ4nQ2nstarQ2nstar
3517 + 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3518 + 6.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-6.*dMult)
3519 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3520 // Average 4-particle correlations for all events:
3521 fIntFlowCorrelationsAllPro->Fill(41.5,four6n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3522 fIntFlowCorrelationsAllPro->Fill(42.5,four3n2n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3523 fIntFlowCorrelationsAllPro->Fill(43.5,four4n1n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3524 fIntFlowCorrelationsAllPro->Fill(44.5,four3n3n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3525 //fIntFlowCorrelationsAllPro->Fill(45.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); // I already have this one above
3526 fIntFlowCorrelationsAllPro->Fill(46.5,four5n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3527 fIntFlowCorrelationsAllPro->Fill(47.5,four4n2n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3528 fIntFlowCorrelationsAllPro->Fill(48.5,four5n1n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3529 fIntFlowCorrelationsAllPro->Fill(49.5,four5n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3530 fIntFlowCorrelationsAllPro->Fill(50.5,four5n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3531 fIntFlowCorrelationsAllPro->Fill(51.5,four5n1n5n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
403e3389 3532 fIntFlowCorrelationsAllPro->Fill(58.5,four6n4n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3533 fIntFlowCorrelationsAllPro->Fill(59.5,four6n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3534 if(fCalculateAllCorrelationsVsM)
3535 {
3536 fIntFlowCorrelationsAllVsMPro[41]->Fill(dMult+0.5,four6n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3537 fIntFlowCorrelationsAllVsMPro[42]->Fill(dMult+0.5,four3n2n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3538 fIntFlowCorrelationsAllVsMPro[43]->Fill(dMult+0.5,four4n1n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3539 fIntFlowCorrelationsAllVsMPro[44]->Fill(dMult+0.5,four3n3n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3540 //fIntFlowCorrelationsAllVsMPro[45]->Fill(dMult+0.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3541 fIntFlowCorrelationsAllVsMPro[46]->Fill(dMult+0.5,four5n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3542 fIntFlowCorrelationsAllVsMPro[47]->Fill(dMult+0.5,four4n2n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3543 fIntFlowCorrelationsAllVsMPro[48]->Fill(dMult+0.5,four5n1n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3544 fIntFlowCorrelationsAllVsMPro[49]->Fill(dMult+0.5,four5n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3545 fIntFlowCorrelationsAllVsMPro[50]->Fill(dMult+0.5,four5n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3546 fIntFlowCorrelationsAllVsMPro[51]->Fill(dMult+0.5,four5n1n5n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
403e3389 3547 fIntFlowCorrelationsAllVsMPro[58]->Fill(dMult+0.5,four6n4n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3548 fIntFlowCorrelationsAllVsMPro[59]->Fill(dMult+0.5,four6n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
b84464d3 3549 }
3550 } // end of if(dMult>3)
3551
3552 // 5-particle:
3553 Double_t five3n3n3n2n1n = 0.; // <cos(n(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
3554 Double_t five4n2n3n2n1n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
3555 Double_t five3n2n3n1n1n = 0.; // <cos(n(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
3556 Double_t five3n2n2n2n1n = 0.; // <cos(n(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
3557 Double_t five5n1n3n2n1n = 0.; // <cos(n(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
403e3389 3558 Double_t five6n2n2n1n1n = 0.; // <cos(n(6*phi1-2*phi2-2*phi3-1*phi4-1*phi5)>
3559 Double_t five4n1n1n3n3n = 0.; // <cos(n(4*phi1+1*phi2+1*phi3-3*phi4-3*phi5)>
b84464d3 3560 if(dMult>4)
3561 {
3562 five3n3n3n2n1n = (reQ3nQ3nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ3nstarQ3nstar-reQ4nQ2nQ3nstarQ3nstar
3563 + reQ6nQ5nstarQ1nstar+reQ6nQ4nstarQ2nstar+3.*reQ6nQ3nstarQ3nstar+4.*reQ5nQ3nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar
3564 - 2.*(dMult-6.)*reQ3nQ2nstarQ1nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3565 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3566 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3567 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*(3.*dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3568 - pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)+2.*(dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3569 + 2.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3570 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3571 five4n2n3n2n1n = (reQ4nQ2nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ4nstarQ2nstar
3572 - reQ4nQ2nQ3nstarQ3nstar-reQ4nQ1nQ3nstarQ2nstar-reQ4nQ2nstarQ1nstarQ1nstar
3573 - reQ3nQ1nQ2nstarQ2nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3574 + 3.*reQ6nQ4nstarQ2nstar+reQ6nQ5nstarQ1nstar+reQ6nQ3nstarQ3nstar+reQ5nQ4nstarQ1nstar
3575 + 3.*reQ5nQ3nstarQ2nstar-(dMult-7.)*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+7.*reQ3nQ2nstarQ1nstar
3576 + 4.*reQ2nQ1nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3577 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3578 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3579 + (dMult-8.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+(dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3580 + 2.*(dMult-7.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+(dMult-12.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3581 - 2.*dMult*(dMult-12.))
3582 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3583 five3n2n3n1n1n = (reQ3nQ2nQ3nstarQ1nstarQ1nstar-reQ5nQ3nstarQ1nstarQ1nstar-2.*reQ4nQ1nQ3nstarQ2nstar-reQ3nQ1nstarQ1nstarQ1nstar
3584 - 2.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ5nQ4nstarQ1nstar+3.*reQ5nQ3nstarQ2nstar+6.*reQ4nQ3nstarQ1nstar
3585 + 2.*reQ4nQ2nstarQ2nstar+9.*reQ3nQ2nstarQ1nstar-(dMult-8.)*reQ2nQ1nstarQ1nstar
3586 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3587 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3588 - 2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))-4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3589 + 2.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(dMult-12.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3590 + 2.*(dMult-9.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-2.*dMult*(dMult-12.))
3591 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3592 five3n2n2n2n1n = (reQ3nQ2nQ2nstarQ2nstarQ1nstar-reQ5nQ2nstarQ2nstarQ1nstar-reQ4nQ1nQ3nstarQ2nstar-reQ3nQ1nQ2nstarQ2nstar
3593 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+reQ5nQ4nstarQ1nstar
3594 + 4.*reQ5nQ3nstarQ2nstar+reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar-2.*(dMult-6.)*reQ3nQ2nstarQ1nstar
3595 + 4.*reQ2nQ1nstarQ1nstar-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3596 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3597 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3598 - pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3599 + 2.*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3600 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3601 five5n1n3n2n1n = (reQ5nQ1nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ4nstarQ2nstar-reQ5nQ1nQ3nstarQ3nstar
3602 - reQ4nQ1nQ3nstarQ2nstar-reQ5nQ3nstarQ1nstarQ1nstar-reQ5nQ2nstarQ2nstarQ1nstar
3603 + 3.*reQ6nQ5nstarQ1nstar+reQ6nQ4nstarQ2nstar+reQ6nQ3nstarQ3nstar+4.*reQ5nQ4nstarQ1nstar
3604 - (dMult-7.)*reQ5nQ3nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar+reQ4nQ2nstarQ2nstar+6.*reQ3nQ2nstarQ1nstar
3605 + 3.*reQ2nQ1nstarQ1nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3606 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3607 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3608 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+(dMult-8.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3609 - 4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+(dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3610 + (dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*(dMult-7.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3611 - 2.*dMult*(dMult-12.))
3612 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
403e3389 3613
3614 // five6n2n2n1n1n = ;
3615 // five4n1n1n3n3n = ;
3616
b84464d3 3617 // Average 5-particle correlations for all events:
3618 fIntFlowCorrelationsAllPro->Fill(52.5,five3n3n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3619 fIntFlowCorrelationsAllPro->Fill(53.5,five4n2n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3620 fIntFlowCorrelationsAllPro->Fill(54.5,five3n2n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3621 fIntFlowCorrelationsAllPro->Fill(55.5,five3n2n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3622 fIntFlowCorrelationsAllPro->Fill(56.5,five5n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
403e3389 3623 fIntFlowCorrelationsAllPro->Fill(60.5,five6n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3624 fIntFlowCorrelationsAllPro->Fill(61.5,five4n1n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
b84464d3 3625 if(fCalculateAllCorrelationsVsM)
3626 {
3627 fIntFlowCorrelationsAllVsMPro[52]->Fill(dMult+0.5,five3n3n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3628 fIntFlowCorrelationsAllVsMPro[53]->Fill(dMult+0.5,five4n2n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3629 fIntFlowCorrelationsAllVsMPro[54]->Fill(dMult+0.5,five3n2n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3630 fIntFlowCorrelationsAllVsMPro[55]->Fill(dMult+0.5,five3n2n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3631 fIntFlowCorrelationsAllVsMPro[56]->Fill(dMult+0.5,five5n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
403e3389 3632 fIntFlowCorrelationsAllVsMPro[60]->Fill(dMult+0.5,five6n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3633 fIntFlowCorrelationsAllVsMPro[61]->Fill(dMult+0.5,five4n1n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
b84464d3 3634 }
3635 } // end of if(dMult>4)
3636
3637 // 6-particle:
3638 Double_t six3n2n1n3n2n1n = 0.; // <cos(n(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
403e3389 3639 Double_t six3n3n2n2n1n1n = 0.; // <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-1*phi5-1*phi6)>
b84464d3 3640 if(dMult>5.)
3641 {
3642 six3n2n1n3n2n1n = (dQ3nQ2nQ1nQ3nstarQ2nstarQ1nstar-2.*reQ3nQ3nQ3nstarQ2nstarQ1nstar
3643 - 2.*reQ3nQ2nQ2nstarQ2nstarQ1nstar-2.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3644 - 2.*reQ3nQ2nQ3nstarQ1nstarQ1nstar-2.*reQ4nQ2nQ3nstarQ2nstarQ1nstar
3645 - 2.*reQ5nQ1nQ3nstarQ2nstarQ1nstar+4.*reQ6nQ3nstarQ2nstarQ1nstar
3646 + 2.*reQ5nQ1nQ4nstarQ2nstar+2.*reQ5nQ1nQ3nstarQ3nstar
3647 + 2.*reQ4nQ2nQ3nstarQ3nstar+6.*reQ4nQ1nQ3nstarQ2nstar
3648 + 2.*reQ5nQ3nstarQ1nstarQ1nstar+2.*reQ5nQ2nstarQ2nstarQ1nstar
3649 + 6.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ4nQ2nstarQ1nstarQ1nstar
3650 - 4.*reQ6nQ5nstarQ1nstar-4.*reQ6nQ4nstarQ2nstar-6.*reQ5nQ4nstarQ1nstar
3651 - 4.*reQ6nQ3nstarQ3nstar+2.*(dMult-11.)*reQ5nQ3nstarQ2nstar
3652 + 2.*(dMult-13.)*reQ4nQ3nstarQ1nstar-8.*reQ4nQ2nstarQ2nstar
3653 + 2.*(5.*dMult-32.)*reQ3nQ2nstarQ1nstar+2.*reQ3nQ1nstarQ1nstarQ1nstar
3654 + 2.*(dMult-13.)*reQ2nQ1nstarQ1nstar
3655 - (dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3656 + (pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3657 + (pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3658 - (dMult-11.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3659 - (dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3660 + 4.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-(dMult-12.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3661 - (dMult-16.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)
3662 + (dMult*dMult-19.*dMult+68.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3663 + (dMult*dMult-19.*dMult+72.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3664 + pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3665 + (dMult*dMult-20.*dMult+80.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3666 - dMult*(dMult-12.)*(dMult-10.))
3667 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
403e3389 3668
3669 // six3n3n2n2n1n1n = ;
3670
b84464d3 3671 // Average 6-particle correlations for all events:
3672 fIntFlowCorrelationsAllPro->Fill(57.5,six3n2n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
403e3389 3673 fIntFlowCorrelationsAllPro->Fill(62.5,six3n3n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
b84464d3 3674 if(fCalculateAllCorrelationsVsM)
3675 {
3676 fIntFlowCorrelationsAllVsMPro[57]->Fill(dMult+0.5,six3n2n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
403e3389 3677 fIntFlowCorrelationsAllVsMPro[62]->Fill(dMult+0.5,six3n3n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
b84464d3 3678 }
3679 } // end of if(dMult>5.)
3680
489d5531 3681} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
3682
489d5531 3683//================================================================================================================================
3684
e5834fcb 3685void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3686{
3687 // Store phi distribution for one event to illustrate flow.
3688
3689 if(fPhiDistributionForOneEvent->GetEntries()>0){return;} // store only phi distribution for one event
3690
3691 Double_t vMin = fPhiDistributionForOneEventSettings[0];
3692 Double_t vMax = fPhiDistributionForOneEventSettings[1];
3693 Double_t refMultMin = fPhiDistributionForOneEventSettings[2];
3694 Double_t refMultMax = fPhiDistributionForOneEventSettings[3];
3695
3696 Double_t vEBE = 0.;
3697 Double_t cumulant4thEBE = fIntFlowCorrelationsEBE->GetBinContent(2)-2.*pow(fIntFlowCorrelationsEBE->GetBinContent(1),2.);
3698 if(cumulant4thEBE<0.)
3699 {
3700 vEBE = pow(-1.*cumulant4thEBE,0.25);
3701 if((vEBE>vMin && vEBE<vMax) && (fReferenceMultiplicityEBE>refMultMin && fReferenceMultiplicityEBE<refMultMax))
3702 {
3958eee6 3703 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f",fHarmonic,vEBE));
e5834fcb 3704 for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3705 {
3706 if(anEvent->GetTrack(p)->InRPSelection())
3707 {
3708 fPhiDistributionForOneEvent->Fill(anEvent->GetTrack(p)->Phi());
3709 }
3710 } // end of for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3958eee6 3711 } else
3712 {
3713 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f, out of specified boundaries",fHarmonic,vEBE));
3714 }
3715
e5834fcb 3716 } // end of if(cumulant4thEBE<0.)
3717
3718} // end of void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3719
3720//================================================================================================================================
489d5531 3721
3722void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3723{
0328db2d 3724 // Calculate averages of products of correlations for integrated flow.
489d5531 3725
2001bc3a 3726 // multiplicity:
1268c371 3727 Double_t dMult = (*fSpk)(0,0);
2001bc3a 3728
489d5531 3729 Int_t counter = 0;
3730
3731 for(Int_t ci1=1;ci1<4;ci1++)
3732 {
3733 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
3734 {
ff70ca91 3735 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
3736 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3737 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3738 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3739 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3740 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 3741 if(fCalculateCumulantsVsM)
3742 {
3743 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
3744 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3745 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3746 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3747 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3748 } // end of if(fCalculateCumulantsVsM)
ff70ca91 3749 counter++;
489d5531 3750 }
3751 }
3752
3753} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3754
3755
3756//================================================================================================================================
3757
3758
0328db2d 3759void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3760{
3761 // Calculate averages of products of correction terms for NUA.
3762
3763 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
3764 // 1st bin: <<2><cos(phi)>>
3765 // 2nd bin: <<2><sin(phi)>>
3766 // 3rd bin: <<cos(phi)><sin(phi)>>
3767 // 4th bin: <<2><cos(phi1+phi2)>>
3768 // 5th bin: <<2><sin(phi1+phi2)>>
3769 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
3770 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
3771 // 8th bin: <<4><cos(phi1)>>
3772 // 9th bin: <<4><sin(phi1)>>
3773 // 10th bin: <<4><cos(phi1+phi2)>>
3774 // 11th bin: <<4><sin(phi1+phi2)>>
3775 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
3776 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
3777 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
3778 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
3779 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
3780 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
3781 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
3782 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
3783 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
3784 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
3785 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
3786 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3787 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3788 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3789 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3790 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3791
3792 // <<2><cos(phi)>>:
3793 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
3794 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3795 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3796 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3797 // <<2><sin(phi)>>:
3798 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
3799 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3800 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3801 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3802 // <<cos(phi)><sin(phi)>>:
3803 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
3804 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3805 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3806 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3807 // <<2><cos(phi1+phi2)>>:
3808 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
3809 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3810 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3811 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3812 // <<2><sin(phi1+phi2)>>:
3813 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
3814 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3815 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3816 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3817 // <<2><cos(phi1-phi2-phi3)>>:
3818 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
3819 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3820 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3821 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3822 // <<2><sin(phi1-phi2-phi3)>>:
3823 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3824 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3825 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3826 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3827 // <<4><cos(phi1)>>:
3828 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3829 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3830 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3831 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3832 // <<4><sin(phi1)>>:
3833 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3834 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3835 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3836 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3837 // <<4><cos(phi1+phi2)>>:
3838 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3839 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3840 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3841 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3842 // <<4><sin(phi1+phi2)>>:
3843 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3844 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3845 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3846 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3847 // <<4><cos(phi1-phi2-phi3)>>:
3848 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3849 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3850 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3851 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3852 // <<4><sin(phi1-phi2-phi3)>>:
3853 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3854 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3855 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3856 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3857 // <<cos(phi1)><cos(phi1+phi2)>>:
3858 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3859 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3860 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3861 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3862 // <<cos(phi1)><sin(phi1+phi2)>>:
3863 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3864 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3865 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3866 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3867 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3868 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3869 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3870 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3871 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3872 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3873 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3874 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3875 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3876 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3877 // <<sin(phi1)><cos(phi1+phi2)>>:
3878 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3879 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3880 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3881 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3882 // <<sin(phi1)><sin(phi1+phi2)>>:
3883 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3884 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3885 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3886 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3887 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3888 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3889 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3890 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3891 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3892 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3893 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3894 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3895 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3896 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3897 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3898 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3899 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3900 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3901 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3902 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3903 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3904 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3905 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3906 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3907 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3908 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3909 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3910 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3911 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3912 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3913 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3914 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3915 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3916 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3917 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3918 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3919 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3920 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3921 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3922 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3923 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3924 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3925 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3926 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3927
3928} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3929
0328db2d 3930//================================================================================================================================
3931
489d5531 3932void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3933{
3934 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3935 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3936 // b) Store in histogram fIntFlowCovariances for instance the following:
3937 //
3938 // 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)]
3939 //
3940 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3941 // c) Binning of fIntFlowCovariances is organized as follows:
3942 //
3943 // 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)]
3944 // 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)]
3945 // 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)]
3946 // 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)]
3947 // 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)]
3948 // 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 3949 //
489d5531 3950
b3dacf6b 3951 // Average 2-, 4-, 6- and 8-particle correlations for all events:
489d5531 3952 Double_t correlation[4] = {0.};
3953 for(Int_t ci=0;ci<4;ci++)
3954 {
3955 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3956 }
b3dacf6b 3957 // Average products of 2-, 4-, 6- and 8-particle correlations:
489d5531 3958 Double_t productOfCorrelations[4][4] = {{0.}};
3959 Int_t productOfCorrelationsLabel = 1;
b3dacf6b 3960 // Denominators in the expressions for the unbiased estimator for covariance:
489d5531 3961 Double_t denominator[4][4] = {{0.}};
3962 Int_t sumOfProductOfEventWeightsLabel1 = 1;
b3dacf6b 3963 // Weight dependent prefactor which multiply unbiased estimators for covariances:
489d5531 3964 Double_t wPrefactor[4][4] = {{0.}};
3965 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3966 for(Int_t c1=0;c1<4;c1++)
3967 {
3968 for(Int_t c2=c1+1;c2<4;c2++)
3969 {
3970 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
b3dacf6b 3971 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
3972 {
3973 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
3974 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3975 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3976 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
3977 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3978 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
489d5531 3979 }
b3dacf6b 3980 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
489d5531 3981 sumOfProductOfEventWeightsLabel1++;
3982 sumOfProductOfEventWeightsLabel2++;
b3dacf6b 3983 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3984 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 3985
489d5531 3986 Int_t covarianceLabel = 1;
3987 for(Int_t c1=0;c1<4;c1++)
3988 {
3989 for(Int_t c2=c1+1;c2<4;c2++)
3990 {
b3dacf6b 3991 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
489d5531 3992 {
b3dacf6b 3993 // Covariances:
489d5531 3994 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
b3dacf6b 3995 // Covariances multiplied with weight dependent prefactor:
489d5531 3996 Double_t wCov = cov * wPrefactor[c1][c2];
3997 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3998 }
3999 covarianceLabel++;
b3dacf6b 4000 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4001 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 4002
b3dacf6b 4003 // Versus multiplicity:
4004 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 4005 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4006 for(Int_t b=1;b<=nBins;b++)
4007 {
b3dacf6b 4008 // Average 2-, 4-, 6- and 8-particle correlations for all events:
9da1a4f3 4009 Double_t correlationVsM[4] = {0.};
4010 for(Int_t ci=0;ci<4;ci++)
4011 {
4012 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
4013 } // end of for(Int_t ci=0;ci<4;ci++)
b3dacf6b 4014 // Average products of 2-, 4-, 6- and 8-particle correlations:
9da1a4f3 4015 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
4016 Int_t productOfCorrelationsLabelVsM = 1;
b3dacf6b 4017 // Denominators in the expressions for the unbiased estimator for covariance:
9da1a4f3 4018 Double_t denominatorVsM[4][4] = {{0.}};
4019 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
b3dacf6b 4020 // Weight dependent prefactor which multiply unbiased estimators for covariances:
9da1a4f3 4021 Double_t wPrefactorVsM[4][4] = {{0.}};
4022 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
4023 for(Int_t c1=0;c1<4;c1++)
4024 {
4025 for(Int_t c2=c1+1;c2<4;c2++)
4026 {
4027 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
b3dacf6b 4028 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
4029 {
4030 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
4031 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
4032 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
4033 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
4034 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
4035 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
9da1a4f3 4036 }
4037 productOfCorrelationsLabelVsM++;
4038 sumOfProductOfEventWeightsLabel1VsM++;
4039 sumOfProductOfEventWeightsLabel2VsM++;
4040 } // end of for(Int_t c1=0;c1<4;c1++)
4041 } // end of for(Int_t c2=c1+1;c2<4;c2++)
b3dacf6b 4042
9da1a4f3 4043 Int_t covarianceLabelVsM = 1;
4044 for(Int_t c1=0;c1<4;c1++)
4045 {
4046 for(Int_t c2=c1+1;c2<4;c2++)
4047 {
b3dacf6b 4048 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
9da1a4f3 4049 {
b3dacf6b 4050 // Covariances:
9da1a4f3 4051 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
b3dacf6b 4052 // Covariances multiplied with weight dependent prefactor:
9da1a4f3 4053 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
4054 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
4055 }
4056 covarianceLabelVsM++;
b3dacf6b 4057 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4058 } // end of for(Int_t c1=0;c1<4;c1++)
9da1a4f3 4059 } // end of for(Int_t b=1;b<=nBins;b++)
4060
489d5531 4061} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
4062
489d5531 4063//================================================================================================================================
4064
0328db2d 4065void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4066{
4067 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
4068 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
4069 //
4070 // 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)]
4071 //
4072 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
4073 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
4074 //
4075 // 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)]
4076 // 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)]
4077 // 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)]
4078 // ...
4079
4080 // Cov(<2>,<cos(phi)>):
4081 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
4082 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4083 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
4084 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4085 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
4086 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
4087 // numerator in the expression for the the unbiased estimator for covariance:
4088 Double_t numerator1 = product1 - term1st1*term2nd1;
4089 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4090 Double_t denominator1 = 0.;
4091 if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
4092 {
4093 denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
4094 if(TMath::Abs(denominator1)>0.)
4095 {
4096 // covariance:
4097 Double_t covariance1 = numerator1/denominator1;
4098 // weight dependent prefactor for covariance:
4099 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
4100 // finally, store "weighted" covariance:
4101 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
4102 } // end of if(TMath::Abs(denominator)>0.)
4103 } // end of if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
4104
0328db2d 4105 // Cov(<2>,<sin(phi)>):
4106 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
4107 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4108 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
4109 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4110 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
4111 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
4112 // numerator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4113 Double_t numerator2 = product2 - term1st2*term2nd2;
0328db2d 4114 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4115 Double_t denominator2 = 0.;
4116 if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
4117 {
4118 denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
4119 if(TMath::Abs(denominator2)>0.)
4120 {
4121 // covariance:
4122 Double_t covariance2 = numerator2/denominator2;
4123 // weight dependent prefactor for covariance:
4124 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
4125 // finally, store "weighted" covariance:
4126 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
4127 } // end of if(TMath::Abs(denominator2)>0.)
4128 } // end of if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
0328db2d 4129
4130 // Cov(<cos(phi)>,<sin(phi)>):
4131 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
4132 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
4133 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
4134 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
4135 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
4136 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
4137 // numerator in the expression for the the unbiased estimator for covariance:
4138 Double_t numerator3 = product3 - term1st3*term2nd3;
4139 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4140 Double_t denominator3 = 0;
4141 if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
4142 {
4143 denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
4144 if(TMath::Abs(denominator3)>0.)
4145 {
4146 // covariance:
4147 Double_t covariance3 = numerator3/denominator3;
4148 // weight dependent prefactor for covariance:
4149 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
4150 // finally, store "weighted" covariance:
4151 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
4152 } // end of if(TMath::Abs(denominator3)>0.)
4153 } // end of if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
0328db2d 4154
4155 // Cov(<2>,<cos(phi1+phi2)>):
4156 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
4157 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4158 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4159 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4160 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4161 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
4162 // numerator in the expression for the the unbiased estimator for covariance:
4163 Double_t numerator4 = product4 - term1st4*term2nd4;
4164 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4165 Double_t denominator4 = 0.;
4166 if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
4167 {
4168 denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
4169 if(TMath::Abs(denominator4)>0.)
4170 {
4171 // covariance:
4172 Double_t covariance4 = numerator4/denominator4;
4173 // weight dependent prefactor for covariance:
4174 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
4175 // finally, store "weighted" covariance:
4176 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
4177 } // end of if(TMath::Abs(denominator4)>0.)
4178 } // end of if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
4179
0328db2d 4180 // Cov(<2>,<sin(phi1+phi2)>):
4181 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
4182 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4183 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4184 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4185 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4186 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
4187 // numerator in the expression for the the unbiased estimator for covariance:
4188 Double_t numerator5 = product5 - term1st5*term2nd5;
4189 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4190 Double_t denominator5 = 0.;
4191 if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
4192 {
4193 denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
4194 if(TMath::Abs(denominator5)>0.)
4195 {
4196 // covariance:
4197 Double_t covariance5 = numerator5/denominator5;
4198 // weight dependent prefactor for covariance:
4199 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
4200 // finally, store "weighted" covariance:
4201 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
4202 } // end of if(TMath::Abs(denominator5)>0.)
4203 } // end of if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
4204
0328db2d 4205 // Cov(<2>,<cos(phi1-phi2-phi3)>):
4206 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
4207 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4208 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4209 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4210 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4211 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
4212 // numerator in the expression for the the unbiased estimator for covariance:
4213 Double_t numerator6 = product6 - term1st6*term2nd6;
4214 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4215 Double_t denominator6 = 0.;
4216 if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
4217 {
4218 denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
4219 if(TMath::Abs(denominator6)>0.)
4220 {
4221 // covariance:
4222 Double_t covariance6 = numerator6/denominator6;
4223 // weight dependent prefactor for covariance:
4224 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
4225 // finally, store "weighted" covariance:
4226 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
4227 } // end of if(TMath::Abs(denominator6)>0.)
4228 } // end of if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
4229
0328db2d 4230 // Cov(<2>,<sin(phi1-phi2-phi3)>):
4231 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
4232 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4233 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4234 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4235 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4236 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
4237 // numerator in the expression for the the unbiased estimator for covariance:
4238 Double_t numerator7 = product7 - term1st7*term2nd7;
4239 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4240 Double_t denominator7 = 0.;
4241 if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
4242 {
4243 denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
4244 if(TMath::Abs(denominator7)>0.)
4245 {
4246 // covariance:
4247 Double_t covariance7 = numerator7/denominator7;
4248 // weight dependent prefactor for covariance:
4249 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
4250 // finally, store "weighted" covariance:
4251 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
4252 } // end of if(TMath::Abs(denominator7)>0.)
4253 } // end of if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
4254
0328db2d 4255 // Cov(<4>,<cos(phi1>):
4256 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
4257 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4258 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4259 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4260 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4261 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
4262 // numerator in the expression for the the unbiased estimator for covariance:
4263 Double_t numerator8 = product8 - term1st8*term2nd8;
4264 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4265 Double_t denominator8 = 0.;
4266 if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
4267 {
4268 denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
4269 if(TMath::Abs(denominator8)>0.)
4270 {
4271 // covariance:
4272 Double_t covariance8 = numerator8/denominator8;
4273 // weight dependent prefactor for covariance:
4274 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
4275 // finally, store "weighted" covariance:
4276 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
4277 } // end of if(TMath::Abs(denominator8)>0.)
4278 } // end of if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
4279
0328db2d 4280 // Cov(<4>,<sin(phi1)>):
4281 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
4282 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4283 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4284 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4285 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4286 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
4287 // numerator in the expression for the the unbiased estimator for covariance:
4288 Double_t numerator9 = product9 - term1st9*term2nd9;
4289 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4290 Double_t denominator9 = 0.;
4291 if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
4292 {
4293 denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
4294 if(TMath::Abs(denominator9)>0.)
4295 {
4296 // covariance:
4297 Double_t covariance9 = numerator9/denominator9;
4298 // weight dependent prefactor for covariance:
4299 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
4300 // finally, store "weighted" covariance:
4301 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
4302 }
4303 } // end of if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
4304
0328db2d 4305 // Cov(<4>,<cos(phi1+phi2)>):
4306 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
4307 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4308 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4309 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4310 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4311 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
4312 // numerator in the expression for the the unbiased estimator for covariance:
4313 Double_t numerator10 = product10 - term1st10*term2nd10;
4314 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4315 Double_t denominator10 = 0.;
4316 if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
4317 {
4318 denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
4319 if(TMath::Abs(denominator10)>0.)
4320 {
4321 // covariance:
4322 Double_t covariance10 = numerator10/denominator10;
4323 // weight dependent prefactor for covariance:
4324 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
4325 // finally, store "weighted" covariance:
4326 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
4327 } // end of if(TMath::Abs(denominator10)>0.)
4328 } // end of if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
4329
0328db2d 4330 // Cov(<4>,<sin(phi1+phi2)>):
4331 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
4332 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4333 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4334 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4335 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4336 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
4337 // numerator in the expression for the the unbiased estimator for covariance:
4338 Double_t numerator11 = product11 - term1st11*term2nd11;
4339 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4340 Double_t denominator11 = 0.;
4341 if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
4342 {
4343 denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
4344 if(TMath::Abs(denominator11)>0.)
4345 {
4346 // covariance:
4347 Double_t covariance11 = numerator11/denominator11;
4348 // weight dependent prefactor for covariance:
4349 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
4350 // finally, store "weighted" covariance:
4351 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
4352 } // end of if(TMath::Abs(denominator11)>0.)
4353 } // end of if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
0328db2d 4354
4355 // Cov(<4>,<cos(phi1-phi2-phi3)>):
4356 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
4357 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4358 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4359 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4360 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4361 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
4362 // numerator in the expression for the the unbiased estimator for covariance:
4363 Double_t numerator12 = product12 - term1st12*term2nd12;
4364 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4365 Double_t denominator12 = 0.;
4366 if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
4367 {
4368 denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
4369 if(TMath::Abs(denominator12)>0.)
4370 {
4371 // covariance:
4372 Double_t covariance12 = numerator12/denominator12;
4373 // weight dependent prefactor for covariance:
4374 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
4375 // finally, store "weighted" covariance:
4376 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
4377 } // end of if(TMath::Abs(denominator12)>0.)
4378 } // end of if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
0328db2d 4379
4380 // Cov(<4>,<sin(phi1-phi2-phi3)>):
4381 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
4382 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4383 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4384 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4385 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4386 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
4387 // numerator in the expression for the the unbiased estimator for covariance:
4388 Double_t numerator13 = product13 - term1st13*term2nd13;
4389 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4390 Double_t denominator13 = 0.;
4391 if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
4392 {
4393 denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
4394 if(TMath::Abs(denominator13)>0.)
4395 {
4396 // covariance:
4397 Double_t covariance13 = numerator13/denominator13;
4398 // weight dependent prefactor for covariance:
4399 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
4400 // finally, store "weighted" covariance:
4401 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
4402 } // end of if(TMath::Abs(denominator13)>0.)
4403 } // end of if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
0328db2d 4404
4405 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
4406 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
4407 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4408 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4409 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4410 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4411 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
4412 // numerator in the expression for the the unbiased estimator for covariance:
4413 Double_t numerator14 = product14 - term1st14*term2nd14;
4414 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4415 Double_t denominator14 = 0.;
4416 if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
4417 {
4418 denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
4419 if(TMath::Abs(denominator14)>0.)
4420 {
4421 // covariance:
4422 Double_t covariance14 = numerator14/denominator14;
4423 // weight dependent prefactor for covariance:
4424 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
4425 // finally, store "weighted" covariance:
4426 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
4427 } // end of if(TMath::Abs(denominator14)>0.)
4428 } // end of if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
0328db2d 4429
4430 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
4431 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
4432 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4433 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4434 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4435 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4436 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
4437 // numerator in the expression for the the unbiased estimator for covariance:
4438 Double_t numerator15 = product15 - term1st15*term2nd15;
4439 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4440 Double_t denominator15 = 0.;
4441 if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
4442 {
4443 denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
4444 if(TMath::Abs(denominator15)>0.)
4445 {
4446 // covariance:
4447 Double_t covariance15 = numerator15/denominator15;
4448 // weight dependent prefactor for covariance:
4449 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
4450 // finally, store "weighted" covariance:
4451 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
4452 } // end of if(TMath::Abs(denominator15)>0.)
4453 } // end of if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
4454
0328db2d 4455 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
4456 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
4457 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4458 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4459 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4460 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4461 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
4462 // numerator in the expression for the the unbiased estimator for covariance:
4463 Double_t numerator16 = product16 - term1st16*term2nd16;
4464 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4465 Double_t denominator16 = 0.;
4466 if(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
4467 {
4468 denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
4469 if(TMath::Abs(denominator16)>0.)
4470 {
4471 // covariance:
4472 Double_t covariance16 = numerator16/denominator16;
4473 // weight dependent prefactor for covariance:
4474 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
4475 // finally, store "weighted" covariance:
4476 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
4477 } // end of if(TMath::Abs(denominator16)>0.)
4478 } // end ofif(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
4479
0328db2d 4480 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
4481 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
4482 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4483 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4484 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4485 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4486 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
4487 // numerator in the expression for the the unbiased estimator for covariance:
4488 Double_t numerator17 = product17 - term1st17*term2nd17;
4489 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4490 Double_t denominator17 = 0.;
4491 if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
4492 {
4493 denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
4494 if(TMath::Abs(denominator17)>0.)
4495 {
4496 // covariance:
4497 Double_t covariance17 = numerator17/denominator17;
4498 // weight dependent prefactor for covariance:
4499 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
4500 // finally, store "weighted" covariance:
4501 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
4502 } // end of if(TMath::Abs(denominator17)>0.)
4503 } // end of if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
0328db2d 4504
4505 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
4506 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
4507 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4508 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4509 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4510 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4511 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
4512 // numerator in the expression for the the unbiased estimator for covariance:
4513 Double_t numerator18 = product18 - term1st18*term2nd18;
4514 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4515 Double_t denominator18 = 0.;
4516 if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
4517 {
4518 denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
4519 if(TMath::Abs(denominator18)>0.)
4520 {
4521 // covariance:
4522 Double_t covariance18 = numerator18/denominator18;
4523 // weight dependent prefactor for covariance:
4524 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
4525 // finally, store "weighted" covariance:
4526 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
4527 } // end of if(TMath::Abs(denominator18)>0.)
4528 } // end of if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
0328db2d 4529
4530 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
4531 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
4532 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4533 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4534 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4535 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4536 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
4537 // numerator in the expression for the the unbiased estimator for covariance:
4538 Double_t numerator19 = product19 - term1st19*term2nd19;
4539 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4540 Double_t denominator19 = 0.;
4541 if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
4542 {
4543 denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
4544 if(TMath::Abs(denominator19)>0.)
4545 {
4546 // covariance:
4547 Double_t covariance19 = numerator19/denominator19;
4548 // weight dependent prefactor for covariance:
4549 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
4550 // finally, store "weighted" covariance:
4551 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
4552 } // end of if(TMath::Abs(denominator19)>0.)
4553 } // end of if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
4554
0328db2d 4555 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
4556 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
4557 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4558 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4559 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4560 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4561 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
4562 // numerator in the expression for the the unbiased estimator for covariance:
4563 Double_t numerator20 = product20 - term1st20*term2nd20;
4564 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4565 Double_t denominator20 = 0.;
4566 if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
4567 {
4568 denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
4569 if(TMath::Abs(denominator20)>0.)
4570 {
4571 // covariance:
4572 Double_t covariance20 = numerator20/denominator20;
4573 // weight dependent prefactor for covariance:
4574 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
4575 // finally, store "weighted" covariance:
4576 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
4577 } // end of if(TMath::Abs(denominator20)>0.)
4578 } // end of if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
0328db2d 4579
4580 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
4581 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
4582 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4583 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4584 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4585 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4586 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
4587 // numerator in the expression for the the unbiased estimator for covariance:
4588 Double_t numerator21 = product21 - term1st21*term2nd21;
4589 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4590 Double_t denominator21 = 0.;
4591 if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
4592 {
4593 denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
4594 if(TMath::Abs(denominator21)>0.)
4595 {
4596 // covariance:
4597 Double_t covariance21 = numerator21/denominator21;
4598 // weight dependent prefactor for covariance:
4599 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
4600 // finally, store "weighted" covariance:
4601 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
4602 } // end of if(TMath::Abs(denominator21)>0.)
4603 } // end of if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
0328db2d 4604
4605 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
4606 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
4607 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4608 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4609 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4610 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4611 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
4612 // numerator in the expression for the the unbiased estimator for covariance:
4613 Double_t numerator22 = product22 - term1st22*term2nd22;
4614 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4615 Double_t denominator22 = 0.;
4616 if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
4617 {
4618 denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
4619 if(TMath::Abs(denominator22)>0.)
4620 {
4621 // covariance:
4622 Double_t covariance22 = numerator22/denominator22;
4623 // weight dependent prefactor for covariance:
4624 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
4625 // finally, store "weighted" covariance:
4626 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
4627 } // end of if(TMath::Abs(denominator22)>0.)
4628 } // end of if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
0328db2d 4629
4630 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4631 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
4632 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4633 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4634 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4635 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4636 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4637 // numerator in the expression for the the unbiased estimator for covariance:
4638 Double_t numerator23 = product23 - term1st23*term2nd23;
4639 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4640 Double_t denominator23 = 0.;
4641 if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
4642 {
4643 denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
4644 if(TMath::Abs(denominator23)>0.)
4645 {
4646 // covariance:
4647 Double_t covariance23 = numerator23/denominator23;
4648 // weight dependent prefactor for covariance:
4649 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
4650 // finally, store "weighted" covariance:
4651 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
4652 } // end of if(TMath::Abs(denominator23)>0.)
4653 } // end of if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
4654
0328db2d 4655 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4656 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
4657 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4658 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4659 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4660 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4661 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4662 // numerator in the expression for the the unbiased estimator for covariance:
4663 Double_t numerator24 = product24 - term1st24*term2nd24;
4664 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4665 Double_t denominator24 = 0.;
4666 if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4667 {
4668 denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4669 if(TMath::Abs(denominator24)>0.)
4670 {
4671 // covariance:
4672 Double_t covariance24 = numerator24/denominator24;
4673 // weight dependent prefactor for covariance:
4674 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4675 // finally, store "weighted" covariance:
4676 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
4677 } // end of if(TMath::Abs(denominator24)>0.)
4678 } // end of if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
0328db2d 4679
4680 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4681 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
4682 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4683 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4684 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4685 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4686 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4687 // numerator in the expression for the the unbiased estimator for covariance:
4688 Double_t numerator25 = product25 - term1st25*term2nd25;
4689 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4690 Double_t denominator25 = 0.;
4691 if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4692 {
4693 denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4694 if(TMath::Abs(denominator25)>0.)
4695 {
4696 // covariance:
4697 Double_t covariance25 = numerator25/denominator25;
4698 // weight dependent prefactor for covariance:
4699 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4700 // finally, store "weighted" covariance:
4701 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
4702 } // end of if(TMath::Abs(denominator25)>0.)
4703 } // end of if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4704
0328db2d 4705 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4706 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
4707 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4708 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4709 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4710 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4711 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4712 // numerator in the expression for the the unbiased estimator for covariance:
4713 Double_t numerator26 = product26 - term1st26*term2nd26;
4714 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4715 Double_t denominator26 = 0.;
4716 if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4717 {
4718 denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4719 if(TMath::Abs(denominator26)>0.)
4720 {
4721 // covariance:
4722 Double_t covariance26 = numerator26/denominator26;
4723 // weight dependent prefactor for covariance:
4724 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4725 // finally, store "weighted" covariance:
4726 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
4727 } // end of if(TMath::Abs(denominator26)>0.)
4728 } // end of if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4729
0328db2d 4730 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
4731 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
b92ea2b9 4732 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
0328db2d 4733 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
b92ea2b9 4734 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
0328db2d 4735 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4736 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
4737 // numerator in the expression for the the unbiased estimator for covariance:
4738 Double_t numerator27 = product27 - term1st27*term2nd27;
4739 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4740 Double_t denominator27 = 0.;
4741 if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4742 {
4743 denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4744 if(TMath::Abs(denominator27)>0.)
4745 {
4746 // covariance:
4747 Double_t covariance27 = numerator27/denominator27;
4748 // weight dependent prefactor for covariance:
4749 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4750 // finally, store "weighted" covariance:
4751 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
4752 } // end of if(TMath::Abs(denominator27)>0.)
4753 } // end of if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4754
0328db2d 4755} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4756
0328db2d 4757//================================================================================================================================
4758
489d5531 4759void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4760{
4761 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
4762 // correctly calculate the statistical errors and store the final results and
4763 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
4764 //
4765 // Remark: Statistical error of correlation is calculated as:
4766 //
4767 // statistical error = termA * spread * termB:
4768 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
4769 // termB = 1/sqrt(1-termA^2)
b3dacf6b 4770 //
4771
489d5531 4772 for(Int_t ci=1;ci<=4;ci++) // correlation index
4773 {
b40a910e 4774 if(fIntFlowCorrelationsPro->GetBinEffectiveEntries(ci) < 2 || fIntFlowSquaredCorrelationsPro->GetBinEffectiveEntries(ci) < 2)
4775 {
4776 fIntFlowCorrelationsPro->SetBinError(ci,0.);
4777 fIntFlowSquaredCorrelationsPro->SetBinError(ci,0.);
4778 continue;
4779 }
489d5531 4780 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
b40a910e 4781 Double_t squaredCorrelation = fIntFlowSquaredCorrelationsPro->GetBinContent(ci);
4782 Double_t spread = 0.;
4783 if(squaredCorrelation-correlation*correlation >= 0.)
4784 {
4785 spread = pow(squaredCorrelation-correlation*correlation,0.5);
4786 } else
4787 {
4788 cout<<endl;
4789 cout<<Form(" WARNING: Imaginary 'spread' for %d-particle correlation!!!! ",2*ci)<<endl;
4790 cout<<endl;
4791 }
489d5531 4792 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
4793 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
4794 Double_t termA = 0.;
4795 Double_t termB = 0.;
b3dacf6b 4796 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
489d5531 4797 {
4798 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
4799 } else
4800 {
b3dacf6b 4801 cout<<endl;
4802 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4803 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4804 cout<<endl;
489d5531 4805 }
4806 if(1.-pow(termA,2.) > 0.)
4807 {
4808 termB = 1./pow(1-pow(termA,2.),0.5);
4809 } else
4810 {
b3dacf6b 4811 cout<<endl;
4812 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4813 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4814 cout<<endl;
489d5531 4815 }
4816 Double_t statisticalError = termA * spread * termB;
4817 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
4818 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
ff70ca91 4819 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4820
b3dacf6b 4821 // Versus multiplicity:
4822 if(!fCalculateCumulantsVsM){return;}
ff70ca91 4823 for(Int_t ci=0;ci<=3;ci++) // correlation index
4824 {
4825 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
4826 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
4827 {
b40a910e 4828 if(fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2 || fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2)
4829 {
4830 fIntFlowCorrelationsVsMPro[ci]->SetBinError(b,0.);
4831 fIntFlowSquaredCorrelationsVsMPro[ci]->SetBinError(b,0.);
4832 continue;
4833 }
ff70ca91 4834 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
b40a910e 4835 Double_t squaredCorrelationVsM = fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinContent(b);
4836 Double_t spreadVsM = 0.;
4837 if(squaredCorrelationVsM-correlationVsM*correlationVsM >= 0.)
4838 {
4839 spreadVsM = pow(squaredCorrelationVsM-correlationVsM*correlationVsM,0.5);
4840 } else
4841 {
4842 cout<<endl;
4843 cout<<Form(" WARNING (QC): Imaginary 'spreadVsM' for ci = %d, bin = %d, entries = %f !!!!",
4844 ci,b,fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b))<<endl;
4845 cout<<endl;
4846 }
ff70ca91 4847 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
4848 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
4849 Double_t termAVsM = 0.;
4850 Double_t termBVsM = 0.;
b40a910e 4851 if(sumOfLinearEventWeightsVsM > 0.)
ff70ca91 4852 {
4853 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
b3dacf6b 4854 }
ff70ca91 4855 if(1.-pow(termAVsM,2.) > 0.)
4856 {
4857 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
b3dacf6b 4858 }
ff70ca91 4859 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
4860 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
4861 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
4862 } // end of for(Int_t b=1;b<=nBins;b++)
4863 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4864
489d5531 4865} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4866
489d5531 4867//================================================================================================================================
4868
489d5531 4869void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
4870{
b77b6434 4871 // Fill profile fAverageMultiplicity to hold average multiplicities and
4872 // number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
489d5531 4873
4874 // Binning of fAverageMultiplicity is organized as follows:
4875 // 1st bin: all events (including the empty ones)
4876 // 2nd bin: event with # of RPs greater or equal to 1
4877 // 3rd bin: event with # of RPs greater or equal to 2
4878 // 4th bin: event with # of RPs greater or equal to 3
4879 // 5th bin: event with # of RPs greater or equal to 4
4880 // 6th bin: event with # of RPs greater or equal to 5
4881 // 7th bin: event with # of RPs greater or equal to 6
4882 // 8th bin: event with # of RPs greater or equal to 7
4883 // 9th bin: event with # of RPs greater or equal to 8
4884
489d5531 4885 if(nRP<0)
4886 {
b77b6434 4887 cout<<endl;
4888 cout<<" WARNING (QC): nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
4889 cout<<endl;
489d5531 4890 exit(0);
4891 }
4892
4893 for(Int_t i=0;i<9;i++)
4894 {
b77b6434 4895 if(nRP>=i){fAvMultiplicity->Fill(i+0.5,nRP,1);}
489d5531 4896 }
4897
4898} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
4899
489d5531 4900//================================================================================================================================
4901
489d5531 4902void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
b3dacf6b 4903{
b92ea2b9 4904 // a) Calculate Q-cumulants from the measured multiparticle correlations;
4905 // b) Propagate the statistical errors from measured multiparticle correlations to statistical errors of Q-cumulants;
4906 // c) Remark: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
4907 // Method CalculateQcumulantsCorrectedForNUAIntFlow() is called afterwards to correct for this bias;
4908 // d) Store the results and statistical error of Q-cumulants in histogram fIntFlowQcumulants.
4909 // Binning of fIntFlowQcumulants is organized as follows:
489d5531 4910 //
b3dacf6b 4911 // 1st bin: QC{2}
4912 // 2nd bin: QC{4}
4913 // 3rd bin: QC{6}
4914 // 4th bin: QC{8}
4915 //
489d5531 4916
b3dacf6b 4917 // Correlations:
489d5531 4918 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4919 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4920 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4921 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
b3dacf6b 4922 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
489d5531 4923 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4924 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4925 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4926 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
b3dacf6b 4927 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 4928 Double_t wCov24 = 0.; // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4929 Double_t wCov26 = 0.; // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4930 Double_t wCov28 = 0.; // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4931 Double_t wCov46 = 0.; // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4932 Double_t wCov48 = 0.; // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4933 Double_t wCov68 = 0.; // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4934 if(!fForgetAboutCovariances)
4935 {
4936 wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4937 wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4938 wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4939 wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4940 wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4941 wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4942 }
489d5531 4943 // Q-cumulants:
4944 Double_t qc2 = 0.; // QC{2}
4945 Double_t qc4 = 0.; // QC{4}
4946 Double_t qc6 = 0.; // QC{6}
4947 Double_t qc8 = 0.; // QC{8}
b3dacf6b 4948 if(TMath::Abs(two) > 0.){qc2 = two;}
4949 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4950 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4951 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4952 // Statistical errors of Q-cumulants:
489d5531 4953 Double_t qc2Error = 0.;
4954 Double_t qc4Error = 0.;
4955 Double_t qc6Error = 0.;
b3dacf6b 4956 Double_t qc8Error = 0.;
4957 // Squared statistical errors of Q-cumulants:
489d5531 4958 //Double_t qc2ErrorSquared = 0.;
4959 Double_t qc4ErrorSquared = 0.;
4960 Double_t qc6ErrorSquared = 0.;
b3dacf6b 4961 Double_t qc8ErrorSquared = 0.;
4962 // Statistical error of QC{2}:
4963 qc2Error = twoError;
4964 // Statistical error of QC{4}:
489d5531 4965 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4966 - 8.*two*wCov24;
4967 if(qc4ErrorSquared>0.)
4968 {
4969 qc4Error = pow(qc4ErrorSquared,0.5);
4970 } else
4971 {
b3dacf6b 4972 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
4973 }
4974 // Statistical error of QC{6}:
489d5531 4975 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4976 + 81.*pow(two,2.)*pow(fourError,2.)
4977 + pow(sixError,2.)
4978 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4979 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 4980 - 18.*two*wCov46;
489d5531 4981 if(qc6ErrorSquared>0.)
4982 {
4983 qc6Error = pow(qc6ErrorSquared,0.5);
4984 } else
4985 {
b3dacf6b 4986 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
4987 }
4988 // Statistical error of QC{8}:
489d5531 4989 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4990 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4991 + 256.*pow(two,2.)*pow(sixError,2.)
4992 + pow(eightError,2.)
4993 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4994 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4995 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4996 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4997 + 72.*(4.*pow(two,2.)-four)*wCov48
4998 - 32.*two*wCov68;
4999 if(qc8ErrorSquared>0.)
5000 {
5001 qc8Error = pow(qc8ErrorSquared,0.5);
5002 } else
5003 {
b3dacf6b 5004 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
489d5531 5005 }
b3dacf6b 5006 // Store the results and statistical errors for Q-cumulants:
5007 if(TMath::Abs(qc2)>0.)
5008 {
5009 fIntFlowQcumulants->SetBinContent(1,qc2);
5010 fIntFlowQcumulants->SetBinError(1,qc2Error);
5011 }
5012 if(TMath::Abs(qc4)>0.)
5013 {
5014 fIntFlowQcumulants->SetBinContent(2,qc4);
5015 fIntFlowQcumulants->SetBinError(2,qc4Error);
5016 }
5017 if(TMath::Abs(qc6)>0.)
5018 {
5019 fIntFlowQcumulants->SetBinContent(3,qc6);
5020 fIntFlowQcumulants->SetBinError(3,qc6Error);
5021 }
5022 if(TMath::Abs(qc8)>0.)
5023 {
5024 fIntFlowQcumulants->SetBinContent(4,qc8);
5025 fIntFlowQcumulants->SetBinError(4,qc8Error);
5026 }
5027
5028 // Versus multiplicity:
5029 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 5030 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b3dacf6b 5031 Double_t value[4] = {0.}; // QCs vs M
5032 Double_t error[4] = {0.}; // error of QCs vs M
5033 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
5034 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
9da1a4f3 5035 for(Int_t b=1;b<=nBins;b++)
5036 {
b3dacf6b 5037 // Correlations:
9da1a4f3 5038 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
5039 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
5040 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
5041 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
b3dacf6b 5042 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
9da1a4f3 5043 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
5044 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
5045 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
5046 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
b3dacf6b 5047 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 5048 if(!fForgetAboutCovariances)
5049 {
5050 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
5051 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
5052 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
5053 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
5054 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
5055 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
5056 }
9da1a4f3 5057 // Q-cumulants:
5058 qc2 = 0.; // QC{2}
5059 qc4 = 0.; // QC{4}
5060 qc6 = 0.; // QC{6}
5061 qc8 = 0.; // QC{8}
b3dacf6b 5062 if(TMath::Abs(two) > 0.){qc2 = two;}
5063 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
5064 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
5065 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
5066 // Statistical errors of Q-cumulants:
9da1a4f3 5067 qc2Error = 0.;
5068 qc4Error = 0.;
5069 qc6Error = 0.;
b3dacf6b 5070 qc8Error = 0.;
5071 // Squared statistical errors of Q-cumulants:
9da1a4f3 5072 //Double_t qc2ErrorSquared = 0.;
5073 qc4ErrorSquared = 0.;
5074 qc6ErrorSquared = 0.;
b3dacf6b 5075 qc8ErrorSquared = 0.;
5076 // Statistical error of QC{2}:
5077 qc2Error = twoError;
5078 // Statistical error of QC{4}:
9da1a4f3 5079 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
5080 - 8.*two*wCov24;
5081 if(qc4ErrorSquared>0.)
5082 {
5083 qc4Error = pow(qc4ErrorSquared,0.5);
5084 } else
5085 {
5086 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 5087 }
5088 // Statistical error of QC{6}:
9da1a4f3 5089 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
5090 + 81.*pow(two,2.)*pow(fourError,2.)
5091 + pow(sixError,2.)
5092 - 162.*two*(4.*pow(two,2.)-four)*wCov24
5093 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 5094 - 18.*two*wCov46;
9da1a4f3 5095 if(qc6ErrorSquared>0.)
5096 {
5097 qc6Error = pow(qc6ErrorSquared,0.5);
5098 } else
5099 {
5100 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 5101 }
5102 // Statistical error of QC{8}:
9da1a4f3 5103 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
5104 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
5105 + 256.*pow(two,2.)*pow(sixError,2.)
5106 + pow(eightError,2.)
5107 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
5108 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
5109 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
5110 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
5111 + 72.*(4.*pow(two,2.)-four)*wCov48
5112 - 32.*two*wCov68;
5113 if(qc8ErrorSquared>0.)
5114 {
5115 qc8Error = pow(qc8ErrorSquared,0.5);
5116 } else
5117 {
5118 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
5119 }
b3dacf6b 5120 // Store the results and statistical errors for Q-cumulants:
5121 if(TMath::Abs(qc2)>0.)
5122 {
5123 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
5124 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
5125 }
5126 if(TMath::Abs(qc4)>0.)
5127 {
5128 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
5129 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
5130 }
5131 if(TMath::Abs(qc6)>0.)
5132 {
5133 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
5134 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
5135 }
5136 if(TMath::Abs(qc8)>0.)
5137 {
5138 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
5139 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
5140 }
5141 // Rebin in M:
5142 for(Int_t co=0;co<4;co++)
5143 {
b40a910e 5144 if(fIntFlowCorrelationsVsMPro[co]->GetBinEffectiveEntries(b)<2){continue;}
b3dacf6b 5145 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
5146 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
5147 if(error[co]>0.)
5148 {
5149 dSum1[co]+=value[co]/(error[co]*error[co]);
5150 dSum2[co]+=1./(error[co]*error[co]);
5151 }
5152 } // end of for(Int_t co=0;co<4;co++)
9da1a4f3 5153 } // end of for(Int_t b=1;b<=nBins;b++)
b3dacf6b 5154 // Store rebinned Q-cumulants:
5155 for(Int_t co=0;co<4;co++)
5156 {
5157 if(dSum2[co]>0.)
5158 {
5159 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
5160 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
5161 }
5162 } // end of for(Int_t co=0;co<4;co++)
5163
489d5531 5164} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
5165
489d5531 5166//================================================================================================================================
5167
b92ea2b9 5168void AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 5169{
b92ea2b9 5170 // a) Calculate the final results for reference flow estimates from Q-cumulants;
5171 // b) Propagate the statistical errors to reference flow estimates from statistical error of Q-cumulants;
0328db2d 5172 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
489d5531 5173 // Binning of fIntFlow is organized as follows:
5174 //
b3dacf6b 5175 // 1st bin: v{2,QC}
5176 // 2nd bin: v{4,QC}
5177 // 3rd bin: v{6,QC}
5178 // 4th bin: v{8,QC}
5179 //
489d5531 5180
b3dacf6b 5181 // Reference flow estimates:
489d5531 5182 Double_t v2 = 0.; // v{2,QC}
5183 Double_t v4 = 0.; // v{4,QC}
5184 Double_t v6 = 0.; // v{6,QC}
5185 Double_t v8 = 0.; // v{8,QC}
b3dacf6b 5186 // Reference flow's statistical errors:
5187 Double_t v2Error = 0.; // v{2,QC} stat. error
5188 Double_t v4Error = 0.; // v{4,QC} stat. error
5189 Double_t v6Error = 0.; // v{6,QC} stat. error
5190 Double_t v8Error = 0.; // v{8,QC} stat. error
5191
b92ea2b9 5192 // Q-cumulants:
5193 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
5194 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
5195 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
5196 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
5197 // Q-cumulants's statistical errors:
5198 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
5199 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
5200 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
5201 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
5202 // Calculate reference flow estimates from Q-cumulants:
1268c371 5203 if(qc2>=0.){v2 = pow(qc2,0.5);}
b92ea2b9 5204 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
5205 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
5206 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
5207 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 5208 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-0.5)*qc2Error;}
b92ea2b9 5209 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
5210 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
5211 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
5212 // Print warnings for the 'wrong sign' cumulants:
5213 if(TMath::Abs(v2) < 1.e-44)
5214 {
5215 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
5216 }
5217 if(TMath::Abs(v4) < 1.e-44)
5218 {
5219 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
5220 }
5221 if(TMath::Abs(v6) < 1.e-44)
5222 {
5223 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
5224 }
5225 if(TMath::Abs(v8) < 1.e-44)
5226 {
5227 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
5228 }
5229 // Store the results and statistical errors of integrated flow estimates:
5230 fIntFlow->SetBinContent(1,v2);
5231 fIntFlow->SetBinError(1,v2Error);
5232 fIntFlow->SetBinContent(2,v4);
5233 fIntFlow->SetBinError(2,v4Error);
5234 fIntFlow->SetBinContent(3,v6);
5235 fIntFlow->SetBinError(3,v6Error);
5236 fIntFlow->SetBinContent(4,v8);
5237 fIntFlow->SetBinError(4,v8Error);
5238
5239 // Versus multiplicity:
5240 if(!fCalculateCumulantsVsM){return;}
5241 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
5242 for(Int_t b=1;b<=nBins;b++)
9da1a4f3 5243 {
5244 // Q-cumulants:
b92ea2b9 5245 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
5246 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
5247 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
5248 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
b3dacf6b 5249 // Q-cumulants's statistical errors:
b92ea2b9 5250 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
5251 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
5252 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
5253 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
b3dacf6b 5254 // Reference flow estimates:
b92ea2b9 5255 Double_t v2VsM = 0.; // v{2,QC}
5256 Double_t v4VsM = 0.; // v{4,QC}
5257 Double_t v6VsM = 0.; // v{6,QC}
5258 Double_t v8VsM = 0.; // v{8,QC}
5259 // Reference flow estimates errors:
5260 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
5261 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
5262 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
5263 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
b3dacf6b 5264 // Calculate reference flow estimates from Q-cumulants:
1268c371 5265 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,0.5);}
b92ea2b9 5266 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
5267 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
5268 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
b3dacf6b 5269 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 5270 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-0.5)*qc2ErrorVsM;}
b92ea2b9 5271 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
5272 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
5273 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
b3dacf6b 5274 // Store the results and statistical errors of integrated flow estimates:
b92ea2b9 5275 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
5276 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
5277 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
5278 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
5279 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
5280 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
5281 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
5282 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
5283 } // end of for(Int_t b=1;b<=nBins;b++)
5284
5285 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
5286 // Reference flow estimates:
5287 Double_t v2RebinnedInM = 0.; // v{2,QC}
5288 Double_t v4RebinnedInM = 0.; // v{4,QC}
5289 Double_t v6RebinnedInM = 0.; // v{6,QC}
5290 Double_t v8RebinnedInM = 0.; // v{8,QC}
5291 // Reference flow's statistical errors:
5292 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
5293 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
5294 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
5295 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
5296 // Q-cumulants:
5297 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
5298 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
5299 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
5300 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
5301 // Q-cumulants's statistical errors:
5302 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
5303 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
5304 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
5305 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
5306 // Calculate reference flow estimates from Q-cumulants:
1268c371 5307 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,0.5);}
b92ea2b9 5308 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
5309 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
5310 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
5311 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 5312 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-0.5)*qc2ErrorRebinnedInM;}
b92ea2b9 5313 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
5314 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
5315 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
5316 // Print warnings for the 'wrong sign' cumulants:
5317 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
5318 {
5319 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
5320 }
5321 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
5322 {
5323 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
5324 }
5325 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
5326 {
5327 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
5328 }
5329 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
5330 {
5331 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
5332 }
5333 // Store the results and statistical errors of integrated flow estimates:
5334 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
5335 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
5336 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
5337 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
5338 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
5339 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
5340 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
5341 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
5342
5343} // end of AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 5344
489d5531 5345//================================================================================================================================
5346
489d5531 5347void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
5348{
0dd3b008 5349 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
489d5531 5350
0dd3b008 5351 // There are two possibilities here:
5352 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
5353 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
5354 // also stored in local histogram fIntFlow;
5355 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
5356 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
5357 // is also stored in local histogram fIntFlowRebinnedInM.
489d5531 5358
0dd3b008 5359 // Reference flow estimates:
5360 Double_t v[4] = {0.};
5361 // Statistical errors of reference flow estimates:
5362 Double_t vError[4] = {0.};
489d5531 5363
0dd3b008 5364 for(Int_t b=0;b<4;b++)
5365 {
5366 if(fMinimumBiasReferenceFlow)
5367 {
5368 v[b] = fIntFlow->GetBinContent(b+1);
5369 vError[b] = fIntFlow->GetBinError(b+1);
5370 } else
5371 {
5372 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
5373 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
5374 }
5375 } // end of for(Int_t b=0;b<4;b++)
5376
5377 // Fill AliFlowCommonHistResults histogram:
5378 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
5379 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
403e3389 5380 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)) // to be improved (calculate also 6th and 8th order)
489d5531 5381 {
0dd3b008 5382 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
5383 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
489d5531 5384 }
5385
5386} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
5387
489d5531 5388//================================================================================================================================
5389
489d5531 5390void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
5391{
5392 // Calculate all correlations needed for integrated flow using particle weights.
5393
5394 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
5395 //
5396 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
5397 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
5398 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
5399 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
5400 // 5th bin: ---- EMPTY ----
5401 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5402 // 7th bin: <3>_{3n|2n,1n} = ...
5403 // 8th bin: <3>_{4n|2n,2n} = ...
5404 // 9th bin: <3>_{4n|3n,1n} = ...
5405 // 10th bin: ---- EMPTY ----
5406 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5407 // 12th bin: <4>_{2n,1n|2n,1n} = ...
5408 // 13th bin: <4>_{2n,2n|2n,2n} = ...
5409 // 14th bin: <4>_{3n|1n,1n,1n} = ...
5410 // 15th bin: <4>_{3n,1n|3n,1n} = ...
5411 // 16th bin: <4>_{3n,1n|2n,2n} = ...
5412 // 17th bin: <4>_{4n|2n,1n,1n} = ...
5413 // 18th bin: ---- EMPTY ----
5414 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
5415 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
5416 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
5417 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
5418 // 23rd bin: ---- EMPTY ----
5419 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
5420 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
5421 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
5422 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
5423 // 28th bin: ---- EMPTY ----
5424 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
5425 // 30th bin: ---- EMPTY ----
5426 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
5427
5428 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
5429 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
5430
5431 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
5432 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
5433
5434 // multiplicity (number of particles used to determine the reaction plane)
1268c371 5435 Double_t dMult = (*fSpk)(0,0);
489d5531 5436
5437 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5438 Double_t dReQ1n1k = (*fReQ)(0,1);
5439 Double_t dReQ2n2k = (*fReQ)(1,2);
5440 Double_t dReQ3n3k = (*fReQ)(2,3);
5441 Double_t dReQ4n4k = (*fReQ)(3,4);
5442 Double_t dReQ1n3k = (*fReQ)(0,3);
5443 Double_t dImQ1n1k = (*fImQ)(0,1);
5444 Double_t dImQ2n2k = (*fImQ)(1,2);
5445 Double_t dImQ3n3k = (*fImQ)(2,3);
5446 Double_t dImQ4n4k = (*fImQ)(3,4);
5447 Double_t dImQ1n3k = (*fImQ)(0,3);
5448
5449 // dMs are variables introduced in order to simplify some Eqs. bellow:
5450 //..............................................................................................
1268c371 5451 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
5452 Double_t dM22 = (*fSpk)(1,2)-(*fSpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
5453 Double_t dM33 = (*fSpk)(1,3)-(*fSpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
5454 Double_t dM44 = (*fSpk)(1,4)-(*fSpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
5455 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
5456 Double_t dM211 = (*fSpk)(0,2)*(*fSpk)(1,1)-2.*(*fSpk)(0,3)*(*fSpk)(0,1)
5457 - (*fSpk)(1,2)+2.*(*fSpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
5458 Double_t dM1111 = (*fSpk)(3,1)-6.*(*fSpk)(0,2)*(*fSpk)(1,1)
5459 + 8.*(*fSpk)(0,3)*(*fSpk)(0,1)
5460 + 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 5461 //..............................................................................................
5462
5463 // 2-particle correlations:
5464 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
5465 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
5466 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
5467 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
5468 if(dMult>1)
5469 {
5470 if(dM11)
5471 {
1268c371 5472 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))/dM11;
489d5531 5473 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
5474 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
5475 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
5476 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
b40a910e 5477 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
5478 // average squared correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
5479 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1nW1W1*two1n1nW1W1,dM11);
489d5531 5480 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
5481 }
5482 if(dM22)
5483 {
1268c371 5484 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSpk)(0,4))/dM22;
489d5531 5485 // ...
5486 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
5487 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
5488 }
5489 if(dM33)
5490 {
1268c371 5491 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSpk)(0,6))/dM33;
489d5531 5492 // ...
5493 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
5494 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
5495 }
5496 if(dM44)
5497 {
1268c371 5498 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSpk)(0,8))/dM44;
489d5531 5499 // ...
5500 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
5501 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
5502 }
5503 } // end of if(dMult>1)
5504
5505 // extra 2-particle correlations:
5506 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
5507 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
5508 if(dMult>1)
5509 {
5510 if(dM31)
5511 {
1268c371 5512 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSpk)(0,4))/dM31;
489d5531 5513 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
5514 }
5515 if(dM211)
5516 {
1268c371 5517 two1n1nW1W1W2 = ((*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))
489d5531 5518 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
1268c371 5519 - (*fSpk)(0,4)))/dM211;
489d5531 5520 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
5521 }
5522 } // end of if(dMult>1)
5523 //..............................................................................................
5524
5525 //..............................................................................................
5526 // 3-particle correlations:
5527 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5528
5529 if(dMult>2)
5530 {
5531 if(dM211)
5532 {
5533 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
5534 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5535 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
1268c371 5536 + 2.*(*fSpk)(0,4))/dM211;
489d5531 5537 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
5538 }
5539 } // end of if(dMult>2)
5540 //..............................................................................................
5541
5542 //..............................................................................................
5543 // 4-particle correlations:
5544 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5545 if(dMult>3)
5546 {
5547 if(dM1111)
5548 {
5549 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
5550 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
5551 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5552 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
1268c371 5553 - 4.*(*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
5554 - 6.*(*fSpk)(0,4)+2.*(*fSpk)(1,2))/dM1111;
489d5531 5555
5556 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
5557 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
5558 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
5559 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5560 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
b40a910e 5561 // average squared correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5562 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1*four1n1n1n1nW1W1W1W1,dM1111);
489d5531 5563 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
5564 }
5565 } // end of if(dMult>3)
5566 //..............................................................................................
5567
5568} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
5569
489d5531 5570//================================================================================================================================
5571
489d5531 5572void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5573{
5574 // Initialize all arrays used to calculate integrated flow.
5575
5576 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5577 {
5578 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
0328db2d 5579 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
489d5531 5580 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
5581 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
b92ea2b9 5582 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 5583 {
5584 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
5585 }
0328db2d 5586 for(Int_t power=0;power<2;power++) // linear or quadratic
5587 {
5588 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
5589 }
489d5531 5590 }
5591 for(Int_t power=0;power<2;power++) // linear or quadratic
5592 {
5593 fIntFlowSumOfEventWeights[power] = NULL;
5594 }
b3dacf6b 5595 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 5596 {
5597 fPrintFinalResults[i] = kTRUE;
5598 }
ff70ca91 5599 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
5600 {
5601 fIntFlowCorrelationsVsMPro[ci] = NULL;
b40a910e 5602 fIntFlowSquaredCorrelationsVsMPro[ci] = NULL;
ff70ca91 5603 fIntFlowCorrelationsVsMHist[ci] = NULL;
5604 fIntFlowQcumulantsVsM[ci] = NULL;
5605 fIntFlowVsM[ci] = NULL;
2001bc3a 5606 fIntFlowDetectorBiasVsM[ci] = NULL;
ff70ca91 5607 for(Int_t lc=0;lc<2;lc++)
5608 {
5609 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
5610 }
5611 }
5612 for(Int_t pi=0;pi<6;pi++) // product or covariance index
5613 {
5614 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
5615 fIntFlowCovariancesVsM[pi] = NULL;
5616 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
5617 }
403e3389 5618 for(Int_t ci=0;ci<64;ci++) // correlation index for all correlations vs M profiles (to be improved - hardwired 64)
3435cacb 5619 {
5620 fIntFlowCorrelationsAllVsMPro[ci] = NULL;
5621 }
5622
489d5531 5623} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5624
489d5531 5625//================================================================================================================================
5626
489d5531 5627void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5628{
5629 // Initialize all arrays needed to calculate differential flow.
5630 // a) Initialize lists holding profiles;
5631 // b) Initialize lists holding histograms;
5632 // c) Initialize event-by-event quantities;
5633 // d) Initialize profiles;
5634 // e) Initialize histograms holding final results.
5635
5636 // a) Initialize lists holding profiles;
5637 for(Int_t t=0;t<2;t++) // type (RP, POI)
5638 {
5639 for(Int_t pe=0;pe<2;pe++) // pt or eta
5640 {
5641 fDiffFlowCorrelationsProList[t][pe] = NULL;
5642 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
5643 fDiffFlowCorrectionsProList[t][pe] = NULL;
5644 }
1268c371 5645 // 2D:
5646 f2DDiffFlowCorrelationsProList[t] = NULL;
489d5531 5647 }
5648
5649 // b) Initialize lists holding histograms;
5650 for(Int_t t=0;t<2;t++) // type (RP, POI)
5651 {
5652 for(Int_t pe=0;pe<2;pe++) // pt or eta
5653 {
5654 fDiffFlowCorrelationsHistList[t][pe] = NULL;
5655 for(Int_t power=0;power<2;power++)
5656 {
5657 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
5658 } // end of for(Int_t power=0;power<2;power++)
5659 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
5660 fDiffFlowCorrectionsHistList[t][pe] = NULL;
5661 fDiffFlowCovariancesHistList[t][pe] = NULL;
5662 fDiffFlowCumulantsHistList[t][pe] = NULL;
1268c371 5663 fDiffFlowDetectorBiasHistList[t][pe] = NULL;
489d5531 5664 fDiffFlowHistList[t][pe] = NULL;
5665 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5666 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
5667
5668 // c) Initialize event-by-event quantities:
5669 // 1D:
5670 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5671 {
5672 for(Int_t pe=0;pe<2;pe++) // pt or eta
5673 {
5674 for(Int_t m=0;m<4;m++) // multiple of harmonic
5675 {
5676 for(Int_t k=0;k<9;k++) // power of weight
5677 {
5678 fReRPQ1dEBE[t][pe][m][k] = NULL;
5679 fImRPQ1dEBE[t][pe][m][k] = NULL;
5680 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5681 }
5682 }
5683 }
5684 }
5685 // 1D:
5686 for(Int_t t=0;t<2;t++) // type (RP or POI)
5687 {
5688 for(Int_t pe=0;pe<2;pe++) // pt or eta
5689 {
5690 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5691 {
5692 for(Int_t cti=0;cti<9;cti++) // correction term index
5693 {
5694 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
5695 }
5696 }
5697 }
5698 }
5699 // 2D:
5700 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5701 {
5702 for(Int_t m=0;m<4;m++) // multiple of harmonic
5703 {
5704 for(Int_t k=0;k<9;k++) // power of weight
5705 {
5706 fReRPQ2dEBE[t][m][k] = NULL;
5707 fImRPQ2dEBE[t][m][k] = NULL;
5708 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5709 }
5710 }
5711 }
5712
5713 // d) Initialize profiles:
5714 for(Int_t t=0;t<2;t++) // type: RP or POI
5715 {
5716 for(Int_t pe=0;pe<2;pe++) // pt or eta
5717 {
5718 for(Int_t ci=0;ci<4;ci++) // correlation index
5719 {
5720 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
b40a910e 5721 fDiffFlowSquaredCorrelationsPro[t][pe][ci] = NULL;
489d5531 5722 } // end of for(Int_t ci=0;ci<4;ci++)
5723 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5724 {
5725 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5726 {
5727 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
5728 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5729 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5730 // correction terms for nua:
5731 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5732 {
5733 for(Int_t cti=0;cti<9;cti++) // correction term index
5734 {
5735 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
5736 }
5737 }
64e500e3 5738 // other differential correlators:
5739 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5740 {
5741 for(Int_t ci=0;ci<1;ci++) // correction term index
5742 {
5743 fOtherDiffCorrelators[t][pe][sc][ci] = NULL;
5744 }
5745 }
489d5531 5746 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1268c371 5747 for(Int_t ci=0;ci<4;ci++) // correlation index
5748 {
5749 f2DDiffFlowCorrelationsPro[t][ci] = NULL;
5750 }
489d5531 5751 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5752
5753 // e) Initialize histograms holding final results.
5754 for(Int_t t=0;t<2;t++) // type: RP or POI
5755 {
5756 for(Int_t pe=0;pe<2;pe++) // pt or eta
5757 {
5758 for(Int_t ci=0;ci<4;ci++) // correlation index
5759 {
5760 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
5761 fDiffFlowCumulants[t][pe][ci] = NULL;
1268c371 5762 fDiffFlowDetectorBias[t][pe][ci] = NULL;
489d5531 5763 fDiffFlow[t][pe][ci] = NULL;
5764 } // end of for(Int_t ci=0;ci<4;ci++)
5765 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5766 {
5767 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
5768 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5769 // correction terms for nua:
5770 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5771 {
5772 for(Int_t cti=0;cti<9;cti++) // correction term index
5773 {
5774 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
5775 }
5776 }
5777 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1268c371 5778 for(Int_t ci=0;ci<4;ci++) // correlation index
5779 {
5780 f2DDiffFlowCumulants[t][ci] = NULL;
5781 f2DDiffFlow[t][ci] = NULL;
5782 }
489d5531 5783 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5784
5785 // sum of event weights for reduced correlations:
5786 for(Int_t t=0;t<2;t++) // type = RP or POI
5787 {
5788 for(Int_t pe=0;pe<2;pe++) // pt or eta
5789 {
5790 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
5791 {
5792 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
5793 {
5794 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
5795 }
5796 }
5797 }
5798 }
5799 // product of event weights for both types of correlations:
5800 for(Int_t t=0;t<2;t++) // type = RP or POI
5801 {
5802 for(Int_t pe=0;pe<2;pe++) // pt or eta
5803 {
5804 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5805 {
5806 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5807 {
5808 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
5809 }
5810 }
5811 }
5812 }
1268c371 5813
5814} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5815
5816//================================================================================================================================
489d5531 5817
1268c371 5818void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5819{
5820 // Calculate differential flow cumulants from measured multiparticle correlations.
489d5531 5821
1268c371 5822 // REMARK: Cumulants calculated in this method are NOT corrected for non-uniform acceptance.
5823 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied
5824 // in the method CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
489d5531 5825
1268c371 5826 Int_t t = 0;
5827 Int_t pe = 0;
5828
5829 if(type == "RP")
5830 {
5831 t = 0;
5832 } else if(type == "POI")
5833 {
5834 t = 1;
5835 }
5836
5837 if(ptOrEta == "Pt")
5838 {
5839 pe = 0;
5840 } else if(ptOrEta == "Eta")
5841 {
5842 pe = 1;
5843 }
5844
5845 // Common:
5846 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 5847
1268c371 5848 // Correlation <<2>>:
5849 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5850 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
489d5531 5851
1268c371 5852 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
489d5531 5853 {
1268c371 5854 // Reduced correlations:
5855 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
5856 Double_t twoPrimeError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b); // stat. error of <<2'>>
5857 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
5858 Double_t fourPrimeError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b); // stat. error of <<4'>>
5859 // Covariances:
5860 Double_t wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b); // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
5861 Double_t wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b); // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
5862 Double_t wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b); // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
5863 // QC{2'}:
5864 Double_t qc2Prime = twoPrime; // QC{2'}
5865 Double_t qc2PrimeError = twoPrimeError; // stat. error of QC{2'}
5866 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5867 fDiffFlowCumulants[t][pe][0]->SetBinError(b,qc2PrimeError);
5868 // QC{4'}:
5869 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5870 Double_t qc4PrimeError = 0.; // stat. error of QC{4'}
5871 Double_t qc4PrimeErrorSquared = 4.*pow(twoPrime,2.)*pow(twoError,2.)
5872 + 4.*pow(two,2.)*pow(twoPrimeError,2.)
5873 + pow(fourPrimeError,2.)
5874 + 8.*two*twoPrime*wCovTwoTwoReduced
5875 - 4.*twoPrime*wCovTwoFourReduced
5876 - 4.*two*wCovTwoReducedFourReduced;
5877 if(qc4PrimeErrorSquared>0.)
5878 {
5879 qc4PrimeError = pow(qc4PrimeErrorSquared,0.5);
489d5531 5880 }
1268c371 5881 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5882 fDiffFlowCumulants[t][pe][1]->SetBinError(b,qc4PrimeError);
489d5531 5883 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 5884
1268c371 5885} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
489d5531 5886
5887//================================================================================================================================
5888
1268c371 5889void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
489d5531 5890{
1268c371 5891 // Calculate 2D differential cumulants.
489d5531 5892
1268c371 5893 // Remark: correction for detector effects and error propagation not implemented yet for 2D differential cumulants.
489d5531 5894
1268c371 5895 Int_t t = 0;
489d5531 5896
5897 if(type == "RP")
5898 {
1268c371 5899 t = 0;
489d5531 5900 } else if(type == "POI")
5901 {
1268c371 5902 t = 1;
5903 }
5904
5905 // Reference correlation <<2>>:
5906 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
489d5531 5907
1268c371 5908 // Looping over all (pt,eta) bins and calculating differential flow cumulants:
5909 for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 5910 {
5911 for(Int_t e=1;e<=fnBinsEta;e++)
5912 {
1268c371 5913 // Reduced correlations:
5914 Double_t twoPrime = f2DDiffFlowCorrelationsPro[t][0]->GetBinContent(f2DDiffFlowCorrelationsPro[t][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5915 Double_t fourPrime = f2DDiffFlowCorrelationsPro[t][1]->GetBinContent(f2DDiffFlowCorrelationsPro[t][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5916 // Cumulants:
5917 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5918 f2DDiffFlowCumulants[t][0]->SetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e),qc2Prime);
5919 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5920 f2DDiffFlowCumulants[t][1]->SetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e),qc4Prime);
489d5531 5921 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
489d5531 5922 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5923
1268c371 5924} // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
489d5531 5925
489d5531 5926//================================================================================================================================
5927
489d5531 5928void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5929{
1268c371 5930 // Calculate final results for integrated flow of RPs and POIs.
489d5531 5931
1268c371 5932 // to be improved - check if the integrated flow calculation here is actually correct
5933
5934 Int_t t = 0; // RP = 0, POI = 1
489d5531 5935
5936 if(type == "RP")
5937 {
1268c371 5938 t = 0;
489d5531 5939 } else if(type == "POI")
5940 {
1268c371 5941 t = 1;
5942 }
489d5531 5943
489d5531 5944 // pt yield:
5945 TH1F *yield2ndPt = NULL;
5946 TH1F *yield4thPt = NULL;
5947 TH1F *yield6thPt = NULL;
5948 TH1F *yield8thPt = NULL;
5949
5950 if(type == "POI")
5951 {
dd442cd2 5952 if(fFillMultipleControlHistograms)
5953 {
5954 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5955 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5956 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5957 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5958 } else
5959 {
5960 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5961 yield4thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5962 yield6thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5963 yield8thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5964 }
489d5531 5965 }
5966 else if(type == "RP")
5967 {
dd442cd2 5968 if(fFillMultipleControlHistograms)
5969 {
5970 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5971 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5972 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5973 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5974 } else
5975 {
5976 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5977 yield4thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5978 yield6thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5979 yield8thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5980 }
489d5531 5981 }
5982
0d11c335 5983 if(!yield2ndPt){return;}
5984 if(!yield4thPt){return;}
5985 if(!yield6thPt){return;}
5986 if(!yield8thPt){return;}
5987
489d5531 5988 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5989
5990 TH1D *flow2ndPt = NULL;
5991 TH1D *flow4thPt = NULL;
5992 TH1D *flow6thPt = NULL;
5993 TH1D *flow8thPt = NULL;
5994
5995 // to be improved (hardwired pt index)
5996 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5997 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5998 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5999 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
0d11c335 6000
6001 if(!flow2ndPt){return;}
6002 if(!flow4thPt){return;}
6003 if(!flow6thPt){return;}
6004 if(!flow8thPt){return;}
489d5531 6005
6006 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
6007 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
6008
6009 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
6010 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
6011
6012 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
6013 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
6014
6015 // looping over pt bins:
6016 for(Int_t p=1;p<nBinsPt+1;p++)
6017 {
6018 dvn2nd = flow2ndPt->GetBinContent(p);
6019 dvn4th = flow4thPt->GetBinContent(p);
6020 dvn6th = flow6thPt->GetBinContent(p);
6021 dvn8th = flow8thPt->GetBinContent(p);
6022
6023 dErrvn2nd = flow2ndPt->GetBinError(p);
6024 dErrvn4th = flow4thPt->GetBinError(p);
6025 dErrvn6th = flow6thPt->GetBinError(p);
6026 dErrvn8th = flow8thPt->GetBinError(p);
6027
6028 dYield2nd = yield2ndPt->GetBinContent(p);
6029 dYield4th = yield4thPt->GetBinContent(p);
6030 dYield6th = yield6thPt->GetBinContent(p);
6031 dYield8th = yield8thPt->GetBinContent(p);
6032
6033 dVn2nd += dvn2nd*dYield2nd;
6034 dVn4th += dvn4th*dYield4th;
6035 dVn6th += dvn6th*dYield6th;
6036 dVn8th += dvn8th*dYield8th;
6037
6038 dSum2nd += dYield2nd;
6039 dSum4th += dYield4th;
6040 dSum6th += dYield6th;
6041 dSum8th += dYield8th;
6042
6043 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
6044 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
6045 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
6046 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
6047
6048 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
6049
6050 // normalizing the results for integrated flow:
6051 if(dSum2nd)
6052 {
6053 dVn2nd /= dSum2nd;
6054 dErrVn2nd /= (dSum2nd*dSum2nd);
6055 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
6056 }
6057 if(dSum4th)
6058 {
6059 dVn4th /= dSum4th;
6060 dErrVn4th /= (dSum4th*dSum4th);
6061 dErrVn4th = TMath::Sqrt(dErrVn4th);
6062 }
6063 //if(dSum6th) dVn6th/=dSum6th;
6064 //if(dSum8th) dVn8th/=dSum8th;
6065
6066 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
6067 if(type == "POI")
6068 {
6069 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
6070 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
6071 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
6072 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
6073 }
6074 else if (type == "RP")
6075 {
6076 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
6077 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
6078 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
6079 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
6080 }
6081
6082 delete flow2ndPt;
6083 delete flow4thPt;
6084 //delete flow6thPt;
6085 //delete flow8thPt;
6086
6087 delete yield2ndPt;
6088 delete yield4thPt;
6089 delete yield6thPt;
6090 delete yield8thPt;
6091
6092} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
6093
489d5531 6094//================================================================================================================================
6095
489d5531 6096void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
6097{
6098 // Initialize all arrays used for distributions.
6099
6100 // a) Initialize arrays of histograms used to hold distributions of correlations;
6101 // b) Initialize array to hold min and max values of correlations.
6102
6103 // a) Initialize arrays of histograms used to hold distributions of correlations:
6104 for(Int_t di=0;di<4;di++) // distribution index
6105 {
6106 fDistributions[di] = NULL;
6107 }
6108
6109 // b) Initialize default min and max values of correlations:
6110 // (Remark: The default values bellow were chosen for v2=5% and M=500)
6111 fMinValueOfCorrelation[0] = -0.01; // <2>_min
6112 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
6113 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
6114 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
6115 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
6116 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
6117 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
6118 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
6119
6120} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
6121
489d5531 6122//================================================================================================================================
6123
e5834fcb 6124void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
6125{
6126 // Initialize all arrays used for various unclassified objects.
6127
6128 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
6129 {
6130 fPhiDistributionForOneEventSettings[p] = 0.;
6131 }
6132
6133} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
6134
6135//================================================================================================================================
489d5531 6136
6137void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
6138{
6139 // a) Book profile to hold all flags for distributions of correlations;
6140 // b) Book all histograms to hold distributions of correlations.
6141
6142 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
6143
6144 // a) Book profile to hold all flags for distributions of correlations:
6145 TString distributionsFlagsName = "fDistributionsFlags";
6146 distributionsFlagsName += fAnalysisLabel->Data();
6147 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
6148 fDistributionsFlags->SetTickLength(-0.01,"Y");
6149 fDistributionsFlags->SetMarkerStyle(25);
6150 fDistributionsFlags->SetLabelSize(0.05);
6151 fDistributionsFlags->SetLabelOffset(0.02,"Y");
6152 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
6153 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
6154 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
6155 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
6156 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
6157 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
6158 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
6159 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
6160 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
6161 fDistributionsList->Add(fDistributionsFlags);
6162
6163 // b) Book all histograms to hold distributions of correlations.
6164 if(fStoreDistributions)
6165 {
6166 TString distributionsName = "fDistributions";
6167 distributionsName += fAnalysisLabel->Data();
6168 for(Int_t di=0;di<4;di++) // distribution index
6169 {
6170 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
6171 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
6172 fDistributionsList->Add(fDistributions[di]);
6173 } // end of for(Int_t di=0;di<4;di++) // distribution index
6174 } // end of if(fStoreDistributions)
6175
6176} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
6177
489d5531 6178//================================================================================================================================
6179
e5834fcb 6180void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6181{
6182 // Book all objects for various unclassified quantities.
6183
6184 if(!fStorePhiDistributionForOneEvent){return;}
6185
6186 // a) Book histogram holding phi distribution for single event to illustrate flow.
6187
6188 // a) Book histogram holding phi distribution for single event to illustrate flow:
6189 fPhiDistributionForOneEvent = new TH1D("fPhiDistributionForOneEvent","",360,0.,TMath::TwoPi());
6190 fPhiDistributionForOneEvent->GetXaxis()->SetTitle("#phi");
6191 fVariousList->Add(fPhiDistributionForOneEvent);
6192
6193} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6194
6195//================================================================================================================================
489d5531 6196
6197void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6198{
6199 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
6200
6201 if(!fDistributionsFlags)
6202 {
6203 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
6204 exit(0);
6205 }
6206
6207 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
6208 // store min and max values of correlations:
6209 for(Int_t di=0;di<4;di++) // distribution index
6210 {
6211 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
6212 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
6213 }
6214
6215} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6216
489d5531 6217//================================================================================================================================
6218
489d5531 6219void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6220{
6221 // Store distributions of correlations.
6222
6223 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
6224 {
6225 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
6226 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
6227 exit(0);
6228 }
6229
6230 for(Int_t di=0;di<4;di++) // distribution index
6231 {
6232 if(!fDistributions[di])
6233 {
6234 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
6235 cout<<"di = "<<di<<endl;
6236 exit(0);
6237 } else
6238 {
6239 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
6240 }
6241 } // end of for(Int_t di=0;di<4;di++) // distribution index
6242
6243} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6244
489d5531 6245//================================================================================================================================
6246
489d5531 6247void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6248{
6249 // Book and nest all lists nested in the base list fHistList.
6250 // a) Book and nest lists for integrated flow;
6251 // b) Book and nest lists for differential flow;
6252 // c) Book and nest list for particle weights;
6253 // d) Book and nest list for distributions;
e5834fcb 6254 // e) Book and nest list for various unclassified objects;
6255 // f) Book and nest list for nested loops.
489d5531 6256
6257 // a) Book and nest all lists for integrated flow:
1268c371 6258 // Base list for integrated flow:
489d5531 6259 fIntFlowList = new TList();
6260 fIntFlowList->SetName("Integrated Flow");
6261 fIntFlowList->SetOwner(kTRUE);
6262 fHistList->Add(fIntFlowList);
1268c371 6263 // List holding profiles:
489d5531 6264 fIntFlowProfiles = new TList();
6265 fIntFlowProfiles->SetName("Profiles");
6266 fIntFlowProfiles->SetOwner(kTRUE);
6267 fIntFlowList->Add(fIntFlowProfiles);
3435cacb 6268 // List holding all profiles with results for correlations vs M:
6269 if(fCalculateAllCorrelationsVsM)
6270 {
6271 fIntFlowAllCorrelationsVsM = new TList();
6272 fIntFlowAllCorrelationsVsM->SetName("Correlations vs M");
6273 fIntFlowAllCorrelationsVsM->SetOwner(kTRUE);
6274 fIntFlowProfiles->Add(fIntFlowAllCorrelationsVsM);
6275 } // end of if(fCalculateAllCorrelationsVsM)
1268c371 6276 // List holding histograms with results:
489d5531 6277 fIntFlowResults = new TList();
6278 fIntFlowResults->SetName("Results");
6279 fIntFlowResults->SetOwner(kTRUE);
6280 fIntFlowList->Add(fIntFlowResults);
6281
1268c371 6282 // b) Book and nest lists for differential flow:
6283 this->BookAndNestListsForDifferentialFlow();
6284
6285 // c) Book and nest list for particle weights:
6286 fWeightsList->SetName("Weights");
6287 fWeightsList->SetOwner(kTRUE);
6288 fHistList->Add(fWeightsList);
6289
6290 // d) Book and nest list for distributions:
6291 fDistributionsList = new TList();
6292 fDistributionsList->SetName("Distributions");
6293 fDistributionsList->SetOwner(kTRUE);
6294 fHistList->Add(fDistributionsList);
6295
6296 // e) Book and nest list for various unclassified objects:
6297 if(fStorePhiDistributionForOneEvent)
6298 {
6299 fVariousList = new TList();
6300 fVariousList->SetName("Various");
6301 fVariousList->SetOwner(kTRUE);
6302 fHistList->Add(fVariousList);
6303 }
6304
64e500e3 6305 // f) Book and nest list for other differential correlators:
6306 fOtherDiffCorrelatorsList = new TList();
6307 fOtherDiffCorrelatorsList->SetName("Other differential correlators");
6308 fOtherDiffCorrelatorsList->SetOwner(kTRUE);
6309 fHistList->Add(fOtherDiffCorrelatorsList);
6310
6311 // g) Book and nest list for nested loops:
1268c371 6312 fNestedLoopsList = new TList();
6313 fNestedLoopsList->SetName("Nested Loops");
6314 fNestedLoopsList->SetOwner(kTRUE);
6315 fHistList->Add(fNestedLoopsList);
6316
6317} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6318
6319//================================================================================================================================
6320
6321void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
6322{
6323 // Book and nest lists for differential flow.
6324
6325 // Base list for differential flow objects:
489d5531 6326 fDiffFlowList = new TList();
6327 fDiffFlowList->SetName("Differential Flow");
6328 fDiffFlowList->SetOwner(kTRUE);
6329 fHistList->Add(fDiffFlowList);
1268c371 6330
6331 // Local flags:
6332 TString typeFlag[2] = {"RP","POI"};
6333 TString ptEtaFlag[2] = {"p_{T}","#eta"};
6334 TString powerFlag[2] = {"linear","quadratic"};
6335
6336 // 2D:
6337 if(fCalculate2DDiffFlow)
6338 {
6339 fDiffFlow2D = new TList();
6340 fDiffFlow2D->SetName("2D");
6341 fDiffFlow2D->SetOwner(kTRUE);
6342 fDiffFlowList->Add(fDiffFlow2D);
6343 for(Int_t t=0;t<2;t++)
6344 {
6345 f2DDiffFlowCorrelationsProList[t] = new TList();
6346 f2DDiffFlowCorrelationsProList[t]->SetOwner(kTRUE);
6347 f2DDiffFlowCorrelationsProList[t]->SetName(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data()));
6348 fDiffFlow2D->Add(f2DDiffFlowCorrelationsProList[t]);
6349 } // end of for(Int_t t=0;t<2;t++)
6350 } // end of if(fCalculate2DDiffFlow)
6351
6352 // What follows bellow in this method is relevant only for 1D differential flow:
6353 if(!fCalculateDiffFlow){return;}
6354
6355 // List holding profiles:
489d5531 6356 fDiffFlowProfiles = new TList();
6357 fDiffFlowProfiles->SetName("Profiles");
6358 fDiffFlowProfiles->SetOwner(kTRUE);
6359 fDiffFlowList->Add(fDiffFlowProfiles);
1268c371 6360 // List holding histograms with results:
489d5531 6361 fDiffFlowResults = new TList();
6362 fDiffFlowResults->SetName("Results");
6363 fDiffFlowResults->SetOwner(kTRUE);
6364 fDiffFlowList->Add(fDiffFlowResults);
1268c371 6365 // Flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
489d5531 6366 TList list;
6367 list.SetOwner(kTRUE);
1268c371 6368 // Nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
489d5531 6369 for(Int_t t=0;t<2;t++) // type: RP or POI
6370 {
6371 for(Int_t pe=0;pe<2;pe++) // pt or eta
6372 {
6373 // list holding profiles with correlations:
6374 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
6375 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6376 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
6377 // list holding profiles with products of correlations:
6378 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
6379 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6380 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
6381 // list holding profiles with corrections:
6382 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
6383 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6384 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
6385 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6386 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6387 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
6388 for(Int_t t=0;t<2;t++) // type: RP or POI
6389 {
6390 for(Int_t pe=0;pe<2;pe++) // pt or eta
6391 {
6392 // list holding histograms with correlations:
6393 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
6394 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6395 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
6396 // list holding histograms with corrections:
6397 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
6398 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6399 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
6400 for(Int_t power=0;power<2;power++)
6401 {
6402 // list holding histograms with sums of event weights:
6403 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
6404 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6405 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
6406 } // end of for(Int_t power=0;power<2;power++)
6407 // list holding histograms with sums of products of event weights:
6408 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
6409 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6410 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
6411 // list holding histograms with covariances of correlations:
6412 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
6413 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6414 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
6415 // list holding histograms with differential Q-cumulants:
6416 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
6417 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6418 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
1268c371 6419 // list holding histograms which quantify detector bias to differential Q-cumulants:
6420 fDiffFlowDetectorBiasHistList[t][pe] = (TList*)list.Clone();
6421 fDiffFlowDetectorBiasHistList[t][pe]->SetName(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6422 fDiffFlowResults->Add(fDiffFlowDetectorBiasHistList[t][pe]);
489d5531 6423 // list holding histograms with differential flow estimates from Q-cumulants:
6424 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
6425 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6426 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
6427 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6428 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6429
1268c371 6430} // end of void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
489d5531 6431
6432//================================================================================================================================
6433
489d5531 6434void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
6435{
1268c371 6436 // Fill common result histograms for differential flow.
489d5531 6437
1268c371 6438 Int_t t = 0;
489d5531 6439
6440 if(type == "RP")
6441 {
1268c371 6442 t = 0;
489d5531 6443 } else if(type == "POI")
6444 {
1268c371 6445 t = 1;
489d5531 6446 }
1268c371 6447
6448 // to be improved - check all pointers used in this method
489d5531 6449
6450 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
6451 {
6452 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
6453 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
6454 exit(0);
6455 }
6456
6457 // pt:
6458 for(Int_t p=1;p<=fnBinsPt;p++)
6459 {
6460 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
6461 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
6462 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
6463 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
6464
6465 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
6466 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
6467 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
6468 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
6469
6470 if(type == "RP")
6471 {
6472 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
6473 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
6474 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
6475 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
6476 } else if(type == "POI")
6477 {
6478 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
6479 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
6480 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
6481 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
6482 }
6483 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6484
6485 // eta:
6486 for(Int_t e=1;e<=fnBinsEta;e++)
6487 {
6488 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
6489 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
6490 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
6491 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
6492
6493 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
6494 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
6495 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
6496 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
6497
6498 if(type == "RP")
6499 {
6500 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6501 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6502 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6503 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6504 } else if(type == "POI")
6505 {
6506 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6507 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6508 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6509 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6510 }
6511 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6512
6513} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6514
489d5531 6515//================================================================================================================================
6516
1268c371 6517void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
489d5531 6518{
1268c371 6519 // Access and store common constants.
6520
6521 // a) If this method was called in Init() access common constants from AliFlowCommonConstants;
6522 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a);
6523 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b).
6524
6525 if(method == "Init")
6526 {
6527 // a) If this method was called in Init() access common constants from AliFlowCommonConstants:
6528 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6529 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6530 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6531 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
6532 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6533 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6534 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6535 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
6536 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6537 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6538 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6539 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
6540
6541 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a):
6542 TString fCommonConstantsName = "fCommonConstants";
6543 fCommonConstantsName += fAnalysisLabel->Data();
6544 fCommonConstants = new TProfile(fCommonConstantsName.Data(),"Common constants",9,0.,9.);
6545 fCommonConstants->SetLabelSize(0.05);
6546 fCommonConstants->GetXaxis()->SetBinLabel(1,"nBins (#phi)");
6547 fCommonConstants->Fill(0.5,fnBinsPhi);
6548 fCommonConstants->GetXaxis()->SetBinLabel(2,"#phi_{min}");
6549 fCommonConstants->Fill(1.5,fPhiMin);
6550 fCommonConstants->GetXaxis()->SetBinLabel(3,"#phi_{max}");
6551 fCommonConstants->Fill(2.5,fPhiMax);
6552 fCommonConstants->GetXaxis()->SetBinLabel(4,"nBins (p_{t})");
6553 fCommonConstants->Fill(3.5,fnBinsPt);
6554 fCommonConstants->GetXaxis()->SetBinLabel(5,"(p_{t})_{min}");
6555 fCommonConstants->Fill(4.5,fPtMin);
6556 fCommonConstants->GetXaxis()->SetBinLabel(6,"(p_{t})_{max}");
6557 fCommonConstants->Fill(5.5,fPtMax);
6558 fCommonConstants->GetXaxis()->SetBinLabel(7,"nBins (#eta)");
6559 fCommonConstants->Fill(6.5,fnBinsEta);
6560 fCommonConstants->GetXaxis()->SetBinLabel(8,"#eta_{min}");
6561 fCommonConstants->Fill(7.5,fEtaMin);
6562 fCommonConstants->GetXaxis()->SetBinLabel(9,"#eta_{max}");
6563 fCommonConstants->Fill(8.5,fEtaMax);
6564 fHistList->Add(fCommonConstants);
6565 } // end of if(method == "Init")
6566 else if(method == "Finish")
6567 {
6568 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b):
6569 if(!fCommonConstants)
6570 {
6571 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::AC(\"%s\") !!!!\n\n",method.Data());
6572 exit(0);
6573 }
6574 fnBinsPhi = (Int_t)fCommonConstants->GetBinContent(1);
6575 fPhiMin = fCommonConstants->GetBinContent(2);
6576 fPhiMax = fCommonConstants->GetBinContent(3);
6577 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
6578 fnBinsPt = (Int_t)fCommonConstants->GetBinContent(4);
6579 fPtMin = fCommonConstants->GetBinContent(5);
6580 fPtMax = fCommonConstants->GetBinContent(6);
6581 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
6582 fnBinsEta = (Int_t)fCommonConstants->GetBinContent(7);
6583 fEtaMin = fCommonConstants->GetBinContent(8);
6584 fEtaMax = fCommonConstants->GetBinContent(9);
6585 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
6586 } // end of else if(method == "Finish")
6587
6588} // end of void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
489d5531 6589
489d5531 6590//================================================================================================================================
6591
489d5531 6592void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6593{
1268c371 6594 // a) Cross check if the choice for multiplicity weights make sense.
489d5531 6595
6596 // a) Cross check if the choice for multiplicity weights make sense:
6597 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6598 strcmp(fMultiplicityWeight->Data(),"unit") &&
6599 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6600 {
6601 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6602 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6603 exit(0);
6604 }
6605
6606} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6607
489d5531 6608//================================================================================================================================
6609
489d5531 6610void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6611{
0328db2d 6612 // Calculate sum of linear and quadratic event weights for correlations.
2001bc3a 6613
6614 // multiplicity:
1268c371 6615 Double_t dMult = (*fSpk)(0,0);
9f33751d 6616
489d5531 6617 for(Int_t p=0;p<2;p++) // power-1
6618 {
6619 for(Int_t ci=0;ci<4;ci++) // correlation index
6620 {
6621 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
b3dacf6b 6622 if(fCalculateCumulantsVsM)
6623 {
6624 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
6625 }
489d5531 6626 }
6627 }
6628
6629} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6630
489d5531 6631//================================================================================================================================
6632
0328db2d 6633void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6634{
0328db2d 6635 // Calculate sum of linear and quadratic event weights for NUA terms.
6636
6637 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
489d5531 6638 {
0328db2d 6639 for(Int_t p=0;p<2;p++) // power-1
6640 {
b92ea2b9 6641 for(Int_t ci=0;ci<4;ci++) // nua term index
0328db2d 6642 {
6643 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
489d5531 6644 }
0328db2d 6645 }
6646 }
6647
6648} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6649
0328db2d 6650//================================================================================================================================
6651
0328db2d 6652void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6653{
ff70ca91 6654 // Calculate sum of product of event weights for correlations.
2001bc3a 6655
6656 // multiplicity:
1268c371 6657 Double_t dMult = (*fSpk)(0,0);
2001bc3a 6658
489d5531 6659 Int_t counter = 0;
6660
6661 for(Int_t ci1=1;ci1<4;ci1++)
6662 {
6663 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6664 {
ff70ca91 6665 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6666 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
b3dacf6b 6667 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6668 if(fCalculateCumulantsVsM)
6669 {
6670 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
6671 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6672 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6673 } // end of if(fCalculateCumulantsVsM)
ff70ca91 6674 counter++;
489d5531 6675 }
6676 }
6677
0328db2d 6678} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6679
0328db2d 6680//================================================================================================================================
6681
0328db2d 6682void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6683{
6684 // Calculate sum of product of event weights for NUA terms.
6685
6686 // w_{<2>} * w_{<cos(#phi)>}:
6687 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6688 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6689 // w_{<2>} * w_{<sin(#phi)>}:
6690 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6691 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6692 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6693 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6694 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6695 // w_{<2>} * w{<cos(phi1+phi2)>}
6696 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6697 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6698 // w_{<2>} * w{<sin(phi1+phi2)>}
6699 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6700 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6701 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6702 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6703 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6704 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6705 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6706 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6707 // w_{<4>} * w{<cos(phi1)>}
6708 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6709 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6710 // w_{<4>} * w{<sin(phi1)>}
6711 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6712 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6713 // w_{<4>} * w{<cos(phi1+phi2)>}
6714 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6715 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6716 // w_{<4>} * w{<sin(phi1+phi2)>}
6717 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6718 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6719 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6720 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6721 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6722 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6723 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6724 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6725 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6726 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6727 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6728 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6729 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6730 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6731 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6732 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6733 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6734 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6735 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6736 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6737 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6738 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6739 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6740 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6741 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6742 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6743 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6744 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6745 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6746 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6747 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6748 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6749 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6750 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6751 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6752 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6753 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6754 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6755 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6756 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6757 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6758 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6759 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6760 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6761 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6762 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6763 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6764 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6765 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6766 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6767
6768} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
489d5531 6769
489d5531 6770//================================================================================================================================
6771
489d5531 6772void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6773{
1268c371 6774 // Calculate reduced correlations for RPs or POIs for all pt and eta bins.
489d5531 6775
1268c371 6776 // Multiplicity:
6777 Double_t dMult = (*fSpk)(0,0);
489d5531 6778
6779 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6780 Double_t dReQ1n = (*fReQ)(0,0);
6781 Double_t dReQ2n = (*fReQ)(1,0);
6782 //Double_t dReQ3n = (*fReQ)(2,0);
6783 //Double_t dReQ4n = (*fReQ)(3,0);
6784 Double_t dImQ1n = (*fImQ)(0,0);
6785 Double_t dImQ2n = (*fImQ)(1,0);
6786 //Double_t dImQ3n = (*fImQ)(2,0);
6787 //Double_t dImQ4n = (*fImQ)(3,0);
6788
6789 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6790 //
6791 // 0: <<2'>>
6792 // 1: <<4'>>
6793 // 2: <<6'>>
6794 // 3: <<8'>>
6795
2a98ceb8 6796 Int_t t = 0; // type flag
6797 Int_t pe = 0; // ptEta flag
489d5531 6798
6799 if(type == "RP")
6800 {
6801 t = 0;
6802 } else if(type == "POI")
6803 {
6804 t = 1;
6805 }
6806
6807 if(ptOrEta == "Pt")
6808 {
6809 pe = 0;
6810 } else if(ptOrEta == "Eta")
6811 {
6812 pe = 1;
6813 }
6814
6815 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6816 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6817 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6818 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6819
6820 // looping over all bins and calculating reduced correlations:
6821 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6822 {
6823 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6824 Double_t p1n0kRe = 0.;
6825 Double_t p1n0kIm = 0.;
6826
6827 // number of POIs in particular pt or eta bin:
6828 Double_t mp = 0.;
6829
6830 // 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):
6831 Double_t q1n0kRe = 0.;
6832 Double_t q1n0kIm = 0.;
6833 Double_t q2n0kRe = 0.;
6834 Double_t q2n0kIm = 0.;
6835
6836 // number of particles which are both RPs and POIs in particular pt or eta bin:
6837 Double_t mq = 0.;
6838
6839 if(type == "POI")
6840 {
6841 // q_{m*n,0}:
6842 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6843 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6844 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6845 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6846 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6847 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6848 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6849 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6850
6851 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6852 }
6853 else if(type == "RP")
6854 {
6855 // q_{m*n,0}:
6856 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6857 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6858 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6859 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6860 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6861 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6862 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6863 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6864
6865 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6866 }
6867
6868 if(type == "POI")
6869 {
6870 // p_{m*n,0}:
6871 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6872 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6873 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6874 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6875
6876 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6877
6878 t = 1; // typeFlag = RP or POI
6879 }
6880 else if(type == "RP")
6881 {
6882 // p_{m*n,0} = q_{m*n,0}:
6883 p1n0kRe = q1n0kRe;
6884 p1n0kIm = q1n0kIm;
6885
6886 mp = mq;
6887
6888 t = 0; // typeFlag = RP or POI
6889 }
6890
1268c371 6891 // 2'-particle correlation for particular pt or eta bin:
489d5531 6892 Double_t two1n1nPtEta = 0.;
b40a910e 6893 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
489d5531 6894 if(mp*dMult-mq)
6895 {
6896 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6897 / (mp*dMult-mq);
b40a910e 6898 // determine multiplicity weight:
6899 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6900 {
6901 mWeight2pPrime = mp*dMult-mq;
6902 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6903 {
6904 mWeight2pPrime = 1.;
6905 }
489d5531 6906 if(type == "POI") // to be improved (I do not this if)
6907 {
6908 // fill profile to get <<2'>> for POIs
b40a910e 6909 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6910 // fill profile to get <<2'>^2> for POIs
6911 fDiffFlowSquaredCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
489d5531 6912 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6913 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
b40a910e 6914 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mWeight2pPrime);
489d5531 6915 }
6916 else if(type == "RP") // to be improved (I do not this if)
6917 {
6918 // profile to get <<2'>> for RPs:
b40a910e 6919 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6920 // profile to get <<2'>^2> for RPs:
6921 fDiffFlowSquaredCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
489d5531 6922 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6923 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
b40a910e 6924 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mWeight2pPrime);
489d5531 6925 }
6926 } // end of if(mp*dMult-mq)
6927
6928 // 4'-particle correlation:
6929 Double_t four1n1n1n1nPtEta = 0.;
b40a910e 6930 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
489d5531 6931 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6932 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6933 {
6934 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6935 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6936 - 2.*q2n0kIm*dReQ1n*dImQ1n
6937 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6938 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6939 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6940 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6941 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6942 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6943 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6944 + 2.*mq*dMult
6945 - 6.*mq)
6946 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6947 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
b40a910e 6948 // determine multiplicity weight:
6949 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6950 {
6951 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6952 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6953 {
6954 mWeight4pPrime = 1.;
6955 }
489d5531 6956 if(type == "POI")
6957 {
6958 // profile to get <<4'>> for POIs:
b40a910e 6959 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6960 // profile to get <<4'>^2> for POIs:
6961 fDiffFlowSquaredCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
489d5531 6962 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6963 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
b40a910e 6964 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,mWeight4pPrime);
489d5531 6965 }
6966 else if(type == "RP")
6967 {
6968 // profile to get <<4'>> for RPs:
b40a910e 6969 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6970 // profile to get <<4'>^2> for RPs:
6971 fDiffFlowSquaredCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
489d5531 6972 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6973 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
b40a910e 6974 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,mWeight4pPrime);
489d5531 6975 }
6976 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6977 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6978
6979 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6980
6981
6982} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6983
489d5531 6984//================================================================================================================================
6985
64e500e3 6986void AliFlowAnalysisWithQCumulants::CalculateOtherDiffCorrelators(TString type, TString ptOrEta)
6987{
6988 // Calculate other differential correlators for RPs or POIs for all pt and eta bins.
6989
6990 // Multiplicity:
6991 Double_t dMult = (*fSpk)(0,0);
6992
6993 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6994 Double_t dReQ1n = (*fReQ)(0,0);
6995 Double_t dReQ2n = (*fReQ)(1,0);
6996 Double_t dReQ3n = (*fReQ)(2,0);
6997 //Double_t dReQ4n = (*fReQ)(3,0);
6998 Double_t dImQ1n = (*fImQ)(0,0);
6999 Double_t dImQ2n = (*fImQ)(1,0);
7000 Double_t dImQ3n = (*fImQ)(2,0);
7001 //Double_t dImQ4n = (*fImQ)(3,0);
7002
7003 // Other correlations are stored in fOtherDiffCorrelators[2][2][2][1], [0=RP,1=POI][0=pt,1=eta][0=sin terms,1=cos terms][correlator index]
7004 // Correlation index runs as follows:
7005 //
7006 // 0: <exp[in(psi1-3phi2+2phi3)]>
7007
7008 Int_t t = 0; // type flag
7009 Int_t pe = 0; // ptEta flag
7010
7011 if(type == "RP")
7012 {
7013 t = 0;
7014 } else if(type == "POI")
7015 {
7016 t = 1;
7017 }
7018
7019 if(ptOrEta == "Pt")
7020 {
7021 pe = 0;
7022 } else if(ptOrEta == "Eta")
7023 {
7024 pe = 1;
7025 }
7026
7027 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7028 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7029 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7030 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7031
7032 // looping over all bins and calculating reduced correlations:
7033 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7034 {
7035 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
7036 Double_t p1n0kRe = 0.;
7037 Double_t p1n0kIm = 0.;
7038
7039 // number of POIs in particular pt or eta bin:
7040 Double_t mp = 0.;
7041
7042 // 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):
7043 Double_t q1n0kRe = 0.;
7044 Double_t q1n0kIm = 0.;
7045 Double_t q2n0kRe = 0.;
7046 Double_t q2n0kIm = 0.;
7047 Double_t q3n0kRe = 0.;
7048 Double_t q3n0kIm = 0.;
7049
7050 // number of particles which are both RPs and POIs in particular pt or eta bin:
7051 Double_t mq = 0.;
7052
7053 if(type == "POI")
7054 {
7055 // q_{m*n,0}:
7056 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
7057 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
7058 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
7059 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
7060 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
7061 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
7062 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
7063 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
7064 q3n0kRe = fReRPQ1dEBE[2][pe][2][0]->GetBinContent(fReRPQ1dEBE[2][pe][2][0]->GetBin(b))
7065 * fReRPQ1dEBE[2][pe][2][0]->GetBinEntries(fReRPQ1dEBE[2][pe][2][0]->GetBin(b));
7066 q3n0kIm = fImRPQ1dEBE[2][pe][2][0]->GetBinContent(fImRPQ1dEBE[2][pe][2][0]->GetBin(b))
7067 * fImRPQ1dEBE[2][pe][2][0]->GetBinEntries(fImRPQ1dEBE[2][pe][2][0]->GetBin(b));
7068
7069 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7070 }
7071 else if(type == "RP")
7072 {
7073 // q_{m*n,0}:
7074 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
7075 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
7076 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
7077 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
7078 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
7079 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
7080 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
7081 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
7082 q3n0kRe = fReRPQ1dEBE[0][pe][2][0]->GetBinContent(fReRPQ1dEBE[0][pe][2][0]->GetBin(b))
7083 * fReRPQ1dEBE[0][pe][2][0]->GetBinEntries(fReRPQ1dEBE[0][pe][2][0]->GetBin(b));
7084 q3n0kIm = fImRPQ1dEBE[0][pe][2][0]->GetBinContent(fImRPQ1dEBE[0][pe][2][0]->GetBin(b))
7085 * fImRPQ1dEBE[0][pe][2][0]->GetBinEntries(fImRPQ1dEBE[0][pe][2][0]->GetBin(b));
7086
7087 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7088 }
7089
7090 if(type == "POI")
7091 {
7092 // p_{m*n,0}:
7093 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
7094 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
7095 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
7096 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
7097
7098 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7099
7100 t = 1; // typeFlag = RP or POI
7101 }
7102 else if(type == "RP")
7103 {
7104 // p_{m*n,0} = q_{m*n,0}:
7105 p1n0kRe = q1n0kRe;
7106 p1n0kIm = q1n0kIm;
7107
7108 mp = mq;
7109
7110 t = 0; // typeFlag = RP or POI
7111 }
7112
7113 // 3'-particle correlators:
7114 // Taeney-Yan correlator:
7115 Double_t dTaeneyYan = 0.;
7116 Double_t mWeightTaeneyYan = 0.; // multiplicity weight for Taeney-Yan correlator
7117 if((mp*dMult-2.*mq)*(dMult-1.) > 0.) // to be improved - is this condition fully justified?
7118 {
7119 dTaeneyYan = (dReQ3n*(p1n0kRe*dReQ2n-p1n0kIm*dImQ2n)+dImQ3n*(p1n0kIm*dReQ2n+p1n0kRe*dImQ2n)
7120 - p1n0kRe*dReQ1n - p1n0kIm*dImQ1n
7121 - q2n0kRe*dReQ2n - q2n0kIm*dImQ2n
7122 - q3n0kRe*dReQ3n - q3n0kIm*dImQ3n
7123 + 2.*mq)
7124 / ((mp*dMult-2.*mq)*(dMult-1.));
7125 // determine multiplicity weight:
7126 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7127 {
7128 mWeightTaeneyYan = (mp*dMult-2.*mq)*(dMult-1.);
7129 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7130 {
7131 mWeightTaeneyYan = 1.;
7132 }
7133 // Fill profiles:
7134 fOtherDiffCorrelators[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dTaeneyYan,mWeightTaeneyYan);
7135 } // end of if((mp*dMult-2.*mq)*(dMult-1.) > 0.)
7136
7137 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7138
7139} // end of void AliFlowAnalysisWithQCumulants::CalculateOtherDiffCorrelators(TString type, TString ptOrEta)
7140
7141//================================================================================================================================
7142
1268c371 7143void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
7144{
7145 // Calculate all reduced correlations needed for 2D differential flow for each (pt,eta) bin.
7146
7147 // Multiplicity:
7148 Double_t dMult = (*fSpk)(0,0);
7149 // Real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7150 Double_t dReQ1n = (*fReQ)(0,0);
7151 Double_t dReQ2n = (*fReQ)(1,0);
7152 //Double_t dReQ3n = (*fReQ)(2,0);
7153 //Double_t dReQ4n = (*fReQ)(3,0);
7154 Double_t dImQ1n = (*fImQ)(0,0);
7155 Double_t dImQ2n = (*fImQ)(1,0);
7156 //Double_t dImQ3n = (*fImQ)(2,0);
7157 //Double_t dImQ4n = (*fImQ)(3,0);
7158
7159 // 2D reduced correlations are stored in TProfile2D f2DDiffFlowCorrelationsPro[0=RP,1=POI][correlation index].
7160 // Correlation index runs as follows:
7161 // 0: <<2'>>
7162 // 1: <<4'>>
7163 // 2: <<6'>>
7164 // 3: <<8'>>
7165
7166 Int_t t = 0; // type flag
7167 if(type == "RP")
7168 {
7169 t = 0;
7170 } else if(type == "POI")
7171 {
7172 t = 1;
7173 }
7174
7175 // Looping over all (pt,eta) bins and calculating correlations needed for differential flow:
7176 for(Int_t p=1;p<=fnBinsPt;p++)
7177 {
7178 for(Int_t e=1;e<=fnBinsEta;e++)
7179 {
7180 // Real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
7181 Double_t p1n0kRe = 0.;
7182 Double_t p1n0kIm = 0.;
7183 // Number of POIs in particular pt or eta bin:
7184 Double_t mp = 0.;
7185 // Real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for 'RP && POI particles' in particular pt or eta bin):
7186 Double_t q1n0kRe = 0.;
7187 Double_t q1n0kIm = 0.;
7188 Double_t q2n0kRe = 0.;
7189 Double_t q2n0kIm = 0.;
7190 // Number of 'RP && POI particles' in particular pt or eta bin:
7191 Double_t mq = 0.;
7192 if(type == "POI")
7193 {
7194 // q_{m*n,0}:
7195 q1n0kRe = fReRPQ2dEBE[2][0][0]->GetBinContent(fReRPQ2dEBE[2][0][0]->GetBin(p,e))
7196 * fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e));
7197 q1n0kIm = fImRPQ2dEBE[2][0][0]->GetBinContent(fImRPQ2dEBE[2][0][0]->GetBin(p,e))
7198 * fImRPQ2dEBE[2][0][0]->GetBinEntries(fImRPQ2dEBE[2][0][0]->GetBin(p,e));
7199 q2n0kRe = fReRPQ2dEBE[2][1][0]->GetBinContent(fReRPQ2dEBE[2][1][0]->GetBin(p,e))
7200 * fReRPQ2dEBE[2][1][0]->GetBinEntries(fReRPQ2dEBE[2][1][0]->GetBin(p,e));
7201 q2n0kIm = fImRPQ2dEBE[2][1][0]->GetBinContent(fImRPQ2dEBE[2][1][0]->GetBin(p,e))
7202 * fImRPQ2dEBE[2][1][0]->GetBinEntries(fImRPQ2dEBE[2][1][0]->GetBin(p,e));
7203 // m_{q}:
7204 mq = fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7205 } // end of if(type == "POI")
7206 else if(type == "RP")
7207 {
7208 // q_{m*n,0}:
7209 q1n0kRe = fReRPQ2dEBE[0][0][0]->GetBinContent(fReRPQ2dEBE[0][0][0]->GetBin(p,e))
7210 * fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e));
7211 q1n0kIm = fImRPQ2dEBE[0][0][0]->GetBinContent(fImRPQ2dEBE[0][0][0]->GetBin(p,e))
7212 * fImRPQ2dEBE[0][0][0]->GetBinEntries(fImRPQ2dEBE[0][0][0]->GetBin(p,e));
7213 q2n0kRe = fReRPQ2dEBE[0][1][0]->GetBinContent(fReRPQ2dEBE[0][1][0]->GetBin(p,e))
7214 * fReRPQ2dEBE[0][1][0]->GetBinEntries(fReRPQ2dEBE[0][1][0]->GetBin(p,e));
7215 q2n0kIm = fImRPQ2dEBE[0][1][0]->GetBinContent(fImRPQ2dEBE[0][1][0]->GetBin(p,e))
7216 * fImRPQ2dEBE[0][1][0]->GetBinEntries(fImRPQ2dEBE[0][1][0]->GetBin(p,e));
7217 // m_{q}:
7218 mq = fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7219 } // end of else if(type == "RP")
7220 if(type == "POI")
7221 {
7222 // p_{m*n,0}:
7223 p1n0kRe = fReRPQ2dEBE[1][0][0]->GetBinContent(fReRPQ2dEBE[1][0][0]->GetBin(p,e))
7224 * fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e));
7225 p1n0kIm = fImRPQ2dEBE[1][0][0]->GetBinContent(fImRPQ2dEBE[1][0][0]->GetBin(p,e))
7226 * fImRPQ2dEBE[1][0][0]->GetBinEntries(fImRPQ2dEBE[1][0][0]->GetBin(p,e));
7227 // m_{p}
7228 mp = fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7229
7230 t = 1; // typeFlag = RP or POI
7231 } // end of if(type == "POI")
7232 else if(type == "RP")
7233 {
7234 // p_{m*n,0} = q_{m*n,0}:
7235 p1n0kRe = q1n0kRe;
7236 p1n0kIm = q1n0kIm;
7237 // m_{p} = m_{q}:
7238 mp = mq;
7239
7240 t = 0; // typeFlag = RP or POI
7241 } // end of if(type == "RP")
7242
7243 // 2'-particle correlation for particular (pt,eta) bin:
7244 Double_t two1n1nPtEta = 0.;
7245 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
7246 if(mp*dMult-mq)
7247 {
7248 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
7249 / (mp*dMult-mq);
7250 // Determine multiplicity weight:
7251 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7252 {
7253 mWeight2pPrime = mp*dMult-mq;
7254 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7255 {
7256 mWeight2pPrime = 1.;
7257 }
7258 // Fill 2D profile holding <<2'>>:
7259 f2DDiffFlowCorrelationsPro[t][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mWeight2pPrime);
7260 } // end of if(mp*dMult-mq)
7261
7262 // 4'-particle correlation:
7263 Double_t four1n1n1n1nPtEta = 0.;
7264 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
7265 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7266 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
7267 {
7268 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7269 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
7270 - 2.*q2n0kIm*dReQ1n*dImQ1n
7271 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
7272 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
7273 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7274 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
7275 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
7276 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
7277 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7278 + 2.*mq*dMult
7279 - 6.*mq)
7280 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7281 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
7282 // Determine multiplicity weight:
7283 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7284 {
7285 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7286 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7287 {
7288 mWeight4pPrime = 1.;
7289 }
7290 // Fill 2D profile holding <<4'>>:
7291 f2DDiffFlowCorrelationsPro[t][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,mWeight4pPrime);
7292 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7293 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
7294 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7295 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7296
7297} // end of AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
7298
7299//================================================================================================================================
7300
489d5531 7301void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
7302{
7303 // Calculate sums of various event weights for reduced correlations.
7304 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
7305
2a98ceb8 7306 Int_t typeFlag = 0;
7307 Int_t ptEtaFlag = 0;
489d5531 7308
7309 if(type == "RP")
7310 {
7311 typeFlag = 0;
7312 } else if(type == "POI")
7313 {
7314 typeFlag = 1;
7315 }
7316
7317 if(ptOrEta == "Pt")
7318 {
7319 ptEtaFlag = 0;
7320 } else if(ptOrEta == "Eta")
7321 {
7322 ptEtaFlag = 1;
7323 }
7324
7325 // shortcuts:
7326 Int_t t = typeFlag;
7327 Int_t pe = ptEtaFlag;
7328
7329 // binning:
7330 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7331 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7332 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7333 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7334
7335 for(Int_t rpq=0;rpq<3;rpq++)
7336 {
7337 for(Int_t m=0;m<4;m++)
7338 {
7339 for(Int_t k=0;k<9;k++)
7340 {
7341 if(!fReRPQ1dEBE[rpq][pe][m][k])
7342 {
7343 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
7344 cout<<"pe = "<<pe<<endl;
7345 cout<<"rpq = "<<rpq<<endl;
7346 cout<<"m = "<<m<<endl;
7347 cout<<"k = "<<k<<endl;
7348 exit(0);
7349 }
7350 }
7351 }
7352 }
7353
7354 // multiplicities:
1268c371 7355 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
489d5531 7356 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7357 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7358 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7359
7360 // event weights for reduced correlations:
7361 Double_t dw2 = 0.; // event weight for <2'>
7362 Double_t dw4 = 0.; // event weight for <4'>
7363 //Double_t dw6 = 0.; // event weight for <6'>
7364 //Double_t dw8 = 0.; // event weight for <8'>
7365
7366 // looping over bins:
7367 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7368 {
7369 if(type == "RP")
7370 {
7371 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7372 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7373 } else if(type == "POI")
7374 {
7375 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7376 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7377 }
7378
7379 // event weight for <2'>:
7380 dw2 = mp*dMult-mq;
7381 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
7382 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
7383
7384 // event weight for <4'>:
7385 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7386 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7387 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
7388 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
7389
7390 // event weight for <6'>:
7391 //dw6 = ...;
7392 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
7393 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
7394
7395 // event weight for <8'>:
7396 //dw8 = ...;
7397 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
7398 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
7399 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7400
7401} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
7402
7403
7404//================================================================================================================================
7405
7406
7407void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
7408{
7409 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
7410 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
7411 //
7412 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
7413 // 1.) i<j
7414 // 2.) do not store terms which DO NOT include reduced correlations;
7415 // Table:
7416 // [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'>]
7417
2a98ceb8 7418 Int_t typeFlag = 0;
7419 Int_t ptEtaFlag = 0;
489d5531 7420
7421 if(type == "RP")
7422 {
7423 typeFlag = 0;
7424 } else if(type == "POI")
7425 {
7426 typeFlag = 1;
7427 }
7428
7429 if(ptOrEta == "Pt")
7430 {
7431 ptEtaFlag = 0;
7432 } else if(ptOrEta == "Eta")
7433 {
7434 ptEtaFlag = 1;
7435 }
7436
7437 // shortcuts:
7438 Int_t t = typeFlag;
7439 Int_t pe = ptEtaFlag;
7440
7441 // binning:
7442 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7443 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7444 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7445 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7446
7447 // protection:
7448 for(Int_t rpq=0;rpq<3;rpq++)
7449 {
7450 for(Int_t m=0;m<4;m++)
7451 {
7452 for(Int_t k=0;k<9;k++)
7453 {
7454 if(!fReRPQ1dEBE[rpq][pe][m][k])
7455 {
7456 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
7457 cout<<"pe = "<<pe<<endl;
7458 cout<<"rpq = "<<rpq<<endl;
7459 cout<<"m = "<<m<<endl;
7460 cout<<"k = "<<k<<endl;
7461 exit(0);
7462 }
7463 }
7464 }
7465 }
7466
7467 // multiplicities:
1268c371 7468 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
489d5531 7469 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7470 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7471 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7472
7473 // event weights for correlations:
7474 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
7475 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
7476 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
7477 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
7478
7479 // event weights for reduced correlations:
7480 Double_t dw2 = 0.; // event weight for <2'>
7481 Double_t dw4 = 0.; // event weight for <4'>
7482 //Double_t dw6 = 0.; // event weight for <6'>
7483 //Double_t dw8 = 0.; // event weight for <8'>
7484
7485 // looping over bins:
7486 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7487 {
7488 if(type == "RP")
7489 {
7490 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7491 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7492 } else if(type == "POI")
7493 {
7494 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7495 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7496 }
7497
7498 // event weight for <2'>:
7499 dw2 = mp*dMult-mq;
7500 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
7501 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
7502 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
7503 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
7504
7505 // event weight for <4'>:
7506 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7507 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7508 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
7509 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
7510 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
7511 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
7512 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
7513
7514 // event weight for <6'>:
7515 //dw6 = ...;
7516 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
7517 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
7518 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
7519 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
7520 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
7521 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
7522 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
7523
7524 // event weight for <8'>:
7525 //dw8 = ...;
7526 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
7527 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
7528 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
7529 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
7530 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
7531 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
7532 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
7533
7534 // Table:
7535 // [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'>]
7536
7537 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7538
7539
7540
7541} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
7542
489d5531 7543//================================================================================================================================
7544
489d5531 7545void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
7546{
7547 // Transfer profiles into histograms and calculate statistical errors correctly.
7548
1268c371 7549 Int_t t = 0; // RP or POI
7550 Int_t pe = 0; // pt or eta
489d5531 7551
7552 if(type == "RP")
7553 {
1268c371 7554 t = 0;
489d5531 7555 } else if(type == "POI")
7556 {
1268c371 7557 t = 1;
489d5531 7558 }
7559
7560 if(ptOrEta == "Pt")
7561 {
1268c371 7562 pe = 0;
489d5531 7563 } else if(ptOrEta == "Eta")
7564 {
1268c371 7565 pe = 1;
489d5531 7566 }
1268c371 7567
7568 for(Int_t rci=0;rci<4;rci++) // to be improved - moved into the method CheckPointersUsedInFinish()
489d5531 7569 {
7570 if(!fDiffFlowCorrelationsPro[t][pe][rci])
7571 {
7572 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7573 cout<<"t = "<<t<<endl;
7574 cout<<"pe = "<<pe<<endl;
7575 cout<<"rci = "<<rci<<endl;
7576 exit(0);
7577 }
b40a910e 7578 if(!fDiffFlowSquaredCorrelationsPro[t][pe][rci])
7579 {
7580 cout<<"WARNING: fDiffFlowSquaredCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7581 cout<<"t = "<<t<<endl;
7582 cout<<"pe = "<<pe<<endl;
7583 cout<<"rci = "<<rci<<endl;
7584 exit(0);
7585 }
489d5531 7586 for(Int_t power=0;power<2;power++)
7587 {
7588 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
7589 {
7590 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7591 cout<<"t = "<<t<<endl;
7592 cout<<"pe = "<<pe<<endl;
7593 cout<<"power = "<<power<<endl;
7594 cout<<"rci = "<<rci<<endl;
7595 exit(0);
7596 }
7597 } // end of for(Int_t power=0;power<2;power++)
7598 } // end of for(Int_t rci=0;rci<4;rci++)
7599
7600 // common:
b40a910e 7601 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 7602 // transfer 1D profile into 1D histogram:
7603 Double_t correlation = 0.;
b40a910e 7604 Double_t squaredCorrelation = 0.;
489d5531 7605 Double_t spread = 0.;
7606 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
7607 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
7608 Double_t error = 0.; // error = termA * spread * termB
7609 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
7610 // termB = 1/pow(1-termA^2,0.5)
7611 Double_t termA = 0.;
7612 Double_t termB = 0.;
7613 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
7614 {
7615 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
7616 {
b40a910e 7617 if(fDiffFlowCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2 ||
7618 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2)
7619 {
7620 fDiffFlowCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7621 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7622 continue; // to be improved - should I ignore results in pt bins with one entry for reduced correlations or not?
7623 }
489d5531 7624 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
b40a910e 7625 squaredCorrelation = fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinContent(b);
7626 if(squaredCorrelation-correlation*correlation >= 0.)
7627 {
7628 spread = pow(squaredCorrelation-correlation*correlation,0.5);
7629 } else
7630 {
7631 cout<<endl;
7632 cout<<Form(" WARNING: Imaginary 'spread' for rci = %d, pe = %d, bin = %d !!!!",rci,pe,b)<<endl;
7633 cout<<endl;
7634 }
489d5531 7635 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
7636 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
1268c371 7637 if(TMath::Abs(sumOfWeights)>0.){termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);}
7638 if(1.-pow(termA,2.)>0.){termB = 1./pow(1.-pow(termA,2.),0.5);}
489d5531 7639 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
7640 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
7641 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
7642 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7643 } // end of for(Int_t rci=0;rci<4;rci++)
7644
7645} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
7646
489d5531 7647//================================================================================================================================
7648
489d5531 7649void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7650{
7651 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
7652 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
7653 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
7654 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
7655 // <6'><8'>, <8><8'>.
7656
2a98ceb8 7657 Int_t typeFlag = 0;
7658 Int_t ptEtaFlag = 0;
489d5531 7659
7660 if(type == "RP")
7661 {
7662 typeFlag = 0;
7663 } else if(type == "POI")
7664 {
7665 typeFlag = 1;
7666 }
7667
7668 if(ptOrEta == "Pt")
7669 {
7670 ptEtaFlag = 0;
7671 } else if(ptOrEta == "Eta")
7672 {
7673 ptEtaFlag = 1;
7674 }
7675
7676 // shortcuts:
7677 Int_t t = typeFlag;
7678 Int_t pe = ptEtaFlag;
7679
7680 // common:
7681 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7682 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7683 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7684
7685 // protections // to be improved (add protection for all pointers in this method)
7686 if(!fIntFlowCorrelationsEBE)
7687 {
7688 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
7689 exit(0);
7690 }
7691
7692 /*
1268c371 7693 Double_t dMult = (*fSpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
489d5531 7694 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7695 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7696 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7697 */
7698
7699 // e-b-e correlations:
7700 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
7701 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
7702 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
7703 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
7704
7705 // event weights for correlations:
7706 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
7707 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
7708 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
7709 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
7710
7711 // e-b-e reduced correlations:
7712 Double_t twoReducedEBE = 0.; // <2'>
7713 Double_t fourReducedEBE = 0.; // <4'>
7714 Double_t sixReducedEBE = 0.; // <6'>
7715 Double_t eightReducedEBE = 0.; // <8'>
7716
7717 // event weights for reduced correlations:
7718 Double_t dw2 = 0.; // event weight for <2'>
7719 Double_t dw4 = 0.; // event weight for <4'>
7720 //Double_t dw6 = 0.; // event weight for <6'>
7721 //Double_t dw8 = 0.; // event weight for <8'>
7722
7723 // looping over bins:
7724 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7725 {
7726 // e-b-e reduced correlations:
7727 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
7728 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
7729 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
7730 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
7731
7732 /*
7733 // to be improved (I should not do this here again)
7734 if(type == "RP")
7735 {
7736 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7737 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7738 } else if(type == "POI")
7739 {
7740 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7741 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7742 }
7743
7744 // event weights for reduced correlations:
7745 dw2 = mp*dMult-mq; // weight for <2'>
7746 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7747 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
7748 //dw6 = ...
7749 //dw8 = ...
7750
7751 */
7752
7753 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
7754 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
7755
7756 // storing all products:
7757 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
7758 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
7759 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
7760 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
7761
7762 // event weight for <4'>:
7763 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
7764 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
7765 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
7766 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
7767 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
7768
7769 // event weight for <6'>:
7770 //dw6 = ...;
7771 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
7772 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
7773 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
7774 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
7775 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
7776 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
7777 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7778
7779 // event weight for <8'>:
7780 //dw8 = ...;
7781 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
7782 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
7783 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
7784 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
7785 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
7786 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7787 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
7788 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
7789
7790} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7791
489d5531 7792//================================================================================================================================
7793
489d5531 7794void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
7795{
7796 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
7797 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
7798 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
7799 //
7800 // 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)]
7801 //
7802 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
7803 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
7804 //
7805 // 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)]
7806 // 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)]
7807 // 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)]
7808 // 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)]
7809 // 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)]
7810 // ...
7811
2a98ceb8 7812 Int_t typeFlag = 0;
7813 Int_t ptEtaFlag = 0;
489d5531 7814
7815 if(type == "RP")
7816 {
7817 typeFlag = 0;
7818 } else if(type == "POI")
7819 {
7820 typeFlag = 1;
7821 }
7822
7823 if(ptOrEta == "Pt")
7824 {
7825 ptEtaFlag = 0;
7826 } else if(ptOrEta == "Eta")
7827 {
7828 ptEtaFlag = 1;
7829 }
7830
7831 // shortcuts:
7832 Int_t t = typeFlag;
7833 Int_t pe = ptEtaFlag;
7834
7835 // common:
7836 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7837 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
7838 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7839 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7840
7841 // average correlations:
7842 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7843 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7844 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
7845 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7846
7847 // sum of weights for correlation:
7848 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
7849 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7850 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7851 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7852
7853 // average reduced correlations:
7854 Double_t twoReduced = 0.; // <<2'>>
7855 Double_t fourReduced = 0.; // <<4'>>
7856 //Double_t sixReduced = 0.; // <<6'>>
7857 //Double_t eightReduced = 0.; // <<8'>>
7858
7859 // sum of weights for reduced correlation:
7860 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7861 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7862 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7863 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7864
7865 // product of weights for reduced correlation:
7866 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7867 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7868 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7869 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7870 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7871 // ...
7872
7873 // products for differential flow:
7874 Double_t twoTwoReduced = 0; // <<2><2'>>
7875 Double_t twoFourReduced = 0; // <<2><4'>>
7876 Double_t fourTwoReduced = 0; // <<4><2'>>
7877 Double_t fourFourReduced = 0; // <<4><4'>>
7878 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7879
7880 // denominators in the expressions for the unbiased estimators for covariances:
7881 // denominator = 1 - term1/(term2*term3)
7882 // prefactor = term1/(term2*term3)
7883 Double_t denominator = 0.;
7884 Double_t prefactor = 0.;
7885 Double_t term1 = 0.;
7886 Double_t term2 = 0.;
7887 Double_t term3 = 0.;
7888
7889 // unbiased estimators for covariances for differential flow:
7890 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7891 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7892 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7893 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7894 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7895 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7896 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7897 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7898 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7899 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7900
7901 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7902 {
7903 // average reduced corelations:
7904 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7905 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7906 // average products:
7907 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7908 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7909 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7910 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7911 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7912 // sum of weights for reduced correlations:
7913 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7914 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7915 // products of weights for correlations:
7916 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7917 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7918 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7919 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7920 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7921 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7922 // prefactor (multiplies Cov's) = term1/(term2*term3)
7923 // <2>,<2'>:
7924 term1 = productOfWeightsForTwoTwoReduced;
7925 term2 = sumOfWeightsForTwo;
7926 term3 = sumOfWeightsForTwoReduced;
7927 if(term2*term3>0.)
7928 {
7929 denominator = 1.-term1/(term2*term3);
7930 prefactor = term1/(term2*term3);
1268c371 7931 if(TMath::Abs(denominator)>1.e-6)
489d5531 7932 {
7933 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7934 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7935 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7936 }
7937 }
7938 // <2>,<4'>:
7939 term1 = productOfWeightsForTwoFourReduced;
7940 term2 = sumOfWeightsForTwo;
7941 term3 = sumOfWeightsForFourReduced;
7942 if(term2*term3>0.)
7943 {
7944 denominator = 1.-term1/(term2*term3);
7945 prefactor = term1/(term2*term3);
1268c371 7946 if(TMath::Abs(denominator)>1.e-6)
489d5531 7947 {
7948 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7949 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7950 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7951 }
7952 }
7953 // <4>,<2'>:
7954 term1 = productOfWeightsForFourTwoReduced;
7955 term2 = sumOfWeightsForFour;
7956 term3 = sumOfWeightsForTwoReduced;
7957 if(term2*term3>0.)
7958 {
7959 denominator = 1.-term1/(term2*term3);
7960 prefactor = term1/(term2*term3);
1268c371 7961 if(TMath::Abs(denominator)>1.e-6)
489d5531 7962 {
7963 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7964 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7965 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7966 }
7967 }
7968 // <4>,<4'>:
7969 term1 = productOfWeightsForFourFourReduced;
7970 term2 = sumOfWeightsForFour;
7971 term3 = sumOfWeightsForFourReduced;
7972 if(term2*term3>0.)
7973 {
7974 denominator = 1.-term1/(term2*term3);
7975 prefactor = term1/(term2*term3);
1268c371 7976 if(TMath::Abs(denominator)>1.e-6)
489d5531 7977 {
7978 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7979 wCovFourFourReduced = covFourFourReduced*prefactor;
7980 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7981 }
7982 }
7983 // <2'>,<4'>:
7984 term1 = productOfWeightsForTwoReducedFourReduced;
7985 term2 = sumOfWeightsForTwoReduced;
7986 term3 = sumOfWeightsForFourReduced;
7987 if(term2*term3>0.)
7988 {
7989 denominator = 1.-term1/(term2*term3);
7990 prefactor = term1/(term2*term3);
1268c371 7991 if(TMath::Abs(denominator)>1.e-6)
489d5531 7992 {
7993 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7994 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7995 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7996 }
7997 }
7998 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7999
8000} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
8001
489d5531 8002//================================================================================================================================
8003
489d5531 8004void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
8005{
1268c371 8006 // Calculate final results for differential flow.
489d5531 8007
1268c371 8008 // REMARK: Differential flow calculated in this method is NOT corrected for non-uniform acceptance.
8009 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied in the method
8010 // CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
8011
8012 Int_t t = 0; // RP or POI
8013 Int_t pe = 0; // pt or eta
489d5531 8014
8015 if(type == "RP")
8016 {
1268c371 8017 t = 0;
489d5531 8018 } else if(type == "POI")
8019 {
1268c371 8020 t = 1;
489d5531 8021 }
8022
8023 if(ptOrEta == "Pt")
8024 {
1268c371 8025 pe = 0;
489d5531 8026 } else if(ptOrEta == "Eta")
8027 {
1268c371 8028 pe = 1;
489d5531 8029 }
1268c371 8030
8031 // Common:
489d5531 8032 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
1268c371 8033 // Correlations:
489d5531 8034 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
1268c371 8035 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8036 // Statistical errors of correlations:
489d5531 8037 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
8038 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
1268c371 8039 // Reduced correlations:
489d5531 8040 Double_t twoReduced = 0.; // <<2'>>
8041 Double_t fourReduced = 0.; // <<4'>>
1268c371 8042 // Statistical errors of reduced correlations:
489d5531 8043 Double_t twoReducedError = 0.;
8044 Double_t fourReducedError = 0.;
1268c371 8045 // Covariances:
8e1cefdd 8046 Double_t wCovTwoFour = 0.; // Cov(<2>,<4>) * prefactor(<2>,<4>)
8047 if(!fForgetAboutCovariances)
8048 {
8049 wCovTwoFour = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(<2>,<4>)
8050 }
489d5531 8051 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
8052 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
8053 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
8054 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
8055 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
1268c371 8056 // Differential flow:
489d5531 8057 Double_t v2Prime = 0.; // v'{2}
8058 Double_t v4Prime = 0.; // v'{4}
1268c371 8059 // Statistical error of differential flow:
489d5531 8060 Double_t v2PrimeError = 0.;
8061 Double_t v4PrimeError = 0.;
1268c371 8062 // Squared statistical error of differential flow:
489d5531 8063 Double_t v2PrimeErrorSquared = 0.;
8064 Double_t v4PrimeErrorSquared = 0.;
1268c371 8065 // Loop over pt or eta bins:
489d5531 8066 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8067 {
1268c371 8068 // Reduced correlations and statistical errors:
489d5531 8069 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
8070 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
8071 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
8072 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
1268c371 8073 // Covariances:
8e1cefdd 8074 if(!fForgetAboutCovariances)
8075 {
8076 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
8077 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
8078 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
8079 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
8080 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
8081 }
1268c371 8082 // Differential flow:
489d5531 8083 // v'{2}:
8084 if(two>0.)
8085 {
8086 v2Prime = twoReduced/pow(two,0.5);
1268c371 8087 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*(pow(twoReduced,2.)*pow(twoError,2.)
8088 + 4.*pow(two,2.)*pow(twoReducedError,2.)
8089 - 4.*two*twoReduced*wCovTwoTwoReduced);
8090 if(v2PrimeErrorSquared>0.){v2PrimeError = pow(v2PrimeErrorSquared,0.5);}
8091 if(TMath::Abs(v2Prime)>0.)
8092 {
8093 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
8094 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
8095 }
8096 } // end of if(two>0.)
489d5531 8097 // differential flow:
8098 // v'{4}
8099 if(2.*pow(two,2.)-four > 0.)
8100 {
8101 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
1268c371 8102 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)
8103 * (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
8104 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
8105 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
8106 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
8107 - (3./2.)*(2.*two*twoReduced-fourReduced)
8108 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
8109 - 4.*two*(2.*pow(two,2.)-four)
8110 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
8111 + 2.*(2.*pow(two,2.)-four)
8112 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
8113 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
8114 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
8115 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
8116 if(v4PrimeErrorSquared>0.){v4PrimeError = pow(v4PrimeErrorSquared,0.5);}
8117 if(TMath::Abs(v4Prime)>0.)
8118 {
8119 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
8120 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
8121 }
8122 } // end of if(2.*pow(two,2.)-four > 0.)
489d5531 8123 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
1268c371 8124
8125} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
8126
8127//================================================================================================================================
8128
8129void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
8130{
8131 // Calculate final results for 2D diferential flow.
8132
8133 // to be improved - check pointers used in this method
8134
8135 Int_t t = 0; // RP or POI
8136
8137 if(type == "RP")
8138 {
8139 t = 0;
8140 } else if(type == "POI")
8141 {
8142 t = 1;
8143 }
489d5531 8144
1268c371 8145 // Differential flow:
8146 Double_t v2Prime = 0.; // v'{2}
8147 Double_t v4Prime = 0.; // v'{4}
8148 // Differential cumulants:
8149 Double_t qc2Prime = 0.; // QC{2'}
8150 Double_t qc4Prime = 0.; // QC{4'}
8151 // Looping over all (pt,eta) bins and calculating differential flow:
8152 for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 8153 {
1268c371 8154 for(Int_t e=1;e<=fnBinsEta;e++)
489d5531 8155 {
1268c371 8156 // QC{2'}:
8157 qc2Prime = f2DDiffFlowCumulants[t][0]->GetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e));
8158 if(qc2Prime>=0.)
8159 {
8160 v2Prime = pow(qc2Prime,0.5);
8161 f2DDiffFlow[t][0]->SetBinContent(f2DDiffFlow[t][0]->GetBin(p,e),v2Prime);
8162 }
8163 // QC{4'}:
8164 qc4Prime = f2DDiffFlowCumulants[t][1]->GetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e));
8165 if(qc4Prime<=0.)
8166 {
8167 v4Prime = pow(-1.*qc4Prime,1./4.);
8168 f2DDiffFlow[t][1]->SetBinContent(f2DDiffFlow[t][1]->GetBin(p,e),v4Prime);
8169 }
8170 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
8171 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
8172
8173} // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
489d5531 8174
489d5531 8175//================================================================================================================================
8176
489d5531 8177void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
8178{
8179 // a) Store all flags for integrated flow in profile fIntFlowFlags.
8180
8181 if(!fIntFlowFlags)
8182 {
8183 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
8184 exit(0);
8185 }
8186
8187 // particle weights used or not:
403e3389 8188 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights);
489d5531 8189 // which event weights were used:
8190 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
8191 {
8192 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
8193 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
8194 {
8195 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
8196 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
8197 {
8198 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
8199 }
489d5531 8200 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
8201 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
8202 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
8203 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
b3dacf6b 8204 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
8205 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
b77b6434 8206 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorAlsoFromNIT);
b3dacf6b 8207 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
0dd3b008 8208 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
8e1cefdd 8209 fIntFlowFlags->Fill(11.5,(Int_t)fForgetAboutCovariances);
e5834fcb 8210 fIntFlowFlags->Fill(12.5,(Int_t)fStorePhiDistributionForOneEvent);
dd442cd2 8211 fIntFlowFlags->Fill(13.5,(Int_t)fFillMultipleControlHistograms);
3435cacb 8212 fIntFlowFlags->Fill(14.5,(Int_t)fCalculateAllCorrelationsVsM);
489d5531 8213} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
8214
489d5531 8215//================================================================================================================================
8216
489d5531 8217void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
8218{
8219 // Store all flags for differential flow in the profile fDiffFlowFlags.
8220
8221 if(!fDiffFlowFlags)
8222 {
1268c371 8223 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::SDFF() !!!!\n\n");
489d5531 8224 exit(0);
8225 }
8226
1268c371 8227 fDiffFlowFlags->Fill(0.5,fCalculateDiffFlow); // calculate differential flow
403e3389 8228 fDiffFlowFlags->Fill(1.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights); // particle weights used or not?
1268c371 8229 //fDiffFlowFlags->Fill(2.5,""); // which event weight was used? ("combinations", "unit" or "multiplicity") to be improved - finalized
8230 fDiffFlowFlags->Fill(3.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
8231 fDiffFlowFlags->Fill(4.5,fCalculate2DDiffFlow); // calculate also 2D differential flow vs (pt,eta)
8232
489d5531 8233} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
8234
489d5531 8235//================================================================================================================================
8236
489d5531 8237void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
8238{
8239 // Access all pointers to common control and common result histograms and profiles.
8240
1268c371 8241 TString sCommonConstantsName = "fCommonConstants";
8242 sCommonConstantsName += fAnalysisLabel->Data();
8243 fCommonConstants = dynamic_cast<TProfile*>(fHistList->FindObject(sCommonConstantsName.Data()));
8244 if(!fCommonConstants)
8245 {
8246 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::GPFCH() !!!!\n\n");
8247 exit(0);
8248 }
8249
8250 // to be improved - lines bellow can be implemented better.
8251
489d5531 8252 TString commonHistsName = "AliFlowCommonHistQC";
8253 commonHistsName += fAnalysisLabel->Data();
8254 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
b77b6434 8255 if(commonHist)
8256 {
8257 this->SetCommonHists(commonHist);
8258 if(fCommonHists->GetHarmonic())
8259 {
8260 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
8261 }
8262 } // end of if(commonHist)
489d5531 8263 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
8264 commonHists2ndOrderName += fAnalysisLabel->Data();
8265 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
8266 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
8267 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
8268 commonHists4thOrderName += fAnalysisLabel->Data();
8269 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
8270 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
8271 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
8272 commonHists6thOrderName += fAnalysisLabel->Data();
8273 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
8274 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
8275 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
8276 commonHists8thOrderName += fAnalysisLabel->Data();
8277 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
dd442cd2 8278 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
8279
489d5531 8280 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
8281 commonHistResults2ndOrderName += fAnalysisLabel->Data();
b77b6434 8282 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
8283 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
489d5531 8284 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
8285 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
8286 commonHistResults4thOrderName += fAnalysisLabel->Data();
8287 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
8288 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
8289 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
8290 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
8291 commonHistResults6thOrderName += fAnalysisLabel->Data();
8292 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
8293 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
8294 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
8295 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
8296 commonHistResults8thOrderName += fAnalysisLabel->Data();
8297 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
8298 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
8299 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
8300
8301} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
8302
489d5531 8303//================================================================================================================================
8304
489d5531 8305void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
8306{
8307 // Get pointers for histograms with particle weights.
8308
8309 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
ca5f47e7 8310 if(!weightsList){printf("\n WARNING (QC): weightsList is NULL in AFAWQC::GPFPWH() !!!!\n");exit(0);}
8311 this->SetWeightsList(weightsList);
489d5531 8312 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
8313 fUseParticleWeightsName += fAnalysisLabel->Data();
8314 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
8315 if(useParticleWeights)
8316 {
8317 this->SetUseParticleWeights(useParticleWeights);
8318 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
8319 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
8320 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
403e3389 8321 fUseTrackWeights = (Int_t)fUseParticleWeights->GetBinContent(4);
489d5531 8322 }
8323} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
8324
489d5531 8325//================================================================================================================================
8326
489d5531 8327void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8328{
8329 // Get pointers for histograms and profiles relevant for integrated flow:
8330 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
8331 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
8332 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
8333 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
8334
8335 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
8336 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
b40a910e 8337 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?)
8338 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 8339
8340 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
8341 TList *intFlowList = NULL;
8342 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
8343 if(!intFlowList)
8344 {
8345 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8346 exit(0);
8347 }
8348
b92ea2b9 8349 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
8350 TString intFlowFlagsName = "fIntFlowFlags";
8351 intFlowFlagsName += fAnalysisLabel->Data();
8352 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
8353 if(intFlowFlags)
8354 {
8355 this->SetIntFlowFlags(intFlowFlags);
8356 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
8357 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
8358 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
8359 } else
8360 {
8361 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
8362 }
489d5531 8363
8364 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
8365 TList *intFlowProfiles = NULL;
8366 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
8367 if(intFlowProfiles)
8368 {
8369 // average multiplicities:
8370 TString avMultiplicityName = "fAvMultiplicity";
8371 avMultiplicityName += fAnalysisLabel->Data();
8372 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
8373 if(avMultiplicity)
8374 {
8375 this->SetAvMultiplicity(avMultiplicity);
8376 } else
8377 {
8378 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8379 }
8380 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
8381 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
8382 intFlowCorrelationsProName += fAnalysisLabel->Data();
8383 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
8384 if(intFlowCorrelationsPro)
8385 {
8386 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
8387 } else
8388 {
8389 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 8390 }
b40a910e 8391 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8^2>>:
8392 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
8393 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8394 TProfile *intFlowSquaredCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowSquaredCorrelationsProName.Data()));
8395 if(intFlowSquaredCorrelationsPro)
8396 {
8397 this->SetIntFlowSquaredCorrelationsPro(intFlowSquaredCorrelationsPro);
8398 } else
8399 {
8400 cout<<"WARNING: intFlowSquaredCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8401 }
b3dacf6b 8402 if(fCalculateCumulantsVsM)
ff70ca91 8403 {
b40a910e 8404 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
b3dacf6b 8405 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
8406 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
8407 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 8408 {
b3dacf6b 8409 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
8410 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
8411 if(intFlowCorrelationsVsMPro)
8412 {
8413 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
8414 } else
8415 {
8416 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8417 }
8418 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b40a910e 8419 // Average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
8420 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
8421 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
8422 for(Int_t ci=0;ci<4;ci++) // correlation index
8423 {
8424 TProfile *intFlowSquaredCorrelationsVsMPro = dynamic_cast<TProfile*>
8425 (intFlowProfiles->FindObject(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data())));
8426 if(intFlowSquaredCorrelationsVsMPro)
8427 {
8428 this->SetIntFlowSquaredCorrelationsVsMPro(intFlowSquaredCorrelationsVsMPro,ci);
8429 } else
8430 {
8431 cout<<"WARNING: "<<Form("intFlowSquaredCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8432 }
8433 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b3dacf6b 8434 } // end of if(fCalculateCumulantsVsM)
489d5531 8435 // average all correlations for integrated flow (with wrong errors!):
8436 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
8437 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
8438 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
8439 if(intFlowCorrelationsAllPro)
8440 {
8441 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
8442 } else
8443 {
8444 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8445 }
8446 // average extra correlations for integrated flow (which appear only when particle weights are used):
8447 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
403e3389 8448 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 8449 {
8450 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
8451 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
8452 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
8453 if(intFlowExtraCorrelationsPro)
8454 {
8455 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
8456 } else
8457 {
8458 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8459 }
403e3389 8460 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 8461 // average products of correlations <2>, <4>, <6> and <8>:
8462 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
8463 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8464 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
8465 if(intFlowProductOfCorrelationsPro)
8466 {
8467 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
8468 } else
8469 {
8470 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 8471 }
8472 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
8473 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 8474 if(fCalculateCumulantsVsM)
8475 {
8476 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
8477 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
403e3389 8478 TString productFlag[6] = {"#LT#LT2#GT#LT4#GT#GT","#LT#LT2#GT#LT6#GT#GT","#LT#LT2#GT#LT8#GT#GT",
8479 "#LT#LT4#GT#LT6#GT#GT","#LT#LT4#GT#LT8#GT#GT","#LT#LT6#GT#LT8#GT#GT"};
b3dacf6b 8480 for(Int_t pi=0;pi<6;pi++)
8481 {
8482 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
8483 if(intFlowProductOfCorrelationsVsMPro)
8484 {
8485 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
8486 } else
8487 {
8488 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8489 }
8490 } // end of for(Int_t pi=0;pi<6;pi++)
8491 } // end of if(fCalculateCumulantsVsM)
489d5531 8492 // average correction terms for non-uniform acceptance (with wrong errors!):
8493 for(Int_t sc=0;sc<2;sc++)
8494 {
8495 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
8496 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8497 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
8498 if(intFlowCorrectionTermsForNUAPro)
8499 {
8500 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
8501 } else
8502 {
8503 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8504 cout<<"sc = "<<sc<<endl;
8505 }
2001bc3a 8506 // versus multiplicity:
b3dacf6b 8507 if(fCalculateCumulantsVsM)
2001bc3a 8508 {
b3dacf6b 8509 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
8510 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
8511 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
8512 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 8513 {
b3dacf6b 8514 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
8515 if(intFlowCorrectionTermsForNUAVsMPro)
8516 {
8517 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
8518 } else
8519 {
8520 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8521 cout<<"sc = "<<sc<<endl;
8522 cout<<"ci = "<<ci<<endl;
8523 }
8524 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
8525 } // end of if(fCalculateCumulantsVsM)
489d5531 8526 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 8527 // average products of correction terms for NUA:
8528 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
8529 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8530 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
8531 if(intFlowProductOfCorrectionTermsForNUAPro)
8532 {
8533 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
8534 } else
8535 {
8536 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8537 }
489d5531 8538 } else // to if(intFlowProfiles)
8539 {
8540 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8541 }
8542
8543 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
8544 TList *intFlowResults = NULL;
8545 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
8546 if(intFlowResults)
8547 {
8548 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
8549 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
8550 intFlowCorrelationsHistName += fAnalysisLabel->Data();
8551 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
8552 if(intFlowCorrelationsHist)
8553 {
8554 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
8555 } else
8556 {
8557 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8558 }
ff70ca91 8559 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
b3dacf6b 8560 if(fCalculateCumulantsVsM)
ff70ca91 8561 {
b3dacf6b 8562 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
8563 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
8564 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 8565 {
b3dacf6b 8566 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
8567 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
8568 if(intFlowCorrelationsVsMHist)
8569 {
8570 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
8571 } else
8572 {
8573 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8574 }
8575 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8576 } // end of if(fCalculateCumulantsVsM)
489d5531 8577 // average all correlations for integrated flow (with correct errors!):
8578 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
8579 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
8580 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
8581 if(intFlowCorrelationsAllHist)
8582 {
8583 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
8584 } else
8585 {
8586 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8587 }
8588 // average correction terms for non-uniform acceptance (with correct errors!):
8589 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
8590 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8591 for(Int_t sc=0;sc<2;sc++)
8592 {
8593 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
8594 if(intFlowCorrectionTermsForNUAHist)
8595 {
8596 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
8597 } else
8598 {
8599 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8600 cout<<"sc = "<<sc<<endl;
8601 }
8602 } // end of for(Int_t sc=0;sc<2;sc++)
8603 // covariances (multiplied with weight dependent prefactor):
8604 TString intFlowCovariancesName = "fIntFlowCovariances";
8605 intFlowCovariancesName += fAnalysisLabel->Data();
8606 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
8607 if(intFlowCovariances)
8608 {
8609 this->SetIntFlowCovariances(intFlowCovariances);
8610 } else
8611 {
8612 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8613 }
8614 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
8615 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
8616 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8617 for(Int_t power=0;power<2;power++)
8618 {
8619 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
8620 if(intFlowSumOfEventWeights)
8621 {
8622 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
8623 } else
8624 {
8625 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8626 cout<<"power = "<<power<<endl;
8627 }
8628 } // end of for(Int_t power=0;power<2;power++)
8629 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
8630 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
8631 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8632 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
8633 if(intFlowSumOfProductOfEventWeights)
8634 {
8635 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
8636 } else
8637 {
8638 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8639 }
ff70ca91 8640 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
8641 // [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 8642 if(fCalculateCumulantsVsM)
ff70ca91 8643 {
b3dacf6b 8644 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
8645 intFlowCovariancesVsMName += fAnalysisLabel->Data();
8646 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
8647 for(Int_t ci=0;ci<6;ci++)
8648 {
8649 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
8650 if(intFlowCovariancesVsM)
ff70ca91 8651 {
b3dacf6b 8652 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
ff70ca91 8653 } else
8654 {
b3dacf6b 8655 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 8656 }
b3dacf6b 8657 } // end of for(Int_t ci=0;ci<6;ci++)
8658 } // end of if(fCalculateCumulantsVsM)
8659 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
8660 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
8661 if(fCalculateCumulantsVsM)
8662 {
8663 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
8664 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
8665 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>}"},
8666 {"#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}"}};
8667 for(Int_t si=0;si<4;si++)
8668 {
8669 for(Int_t power=0;power<2;power++)
8670 {
8671 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
8672 if(intFlowSumOfEventWeightsVsM)
8673 {
8674 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
8675 } else
8676 {
8677 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8678 }
8679 } // end of for(Int_t power=0;power<2;power++)
8680 } // end of for(Int_t si=0;si<4;si++)
8681 } // end of if(fCalculateCumulantsVsM)
ff70ca91 8682 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
8683 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
8684 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 8685 if(fCalculateCumulantsVsM)
ff70ca91 8686 {
b3dacf6b 8687 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
8688 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
8689 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>}",
8690 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
8691 for(Int_t pi=0;pi<6;pi++)
ff70ca91 8692 {
b3dacf6b 8693 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
8694 if(intFlowSumOfProductOfEventWeightsVsM)
8695 {
8696 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
8697 } else
8698 {
8699 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8700 }
8701 } // end of for(Int_t pi=0;pi<6;pi++)
8702 } // end of if(fCalculateCumulantsVsM)
0328db2d 8703 // covariances for NUA (multiplied with weight dependent prefactor):
8704 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
8705 intFlowCovariancesNUAName += fAnalysisLabel->Data();
8706 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
8707 if(intFlowCovariancesNUA)
8708 {
8709 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
8710 } else
8711 {
8712 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8713 }
8714 // sum of linear and quadratic event weights NUA terms:
8715 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
8716 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
8717 for(Int_t sc=0;sc<2;sc++)
8718 {
8719 for(Int_t power=0;power<2;power++)
8720 {
8721 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
8722 if(intFlowSumOfEventWeightsNUA)
8723 {
8724 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
8725 } else
8726 {
8727 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8728 cout<<"sc = "<<sc<<endl;
8729 cout<<"power = "<<power<<endl;
8730 }
8731 } // end of for(Int_t power=0;power<2;power++)
8732 } // end of for(Int_t sc=0;sc<2;sc++)
8733 // sum of products of event weights for NUA terms:
8734 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
8735 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
8736 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
8737 if(intFlowSumOfProductOfEventWeightsNUA)
8738 {
8739 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
8740 } else
8741 {
8742 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8743 }
b3dacf6b 8744 // Final results for reference Q-cumulants:
489d5531 8745 TString intFlowQcumulantsName = "fIntFlowQcumulants";
8746 intFlowQcumulantsName += fAnalysisLabel->Data();
8747 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
8748 if(intFlowQcumulants)
8749 {
8750 this->SetIntFlowQcumulants(intFlowQcumulants);
8751 } else
8752 {
8753 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8754 }
b3dacf6b 8755 // Final results for reference Q-cumulants rebinned in M:
8756 if(fCalculateCumulantsVsM)
8757 {
8758 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
8759 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
8760 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
8761 if(intFlowQcumulantsRebinnedInM)
8762 {
8763 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
8764 } else
8765 {
8766 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8767 }
8768 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 8769 // Ratio between error squared: with/without non-isotropic terms:
8770 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
8771 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
8772 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
8773 if(intFlowQcumulantsErrorSquaredRatio)
8774 {
8775 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
8776 } else
8777 {
8778 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8779 }
ff70ca91 8780 // final results for integrated Q-cumulants versus multiplicity:
ff70ca91 8781 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
b3dacf6b 8782 if(fCalculateCumulantsVsM)
ff70ca91 8783 {
b3dacf6b 8784 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
8785 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
8786 for(Int_t co=0;co<4;co++) // cumulant order
ff70ca91 8787 {
b3dacf6b 8788 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
8789 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
8790 if(intFlowQcumulantsVsM)
8791 {
8792 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
8793 } else
8794 {
8795 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8796 }
8797 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8798 } // end of if(fCalculateCumulantsVsM)
8799 // Final reference flow estimates from Q-cumulants:
489d5531 8800 TString intFlowName = "fIntFlow";
8801 intFlowName += fAnalysisLabel->Data();
8802 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
8803 if(intFlow)
8804 {
8805 this->SetIntFlow(intFlow);
8806 } else
8807 {
8808 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 8809 }
b3dacf6b 8810 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
8811 if(fCalculateCumulantsVsM)
ff70ca91 8812 {
b3dacf6b 8813 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
8814 intFlowRebinnedInMName += fAnalysisLabel->Data();
8815 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
8816 if(intFlowRebinnedInM)
ff70ca91 8817 {
b3dacf6b 8818 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
8819 } else
ff70ca91 8820 {
b3dacf6b 8821 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8822 }
8823 } // end of if(fCalculateCumulantsVsM)
8824 // integrated flow from Q-cumulants versus multiplicity:
8825 if(fCalculateCumulantsVsM)
8826 {
8827 TString intFlowVsMName = "fIntFlowVsM";
8828 intFlowVsMName += fAnalysisLabel->Data();
b77b6434 8829 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 8830 for(Int_t co=0;co<4;co++) // cumulant order
8831 {
8832 TH1D *intFlowVsM = dynamic_cast<TH1D*>
b77b6434 8833 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
b3dacf6b 8834 if(intFlowVsM)
8835 {
8836 this->SetIntFlowVsM(intFlowVsM,co);
8837 } else
8838 {
8839 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8840 }
8841 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8842 } // end of if(fCalculateCumulantsVsM)
2001bc3a 8843 // quantifying detector effects effects to correlations:
8844 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
8845 intFlowDetectorBiasName += fAnalysisLabel->Data();
8846 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
8847 if(intFlowDetectorBias)
8848 {
8849 this->SetIntFlowDetectorBias(intFlowDetectorBias);
8850 } else
8851 {
8852 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8853 }
8854 // quantifying detector effects effects to correlations vs multiplicity:
b77b6434 8855 if(fCalculateCumulantsVsM)
2001bc3a 8856 {
3c5d5752 8857 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
8858 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
8859 for(Int_t ci=0;ci<4;ci++) // correlation index
2001bc3a 8860 {
3c5d5752 8861 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
8862 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
8863 if(intFlowDetectorBiasVsM)
8864 {
8865 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
8866 } else
8867 {
8868 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8869 }
8870 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b77b6434 8871 } // end of if(fCalculateCumulantsVsM)
489d5531 8872 } else // to if(intFlowResults)
8873 {
8874 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8875 }
ff70ca91 8876
489d5531 8877} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8878
489d5531 8879//================================================================================================================================
8880
1268c371 8881void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8882{
8883 // Get pointers for 2D differential flow histograms.
8884 // a) Check pointers used in this method;
8885 // b) Get pointers to 2D differential flow lists;
8886 // c) Get pointers to 2D differential flow profiles;
8887 // d) Get pointers to 2D differential flow histograms.
8888
8889 // a) Check pointers used in this method:
8890 if(!fDiffFlowList)
8891 {
8892 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPF2DDFH() !!!!\n");
8893 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8894 exit(0);
8895 }
8896 if(!fDiffFlowFlags)
8897 {
8898 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPF2DDFH() !!!!\n\n");
8899 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8900 exit(0);
8901 }
8902
8903 // b) Get pointers to 2D differential flow lists:
8904 this->SetCalculate2DDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(5)); // to be improved - hardwired 5
8905 if(!fCalculate2DDiffFlow){return;}
8906 TString typeFlag[2] = {"RP","POI"};
8907 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8908 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8909 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8910 // Base list:
8911 TString diffFlow2DListName = "2D";
8912 diffFlow2DListName += fAnalysisLabel->Data();
8913 fDiffFlow2D = dynamic_cast<TList*>(fDiffFlowList->FindObject(diffFlow2DListName.Data()));
8914 if(!fDiffFlow2D)
8915 {
8916 printf("\n WARNING (QC): fDiffFlow2D is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8917 exit(0);
8918 }
8919 // Lists holding profiles with 2D correlations:
8920 TString s2DDiffFlowCorrelationsProListName = "Profiles with 2D correlations";
8921 s2DDiffFlowCorrelationsProListName += fAnalysisLabel->Data(); // to be improved
8922 for(Int_t t=0;t<2;t++)
8923 {
8924 f2DDiffFlowCorrelationsProList[t] = dynamic_cast<TList*>(fDiffFlow2D->FindObject(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data())));
8925 if(!f2DDiffFlowCorrelationsProList[t])
8926 {
8927 printf("\n WARNING (QC): f2DDiffFlowCorrelationsProList[%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t);
8928 exit(0);
8929 }
8930 } // end of for(Int_t t=0;t<2;t++)
8931
8932 // c) Get pointers to 2D differential flow profiles:
8933 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8934 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8935 for(Int_t t=0;t<2;t++) // type: RP or POI
8936 {
8937 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8938 {
8939 f2DDiffFlowCorrelationsPro[t][rci] = dynamic_cast<TProfile2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data())));
8940 if(!f2DDiffFlowCorrelationsPro[t][rci])
8941 {
8942 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8943 exit(0);
8944 } else
8945 {
8946 this->Set2DDiffFlowCorrelationsPro(f2DDiffFlowCorrelationsPro[t][rci],t,rci);
8947 }
8948 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8949 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8950
8951 // d) Get pointers to 2D differential flow histograms:
8952 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8953 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8954 TString s2DDiffFlowName = "f2DDiffFlow";
8955 s2DDiffFlowName += fAnalysisLabel->Data();
8956 for(Int_t t=0;t<2;t++) // type: RP or POI
8957 {
8958 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8959 {
8960 // 2D differential cumulants:
8961 f2DDiffFlowCumulants[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data())));
8962 if(!f2DDiffFlowCumulants[t][rci])
8963 {
8964 printf("\n WARNING (QC): f2DDiffFlowCumulants[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8965 exit(0);
8966 } else
8967 {
8968 this->Set2DDiffFlowCumulants(f2DDiffFlowCumulants[t][rci],t,rci);
8969 }
8970 // 2D differential flow:
8971 f2DDiffFlow[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data())));
8972 if(!f2DDiffFlow[t][rci])
8973 {
8974 printf("\n WARNING (QC): f2DDiffFlow[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8975 exit(0);
8976 } else
8977 {
8978 this->Set2DDiffFlow(f2DDiffFlow[t][rci],t,rci);
8979 }
8980 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8981 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8982
8983} // end of void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8984
8985//================================================================================================================================
8986
64e500e3 8987void AliFlowAnalysisWithQCumulants::GetPointersForOtherDiffCorrelators()
8988{
8989 // Get pointers for other differential correlators.
8990 // a) Get pointer to list with other differential correlators;
8991 // b) Declare local flags;
8992 // c) Get pointers to other differential profiles.
8993
8994 // a) Get pointer to list with other differential correlators:
8995 fOtherDiffCorrelatorsList = dynamic_cast<TList*>(fHistList->FindObject("Other differential correlators"));
8996 if(!fOtherDiffCorrelatorsList)
8997 {
8998 printf("\n WARNING (QC): fOtherDiffCorrelatorsList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8999 exit(0);
9000 }
9001
9002 // b) Declare local flags: // (to be improved - promoted to data members)
9003 TString typeFlag[2] = {"RP","POI"};
9004 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9005 TString sinCosFlag[2] = {"sin","cos"};
9006
9007 // c) Get pointers to other differential profiles:
9008 TString otherDiffCorrelatorsName = "fOtherDiffCorrelators";
9009 otherDiffCorrelatorsName += fAnalysisLabel->Data();
9010 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9011 {
9012 for(Int_t pe=0;pe<2;pe++) // pt or eta
9013 {
9014 for(Int_t sc=0;sc<2;sc++) // sin or cos
9015 {
9016 for(Int_t ci=0;ci<1;ci++) // correlator index
9017 {
9018 fOtherDiffCorrelators[t][pe][sc][ci] = dynamic_cast<TProfile*>(fOtherDiffCorrelatorsList->FindObject(Form("%s, %s, %s, %s, ci = %d",otherDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1)));
9019 if(!fOtherDiffCorrelators[t][pe][sc][ci])
9020 {
9021 printf("\n WARNING (QC): fOtherDiffCorrelators[%i][%i][%i][%i] is NULL in AFAWQC::GPFODC() !!!!\n\n",t,pe,sc,ci);
9022 exit(0);
9023 } else
9024 {
9025 this->SetOtherDiffCorrelators(fOtherDiffCorrelators[t][pe][sc][ci],t,pe,sc,ci);
9026 }
9027 } // end of for(Int_t ci=0;ci<1;ci++) // correlator index
9028 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9029 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9030 } // end of for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9031
9032} // end of void AliFlowAnalysisWithQCumulants::GetPointersForOtherDiffCorrelators()
9033
9034//================================================================================================================================
9035
489d5531 9036void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
9037{
9038 // Get pointer to all objects relevant for differential flow.
1268c371 9039 // a) Get pointer to base list for differential flow fDiffFlowList;
9040 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags;
9041 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults;
9042 // d) Define flags locally (to be improved: should I promote these flags to data members?);
9043 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
9044 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
9045
9046 // a) Get pointer to base list for differential flow fDiffFlowList:
9047 fDiffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
9048 if(!fDiffFlowList)
489d5531 9049 {
1268c371 9050 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 9051 exit(0);
9052 }
1268c371 9053
9054 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags:
9055 TString diffFlowFlagsName = "fDiffFlowFlags";
9056 diffFlowFlagsName += fAnalysisLabel->Data();
9057 fDiffFlowFlags = dynamic_cast<TProfile*>(fDiffFlowList->FindObject(diffFlowFlagsName.Data()));
9058 if(fDiffFlowFlags)
9059 {
9060 this->SetCalculateDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(1)); // to be improved - hardwired 5
9061 } else
9062 {
9063 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9064 printf("\n Flags in method Finish() are wrong.\n\n");
9065 exit(0);
9066 }
9067
9068 if(!fCalculateDiffFlow){return;} // IMPORTANT: do not move this anywhere above in this method (to be improved)
9069
9070 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults:
9071 // List holding nested lists holding profiles:
489d5531 9072 TList *diffFlowListProfiles = NULL;
1268c371 9073 diffFlowListProfiles = dynamic_cast<TList*>(fDiffFlowList->FindObject("Profiles"));
489d5531 9074 if(!diffFlowListProfiles)
9075 {
1268c371 9076 printf("\n WARNING (QC): diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 9077 exit(0);
9078 }
1268c371 9079 // List holding nested lists holding histograms with final results:
489d5531 9080 TList *diffFlowListResults = NULL;
1268c371 9081 diffFlowListResults = dynamic_cast<TList*>(fDiffFlowList->FindObject("Results"));
489d5531 9082 if(!diffFlowListResults)
9083 {
1268c371 9084 printf("\n WARNING (QC): diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 9085 exit(0);
9086 }
9087
1268c371 9088 // d) Define flags locally (to be improved: should I promote these flags to data members?):
9089 TString typeFlag[2] = {"RP","POI"};
9090 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9091 TString powerFlag[2] = {"linear","quadratic"};
9092 TString sinCosFlag[2] = {"sin","cos"};
9093 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9094 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9095 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9096 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
9097 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
9098 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
489d5531 9099
1268c371 9100 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold:
489d5531 9101 // correlations:
9102 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
9103 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
9104 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 9105 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
9106 // squared correlations:
9107 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
9108 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
9109 TProfile *diffFlowSquaredCorrelationsPro[2][2][4] = {{{NULL}}};
489d5531 9110 // products of correlations:
9111 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
9112 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
9113 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
9114 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
9115 // corrections:
9116 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
9117 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
9118 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
9119 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
9120 for(Int_t t=0;t<2;t++)
9121 {
9122 for(Int_t pe=0;pe<2;pe++)
9123 {
9124 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9125 if(!diffFlowCorrelationsProList[t][pe])
9126 {
9127 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9128 cout<<"t = "<<t<<endl;
9129 cout<<"pe = "<<pe<<endl;
9130 exit(0);
9131 }
9132 for(Int_t ci=0;ci<4;ci++) // correlation index
9133 {
b40a910e 9134 // reduced correlations:
489d5531 9135 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())));
9136 if(diffFlowCorrelationsPro[t][pe][ci])
9137 {
9138 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
9139 } else
9140 {
9141 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9142 cout<<"t = "<<t<<endl;
9143 cout<<"pe = "<<pe<<endl;
9144 cout<<"ci = "<<ci<<endl;
9145 }
b40a910e 9146 // reduced squared correlations:
9147 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())));
9148 if(diffFlowSquaredCorrelationsPro[t][pe][ci])
9149 {
9150 this->SetDiffFlowSquaredCorrelationsPro(diffFlowSquaredCorrelationsPro[t][pe][ci],t,pe,ci);
9151 } else
9152 {
9153 cout<<"WARNING: diffFlowSquaredCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9154 cout<<"t = "<<t<<endl;
9155 cout<<"pe = "<<pe<<endl;
9156 cout<<"ci = "<<ci<<endl;
9157 }
489d5531 9158 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9159 // products of correlations:
9160 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9161 if(!diffFlowProductOfCorrelationsProList[t][pe])
9162 {
9163 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9164 cout<<"t = "<<t<<endl;
9165 cout<<"pe = "<<pe<<endl;
9166 exit(0);
9167 }
9168 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9169 {
9170 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9171 {
9172 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())));
9173 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
9174 {
9175 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
9176 } else
9177 {
b40a910e 9178 cout<<"WARNING: diffFlowProductOfCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
489d5531 9179 cout<<"t = "<<t<<endl;
9180 cout<<"pe = "<<pe<<endl;
9181 cout<<"mci1 = "<<mci1<<endl;
9182 cout<<"mci2 = "<<mci2<<endl;
9183 }
9184 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9185 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9186 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9187 // corrections:
9188 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9189 if(!diffFlowCorrectionsProList[t][pe])
9190 {
9191 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9192 cout<<"t = "<<t<<endl;
9193 cout<<"pe = "<<pe<<endl;
9194 exit(0);
9195 }
9196 // correction terms for NUA:
9197 for(Int_t sc=0;sc<2;sc++) // sin or cos
9198 {
9199 for(Int_t cti=0;cti<9;cti++) // correction term index
9200 {
9201 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)));
9202 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
9203 {
9204 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
9205 } else
9206 {
9207 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9208 cout<<"t = "<<t<<endl;
9209 cout<<"pe = "<<pe<<endl;
9210 cout<<"sc = "<<sc<<endl;
9211 cout<<"cti = "<<cti<<endl;
9212 }
9213 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9214 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9215 // ...
9216 } // end of for(Int_t pe=0;pe<2;pe++)
9217 } // end of for(Int_t t=0;t<2;t++)
9218
1268c371 9219 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold:
489d5531 9220 // reduced correlations:
9221 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
9222 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
9223 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
9224 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
9225 // corrections for NUA:
9226 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
9227 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
9228 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
9229 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
9230 // differential Q-cumulants:
9231 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
9232 TString diffFlowCumulantsName = "fDiffFlowCumulants";
9233 diffFlowCumulantsName += fAnalysisLabel->Data();
9234 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1268c371 9235 // detector bias to differential Q-cumulants:
9236 TList *diffFlowDetectorBiasHistList[2][2] = {{NULL}};
9237 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
9238 diffFlowDetectorBiasName += fAnalysisLabel->Data();
9239 TH1D *diffFlowDetectorBias[2][2][4] = {{{NULL}}};
489d5531 9240 // differential flow estimates from Q-cumulants:
9241 TList *diffFlowHistList[2][2] = {{NULL}};
9242 TString diffFlowName = "fDiffFlow";
9243 diffFlowName += fAnalysisLabel->Data();
9244 TH1D *diffFlow[2][2][4] = {{{NULL}}};
9245 // differential covariances:
9246 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
9247 TString diffFlowCovariancesName = "fDiffFlowCovariances";
9248 diffFlowCovariancesName += fAnalysisLabel->Data();
9249 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
9250 for(Int_t t=0;t<2;t++) // type: RP or POI
9251 {
9252 for(Int_t pe=0;pe<2;pe++) // pt or eta
9253 {
9254 // reduced correlations:
9255 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9256 if(!diffFlowCorrelationsHistList[t][pe])
9257 {
9258 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9259 cout<<"t = "<<t<<endl;
9260 cout<<"pe = "<<pe<<endl;
9261 exit(0);
9262 }
9263 for(Int_t index=0;index<4;index++)
9264 {
9265 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())));
9266 if(diffFlowCorrelationsHist[t][pe][index])
9267 {
9268 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
9269 } else
9270 {
9271 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9272 cout<<"t = "<<t<<endl;
9273 cout<<"pe = "<<pe<<endl;
9274 cout<<"index = "<<index<<endl;
9275 exit(0);
9276 }
9277 } // end of for(Int_t index=0;index<4;index++)
9278 // corrections:
9279 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9280 if(!diffFlowCorrectionsHistList[t][pe])
9281 {
9282 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9283 cout<<"t = "<<t<<endl;
9284 cout<<"pe = "<<pe<<endl;
9285 exit(0);
9286 }
9287 // correction terms for NUA:
9288 for(Int_t sc=0;sc<2;sc++) // sin or cos
9289 {
9290 for(Int_t cti=0;cti<9;cti++) // correction term index
9291 {
9292 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)));
9293 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
9294 {
9295 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
9296 } else
9297 {
9298 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9299 cout<<"t = "<<t<<endl;
9300 cout<<"pe = "<<pe<<endl;
9301 cout<<"sc = "<<sc<<endl;
9302 cout<<"cti = "<<cti<<endl;
9303 }
9304 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9305 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9306 // ...
9307 // differential Q-cumulants:
9308 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9309 if(!diffFlowCumulantsHistList[t][pe])
9310 {
9311 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9312 cout<<"t = "<<t<<endl;
9313 cout<<"pe = "<<pe<<endl;
9314 exit(0);
9315 }
9316 for(Int_t index=0;index<4;index++)
9317 {
9318 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())));
9319 if(diffFlowCumulants[t][pe][index])
9320 {
9321 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
9322 } else
9323 {
9324 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9325 cout<<"t = "<<t<<endl;
9326 cout<<"pe = "<<pe<<endl;
9327 cout<<"index = "<<index<<endl;
9328 exit(0);
9329 }
9330 } // end of for(Int_t index=0;index<4;index++)
1268c371 9331 // Detector bias to differential Q-cumulants:
9332 diffFlowDetectorBiasHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9333 if(!diffFlowDetectorBiasHistList[t][pe])
9334 {
9335 cout<<"WARNING: diffFlowDetectorBiasHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9336 cout<<"t = "<<t<<endl;
9337 cout<<"pe = "<<pe<<endl;
9338 exit(0);
9339 }
9340 for(Int_t index=0;index<4;index++)
9341 {
9342 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())));
9343 if(diffFlowDetectorBias[t][pe][index])
9344 {
9345 this->SetDiffFlowDetectorBias(diffFlowDetectorBias[t][pe][index],t,pe,index);
9346 } else
9347 {
9348 cout<<"WARNING: diffFlowDetectorBias[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9349 cout<<"t = "<<t<<endl;
9350 cout<<"pe = "<<pe<<endl;
9351 cout<<"index = "<<index<<endl;
9352 exit(0);
9353 }
9354 } // end of for(Int_t index=0;index<4;index++)
489d5531 9355 // differential flow estimates from Q-cumulants:
9356 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9357 if(!diffFlowHistList[t][pe])
9358 {
9359 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9360 cout<<"t = "<<t<<endl;
9361 cout<<"pe = "<<pe<<endl;
9362 exit(0);
9363 }
9364 for(Int_t index=0;index<4;index++)
9365 {
9366 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())));
9367 if(diffFlow[t][pe][index])
9368 {
9369 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
9370 } else
9371 {
9372 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9373 cout<<"t = "<<t<<endl;
9374 cout<<"pe = "<<pe<<endl;
9375 cout<<"index = "<<index<<endl;
9376 exit(0);
9377 }
9378 } // end of for(Int_t index=0;index<4;index++)
9379 // differential covariances:
9380 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9381 if(!diffFlowCovariancesHistList[t][pe])
9382 {
9383 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9384 cout<<"t = "<<t<<endl;
9385 cout<<"pe = "<<pe<<endl;
9386 exit(0);
9387 }
9388 for(Int_t covIndex=0;covIndex<5;covIndex++)
9389 {
9390 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())));
9391 if(diffFlowCovariances[t][pe][covIndex])
9392 {
9393 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
9394 } else
9395 {
9396 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9397 cout<<"t = "<<t<<endl;
9398 cout<<"pe = "<<pe<<endl;
9399 cout<<"covIndex = "<<covIndex<<endl;
9400 exit(0);
9401 }
9402 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9403 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9404 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9405 // sum of event weights for reduced correlations:
9406 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
9407 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
9408 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
9409 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
9410 for(Int_t t=0;t<2;t++) // type is RP or POI
9411 {
9412 for(Int_t pe=0;pe<2;pe++) // pt or eta
9413 {
9414 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
9415 {
9416 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())));
9417 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
9418 {
9419 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9420 cout<<"t = "<<t<<endl;
9421 cout<<"pe = "<<pe<<endl;
9422 cout<<"power = "<<p<<endl;
9423 exit(0);
9424 }
9425 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
9426 {
9427 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())));
9428 if(diffFlowSumOfEventWeights[t][pe][p][ew])
9429 {
9430 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
9431 } else
9432 {
9433 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9434 cout<<"t = "<<t<<endl;
9435 cout<<"pe = "<<pe<<endl;
9436 cout<<"power = "<<p<<endl;
9437 cout<<"ew = "<<ew<<endl;
9438 exit(0);
9439 }
9440 }
9441 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
9442 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9443 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
9444 //
9445 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
9446 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
9447 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
9448 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
9449 for(Int_t t=0;t<2;t++) // type is RP or POI
9450 {
9451 for(Int_t pe=0;pe<2;pe++) // pt or eta
9452 {
9453 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9454 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
9455 {
9456 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9457 cout<<"t = "<<t<<endl;
9458 cout<<"pe = "<<pe<<endl;
9459 exit(0);
9460 }
9461 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9462 {
9463 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9464 {
9465 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())));
9466 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
9467 {
9468 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
9469 } else
9470 {
9471 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9472 cout<<"t = "<<t<<endl;
9473 cout<<"pe = "<<pe<<endl;
9474 cout<<"mci1 = "<<mci1<<endl;
9475 cout<<"mci2 = "<<mci2<<endl;
9476 exit(0);
9477 }
9478 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9479 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9480 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9481 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9482 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
9483
9484} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
9485
489d5531 9486//================================================================================================================================
9487
1268c371 9488void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
9489{
9490 // Book all objects needed for 2D differential flow.
9491 // a) Define flags locally (to be improved: should I promote flags to data members?);
9492 // b) Book e-b-e quantities;
9493 // c) Book 2D profiles;
9494 // d) Book 2D histograms.
9495
9496 if(!fCalculate2DDiffFlow){return;}
9497
9498 // a) Define flags locally (to be improved: should I promote flags to data members?):
9499 TString typeFlag[2] = {"RP","POI"};
9500 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9501 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9502 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9503
9504 // b) Book e-b-e quantities:
9505 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9506 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9507 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9508 {
9509 for(Int_t m=0;m<4;m++)
9510 {
9511 for(Int_t k=0;k<9;k++)
9512 {
9513 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
9514 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
9515 }
9516 }
9517 }
9518 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9519 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9520 {
9521 for(Int_t k=0;k<9;k++)
9522 {
9523 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
9524 }
9525 }
9526
9527 // c) Book 2D profiles:
9528 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
9529 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
9530 for(Int_t t=0;t<2;t++) // type: RP or POI
9531 {
9532 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9533 {
9534 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,"");
9535 f2DDiffFlowCorrelationsPro[t][rci]->Sumw2();
9536 f2DDiffFlowCorrelationsPro[t][rci]->SetXTitle("p_{t}");
9537 f2DDiffFlowCorrelationsPro[t][rci]->SetYTitle("#eta");
9538 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCorrelationsPro[t][rci]);
9539 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9540 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
9541
9542 // d) Book 2D histograms:
9543 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
9544 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
9545 TString s2DDiffFlowName = "f2DDiffFlow";
9546 s2DDiffFlowName += fAnalysisLabel->Data();
9547 for(Int_t t=0;t<2;t++) // type: RP or POI
9548 {
9549 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9550 {
9551 // 2D diferential cumulants:
9552 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);
9553 f2DDiffFlowCumulants[t][rci]->SetXTitle("p_{t}");
9554 f2DDiffFlowCumulants[t][rci]->SetYTitle("#eta");
9555 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCumulants[t][rci]); // to be improved - moved to another list
9556 // 2D differential flow:
9557 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);
9558 f2DDiffFlow[t][rci]->SetXTitle("p_{t}");
9559 f2DDiffFlow[t][rci]->SetYTitle("#eta");
9560 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlow[t][rci]); // to be improved - moved to another list
9561 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9562 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
9563
9564} // void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
9565
9566//================================================================================================================================
489d5531 9567
9568void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9569{
9570 // Book all histograms and profiles needed for differential flow.
1268c371 9571 // a) Book profile to hold all flags for differential flow;
9572 // b) Define flags locally (to be improved: should I promote flags to data members?);
489d5531 9573 // c) Book e-b-e quantities;
9574 // d) Book profiles;
9575 // e) Book histograms holding final results.
9576
1268c371 9577 // a) Book profile to hold all flags for differential flow:
9578 TString diffFlowFlagsName = "fDiffFlowFlags";
9579 diffFlowFlagsName += fAnalysisLabel->Data();
9580 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for differential flow",5,0,5);
9581 fDiffFlowFlags->SetTickLength(-0.01,"Y");
9582 fDiffFlowFlags->SetMarkerStyle(25);
9583 fDiffFlowFlags->SetLabelSize(0.04,"X");
9584 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
9585 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"Calculate diff. flow");
9586 fDiffFlowFlags->GetXaxis()->SetBinLabel(2,"Particle weights");
9587 fDiffFlowFlags->GetXaxis()->SetBinLabel(3,"Event weights");
9588 fDiffFlowFlags->GetXaxis()->SetBinLabel(4,"Correct for NUA");
9589 fDiffFlowFlags->GetXaxis()->SetBinLabel(5,"Calculate 2D diff. flow");
9590 fDiffFlowList->Add(fDiffFlowFlags);
9591
9592 if(!fCalculateDiffFlow){return;}
9593
9594 // b) Define flags locally (to be improved: should I promote flags to data members?):
489d5531 9595 TString typeFlag[2] = {"RP","POI"};
9596 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9597 TString powerFlag[2] = {"linear","quadratic"};
9598 TString sinCosFlag[2] = {"sin","cos"};
9599 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9600 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9601 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
b40a910e 9602 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
489d5531 9603 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
9604 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
9605 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9606 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9607 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
1268c371 9608
489d5531 9609 // c) Book e-b-e quantities:
9610 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
9611 // Explanantion of notation:
9612 // 1.) n is harmonic, m is multiple of harmonic;
9613 // 2.) k is power of particle weight;
9614 // 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);
9615 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
9616 // (if i-th POI is also RP, than it is weighted with w_i^k);
9617 // 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
9618 // (i-th RP&&POI is weighted with w_i^k)
9619
9620 // 1D:
9621 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
9622 {
9623 for(Int_t pe=0;pe<2;pe++) // pt or eta
9624 {
9625 for(Int_t m=0;m<4;m++) // multiple of harmonic
9626 {
9627 for(Int_t k=0;k<9;k++) // power of particle weight
9628 {
9629 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
9630 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9631 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
9632 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9633 }
9634 }
9635 }
9636 }
9637 // to be improved (add explanation of fs1dEBE[t][pe][k]):
9638 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9639 {
9640 for(Int_t pe=0;pe<2;pe++) // pt or eta
9641 {
9642 for(Int_t k=0;k<9;k++) // power of particle weight
9643 {
9644 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
9645 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9646 }
9647 }
9648 }
9649 // correction terms for nua:
9650 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9651 {
9652 for(Int_t pe=0;pe<2;pe++) // pt or eta
9653 {
9654 for(Int_t sc=0;sc<2;sc++) // sin or cos
9655 {
9656 for(Int_t cti=0;cti<9;cti++) // correction term index
9657 {
9658 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
9659 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9660 }
9661 }
9662 }
9663 }
489d5531 9664 // reduced correlations e-b-e:
9665 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
9666 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
9667 for(Int_t t=0;t<2;t++) // type: RP or POI
9668 {
9669 for(Int_t pe=0;pe<2;pe++) // pt or eta
9670 {
9671 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9672 {
9673 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]);
9674 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9675 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9676 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9677 // event weights for reduced correlations e-b-e:
9678 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
9679 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
9680 for(Int_t t=0;t<2;t++) // type: RP or POI
9681 {
9682 for(Int_t pe=0;pe<2;pe++) // pt or eta
9683 {
9684 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
9685 {
9686 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]);
9687 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9688 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9689 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9690
9691 // d) Book profiles;
9692 // reduced correlations:
9693 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
9694 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 9695 // reduced squared correlations:
9696 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
9697 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
489d5531 9698 // corrections terms:
9699 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
9700 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b40a910e 9701 // reduced correlations:
489d5531 9702 for(Int_t t=0;t<2;t++) // type: RP or POI
9703 {
9704 for(Int_t pe=0;pe<2;pe++) // pt or eta
9705 {
9706 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9707 {
489d5531 9708 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 9709 fDiffFlowCorrelationsPro[t][pe][rci]->Sumw2();
489d5531 9710 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
9711 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
9712 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9713 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9714 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
b40a910e 9715 // reduced squared correlations:
9716 for(Int_t t=0;t<2;t++) // type: RP or POI
9717 {
9718 for(Int_t pe=0;pe<2;pe++) // pt or eta
9719 {
9720 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9721 {
9722 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");
9723 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->Sumw2();
9724 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
9725 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowSquaredCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
9726 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9727 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9728 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
489d5531 9729 // correction terms for nua:
9730 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9731 {
9732 for(Int_t pe=0;pe<2;pe++) // pt or eta
9733 {
9734 for(Int_t sc=0;sc<2;sc++) // sin or cos
9735 {
9736 for(Int_t cti=0;cti<9;cti++) // correction term index
9737 {
9738 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]);
9739 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
9740 }
9741 }
9742 }
9743 }
64e500e3 9744 // Other differential correlators:
9745 TString otherDiffCorrelatorsName = "fOtherDiffCorrelators";
9746 otherDiffCorrelatorsName += fAnalysisLabel->Data();
9747 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9748 {
9749 for(Int_t pe=0;pe<2;pe++) // pt or eta
9750 {
9751 for(Int_t sc=0;sc<2;sc++) // sin or cos
9752 {
9753 for(Int_t ci=0;ci<1;ci++) // correlator index
9754 {
9755 fOtherDiffCorrelators[t][pe][sc][ci] = new TProfile(Form("%s, %s, %s, %s, ci = %d",otherDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),Form("%s, %s, %s, %s, ci = %d",otherDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9756 fOtherDiffCorrelators[t][pe][sc][ci]->Sumw2();
9757 fOtherDiffCorrelatorsList->Add(fOtherDiffCorrelators[t][pe][sc][ci]);
9758 }
9759 }
9760 }
9761 }
489d5531 9762 // e) Book histograms holding final results.
9763 // reduced correlations:
9764 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
9765 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
9766 // corrections terms:
9767 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
9768 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
9769 // differential covariances:
9770 TString diffFlowCovariancesName = "fDiffFlowCovariances";
9771 diffFlowCovariancesName += fAnalysisLabel->Data();
9772 // differential Q-cumulants:
9773 TString diffFlowCumulantsName = "fDiffFlowCumulants";
9774 diffFlowCumulantsName += fAnalysisLabel->Data();
1268c371 9775 // Detector bias to differential Q-cumulants:
9776 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
9777 diffFlowDetectorBiasName += fAnalysisLabel->Data();
489d5531 9778 // differential flow:
9779 TString diffFlowName = "fDiffFlow";
9780 diffFlowName += fAnalysisLabel->Data();
9781 for(Int_t t=0;t<2;t++) // type: RP or POI
9782 {
9783 for(Int_t pe=0;pe<2;pe++) // pt or eta
9784 {
9785 for(Int_t index=0;index<4;index++)
9786 {
9787 // reduced correlations:
9788 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]);
9789 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9790 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
9791 // differential Q-cumulants:
9792 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]);
9793 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9794 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
1268c371 9795 // Detector bias to differential Q-cumulants:
9796 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]);
9797 fDiffFlowDetectorBias[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9798 fDiffFlowDetectorBias[t][pe][index]->SetTitle(Form("#frac{corrected}{measured} %s",differentialCumulantIndex[index].Data()));
9799 fDiffFlowDetectorBiasHistList[t][pe]->Add(fDiffFlowDetectorBias[t][pe][index]);
489d5531 9800 // differential flow estimates from Q-cumulants:
9801 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]);
9802 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9803 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
9804 } // end of for(Int_t index=0;index<4;index++)
9805 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9806 {
9807 // differential covariances:
9808 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]);
9809 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
9810 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
9811 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9812 // products of both types of correlations:
9813 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
9814 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
9815 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9816 {
9817 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9818 {
9819 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]);
9820 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
9821 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
9822 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9823 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9824 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9825 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9826 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9827 // sums of event weights for reduced correlations:
9828 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
9829 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
9830 for(Int_t t=0;t<2;t++) // type is RP or POI
9831 {
9832 for(Int_t pe=0;pe<2;pe++) // pt or eta
9833 {
9834 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
9835 {
9836 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
9837 {
9838 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]);
9839 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
9840 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
9841 }
9842 }
9843 }
9844 }
9845 // sum of products of event weights for both types of correlations:
9846 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
9847 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
9848 for(Int_t t=0;t<2;t++) // type is RP or POI
9849 {
9850 for(Int_t pe=0;pe<2;pe++) // pt or eta
9851 {
9852 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9853 {
9854 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9855 {
9856 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]);
9857 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
9858 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
9859 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9860 }
9861 }
9862 }
9863 }
9864 // correction terms for nua:
9865 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9866 {
9867 for(Int_t pe=0;pe<2;pe++) // pt or eta
9868 {
9869 for(Int_t sc=0;sc<2;sc++) // sin or cos
9870 {
9871 for(Int_t cti=0;cti<9;cti++) // correction term index
9872 {
9873 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]);
9874 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
9875 }
9876 }
9877 }
9878 }
9879
9880} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9881
489d5531 9882//================================================================================================================================
9883
489d5531 9884void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
9885{
9886 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
9887
b92ea2b9 9888 // Isotropic cumulants:
9889 Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
9890 Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
9891 Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
9892 Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
9893 //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
9894 //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
9895 //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
9896 //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
9897
9898 // Measured 2-, 4-, 6- and 8-particle correlations:
489d5531 9899 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
b92ea2b9 9900 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
489d5531 9901 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
b92ea2b9 9902 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
489d5531 9903 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
489d5531 9904 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
b92ea2b9 9905 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
489d5531 9906 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
b92ea2b9 9907
9908 // Non-isotropic terms:
9909 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
9910 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
9911 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
9912 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
9913 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
9914 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
9915 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
9916 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
9917 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
9918 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
9919 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
9920 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
9921
9922 // Shortcuts:
9923 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
9924 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
9925 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
9926 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
9927 Double_t a5 = 4.*c1*s1-s2;
9928
9929 // Covariances (including weight dependent prefactor):
8e1cefdd 9930 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
9931 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
9932 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
9933 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
9934 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9935 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9936 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9937 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9938 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
9939 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9940 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9941 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
9942 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9943 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9944 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9945 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9946 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9947 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9948 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9949 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9950 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9951 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9952 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9953 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9954 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9955 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9956 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9957 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9958 if(!fForgetAboutCovariances)
9959 {
9960 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
9961 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
9962 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
9963 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
9964 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9965 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9966 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9967 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9968 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
9969 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9970 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9971 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
9972 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9973 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9974 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9975 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9976 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9977 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9978 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9979 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9980 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9981 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9982 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9983 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9984 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9985 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9986 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9987 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9988 } // end of if(!fForgetAboutCovariances)
9989
b92ea2b9 9990 // Calculating generalized QC{2}:
9991 // Generalized QC{2}:
9992 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
9993 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
9994 // Statistical error of generalized QC{2}:
9995 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
9996 + 4.*pow(s1,2.)*pow(s1Error,2.)
9997 - 4*c1*wCov1-4*s1*wCov2
9998 + 8.*c1*s1*wCov3;
9999 // Store ratio of error squared - with/without NUA terms:
10000 Double_t ratioErrorSquaredQC2 = 0.;
10001 if(fIntFlowQcumulants->GetBinError(1)>0.)
10002 {
10003 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
10004 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
10005 }
10006 // If enabled, store error by including non-isotropic terms:
b77b6434 10007 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 10008 {
10009 if(gQC2ErrorSquared>=0.)
10010 {
10011 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
10012 } else
10013 {
10014 fIntFlowQcumulants->SetBinError(1,0.);
10015 cout<<endl;
10016 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
10017 cout<<endl;
10018 }
b77b6434 10019 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 10020 // Quantify detector bias to QC{2}:
10021 if(TMath::Abs(QC2)>0.)
10022 {
10023 fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2);
10024 if(QC2Error>0.)
10025 {
10026 Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
10027 if(errorSquared>0.)
10028 {
10029 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
10030 }
10031 }
10032 } // end of if(TMath::Abs(QC2)>0.)
10033
10034 // Calculating generalized QC{4}:
10035 // Generalized QC{4}:
10036 Double_t gQC4 = four-2.*pow(two,2.)
10037 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
10038 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
10039 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
10040 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
10041 // Statistical error of generalized QC{4}:
10042 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
10043 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
10044 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
10045 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
10046 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
10047 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
10048 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
10049 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
10050 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
10051 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
10052 // Store ratio of error squared - with/without NUA terms:
10053 Double_t ratioErrorSquaredQC4 = 0.;
10054 if(fIntFlowQcumulants->GetBinError(2)>0.)
10055 {
10056 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
10057 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
10058 }
b77b6434 10059 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 10060 {
10061 if(gQC4ErrorSquared>=0.)
10062 {
10063 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
10064 } else
10065 {
10066 fIntFlowQcumulants->SetBinError(2,0.);
10067 cout<<endl;
10068 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
10069 cout<<endl;
10070 }
b77b6434 10071 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 10072 // Quantify detector bias to QC{4}:
10073 if(TMath::Abs(QC4)>0.)
10074 {
10075 fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4);
10076 if(QC4Error>0.)
10077 {
10078 Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
10079 if(errorSquared>0.)
10080 {
10081 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
10082 }
10083 }
10084 } // end of if(TMath::Abs(QC4)>0.)
489d5531 10085
b92ea2b9 10086
10087 // .... to be improved (continued for 6th and 8th order) ....
10088
10089
2001bc3a 10090 // versus multiplicity:
b77b6434 10091 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
2001bc3a 10092 {
10093 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b77b6434 10094 Double_t value[4] = {0.}; // QCs vs M
10095 Double_t error[4] = {0.}; // error of QCs vs M
10096 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
10097 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
2001bc3a 10098 for(Int_t b=1;b<=nBins;b++)
10099 {
b92ea2b9 10100 // Measured correlations:
2001bc3a 10101 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
10102 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
b92ea2b9 10103 // Isotropic cumulants:
10104 QC2 = two;
10105 QC4 = four-2.*pow(two,2.);
10106 // Non-isotropic terms:
10107 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
10108 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
10109 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
10110 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
10111 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
10112 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
10113 // Generalized QC{2} vs M:
10114 gQC2 = two - pow(c1,2.) - pow(s1,2.);
b77b6434 10115 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
b92ea2b9 10116 // Generalized QC{4} vs M:
10117 gQC4 = four-2.*pow(two,2.)
10118 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
10119 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
10120 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
b77b6434 10121 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
b92ea2b9 10122 // Detector bias vs M:
10123 if(TMath::Abs(QC2)>0.)
10124 {
10125 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2);
10126 } // end of if(TMath::Abs(QC2)>0.)
10127 if(TMath::Abs(QC4)>0.)
10128 {
10129 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4);
b77b6434 10130 } // end of if(TMath::Abs(QC4)>0.)
10131 // Rebin in M:
10132 for(Int_t co=0;co<4;co++)
10133 {
10134 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
10135 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
10136 if(error[co]>0.)
10137 {
10138 dSum1[co]+=value[co]/(error[co]*error[co]);
10139 dSum2[co]+=1./(error[co]*error[co]);
10140 }
10141 } // end of for(Int_t co=0;co<4;co++)
10142 } // end of for(Int_t b=1;b<=nBins;b++)
10143 // Store rebinned Q-cumulants:
10144 if(fApplyCorrectionForNUAVsM)
10145 {
10146 for(Int_t co=0;co<4;co++)
10147 {
10148 if(dSum2[co]>0.)
10149 {
10150 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
10151 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
10152 }
10153 } // end of for(Int_t co=0;co<4;co++)
10154 } // end of if(fApplyCorrectionForNUAVsM)
10155 } // end of if(fCalculateCumulantsVsM)
2001bc3a 10156
489d5531 10157} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
0328db2d 10158
489d5531 10159//================================================================================================================================
10160
489d5531 10161void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
10162{
0328db2d 10163 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 10164 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 10165 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 10166 //
10167 // Remark: Statistical error of correction temrs is calculated as:
10168 //
10169 // statistical error = termA * spread * termB:
10170 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
10171 // termB = 1/sqrt(1-termA^2)
10172
b92ea2b9 10173 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
10174 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
10175
489d5531 10176 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
10177 {
b92ea2b9 10178 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 10179 {
10180 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 10181 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
10182 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
10183 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
10184 Double_t termA = 0.;
10185 Double_t termB = 0.;
b92ea2b9 10186 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
0328db2d 10187 {
10188 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
10189 } else
10190 {
b92ea2b9 10191 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
10192 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
0328db2d 10193 }
489d5531 10194 if(1.-pow(termA,2.) > 0.)
10195 {
10196 termB = 1./pow(1-pow(termA,2.),0.5);
10197 } else
10198 {
b92ea2b9 10199 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
10200 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
489d5531 10201 }
10202 Double_t statisticalError = termA * spread * termB;
489d5531 10203 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 10204 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
b92ea2b9 10205 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
489d5531 10206 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
10207
10208} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
10209
489d5531 10210//================================================================================================================================
10211
489d5531 10212void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
10213{
10214 // Get pointers to all objects relevant for calculations with nested loops.
10215
10216 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
10217 if(nestedLoopsList)
10218 {
10219 this->SetNestedLoopsList(nestedLoopsList);
10220 } else
10221 {
10222 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10223 exit(0);
10224 }
10225
10226 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
10227 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
10228 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
10229 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
10230
10231 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
10232 evaluateNestedLoopsName += fAnalysisLabel->Data();
10233 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
10234 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
10235 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
10236 if(evaluateNestedLoops)
10237 {
10238 this->SetEvaluateNestedLoops(evaluateNestedLoops);
10239 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
10240 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
10241 }
10242 // nested loops relevant for integrated flow:
10243 if(bEvaluateIntFlowNestedLoops)
10244 {
10245 // correlations:
10246 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
10247 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
10248 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
10249 if(intFlowDirectCorrelations)
10250 {
10251 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
10252 } else
10253 {
10254 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10255 exit(0);
10256 }
403e3389 10257 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 10258 {
10259 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
10260 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
10261 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
10262 if(intFlowExtraDirectCorrelations)
10263 {
10264 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
10265 } else
10266 {
10267 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10268 exit(0);
10269 }
403e3389 10270 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 10271 // correction terms for non-uniform acceptance:
10272 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
10273 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
10274 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
10275 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
10276 {
10277 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
10278 if(intFlowDirectCorrectionTermsForNUA[sc])
10279 {
10280 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
10281 } else
10282 {
10283 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10284 cout<<"sc = "<<sc<<endl;
10285 exit(0);
10286 }
10287 } // end of for(Int_t sc=0;sc<2;sc++)
10288 } // end of if(bEvaluateIntFlowNestedLoops)
10289
10290 // nested loops relevant for differential flow:
10291 if(bEvaluateDiffFlowNestedLoops)
10292 {
10293 // correlations:
10294 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
10295 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
10296 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
10297 for(Int_t t=0;t<2;t++)
10298 {
10299 for(Int_t pe=0;pe<2;pe++)
10300 {
10301 for(Int_t ci=0;ci<4;ci++) // correlation index
10302 {
10303 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())));
10304 if(diffFlowDirectCorrelations[t][pe][ci])
10305 {
10306 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
10307 } else
10308 {
10309 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10310 cout<<"t = "<<t<<endl;
10311 cout<<"pe = "<<pe<<endl;
10312 cout<<"ci = "<<ci<<endl;
10313 }
10314 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
10315 } // end of for(Int_t pe=0;pe<2;pe++)
10316 } // end of for(Int_t t=0;t<2;t++)
10317 // correction terms for non-uniform acceptance:
10318 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
10319 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
10320 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
10321 for(Int_t t=0;t<2;t++)
10322 {
10323 for(Int_t pe=0;pe<2;pe++)
10324 {
10325 // correction terms for NUA:
10326 for(Int_t sc=0;sc<2;sc++) // sin or cos
10327 {
10328 for(Int_t cti=0;cti<9;cti++) // correction term index
10329 {
10330 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)));
10331 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
10332 {
10333 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
10334 } else
10335 {
10336 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10337 cout<<"t = "<<t<<endl;
10338 cout<<"pe = "<<pe<<endl;
10339 cout<<"sc = "<<sc<<endl;
10340 cout<<"cti = "<<cti<<endl;
10341 }
10342 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
10343 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10344 } // end of for(Int_t pe=0;pe<2;pe++)
10345 } // end of for(Int_t t=0;t<2;t++)
64e500e3 10346 // other differential correlators:
10347 TString otherDirectDiffCorrelatorsName = "fOtherDirectDiffCorrelators";
10348 otherDirectDiffCorrelatorsName += fAnalysisLabel->Data();
10349 TProfile *otherDirectDiffCorrelators[2][2][2][1] = {{{{NULL}}}};
10350 for(Int_t t=0;t<2;t++)
10351 {
10352 for(Int_t pe=0;pe<2;pe++)
10353 {
10354 // correction terms for NUA:
10355 for(Int_t sc=0;sc<2;sc++) // sin or cos
10356 {
10357 for(Int_t ci=0;ci<1;ci++) // correlator index
10358 {
10359 otherDirectDiffCorrelators[t][pe][sc][ci] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s, ci = %d",otherDirectDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1)));
10360 if(otherDirectDiffCorrelators[t][pe][sc][ci])
10361 {
10362 this->SetOtherDirectDiffCorrelators(otherDirectDiffCorrelators[t][pe][sc][ci],t,pe,sc,ci);
10363 } else
10364 {
10365 cout<<"WARNING: otherDirectDiffCorrelators[t][pe][sc][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10366 cout<<"t = "<<t<<endl;
10367 cout<<"pe = "<<pe<<endl;
10368 cout<<"sc = "<<sc<<endl;
10369 cout<<"ci = "<<ci<<endl;
10370 }
10371 } // end of for(Int_t ci=0;ci<9;ci++) // correction term index
10372 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10373 } // end of for(Int_t pe=0;pe<2;pe++)
10374 } // end of for(Int_t t=0;t<2;t++)
489d5531 10375 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
10376 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
10377 TH1D *noOfParticlesInBin = NULL;
10378 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
10379 if(noOfParticlesInBin)
10380 {
10381 this->SetNoOfParticlesInBin(noOfParticlesInBin);
10382 } else
10383 {
10384 cout<<endl;
10385 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10386 cout<<endl;
10387 }
10388 } // end of if(bEvaluateDiffFlowNestedLoops)
10389
10390} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
10391
489d5531 10392//================================================================================================================================
10393
489d5531 10394void AliFlowAnalysisWithQCumulants::StoreHarmonic()
10395{
10396 // Store flow harmonic in common control histograms.
10397
10398 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
dd442cd2 10399 if(fFillMultipleControlHistograms)
10400 {
10401 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
10402 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
10403 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
10404 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
10405 }
10406
489d5531 10407} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
10408
489d5531 10409//================================================================================================================================
10410
489d5531 10411void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
10412{
10413 // Calculate all correlations needed for differential flow using particle weights.
10414
2a98ceb8 10415 Int_t t = 0; // type flag
10416 Int_t pe = 0; // ptEta flag
489d5531 10417
10418 if(type == "RP")
10419 {
10420 t = 0;
10421 } else if(type == "POI")
10422 {
10423 t = 1;
10424 }
10425
10426 if(ptOrEta == "Pt")
10427 {
10428 pe = 0;
10429 } else if(ptOrEta == "Eta")
10430 {
10431 pe = 1;
10432 }
10433
10434 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10435 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10436 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10437 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10438
10439 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10440 Double_t dReQ1n1k = (*fReQ)(0,1);
10441 Double_t dReQ2n2k = (*fReQ)(1,2);
10442 Double_t dReQ1n3k = (*fReQ)(0,3);
10443 //Double_t dReQ4n4k = (*fReQ)(3,4);
10444 Double_t dImQ1n1k = (*fImQ)(0,1);
10445 Double_t dImQ2n2k = (*fImQ)(1,2);
10446 Double_t dImQ1n3k = (*fImQ)(0,3);
10447 //Double_t dImQ4n4k = (*fImQ)(3,4);
10448
1268c371 10449 // S^M_{p,k} (see .h file for the definition of fSpk):
10450 Double_t dSM1p1k = (*fSpk)(0,1);
10451 Double_t dSM1p2k = (*fSpk)(0,2);
10452 Double_t dSM1p3k = (*fSpk)(0,3);
10453 Double_t dSM2p1k = (*fSpk)(1,1);
10454 Double_t dSM3p1k = (*fSpk)(2,1);
489d5531 10455
10456 // looping over all bins and calculating reduced correlations:
10457 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10458 {
10459 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
10460 Double_t p1n0kRe = 0.;
10461 Double_t p1n0kIm = 0.;
10462
10463 // number of POIs in particular (pt,eta) bin):
10464 Double_t mp = 0.;
10465
10466 // real and imaginary parts of q_{m*n,k}:
10467 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
10468 Double_t q1n2kRe = 0.;
10469 Double_t q1n2kIm = 0.;
10470 Double_t q2n1kRe = 0.;
10471 Double_t q2n1kIm = 0.;
10472
10473 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10474 Double_t s1p1k = 0.;
10475 Double_t s1p2k = 0.;
10476 Double_t s1p3k = 0.;
10477
10478 // M0111 from Eq. (118) in QC2c (to be improved (notation))
10479 Double_t dM0111 = 0.;
10480
10481 if(type == "POI")
10482 {
10483 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10484 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10485 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10486 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10487
10488 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10489
10490 t = 1; // typeFlag = RP or POI
10491
10492 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10493 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
10494 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
10495 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
10496 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
10497 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
10498 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
10499 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
10500 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
10501
10502 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10503 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
10504 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
10505 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
10506
10507 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
10508 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
10509 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
10510 + 2.*(s1p3k-s1p2k*dSM1p1k));
10511 }
10512 else if(type == "RP")
10513 {
10514 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10515 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
10516 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
10517 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
10518 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
10519 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
10520 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
10521 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
10522 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
10523
10524 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10525 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
10526 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
10527 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
10528
10529 // to be improved (cross-checked):
10530 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10531 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10532 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10533 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10534
10535 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10536
10537 t = 0; // typeFlag = RP or POI
10538
10539 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
10540 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
10541 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
10542 + 2.*(s1p3k-s1p2k*dSM1p1k));
10543 //...............................................................................................
10544 }
10545
10546 // 2'-particle correlation:
10547 Double_t two1n1nW0W1 = 0.;
10548 if(mp*dSM1p1k-s1p1k)
10549 {
10550 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
10551 / (mp*dSM1p1k-s1p1k);
10552
10553 // fill profile to get <<2'>>
b40a910e 10554 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
10555 // fill profile to get <<2'>^2>
10556 fDiffFlowSquaredCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1*two1n1nW0W1,mp*dSM1p1k-s1p1k);
489d5531 10557 // histogram to store <2'> e-b-e (needed in some other methods):
10558 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
10559 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
10560 } // end of if(mp*dSM1p1k-s1p1k)
10561
10562 // 4'-particle correlation:
10563 Double_t four1n1n1n1nW0W1W1W1 = 0.;
10564 if(dM0111)
10565 {
10566 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
10567 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
10568 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
10569 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
10570 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
10571 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
10572 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
10573 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
10574 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
10575 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
10576 + 2.*s1p1k*dSM1p2k
10577 - 6.*s1p3k)
10578 / dM0111; // to be improved (notation of dM0111)
10579
10580 // fill profile to get <<4'>>
b40a910e 10581 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
10582 // fill profile to get <<4'>^2>
10583 fDiffFlowSquaredCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1*four1n1n1n1nW0W1W1W1,dM0111);
489d5531 10584 // histogram to store <4'> e-b-e (needed in some other methods):
10585 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
10586 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
10587 } // end of if(dM0111)
10588 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10589
10590} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
10591
489d5531 10592//================================================================================================================================
10593
489d5531 10594void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
10595{
10596 // Fill common control histograms.
10597
10598 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
10599 fCommonHists->FillControlHistograms(anEvent);
dd442cd2 10600 if(fFillMultipleControlHistograms)
489d5531 10601 {
dd442cd2 10602 if(nRP>1)
489d5531 10603 {
dd442cd2 10604 fCommonHists2nd->FillControlHistograms(anEvent);
10605 if(nRP>3)
489d5531 10606 {
dd442cd2 10607 fCommonHists4th->FillControlHistograms(anEvent);
10608 if(nRP>5)
489d5531 10609 {
dd442cd2 10610 fCommonHists6th->FillControlHistograms(anEvent);
10611 if(nRP>7)
10612 {
10613 fCommonHists8th->FillControlHistograms(anEvent);
10614 } // end of if(nRP>7)
10615 } // end of if(nRP>5)
10616 } // end of if(nRP>3)
10617 } // end of if(nRP>1)
10618 } // end of if(fFillMultipleControlHistograms)
489d5531 10619
10620} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
10621
489d5531 10622//================================================================================================================================
10623
489d5531 10624void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
10625{
10626 // Reset all event by event quantities.
10627
1268c371 10628 // Reference flow:
489d5531 10629 fReQ->Zero();
10630 fImQ->Zero();
1268c371 10631 fSpk->Zero();
489d5531 10632 fIntFlowCorrelationsEBE->Reset();
10633 fIntFlowEventWeightsForCorrelationsEBE->Reset();
10634 fIntFlowCorrelationsAllEBE->Reset();
10635
b92ea2b9 10636 for(Int_t sc=0;sc<2;sc++)
489d5531 10637 {
b92ea2b9 10638 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
10639 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 10640 }
10641
1268c371 10642 // Differential flow:
10643 if(fCalculateDiffFlow)
489d5531 10644 {
1268c371 10645 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
489d5531 10646 {
1268c371 10647 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 10648 {
1268c371 10649 for(Int_t m=0;m<4;m++) // multiple of harmonic
489d5531 10650 {
1268c371 10651 for(Int_t k=0;k<9;k++) // power of weight
10652 {
10653 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
10654 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
10655 }
10656 }
489d5531 10657 }
1268c371 10658 }
10659 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
10660 {
10661 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 10662 {
1268c371 10663 for(Int_t k=0;k<9;k++)
10664 {
10665 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
10666 }
489d5531 10667 }
10668 }
1268c371 10669 // e-b-e reduced correlations:
10670 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
10671 {
10672 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 10673 {
1268c371 10674 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
10675 {
10676 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
10677 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
10678 }
489d5531 10679 }
1268c371 10680 }
10681 // correction terms for NUA:
10682 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
10683 {
10684 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 10685 {
1268c371 10686 for(Int_t sc=0;sc<2;sc++) // sin or cos
489d5531 10687 {
1268c371 10688 for(Int_t cti=0;cti<9;cti++) // correction term index
10689 {
489d5531 10690 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
1268c371 10691 }
489d5531 10692 }
1268c371 10693 }
10694 }
10695 } // end of if(fCalculateDiffFlow)
10696
489d5531 10697 // 2D (pt,eta)
1268c371 10698 if(fCalculate2DDiffFlow)
489d5531 10699 {
10700 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
10701 {
10702 for(Int_t m=0;m<4;m++) // multiple of harmonic
10703 {
10704 for(Int_t k=0;k<9;k++) // power of weight
10705 {
b77b6434 10706 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
10707 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
489d5531 10708 }
10709 }
10710 }
10711 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
10712 {
10713 for(Int_t k=0;k<9;k++)
10714 {
b77b6434 10715 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
489d5531 10716 }
10717 }
1268c371 10718 } // end of if(fCalculate2DDiffFlow)
489d5531 10719
10720} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
10721
489d5531 10722//================================================================================================================================
10723
489d5531 10724void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
10725{
10726 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
10727
10728 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
10729 // 0: <<sin n(psi1)>>
10730 // 1: <<sin n(psi1+phi2)>>
10731 // 2: <<sin n(psi1+phi2-phi3)>>
10732 // 3: <<sin n(psi1-phi2-phi3)>>:
10733 // 4:
10734 // 5:
10735 // 6:
10736
10737 // multiplicity:
1268c371 10738 Double_t dMult = (*fSpk)(0,0);
489d5531 10739
10740 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10741 Double_t dReQ1n = (*fReQ)(0,0);
10742 Double_t dReQ2n = (*fReQ)(1,0);
10743 //Double_t dReQ3n = (*fReQ)(2,0);
10744 //Double_t dReQ4n = (*fReQ)(3,0);
10745 Double_t dImQ1n = (*fImQ)(0,0);
10746 Double_t dImQ2n = (*fImQ)(1,0);
10747 //Double_t dImQ3n = (*fImQ)(2,0);
10748 //Double_t dImQ4n = (*fImQ)(3,0);
10749
2a98ceb8 10750 Int_t t = 0; // type flag
10751 Int_t pe = 0; // ptEta flag
489d5531 10752
10753 if(type == "RP")
10754 {
10755 t = 0;
10756 } else if(type == "POI")
10757 {
10758 t = 1;
10759 }
10760
10761 if(ptOrEta == "Pt")
10762 {
10763 pe = 0;
10764 } else if(ptOrEta == "Eta")
10765 {
10766 pe = 1;
10767 }
10768
10769 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10770 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10771 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10772 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10773
10774 // looping over all bins and calculating correction terms:
10775 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10776 {
10777 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10778 Double_t p1n0kRe = 0.;
10779 Double_t p1n0kIm = 0.;
10780
10781 // number of POIs in particular pt or eta bin:
10782 Double_t mp = 0.;
10783
10784 // 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):
10785 Double_t q1n0kRe = 0.;
10786 Double_t q1n0kIm = 0.;
10787 Double_t q2n0kRe = 0.;
10788 Double_t q2n0kIm = 0.;
10789
10790 // number of particles which are both RPs and POIs in particular pt or eta bin:
10791 Double_t mq = 0.;
10792
10793 if(type == "POI")
10794 {
10795 // q_{m*n,0}:
10796 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10797 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10798 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10799 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10800 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10801 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10802 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10803 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10804
10805 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10806 }
10807 else if(type == "RP")
10808 {
10809 // q_{m*n,0}:
10810 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10811 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10812 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10813 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10814 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10815 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10816 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10817 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10818
10819 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10820 }
10821 if(type == "POI")
10822 {
10823 // p_{m*n,0}:
10824 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10825 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10826 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10827 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10828
10829 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10830
10831 t = 1; // typeFlag = RP or POI
10832 }
10833 else if(type == "RP")
10834 {
10835 // p_{m*n,0} = q_{m*n,0}:
10836 p1n0kRe = q1n0kRe;
10837 p1n0kIm = q1n0kIm;
10838
10839 mp = mq;
10840
10841 t = 0; // typeFlag = RP or POI
10842 }
10843
10844 // <<sin n(psi1)>>:
10845 Double_t sinP1nPsi = 0.;
10846 if(mp)
10847 {
10848 sinP1nPsi = p1n0kIm/mp;
10849 // fill profile for <<sin n(psi1)>>:
10850 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
10851 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
10852 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
10853 } // end of if(mp)
10854
10855 // <<sin n(psi1+phi2)>>:
10856 Double_t sinP1nPsiP1nPhi = 0.;
10857 if(mp*dMult-mq)
10858 {
10859 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
10860 // fill profile for <<sin n(psi1+phi2)>>:
10861 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
10862 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10863 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
10864 } // end of if(mp*dMult-mq)
10865
10866 // <<sin n(psi1+phi2-phi3)>>:
10867 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
10868 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10869 {
10870 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10871 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
10872 - mq*dImQ1n+2.*q1n0kIm)
10873 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10874 // fill profile for <<sin n(psi1+phi2)>>:
10875 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10876 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10877 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
10878 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10879
10880 // <<sin n(psi1-phi2-phi3)>>:
10881 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
10882 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10883 {
10884 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
10885 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
10886 + 2.*mq*dImQ1n-2.*q1n0kIm)
10887 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10888 // fill profile for <<sin n(psi1+phi2)>>:
10889 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10890 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10891 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
10892 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10893 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10894
10895} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
10896
10897
10898//================================================================================================================================
10899
10900
10901void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
10902{
10903 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
10904
10905 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
10906 // 0: <<cos n(psi)>>
10907 // 1: <<cos n(psi1+phi2)>>
10908 // 2: <<cos n(psi1+phi2-phi3)>>
10909 // 3: <<cos n(psi1-phi2-phi3)>>
10910 // 4:
10911 // 5:
10912 // 6:
10913
10914 // multiplicity:
1268c371 10915 Double_t dMult = (*fSpk)(0,0);
489d5531 10916
10917 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10918 Double_t dReQ1n = (*fReQ)(0,0);
10919 Double_t dReQ2n = (*fReQ)(1,0);
10920 //Double_t dReQ3n = (*fReQ)(2,0);
10921 //Double_t dReQ4n = (*fReQ)(3,0);
10922 Double_t dImQ1n = (*fImQ)(0,0);
10923 Double_t dImQ2n = (*fImQ)(1,0);
10924 //Double_t dImQ3n = (*fImQ)(2,0);
10925 //Double_t dImQ4n = (*fImQ)(3,0);
10926
2a98ceb8 10927 Int_t t = 0; // type flag
10928 Int_t pe = 0; // ptEta flag
489d5531 10929
10930 if(type == "RP")
10931 {
10932 t = 0;
10933 } else if(type == "POI")
10934 {
10935 t = 1;
10936 }
10937
10938 if(ptOrEta == "Pt")
10939 {
10940 pe = 0;
10941 } else if(ptOrEta == "Eta")
10942 {
10943 pe = 1;
10944 }
10945
10946 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10947 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10948 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10949 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10950
10951 // looping over all bins and calculating correction terms:
10952 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10953 {
10954 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10955 Double_t p1n0kRe = 0.;
10956 Double_t p1n0kIm = 0.;
10957
10958 // number of POIs in particular pt or eta bin:
10959 Double_t mp = 0.;
10960
10961 // 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):
10962 Double_t q1n0kRe = 0.;
10963 Double_t q1n0kIm = 0.;
10964 Double_t q2n0kRe = 0.;
10965 Double_t q2n0kIm = 0.;
10966
10967 // number of particles which are both RPs and POIs in particular pt or eta bin:
10968 Double_t mq = 0.;
10969
10970 if(type == "POI")
10971 {
10972 // q_{m*n,0}:
10973 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10974 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10975 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10976 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10977 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10978 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10979 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10980 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10981
10982 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10983 }
10984 else if(type == "RP")
10985 {
10986 // q_{m*n,0}:
10987 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10988 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10989 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10990 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10991 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10992 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10993 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10994 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10995
10996 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10997 }
10998 if(type == "POI")
10999 {
11000 // p_{m*n,0}:
11001 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
11002 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
11003 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
11004 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
11005
11006 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11007
11008 t = 1; // typeFlag = RP or POI
11009 }
11010 else if(type == "RP")
11011 {
11012 // p_{m*n,0} = q_{m*n,0}:
11013 p1n0kRe = q1n0kRe;
11014 p1n0kIm = q1n0kIm;
11015
11016 mp = mq;
11017
11018 t = 0; // typeFlag = RP or POI
11019 }
11020
11021 // <<cos n(psi1)>>:
11022 Double_t cosP1nPsi = 0.;
11023 if(mp)
11024 {
11025 cosP1nPsi = p1n0kRe/mp;
11026
11027 // fill profile for <<cos n(psi1)>>:
11028 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
11029 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
11030 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
11031 } // end of if(mp)
11032
11033 // <<cos n(psi1+phi2)>>:
11034 Double_t cosP1nPsiP1nPhi = 0.;
11035 if(mp*dMult-mq)
11036 {
11037 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
11038 // fill profile for <<sin n(psi1+phi2)>>:
11039 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
11040 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11041 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
11042 } // end of if(mp*dMult-mq)
11043
11044 // <<cos n(psi1+phi2-phi3)>>:
11045 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
11046 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11047 {
11048 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
11049 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
11050 - mq*dReQ1n+2.*q1n0kRe)
11051 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11052 // fill profile for <<sin n(psi1+phi2)>>:
11053 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11054 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11055 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
11056 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11057
11058 // <<cos n(psi1-phi2-phi3)>>:
11059 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
11060 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11061 {
11062 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
11063 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
11064 - 2.*mq*dReQ1n+2.*q1n0kRe)
11065 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11066 // fill profile for <<sin n(psi1+phi2)>>:
11067 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11068 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11069 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
11070 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11071 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11072
11073} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
11074
489d5531 11075//==================================================================================================================================
11076
489d5531 11077void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
11078{
1268c371 11079 // Transfer profiles into histogams and correctly propagate the error.
489d5531 11080
2a98ceb8 11081 Int_t t = 0; // type flag
11082 Int_t pe = 0; // ptEta flag
489d5531 11083
11084 if(type == "RP")
11085 {
11086 t = 0;
11087 } else if(type == "POI")
11088 {
11089 t = 1;
11090 }
11091
11092 if(ptOrEta == "Pt")
11093 {
11094 pe = 0;
11095 } else if(ptOrEta == "Eta")
11096 {
11097 pe = 1;
11098 }
11099
11100 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11101 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
11102 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11103 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11104
11105 for(Int_t sc=0;sc<2;sc++) // sin or cos
11106 {
11107 for(Int_t cti=0;cti<9;cti++) // correction term index
11108 {
11109 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11110 {
11111 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
11112 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
11113 // to be improved (propagate error correctly)
11114 // ...
11115 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11116 } // correction term index
11117 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
11118
11119}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
11120
489d5531 11121//==================================================================================================================================
11122
489d5531 11123void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
11124{
1268c371 11125 // Calculate generalized differential flow cumulants (corrected for non-uniform acceptance).
11126
11127 // to be improved - propagate error also from non-isotropic terms
489d5531 11128
1268c371 11129 Int_t t = 0; // RP = 0, POI = 1
11130 Int_t pe = 0; // pt = 0, eta = 1
489d5531 11131
11132 if(type == "RP")
11133 {
1268c371 11134 t = 0;
489d5531 11135 } else if(type == "POI")
11136 {
1268c371 11137 t = 1;
489d5531 11138 }
11139
11140 if(ptOrEta == "Pt")
11141 {
1268c371 11142 pe = 0;
489d5531 11143 } else if(ptOrEta == "Eta")
11144 {
1268c371 11145 pe = 1;
489d5531 11146 }
1268c371 11147
11148 // Common:
489d5531 11149 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 11150 // 2-particle correlation:
11151 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
1268c371 11152 // sinus terms coming from reference flow:
489d5531 11153 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
11154 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
11155 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
1268c371 11156 // cosinus terms coming from reference flow:
489d5531 11157 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
11158 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
11159 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
11160
11161 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11162 {
11163 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
11164 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
11165 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
11166 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
11167 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
11168 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
11169 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
11170 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
11171 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
11172 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
1268c371 11173 // Generalized QC{2'}:
489d5531 11174 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
1268c371 11175 if(fApplyCorrectionForNUA)
11176 {
11177 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
11178 }
11179 if(TMath::Abs(twoPrime)>0.)
11180 {
11181 fDiffFlowDetectorBias[t][pe][0]->SetBinContent(b,qc2Prime/twoPrime); // detector bias = generalized/isotropic cumulant.
11182 }
11183 // Generalized QC{4'}:
489d5531 11184 Double_t qc4Prime = fourPrime-2.*twoPrime*two
11185 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
11186 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
11187 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
11188 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
11189 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
11190 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
11191 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
11192 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
11193 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
11194 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
11195 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
11196 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
11197 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
11198 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
11199 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
11200 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
11201 - 12.*cosP1nPhi*sinP1nPhi
11202 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
1268c371 11203 if(fApplyCorrectionForNUA)
11204 {
11205 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
11206 }
11207 if(TMath::Abs(fourPrime-2.*twoPrime*two)>0.)
11208 {
11209 fDiffFlowDetectorBias[t][pe][1]->SetBinContent(b,qc4Prime/(fourPrime-2.*twoPrime*two)); // detector bias = generalized/isotropic cumulant.
11210 }
489d5531 11211 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
11212
11213} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
11214
1268c371 11215//==================================================================================================================================
489d5531 11216
11217void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
11218{
11219 // Calculate differential flow corrected for non-uniform acceptance.
11220
1268c371 11221 // to be improved: eventually I will have to access here masured correlations and NUA terms
11222 // instead of cumulants in order to propagate statistical error correctly also
11223 // to NUA terms (propagating errors directly from cumulants is WRONG for
11224 // differential flow becuase that doesn't account at all cross-covariance terms)
489d5531 11225
1268c371 11226 // REMARK: When NUA correction is apllied error for differential flow DOES NOT get corrected,
11227 // i.e. only value is being corrected, error is still the one relevant for isotropic
11228 // case. This eventually will be resolved.
11229
11230
11231 Int_t t = 0; // RP or POI
11232 Int_t pe = 0; // pt or eta
489d5531 11233
11234 if(type == "RP")
11235 {
1268c371 11236 t = 0;
489d5531 11237 } else if(type == "POI")
11238 {
1268c371 11239 t = 1;
11240 }
489d5531 11241 if(ptOrEta == "Pt")
11242 {
1268c371 11243 pe = 0;
489d5531 11244 } else if(ptOrEta == "Eta")
11245 {
1268c371 11246 pe = 1;
489d5531 11247 }
11248
1268c371 11249 // Common:
489d5531 11250 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
1268c371 11251 // Reference Q-cumulants
11252 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
11253 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
11254 // Loop over pt or eta bins:
489d5531 11255 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11256 {
1268c371 11257 // Differential Q-cumulants:
11258 Double_t qc2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b); // QC{2'}
11259 Double_t qc4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b); // QC{4'}
489d5531 11260 // v'{2}:
1268c371 11261 if(qc2>0.)
489d5531 11262 {
1268c371 11263 Double_t v2Prime = qc2Prime/pow(qc2,0.5);
11264 if(TMath::Abs(v2Prime)>0.){fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);}
489d5531 11265 }
489d5531 11266 // v'{4}:
1268c371 11267 if(qc4<0.)
489d5531 11268 {
1268c371 11269 Double_t v4Prime = -qc4Prime/pow(-qc4,3./4.);
11270 if(TMath::Abs(v4Prime)>0.){fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);}
489d5531 11271 }
11272 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
11273
11274} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
11275
489d5531 11276//==================================================================================================================================
11277
0328db2d 11278void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 11279{
11280 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
11281
11282 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
11283 //
11284 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
11285 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
11286 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
11287 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
11288 // 5th bin: ---- EMPTY ----
11289 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
11290 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
11291 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
11292 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
11293 // 10th bin: ---- EMPTY ----
11294 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
11295 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
11296 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
11297 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
11298 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
11299 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
11300 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
11301 // 18th bin: ---- EMPTY ----
11302 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
11303 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
11304 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
11305 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
11306 // 23rd bin: ---- EMPTY ----
11307 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
11308 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
11309 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
11310 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
11311 // 28th bin: ---- EMPTY ----
11312 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
11313 // 30th bin: ---- EMPTY ----
11314 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
8ed4edc7 11315 // 32nd bin: ---- EMPTY ----
b84464d3 11316 // Extra correlations for 3p TY study:
8ed4edc7 11317 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
b84464d3 11318 // 34th bin: <5>_{3n,3n|2n,2n,2n} = five3n3n2n2n2n = <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
11319 // Extra correlations for 6p TY study:
11320 // 35th bin: <2>_{5n|5n} = two5n5n = <cos(5n*(phi1-phi2)> T
11321 // 36th bin: <2>_{6n|6n} = two6n6n = <cos(6n*(phi1-phi2)> T
11322 // 37th bin: <3>_{5n|3n,2n} = three5n3n2n = <cos(n*(5*phi1-3*phi2-2*phi3)>
11323 // 38th bin: <3>_{5n|4n,1n} = three5n4n1n = <cos(n*(5*phi1-4*phi2-1*phi3)>
11324 // 39th bin: <3>_{6n|3n,3n} = three6n3n3n = <cos(n*(6*phi1-3*phi2-3*phi3)> T
11325 // 40th bin: <3>_{6n|4n,2n} = three6n4n2n = <cos(n*(6*phi1-4*phi2-2*phi3)> T
11326 // 41st bin: <3>_{6n|5n,1n} = three6n5n1n = <cos(n*(6*phi1-5*phi2-1*phi3)>
11327 // 42nd bin: <4>_{6n|3n,2n,1n} = four6n3n2n1n = <cos(n*(6*phi1-3*phi2-2*phi3-1*phi4)>
11328 // 43rd bin: <4>_{3n,2n|3n,2n} = four3n2n3n2n = <cos(n*(3*phi1+2*phi2-3*phi3-2*phi4)>
11329 // 44th bin: <4>_{4n,1n|3n,2n} = four4n1n3n2n = <cos(n*(4*phi1+1*phi2-3*phi3-2*phi4)>
11330 // 45th bin: <4>_{3n,3n|3n,3n} = four3n3n3n3n = <cos(3.*n*(phi1+phi2-phi3-phi4))> T
11331 // 46th bin: <4>_{4n,2n|3n,3n} = four4n2n3n3n = <cos(n*(4*phi1+2*phi2-3*phi3-3*phi4)>
11332 // 47th bin: <4>_{5n,1n|3n,3n} = four5n1n3n3n = <cos(n*(5*phi1+1*phi2-3*phi3-3*phi4)>
11333 // 48th bin: <4>_{4n,2n|4n,2n} = four4n2n4n2n = <cos(n*(4*phi1+2*phi2-4*phi3-2*phi4)> T
11334 // 49th bin: <4>_{5n,1n|4n,2n} = four5n1n4n2n = <cos(n*(5*phi1+1*phi2-4*phi3-2*phi4)>
11335 // 50th bin: <4>_{5n|3n,1n,1n} = four5n3n1n1n = <cos(n*(5*phi1-3*phi2-1*phi3-1*phi4)>
11336 // 51st bin: <4>_{5n|2n,2n,1n} = four5n2n2n1n = <cos(n*(5*phi1-2*phi2-2*phi3-1*phi4)>
11337 // 52nd bin: <4>_{5n,1n|5n,1n} = four5n1n5n1n = <cos(n*(5*phi1+1*phi2-5*phi3-1*phi4)>
11338 // 53rd bin: <5>_{3n,3n|3n,2n,1n} = four3n3n3n2n1n = <cos(n*(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
11339 // 54th bin: <5>_{4n,2n|3n,2n,1n} = four4n2n3n2n1n = <cos(n*(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
11340 // 55th bin: <5>_{3n,2n|3n,1n,1n} = four3n2n3n1n1n = <cos(n*(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
11341 // 56th bin: <5>_{3n,2n|2n,2n,1n} = four3n2n2n2n1n = <cos(n*(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
11342 // 57th bin: <5>_{5n,1n|3n,2n,1n} = four5n1n3n2n1n = <cos(n*(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
11343 // 58th bin: <6>_{3n,2n,1n|3n,2n,1n} = six3n2n1n3n2n1n = <cos(n*(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
8ed4edc7 11344
489d5531 11345 Int_t nPrim = anEvent->NumberOfTracks();
11346 AliFlowTrackSimple *aftsTrack = NULL;
11347 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11348 Int_t n = fHarmonic;
11349 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 11350 Double_t dMult = (*fSpk)(0,0);
489d5531 11351 cout<<endl;
11352 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11353 if(dMult<2)
11354 {
11355 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11356 } else if (dMult>fMaxAllowedMultiplicity)
11357 {
11358 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11359 } else
11360 {
11361 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
11362 }
11363
11364 // 2-particle correlations:
11365 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11366 {
11367 for(Int_t i1=0;i1<nPrim;i1++)
11368 {
11369 aftsTrack=anEvent->GetTrack(i1);
11370 if(!(aftsTrack->InRPSelection())) continue;
11371 phi1=aftsTrack->Phi();
11372 for(Int_t i2=0;i2<nPrim;i2++)
11373 {
11374 if(i2==i1)continue;
11375 aftsTrack=anEvent->GetTrack(i2);
11376 if(!(aftsTrack->InRPSelection())) continue;
11377 phi2=aftsTrack->Phi();
11378 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11379 // fill the profile with 2-p correlations:
b84464d3 11380 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
11381 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
11382 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
11383 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
11384 fIntFlowDirectCorrelations->Fill(34.5,cos(5.*n*(phi1-phi2)),1.); // <cos(5n*(phi1-phi2))>
11385 fIntFlowDirectCorrelations->Fill(35.5,cos(6.*n*(phi1-phi2)),1.); // <cos(6n*(phi1-phi2))>
489d5531 11386 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11387 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11388 } // end of if(nPrim>=2)
11389
11390 // 3-particle correlations:
11391 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11392 {
11393 for(Int_t i1=0;i1<nPrim;i1++)
11394 {
11395 aftsTrack=anEvent->GetTrack(i1);
11396 if(!(aftsTrack->InRPSelection())) continue;
11397 phi1=aftsTrack->Phi();
11398 for(Int_t i2=0;i2<nPrim;i2++)
11399 {
11400 if(i2==i1)continue;
11401 aftsTrack=anEvent->GetTrack(i2);
11402 if(!(aftsTrack->InRPSelection())) continue;
11403 phi2=aftsTrack->Phi();
11404 for(Int_t i3=0;i3<nPrim;i3++)
11405 {
11406 if(i3==i1||i3==i2)continue;
11407 aftsTrack=anEvent->GetTrack(i3);
11408 if(!(aftsTrack->InRPSelection())) continue;
11409 phi3=aftsTrack->Phi();
11410 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
11411 // fill the profile with 3-p correlations:
b84464d3 11412 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
11413 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
11414 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
11415 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
11416 fIntFlowDirectCorrelations->Fill(36.5,cos(5.*n*phi1-3.*n*phi2-2.*n*phi3),1.); //<3>_{5n|3n,2n}
11417 fIntFlowDirectCorrelations->Fill(37.5,cos(5.*n*phi1-4.*n*phi2-1.*n*phi3),1.); //<3>_{5n|4n,1n}
11418 fIntFlowDirectCorrelations->Fill(38.5,cos(6.*n*phi1-3.*n*phi2-3.*n*phi3),1.); //<3>_{6n|3n,3n}
11419 fIntFlowDirectCorrelations->Fill(39.5,cos(6.*n*phi1-4.*n*phi2-2.*n*phi3),1.); //<3>_{6n|4n,2n}
11420 fIntFlowDirectCorrelations->Fill(40.5,cos(6.*n*phi1-5.*n*phi2-1.*n*phi3),1.); //<3>_{6n|5n,1n}
489d5531 11421 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11422 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11423 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11424 } // end of if(nPrim>=3)
11425
11426 // 4-particle correlations:
11427 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11428 {
11429 for(Int_t i1=0;i1<nPrim;i1++)
11430 {
11431 aftsTrack=anEvent->GetTrack(i1);
11432 if(!(aftsTrack->InRPSelection())) continue;
11433 phi1=aftsTrack->Phi();
11434 for(Int_t i2=0;i2<nPrim;i2++)
11435 {
11436 if(i2==i1)continue;
11437 aftsTrack=anEvent->GetTrack(i2);
11438 if(!(aftsTrack->InRPSelection())) continue;
11439 phi2=aftsTrack->Phi();
11440 for(Int_t i3=0;i3<nPrim;i3++)
11441 {
11442 if(i3==i1||i3==i2)continue;
11443 aftsTrack=anEvent->GetTrack(i3);
11444 if(!(aftsTrack->InRPSelection())) continue;
11445 phi3=aftsTrack->Phi();
11446 for(Int_t i4=0;i4<nPrim;i4++)
11447 {
11448 if(i4==i1||i4==i2||i4==i3)continue;
11449 aftsTrack=anEvent->GetTrack(i4);
11450 if(!(aftsTrack->InRPSelection())) continue;
11451 phi4=aftsTrack->Phi();
11452 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
11453 // fill the profile with 4-p correlations:
11454 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
11455 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
11456 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
11457 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
11458 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
11459 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
11460 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
b84464d3 11461 fIntFlowDirectCorrelations->Fill(32.,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
11462 fIntFlowDirectCorrelations->Fill(41.5,cos(n*(6.*phi1-3.*phi2-2.*phi3-1.*phi4)),1.); // <4>_{6n|3n,2n,1n}
11463 fIntFlowDirectCorrelations->Fill(42.5,cos(n*(3.*phi1+2.*phi2-3.*phi3-2.*phi4)),1.); // <4>_{3n,2n|3n,2n}
11464 fIntFlowDirectCorrelations->Fill(43.5,cos(n*(4.*phi1+1.*phi2-3.*phi3-2.*phi4)),1.); // <4>_{4n,1n|3n,2n}
11465 fIntFlowDirectCorrelations->Fill(44.5,cos(n*(3.*phi1+3.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{3n,3n|3n,3n}
11466 fIntFlowDirectCorrelations->Fill(45.5,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
11467 fIntFlowDirectCorrelations->Fill(46.5,cos(n*(5.*phi1+1.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{5n,1n|3n,3n}
11468 fIntFlowDirectCorrelations->Fill(47.5,cos(n*(4.*phi1+2.*phi2-4.*phi3-2.*phi4)),1.); // <4>_{4n,2n|4n,2n}
11469 fIntFlowDirectCorrelations->Fill(48.5,cos(n*(5.*phi1+1.*phi2-4.*phi3-2.*phi4)),1.); // <4>_{5n,1n|4n,2n}
11470 fIntFlowDirectCorrelations->Fill(49.5,cos(n*(5.*phi1-3.*phi2-1.*phi3-1.*phi4)),1.); // <4>_{5n|3n,1n,1n}
11471 fIntFlowDirectCorrelations->Fill(50.5,cos(n*(5.*phi1-2.*phi2-2.*phi3-1.*phi4)),1.); // <4>_{5n|2n,2n,1n}
403e3389 11472 fIntFlowDirectCorrelations->Fill(51.5,cos(n*(5.*phi1+1.*phi2-5.*phi3-1.*phi4)),1.); // <4>_{5n,1n|5n,1n}
11473 fIntFlowDirectCorrelations->Fill(58.5,cos(n*(6.*phi1-4.*phi2-1.*phi3-1.*phi4)),1.); // <4>_{6n|4n,1n,1n}
11474 fIntFlowDirectCorrelations->Fill(59.5,cos(n*(6.*phi1-2.*phi2-2.*phi3-2.*phi4)),1.); // <4>_{6n|2n,2n,2n}
489d5531 11475 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11476 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11477 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11478 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11479 } // end of if(nPrim>=)
11480
11481 // 5-particle correlations:
11482 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
11483 {
11484 for(Int_t i1=0;i1<nPrim;i1++)
11485 {
11486 aftsTrack=anEvent->GetTrack(i1);
11487 if(!(aftsTrack->InRPSelection())) continue;
11488 phi1=aftsTrack->Phi();
11489 for(Int_t i2=0;i2<nPrim;i2++)
11490 {
11491 if(i2==i1)continue;
11492 aftsTrack=anEvent->GetTrack(i2);
11493 if(!(aftsTrack->InRPSelection())) continue;
11494 phi2=aftsTrack->Phi();
11495 for(Int_t i3=0;i3<nPrim;i3++)
11496 {
11497 if(i3==i1||i3==i2)continue;
11498 aftsTrack=anEvent->GetTrack(i3);
11499 if(!(aftsTrack->InRPSelection())) continue;
11500 phi3=aftsTrack->Phi();
11501 for(Int_t i4=0;i4<nPrim;i4++)
11502 {
11503 if(i4==i1||i4==i2||i4==i3)continue;
11504 aftsTrack=anEvent->GetTrack(i4);
11505 if(!(aftsTrack->InRPSelection())) continue;
11506 phi4=aftsTrack->Phi();
11507 for(Int_t i5=0;i5<nPrim;i5++)
11508 {
11509 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11510 aftsTrack=anEvent->GetTrack(i5);
11511 if(!(aftsTrack->InRPSelection())) continue;
11512 phi5=aftsTrack->Phi();
11513 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
11514 // fill the profile with 5-p correlations:
b84464d3 11515 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); // <5>_{2n,n|n,n,n}
11516 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); // <5>_{2n,2n|2n,n,n}
11517 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); // <5>_{3n,n|2n,n,n}
11518 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); // <5>_{4n|n,n,n,n}
11519 fIntFlowDirectCorrelations->Fill(33.,cos(3.*n*phi1+3.*n*phi2-2.*n*phi3-2.*n*phi4-2.*n*phi5),1.); // <5>_{3n,3n|2n,2n,2n}
11520 fIntFlowDirectCorrelations->Fill(52.5,cos(3.*n*phi1+3.*n*phi2-3.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{3n,3n|3n,2n,1n}
11521 fIntFlowDirectCorrelations->Fill(53.5,cos(4.*n*phi1+2.*n*phi2-3.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{4n,2n|3n,2n,1n}
11522 fIntFlowDirectCorrelations->Fill(54.5,cos(3.*n*phi1+2.*n*phi2-3.*n*phi3-1.*n*phi4-1.*n*phi5),1.); // <5>_{3n,2n|3n,1n,1n}
11523 fIntFlowDirectCorrelations->Fill(55.5,cos(3.*n*phi1+2.*n*phi2-2.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{3n,2n|2n,2n,1n}
11524 fIntFlowDirectCorrelations->Fill(56.5,cos(5.*n*phi1+1.*n*phi2-3.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{5n,1n|3n,2n,1n}
403e3389 11525 fIntFlowDirectCorrelations->Fill(60.5,cos(6.*n*phi1-2.*n*phi2-2.*n*phi3-1.*n*phi4-1.*n*phi5),1.); // <5>_{6n|2n,2n,1n,1n}
11526 fIntFlowDirectCorrelations->Fill(61.5,cos(4.*n*phi1+1.*n*phi2+1.*n*phi3-3.*n*phi4-3.*n*phi5),1.); // <5>_{4n,1n,1n|3n,3n}
489d5531 11527 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11528 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11529 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11530 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11531 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11532 } // end of if(nPrim>=5)
11533
11534 // 6-particle correlations:
11535 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
11536 {
11537 for(Int_t i1=0;i1<nPrim;i1++)
11538 {
11539 aftsTrack=anEvent->GetTrack(i1);
11540 if(!(aftsTrack->InRPSelection())) continue;
11541 phi1=aftsTrack->Phi();
11542 for(Int_t i2=0;i2<nPrim;i2++)
11543 {
11544 if(i2==i1)continue;
11545 aftsTrack=anEvent->GetTrack(i2);
11546 if(!(aftsTrack->InRPSelection())) continue;
11547 phi2=aftsTrack->Phi();
11548 for(Int_t i3=0;i3<nPrim;i3++)
11549 {
11550 if(i3==i1||i3==i2)continue;
11551 aftsTrack=anEvent->GetTrack(i3);
11552 if(!(aftsTrack->InRPSelection())) continue;
11553 phi3=aftsTrack->Phi();
11554 for(Int_t i4=0;i4<nPrim;i4++)
11555 {
11556 if(i4==i1||i4==i2||i4==i3)continue;
11557 aftsTrack=anEvent->GetTrack(i4);
11558 if(!(aftsTrack->InRPSelection())) continue;
11559 phi4=aftsTrack->Phi();
11560 for(Int_t i5=0;i5<nPrim;i5++)
11561 {
11562 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11563 aftsTrack=anEvent->GetTrack(i5);
11564 if(!(aftsTrack->InRPSelection())) continue;
11565 phi5=aftsTrack->Phi();
11566 for(Int_t i6=0;i6<nPrim;i6++)
11567 {
11568 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11569 aftsTrack=anEvent->GetTrack(i6);
11570 if(!(aftsTrack->InRPSelection())) continue;
11571 phi6=aftsTrack->Phi();
11572 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
11573 // fill the profile with 6-p correlations:
403e3389 11574 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); // <6>_{1n,1n,1n|1n,1n,1n}
11575 fIntFlowDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); // <6>_{2n,1n,1n|2n,1n,1n}
11576 fIntFlowDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); // <6>_{2n,2n|1n,1n,1n,1n}
11577 fIntFlowDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); // <6>_{3n,1n|1n,1n,1n,1n}
b84464d3 11578 fIntFlowDirectCorrelations->Fill(57.5,cos(3.*n*phi1+2.*n*phi2+1.*n*phi3-3.*n*phi4-2.*n*phi5-1.*n*phi6),1.); // <6>_{3n,2n,1n|3n,2n,1n}
403e3389 11579 fIntFlowDirectCorrelations->Fill(62.5,cos(3.*n*phi1+3.*n*phi2-2.*n*phi3-2.*n*phi4-1.*n*phi5-1.*n*phi6),1.); // <6>_{3n,3n|2n,2n,1n,1n}
489d5531 11580 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11581 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11582 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11583 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11584 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11585 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11586 } // end of if(nPrim>=6)
11587
11588 // 7-particle correlations:
11589 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
11590 {
11591 for(Int_t i1=0;i1<nPrim;i1++)
11592 {
11593 aftsTrack=anEvent->GetTrack(i1);
11594 if(!(aftsTrack->InRPSelection())) continue;
11595 phi1=aftsTrack->Phi();
11596 for(Int_t i2=0;i2<nPrim;i2++)
11597 {
11598 if(i2==i1)continue;
11599 aftsTrack=anEvent->GetTrack(i2);
11600 if(!(aftsTrack->InRPSelection())) continue;
11601 phi2=aftsTrack->Phi();
11602 for(Int_t i3=0;i3<nPrim;i3++)
11603 {
11604 if(i3==i1||i3==i2)continue;
11605 aftsTrack=anEvent->GetTrack(i3);
11606 if(!(aftsTrack->InRPSelection())) continue;
11607 phi3=aftsTrack->Phi();
11608 for(Int_t i4=0;i4<nPrim;i4++)
11609 {
11610 if(i4==i1||i4==i2||i4==i3)continue;
11611 aftsTrack=anEvent->GetTrack(i4);
11612 if(!(aftsTrack->InRPSelection())) continue;
11613 phi4=aftsTrack->Phi();
11614 for(Int_t i5=0;i5<nPrim;i5++)
11615 {
11616 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11617 aftsTrack=anEvent->GetTrack(i5);
11618 if(!(aftsTrack->InRPSelection())) continue;
11619 phi5=aftsTrack->Phi();
11620 for(Int_t i6=0;i6<nPrim;i6++)
11621 {
11622 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11623 aftsTrack=anEvent->GetTrack(i6);
11624 if(!(aftsTrack->InRPSelection())) continue;
11625 phi6=aftsTrack->Phi();
11626 for(Int_t i7=0;i7<nPrim;i7++)
11627 {
11628 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
11629 aftsTrack=anEvent->GetTrack(i7);
11630 if(!(aftsTrack->InRPSelection())) continue;
11631 phi7=aftsTrack->Phi();
11632 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
11633 // fill the profile with 7-p correlation:
11634 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}
11635 } // end of for(Int_t i7=0;i7<nPrim;i7++)
11636 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11637 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11638 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11639 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11640 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11641 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11642 } // end of if(nPrim>=7)
11643
11644 // 8-particle correlations:
11645 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
11646 {
11647 for(Int_t i1=0;i1<nPrim;i1++)
11648 {
11649 aftsTrack=anEvent->GetTrack(i1);
11650 if(!(aftsTrack->InRPSelection())) continue;
11651 phi1=aftsTrack->Phi();
11652 for(Int_t i2=0;i2<nPrim;i2++)
11653 {
11654 if(i2==i1)continue;
11655 aftsTrack=anEvent->GetTrack(i2);
11656 if(!(aftsTrack->InRPSelection())) continue;
11657 phi2=aftsTrack->Phi();
11658 for(Int_t i3=0;i3<nPrim;i3++)
11659 {
11660 if(i3==i1||i3==i2)continue;
11661 aftsTrack=anEvent->GetTrack(i3);
11662 if(!(aftsTrack->InRPSelection())) continue;
11663 phi3=aftsTrack->Phi();
11664 for(Int_t i4=0;i4<nPrim;i4++)
11665 {
11666 if(i4==i1||i4==i2||i4==i3)continue;
11667 aftsTrack=anEvent->GetTrack(i4);
11668 if(!(aftsTrack->InRPSelection())) continue;
11669 phi4=aftsTrack->Phi();
11670 for(Int_t i5=0;i5<nPrim;i5++)
11671 {
11672 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11673 aftsTrack=anEvent->GetTrack(i5);
11674 if(!(aftsTrack->InRPSelection())) continue;
11675 phi5=aftsTrack->Phi();
11676 for(Int_t i6=0;i6<nPrim;i6++)
11677 {
11678 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11679 aftsTrack=anEvent->GetTrack(i6);
11680 if(!(aftsTrack->InRPSelection())) continue;
11681 phi6=aftsTrack->Phi();
11682 for(Int_t i7=0;i7<nPrim;i7++)
11683 {
11684 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
11685 aftsTrack=anEvent->GetTrack(i7);
11686 if(!(aftsTrack->InRPSelection())) continue;
11687 phi7=aftsTrack->Phi();
11688 for(Int_t i8=0;i8<nPrim;i8++)
11689 {
11690 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
11691 aftsTrack=anEvent->GetTrack(i8);
11692 if(!(aftsTrack->InRPSelection())) continue;
11693 phi8=aftsTrack->Phi();
11694 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
11695 // fill the profile with 8-p correlation:
11696 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}
11697 } // end of for(Int_t i8=0;i8<nPrim;i8++)
11698 } // end of for(Int_t i7=0;i7<nPrim;i7++)
11699 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11700 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11701 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11702 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11703 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11704 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11705 } // end of if(nPrim>=8)
11706
11707 cout<<endl;
11708
11709} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
11710
11711
11712//==================================================================================================================================
11713
11714
11715void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
11716{
11717 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
11718
11719 cout<<endl;
11720 cout<<endl;
11721 cout<<" *****************************************"<<endl;
11722 cout<<" **** cross-checking the correlations ****"<<endl;
11723 cout<<" **** for integrated flow ****"<<endl;
403e3389 11724 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 11725 {
11726 cout<<" **** (particle weights not used) ****"<<endl;
11727 } else
11728 {
11729 cout<<" **** (particle weights used) ****"<<endl;
11730 }
11731 cout<<" *****************************************"<<endl;
11732 cout<<endl;
11733 cout<<endl;
11734
403e3389 11735 Int_t ciMax = 64; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
489d5531 11736
403e3389 11737 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
489d5531 11738 {
11739 ciMax = 11;
11740 }
11741
11742 for(Int_t ci=1;ci<=ciMax;ci++)
11743 {
11744 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
11745 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
11746 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
11747 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
11748 cout<<endl;
11749 }
11750
11751} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
11752
489d5531 11753//================================================================================================================================
11754
489d5531 11755void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
11756{
11757 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
11758
11759 cout<<endl;
11760 cout<<endl;
11761 cout<<" *********************************************"<<endl;
11762 cout<<" **** cross-checking the correction terms ****"<<endl;
11763 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
11764 cout<<" **** for integrated flow ****"<<endl;
403e3389 11765 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 11766 {
11767 cout<<" **** (particle weights not used) ****"<<endl;
11768 } else
11769 {
11770 cout<<" **** (particle weights used) ****"<<endl;
11771 }
11772 cout<<" *********************************************"<<endl;
11773 cout<<endl;
11774 cout<<endl;
11775
b92ea2b9 11776 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 11777 {
11778 for(Int_t sc=0;sc<2;sc++) // sin or cos term
11779 {
11780 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
11781 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
11782 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
11783 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
11784 cout<<endl;
11785 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
11786 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
11787
11788} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
11789
489d5531 11790//================================================================================================================================
11791
0328db2d 11792void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11793{
11794 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
11795
11796 // Results are stored in profile fIntFlowDirectCorrelations.
11797 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
11798 //
11799 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
11800 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
11801 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
11802 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
11803 // 5th bin: ---- EMPTY ----
11804 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
11805 // 7th bin: <3>_{3n|2n,1n} = ...
11806 // 8th bin: <3>_{4n|2n,2n} = ...
11807 // 9th bin: <3>_{4n|3n,1n} = ...
11808 // 10th bin: ---- EMPTY ----
11809 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
11810 // 12th bin: <4>_{2n,1n|2n,1n} = ...
11811 // 13th bin: <4>_{2n,2n|2n,2n} = ...
11812 // 14th bin: <4>_{3n|1n,1n,1n} = ...
11813 // 15th bin: <4>_{3n,1n|3n,1n} = ...
11814 // 16th bin: <4>_{3n,1n|2n,2n} = ...
11815 // 17th bin: <4>_{4n|2n,1n,1n} = ...
11816 // 18th bin: ---- EMPTY ----
11817 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
11818 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
11819 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
11820 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
11821 // 23rd bin: ---- EMPTY ----
11822 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
11823 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
11824 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
11825 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
11826 // 28th bin: ---- EMPTY ----
11827 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
11828 // 30th bin: ---- EMPTY ----
11829 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 11830
489d5531 11831 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
11832 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 11833
489d5531 11834 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
11835 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
11836 // ...
57340a27 11837
489d5531 11838 Int_t nPrim = anEvent->NumberOfTracks();
11839 AliFlowTrackSimple *aftsTrack = NULL;
11840 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11841 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11842 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
11843 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
11844 Int_t n = fHarmonic;
11845 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 11846 Double_t dMult = (*fSpk)(0,0);
489d5531 11847 cout<<endl;
11848 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11849 if(dMult<2)
11850 {
11851 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11852 } else if (dMult>fMaxAllowedMultiplicity)
11853 {
11854 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11855 } else
11856 {
11857 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11858 }
11859
11860 // 2-particle correlations:
11861 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11862 {
11863 // 2 nested loops multiparticle correlations using particle weights:
11864 for(Int_t i1=0;i1<nPrim;i1++)
11865 {
11866 aftsTrack=anEvent->GetTrack(i1);
11867 if(!(aftsTrack->InRPSelection())) continue;
11868 phi1=aftsTrack->Phi();
11869 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11870 for(Int_t i2=0;i2<nPrim;i2++)
11871 {
11872 if(i2==i1)continue;
11873 aftsTrack=anEvent->GetTrack(i2);
11874 if(!(aftsTrack->InRPSelection())) continue;
11875 phi2=aftsTrack->Phi();
11876 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11877 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11878 // 2-p correlations using particle weights:
11879 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
11880 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))>
11881 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))>
11882 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))>
11883 // extra correlations:
11884 // 2-p extra correlations (do not appear if particle weights are not used):
11885 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
11886 // ...
11887 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11888 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11889 } // end of if(nPrim>=2)
11890
11891 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 11892 {
489d5531 11893 // 3 nested loops multiparticle correlations using particle weights:
11894 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 11895 {
489d5531 11896 aftsTrack=anEvent->GetTrack(i1);
11897 if(!(aftsTrack->InRPSelection())) continue;
11898 phi1=aftsTrack->Phi();
11899 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11900 for(Int_t i2=0;i2<nPrim;i2++)
11901 {
11902 if(i2==i1)continue;
11903 aftsTrack=anEvent->GetTrack(i2);
11904 if(!(aftsTrack->InRPSelection())) continue;
11905 phi2=aftsTrack->Phi();
11906 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11907 for(Int_t i3=0;i3<nPrim;i3++)
11908 {
11909 if(i3==i1||i3==i2)continue;
11910 aftsTrack=anEvent->GetTrack(i3);
11911 if(!(aftsTrack->InRPSelection())) continue;
11912 phi3=aftsTrack->Phi();
11913 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11914 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
11915 // 3-p correlations using particle weights:
11916 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))>
11917 // ...
11918 // extra correlations:
11919 // 2-p extra correlations (do not appear if particle weights are not used):
11920 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
11921 // ...
11922 // 3-p extra correlations (do not appear if particle weights are not used):
11923 // ...
11924 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11925 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11926 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11927 } // end of if(nPrim>=3)
57340a27 11928
489d5531 11929 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11930 {
11931 // 4 nested loops multiparticle correlations using particle weights:
11932 for(Int_t i1=0;i1<nPrim;i1++)
11933 {
11934 aftsTrack=anEvent->GetTrack(i1);
11935 if(!(aftsTrack->InRPSelection())) continue;
11936 phi1=aftsTrack->Phi();
11937 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11938 for(Int_t i2=0;i2<nPrim;i2++)
11939 {
11940 if(i2==i1)continue;
11941 aftsTrack=anEvent->GetTrack(i2);
11942 if(!(aftsTrack->InRPSelection())) continue;
11943 phi2=aftsTrack->Phi();
11944 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11945 for(Int_t i3=0;i3<nPrim;i3++)
11946 {
11947 if(i3==i1||i3==i2)continue;
11948 aftsTrack=anEvent->GetTrack(i3);
11949 if(!(aftsTrack->InRPSelection())) continue;
11950 phi3=aftsTrack->Phi();
11951 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11952 for(Int_t i4=0;i4<nPrim;i4++)
11953 {
11954 if(i4==i1||i4==i2||i4==i3)continue;
11955 aftsTrack=anEvent->GetTrack(i4);
11956 if(!(aftsTrack->InRPSelection())) continue;
11957 phi4=aftsTrack->Phi();
11958 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11959 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11960 // 4-p correlations using particle weights:
11961 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11962 // extra correlations:
11963 // 2-p extra correlations (do not appear if particle weights are not used):
11964 // ...
11965 // 3-p extra correlations (do not appear if particle weights are not used):
11966 // ...
11967 // 4-p extra correlations (do not appear if particle weights are not used):
11968 // ...
11969 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11970 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11971 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11972 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11973 } // end of if(nPrim>=4)
57340a27 11974
489d5531 11975 cout<<endl;
57340a27 11976
489d5531 11977} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 11978
489d5531 11979//================================================================================================================================
11980
489d5531 11981void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 11982{
489d5531 11983 // Cross-check results for extra multiparticle correlations needed for int. flow
11984 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 11985
489d5531 11986 cout<<endl;
11987 cout<<endl;
11988 cout<<" ***********************************************"<<endl;
11989 cout<<" **** cross-checking the extra correlations ****"<<endl;
11990 cout<<" **** for integrated flow ****"<<endl;
11991 cout<<" ***********************************************"<<endl;
11992 cout<<endl;
11993 cout<<endl;
11994
11995 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 11996 {
489d5531 11997 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
11998 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
11999 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
12000 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
12001 cout<<endl;
12002 }
57340a27 12003
489d5531 12004} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 12005
489d5531 12006//================================================================================================================================
3b552efe 12007
0328db2d 12008void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 12009{
12010 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
12011 //
12012 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
12013 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
12014 // (sc stands for either sin or cos):
12015
12016 // 1st bin: <<sc(n*(phi1))>>
12017 // 2nd bin: <<sc(n*(phi1+phi2))>>
12018 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
12019 // 4th bin: <<sc(n*(2phi1-phi2))>>
12020
12021 Int_t nPrim = anEvent->NumberOfTracks();
12022 AliFlowTrackSimple *aftsTrack = NULL;
12023 Double_t phi1=0., phi2=0., phi3=0.;
12024 Int_t n = fHarmonic;
12025 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 12026 Double_t dMult = (*fSpk)(0,0);
489d5531 12027 cout<<endl;
12028 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
12029 if(dMult<1)
3b552efe 12030 {
489d5531 12031 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
12032 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 12033 {
489d5531 12034 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
12035 } else
12036 {
12037 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
12038 }
12039
12040 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12041 {
12042 // 1-particle correction terms for non-uniform acceptance:
12043 for(Int_t i1=0;i1<nPrim;i1++)
12044 {
12045 aftsTrack=anEvent->GetTrack(i1);
12046 if(!(aftsTrack->InRPSelection())) continue;
12047 phi1=aftsTrack->Phi();
12048 if(nPrim==1) cout<<i1<<"\r"<<flush;
12049 // sin terms:
12050 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
12051 // cos terms:
12052 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
12053 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12054 } // end of if(nPrim>=1)
12055
12056 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
12057 {
12058 // 2-particle correction terms for non-uniform acceptance:
12059 for(Int_t i1=0;i1<nPrim;i1++)
12060 {
12061 aftsTrack=anEvent->GetTrack(i1);
12062 if(!(aftsTrack->InRPSelection())) continue;
12063 phi1=aftsTrack->Phi();
12064 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 12065 {
489d5531 12066 if(i2==i1)continue;
12067 aftsTrack=anEvent->GetTrack(i2);
12068 if(!(aftsTrack->InRPSelection())) continue;
12069 phi2=aftsTrack->Phi();
12070 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
12071 // sin terms:
3b552efe 12072 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 12073 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
12074 // cos terms:
3b552efe 12075 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 12076 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
12077 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12078 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12079 } // end of if(nPrim>=2)
12080
12081 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12082 {
12083 // 3-particle correction terms for non-uniform acceptance:
12084 for(Int_t i1=0;i1<nPrim;i1++)
12085 {
12086 aftsTrack=anEvent->GetTrack(i1);
12087 if(!(aftsTrack->InRPSelection())) continue;
12088 phi1=aftsTrack->Phi();
12089 for(Int_t i2=0;i2<nPrim;i2++)
12090 {
12091 if(i2==i1)continue;
12092 aftsTrack=anEvent->GetTrack(i2);
12093 if(!(aftsTrack->InRPSelection())) continue;
12094 phi2=aftsTrack->Phi();
12095 for(Int_t i3=0;i3<nPrim;i3++)
12096 {
12097 if(i3==i1||i3==i2)continue;
12098 aftsTrack=anEvent->GetTrack(i3);
12099 if(!(aftsTrack->InRPSelection())) continue;
12100 phi3=aftsTrack->Phi();
12101 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
12102 // sin terms:
12103 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
12104 // cos terms:
12105 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
12106 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12107 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12108 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12109 } // end of if(nPrim>=3)
12110
12111 cout<<endl;
12112}
64e500e3 12113
489d5531 12114//================================================================================================================================
64e500e3 12115
0328db2d 12116void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12117{
12118 // Evaluate reduced correlations with nested loops without using the particle weights.
12119
12120 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12121 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
12122 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
12123 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
12124 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
12125 // ...
12126
2a98ceb8 12127 Int_t typeFlag = 0;
12128 Int_t ptEtaFlag = 0;
489d5531 12129 if(type == "RP")
12130 {
12131 typeFlag = 0;
12132 } else if(type == "POI")
12133 {
12134 typeFlag = 1;
12135 }
12136 if(ptOrEta == "Pt")
12137 {
12138 ptEtaFlag = 0;
12139 } else if(ptOrEta == "Eta")
12140 {
12141 ptEtaFlag = 1;
12142 }
12143 // shortcuts:
12144 Int_t t = typeFlag;
12145 Int_t pe = ptEtaFlag;
12146
12147 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12148 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12149 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12150
12151 Int_t nPrim = anEvent->NumberOfTracks();
12152 AliFlowTrackSimple *aftsTrack = NULL;
12153
12154 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12155
3b552efe 12156 Int_t n = fHarmonic;
489d5531 12157
12158 // 2'-particle correlations:
12159 for(Int_t i1=0;i1<nPrim;i1++)
12160 {
12161 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12162 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12163 if(typeFlag==1) // this is diff flow of POIs
489d5531 12164 {
12165 if(ptOrEta == "Pt")
12166 {
12167 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12168 } else if (ptOrEta == "Eta")
12169 {
12170 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12171 }
12172 } else // this is diff flow of RPs
12173 {
489d5531 12174 if(ptOrEta == "Pt")
12175 {
12176 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12177 } else if (ptOrEta == "Eta")
12178 {
12179 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12180 }
12181 }
489d5531 12182
12183 psi1=aftsTrack->Phi();
12184 for(Int_t i2=0;i2<nPrim;i2++)
12185 {
12186 if(i2==i1)continue;
12187 aftsTrack=anEvent->GetTrack(i2);
12188 // RP condition (!(first) particle in the correlator must be RP):
12189 if(!(aftsTrack->InRPSelection()))continue;
12190 phi2=aftsTrack->Phi();
12191 // 2'-particle correlations:
12192 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
12193 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12194 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12195
12196 /*
12197
12198 // 3'-particle correlations:
12199 for(Int_t i1=0;i1<nPrim;i1++)
12200 {
12201 aftsTrack=anEvent->GetTrack(i1);
12202 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12203 if(ptOrEta == "Pt")
12204 {
12205 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12206 } else if (ptOrEta == "Eta")
12207 {
12208 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12209 }
12210 psi1=aftsTrack->Phi();
12211 for(Int_t i2=0;i2<nPrim;i2++)
12212 {
12213 if(i2==i1)continue;
12214 aftsTrack=anEvent->GetTrack(i2);
12215 // RP condition (!(first) particle in the correlator must be RP):
12216 if(!(aftsTrack->InRPSelection())) continue;
12217 phi2=aftsTrack->Phi();
12218 for(Int_t i3=0;i3<nPrim;i3++)
12219 {
12220 if(i3==i1||i3==i2)continue;
12221 aftsTrack=anEvent->GetTrack(i3);
12222 // RP condition (!(first) particle in the correlator must be RP):
12223 if(!(aftsTrack->InRPSelection())) continue;
12224 phi3=aftsTrack->Phi();
12225 // 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))>
12226 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12227 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12228 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12229
12230 */
12231
12232 // 4'-particle correlations:
12233 for(Int_t i1=0;i1<nPrim;i1++)
12234 {
12235 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12236 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12237 if(typeFlag==1) // this is diff flow of POIs
489d5531 12238 {
12239 if(ptOrEta == "Pt")
12240 {
12241 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12242 } else if (ptOrEta == "Eta")
12243 {
12244 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12245 }
12246 } else // this is diff flow of RPs
12247 {
489d5531 12248 if(ptOrEta == "Pt")
12249 {
12250 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12251 } else if (ptOrEta == "Eta")
12252 {
12253 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12254 }
12255 }
489d5531 12256
12257 psi1=aftsTrack->Phi();
12258 for(Int_t i2=0;i2<nPrim;i2++)
12259 {
12260 if(i2==i1) continue;
12261 aftsTrack=anEvent->GetTrack(i2);
12262 // RP condition (!(first) particle in the correlator must be RP):
12263 if(!(aftsTrack->InRPSelection())) continue;
12264 phi2=aftsTrack->Phi();
12265 for(Int_t i3=0;i3<nPrim;i3++)
12266 {
12267 if(i3==i1||i3==i2) continue;
12268 aftsTrack=anEvent->GetTrack(i3);
12269 // RP condition (!(first) particle in the correlator must be RP):
12270 if(!(aftsTrack->InRPSelection())) continue;
12271 phi3=aftsTrack->Phi();
12272 for(Int_t i4=0;i4<nPrim;i4++)
12273 {
12274 if(i4==i1||i4==i2||i4==i3) continue;
12275 aftsTrack=anEvent->GetTrack(i4);
12276 // RP condition (!(first) particle in the correlator must be RP):
12277 if(!(aftsTrack->InRPSelection())) continue;
12278 phi4=aftsTrack->Phi();
12279 // 4'-particle correlations:
12280 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
12281 }//end of for(Int_t i4=0;i4<nPrim;i4++)
12282 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12283 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12284 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12285
12286 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 12287 for(Int_t i=0;i<nPrim;i++)
12288 {
12289 aftsTrack=anEvent->GetTrack(i);
12290 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12291 if(typeFlag==1) // this is diff flow of POIs
489d5531 12292 {
12293 if(ptOrEta == "Pt")
12294 {
12295 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12296 } else if (ptOrEta == "Eta")
12297 {
12298 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12299 }
12300 } else // this is diff flow of RPs
12301 {
489d5531 12302 if(ptOrEta == "Pt")
12303 {
12304 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12305 } else if (ptOrEta == "Eta")
12306 {
12307 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12308 }
12309 }
12310 if(t==1)t++;
12311 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 12312 }
12313
12314} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12315
489d5531 12316//================================================================================================================================
12317
64e500e3 12318void AliFlowAnalysisWithQCumulants::EvaluateOtherDiffCorrelatorsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12319{
12320 // Evaluate other differential correlators with nested loops without using the particle weights.
12321
12322 // Remark 1: Other differential correlators are evaluated in pt bin number fCrossCheckInPtBinNo
12323 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12324 // Remark 2: Results are stored in 1 bin profiles fOtherDirectDiffCorrelators[t][pe][sc][ci], where indices runs as follows:
12325 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms][ci = correlator index]
12326 // Remark 3: Correlator index 'ci' runs as follows:
12327 // 0: <exp(n*(psi1-3phi2+2phi3))> (Teaney-Yan correlator)
12328
12329 Int_t typeFlag = 0;
12330 Int_t ptEtaFlag = 0;
12331 if(type == "RP")
12332 {
12333 typeFlag = 0;
12334 } else if(type == "POI")
12335 {
12336 typeFlag = 1;
12337 }
12338 if(ptOrEta == "Pt")
12339 {
12340 ptEtaFlag = 0;
12341 } else if(ptOrEta == "Eta")
12342 {
12343 ptEtaFlag = 1;
12344 }
12345 // shortcuts:
12346 Int_t t = typeFlag;
12347 Int_t pe = ptEtaFlag;
12348
12349 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12350 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12351 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12352
12353 Int_t nPrim = anEvent->NumberOfTracks();
12354 AliFlowTrackSimple *aftsTrack = NULL;
12355
12356 Double_t psi1=0., phi2=0., phi3=0.;
12357
12358 Int_t n = fHarmonic;
12359
12360 // 3-p correlators:
12361 for(Int_t i1=0;i1<nPrim;i1++)
12362 {
12363 aftsTrack=anEvent->GetTrack(i1);
12364 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12365 if(typeFlag==1) // this is diff flow of POIs
12366 {
12367 if(ptOrEta == "Pt")
12368 {
12369 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12370 } else if (ptOrEta == "Eta")
12371 {
12372 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12373 }
12374 } else // this is diff flow of RPs
12375 {
12376 if(ptOrEta == "Pt")
12377 {
12378 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12379 } else if (ptOrEta == "Eta")
12380 {
12381 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12382 }
12383 }
12384 psi1=aftsTrack->Phi();
12385 for(Int_t i2=0;i2<nPrim;i2++)
12386 {
12387 if(i2==i1) continue;
12388 aftsTrack=anEvent->GetTrack(i2);
12389 // RP condition (!(first) particle in the correlator must be RP):
12390 if(!(aftsTrack->InRPSelection())) continue;
12391 phi2=aftsTrack->Phi();
12392 for(Int_t i3=0;i3<nPrim;i3++)
12393 {
12394 if(i3==i1||i3==i2) continue;
12395 aftsTrack=anEvent->GetTrack(i3);
12396 // RP condition (!(first) particle in the correlator must be RP):
12397 if(!(aftsTrack->InRPSelection())) continue;
12398 phi3=aftsTrack->Phi();
12399 // Fill 3-p correlators:
12400 fOtherDirectDiffCorrelators[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-3.*phi2+2.*phi3)),1.); // <cos(n(psi1-3.*phi2+2.*phi3))>
12401 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12402 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12403 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12404} // end of void AliFlowAnalysisWithQCumulants::EvaluateOtherDiffCorrelatorsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12405
12406//================================================================================================================================
489d5531 12407
12408void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
12409{
12410 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12411
2a98ceb8 12412 Int_t typeFlag = 0;
12413 Int_t ptEtaFlag = 0;
489d5531 12414 if(type == "RP")
12415 {
12416 typeFlag = 0;
12417 } else if(type == "POI")
12418 {
12419 typeFlag = 1;
12420 }
12421 if(ptOrEta == "Pt")
12422 {
12423 ptEtaFlag = 0;
12424 } else if(ptOrEta == "Eta")
12425 {
12426 ptEtaFlag = 1;
12427 }
12428 // shortcuts:
12429 Int_t t = typeFlag;
12430 Int_t pe = ptEtaFlag;
12431
12432 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12433 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12434 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
12435 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12436 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12437
12438 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12439
12440
12441 cout<<endl;
12442 cout<<" *****************************************"<<endl;
12443 cout<<" **** cross-checking the correlations ****"<<endl;
12444 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
403e3389 12445 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 12446 {
12447 cout<<" **** (particle weights not used) ****"<<endl;
12448 } else
12449 {
12450 cout<<" **** (particle weights used) ****"<<endl;
12451 }
12452 cout<<" *****************************************"<<endl;
12453 cout<<endl;
12454 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12455 cout<<endl;
12456
12457 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
12458 {
12459 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
12460 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12461 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
12462 cout<<endl;
12463 } // end of for(Int_t rci=0;rci<4;rci++)
12464
12465} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
12466
3b552efe 12467//================================================================================================================================
12468
64e500e3 12469void AliFlowAnalysisWithQCumulants::CrossCheckOtherDiffCorrelators(TString type, TString ptOrEta)
12470{
12471 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12472
12473 Int_t typeFlag = 0;
12474 Int_t ptEtaFlag = 0;
12475 if(type == "RP")
12476 {
12477 typeFlag = 0;
12478 } else if(type == "POI")
12479 {
12480 typeFlag = 1;
12481 }
12482 if(ptOrEta == "Pt")
12483 {
12484 ptEtaFlag = 0;
12485 } else if(ptOrEta == "Eta")
12486 {
12487 ptEtaFlag = 1;
12488 }
12489 // shortcuts:
12490 Int_t t = typeFlag;
12491 Int_t pe = ptEtaFlag;
12492
12493 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12494 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12495 TString otherCorrelators[1] = {"<<cos(n(psi1-3phi2+2phi3))>>"}; // to be improved (access this from pro or hist)
12496 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12497 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12498
12499 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12500
12501 cout<<endl;
12502 cout<<" *****************************************"<<endl;
12503 cout<<" **** cross-checking the other ****"<<endl;
12504 cout<<" **** diff. correlators ("<<rpORpoiString[t]<<") ****"<<endl;
403e3389 12505 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
64e500e3 12506 {
12507 cout<<" **** (particle weights not used) ****"<<endl;
12508 } else
12509 {
12510 cout<<" **** (particle weights used) ****"<<endl;
12511 }
12512 cout<<" *****************************************"<<endl;
12513 cout<<endl;
12514 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12515 cout<<endl;
12516
12517 for(Int_t ci=0;ci<1;ci++)
12518 {
12519 cout<<" "<<otherCorrelators[ci].Data()<<":"<<endl;
12520 cout<<" from Q-vectors = "<<fOtherDiffCorrelators[t][pe][1][ci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12521 cout<<" from nested loops = "<<fOtherDirectDiffCorrelators[t][pe][1][ci]->GetBinContent(1)<<endl;
12522 cout<<endl;
12523 } // end of for(Int_t ci=0;ci<1;ci++)
12524
12525} // end of void AliFlowAnalysisWithQCumulants::CrossCheckOtherDiffCorrelators(TString type, TString ptOrEta)
12526
12527//================================================================================================================================
12528
489d5531 12529void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 12530{
12531 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
12532
12533 cout<<endl;
12534 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
12535 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
12536 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
12537 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
12538
489d5531 12539} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
12540
3b552efe 12541//================================================================================================================================
12542
0328db2d 12543void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12544{
12545 // Evaluate reduced correlations with nested loops without using the particle weights.
12546
12547 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12548 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
12549 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
12550 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
12551 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
12552 // ...
12553
2a98ceb8 12554 Int_t typeFlag = 0;
12555 Int_t ptEtaFlag = 0;
489d5531 12556 if(type == "RP")
12557 {
12558 typeFlag = 0;
12559 } else if(type == "POI")
12560 {
12561 typeFlag = 1;
12562 }
12563 if(ptOrEta == "Pt")
12564 {
12565 ptEtaFlag = 0;
12566 } else if(ptOrEta == "Eta")
12567 {
12568 ptEtaFlag = 1;
12569 }
12570 // shortcuts:
12571 Int_t t = typeFlag;
12572 Int_t pe = ptEtaFlag;
12573
12574 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12575 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12576 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12577
12578 Int_t nPrim = anEvent->NumberOfTracks();
12579 AliFlowTrackSimple *aftsTrack = NULL;
12580
12581 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12582 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
12583
12584 Int_t n = fHarmonic;
12585
12586 // 2'-particle correlations:
12587 for(Int_t i1=0;i1<nPrim;i1++)
12588 {
12589 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12590 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12591 if(typeFlag==1) // this is diff flow of POIs
489d5531 12592 {
12593 if(ptOrEta == "Pt")
12594 {
12595 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12596 } else if (ptOrEta == "Eta")
12597 {
12598 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12599 }
12600 } else // this is diff flow of RPs
12601 {
489d5531 12602 if(ptOrEta == "Pt")
12603 {
12604 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12605 } else if (ptOrEta == "Eta")
12606 {
12607 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12608 }
489d5531 12609 }
12610 psi1=aftsTrack->Phi();
12611 for(Int_t i2=0;i2<nPrim;i2++)
12612 {
12613 if(i2==i1) continue;
12614 aftsTrack=anEvent->GetTrack(i2);
12615 // RP condition (!(first) particle in the correlator must be RP):
12616 if(!(aftsTrack->InRPSelection())) continue;
12617 phi2=aftsTrack->Phi();
12618 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12619 // 2'-particle correlations:
12620 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
12621 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12622 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12623
12624 // 4'-particle correlations:
12625 for(Int_t i1=0;i1<nPrim;i1++)
12626 {
12627 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12628 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12629 if(typeFlag==1) // this is diff flow of POIs
489d5531 12630 {
12631 if(ptOrEta == "Pt")
12632 {
12633 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12634 } else if (ptOrEta == "Eta")
12635 {
12636 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12637 }
12638 } else // this is diff flow of RPs
12639 {
489d5531 12640 if(ptOrEta == "Pt")
12641 {
12642 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12643 } else if (ptOrEta == "Eta")
12644 {
12645 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12646 }
489d5531 12647 }
12648 psi1=aftsTrack->Phi();
12649 for(Int_t i2=0;i2<nPrim;i2++)
12650 {
12651 if(i2==i1) continue;
12652 aftsTrack=anEvent->GetTrack(i2);
12653 // RP condition (!(first) particle in the correlator must be RP):
12654 if(!(aftsTrack->InRPSelection())) continue;
12655 phi2=aftsTrack->Phi();
12656 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12657 for(Int_t i3=0;i3<nPrim;i3++)
12658 {
12659 if(i3==i1||i3==i2) continue;
12660 aftsTrack=anEvent->GetTrack(i3);
12661 // RP condition (!(first) particle in the correlator must be RP):
12662 if(!(aftsTrack->InRPSelection())) continue;
12663 phi3=aftsTrack->Phi();
12664 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12665 for(Int_t i4=0;i4<nPrim;i4++)
12666 {
12667 if(i4==i1||i4==i2||i4==i3) continue;
12668 aftsTrack=anEvent->GetTrack(i4);
12669 // RP condition (!(first) particle in the correlator must be RP):
12670 if(!(aftsTrack->InRPSelection())) continue;
12671 phi4=aftsTrack->Phi();
12672 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12673 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
12674 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
12675 }//end of for(Int_t i4=0;i4<nPrim;i4++)
12676 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12677 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12678 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12679
12680 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 12681 for(Int_t i=0;i<nPrim;i++)
12682 {
489d5531 12683 aftsTrack=anEvent->GetTrack(i);
12684 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12685 if(typeFlag==1) // this is diff flow of POIs
12686 {
12687 if(ptOrEta == "Pt")
12688 {
12689 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12690 } else if (ptOrEta == "Eta")
12691 {
12692 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12693 }
12694 } else // this is diff flow of RPs
12695 {
12696 if(ptOrEta == "Pt")
12697 {
12698 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12699 } else if (ptOrEta == "Eta")
12700 {
12701 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12702 }
12703 }
12704 if(t==1)t++;
12705 fNoOfParticlesInBin->Fill(t+pe+0.5);
12706 }
12707
12708} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12709
489d5531 12710//================================================================================================================================
12711
0328db2d 12712void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12713{
12714 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
12715
12716 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12717 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12718 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12719 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12720 // cti:
12721 // 0: <<sc n(psi1)>>
12722 // 1: <<sc n(psi1+phi2)>>
12723 // 2: <<sc n(psi1+phi2-phi3)>>
12724 // 3: <<sc n(psi1-phi2-phi3)>>
12725 // 4:
12726 // 5:
12727 // 6:
12728
2a98ceb8 12729 Int_t typeFlag = 0;
12730 Int_t ptEtaFlag = 0;
489d5531 12731 if(type == "RP")
12732 {
12733 typeFlag = 0;
12734 } else if(type == "POI")
12735 {
12736 typeFlag = 1;
12737 }
12738 if(ptOrEta == "Pt")
12739 {
12740 ptEtaFlag = 0;
12741 } else if(ptOrEta == "Eta")
12742 {
12743 ptEtaFlag = 1;
12744 }
12745 // shortcuts:
12746 Int_t t = typeFlag;
12747 Int_t pe = ptEtaFlag;
12748
12749 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12750 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12751 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12752
12753 Int_t nPrim = anEvent->NumberOfTracks();
12754 AliFlowTrackSimple *aftsTrack = NULL;
12755
12756 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12757
12758 Int_t n = fHarmonic;
12759
12760 // 1-particle correction terms:
12761 for(Int_t i1=0;i1<nPrim;i1++)
12762 {
12763 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12764 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12765 if(typeFlag==1) // this is diff flow of POIs
489d5531 12766 {
12767 if(ptOrEta == "Pt")
12768 {
12769 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12770 } else if (ptOrEta == "Eta")
12771 {
12772 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12773 }
12774 } else // this is diff flow of RPs
12775 {
489d5531 12776 if(ptOrEta == "Pt")
12777 {
12778 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12779 } else if (ptOrEta == "Eta")
12780 {
12781 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12782 }
12783 }
489d5531 12784 psi1=aftsTrack->Phi();
12785 // sin terms:
12786 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12787 // cos terms:
12788 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12789 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12790
12791 // 2-particle correction terms:
12792 for(Int_t i1=0;i1<nPrim;i1++)
12793 {
12794 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12795 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12796 if(typeFlag==1) // this is diff flow of POIs
489d5531 12797 {
12798 if(ptOrEta == "Pt")
12799 {
12800 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12801 } else if (ptOrEta == "Eta")
12802 {
12803 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12804 }
12805 } else // this is diff flow of RPs
12806 {
489d5531 12807 if(ptOrEta == "Pt")
12808 {
12809 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12810 } else if (ptOrEta == "Eta")
12811 {
12812 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12813 }
489d5531 12814 }
12815 psi1=aftsTrack->Phi();
12816 for(Int_t i2=0;i2<nPrim;i2++)
12817 {
12818 if(i2==i1) continue;
12819 aftsTrack=anEvent->GetTrack(i2);
12820 // RP condition (!(first) particle in the correlator must be RP):
12821 if(!(aftsTrack->InRPSelection())) continue;
12822 phi2=aftsTrack->Phi();
12823 // sin terms:
12824 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
12825 // cos terms:
12826 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
12827 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12828 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12829
12830 // 3-particle correction terms:
12831 for(Int_t i1=0;i1<nPrim;i1++)
12832 {
12833 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12834 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12835 if(typeFlag==1) // this is diff flow of POIs
489d5531 12836 {
12837 if(ptOrEta == "Pt")
12838 {
12839 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12840 } else if (ptOrEta == "Eta")
12841 {
12842 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12843 }
12844 } else // this is diff flow of RPs
12845 {
489d5531 12846 if(ptOrEta == "Pt")
12847 {
12848 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12849 } else if (ptOrEta == "Eta")
12850 {
12851 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12852 }
489d5531 12853 }
12854 psi1=aftsTrack->Phi();
12855 for(Int_t i2=0;i2<nPrim;i2++)
12856 {
12857 if(i2==i1) continue;
12858 aftsTrack=anEvent->GetTrack(i2);
12859 // RP condition (!(first) particle in the correlator must be RP):
12860 if(!(aftsTrack->InRPSelection())) continue;
12861 phi2=aftsTrack->Phi();
12862 for(Int_t i3=0;i3<nPrim;i3++)
12863 {
12864 if(i3==i1||i3==i2) continue;
12865 aftsTrack=anEvent->GetTrack(i3);
12866 // RP condition (!(first) particle in the correlator must be RP):
12867 if(!(aftsTrack->InRPSelection())) continue;
12868 phi3=aftsTrack->Phi();
12869 // sin terms:
12870 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
12871 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
12872 // cos terms:
12873 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
12874 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
12875 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12876 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12877 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12878
12879} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12880
12881
12882//================================================================================================================================
12883
12884
12885void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
12886{
12887 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12888
2a98ceb8 12889 Int_t typeFlag = 0;
12890 Int_t ptEtaFlag = 0;
489d5531 12891 if(type == "RP")
12892 {
12893 typeFlag = 0;
12894 } else if(type == "POI")
12895 {
12896 typeFlag = 1;
12897 }
12898 if(ptOrEta == "Pt")
12899 {
12900 ptEtaFlag = 0;
12901 } else if(ptOrEta == "Eta")
12902 {
12903 ptEtaFlag = 1;
12904 }
12905 // shortcuts:
12906 Int_t t = typeFlag;
12907 Int_t pe = ptEtaFlag;
12908
12909 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12910 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12911 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
12912 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)
12913 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)
12914 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12915 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12916
12917 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12918
12919 cout<<endl;
12920 cout<<" ******************************************"<<endl;
12921 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 12922 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 12923 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
403e3389 12924 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489d5531 12925 {
12926 cout<<" **** (particle weights not used) ****"<<endl;
12927 } else
12928 {
12929 cout<<" **** (particle weights used) ****"<<endl;
12930 }
12931 cout<<" ******************************************"<<endl;
12932 cout<<endl;
12933 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12934 cout<<endl;
12935
12936 for(Int_t cti=0;cti<4;cti++) // correction term index
12937 {
12938 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
12939 {
12940 if(sc==0) // to be improved (this can be implemented better)
12941 {
12942 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
12943 } else
12944 {
12945 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
12946 }
12947 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12948 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
12949 cout<<endl;
12950 }
12951 } // end of for(Int_t rci=0;rci<4;rci++)
12952
12953} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
12954
57340a27 12955//================================================================================================================================
12956
489d5531 12957void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
12958{
12959 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
12960
12961 // **********************************************************************
12962 // **** weighted corrections for non-uniform acceptance (cos terms): ****
12963 // **********************************************************************
57340a27 12964
489d5531 12965 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 12966 //
489d5531 12967 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
12968 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
12969 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
12970 // ...
12971
12972 // multiplicity (number of particles used to determine the reaction plane)
1268c371 12973 Double_t dMult = (*fSpk)(0,0);
489d5531 12974
12975 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12976 Double_t dReQ1n1k = (*fReQ)(0,1);
12977 Double_t dReQ2n2k = (*fReQ)(1,2);
12978 //Double_t dReQ3n3k = (*fReQ)(2,3);
12979 //Double_t dReQ4n4k = (*fReQ)(3,4);
12980 Double_t dReQ1n3k = (*fReQ)(0,3);
12981 Double_t dImQ1n1k = (*fImQ)(0,1);
12982 Double_t dImQ2n2k = (*fImQ)(1,2);
12983 //Double_t dImQ3n3k = (*fImQ)(2,3);
12984 //Double_t dImQ4n4k = (*fImQ)(3,4);
12985 //Double_t dImQ1n3k = (*fImQ)(0,3);
12986
12987 // dMs are variables introduced in order to simplify some Eqs. bellow:
12988 //..............................................................................................
1268c371 12989 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
12990 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
12991 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 12992 //..............................................................................................
ecac11c2 12993 // 1-particle:
489d5531 12994 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
12995
1268c371 12996 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 12997 {
1268c371 12998 cosP1nW1 = dReQ1n1k/(*fSpk)(0,1);
489d5531 12999
13000 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
13001 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
13002
13003 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
1268c371 13004 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSpk)(0,1));
489d5531 13005 }
13006
13007 // 2-particle:
13008 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
13009
1268c371 13010 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 13011 {
13012 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
13013
13014 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
13015 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
13016
13017 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
13018 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
13019 }
13020
13021 // 3-particle:
13022 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
13023
1268c371 13024 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 13025 {
57340a27 13026 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
13027 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
1268c371 13028 - 2.*((*fSpk)(0,2))*dReQ1n1k
489d5531 13029 + 2.*dReQ1n3k)
13030 / dM111;
13031
13032 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
13033 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
13034
13035 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
13036 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
13037 }
13038
13039} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
13040
13041
13042//================================================================================================================================
13043
13044
13045void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
13046{
13047 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
13048
13049 // **********************************************************************
13050 // **** weighted corrections for non-uniform acceptance (sin terms): ****
13051 // **********************************************************************
13052
13053 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 13054 //
489d5531 13055 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
13056 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
13057 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
13058 // ...
13059
13060 // multiplicity (number of particles used to determine the reaction plane)
1268c371 13061 Double_t dMult = (*fSpk)(0,0);
489d5531 13062
13063 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13064 Double_t dReQ1n1k = (*fReQ)(0,1);
13065 Double_t dReQ2n2k = (*fReQ)(1,2);
13066 //Double_t dReQ3n3k = (*fReQ)(2,3);
13067 //Double_t dReQ4n4k = (*fReQ)(3,4);
13068 //Double_t dReQ1n3k = (*fReQ)(0,3);
13069 Double_t dImQ1n1k = (*fImQ)(0,1);
13070 Double_t dImQ2n2k = (*fImQ)(1,2);
13071 //Double_t dImQ3n3k = (*fImQ)(2,3);
13072 //Double_t dImQ4n4k = (*fImQ)(3,4);
13073 Double_t dImQ1n3k = (*fImQ)(0,3);
13074
13075 // dMs are variables introduced in order to simplify some Eqs. bellow:
13076 //..............................................................................................
1268c371 13077 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
13078 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
13079 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 13080 //..............................................................................................
13081
13082 // 1-particle:
13083 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
13084
1268c371 13085 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 13086 {
1268c371 13087 sinP1nW1 = dImQ1n1k/((*fSpk)(0,1));
489d5531 13088
13089 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
13090 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
13091
13092 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1268c371 13093 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSpk)(0,1));
489d5531 13094 }
13095
13096 // 2-particle:
13097 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
13098
1268c371 13099 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 13100 {
13101 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
13102
13103 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
13104 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
13105
13106 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
13107 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
13108 }
13109
13110 // 3-particle:
13111 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
13112
1268c371 13113 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 13114 {
57340a27 13115 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
13116 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
1268c371 13117 + 2.*((*fSpk)(0,2))*dImQ1n1k
489d5531 13118 - 2.*dImQ1n3k)
13119 / dM111;
13120
13121 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
13122 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
13123
13124 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
13125 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
13126 }
13127
13128} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
13129
57340a27 13130//================================================================================================================================
489d5531 13131
0328db2d 13132void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 13133{
13134 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
13135
57340a27 13136 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
13137 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 13138
57340a27 13139 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 13140 // organized as follows (sc stands for either sin or cos):
13141 //
13142 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
13143 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
13144 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 13145 // ...
489d5531 13146
13147 Int_t nPrim = anEvent->NumberOfTracks();
13148 AliFlowTrackSimple *aftsTrack = NULL;
13149 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
13150 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
13151 Double_t phi1=0., phi2=0., phi3=0.;
13152 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
13153 Int_t n = fHarmonic;
13154 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 13155 Double_t dMult = (*fSpk)(0,0);
489d5531 13156 cout<<endl;
13157 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
13158 if(dMult<1)
13159 {
13160 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
13161 } else if (dMult>fMaxAllowedMultiplicity)
13162 {
13163 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
13164 } else
13165 {
13166 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
13167 }
13168
13169 // 1-particle correction terms using particle weights:
13170 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
13171 {
13172 for(Int_t i1=0;i1<nPrim;i1++)
13173 {
13174 aftsTrack=anEvent->GetTrack(i1);
13175 if(!(aftsTrack->InRPSelection())) continue;
13176 phi1=aftsTrack->Phi();
13177 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 13178 // 1-particle correction terms using particle weights:
489d5531 13179 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
13180 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 13181 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13182 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
13183
489d5531 13184 // 2-particle correction terms using particle weights:
13185 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
13186 {
13187 for(Int_t i1=0;i1<nPrim;i1++)
13188 {
13189 aftsTrack=anEvent->GetTrack(i1);
13190 if(!(aftsTrack->InRPSelection())) continue;
13191 phi1=aftsTrack->Phi();
13192 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13193 for(Int_t i2=0;i2<nPrim;i2++)
13194 {
13195 if(i2==i1)continue;
13196 aftsTrack=anEvent->GetTrack(i2);
13197 if(!(aftsTrack->InRPSelection())) continue;
13198 phi2=aftsTrack->Phi();
13199 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13200 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 13201 // 2-p correction terms using particle weights:
489d5531 13202 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
13203 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
13204 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13205 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13206 } // end of if(nPrim>=2)
13207
13208 // 3-particle correction terms using particle weights:
13209 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
13210 {
13211 for(Int_t i1=0;i1<nPrim;i1++)
13212 {
13213 aftsTrack=anEvent->GetTrack(i1);
13214 if(!(aftsTrack->InRPSelection())) continue;
13215 phi1=aftsTrack->Phi();
13216 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13217 for(Int_t i2=0;i2<nPrim;i2++)
13218 {
13219 if(i2==i1)continue;
13220 aftsTrack=anEvent->GetTrack(i2);
13221 if(!(aftsTrack->InRPSelection())) continue;
13222 phi2=aftsTrack->Phi();
13223 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13224 for(Int_t i3=0;i3<nPrim;i3++)
13225 {
13226 if(i3==i1||i3==i2)continue;
13227 aftsTrack=anEvent->GetTrack(i3);
13228 if(!(aftsTrack->InRPSelection())) continue;
13229 phi3=aftsTrack->Phi();
13230 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13231 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 13232 // 3-p correction terms using particle weights:
489d5531 13233 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
13234 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
13235 } // end of for(Int_t i3=0;i3<nPrim;i3++)
13236 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13237 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13238 } // end of if(nPrim>=3)
13239
57340a27 13240 /*
13241
489d5531 13242 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
13243 {
13244 // 4 nested loops multiparticle correlations using particle weights:
13245 for(Int_t i1=0;i1<nPrim;i1++)
13246 {
13247 aftsTrack=anEvent->GetTrack(i1);
13248 if(!(aftsTrack->InRPSelection())) continue;
13249 phi1=aftsTrack->Phi();
13250 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13251 for(Int_t i2=0;i2<nPrim;i2++)
13252 {
13253 if(i2==i1)continue;
13254 aftsTrack=anEvent->GetTrack(i2);
13255 if(!(aftsTrack->InRPSelection())) continue;
13256 phi2=aftsTrack->Phi();
13257 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13258 for(Int_t i3=0;i3<nPrim;i3++)
13259 {
13260 if(i3==i1||i3==i2)continue;
13261 aftsTrack=anEvent->GetTrack(i3);
13262 if(!(aftsTrack->InRPSelection())) continue;
13263 phi3=aftsTrack->Phi();
13264 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13265 for(Int_t i4=0;i4<nPrim;i4++)
13266 {
13267 if(i4==i1||i4==i2||i4==i3)continue;
13268 aftsTrack=anEvent->GetTrack(i4);
13269 if(!(aftsTrack->InRPSelection())) continue;
13270 phi4=aftsTrack->Phi();
13271 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
13272 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
13273 // 4-p correlations using particle weights:
13274 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
13275 // extra correlations:
13276 // 2-p extra correlations (do not appear if particle weights are not used):
13277 // ...
13278 // 3-p extra correlations (do not appear if particle weights are not used):
13279 // ...
13280 // 4-p extra correlations (do not appear if particle weights are not used):
13281 // ...
13282 } // end of for(Int_t i4=0;i4<nPrim;i4++)
13283 } // end of for(Int_t i3=0;i3<nPrim;i3++)
13284 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13285 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13286 } // end of if(nPrim>=4)
13287
13288 */
13289
13290 cout<<endl;
13291
13292} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
13293
57340a27 13294//================================================================================================================================
489d5531 13295
489d5531 13296void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
13297{
13298 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 13299
489d5531 13300 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 13301 //
489d5531 13302 // 0: <<cos n(psi)>>
13303 // 1: <<w2 cos n(psi1+phi2)>>
13304 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
13305 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
13306 // 4:
13307 // 5:
13308 // 6:
13309
13310 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13311 Double_t dReQ1n1k = (*fReQ)(0,1);
13312 Double_t dReQ2n2k = (*fReQ)(1,2);
13313 //Double_t dReQ1n3k = (*fReQ)(0,3);
13314 //Double_t dReQ4n4k = (*fReQ)(3,4);
13315 Double_t dImQ1n1k = (*fImQ)(0,1);
13316 Double_t dImQ2n2k = (*fImQ)(1,2);
13317 //Double_t dImQ1n3k = (*fImQ)(0,3);
13318 //Double_t dImQ4n4k = (*fImQ)(3,4);
13319
1268c371 13320 // S^M_{p,k} (see .h file for the definition of fSpk):
13321 Double_t dSM1p1k = (*fSpk)(0,1);
13322 Double_t dSM1p2k = (*fSpk)(0,2);
13323 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 13324
2a98ceb8 13325 Int_t t = 0; // type flag
13326 Int_t pe = 0; // ptEta flag
489d5531 13327
13328 if(type == "RP")
13329 {
13330 t = 0;
13331 } else if(type == "POI")
13332 {
13333 t = 1;
13334 }
13335
13336 if(ptOrEta == "Pt")
13337 {
13338 pe = 0;
13339 } else if(ptOrEta == "Eta")
13340 {
13341 pe = 1;
13342 }
13343
13344 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
13345 Double_t minPtEta[2] = {fPtMin,fEtaMin};
13346 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
13347 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13348
13349 // looping over all bins and calculating correction terms:
13350 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13351 {
13352 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
13353 Double_t p1n0kRe = 0.;
13354 Double_t p1n0kIm = 0.;
13355
13356 // number of POIs in particular pt or eta bin:
13357 Double_t mp = 0.;
13358
13359 // 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):
13360 Double_t q1n2kRe = 0.;
13361 Double_t q1n2kIm = 0.;
13362 Double_t q2n1kRe = 0.;
13363 Double_t q2n1kIm = 0.;
46b94261 13364
489d5531 13365 // s_{1,1}, s_{1,2} // to be improved (add explanation)
13366 Double_t s1p1k = 0.;
13367 Double_t s1p2k = 0.;
46b94261 13368
489d5531 13369 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 13370 Double_t mq = 0.;
489d5531 13371
13372 // M0111 from Eq. (118) in QC2c (to be improved (notation))
13373 Double_t dM01 = 0.;
13374 Double_t dM011 = 0.;
13375
13376 if(type == "POI")
13377 {
13378 // q_{m*n,k}:
13379 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
13380 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
13381 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
13382 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
13383 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
13384 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
13385 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
13386 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
13387 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 13388
489d5531 13389 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
13390 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
13391 }else if(type == "RP")
13392 {
13393 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
13394 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
13395 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
13396 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
13397 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
13398 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
13399 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
13400 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
13401 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
13402 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13403 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
13404 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 13405 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
13406
489d5531 13407 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13408 }
3b552efe 13409
489d5531 13410 if(type == "POI")
3b552efe 13411 {
13412 // p_{m*n,k}:
489d5531 13413 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
13414 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
13415 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 13416 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
13417 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 13418 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 13419 dM01 = mp*dSM1p1k-s1p1k;
13420 dM011 = mp*(dSM2p1k-dSM1p2k)
13421 - 2.*(s1p1k*dSM1p1k-s1p2k);
13422
13423 // typeFlag = RP (0) or POI (1):
13424 t = 1;
13425 } else if(type == "RP")
489d5531 13426 {
13427 // to be improved (cross-checked):
13428 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
13429 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
13430 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
13431 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
13432 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13433 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 13434 dM01 = mp*dSM1p1k-s1p1k;
13435 dM011 = mp*(dSM2p1k-dSM1p2k)
13436 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 13437 // typeFlag = RP (0) or POI (1):
3b552efe 13438 t = 0;
13439 }
489d5531 13440
13441 // <<cos n(psi1)>>:
13442 Double_t cosP1nPsi = 0.;
13443 if(mp)
13444 {
13445 cosP1nPsi = p1n0kRe/mp;
13446
13447 // fill profile for <<cos n(psi1)>>:
13448 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
13449 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
13450 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 13451 } // end of if(mp)
57340a27 13452
489d5531 13453 // <<w2 cos n(psi1+phi2)>>:
13454 Double_t cosP1nPsiP1nPhiW2 = 0.;
13455 if(dM01)
13456 {
13457 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
13458 // fill profile for <<w2 cos n(psi1+phi2)>>:
13459 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
13460 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13461 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
13462 } // end of if(dM01)
13463
13464 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
13465 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
13466 if(dM011)
13467 {
46b94261 13468 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
13469 - p1n0kRe*dSM1p2k
13470 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
13471 - s1p1k*dReQ1n1k
13472 + 2.*q1n2kRe)
13473 / dM011;
489d5531 13474 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
13475 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
13476 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13477 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
13478 } // end of if(dM011)
13479
13480 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
13481 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
13482 if(dM011)
13483 {
13484 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
13485 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 13486 - 2.*s1p1k*dReQ1n1k
489d5531 13487 + 2.*q1n2kRe)
13488 / dM011;
13489 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
13490 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
13491 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13492 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
13493 } // end of if(dM011)
13494
13495 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 13496
57340a27 13497} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
13498
489d5531 13499
13500//================================================================================================================================
13501
13502
13503void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
13504{
13505 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
13506
13507 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
13508 // 0: <<sin n(psi1)>>
13509 // 1: <<w2 sin n(psi1+phi2)>>
13510 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
13511 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
13512 // 4:
13513 // 5:
13514 // 6:
13515
13516 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13517 Double_t dReQ1n1k = (*fReQ)(0,1);
13518 Double_t dReQ2n2k = (*fReQ)(1,2);
13519 //Double_t dReQ1n3k = (*fReQ)(0,3);
13520 //Double_t dReQ4n4k = (*fReQ)(3,4);
13521 Double_t dImQ1n1k = (*fImQ)(0,1);
13522 Double_t dImQ2n2k = (*fImQ)(1,2);
13523 //Double_t dImQ1n3k = (*fImQ)(0,3);
13524 //Double_t dImQ4n4k = (*fImQ)(3,4);
13525
1268c371 13526 // S^M_{p,k} (see .h file for the definition of fSpk):
13527 Double_t dSM1p1k = (*fSpk)(0,1);
13528 Double_t dSM1p2k = (*fSpk)(0,2);
13529 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 13530
2a98ceb8 13531 Int_t t = 0; // type flag
13532 Int_t pe = 0; // ptEta flag
489d5531 13533
13534 if(type == "RP")
13535 {
13536 t = 0;
13537 } else if(type == "POI")
13538 {
13539 t = 1;
13540 }
13541
13542 if(ptOrEta == "Pt")
13543 {
13544 pe = 0;
13545 } else if(ptOrEta == "Eta")
13546 {
13547 pe = 1;
13548 }
13549
13550 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
13551 Double_t minPtEta[2] = {fPtMin,fEtaMin};
13552 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
13553 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13554
13555 // looping over all bins and calculating correction terms:
13556 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13557 {
13558 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
13559 Double_t p1n0kRe = 0.;
13560 Double_t p1n0kIm = 0.;
13561
13562 // number of POIs in particular pt or eta bin:
13563 Double_t mp = 0.;
13564
13565 // 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):
13566 Double_t q1n2kRe = 0.;
13567 Double_t q1n2kIm = 0.;
13568 Double_t q2n1kRe = 0.;
13569 Double_t q2n1kIm = 0.;
46b94261 13570
489d5531 13571 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13572 Double_t s1p1k = 0.;
13573 Double_t s1p2k = 0.;
46b94261 13574
489d5531 13575 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 13576 Double_t mq = 0.;
489d5531 13577
13578 // M0111 from Eq. (118) in QC2c (to be improved (notation))
13579 Double_t dM01 = 0.;
13580 Double_t dM011 = 0.;
13581
13582 if(type == "POI")
13583 {
13584 // q_{m*n,k}:
13585 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
13586 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
13587 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
13588 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
13589 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
13590 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
13591 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
13592 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
13593 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 13594
489d5531 13595 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
13596 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
13597 }else if(type == "RP")
13598 {
13599 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
13600 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
13601 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
13602 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
13603 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
13604 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
13605 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
13606 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
13607 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
13608 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13609 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
13610 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
13611 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 13612 }
13613
13614 if(type == "POI")
13615 {
13616 // p_{m*n,k}:
489d5531 13617 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
13618 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
13619 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 13620 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
13621 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 13622 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 13623 dM01 = mp*dSM1p1k-s1p1k;
13624 dM011 = mp*(dSM2p1k-dSM1p2k)
13625 - 2.*(s1p1k*dSM1p1k-s1p2k);
13626 // typeFlag = RP (0) or POI (1):
13627 t = 1;
489d5531 13628 } else if(type == "RP")
3b552efe 13629 {
489d5531 13630 // to be improved (cross-checked):
13631 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
13632 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
13633 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
13634 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
13635 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13636 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 13637 dM01 = mp*dSM1p1k-s1p1k;
13638 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 13639 - 2.*(s1p1k*dSM1p1k-s1p2k);
13640 // typeFlag = RP (0) or POI (1):
3b552efe 13641 t = 0;
13642 }
13643
489d5531 13644 // <<sin n(psi1)>>:
13645 Double_t sinP1nPsi = 0.;
13646 if(mp)
13647 {
13648 sinP1nPsi = p1n0kIm/mp;
13649
13650 // fill profile for <<sin n(psi1)>>:
13651 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
13652 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
13653 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 13654 } // end of if(mp)
13655
489d5531 13656 // <<w2 sin n(psi1+phi2)>>:
13657 Double_t sinP1nPsiP1nPhiW2 = 0.;
13658 if(dM01)
13659 {
13660 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
13661 // fill profile for <<w2 sin n(psi1+phi2)>>:
13662 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
13663 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
13664 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
13665 } // end of if(mp*dMult-mq)
13666
13667 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
13668 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
13669 if(dM011)
13670 {
46b94261 13671 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
13672 - p1n0kIm*dSM1p2k
13673 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
13674 - s1p1k*dImQ1n1k
13675 + 2.*q1n2kIm)
13676 / dM011;
489d5531 13677 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
13678 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
13679 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
13680 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
13681 } // end of if(dM011)
13682
13683 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
13684 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
13685 if(dM011)
13686 {
13687 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
13688 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 13689 + 2.*s1p1k*dImQ1n1k
489d5531 13690 - 2.*q1n2kIm)
13691 / dM011;
13692 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
13693 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
13694 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
13695 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
13696 } // end of if(dM011)
13697
13698 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13699
13700} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
13701
489d5531 13702//================================================================================================================================
489d5531 13703
0328db2d 13704void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 13705{
57340a27 13706 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 13707 // with using particle weights (both sin and cos terms) relevant for differential flow.
13708
57340a27 13709 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
13710 // flagged both as POI and RP.
489d5531 13711 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
13712 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
13713 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
13714 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
13715 // cti:
13716 // 0: <<sc n(psi1)>>
13717 // 1: <<w2 sc n(psi1+phi2)>>
13718 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
13719 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
13720 // 4:
13721 // 5:
13722 // 6:
46b94261 13723
2a98ceb8 13724 Int_t typeFlag = 0;
13725 Int_t ptEtaFlag = 0;
489d5531 13726 if(type == "RP")
13727 {
13728 typeFlag = 0;
13729 } else if(type == "POI")
13730 {
13731 typeFlag = 1;
13732 }
13733 if(ptOrEta == "Pt")
13734 {
13735 ptEtaFlag = 0;
13736 } else if(ptOrEta == "Eta")
13737 {
13738 ptEtaFlag = 1;
13739 }
13740 // shortcuts:
13741 Int_t t = typeFlag;
13742 Int_t pe = ptEtaFlag;
13743
13744 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
13745 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
13746 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13747
13748 Int_t nPrim = anEvent->NumberOfTracks();
13749 AliFlowTrackSimple *aftsTrack = NULL;
13750
13751 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
13752 Double_t wPhi2=1., wPhi3=1.;
13753
13754 Int_t n = fHarmonic;
13755
13756 // 1'-particle correction terms:
13757 for(Int_t i1=0;i1<nPrim;i1++)
13758 {
13759 aftsTrack=anEvent->GetTrack(i1);
3b552efe 13760 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13761 if(typeFlag==1) // this is diff flow of POIs
489d5531 13762 {
13763 if(ptOrEta == "Pt")
13764 {
13765 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13766 } else if (ptOrEta == "Eta")
13767 {
13768 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 13769 }
13770 } else // this is diff flow of RPs
13771 {
489d5531 13772 if(ptOrEta == "Pt")
13773 {
13774 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13775 } else if (ptOrEta == "Eta")
13776 {
13777 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 13778 }
489d5531 13779 }
13780 psi1=aftsTrack->Phi();
13781 // sin terms:
13782 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
13783 // cos terms:
13784 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
13785 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13786
13787 // 2'-particle correction terms:
13788 for(Int_t i1=0;i1<nPrim;i1++)
13789 {
13790 aftsTrack=anEvent->GetTrack(i1);
3b552efe 13791 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13792 if(typeFlag==1) // this is diff flow of POIs
489d5531 13793 {
13794 if(ptOrEta == "Pt")
13795 {
13796 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13797 } else if (ptOrEta == "Eta")
13798 {
13799 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 13800 }
13801 } else // this is diff flow of RPs
13802 {
489d5531 13803 if(ptOrEta == "Pt")
13804 {
13805 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13806 } else if (ptOrEta == "Eta")
13807 {
13808 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 13809 }
489d5531 13810 }
13811 psi1=aftsTrack->Phi();
13812 for(Int_t i2=0;i2<nPrim;i2++)
13813 {
13814 if(i2==i1) continue;
13815 aftsTrack=anEvent->GetTrack(i2);
13816 // RP condition (!(first) particle in the correlator must be RP):
13817 if(!(aftsTrack->InRPSelection())) continue;
46b94261 13818 phi2=aftsTrack->Phi();
489d5531 13819 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13820 // sin terms:
13821 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
13822 // cos terms:
13823 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
13824 }//end of for(Int_t i2=0;i2<nPrim;i2++)
13825 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13826
13827 // 3'-particle correction terms:
13828 for(Int_t i1=0;i1<nPrim;i1++)
13829 {
13830 aftsTrack=anEvent->GetTrack(i1);
3b552efe 13831 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13832 if(typeFlag==1) // this is diff flow of POIs
489d5531 13833 {
13834 if(ptOrEta == "Pt")
13835 {
13836 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13837 } else if (ptOrEta == "Eta")
13838 {
13839 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 13840 }
13841 } else // this is diff flow of RPs
13842 {
489d5531 13843 if(ptOrEta == "Pt")
13844 {
13845 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13846 } else if (ptOrEta == "Eta")
13847 {
13848 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 13849 }
489d5531 13850 }
13851 psi1=aftsTrack->Phi();
13852 for(Int_t i2=0;i2<nPrim;i2++)
13853 {
13854 if(i2==i1) continue;
13855 aftsTrack=anEvent->GetTrack(i2);
13856 // RP condition (!(first) particle in the correlator must be RP):
13857 if(!(aftsTrack->InRPSelection())) continue;
13858 phi2=aftsTrack->Phi();
13859 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13860 for(Int_t i3=0;i3<nPrim;i3++)
13861 {
13862 if(i3==i1||i3==i2) continue;
13863 aftsTrack=anEvent->GetTrack(i3);
13864 // RP condition (!(first) particle in the correlator must be RP):
13865 if(!(aftsTrack->InRPSelection())) continue;
13866 phi3=aftsTrack->Phi();
13867 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13868 // sin terms:
13869 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))>>
13870 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))>>
13871 // cos terms:
13872 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))>>
13873 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))>>
13874 }//end of for(Int_t i3=0;i3<nPrim;i3++)
13875 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 13876 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 13877
13878} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
13879
2001bc3a 13880//================================================================================================================================
13881
b3dacf6b 13882void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
13883{
13884 // Check all pointers used in method Finish().
13885
b77b6434 13886 if(!fAvMultiplicity)
13887 {
13888 cout<<endl;
13889 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13890 cout<<endl;
13891 exit(0);
13892 }
b3dacf6b 13893 if(!fIntFlowCorrelationsPro)
13894 {
13895 cout<<endl;
13896 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13897 cout<<endl;
13898 exit(0);
13899 }
b40a910e 13900 if(!fIntFlowSquaredCorrelationsPro)
13901 {
13902 cout<<endl;
13903 cout<<" WARNING (QC): fIntFlowSquaredCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13904 cout<<endl;
13905 exit(0);
13906 }
b3dacf6b 13907 if(!fIntFlowCorrelationsHist)
13908 {
13909 cout<<endl;
13910 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13911 cout<<endl;
13912 exit(0);
13913 }
403e3389 13914 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights) && !fIntFlowExtraCorrelationsPro)
b77b6434 13915 {
13916 cout<<endl;
13917 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13918 cout<<endl;
13919 exit(0);
13920 }
b3dacf6b 13921 for(Int_t power=0;power<2;power++)
13922 {
13923 if(!fIntFlowSumOfEventWeights[power])
13924 {
13925 cout<<endl;
13926 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
13927 cout<<endl;
13928 exit(0);
13929 }
13930 } // end of for(Int_t power=0;power<2;power++)
13931 if(!fIntFlowProductOfCorrelationsPro)
13932 {
13933 cout<<endl;
13934 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13935 cout<<endl;
13936 exit(0);
13937 }
13938 if(!fIntFlowSumOfProductOfEventWeights)
13939 {
13940 cout<<endl;
13941 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13942 cout<<endl;
13943 exit(0);
13944 }
13945 if(!fIntFlowCovariances)
13946 {
13947 cout<<endl;
13948 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13949 cout<<endl;
13950 exit(0);
13951 }
13952 if(!fIntFlowQcumulants)
13953 {
13954 cout<<endl;
13955 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13956 cout<<endl;
13957 exit(0);
13958 }
0dd3b008 13959 if(!fIntFlow)
13960 {
13961 cout<<endl;
13962 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13963 cout<<endl;
13964 exit(0);
13965 }
13966 if(!fCommonHists)
13967 {
13968 cout<<endl;
13969 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13970 cout<<endl;
13971 exit(0);
13972 }
13973 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
13974 {
13975 cout<<endl;
13976 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
13977 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13978 cout<<endl;
13979 exit(0);
13980 }
b3dacf6b 13981
b92ea2b9 13982 // NUA stuff:
13983 for(Int_t sc=0;sc<2;sc++) // sin/cos
13984 {
13985 if(!fIntFlowCorrectionTermsForNUAPro[sc])
13986 {
13987 cout<<endl;
13988 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
13989 cout<<endl;
13990 exit(0);
13991 }
13992 if(!fIntFlowCorrectionTermsForNUAHist[sc])
13993 {
13994 cout<<endl;
13995 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
13996 cout<<endl;
13997 exit(0);
13998 }
13999 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
14000 {
14001 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
14002 {
14003 cout<<endl;
14004 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
14005 cout<<endl;
14006 exit(0);
14007 }
14008 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
14009 } // end of for(Int_t power=0;power<2;power++)
14010 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
14011 {
14012 cout<<endl;
14013 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14014 cout<<endl;
14015 exit(0);
14016 }
14017 if(!fIntFlowSumOfProductOfEventWeightsNUA)
14018 {
14019 cout<<endl;
14020 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14021 cout<<endl;
14022 exit(0);
14023 }
14024 if(!fIntFlowCovariancesNUA)
14025 {
14026 cout<<endl;
14027 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14028 cout<<endl;
14029 exit(0);
14030 }
14031 if(!fIntFlowQcumulantsErrorSquaredRatio)
14032 {
14033 cout<<endl;
14034 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14035 cout<<endl;
14036 exit(0);
14037 }
14038 if(!fIntFlowDetectorBias)
14039 {
14040 cout<<endl;
14041 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14042 cout<<endl;
14043 exit(0);
14044 }
14045
b3dacf6b 14046 // Versus multiplicity:
14047 if(!fCalculateCumulantsVsM){return;}
b77b6434 14048 for(Int_t co=0;co<=3;co++) // cumulant order
b3dacf6b 14049 {
b77b6434 14050 if(!fIntFlowQcumulantsVsM[co])
b3dacf6b 14051 {
14052 cout<<endl;
b77b6434 14053 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
b3dacf6b 14054 cout<<endl;
14055 exit(0);
14056 }
b77b6434 14057 if(!fIntFlowVsM[co])
b3dacf6b 14058 {
14059 cout<<endl;
b77b6434 14060 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14061 cout<<endl;
14062 exit(0);
14063 }
14064 if(!fIntFlowDetectorBiasVsM[co])
14065 {
14066 cout<<endl;
14067 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14068 cout<<endl;
14069 exit(0);
14070 }
14071 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
14072 for(Int_t ci=0;ci<=3;ci++) // correlation index
14073 {
14074 if(!fIntFlowCorrelationsVsMPro[ci])
14075 {
14076 cout<<endl;
14077 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b3dacf6b 14078 cout<<endl;
14079 exit(0);
14080 }
b40a910e 14081 if(!fIntFlowSquaredCorrelationsVsMPro[ci])
14082 {
14083 cout<<endl;
14084 cout<<Form(" WARNING (QC): fIntFlowSquaredCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
14085 cout<<endl;
14086 exit(0);
14087 }
b77b6434 14088 if(!fIntFlowCorrelationsVsMHist[ci])
b92ea2b9 14089 {
14090 cout<<endl;
b77b6434 14091 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b92ea2b9 14092 cout<<endl;
14093 exit(0);
14094 }
b3dacf6b 14095 for(Int_t power=0;power<2;power++)
14096 {
14097 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
14098 {
14099 cout<<endl;
14100 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
14101 cout<<endl;
14102 exit(0);
14103 }
14104 } // end of for(Int_t power=0;power<2;power++)
14105 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
14106 for(Int_t i=0;i<6;i++)
14107 {
14108 if(!fIntFlowProductOfCorrelationsVsMPro[i])
14109 {
14110 cout<<endl;
14111 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14112 cout<<endl;
14113 exit(0);
14114 }
14115 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
14116 {
14117 cout<<endl;
14118 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14119 cout<<endl;
14120 exit(0);
14121 }
14122 if(!fIntFlowCovariancesVsM[i])
14123 {
14124 cout<<endl;
14125 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14126 cout<<endl;
14127 exit(0);
14128 }
14129 } // end of for(Int_t i=0;i<6;i++)
14130 if(!fIntFlowRebinnedInM)
14131 {
14132 cout<<endl;
14133 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14134 cout<<endl;
14135 exit(0);
14136 }
14137 if(!fIntFlowQcumulantsRebinnedInM)
14138 {
14139 cout<<endl;
14140 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14141 cout<<endl;
14142 exit(0);
14143 }
14144
14145} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
14146
14147//================================================================================================================================
14148
14149void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
14150{
1268c371 14151 // Check all pointers used in method Make(). // to be improved - check other pointers as well
b3dacf6b 14152
b77b6434 14153 if(!fAvMultiplicity)
14154 {
1268c371 14155 printf("\n WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 14156 exit(0);
14157 }
403e3389 14158 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights) && !fIntFlowExtraCorrelationsPro)
b77b6434 14159 {
1268c371 14160 printf("\n WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 14161 exit(0);
14162 }
1268c371 14163 // 2D:
14164 if(fCalculate2DDiffFlow)
14165 {
14166 for(Int_t t=0;t<2;t++) // type = RP or POI
14167 {
14168 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
14169 {
14170 if(!f2DDiffFlowCorrelationsPro[t][rci])
14171 {
14172 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in CheckPointersUsedInMake() !!!!\n\n",t,rci);
14173 exit(0);
14174 } // end of if(!f2DDiffFlowCorrelationsPro[t][rci])
14175 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
14176 } // end of for(Int_t t=0;t<2;t++)
14177 } // end of if(fCalculate2DDiffFlow)
b3dacf6b 14178
14179} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
14180
57340a27 14181