]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
Added the possibility to include a function in the ProcessInfo object, to produce...
[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"
39#include "TProfile3D.h"
40#include "TMath.h"
41#include "TArrow.h"
42#include "TPaveLabel.h"
43#include "TCanvas.h"
44#include "AliFlowEventSimple.h"
45#include "AliFlowTrackSimple.h"
46#include "AliFlowAnalysisWithQCumulants.h"
47#include "TArrayD.h"
48#include "TRandom.h"
49#include "TF1.h"
50
51class TH1;
52class TH2;
53class TGraph;
54class TPave;
55class TLatex;
56class TMarker;
57class TRandom3;
58class TObjArray;
59class TList;
60class TCanvas;
61class TSystem;
62class TROOT;
63class AliFlowVector;
64class TVector;
65
489d5531 66//================================================================================================================
67
489d5531 68ClassImp(AliFlowAnalysisWithQCumulants)
69
70AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
71 // 0.) base:
72 fHistList(NULL),
73 // 1.) common:
74 fCommonHists(NULL),
75 fCommonHists2nd(NULL),
76 fCommonHists4th(NULL),
77 fCommonHists6th(NULL),
78 fCommonHists8th(NULL),
79 fCommonHistsResults2nd(NULL),
80 fCommonHistsResults4th(NULL),
81 fCommonHistsResults6th(NULL),
82 fCommonHistsResults8th(NULL),
83 fnBinsPhi(0),
84 fPhiMin(0),
85 fPhiMax(0),
86 fPhiBinWidth(0),
87 fnBinsPt(0),
88 fPtMin(0),
89 fPtMax(0),
90 fPtBinWidth(0),
91 fnBinsEta(0),
92 fEtaMin(0),
93 fEtaMax(0),
94 fEtaBinWidth(0),
95 fHarmonic(2),
96 fAnalysisLabel(NULL),
97 // 2a.) particle weights:
98 fWeightsList(NULL),
99 fUsePhiWeights(kFALSE),
100 fUsePtWeights(kFALSE),
101 fUseEtaWeights(kFALSE),
102 fUseParticleWeights(NULL),
103 fPhiWeights(NULL),
104 fPtWeights(NULL),
105 fEtaWeights(NULL),
106 // 2b.) event weights:
107 fMultiplicityWeight(NULL),
108 // 3.) integrated flow:
109 fIntFlowList(NULL),
110 fIntFlowProfiles(NULL),
111 fIntFlowResults(NULL),
112 fIntFlowFlags(NULL),
b92ea2b9 113 fApplyCorrectionForNUA(kFALSE),
2001bc3a 114 fApplyCorrectionForNUAVsM(kFALSE),
9da1a4f3 115 fnBinsMult(10000),
067e9bc8 116 fMinMult(0.),
117 fMaxMult(10000.),
b77b6434 118 fPropagateErrorAlsoFromNIT(kFALSE),
b3dacf6b 119 fCalculateCumulantsVsM(kTRUE),
0dd3b008 120 fMinimumBiasReferenceFlow(kTRUE),
e5834fcb 121 fForgetAboutCovariances(kFALSE),
122 fStorePhiDistributionForOneEvent(kFALSE),
489d5531 123 fReQ(NULL),
124 fImQ(NULL),
125 fSMpk(NULL),
126 fIntFlowCorrelationsEBE(NULL),
127 fIntFlowEventWeightsForCorrelationsEBE(NULL),
128 fIntFlowCorrelationsAllEBE(NULL),
e5834fcb 129 fReferenceMultiplicityEBE(0.),
489d5531 130 fAvMultiplicity(NULL),
131 fIntFlowCorrelationsPro(NULL),
132 fIntFlowCorrelationsAllPro(NULL),
133 fIntFlowExtraCorrelationsPro(NULL),
134 fIntFlowProductOfCorrelationsPro(NULL),
0328db2d 135 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
489d5531 136 fIntFlowCorrelationsHist(NULL),
137 fIntFlowCorrelationsAllHist(NULL),
138 fIntFlowCovariances(NULL),
139 fIntFlowSumOfProductOfEventWeights(NULL),
0328db2d 140 fIntFlowCovariancesNUA(NULL),
141 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
489d5531 142 fIntFlowQcumulants(NULL),
b92ea2b9 143 fIntFlowQcumulantsRebinnedInM(NULL),
144 fIntFlowQcumulantsErrorSquaredRatio(NULL),
489d5531 145 fIntFlow(NULL),
b3dacf6b 146 fIntFlowRebinnedInM(NULL),
2001bc3a 147 fIntFlowDetectorBias(NULL),
489d5531 148 // 4.) differential flow:
149 fDiffFlowList(NULL),
150 fDiffFlowProfiles(NULL),
151 fDiffFlowResults(NULL),
152 fDiffFlowFlags(NULL),
153 fCalculate2DFlow(kFALSE),
154 // 5.) distributions:
57340a27 155 fDistributionsList(NULL),
156 fDistributionsFlags(NULL),
489d5531 157 fStoreDistributions(kFALSE),
e5834fcb 158 // 6.) various:
159 fVariousList(NULL),
160 fPhiDistributionForOneEvent(NULL),
489d5531 161 // x.) debugging and cross-checking:
162 fNestedLoopsList(NULL),
163 fEvaluateIntFlowNestedLoops(kFALSE),
164 fEvaluateDiffFlowNestedLoops(kFALSE),
165 fMaxAllowedMultiplicity(10),
166 fEvaluateNestedLoops(NULL),
167 fIntFlowDirectCorrelations(NULL),
168 fIntFlowExtraDirectCorrelations(NULL),
169 fCrossCheckInPtBinNo(10),
3b552efe 170 fCrossCheckInEtaBinNo(20),
489d5531 171 fNoOfParticlesInBin(NULL)
172 {
173 // constructor
174
175 // base list to hold all output objects:
176 fHistList = new TList();
177 fHistList->SetName("cobjQC");
178 fHistList->SetOwner(kTRUE);
179
180 // list to hold histograms with phi, pt and eta weights:
181 fWeightsList = new TList();
182
183 // multiplicity weight:
184 fMultiplicityWeight = new TString("combinations");
185
186 // analysis label;
187 fAnalysisLabel = new TString();
188
189 // initialize all arrays:
190 this->InitializeArraysForIntFlow();
191 this->InitializeArraysForDiffFlow();
192 this->InitializeArraysForDistributions();
e5834fcb 193 this->InitializeArraysForVarious();
489d5531 194 this->InitializeArraysForNestedLoops();
195
196 } // end of constructor
197
198
199//================================================================================================================
200
201
202AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
203{
204 // destructor
205
206 delete fHistList;
207
208} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
209
210
211//================================================================================================================
212
213
214void AliFlowAnalysisWithQCumulants::Init()
215{
3b552efe 216 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 217 // b) Access all common constants;
218 // c) Book all objects;
3b552efe 219 // d) Store flags for integrated and differential flow;
489d5531 220 // e) Store flags for distributions of corelations;
221 // f) Store harmonic which will be estimated.
3b552efe 222
489d5531 223 //save old value and prevent histograms from being added to directory
224 //to avoid name clashes in case multiple analaysis objects are used
225 //in an analysis
226 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
227 TH1::AddDirectory(kFALSE);
228
3b552efe 229 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 230 this->CrossCheckSettings();
231 // b) Access all common constants:
232 this->AccessConstants();
233 // c) Book all objects:
234 this->BookAndFillWeightsHistograms();
235 this->BookAndNestAllLists();
236 this->BookCommonHistograms();
237 this->BookEverythingForIntegratedFlow();
238 this->BookEverythingForDifferentialFlow();
239 this->BookEverythingForDistributions();
e5834fcb 240 this->BookEverythingForVarious();
489d5531 241 this->BookEverythingForNestedLoops();
242 // d) Store flags for integrated and differential flow:
243 this->StoreIntFlowFlags();
3b552efe 244 this->StoreDiffFlowFlags();
489d5531 245 // e) Store flags for distributions of corelations:
246 this->StoreFlagsForDistributions();
247 // f) Store harmonic which will be estimated:
248 this->StoreHarmonic();
249
250 TH1::AddDirectory(oldHistAddStatus);
251} // end of void AliFlowAnalysisWithQCumulants::Init()
252
253
254//================================================================================================================
255
256
257void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
258{
259 // Running over data only in this method.
260
b3dacf6b 261 // a) Check all pointers used in this method;
262 // b) Define local variables;
263 // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
264 // d) Loop over data and calculate e-b-e quantities;
265 // e) Call all the methods which calculate correlations for reference flow;
266 // f) Call all the methods which calculate correlations for differential flow;
267 // g) Distributions of correlations;
e5834fcb 268 // h) Store phi distribution for one event to illustrate flow;
269 // i) Debugging and cross-checking (evaluate nested loops);
270 // j) Reset all event-by-event quantities.
489d5531 271
b3dacf6b 272 // a) Check all pointers used in this method:
273 this->CheckPointersUsedInMake();
274
275 // b) Define local variables:
489d5531 276 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
277 Double_t dPt = 0.; // transverse momentum
278 Double_t dEta = 0.; // pseudorapidity
489d5531 279 Double_t wPhi = 1.; // phi weight
280 Double_t wPt = 1.; // pt weight
281 Double_t wEta = 1.; // eta weight
489d5531 282 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
e5834fcb 283 fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
9f33751d 284
b3dacf6b 285 // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
489d5531 286 this->FillCommonControlHistograms(anEvent);
287 this->FillAverageMultiplicities(nRP);
288
b3dacf6b 289 // d) Loop over data and calculate e-b-e quantities:
9f33751d 290 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
489d5531 291 // nRP = # of particles used to determine the reaction plane;
292 // nPOI = # of particles of interest for a detailed flow analysis;
489d5531 293
294 AliFlowTrackSimple *aftsTrack = NULL;
295
296 for(Int_t i=0;i<nPrim;i++)
297 {
298 aftsTrack=anEvent->GetTrack(i);
299 if(aftsTrack)
300 {
301 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
302 Int_t n = fHarmonic; // shortcut for the harmonic
303 if(aftsTrack->InRPSelection()) // RP condition:
304 {
305 dPhi = aftsTrack->Phi();
306 dPt = aftsTrack->Pt();
307 dEta = aftsTrack->Eta();
308 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
309 {
310 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
311 }
312 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
313 {
314 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
315 }
316 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
317 {
318 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
319 }
320
321 // integrated flow:
322 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
323 for(Int_t m=0;m<4;m++)
324 {
325 for(Int_t k=0;k<9;k++)
326 {
327 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
328 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
329 }
330 }
331 // calculate S^{M}_{p,k} for this event
332 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
333 for(Int_t p=0;p<8;p++)
334 {
335 for(Int_t k=0;k<9;k++)
336 {
337 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
338 }
339 }
340
341 // differential flow:
342 // 1D (pt):
343 // (r_{m*m,k}(pt)):
344 for(Int_t m=0;m<4;m++)
345 {
346 for(Int_t k=0;k<9;k++)
347 {
348 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
349 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
350 }
351 }
352
353 // s_{k}(pt) for RPs // to be improved (clarified)
354 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
355 for(Int_t k=0;k<9;k++)
356 {
357 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
358 }
359 // 1D (eta):
360 // (r_{m*m,k}(eta)):
361 for(Int_t m=0;m<4;m++)
362 {
363 for(Int_t k=0;k<9;k++)
364 {
365 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
366 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
367 }
368 }
369 // s_{k}(eta) for RPs // to be improved (clarified)
370 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
371 for(Int_t k=0;k<9;k++)
372 {
373 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
374 }
489d5531 375 // 2D (pt,eta):
376 if(fCalculate2DFlow)
377 {
378 // (r_{m*m,k}(pt,eta)):
379 for(Int_t m=0;m<4;m++)
380 {
381 for(Int_t k=0;k<9;k++)
382 {
383 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
384 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
385 }
386 }
387 // s_{k}(pt,eta) for RPs // to be improved (clarified)
388 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
389 for(Int_t k=0;k<9;k++)
390 {
391 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
392 }
393 } // end of if(fCalculate2DFlow)
489d5531 394
395 if(aftsTrack->InPOISelection())
396 {
397 // 1D (pt):
398 // (q_{m*m,k}(pt)):
399 for(Int_t m=0;m<4;m++)
400 {
401 for(Int_t k=0;k<9;k++)
402 {
403 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
404 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
405 }
406 }
407 // s_{k}(pt) for RP&&POIs // to be improved (clarified)
408 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
409 for(Int_t k=0;k<9;k++)
410 {
411 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
412 }
413 // 1D (eta):
414 // (q_{m*m,k}(eta)):
415 for(Int_t m=0;m<4;m++)
416 {
417 for(Int_t k=0;k<9;k++)
418 {
419 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
420 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
421 }
422 }
423 // s_{k}(eta) for RP&&POIs // to be improved (clarified)
424 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
425 for(Int_t k=0;k<9;k++)
426 {
427 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
b77b6434 428 }
489d5531 429 // 2D (pt,eta)
430 if(fCalculate2DFlow)
431 {
432 // (q_{m*m,k}(pt,eta)):
433 for(Int_t m=0;m<4;m++)
434 {
435 for(Int_t k=0;k<9;k++)
436 {
437 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
438 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
439 }
440 }
441 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
442 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
443 for(Int_t k=0;k<9;k++)
444 {
445 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
446 }
447 } // end of if(fCalculate2DFlow)
489d5531 448
b77b6434 449 } // end of if(aftsTrack->InPOISelection())
489d5531 450 } // end of if(pTrack->InRPSelection())
451
489d5531 452 if(aftsTrack->InPOISelection())
453 {
454 dPhi = aftsTrack->Phi();
455 dPt = aftsTrack->Pt();
456 dEta = aftsTrack->Eta();
457
458 // 1D (pt)
459 // p_n(m*n,0):
460 for(Int_t m=0;m<4;m++)
461 {
462 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
463 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
464 }
465 // 1D (eta)
466 // p_n(m*n,0):
467 for(Int_t m=0;m<4;m++)
468 {
469 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
470 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
471 }
489d5531 472 // 2D (pt,eta):
473 if(fCalculate2DFlow)
474 {
475 // p_n(m*n,0):
476 for(Int_t m=0;m<4;m++)
477 {
478 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
479 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
480 }
481 } // end of if(fCalculate2DFlow)
b77b6434 482 } // end of if(pTrack->InPOISelection())
483
489d5531 484 } else // to if(aftsTrack)
485 {
486 cout<<endl;
487 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
488 cout<<endl;
489 }
490 } // end of for(Int_t i=0;i<nPrim;i++)
491
492 // calculate the final expressions for S^{M}_{p,k}:
493 for(Int_t p=0;p<8;p++)
494 {
495 for(Int_t k=0;k<9;k++)
496 {
497 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
498 }
499 }
500
b3dacf6b 501 // e) Call all the methods which calculate correlations for reference flow:
489d5531 502 if(!fEvaluateIntFlowNestedLoops)
503 {
504 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
505 {
506 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights
0328db2d 507 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 508 {
509 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights
510 }
511
512 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();
513 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();
514 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();
b92ea2b9 515
516 // non-isotropic terms:
517 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 518 {
b92ea2b9 519 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();
520 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();
521 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
522 {
523 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();
524 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
525 }
0328db2d 526
b92ea2b9 527 if(nRP>0) this->CalculateIntFlowProductOfCorrectionTermsForNUA();
528 if(nRP>0) this->CalculateIntFlowSumOfEventWeightsNUA();
529 if(nRP>0) this->CalculateIntFlowSumOfProductOfEventWeightsNUA();
489d5531 530 } // end of if(!fEvaluateIntFlowNestedLoops)
531
b3dacf6b 532 // f) Call all the methods which calculate correlations for differential flow:
489d5531 533 if(!fEvaluateDiffFlowNestedLoops)
534 {
535 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
536 {
537 // without using particle weights:
538 this->CalculateDiffFlowCorrelations("RP","Pt");
539 this->CalculateDiffFlowCorrelations("RP","Eta");
540 this->CalculateDiffFlowCorrelations("POI","Pt");
57340a27 541 this->CalculateDiffFlowCorrelations("POI","Eta");
b92ea2b9 542 // non-isotropic terms:
543 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
544 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
545 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
546 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
547 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
548 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
549 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
550 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
489d5531 551 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
552 {
553 // with using particle weights:
554 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
555 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
556 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
557 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
b92ea2b9 558 // non-isotropic terms:
559 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
560 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
561 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
562 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
563 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
564 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
565 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
566 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
489d5531 567 }
57340a27 568
489d5531 569 // whether or not using particle weights the following is calculated in the same way:
570 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
571 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
572 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
573 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
574 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
575 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
576 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
577 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
578 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
579 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
580 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
581 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
582 } // end of if(!fEvaluateDiffFlowNestedLoops)
583
584
585
586 // with weights:
587 // ...
588
589 /*
590 // 2D differential flow
591 if(fCalculate2DFlow)
592 {
593 // without weights:
594 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
595 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
596
597 // with weights:
598 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
599 {
600 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
601 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
602 }
603 } // end of if(fCalculate2DFlow)
604 */
57340a27 605
e5834fcb 606 // g) Distributions of correlations:
607 if(fStoreDistributions){this->StoreDistributionsOfCorrelations();}
608
609 // h) Store phi distribution for one event to illustrate flow:
610 if(fStorePhiDistributionForOneEvent){this->StorePhiDistributionForOneEvent(anEvent);}
489d5531 611
b3dacf6b 612 // h) Debugging and cross-checking (evaluate nested loops):
613 // h1) cross-checking results for integrated flow:
489d5531 614 if(fEvaluateIntFlowNestedLoops)
615 {
616 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
617 {
618 // without using particle weights:
619 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
620 {
621 // correlations:
622 this->CalculateIntFlowCorrelations(); // from Q-vectors
623 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
624 // correction for non-uniform acceptance:
625 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
626 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
627 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
628 }
629 // using particle weights:
630 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
631 {
632 // correlations:
633 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
634 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
635 // correction for non-uniform acceptance:
636 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
637 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
57340a27 638 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
489d5531 639 }
640 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
641 {
642 cout<<endl;
643 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
644 } else
645 {
646 cout<<endl;
647 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
648 }
649 } // end of if(fEvaluateIntFlowNestedLoops)
650
b3dacf6b 651 // h2) cross-checking results for differential flow:
489d5531 652 if(fEvaluateDiffFlowNestedLoops)
653 {
654 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
655 {
656 // without using particle weights:
657 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
658 {
659 // reduced correlations:
660 // Q-vectors:
661 this->CalculateDiffFlowCorrelations("RP","Pt");
662 this->CalculateDiffFlowCorrelations("RP","Eta");
663 this->CalculateDiffFlowCorrelations("POI","Pt");
664 this->CalculateDiffFlowCorrelations("POI","Eta");
665 // nested loops:
666 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
667 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
668 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
669 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
670 // reduced corrections for non-uniform acceptance:
671 // Q-vectors:
672 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
673 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
674 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
675 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
676 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
677 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
678 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
679 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
680 // nested loops:
681 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
682 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
683 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
684 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
685 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
686 // using particle weights:
687 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
688 {
689 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
690 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
691 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
692 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
693 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
694 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
695 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
696 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
697 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
698 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
699 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
700 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
701 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
702 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
703 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
3b552efe 704 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
489d5531 705 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
706 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
707 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
708 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
709 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
710 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
711 } // end of if(fEvaluateDiffFlowNestedLoops)
712
b3dacf6b 713 // i) Reset all event-by-event quantities.
489d5531 714 this->ResetEventByEventQuantities();
715
716} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
717
489d5531 718//================================================================================================================================
719
489d5531 720void AliFlowAnalysisWithQCumulants::Finish()
721{
722 // Calculate the final results.
489d5531 723
b3dacf6b 724 // a) Check all pointers used in this method;
725 // b) Acces the constants;
726 // c) Access the flags;
b92ea2b9 727 // d) Calculate reference cumulants (not corrected for detector effects);
728 // e) Correct reference cumulants for detector effects;
729 // f) Calculate reference flow;
b77b6434 730 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
731
b92ea2b9 732
733
b92ea2b9 734 // h) Calculate the final results for differential flow (without/with weights);
735 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
736 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
737 // k) Store results for differential flow in AliFlowCommonHistResults;
738 // l) Print the final results for integrated flow (RP/POI) on the screen;
739 // m) Cross-checking: Results from Q-vectors vs results from nested loops.
b3dacf6b 740
741 // a) Check all pointers used in this method:
742 this->CheckPointersUsedInFinish();
743
744 // b) Acces the constants:
489d5531 745 this->AccessConstants();
746
b3dacf6b 747 if(fCommonHists && fCommonHists->GetHarmonic()) // to be improved (moved somewhere else)
489d5531 748 {
b3dacf6b 749 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
489d5531 750 }
b3dacf6b 751
752 // c) Access the flags: // to be improved (implement a method for this)
753 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
754 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
755 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
756 fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
757 fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
758 fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
759 fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
760 fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
761 fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
b77b6434 762 fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
0dd3b008 763 fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
764 fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
e5834fcb 765 fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
766 fStorePhiDistributionForOneEvent = (Bool_t)fIntFlowFlags->GetBinContent(13);
b3dacf6b 767 fEvaluateIntFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(1);
768 fEvaluateDiffFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(2);
489d5531 769 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
770 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
8e1cefdd 771
b92ea2b9 772 // d) Calculate reference cumulants (not corrected for detector effects):
489d5531 773 this->FinalizeCorrelationsIntFlow();
774 this->CalculateCovariancesIntFlow();
775 this->CalculateCumulantsIntFlow();
489d5531 776
b92ea2b9 777 // e) Correct reference cumulants for detector effects:
778 this->FinalizeCorrectionTermsForNUAIntFlow();
779 this->CalculateCovariancesNUAIntFlow();
780 this->CalculateQcumulantsCorrectedForNUAIntFlow();
781
782 // f) Calculate reference flow:
783 this->CalculateReferenceFlow();
489d5531 784
b77b6434 785 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
489d5531 786 this->FillCommonHistResultsIntFlow();
b3dacf6b 787 if(fPrintFinalResults[0]){this->PrintFinalResultsForIntegratedFlow("RF");}
788 if(fPrintFinalResults[3] && fCalculateCumulantsVsM){this->PrintFinalResultsForIntegratedFlow("RF, rebinned in M");}
489d5531 789
b77b6434 790
791
792
793
794
795
796
797
b3dacf6b 798 // g) Calculate the final results for differential flow (without/with weights):
489d5531 799 this->FinalizeReducedCorrelations("RP","Pt");
800 this->FinalizeReducedCorrelations("RP","Eta");
801 this->FinalizeReducedCorrelations("POI","Pt");
802 this->FinalizeReducedCorrelations("POI","Eta");
803 this->CalculateDiffFlowCovariances("RP","Pt");
804 this->CalculateDiffFlowCovariances("RP","Eta");
805 this->CalculateDiffFlowCovariances("POI","Pt");
806 this->CalculateDiffFlowCovariances("POI","Eta");
807 this->CalculateDiffFlowCumulants("RP","Pt");
808 this->CalculateDiffFlowCumulants("RP","Eta");
809 this->CalculateDiffFlowCumulants("POI","Pt");
810 this->CalculateDiffFlowCumulants("POI","Eta");
811 this->CalculateDiffFlow("RP","Pt");
812 this->CalculateDiffFlow("RP","Eta");
813 this->CalculateDiffFlow("POI","Pt");
814 this->CalculateDiffFlow("POI","Eta");
815
b3dacf6b 816 // h) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
817 if(fApplyCorrectionForNUA)
489d5531 818 {
819 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
820 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
821 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
822 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
823 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
824 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
825 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
826 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
827 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
828 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
829 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
830 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
3b552efe 831 }
489d5531 832
b3dacf6b 833 // i) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
489d5531 834 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
835 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
836
b3dacf6b 837 // j) Store results for differential flow in AliFlowCommonHistResults:
489d5531 838 this->FillCommonHistResultsDiffFlow("RP");
839 this->FillCommonHistResultsDiffFlow("POI");
840
b3dacf6b 841 // k) Print the final results for integrated flow (RP/POI) on the screen:
842 if(fPrintFinalResults[1]){this->PrintFinalResultsForIntegratedFlow("RP");}
843 if(fPrintFinalResults[2]){this->PrintFinalResultsForIntegratedFlow("POI");}
844
845 // l) Cross-checking: Results from Q-vectors vs results from nested loops:
846 // l1) Reference flow:
489d5531 847 if(fEvaluateIntFlowNestedLoops)
848 {
849 this->CrossCheckIntFlowCorrelations();
850 this->CrossCheckIntFlowCorrectionTermsForNUA();
851 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations();
852 } // end of if(fEvaluateIntFlowNestedLoops)
853
b3dacf6b 854 // l2) Differential flow:
489d5531 855 if(fEvaluateDiffFlowNestedLoops)
856 {
b3dacf6b 857 // Correlations:
489d5531 858 this->PrintNumberOfParticlesInSelectedBin();
859 this->CrossCheckDiffFlowCorrelations("RP","Pt");
860 this->CrossCheckDiffFlowCorrelations("RP","Eta");
861 this->CrossCheckDiffFlowCorrelations("POI","Pt");
862 this->CrossCheckDiffFlowCorrelations("POI","Eta");
b3dacf6b 863 // Correction terms for non-uniform acceptance:
489d5531 864 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
865 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
866 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
867 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
868 } // end of if(fEvaluateDiffFlowNestedLoops)
869
870} // end of AliFlowAnalysisWithQCumulants::Finish()
871
489d5531 872//================================================================================================================================
873
489d5531 874void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
875{
b92ea2b9 876 // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
489d5531 877
878 // multiplicity:
879 Double_t dMult = (*fSMpk)(0,0);
880
881 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
882 Double_t dReQ1n = (*fReQ)(0,0);
883 Double_t dReQ2n = (*fReQ)(1,0);
884 //Double_t dReQ3n = (*fReQ)(2,0);
885 //Double_t dReQ4n = (*fReQ)(3,0);
886 Double_t dImQ1n = (*fImQ)(0,0);
887 Double_t dImQ2n = (*fImQ)(1,0);
888 //Double_t dImQ3n = (*fImQ)(2,0);
889 //Double_t dImQ4n = (*fImQ)(3,0);
890
891 // *************************************************************
892 // **** corrections for non-uniform acceptance (cos terms): ****
893 // *************************************************************
894 //
895 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
896 // are stored in 1D profile fQCorrectionsCos.
897 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
898 // --------------------------------------------------------------------------------------------------------------------
899 // 1st bin: <<cos(n*(phi1))>> = cosP1n
900 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
901 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
902 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
903 // --------------------------------------------------------------------------------------------------------------------
904
905 // 1-particle:
906 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
907
908 if(dMult>0)
909 {
910 cosP1n = dReQ1n/dMult;
911
912 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
913 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
0328db2d 914 // event weights for NUA terms:
915 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
489d5531 916
917 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
918 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
b3dacf6b 919 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);}
489d5531 920 }
921
922 // 2-particle:
3b552efe 923 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
489d5531 924 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
925
926 if(dMult>1)
927 {
928 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
929 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
930
931 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
3b552efe 932 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
489d5531 933 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
0328db2d 934 // event weights for NUA terms:
935 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
936 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
937
489d5531 938 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
3b552efe 939 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
489d5531 940 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
b3dacf6b 941 if(fCalculateCumulantsVsM)
942 {
943 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
944 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
945 }
489d5531 946 }
947
948 // 3-particle:
949 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
950
951 if(dMult>2)
952 {
953 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
954 / (dMult*(dMult-1)*(dMult-2));
955
956 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
957 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
0328db2d 958 // event weights for NUA terms:
959 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 960
961 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
2001bc3a 962 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 963 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 964 }
965
966} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
967
968
969//================================================================================================================================
970
971
972void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
973{
974 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
975
976 // multiplicity:
977 Double_t dMult = (*fSMpk)(0,0);
978
979 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
980 Double_t dReQ1n = (*fReQ)(0,0);
981 Double_t dReQ2n = (*fReQ)(1,0);
982 //Double_t dReQ3n = (*fReQ)(2,0);
983 //Double_t dReQ4n = (*fReQ)(3,0);
984 Double_t dImQ1n = (*fImQ)(0,0);
985 Double_t dImQ2n = (*fImQ)(1,0);
986 //Double_t dImQ3n = (*fImQ)(2,0);
987 //Double_t dImQ4n = (*fImQ)(3,0);
988
989 // *************************************************************
990 // **** corrections for non-uniform acceptance (sin terms): ****
991 // *************************************************************
992 //
993 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
994 // are stored in 1D profile fQCorrectionsSin.
995 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
996 // --------------------------------------------------------------------------------------------------------------------
997 // 1st bin: <<sin(n*(phi1))>> = sinP1n
998 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
999 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1000 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1001 // --------------------------------------------------------------------------------------------------------------------
1002
1003 // 1-particle:
1004 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1005
1006 if(dMult>0)
1007 {
1008 sinP1n = dImQ1n/dMult;
1009
1010 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
0328db2d 1011 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1012 // event weights for NUA terms:
1013 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
489d5531 1014
1015 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1016 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
b3dacf6b 1017 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);}
489d5531 1018 }
1019
1020 // 2-particle:
1021 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1022 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1023 if(dMult>1)
1024 {
3b552efe 1025 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
489d5531 1026 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1027
1028 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1029 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
3b552efe 1030 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
0328db2d 1031 // event weights for NUA terms:
1032 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1033 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
489d5531 1034
1035 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1036 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1037 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
b3dacf6b 1038 if(fCalculateCumulantsVsM)
1039 {
1040 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1041 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
1042 }
489d5531 1043 }
1044
1045 // 3-particle:
1046 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1047
1048 if(dMult>2)
1049 {
1050 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1051 / (dMult*(dMult-1)*(dMult-2));
1052
1053 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1054 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
0328db2d 1055 // event weights for NUA terms:
1056 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1057
1058 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
2001bc3a 1059 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 1060 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 1061 }
1062
1063} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1064
1065
1066//================================================================================================================================
1067
1068
1069void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1070{
1071 // a) Get pointers for common control and common result histograms and profiles.
1072 // b) Get pointers for histograms with particle weights.
1073 // c) Get pointers for histograms and profiles relevant for integrated flow.
1074 // d) Get pointers for histograms and profiles relevant for differental flow.
1075 // e) Get pointers for histograms and profiles holding results obtained with nested loops.
1076
1077 if(outputListHistos)
3b552efe 1078 {
1079 this->SetHistList(outputListHistos);
1080 if(!fHistList)
1081 {
1082 cout<<endl;
1083 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1084 cout<<endl;
1085 exit(0);
489d5531 1086 }
1087 this->GetPointersForCommonHistograms();
1088 this->GetPointersForParticleWeightsHistograms();
1089 this->GetPointersForIntFlowHistograms();
1090 this->GetPointersForDiffFlowHistograms();
1091 this->GetPointersForNestedLoopsHistograms();
3b552efe 1092 } else
1093 {
1094 cout<<endl;
1095 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1096 cout<<endl;
1097 exit(0);
489d5531 1098 }
1099
1100} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
ad87ae62 1101
1102
489d5531 1103//================================================================================================================================
1104
1105
1106TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
ad87ae62 1107{
489d5531 1108 // project 2D profile onto pt axis to get 1D profile
1109
1110 Int_t nBinsPt = profilePtEta->GetNbinsX();
1111 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1112 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1113
1114 Int_t nBinsEta = profilePtEta->GetNbinsY();
1115
1116 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1117
1118 for(Int_t p=1;p<=nBinsPt;p++)
1119 {
1120 Double_t contentPt = 0.;
1121 Double_t entryPt = 0.;
1122 Double_t spreadPt = 0.;
1123 Double_t sum1 = 0.;
1124 Double_t sum2 = 0.;
1125 Double_t sum3 = 0.;
1126 for(Int_t e=1;e<=nBinsEta;e++)
1127 {
1128 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1129 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1130 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1131
1132 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1133 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1134 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1135 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1136 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1137 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1138 }
1139 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1140 {
1141 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1142 }
1143 profilePt->SetBinContent(p,contentPt);
1144 profilePt->SetBinEntries(p,entryPt);
1145 {
1146 profilePt->SetBinError(p,spreadPt);
1147 }
1148
1149 }
1150
1151 return profilePt;
1152
1153} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1154
1155
1156//================================================================================================================================
1157
1158
1159TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1160{
1161 // project 2D profile onto eta axis to get 1D profile
1162
1163 Int_t nBinsEta = profilePtEta->GetNbinsY();
1164 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1165 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1166
1167 Int_t nBinsPt = profilePtEta->GetNbinsX();
1168
1169 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1170
1171 for(Int_t e=1;e<=nBinsEta;e++)
1172 {
1173 Double_t contentEta = 0.;
1174 Double_t entryEta = 0.;
1175 for(Int_t p=1;p<=nBinsPt;p++)
1176 {
1177 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1178 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1179 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1180 }
1181 profileEta->SetBinContent(e,contentEta);
1182 profileEta->SetBinEntries(e,entryEta);
1183 }
1184
1185 return profileEta;
1186
1187} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1188
489d5531 1189//================================================================================================================================
1190
489d5531 1191void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1192{
2001bc3a 1193 // Printing on the screen the final results for integrated flow (RF, POI and RP).
489d5531 1194
1195 Int_t n = fHarmonic;
1196
489d5531 1197 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1198 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1199
2001bc3a 1200 if(type == "RF")
489d5531 1201 {
0dd3b008 1202 for(Int_t b=0;b<4;b++)
1203 {
b77b6434 1204 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1205 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1206 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1207 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1208 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1209 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1210 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1211 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
0dd3b008 1212 }
489d5531 1213 } else if(type == "RP")
1214 {
1215 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1216 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1217 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1218 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1219 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1220 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1221 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1222 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1223 } else if(type == "POI")
1224 {
1225 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1226 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1227 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1228 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1229 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1230 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1231 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1232 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
b77b6434 1233 } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
b3dacf6b 1234 {
0dd3b008 1235 for(Int_t b=0;b<4;b++)
1236 {
1237 dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
1238 dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
1239 }
b3dacf6b 1240 }
489d5531 1241
1242 TString title = " flow estimates from Q-cumulants";
1243 TString subtitle = " (";
b3dacf6b 1244 TString subtitle2 = " (rebinned in M)";
489d5531 1245
b3dacf6b 1246 if(type != "RF, rebinned in M")
489d5531 1247 {
b3dacf6b 1248 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1249 {
1250 subtitle.Append(type);
1251 subtitle.Append(", without weights)");
1252 } else
1253 {
1254 subtitle.Append(type);
1255 subtitle.Append(", with weights)");
1256 }
1257 } else
489d5531 1258 {
b3dacf6b 1259 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1260 {
1261 subtitle.Append("RF");
1262 subtitle.Append(", without weights)");
1263 } else
1264 {
1265 subtitle.Append("RF");
1266 subtitle.Append(", with weights)");
1267 }
1268 }
1269
489d5531 1270 cout<<endl;
1271 cout<<"*************************************"<<endl;
1272 cout<<"*************************************"<<endl;
1273 cout<<title.Data()<<endl;
1274 cout<<subtitle.Data()<<endl;
b3dacf6b 1275 if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
489d5531 1276 cout<<endl;
1277
1278 for(Int_t i=0;i<4;i++)
1279 {
2001bc3a 1280 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
489d5531 1281 }
2001bc3a 1282
489d5531 1283 cout<<endl;
b92ea2b9 1284 if(type == "RF")
1285 {
b77b6434 1286 if(fApplyCorrectionForNUA)
1287 {
1288 cout<<" detector bias (corrected for): "<<endl;
1289 } else
1290 {
1291 cout<<" detector bias (not corrected for):"<<endl;
1292 }
b92ea2b9 1293 cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
1294 cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
1295 cout<<endl;
1296 }
b3dacf6b 1297 if(type == "RF" || type == "RF, rebinned in M")
489d5531 1298 {
2001bc3a 1299 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1300 }
1301 else if (type == "RP")
1302 {
2001bc3a 1303 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1304 }
1305 else if (type == "POI")
1306 {
2001bc3a 1307 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1308 }
1309
489d5531 1310 cout<<"*************************************"<<endl;
1311 cout<<"*************************************"<<endl;
1312 cout<<endl;
1313
2001bc3a 1314}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
489d5531 1315
1316//================================================================================================================================
1317
489d5531 1318void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1319{
1320 //store the final results in output .root file
1321 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1322 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1323 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1324 delete output;
1325}
1326
1327
1328//================================================================================================================================
1329
1330
1331void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1332{
1333 //store the final results in output .root file
1334 fHistList->SetName("cobjQC");
1335 fHistList->SetOwner(kTRUE);
1336 outputFileName->Add(fHistList);
1337 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1338}
1339
1340
1341//================================================================================================================================
1342
1343
1344void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1345{
1346 // Book common control histograms and common histograms for final results.
1347 // common control histogram (ALL events)
1348 TString commonHistsName = "AliFlowCommonHistQC";
1349 commonHistsName += fAnalysisLabel->Data();
1350 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1351 fHistList->Add(fCommonHists);
1352 // common control histogram (for events with 2 and more particles)
1353 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1354 commonHists2ndOrderName += fAnalysisLabel->Data();
1355 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1356 fHistList->Add(fCommonHists2nd);
1357 // common control histogram (for events with 4 and more particles)
1358 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1359 commonHists4thOrderName += fAnalysisLabel->Data();
1360 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1361 fHistList->Add(fCommonHists4th);
1362 // common control histogram (for events with 6 and more particles)
1363 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1364 commonHists6thOrderName += fAnalysisLabel->Data();
1365 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1366 fHistList->Add(fCommonHists6th);
1367 // common control histogram (for events with 8 and more particles)
1368 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1369 commonHists8thOrderName += fAnalysisLabel->Data();
1370 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1371 fHistList->Add(fCommonHists8th);
1372 // common histograms for final results (calculated for events with 2 and more particles)
1373 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1374 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1375 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1376 fHistList->Add(fCommonHistsResults2nd);
1377 // common histograms for final results (calculated for events with 4 and more particles)
1378 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1379 commonHistResults4thOrderName += fAnalysisLabel->Data();
1380 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1381 fHistList->Add(fCommonHistsResults4th);
1382 // common histograms for final results (calculated for events with 6 and more particles)
1383 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1384 commonHistResults6thOrderName += fAnalysisLabel->Data();
1385 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1386 fHistList->Add(fCommonHistsResults6th);
1387 // common histograms for final results (calculated for events with 8 and more particles)
1388 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1389 commonHistResults8thOrderName += fAnalysisLabel->Data();
1390 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1391 fHistList->Add(fCommonHistsResults8th);
1392
1393} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1394
1395
1396//================================================================================================================================
1397
1398
1399void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1400{
1401 // book and fill histograms which hold phi, pt and eta weights
1402
1403 if(!fWeightsList)
1404 {
1405 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1406 exit(0);
1407 }
1408
1409 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1410 fUseParticleWeightsName += fAnalysisLabel->Data();
1411 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1412 fUseParticleWeights->SetLabelSize(0.06);
1413 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1414 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1415 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1416 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1417 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1418 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1419 fWeightsList->Add(fUseParticleWeights);
1420
1421 if(fUsePhiWeights)
1422 {
1423 if(fWeightsList->FindObject("phi_weights"))
1424 {
1425 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1426 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1427 {
1428 cout<<endl;
1429 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1430 cout<<endl;
6fbbbbf1 1431 //exit(0);
489d5531 1432 }
1433 } else
1434 {
1435 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1436 exit(0);
1437 }
1438 } // end of if(fUsePhiWeights)
1439
1440 if(fUsePtWeights)
1441 {
1442 if(fWeightsList->FindObject("pt_weights"))
1443 {
1444 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1445 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1446 {
1447 cout<<endl;
1448 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1449 cout<<endl;
6fbbbbf1 1450 //exit(0);
489d5531 1451 }
1452 } else
1453 {
1454 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1455 exit(0);
1456 }
1457 } // end of if(fUsePtWeights)
1458
1459 if(fUseEtaWeights)
1460 {
1461 if(fWeightsList->FindObject("eta_weights"))
1462 {
1463 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1464 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1465 {
1466 cout<<endl;
1467 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1468 cout<<endl;
6fbbbbf1 1469 //exit(0);
489d5531 1470 }
1471 } else
1472 {
1473 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1474 exit(0);
1475 }
1476 } // end of if(fUseEtaWeights)
1477
1478} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1479
1480
1481//================================================================================================================================
1482
1483
1484void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1485{
1486 // Book all objects for integrated flow:
e5834fcb 1487 // a) Book profile to hold all flags for integrated flow;
1488 // b) Book event-by-event quantities;
1489 // c) Book profiles; // to be improved (comment)
489d5531 1490 // d) Book histograms holding the final results.
1491
1492 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1493 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1494
1495 // a) Book profile to hold all flags for integrated flow:
1496 TString intFlowFlagsName = "fIntFlowFlags";
1497 intFlowFlagsName += fAnalysisLabel->Data();
e5834fcb 1498 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",13,0,13);
489d5531 1499 fIntFlowFlags->SetTickLength(-0.01,"Y");
1500 fIntFlowFlags->SetMarkerStyle(25);
1501 fIntFlowFlags->SetLabelSize(0.05);
1502 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1503 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1504 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1505 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
b3dacf6b 1506 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
489d5531 1507 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
3b552efe 1508 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
b3dacf6b 1509 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
1510 fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
1511 fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
1512 fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
0dd3b008 1513 fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
8e1cefdd 1514 fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
e5834fcb 1515 fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStorePhiDistributionForOneEvent");
489d5531 1516 fIntFlowList->Add(fIntFlowFlags);
1517
1518 // b) Book event-by-event quantities:
1519 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1520 fReQ = new TMatrixD(4,9);
1521 fImQ = new TMatrixD(4,9);
1522 fSMpk = new TMatrixD(8,9);
1523 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1524 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1525 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1526 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1527 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1528 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1529 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1530 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1531 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1532 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1533 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1534 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);
1535 // average correction terms for non-uniform acceptance for single event
1536 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1537 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1538 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1539 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1540 {
b92ea2b9 1541 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 1542 }
0328db2d 1543 // event weights for terms for non-uniform acceptance:
1544 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1545 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1546 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1547 {
b92ea2b9 1548 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 1549 }
489d5531 1550 // c) Book profiles: // to be improved (comment)
1551 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1552 TString avMultiplicityName = "fAvMultiplicity";
1553 avMultiplicityName += fAnalysisLabel->Data();
1554 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1555 fAvMultiplicity->SetTickLength(-0.01,"Y");
1556 fAvMultiplicity->SetMarkerStyle(25);
1557 fAvMultiplicity->SetLabelSize(0.05);
1558 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1559 fAvMultiplicity->SetYTitle("Average Multiplicity");
1560 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1561 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1562 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1563 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1564 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1565 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1566 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1567 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1568 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1569 fIntFlowProfiles->Add(fAvMultiplicity);
1570 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
b3dacf6b 1571 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"};
489d5531 1572 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1573 intFlowCorrelationsProName += fAnalysisLabel->Data();
1574 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1575 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1576 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1577 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1578 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 1579 for(Int_t b=0;b<4;b++)
b3dacf6b 1580 {
68a3b4b1 1581 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
b3dacf6b 1582 }
489d5531 1583 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
b3dacf6b 1584 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
1585 if(fCalculateCumulantsVsM)
1586 {
1587 for(Int_t ci=0;ci<4;ci++) // correlation index
1588 {
1589 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1590 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1591 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1592 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1593 fnBinsMult,fMinMult,fMaxMult,"s");
1594 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1595 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1596 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
1597 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1598 } // end of if(fCalculateCumulantsVsM)
489d5531 1599 // averaged all correlations for all events (with wrong errors!):
1600 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1601 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1602 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");
1603 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1604 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1605 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1606 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1607 // 2-p correlations:
1608 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1609 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1610 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1611 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1612 // 3-p correlations:
1613 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1614 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1615 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1616 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1617 // 4-p correlations:
1618 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1619 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1620 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1621 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1622 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1623 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1624 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1625 // 5-p correlations:
1626 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1627 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1628 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1629 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1630 // 6-p correlations:
1631 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1632 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1633 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1634 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1635 // 7-p correlations:
1636 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1637 // 8-p correlations:
1638 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1639 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1640 // when particle weights are used some extra correlations appear:
1641 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1642 {
1643 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1644 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1645 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1646 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1647 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1648 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1649 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1650 // extra 2-p correlations:
1651 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1652 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1653 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1654 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1655 // average product of correlations <2>, <4>, <6> and <8>:
b3dacf6b 1656 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
489d5531 1657 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1658 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1659 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1660 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1661 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1662 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1663 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 1664 for(Int_t b=0;b<6;b++)
b3dacf6b 1665 {
68a3b4b1 1666 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
b3dacf6b 1667 }
1668 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
ff70ca91 1669 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1670 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 1671 if(fCalculateCumulantsVsM)
1672 {
1673 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1674 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1675 for(Int_t pi=0;pi<6;pi++)
1676 {
1677 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1678 Form("%s versus multiplicity",productFlag[pi].Data()),
1679 fnBinsMult,fMinMult,fMaxMult);
1680 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1681 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1682 } // end of for(Int_t pi=0;pi<6;pi++)
1683 } // end of if(fCalculateCumulantsVsM)
0328db2d 1684 // average product of correction terms for NUA:
1685 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1686 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1687 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1688 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1689 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1690 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1691 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1692 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1693 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1694 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1695 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1696 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1697 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1698 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1699 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1700 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1701 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1702 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1703 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1704 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1705 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1706 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1707 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1708 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1709 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1710 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1711 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1712 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1713 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1714 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1715 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1716 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1717 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1718 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1719 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
489d5531 1720 // average correction terms for non-uniform acceptance (with wrong errors!):
1721 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1722 {
1723 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1724 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b92ea2b9 1725 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 1726 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1727 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1728 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1729 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
b92ea2b9 1730 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(phi1))#GT#GT",sinCosFlag[sc].Data()));
1731 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1732 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1733 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
489d5531 1734 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
2001bc3a 1735 // versus multiplicity:
b3dacf6b 1736 if(fCalculateCumulantsVsM)
1737 {
1738 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
1739 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
1740 {
1741 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
1742 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
1743 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");
1744 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
1745 }
1746 } // end of if(fCalculateCumulantsVsM)
489d5531 1747 } // end of for(Int_t sc=0;sc<2;sc++)
1748
1749 // d) Book histograms holding the final results:
1750 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1751 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1752 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1753 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1754 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1755 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1756 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1757 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1758 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1759 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1760 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1761 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1762 fIntFlowResults->Add(fIntFlowCorrelationsHist);
ff70ca91 1763 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
b3dacf6b 1764 if(fCalculateCumulantsVsM)
1765 {
1766 for(Int_t ci=0;ci<4;ci++) // correlation index
1767 {
1768 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1769 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1770 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1771 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1772 fnBinsMult,fMinMult,fMaxMult);
1773 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1774 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1775 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1776 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1777 } // end of if(fCalculateCumulantsVsM)
489d5531 1778 // average all correlations for all events (with correct errors!):
1779 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1780 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
1781 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);
1782 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1783 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1784 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1785 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1786 // 2-p correlations:
1787 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1788 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1789 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1790 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1791 // 3-p correlations:
1792 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1793 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1794 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1795 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1796 // 4-p correlations:
1797 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1798 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1799 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1800 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1801 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1802 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1803 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1804 // 5-p correlations:
1805 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1806 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1807 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1808 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1809 // 6-p correlations:
1810 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1811 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1812 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1813 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1814 // 7-p correlations:
1815 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1816 // 8-p correlations:
1817 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1818 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1819 // average correction terms for non-uniform acceptance (with correct errors!):
1820 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1821 {
1822 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1823 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
b92ea2b9 1824 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 1825 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1826 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1827 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1828 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
b92ea2b9 1829 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
1830 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1831 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1832 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
489d5531 1833 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1834 } // end of for(Int_t sc=0;sc<2;sc++)
1835 // covariances (multiplied with weight dependent prefactor):
1836 TString intFlowCovariancesName = "fIntFlowCovariances";
1837 intFlowCovariancesName += fAnalysisLabel->Data();
1838 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1839 fIntFlowCovariances->SetLabelSize(0.04);
1840 fIntFlowCovariances->SetMarkerStyle(25);
1841 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1842 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1843 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1844 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1845 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1846 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1847 fIntFlowResults->Add(fIntFlowCovariances);
1848 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1849 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1850 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1851 for(Int_t power=0;power<2;power++)
1852 {
1853 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);
1854 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1855 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1856 if(power == 0)
1857 {
1858 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1859 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1860 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1861 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1862 } else if (power == 1)
1863 {
1864 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1865 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1866 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1867 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1868 }
1869 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1870 }
1871 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1872 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1873 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1874 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1875 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1876 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1877 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1878 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1879 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1880 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1881 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1882 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1883 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
ff70ca91 1884 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1885 // [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 1886 if(fCalculateCumulantsVsM)
ff70ca91 1887 {
b3dacf6b 1888 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1889 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1890 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1891 for(Int_t ci=0;ci<6;ci++)
1892 {
1893 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1894 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
1895 fnBinsMult,fMinMult,fMaxMult);
1896 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1897 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1898 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1899 }
1900 } // end of if(fCalculateCumulantsVsM)
ff70ca91 1901 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1902 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
b3dacf6b 1903 if(fCalculateCumulantsVsM)
ff70ca91 1904 {
b3dacf6b 1905 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1906 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1907 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>}"},
1908 {"#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}"}};
1909 for(Int_t si=0;si<4;si++)
ff70ca91 1910 {
b3dacf6b 1911 for(Int_t power=0;power<2;power++)
1912 {
1913 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1914 Form("%s vs multiplicity",sumFlag[power][si].Data()),
1915 fnBinsMult,fMinMult,fMaxMult);
1916 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1917 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1918 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1919 } // end of for(Int_t power=0;power<2;power++)
1920 } // end of for(Int_t si=0;si<4;si++)
1921 } // end of if(fCalculateCumulantsVsM)
ff70ca91 1922 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1923 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1924 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 1925 if(fCalculateCumulantsVsM)
1926 {
1927 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1928 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1929 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>}",
1930 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1931 for(Int_t pi=0;pi<6;pi++)
1932 {
1933 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1934 Form("%s versus multiplicity",sopowFlag[pi].Data()),
1935 fnBinsMult,fMinMult,fMaxMult);
1936 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1937 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1938 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1939 } // end of for(Int_t pi=0;pi<6;pi++)
1940 } // end of if(fCalculateCumulantsVsM)
0328db2d 1941 // covariances of NUA terms (multiplied with weight dependent prefactor):
1942 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1943 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1944 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1945 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1946 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1947 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1948 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1949 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1950 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1951 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1952 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1953 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1954 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1955 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1956 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1957 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1958 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1959 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1960 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1961 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1962 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1963 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1964 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1965 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1966 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1967 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1968 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1969 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1970 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1971 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1972 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1973 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1974 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1975 fIntFlowResults->Add(fIntFlowCovariancesNUA);
1976 // sum of linear and quadratic event weights for NUA terms:
1977 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
1978 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
1979 for(Int_t sc=0;sc<2;sc++)
1980 {
1981 for(Int_t power=0;power<2;power++)
1982 {
b92ea2b9 1983 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 1984 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
1985 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
1986 if(power == 0)
1987 {
1988 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
1989 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
b92ea2b9 1990 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
1991 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
0328db2d 1992 } else if(power == 1)
1993 {
1994 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
1995 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
1996 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
b92ea2b9 1997 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
0328db2d 1998 }
1999 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
2000 }
2001 }
2002 // sum of products of event weights for NUA terms:
2003 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
2004 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
2005 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
2006 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
2007 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
2008 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
2009 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
2010 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
2011 // ....
2012 // to be improved - add labels for remaining bins
2013 // ....
2014 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
b3dacf6b 2015 // Final results for reference Q-cumulants:
2016 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
489d5531 2017 TString intFlowQcumulantsName = "fIntFlowQcumulants";
2018 intFlowQcumulantsName += fAnalysisLabel->Data();
b92ea2b9 2019 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
b77b6434 2020 if(fPropagateErrorAlsoFromNIT)
b92ea2b9 2021 {
b77b6434 2022 fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
b92ea2b9 2023 }
489d5531 2024 fIntFlowQcumulants->SetLabelSize(0.05);
2025 fIntFlowQcumulants->SetMarkerStyle(25);
68a3b4b1 2026 for(Int_t b=0;b<4;b++)
b3dacf6b 2027 {
68a3b4b1 2028 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2029 }
489d5531 2030 fIntFlowResults->Add(fIntFlowQcumulants);
b3dacf6b 2031 // Final results for reference Q-cumulants rebinned in M:
2032 if(fCalculateCumulantsVsM)
2033 {
2034 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
2035 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
2036 fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
2037 fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
2038 fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2039 for(Int_t b=0;b<4;b++)
b3dacf6b 2040 {
68a3b4b1 2041 (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2042 }
2043 fIntFlowResults->Add(fIntFlowQcumulantsRebinnedInM);
2044 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 2045 // Ratio between error squared: with/without non-isotropic terms:
2046 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
2047 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
2048 fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
2049 fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
2050 fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
2051 for(Int_t b=0;b<4;b++)
2052 {
2053 (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2054 }
2055 fIntFlowResults->Add(fIntFlowQcumulantsErrorSquaredRatio);
ff70ca91 2056 // final results for integrated Q-cumulants versus multiplicity:
b3dacf6b 2057 if(fCalculateCumulantsVsM)
2058 {
2059 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
2060 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2061 for(Int_t co=0;co<4;co++) // cumulant order
2062 {
2063 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2064 Form("%s vs multipicity",cumulantFlag[co].Data()),
2065 fnBinsMult,fMinMult,fMaxMult);
2066 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2067 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2068 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2069 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2070 } // end of if(fCalculateCumulantsVsM)
489d5531 2071 // final integrated flow estimates from Q-cumulants:
b3dacf6b 2072 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 2073 TString intFlowName = "fIntFlow";
2074 intFlowName += fAnalysisLabel->Data();
2075 // integrated flow from Q-cumulants:
b3dacf6b 2076 fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
489d5531 2077 fIntFlow->SetLabelSize(0.05);
2078 fIntFlow->SetMarkerStyle(25);
68a3b4b1 2079 for(Int_t b=0;b<4;b++)
b3dacf6b 2080 {
68a3b4b1 2081 (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2082 }
ff70ca91 2083 fIntFlowResults->Add(fIntFlow);
b3dacf6b 2084 // Reference flow vs M rebinned in one huge bin:
2085 if(fCalculateCumulantsVsM)
2086 {
2087 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
2088 intFlowRebinnedInMName += fAnalysisLabel->Data();
2089 fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
2090 fIntFlowRebinnedInM->SetLabelSize(0.05);
2091 fIntFlowRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2092 for(Int_t b=0;b<4;b++)
b3dacf6b 2093 {
68a3b4b1 2094 (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2095 }
2096 fIntFlowResults->Add(fIntFlowRebinnedInM);
2097 }
ff70ca91 2098 // integrated flow from Q-cumulants: versus multiplicity:
b3dacf6b 2099 if(fCalculateCumulantsVsM)
2100 {
2101 TString intFlowVsMName = "fIntFlowVsM";
2102 intFlowVsMName += fAnalysisLabel->Data();
2103 for(Int_t co=0;co<4;co++) // cumulant order
2104 {
2105 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2106 Form("%s vs multipicity",flowFlag[co].Data()),
2107 fnBinsMult,fMinMult,fMaxMult);
2108 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2109 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2110 fIntFlowResults->Add(fIntFlowVsM[co]);
2111 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2112 } // end of if(fCalculateCumulantsVsM)
2001bc3a 2113 // quantifying detector effects effects to correlations:
2114 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2115 intFlowDetectorBiasName += fAnalysisLabel->Data();
2116 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2117 fIntFlowDetectorBias->SetLabelSize(0.05);
2118 fIntFlowDetectorBias->SetMarkerStyle(25);
2119 for(Int_t ci=0;ci<4;ci++)
2120 {
2121 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2122 }
2123 fIntFlowResults->Add(fIntFlowDetectorBias);
2124 // quantifying detector effects to correlations versus multiplicity:
b3dacf6b 2125 if(fCalculateCumulantsVsM)
2001bc3a 2126 {
b3dacf6b 2127 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2128 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2129 for(Int_t ci=0;ci<4;ci++) // correlation index
2130 {
2131 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2132 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2133 fnBinsMult,fMinMult,fMaxMult);
2134 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2135 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
b77b6434 2136 fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);
b3dacf6b 2137 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2138 } // end of if(fCalculateCumulantsVsM)
2139
489d5531 2140 /* // to be improved (removed):
2141 // final average weighted multi-particle correlations for all events calculated from Q-vectors
2142 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
2143 fQCorrelations[1]->SetTickLength(-0.01,"Y");
2144 fQCorrelations[1]->SetMarkerStyle(25);
2145 fQCorrelations[1]->SetLabelSize(0.03);
2146 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
2147 // 2-particle correlations:
2148 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2149 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
2150 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
2151 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
2152 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2153 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
2154 // 3-particle correlations:
2155 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
2156 // 4-particle correlations:
2157 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
2158 // add fQCorrelations[1] to the list fIntFlowList:
2159 fIntFlowList->Add(fQCorrelations[1]);
2160 */
2161
2162} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2163
2164
2165//================================================================================================================================
2166
2167
2168void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2169{
2170 // Initialize arrays of all objects relevant for calculations with nested loops.
2171
2172 // integrated flow:
2173 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2174 {
2175 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2176 }
2177
2178 // differential flow:
2179 // correlations:
2180 for(Int_t t=0;t<2;t++) // type: RP or POI
2181 {
2182 for(Int_t pe=0;pe<2;pe++) // pt or eta
2183 {
2184 for(Int_t ci=0;ci<4;ci++) // correlation index
2185 {
2186 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2187 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2188 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2189 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2190 // correction terms for non-uniform acceptance:
2191 for(Int_t t=0;t<2;t++) // type: RP or POI
2192 {
2193 for(Int_t pe=0;pe<2;pe++) // pt or eta
2194 {
2195 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2196 {
2197 for(Int_t cti=0;cti<9;cti++) // correction term index
2198 {
2199 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2200 }
2201 }
2202 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2203 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2204
2205
2206} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2207
2208
2209//================================================================================================================================
2210
2211
2212void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2213{
2214 // Book all objects relevant for calculations with nested loops.
2215
2216 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2217 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2218 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2219 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2220 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2221 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2222
2223 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2224 evaluateNestedLoopsName += fAnalysisLabel->Data();
2225 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2226 fEvaluateNestedLoops->SetLabelSize(0.03);
2227 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2228 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2229 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2230 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2231 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2232 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2233 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2234 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2235 fNestedLoopsList->Add(fEvaluateNestedLoops);
2236 // nested loops for integrated flow:
2237 if(fEvaluateIntFlowNestedLoops)
2238 {
2239 // correlations:
2240 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2241 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
2242 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");
2243 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2244 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2245 {
2246 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2247 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2248 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2249 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2250 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2251 // correction terms for non-uniform acceptance:
2252 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2253 {
2254 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2255 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2256 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");
2257 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2258 } // end of for(Int_t sc=0;sc<2;sc++)
2259 } // end of if(fEvaluateIntFlowNestedLoops)
2260
2261 // nested loops for differential flow:
2262 if(fEvaluateDiffFlowNestedLoops)
2263 {
2264 // reduced correlations:
2265 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2266 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2267 for(Int_t t=0;t<2;t++) // type: RP or POI
2268 {
2269 for(Int_t pe=0;pe<2;pe++) // pt or eta
2270 {
2271 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2272 {
2273 // reduced correlations:
2274 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");
2275 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2276 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2277 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2278 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2279 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2280 // correction terms for non-uniform acceptance:
2281 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2282 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2283 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2284 {
2285 for(Int_t pe=0;pe<2;pe++) // pt or eta
2286 {
2287 for(Int_t sc=0;sc<2;sc++) // sin or cos
2288 {
2289 for(Int_t cti=0;cti<9;cti++) // correction term index
2290 {
2291 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");
2292 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2293 }
2294 }
2295 }
3b552efe 2296 }
2297 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2298 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2299 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
489d5531 2300 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2301 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2302 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
3b552efe 2303 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
489d5531 2304 fNestedLoopsList->Add(fNoOfParticlesInBin);
2305 } // end of if(fEvaluateDiffFlowNestedLoops)
2306
2307} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2308
2309
2310//================================================================================================================================
2311
2312
2313void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2314{
2315 // calculate all correlations needed for integrated flow
57340a27 2316
489d5531 2317 // multiplicity:
2318 Double_t dMult = (*fSMpk)(0,0);
57340a27 2319
489d5531 2320 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2321 Double_t dReQ1n = (*fReQ)(0,0);
2322 Double_t dReQ2n = (*fReQ)(1,0);
2323 Double_t dReQ3n = (*fReQ)(2,0);
2324 Double_t dReQ4n = (*fReQ)(3,0);
2325 Double_t dImQ1n = (*fImQ)(0,0);
2326 Double_t dImQ2n = (*fImQ)(1,0);
2327 Double_t dImQ3n = (*fImQ)(2,0);
2328 Double_t dImQ4n = (*fImQ)(3,0);
2329
2330 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2331 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2332
2333 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2334 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2335
2336 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2337 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2338
2339 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2340 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2341
2342 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2343 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2344 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2345
2346 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2347 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2348
2349 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2350 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2351
2352 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2353 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2354
2355 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2356 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2357
2358 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2359 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2360
2361 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2362 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2363
2364 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2365 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2366
2367 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2368 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2369
2370 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2371 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2372 + dImQ3n*dImQ2n*dReQ1n;
2373
2374 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2375 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2376
2377 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2378 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2379
2380 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2381 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2382 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2383
2384 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2385 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2386
2387 // |Q_{2n}|^2 |Q_{n}|^2
2388 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2389
2390 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2391 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2392 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2393
2394 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2395 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2396
2397 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2398 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2399 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2400
2401 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2402 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2403
2404 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2405 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2406 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2407
2408 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2409 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2410 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2411
2412 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2413 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2414 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2415 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2416
2417 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2418 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2419 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2420 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2421
2422 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2423 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2424 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2425
2426 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2427 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2428 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2429
2430
2431 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2432 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2433 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2434 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2435 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2436
2437 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2438 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2439 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2440 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2441
2442 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2443 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2444 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2445 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2446
2447 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2448 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2449 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2450 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2451
2452 // |Q_{2n}|^2 |Q_{n}|^4
2453 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2454
2455 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2456 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2457 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2458 + 2.*dReQ1n*dImQ1n*dImQ2n);
2459
2460 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2461 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2462 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2463 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2464
2465
2466
2467
2468 // **************************************
2469 // **** multi-particle correlations: ****
2470 // **************************************
2471 //
2472 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)
2473 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)
2474 // --------------------------------------------------------------------------------------------------------------------
2475 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2476 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2477 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2478 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2479 // 5th bin: ---- EMPTY ----
2480 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2481 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2482 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2483 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2484 // 10th bin: ---- EMPTY ----
2485 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2486 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2487 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2488 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2489 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2490 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2491 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2492 // 18th bin: ---- EMPTY ----
2493 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2494 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2495 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2496 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2497 // 23rd bin: ---- EMPTY ----
2498 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2499 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2500 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2501 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2502 // 28th bin: ---- EMPTY ----
2503 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2504 // 30th bin: ---- EMPTY ----
2505 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2506 // --------------------------------------------------------------------------------------------------------------------
2507
2508 // 2-particle:
2509 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2510 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2511 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2512 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2513
2514 if(dMult>1)
2515 {
2516 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2517 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2518 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2519 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2520
2521 // average 2-particle correlations for single event:
2522 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2523 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2524 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2525 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2526
2527 // average 2-particle correlations for all events:
2528 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2529 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2530 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2531 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2532
2533 // store separetately <2> (to be improved: do I really need this?)
2534 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2535
2536 // to be improved (this can be implemented better):
2537 Double_t mWeight2p = 0.;
2538 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2539 {
2540 mWeight2p = dMult*(dMult-1.);
2541 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2542 {
2543 mWeight2p = 1.;
2544 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2545 {
2546 mWeight2p = dMult;
2547 }
2548
2549 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2550 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
b3dacf6b 2551 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);}
489d5531 2552
2553 // distribution of <cos(n*(phi1-phi2))>:
2554 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2555 } // end of if(dMult>1)
2556
2557 // 3-particle:
2558 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2559 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2560 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2561 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2562
2563 if(dMult>2)
2564 {
2565 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2566 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2567 / (dMult*(dMult-1.)*(dMult-2.));
2568 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2569 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2570 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2571 / (dMult*(dMult-1.)*(dMult-2.));
2572 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2573 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2574 / (dMult*(dMult-1.)*(dMult-2.));
2575 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2576 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2577 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2578 / (dMult*(dMult-1.)*(dMult-2.));
2579
2580 // average 3-particle correlations for single event:
2581 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2582 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2583 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2584 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2585
2586 // average 3-particle correlations for all events:
2587 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2588 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2589 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2590 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2591 } // end of if(dMult>2)
2592
2593 // 4-particle:
2594 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2595 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2596 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2597 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2598 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2599 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2600 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2601
2602 if(dMult>3)
2603 {
2604 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2605 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2606 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2607 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2608 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2609 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2610 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2611 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2612 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2613 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2614 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2615 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2616 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2617 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2618 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2619 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2620 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2621 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2622 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2623 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2624 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2625 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2626 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2627 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2628 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2629 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2630 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2631 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2632 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2633 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2634 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2635 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2636 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2637 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2638 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2639 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2640
2641 // average 4-particle correlations for single event:
2642 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2643 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2644 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2645 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2646 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2647 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2648 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2649
2650 // average 4-particle correlations for all events:
2651 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2652 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2653 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2654 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2655 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2656 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2657 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2658
2659 // store separetately <4> (to be improved: do I really need this?)
2660 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2661
2662 // to be improved (this can be implemented better):
2663 Double_t mWeight4p = 0.;
2664 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2665 {
2666 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2667 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2668 {
2669 mWeight4p = 1.;
2670 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2671 {
2672 mWeight4p = dMult;
2673 }
2674
2675 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2676 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
b3dacf6b 2677 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);}
489d5531 2678
2679 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2680 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2681
2682 } // end of if(dMult>3)
2683
2684 // 5-particle:
2685 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2686 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2687 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2688 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2689
2690 if(dMult>4)
2691 {
2692 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2693 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2694 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2695 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2696 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2697 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2698 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2699 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2700 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2701 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2702 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2703
2704 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2705 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2706 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2707 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2708 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2709 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2710 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2711 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2712 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2713 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2714 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2715 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2716 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2717
2718 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2719 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2720 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2721 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2722 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2723 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2724 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2725
2726 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2727 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2728 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2729 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2730 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2731 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2732 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2733 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2734 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2735 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2736 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2737 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2738 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2739 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2740 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2741 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2742
2743 // average 5-particle correlations for single event:
2744 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2745 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2746 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2747 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2748
2749 // average 5-particle correlations for all events:
2750 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2751 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2752 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2753 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2754 } // end of if(dMult>4)
2755
2756 // 6-particle:
2757 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2758 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2759 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2760 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2761
2762 if(dMult>5)
2763 {
2764 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2765 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2766 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2767 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2768 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2769 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2770 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2771 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2772 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2773 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2774 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2775
2776 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2777 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2778 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2779 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2780 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2781 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2782 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2783 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2784 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2785 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2786 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2787 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2788 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2789 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2790
2791 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2792 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2793 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2794 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2795 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2796 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2797 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2798
2799 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2800 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2801 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2802 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2803 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2804 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2805 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2806 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2807
2808 // average 6-particle correlations for single event:
2809 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2810 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2811 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2812 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2813
2814 // average 6-particle correlations for all events:
2815 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2816 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2817 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2818 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2819
2820 // store separetately <6> (to be improved: do I really need this?)
2821 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2822
2823 // to be improved (this can be implemented better):
2824 Double_t mWeight6p = 0.;
2825 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2826 {
2827 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2828 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2829 {
2830 mWeight6p = 1.;
2831 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2832 {
2833 mWeight6p = dMult;
2834 }
2835
2836 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2837 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
b3dacf6b 2838 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);}
489d5531 2839
2840 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2841 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2842 } // end of if(dMult>5)
2843
2844 // 7-particle:
2845 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2846
2847 if(dMult>6)
2848 {
2849 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2850 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2851 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2852 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2853 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2854 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2855 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2856 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2857 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2858 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2859 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2860 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2861 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2862 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2863 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2864 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2865
2866 // average 7-particle correlations for single event:
2867 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2868
2869 // average 7-particle correlations for all events:
2870 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2871 } // end of if(dMult>6)
2872
2873 // 8-particle:
2874 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2875 if(dMult>7)
2876 {
2877 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2878 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2879 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2880 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2881 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2882 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2883 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2884 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2885 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2886 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2887 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2888 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2889 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2890
2891 // average 8-particle correlations for single event:
2892 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2893
2894 // average 8-particle correlations for all events:
2895 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2896
2897 // store separetately <8> (to be improved: do I really need this?)
2898 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2899
2900 // to be improved (this can be implemented better):
2901 Double_t mWeight8p = 0.;
2902 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2903 {
2904 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2905 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2906 {
2907 mWeight8p = 1.;
2908 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2909 {
2910 mWeight8p = dMult;
2911 }
2912
2913 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
2914 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
b3dacf6b 2915 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);}
489d5531 2916
2917 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2918 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2919 } // end of if(dMult>7)
2920
2921} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2922
489d5531 2923//================================================================================================================================
2924
e5834fcb 2925void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
2926{
2927 // Store phi distribution for one event to illustrate flow.
2928
2929 if(fPhiDistributionForOneEvent->GetEntries()>0){return;} // store only phi distribution for one event
2930
2931 Double_t vMin = fPhiDistributionForOneEventSettings[0];
2932 Double_t vMax = fPhiDistributionForOneEventSettings[1];
2933 Double_t refMultMin = fPhiDistributionForOneEventSettings[2];
2934 Double_t refMultMax = fPhiDistributionForOneEventSettings[3];
2935
2936 Double_t vEBE = 0.;
2937 Double_t cumulant4thEBE = fIntFlowCorrelationsEBE->GetBinContent(2)-2.*pow(fIntFlowCorrelationsEBE->GetBinContent(1),2.);
2938 if(cumulant4thEBE<0.)
2939 {
2940 vEBE = pow(-1.*cumulant4thEBE,0.25);
2941 if((vEBE>vMin && vEBE<vMax) && (fReferenceMultiplicityEBE>refMultMin && fReferenceMultiplicityEBE<refMultMax))
2942 {
2943 for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
2944 {
2945 if(anEvent->GetTrack(p)->InRPSelection())
2946 {
2947 fPhiDistributionForOneEvent->Fill(anEvent->GetTrack(p)->Phi());
2948 }
2949 } // end of for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
2950 }
2951 } // end of if(cumulant4thEBE<0.)
2952
2953} // end of void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
2954
2955//================================================================================================================================
489d5531 2956
2957void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2958{
0328db2d 2959 // Calculate averages of products of correlations for integrated flow.
489d5531 2960
2001bc3a 2961 // multiplicity:
2962 Double_t dMult = (*fSMpk)(0,0);
2963
489d5531 2964 Int_t counter = 0;
2965
2966 for(Int_t ci1=1;ci1<4;ci1++)
2967 {
2968 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
2969 {
ff70ca91 2970 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
2971 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2972 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2973 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2974 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2975 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 2976 if(fCalculateCumulantsVsM)
2977 {
2978 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
2979 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2980 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2981 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2982 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2983 } // end of if(fCalculateCumulantsVsM)
ff70ca91 2984 counter++;
489d5531 2985 }
2986 }
2987
2988} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2989
2990
2991//================================================================================================================================
2992
2993
0328db2d 2994void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
2995{
2996 // Calculate averages of products of correction terms for NUA.
2997
2998 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
2999 // 1st bin: <<2><cos(phi)>>
3000 // 2nd bin: <<2><sin(phi)>>
3001 // 3rd bin: <<cos(phi)><sin(phi)>>
3002 // 4th bin: <<2><cos(phi1+phi2)>>
3003 // 5th bin: <<2><sin(phi1+phi2)>>
3004 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
3005 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
3006 // 8th bin: <<4><cos(phi1)>>
3007 // 9th bin: <<4><sin(phi1)>>
3008 // 10th bin: <<4><cos(phi1+phi2)>>
3009 // 11th bin: <<4><sin(phi1+phi2)>>
3010 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
3011 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
3012 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
3013 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
3014 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
3015 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
3016 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
3017 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
3018 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
3019 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
3020 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
3021 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3022 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3023 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3024 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3025 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3026
3027 // <<2><cos(phi)>>:
3028 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
3029 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3030 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3031 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3032 // <<2><sin(phi)>>:
3033 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
3034 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3035 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3036 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3037 // <<cos(phi)><sin(phi)>>:
3038 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
3039 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3040 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3041 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3042 // <<2><cos(phi1+phi2)>>:
3043 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
3044 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3045 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3046 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3047 // <<2><sin(phi1+phi2)>>:
3048 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
3049 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3050 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3051 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3052 // <<2><cos(phi1-phi2-phi3)>>:
3053 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
3054 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3055 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3056 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3057 // <<2><sin(phi1-phi2-phi3)>>:
3058 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3059 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3060 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3061 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3062 // <<4><cos(phi1)>>:
3063 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3064 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3065 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3066 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3067 // <<4><sin(phi1)>>:
3068 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3069 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3070 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3071 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3072 // <<4><cos(phi1+phi2)>>:
3073 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3074 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3075 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3076 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3077 // <<4><sin(phi1+phi2)>>:
3078 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3079 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3080 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3081 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3082 // <<4><cos(phi1-phi2-phi3)>>:
3083 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3084 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3085 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3086 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3087 // <<4><sin(phi1-phi2-phi3)>>:
3088 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3089 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3090 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3091 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3092 // <<cos(phi1)><cos(phi1+phi2)>>:
3093 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3094 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3095 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3096 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3097 // <<cos(phi1)><sin(phi1+phi2)>>:
3098 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3099 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3100 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3101 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3102 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3103 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3104 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3105 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3106 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3107 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3108 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3109 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3110 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3111 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3112 // <<sin(phi1)><cos(phi1+phi2)>>:
3113 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3114 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3115 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3116 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3117 // <<sin(phi1)><sin(phi1+phi2)>>:
3118 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3119 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3120 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3121 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3122 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3123 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3124 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3125 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3126 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3127 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3128 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3129 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3130 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3131 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3132 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3133 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3134 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3135 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3136 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3137 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3138 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3139 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3140 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3141 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3142 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3143 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3144 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3145 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3146 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3147 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3148 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3149 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3150 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3151 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3152 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3153 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3154 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3155 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3156 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3157 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3158 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3159 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3160 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3161 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3162
3163} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3164
0328db2d 3165//================================================================================================================================
3166
489d5531 3167void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3168{
3169 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3170 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3171 // b) Store in histogram fIntFlowCovariances for instance the following:
3172 //
3173 // 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)]
3174 //
3175 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3176 // c) Binning of fIntFlowCovariances is organized as follows:
3177 //
3178 // 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)]
3179 // 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)]
3180 // 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)]
3181 // 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)]
3182 // 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)]
3183 // 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 3184 //
489d5531 3185
b3dacf6b 3186 // Average 2-, 4-, 6- and 8-particle correlations for all events:
489d5531 3187 Double_t correlation[4] = {0.};
3188 for(Int_t ci=0;ci<4;ci++)
3189 {
3190 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3191 }
b3dacf6b 3192 // Average products of 2-, 4-, 6- and 8-particle correlations:
489d5531 3193 Double_t productOfCorrelations[4][4] = {{0.}};
3194 Int_t productOfCorrelationsLabel = 1;
b3dacf6b 3195 // Denominators in the expressions for the unbiased estimator for covariance:
489d5531 3196 Double_t denominator[4][4] = {{0.}};
3197 Int_t sumOfProductOfEventWeightsLabel1 = 1;
b3dacf6b 3198 // Weight dependent prefactor which multiply unbiased estimators for covariances:
489d5531 3199 Double_t wPrefactor[4][4] = {{0.}};
3200 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3201 for(Int_t c1=0;c1<4;c1++)
3202 {
3203 for(Int_t c2=c1+1;c2<4;c2++)
3204 {
3205 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
b3dacf6b 3206 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
3207 {
3208 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
3209 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3210 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3211 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
3212 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3213 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
489d5531 3214 }
b3dacf6b 3215 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
489d5531 3216 sumOfProductOfEventWeightsLabel1++;
3217 sumOfProductOfEventWeightsLabel2++;
b3dacf6b 3218 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3219 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 3220
489d5531 3221 Int_t covarianceLabel = 1;
3222 for(Int_t c1=0;c1<4;c1++)
3223 {
3224 for(Int_t c2=c1+1;c2<4;c2++)
3225 {
b3dacf6b 3226 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
489d5531 3227 {
b3dacf6b 3228 // Covariances:
489d5531 3229 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
b3dacf6b 3230 // Covariances multiplied with weight dependent prefactor:
489d5531 3231 Double_t wCov = cov * wPrefactor[c1][c2];
3232 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3233 }
3234 covarianceLabel++;
b3dacf6b 3235 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3236 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 3237
b3dacf6b 3238 // Versus multiplicity:
3239 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 3240 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3241 for(Int_t b=1;b<=nBins;b++)
3242 {
b3dacf6b 3243 // Average 2-, 4-, 6- and 8-particle correlations for all events:
9da1a4f3 3244 Double_t correlationVsM[4] = {0.};
3245 for(Int_t ci=0;ci<4;ci++)
3246 {
3247 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3248 } // end of for(Int_t ci=0;ci<4;ci++)
b3dacf6b 3249 // Average products of 2-, 4-, 6- and 8-particle correlations:
9da1a4f3 3250 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
3251 Int_t productOfCorrelationsLabelVsM = 1;
b3dacf6b 3252 // Denominators in the expressions for the unbiased estimator for covariance:
9da1a4f3 3253 Double_t denominatorVsM[4][4] = {{0.}};
3254 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
b3dacf6b 3255 // Weight dependent prefactor which multiply unbiased estimators for covariances:
9da1a4f3 3256 Double_t wPrefactorVsM[4][4] = {{0.}};
3257 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
3258 for(Int_t c1=0;c1<4;c1++)
3259 {
3260 for(Int_t c2=c1+1;c2<4;c2++)
3261 {
3262 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
b3dacf6b 3263 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
3264 {
3265 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
3266 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3267 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3268 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
3269 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3270 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
9da1a4f3 3271 }
3272 productOfCorrelationsLabelVsM++;
3273 sumOfProductOfEventWeightsLabel1VsM++;
3274 sumOfProductOfEventWeightsLabel2VsM++;
3275 } // end of for(Int_t c1=0;c1<4;c1++)
3276 } // end of for(Int_t c2=c1+1;c2<4;c2++)
b3dacf6b 3277
9da1a4f3 3278 Int_t covarianceLabelVsM = 1;
3279 for(Int_t c1=0;c1<4;c1++)
3280 {
3281 for(Int_t c2=c1+1;c2<4;c2++)
3282 {
b3dacf6b 3283 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
9da1a4f3 3284 {
b3dacf6b 3285 // Covariances:
9da1a4f3 3286 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
b3dacf6b 3287 // Covariances multiplied with weight dependent prefactor:
9da1a4f3 3288 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
3289 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
3290 }
3291 covarianceLabelVsM++;
b3dacf6b 3292 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3293 } // end of for(Int_t c1=0;c1<4;c1++)
9da1a4f3 3294 } // end of for(Int_t b=1;b<=nBins;b++)
3295
489d5531 3296} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3297
489d5531 3298//================================================================================================================================
3299
0328db2d 3300void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3301{
3302 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3303 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3304 //
3305 // 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)]
3306 //
3307 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3308 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3309 //
3310 // 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)]
3311 // 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)]
3312 // 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)]
3313 // ...
3314
3315 // Cov(<2>,<cos(phi)>):
3316 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3317 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3318 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3319 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3320 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3321 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3322 // numerator in the expression for the the unbiased estimator for covariance:
3323 Double_t numerator1 = product1 - term1st1*term2nd1;
3324 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3325 Double_t denominator1 = 0.;
3326 if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3327 {
3328 denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3329 if(TMath::Abs(denominator1)>0.)
3330 {
3331 // covariance:
3332 Double_t covariance1 = numerator1/denominator1;
3333 // weight dependent prefactor for covariance:
3334 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3335 // finally, store "weighted" covariance:
3336 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3337 } // end of if(TMath::Abs(denominator)>0.)
3338 } // end of if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3339
0328db2d 3340 // Cov(<2>,<sin(phi)>):
3341 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3342 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3343 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3344 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3345 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3346 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3347 // numerator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3348 Double_t numerator2 = product2 - term1st2*term2nd2;
0328db2d 3349 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3350 Double_t denominator2 = 0.;
3351 if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
3352 {
3353 denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3354 if(TMath::Abs(denominator2)>0.)
3355 {
3356 // covariance:
3357 Double_t covariance2 = numerator2/denominator2;
3358 // weight dependent prefactor for covariance:
3359 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3360 // finally, store "weighted" covariance:
3361 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3362 } // end of if(TMath::Abs(denominator2)>0.)
3363 } // end of if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
0328db2d 3364
3365 // Cov(<cos(phi)>,<sin(phi)>):
3366 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3367 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3368 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3369 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3370 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3371 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3372 // numerator in the expression for the the unbiased estimator for covariance:
3373 Double_t numerator3 = product3 - term1st3*term2nd3;
3374 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3375 Double_t denominator3 = 0;
3376 if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
3377 {
3378 denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3379 if(TMath::Abs(denominator3)>0.)
3380 {
3381 // covariance:
3382 Double_t covariance3 = numerator3/denominator3;
3383 // weight dependent prefactor for covariance:
3384 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3385 // finally, store "weighted" covariance:
3386 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3387 } // end of if(TMath::Abs(denominator3)>0.)
3388 } // end of if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
0328db2d 3389
3390 // Cov(<2>,<cos(phi1+phi2)>):
3391 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3392 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3393 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3394 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3395 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3396 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3397 // numerator in the expression for the the unbiased estimator for covariance:
3398 Double_t numerator4 = product4 - term1st4*term2nd4;
3399 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3400 Double_t denominator4 = 0.;
3401 if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3402 {
3403 denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3404 if(TMath::Abs(denominator4)>0.)
3405 {
3406 // covariance:
3407 Double_t covariance4 = numerator4/denominator4;
3408 // weight dependent prefactor for covariance:
3409 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3410 // finally, store "weighted" covariance:
3411 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3412 } // end of if(TMath::Abs(denominator4)>0.)
3413 } // end of if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3414
0328db2d 3415 // Cov(<2>,<sin(phi1+phi2)>):
3416 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3417 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3418 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3419 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3420 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3421 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3422 // numerator in the expression for the the unbiased estimator for covariance:
3423 Double_t numerator5 = product5 - term1st5*term2nd5;
3424 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3425 Double_t denominator5 = 0.;
3426 if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3427 {
3428 denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3429 if(TMath::Abs(denominator5)>0.)
3430 {
3431 // covariance:
3432 Double_t covariance5 = numerator5/denominator5;
3433 // weight dependent prefactor for covariance:
3434 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3435 // finally, store "weighted" covariance:
3436 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3437 } // end of if(TMath::Abs(denominator5)>0.)
3438 } // end of if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3439
0328db2d 3440 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3441 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3442 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3443 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3444 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3445 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3446 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3447 // numerator in the expression for the the unbiased estimator for covariance:
3448 Double_t numerator6 = product6 - term1st6*term2nd6;
3449 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3450 Double_t denominator6 = 0.;
3451 if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3452 {
3453 denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3454 if(TMath::Abs(denominator6)>0.)
3455 {
3456 // covariance:
3457 Double_t covariance6 = numerator6/denominator6;
3458 // weight dependent prefactor for covariance:
3459 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3460 // finally, store "weighted" covariance:
3461 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3462 } // end of if(TMath::Abs(denominator6)>0.)
3463 } // end of if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3464
0328db2d 3465 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3466 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3467 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3468 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3469 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3470 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3471 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3472 // numerator in the expression for the the unbiased estimator for covariance:
3473 Double_t numerator7 = product7 - term1st7*term2nd7;
3474 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3475 Double_t denominator7 = 0.;
3476 if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3477 {
3478 denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3479 if(TMath::Abs(denominator7)>0.)
3480 {
3481 // covariance:
3482 Double_t covariance7 = numerator7/denominator7;
3483 // weight dependent prefactor for covariance:
3484 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3485 // finally, store "weighted" covariance:
3486 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3487 } // end of if(TMath::Abs(denominator7)>0.)
3488 } // end of if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3489
0328db2d 3490 // Cov(<4>,<cos(phi1>):
3491 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3492 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3493 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3494 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3495 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3496 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3497 // numerator in the expression for the the unbiased estimator for covariance:
3498 Double_t numerator8 = product8 - term1st8*term2nd8;
3499 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3500 Double_t denominator8 = 0.;
3501 if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3502 {
3503 denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3504 if(TMath::Abs(denominator8)>0.)
3505 {
3506 // covariance:
3507 Double_t covariance8 = numerator8/denominator8;
3508 // weight dependent prefactor for covariance:
3509 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3510 // finally, store "weighted" covariance:
3511 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3512 } // end of if(TMath::Abs(denominator8)>0.)
3513 } // end of if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3514
0328db2d 3515 // Cov(<4>,<sin(phi1)>):
3516 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3517 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3518 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3519 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3520 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3521 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3522 // numerator in the expression for the the unbiased estimator for covariance:
3523 Double_t numerator9 = product9 - term1st9*term2nd9;
3524 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3525 Double_t denominator9 = 0.;
3526 if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3527 {
3528 denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3529 if(TMath::Abs(denominator9)>0.)
3530 {
3531 // covariance:
3532 Double_t covariance9 = numerator9/denominator9;
3533 // weight dependent prefactor for covariance:
3534 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3535 // finally, store "weighted" covariance:
3536 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3537 }
3538 } // end of if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3539
0328db2d 3540 // Cov(<4>,<cos(phi1+phi2)>):
3541 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3542 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3543 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3544 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3545 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3546 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3547 // numerator in the expression for the the unbiased estimator for covariance:
3548 Double_t numerator10 = product10 - term1st10*term2nd10;
3549 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3550 Double_t denominator10 = 0.;
3551 if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3552 {
3553 denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3554 if(TMath::Abs(denominator10)>0.)
3555 {
3556 // covariance:
3557 Double_t covariance10 = numerator10/denominator10;
3558 // weight dependent prefactor for covariance:
3559 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3560 // finally, store "weighted" covariance:
3561 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3562 } // end of if(TMath::Abs(denominator10)>0.)
3563 } // end of if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3564
0328db2d 3565 // Cov(<4>,<sin(phi1+phi2)>):
3566 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3567 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3568 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3569 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3570 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3571 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3572 // numerator in the expression for the the unbiased estimator for covariance:
3573 Double_t numerator11 = product11 - term1st11*term2nd11;
3574 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3575 Double_t denominator11 = 0.;
3576 if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
3577 {
3578 denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3579 if(TMath::Abs(denominator11)>0.)
3580 {
3581 // covariance:
3582 Double_t covariance11 = numerator11/denominator11;
3583 // weight dependent prefactor for covariance:
3584 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3585 // finally, store "weighted" covariance:
3586 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3587 } // end of if(TMath::Abs(denominator11)>0.)
3588 } // end of if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
0328db2d 3589
3590 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3591 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3592 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3593 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3594 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3595 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3596 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3597 // numerator in the expression for the the unbiased estimator for covariance:
3598 Double_t numerator12 = product12 - term1st12*term2nd12;
3599 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3600 Double_t denominator12 = 0.;
3601 if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
3602 {
3603 denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3604 if(TMath::Abs(denominator12)>0.)
3605 {
3606 // covariance:
3607 Double_t covariance12 = numerator12/denominator12;
3608 // weight dependent prefactor for covariance:
3609 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3610 // finally, store "weighted" covariance:
3611 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3612 } // end of if(TMath::Abs(denominator12)>0.)
3613 } // end of if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
0328db2d 3614
3615 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3616 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3617 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3618 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3619 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3620 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3621 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3622 // numerator in the expression for the the unbiased estimator for covariance:
3623 Double_t numerator13 = product13 - term1st13*term2nd13;
3624 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3625 Double_t denominator13 = 0.;
3626 if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
3627 {
3628 denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3629 if(TMath::Abs(denominator13)>0.)
3630 {
3631 // covariance:
3632 Double_t covariance13 = numerator13/denominator13;
3633 // weight dependent prefactor for covariance:
3634 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3635 // finally, store "weighted" covariance:
3636 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3637 } // end of if(TMath::Abs(denominator13)>0.)
3638 } // end of if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
0328db2d 3639
3640 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3641 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3642 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3643 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3644 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3645 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3646 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3647 // numerator in the expression for the the unbiased estimator for covariance:
3648 Double_t numerator14 = product14 - term1st14*term2nd14;
3649 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3650 Double_t denominator14 = 0.;
3651 if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
3652 {
3653 denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3654 if(TMath::Abs(denominator14)>0.)
3655 {
3656 // covariance:
3657 Double_t covariance14 = numerator14/denominator14;
3658 // weight dependent prefactor for covariance:
3659 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3660 // finally, store "weighted" covariance:
3661 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3662 } // end of if(TMath::Abs(denominator14)>0.)
3663 } // end of if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
0328db2d 3664
3665 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3666 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3667 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3668 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3669 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3670 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3671 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3672 // numerator in the expression for the the unbiased estimator for covariance:
3673 Double_t numerator15 = product15 - term1st15*term2nd15;
3674 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3675 Double_t denominator15 = 0.;
3676 if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3677 {
3678 denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3679 if(TMath::Abs(denominator15)>0.)
3680 {
3681 // covariance:
3682 Double_t covariance15 = numerator15/denominator15;
3683 // weight dependent prefactor for covariance:
3684 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3685 // finally, store "weighted" covariance:
3686 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3687 } // end of if(TMath::Abs(denominator15)>0.)
3688 } // end of if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3689
0328db2d 3690 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3691 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3692 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3693 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3694 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3695 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3696 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3697 // numerator in the expression for the the unbiased estimator for covariance:
3698 Double_t numerator16 = product16 - term1st16*term2nd16;
3699 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3700 Double_t denominator16 = 0.;
3701 if(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3702 {
3703 denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3704 if(TMath::Abs(denominator16)>0.)
3705 {
3706 // covariance:
3707 Double_t covariance16 = numerator16/denominator16;
3708 // weight dependent prefactor for covariance:
3709 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3710 // finally, store "weighted" covariance:
3711 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3712 } // end of if(TMath::Abs(denominator16)>0.)
3713 } // end ofif(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3714
0328db2d 3715 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3716 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3717 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3718 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3719 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3720 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3721 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3722 // numerator in the expression for the the unbiased estimator for covariance:
3723 Double_t numerator17 = product17 - term1st17*term2nd17;
3724 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3725 Double_t denominator17 = 0.;
3726 if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
3727 {
3728 denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3729 if(TMath::Abs(denominator17)>0.)
3730 {
3731 // covariance:
3732 Double_t covariance17 = numerator17/denominator17;
3733 // weight dependent prefactor for covariance:
3734 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3735 // finally, store "weighted" covariance:
3736 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3737 } // end of if(TMath::Abs(denominator17)>0.)
3738 } // end of if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
0328db2d 3739
3740 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3741 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3742 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3743 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3744 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3745 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3746 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3747 // numerator in the expression for the the unbiased estimator for covariance:
3748 Double_t numerator18 = product18 - term1st18*term2nd18;
3749 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3750 Double_t denominator18 = 0.;
3751 if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
3752 {
3753 denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3754 if(TMath::Abs(denominator18)>0.)
3755 {
3756 // covariance:
3757 Double_t covariance18 = numerator18/denominator18;
3758 // weight dependent prefactor for covariance:
3759 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3760 // finally, store "weighted" covariance:
3761 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3762 } // end of if(TMath::Abs(denominator18)>0.)
3763 } // end of if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
0328db2d 3764
3765 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3766 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3767 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3768 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3769 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3770 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3771 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3772 // numerator in the expression for the the unbiased estimator for covariance:
3773 Double_t numerator19 = product19 - term1st19*term2nd19;
3774 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3775 Double_t denominator19 = 0.;
3776 if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3777 {
3778 denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3779 if(TMath::Abs(denominator19)>0.)
3780 {
3781 // covariance:
3782 Double_t covariance19 = numerator19/denominator19;
3783 // weight dependent prefactor for covariance:
3784 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3785 // finally, store "weighted" covariance:
3786 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3787 } // end of if(TMath::Abs(denominator19)>0.)
3788 } // end of if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3789
0328db2d 3790 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3791 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3792 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3793 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3794 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3795 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3796 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3797 // numerator in the expression for the the unbiased estimator for covariance:
3798 Double_t numerator20 = product20 - term1st20*term2nd20;
3799 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3800 Double_t denominator20 = 0.;
3801 if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
3802 {
3803 denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3804 if(TMath::Abs(denominator20)>0.)
3805 {
3806 // covariance:
3807 Double_t covariance20 = numerator20/denominator20;
3808 // weight dependent prefactor for covariance:
3809 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3810 // finally, store "weighted" covariance:
3811 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3812 } // end of if(TMath::Abs(denominator20)>0.)
3813 } // end of if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
0328db2d 3814
3815 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3816 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3817 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3818 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3819 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3820 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3821 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3822 // numerator in the expression for the the unbiased estimator for covariance:
3823 Double_t numerator21 = product21 - term1st21*term2nd21;
3824 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3825 Double_t denominator21 = 0.;
3826 if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
3827 {
3828 denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3829 if(TMath::Abs(denominator21)>0.)
3830 {
3831 // covariance:
3832 Double_t covariance21 = numerator21/denominator21;
3833 // weight dependent prefactor for covariance:
3834 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3835 // finally, store "weighted" covariance:
3836 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3837 } // end of if(TMath::Abs(denominator21)>0.)
3838 } // end of if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
0328db2d 3839
3840 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3841 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3842 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3843 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3844 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3845 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3846 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3847 // numerator in the expression for the the unbiased estimator for covariance:
3848 Double_t numerator22 = product22 - term1st22*term2nd22;
3849 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3850 Double_t denominator22 = 0.;
3851 if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
3852 {
3853 denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3854 if(TMath::Abs(denominator22)>0.)
3855 {
3856 // covariance:
3857 Double_t covariance22 = numerator22/denominator22;
3858 // weight dependent prefactor for covariance:
3859 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3860 // finally, store "weighted" covariance:
3861 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3862 } // end of if(TMath::Abs(denominator22)>0.)
3863 } // end of if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
0328db2d 3864
3865 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3866 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3867 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3868 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3869 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3870 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3871 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3872 // numerator in the expression for the the unbiased estimator for covariance:
3873 Double_t numerator23 = product23 - term1st23*term2nd23;
3874 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3875 Double_t denominator23 = 0.;
3876 if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
3877 {
3878 denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3879 if(TMath::Abs(denominator23)>0.)
3880 {
3881 // covariance:
3882 Double_t covariance23 = numerator23/denominator23;
3883 // weight dependent prefactor for covariance:
3884 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3885 // finally, store "weighted" covariance:
3886 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
3887 } // end of if(TMath::Abs(denominator23)>0.)
3888 } // end of if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
3889
0328db2d 3890 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3891 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3892 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3893 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3894 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3895 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3896 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3897 // numerator in the expression for the the unbiased estimator for covariance:
3898 Double_t numerator24 = product24 - term1st24*term2nd24;
3899 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3900 Double_t denominator24 = 0.;
3901 if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
3902 {
3903 denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3904 if(TMath::Abs(denominator24)>0.)
3905 {
3906 // covariance:
3907 Double_t covariance24 = numerator24/denominator24;
3908 // weight dependent prefactor for covariance:
3909 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3910 // finally, store "weighted" covariance:
3911 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
3912 } // end of if(TMath::Abs(denominator24)>0.)
3913 } // end of if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
0328db2d 3914
3915 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3916 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3917 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3918 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3919 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3920 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3921 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3922 // numerator in the expression for the the unbiased estimator for covariance:
3923 Double_t numerator25 = product25 - term1st25*term2nd25;
3924 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3925 Double_t denominator25 = 0.;
3926 if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
3927 {
3928 denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3929 if(TMath::Abs(denominator25)>0.)
3930 {
3931 // covariance:
3932 Double_t covariance25 = numerator25/denominator25;
3933 // weight dependent prefactor for covariance:
3934 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3935 // finally, store "weighted" covariance:
3936 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
3937 } // end of if(TMath::Abs(denominator25)>0.)
3938 } // end of if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
3939
0328db2d 3940 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3941 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3942 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3943 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3944 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3945 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3946 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3947 // numerator in the expression for the the unbiased estimator for covariance:
3948 Double_t numerator26 = product26 - term1st26*term2nd26;
3949 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3950 Double_t denominator26 = 0.;
3951 if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
3952 {
3953 denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3954 if(TMath::Abs(denominator26)>0.)
3955 {
3956 // covariance:
3957 Double_t covariance26 = numerator26/denominator26;
3958 // weight dependent prefactor for covariance:
3959 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3960 // finally, store "weighted" covariance:
3961 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
3962 } // end of if(TMath::Abs(denominator26)>0.)
3963 } // end of if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
3964
0328db2d 3965 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
3966 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
b92ea2b9 3967 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
0328db2d 3968 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
b92ea2b9 3969 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
0328db2d 3970 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3971 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
3972 // numerator in the expression for the the unbiased estimator for covariance:
3973 Double_t numerator27 = product27 - term1st27*term2nd27;
3974 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3975 Double_t denominator27 = 0.;
3976 if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
3977 {
3978 denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3979 if(TMath::Abs(denominator27)>0.)
3980 {
3981 // covariance:
3982 Double_t covariance27 = numerator27/denominator27;
3983 // weight dependent prefactor for covariance:
3984 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3985 // finally, store "weighted" covariance:
3986 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
3987 } // end of if(TMath::Abs(denominator27)>0.)
3988 } // end of if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
3989
0328db2d 3990} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3991
0328db2d 3992//================================================================================================================================
3993
489d5531 3994void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3995{
3996 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
3997 // correctly calculate the statistical errors and store the final results and
3998 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
3999 //
4000 // Remark: Statistical error of correlation is calculated as:
4001 //
4002 // statistical error = termA * spread * termB:
4003 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
4004 // termB = 1/sqrt(1-termA^2)
b3dacf6b 4005 //
4006
489d5531 4007 for(Int_t ci=1;ci<=4;ci++) // correlation index
4008 {
4009 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
4010 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);
4011 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
4012 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
4013 Double_t termA = 0.;
4014 Double_t termB = 0.;
b3dacf6b 4015 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
489d5531 4016 {
4017 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
4018 } else
4019 {
b3dacf6b 4020 cout<<endl;
4021 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4022 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4023 cout<<endl;
489d5531 4024 }
4025 if(1.-pow(termA,2.) > 0.)
4026 {
4027 termB = 1./pow(1-pow(termA,2.),0.5);
4028 } else
4029 {
b3dacf6b 4030 cout<<endl;
4031 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4032 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4033 cout<<endl;
489d5531 4034 }
4035 Double_t statisticalError = termA * spread * termB;
4036 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
4037 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
ff70ca91 4038 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4039
b3dacf6b 4040 // Versus multiplicity:
4041 if(!fCalculateCumulantsVsM){return;}
ff70ca91 4042 for(Int_t ci=0;ci<=3;ci++) // correlation index
4043 {
4044 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
4045 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
4046 {
4047 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
4048 Double_t spreadVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinError(b);
4049 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
4050 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
4051 Double_t termAVsM = 0.;
4052 Double_t termBVsM = 0.;
b3dacf6b 4053 if(TMath::Abs(sumOfLinearEventWeightsVsM) > 0.) // to be improved - shall I omitt here Abs() ?
ff70ca91 4054 {
4055 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
b3dacf6b 4056 }
ff70ca91 4057 if(1.-pow(termAVsM,2.) > 0.)
4058 {
4059 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
b3dacf6b 4060 }
ff70ca91 4061 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
4062 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
4063 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
4064 } // end of for(Int_t b=1;b<=nBins;b++)
4065 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4066
489d5531 4067} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4068
489d5531 4069//================================================================================================================================
4070
489d5531 4071void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
4072{
b77b6434 4073 // Fill profile fAverageMultiplicity to hold average multiplicities and
4074 // number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
489d5531 4075
4076 // Binning of fAverageMultiplicity is organized as follows:
4077 // 1st bin: all events (including the empty ones)
4078 // 2nd bin: event with # of RPs greater or equal to 1
4079 // 3rd bin: event with # of RPs greater or equal to 2
4080 // 4th bin: event with # of RPs greater or equal to 3
4081 // 5th bin: event with # of RPs greater or equal to 4
4082 // 6th bin: event with # of RPs greater or equal to 5
4083 // 7th bin: event with # of RPs greater or equal to 6
4084 // 8th bin: event with # of RPs greater or equal to 7
4085 // 9th bin: event with # of RPs greater or equal to 8
4086
489d5531 4087 if(nRP<0)
4088 {
b77b6434 4089 cout<<endl;
4090 cout<<" WARNING (QC): nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
4091 cout<<endl;
489d5531 4092 exit(0);
4093 }
4094
4095 for(Int_t i=0;i<9;i++)
4096 {
b77b6434 4097 if(nRP>=i){fAvMultiplicity->Fill(i+0.5,nRP,1);}
489d5531 4098 }
4099
4100} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
4101
489d5531 4102//================================================================================================================================
4103
489d5531 4104void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
b3dacf6b 4105{
b92ea2b9 4106 // a) Calculate Q-cumulants from the measured multiparticle correlations;
4107 // b) Propagate the statistical errors from measured multiparticle correlations to statistical errors of Q-cumulants;
4108 // c) Remark: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
4109 // Method CalculateQcumulantsCorrectedForNUAIntFlow() is called afterwards to correct for this bias;
4110 // d) Store the results and statistical error of Q-cumulants in histogram fIntFlowQcumulants.
4111 // Binning of fIntFlowQcumulants is organized as follows:
489d5531 4112 //
b3dacf6b 4113 // 1st bin: QC{2}
4114 // 2nd bin: QC{4}
4115 // 3rd bin: QC{6}
4116 // 4th bin: QC{8}
4117 //
489d5531 4118
b3dacf6b 4119 // Correlations:
489d5531 4120 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4121 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4122 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4123 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
b3dacf6b 4124 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
489d5531 4125 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4126 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4127 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4128 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
b3dacf6b 4129 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 4130 Double_t wCov24 = 0.; // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4131 Double_t wCov26 = 0.; // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4132 Double_t wCov28 = 0.; // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4133 Double_t wCov46 = 0.; // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4134 Double_t wCov48 = 0.; // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4135 Double_t wCov68 = 0.; // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4136 if(!fForgetAboutCovariances)
4137 {
4138 wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4139 wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4140 wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4141 wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4142 wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4143 wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4144 }
489d5531 4145 // Q-cumulants:
4146 Double_t qc2 = 0.; // QC{2}
4147 Double_t qc4 = 0.; // QC{4}
4148 Double_t qc6 = 0.; // QC{6}
4149 Double_t qc8 = 0.; // QC{8}
b3dacf6b 4150 if(TMath::Abs(two) > 0.){qc2 = two;}
4151 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4152 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4153 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4154 // Statistical errors of Q-cumulants:
489d5531 4155 Double_t qc2Error = 0.;
4156 Double_t qc4Error = 0.;
4157 Double_t qc6Error = 0.;
b3dacf6b 4158 Double_t qc8Error = 0.;
4159 // Squared statistical errors of Q-cumulants:
489d5531 4160 //Double_t qc2ErrorSquared = 0.;
4161 Double_t qc4ErrorSquared = 0.;
4162 Double_t qc6ErrorSquared = 0.;
b3dacf6b 4163 Double_t qc8ErrorSquared = 0.;
4164 // Statistical error of QC{2}:
4165 qc2Error = twoError;
4166 // Statistical error of QC{4}:
489d5531 4167 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4168 - 8.*two*wCov24;
4169 if(qc4ErrorSquared>0.)
4170 {
4171 qc4Error = pow(qc4ErrorSquared,0.5);
4172 } else
4173 {
b3dacf6b 4174 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
4175 }
4176 // Statistical error of QC{6}:
489d5531 4177 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4178 + 81.*pow(two,2.)*pow(fourError,2.)
4179 + pow(sixError,2.)
4180 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4181 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 4182 - 18.*two*wCov46;
489d5531 4183 if(qc6ErrorSquared>0.)
4184 {
4185 qc6Error = pow(qc6ErrorSquared,0.5);
4186 } else
4187 {
b3dacf6b 4188 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
4189 }
4190 // Statistical error of QC{8}:
489d5531 4191 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4192 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4193 + 256.*pow(two,2.)*pow(sixError,2.)
4194 + pow(eightError,2.)
4195 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4196 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4197 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4198 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4199 + 72.*(4.*pow(two,2.)-four)*wCov48
4200 - 32.*two*wCov68;
4201 if(qc8ErrorSquared>0.)
4202 {
4203 qc8Error = pow(qc8ErrorSquared,0.5);
4204 } else
4205 {
b3dacf6b 4206 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
489d5531 4207 }
b3dacf6b 4208 // Store the results and statistical errors for Q-cumulants:
4209 if(TMath::Abs(qc2)>0.)
4210 {
4211 fIntFlowQcumulants->SetBinContent(1,qc2);
4212 fIntFlowQcumulants->SetBinError(1,qc2Error);
4213 }
4214 if(TMath::Abs(qc4)>0.)
4215 {
4216 fIntFlowQcumulants->SetBinContent(2,qc4);
4217 fIntFlowQcumulants->SetBinError(2,qc4Error);
4218 }
4219 if(TMath::Abs(qc6)>0.)
4220 {
4221 fIntFlowQcumulants->SetBinContent(3,qc6);
4222 fIntFlowQcumulants->SetBinError(3,qc6Error);
4223 }
4224 if(TMath::Abs(qc8)>0.)
4225 {
4226 fIntFlowQcumulants->SetBinContent(4,qc8);
4227 fIntFlowQcumulants->SetBinError(4,qc8Error);
4228 }
4229
4230 // Versus multiplicity:
4231 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 4232 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b3dacf6b 4233 Double_t value[4] = {0.}; // QCs vs M
4234 Double_t error[4] = {0.}; // error of QCs vs M
4235 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
4236 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
9da1a4f3 4237 for(Int_t b=1;b<=nBins;b++)
4238 {
b3dacf6b 4239 // Correlations:
9da1a4f3 4240 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
4241 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
4242 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
4243 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
b3dacf6b 4244 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
9da1a4f3 4245 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
4246 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
4247 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
4248 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
b3dacf6b 4249 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 4250 if(!fForgetAboutCovariances)
4251 {
4252 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4253 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4254 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4255 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4256 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4257 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4258 }
9da1a4f3 4259 // Q-cumulants:
4260 qc2 = 0.; // QC{2}
4261 qc4 = 0.; // QC{4}
4262 qc6 = 0.; // QC{6}
4263 qc8 = 0.; // QC{8}
b3dacf6b 4264 if(TMath::Abs(two) > 0.){qc2 = two;}
4265 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4266 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4267 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4268 // Statistical errors of Q-cumulants:
9da1a4f3 4269 qc2Error = 0.;
4270 qc4Error = 0.;
4271 qc6Error = 0.;
b3dacf6b 4272 qc8Error = 0.;
4273 // Squared statistical errors of Q-cumulants:
9da1a4f3 4274 //Double_t qc2ErrorSquared = 0.;
4275 qc4ErrorSquared = 0.;
4276 qc6ErrorSquared = 0.;
b3dacf6b 4277 qc8ErrorSquared = 0.;
4278 // Statistical error of QC{2}:
4279 qc2Error = twoError;
4280 // Statistical error of QC{4}:
9da1a4f3 4281 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4282 - 8.*two*wCov24;
4283 if(qc4ErrorSquared>0.)
4284 {
4285 qc4Error = pow(qc4ErrorSquared,0.5);
4286 } else
4287 {
4288 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 4289 }
4290 // Statistical error of QC{6}:
9da1a4f3 4291 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4292 + 81.*pow(two,2.)*pow(fourError,2.)
4293 + pow(sixError,2.)
4294 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4295 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 4296 - 18.*two*wCov46;
9da1a4f3 4297 if(qc6ErrorSquared>0.)
4298 {
4299 qc6Error = pow(qc6ErrorSquared,0.5);
4300 } else
4301 {
4302 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 4303 }
4304 // Statistical error of QC{8}:
9da1a4f3 4305 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4306 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4307 + 256.*pow(two,2.)*pow(sixError,2.)
4308 + pow(eightError,2.)
4309 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4310 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4311 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4312 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4313 + 72.*(4.*pow(two,2.)-four)*wCov48
4314 - 32.*two*wCov68;
4315 if(qc8ErrorSquared>0.)
4316 {
4317 qc8Error = pow(qc8ErrorSquared,0.5);
4318 } else
4319 {
4320 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4321 }
b3dacf6b 4322 // Store the results and statistical errors for Q-cumulants:
4323 if(TMath::Abs(qc2)>0.)
4324 {
4325 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
4326 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
4327 }
4328 if(TMath::Abs(qc4)>0.)
4329 {
4330 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
4331 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
4332 }
4333 if(TMath::Abs(qc6)>0.)
4334 {
4335 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
4336 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
4337 }
4338 if(TMath::Abs(qc8)>0.)
4339 {
4340 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
4341 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
4342 }
4343 // Rebin in M:
4344 for(Int_t co=0;co<4;co++)
4345 {
4346 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
4347 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
4348 if(error[co]>0.)
4349 {
4350 dSum1[co]+=value[co]/(error[co]*error[co]);
4351 dSum2[co]+=1./(error[co]*error[co]);
4352 }
4353 } // end of for(Int_t co=0;co<4;co++)
9da1a4f3 4354 } // end of for(Int_t b=1;b<=nBins;b++)
b3dacf6b 4355 // Store rebinned Q-cumulants:
4356 for(Int_t co=0;co<4;co++)
4357 {
4358 if(dSum2[co]>0.)
4359 {
4360 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
4361 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
4362 }
4363 } // end of for(Int_t co=0;co<4;co++)
4364
489d5531 4365} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4366
489d5531 4367//================================================================================================================================
4368
b92ea2b9 4369void AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 4370{
b92ea2b9 4371 // a) Calculate the final results for reference flow estimates from Q-cumulants;
4372 // b) Propagate the statistical errors to reference flow estimates from statistical error of Q-cumulants;
0328db2d 4373 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
489d5531 4374 // Binning of fIntFlow is organized as follows:
4375 //
b3dacf6b 4376 // 1st bin: v{2,QC}
4377 // 2nd bin: v{4,QC}
4378 // 3rd bin: v{6,QC}
4379 // 4th bin: v{8,QC}
4380 //
489d5531 4381
b3dacf6b 4382 // Reference flow estimates:
489d5531 4383 Double_t v2 = 0.; // v{2,QC}
4384 Double_t v4 = 0.; // v{4,QC}
4385 Double_t v6 = 0.; // v{6,QC}
4386 Double_t v8 = 0.; // v{8,QC}
b3dacf6b 4387 // Reference flow's statistical errors:
4388 Double_t v2Error = 0.; // v{2,QC} stat. error
4389 Double_t v4Error = 0.; // v{4,QC} stat. error
4390 Double_t v6Error = 0.; // v{6,QC} stat. error
4391 Double_t v8Error = 0.; // v{8,QC} stat. error
4392
b92ea2b9 4393 // Q-cumulants:
4394 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
4395 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
4396 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
4397 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
4398 // Q-cumulants's statistical errors:
4399 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
4400 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
4401 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
4402 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
4403 // Calculate reference flow estimates from Q-cumulants:
4404 if(qc2>=0.){v2 = pow(qc2,1./2.);}
4405 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
4406 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
4407 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
4408 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4409 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-1./2.)*qc2Error;}
4410 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
4411 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
4412 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
4413 // Print warnings for the 'wrong sign' cumulants:
4414 if(TMath::Abs(v2) < 1.e-44)
4415 {
4416 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
4417 }
4418 if(TMath::Abs(v4) < 1.e-44)
4419 {
4420 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
4421 }
4422 if(TMath::Abs(v6) < 1.e-44)
4423 {
4424 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
4425 }
4426 if(TMath::Abs(v8) < 1.e-44)
4427 {
4428 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
4429 }
4430 // Store the results and statistical errors of integrated flow estimates:
4431 fIntFlow->SetBinContent(1,v2);
4432 fIntFlow->SetBinError(1,v2Error);
4433 fIntFlow->SetBinContent(2,v4);
4434 fIntFlow->SetBinError(2,v4Error);
4435 fIntFlow->SetBinContent(3,v6);
4436 fIntFlow->SetBinError(3,v6Error);
4437 fIntFlow->SetBinContent(4,v8);
4438 fIntFlow->SetBinError(4,v8Error);
4439
4440 // Versus multiplicity:
4441 if(!fCalculateCumulantsVsM){return;}
4442 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4443 for(Int_t b=1;b<=nBins;b++)
9da1a4f3 4444 {
4445 // Q-cumulants:
b92ea2b9 4446 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
4447 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
4448 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
4449 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
b3dacf6b 4450 // Q-cumulants's statistical errors:
b92ea2b9 4451 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
4452 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
4453 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
4454 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
b3dacf6b 4455 // Reference flow estimates:
b92ea2b9 4456 Double_t v2VsM = 0.; // v{2,QC}
4457 Double_t v4VsM = 0.; // v{4,QC}
4458 Double_t v6VsM = 0.; // v{6,QC}
4459 Double_t v8VsM = 0.; // v{8,QC}
4460 // Reference flow estimates errors:
4461 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
4462 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
4463 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
4464 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
b3dacf6b 4465 // Calculate reference flow estimates from Q-cumulants:
b92ea2b9 4466 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,1./2.);}
4467 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
4468 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
4469 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
b3dacf6b 4470 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
b92ea2b9 4471 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-1./2.)*qc2ErrorVsM;}
4472 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
4473 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
4474 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
b3dacf6b 4475 // Store the results and statistical errors of integrated flow estimates:
b92ea2b9 4476 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
4477 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
4478 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
4479 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
4480 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
4481 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
4482 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
4483 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
4484 } // end of for(Int_t b=1;b<=nBins;b++)
4485
4486 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
4487 // Reference flow estimates:
4488 Double_t v2RebinnedInM = 0.; // v{2,QC}
4489 Double_t v4RebinnedInM = 0.; // v{4,QC}
4490 Double_t v6RebinnedInM = 0.; // v{6,QC}
4491 Double_t v8RebinnedInM = 0.; // v{8,QC}
4492 // Reference flow's statistical errors:
4493 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
4494 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
4495 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
4496 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
4497 // Q-cumulants:
4498 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
4499 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
4500 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
4501 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
4502 // Q-cumulants's statistical errors:
4503 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
4504 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
4505 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
4506 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
4507 // Calculate reference flow estimates from Q-cumulants:
4508 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,1./2.);}
4509 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
4510 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
4511 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
4512 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4513 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-1./2.)*qc2ErrorRebinnedInM;}
4514 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
4515 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
4516 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
4517 // Print warnings for the 'wrong sign' cumulants:
4518 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
4519 {
4520 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
4521 }
4522 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
4523 {
4524 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
4525 }
4526 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
4527 {
4528 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
4529 }
4530 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
4531 {
4532 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
4533 }
4534 // Store the results and statistical errors of integrated flow estimates:
4535 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
4536 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
4537 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
4538 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
4539 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
4540 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
4541 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
4542 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
4543
4544} // end of AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 4545
489d5531 4546//================================================================================================================================
4547
489d5531 4548void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4549{
0dd3b008 4550 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
489d5531 4551
0dd3b008 4552 // There are two possibilities here:
4553 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
4554 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
4555 // also stored in local histogram fIntFlow;
4556 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
4557 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
4558 // is also stored in local histogram fIntFlowRebinnedInM.
489d5531 4559
0dd3b008 4560 // Reference flow estimates:
4561 Double_t v[4] = {0.};
4562 // Statistical errors of reference flow estimates:
4563 Double_t vError[4] = {0.};
489d5531 4564
0dd3b008 4565 for(Int_t b=0;b<4;b++)
4566 {
4567 if(fMinimumBiasReferenceFlow)
4568 {
4569 v[b] = fIntFlow->GetBinContent(b+1);
4570 vError[b] = fIntFlow->GetBinError(b+1);
4571 } else
4572 {
4573 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
4574 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
4575 }
4576 } // end of for(Int_t b=0;b<4;b++)
4577
4578 // Fill AliFlowCommonHistResults histogram:
4579 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
4580 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
489d5531 4581 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4582 {
0dd3b008 4583 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
4584 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
489d5531 4585 }
4586
4587} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4588
489d5531 4589//================================================================================================================================
4590
489d5531 4591void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4592{
4593 // Calculate all correlations needed for integrated flow using particle weights.
4594
4595 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4596 //
4597 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4598 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4599 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4600 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4601 // 5th bin: ---- EMPTY ----
4602 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4603 // 7th bin: <3>_{3n|2n,1n} = ...
4604 // 8th bin: <3>_{4n|2n,2n} = ...
4605 // 9th bin: <3>_{4n|3n,1n} = ...
4606 // 10th bin: ---- EMPTY ----
4607 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4608 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4609 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4610 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4611 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4612 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4613 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4614 // 18th bin: ---- EMPTY ----
4615 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4616 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4617 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4618 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4619 // 23rd bin: ---- EMPTY ----
4620 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4621 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4622 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4623 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4624 // 28th bin: ---- EMPTY ----
4625 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4626 // 30th bin: ---- EMPTY ----
4627 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4628
4629 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4630 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4631
4632 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4633 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4634
4635 // multiplicity (number of particles used to determine the reaction plane)
4636 Double_t dMult = (*fSMpk)(0,0);
4637
4638 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4639 Double_t dReQ1n1k = (*fReQ)(0,1);
4640 Double_t dReQ2n2k = (*fReQ)(1,2);
4641 Double_t dReQ3n3k = (*fReQ)(2,3);
4642 Double_t dReQ4n4k = (*fReQ)(3,4);
4643 Double_t dReQ1n3k = (*fReQ)(0,3);
4644 Double_t dImQ1n1k = (*fImQ)(0,1);
4645 Double_t dImQ2n2k = (*fImQ)(1,2);
4646 Double_t dImQ3n3k = (*fImQ)(2,3);
4647 Double_t dImQ4n4k = (*fImQ)(3,4);
4648 Double_t dImQ1n3k = (*fImQ)(0,3);
4649
4650 // dMs are variables introduced in order to simplify some Eqs. bellow:
4651 //..............................................................................................
4652 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4653 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4654 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4655 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4656 Double_t dM31 = (*fSMpk)(0,3)*(*fSMpk)(0,1)-(*fSMpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j
4657 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4658 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4659 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4660 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4661 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
4662 //..............................................................................................
4663
4664 // 2-particle correlations:
4665 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4666 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4667 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4668 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4669 if(dMult>1)
4670 {
4671 if(dM11)
4672 {
4673 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
4674 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4675 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4676 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4677 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4678 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4679 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4680 }
4681 if(dM22)
4682 {
4683 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
4684 // ...
4685 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4686 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4687 }
4688 if(dM33)
4689 {
4690 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
4691 // ...
4692 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4693 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4694 }
4695 if(dM44)
4696 {
4697 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
4698 // ...
4699 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4700 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4701 }
4702 } // end of if(dMult>1)
4703
4704 // extra 2-particle correlations:
4705 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4706 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4707 if(dMult>1)
4708 {
4709 if(dM31)
4710 {
4711 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
4712 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4713 }
4714 if(dM211)
4715 {
4716 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
4717 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
4718 - (*fSMpk)(0,4)))/dM211;
4719 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4720 }
4721 } // end of if(dMult>1)
4722 //..............................................................................................
4723
4724 //..............................................................................................
4725 // 3-particle correlations:
4726 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4727
4728 if(dMult>2)
4729 {
4730 if(dM211)
4731 {
4732 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4733 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4734 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
4735 + 2.*(*fSMpk)(0,4))/dM211;
4736 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4737 }
4738 } // end of if(dMult>2)
4739 //..............................................................................................
4740
4741 //..............................................................................................
4742 // 4-particle correlations:
4743 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4744 if(dMult>3)
4745 {
4746 if(dM1111)
4747 {
4748 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4749 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4750 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4751 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
4752 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4753 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
4754
4755 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4756 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4757 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4758 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4759 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
4760 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4761 }
4762 } // end of if(dMult>3)
4763 //..............................................................................................
4764
4765} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4766
489d5531 4767//================================================================================================================================
4768
489d5531 4769void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4770{
4771 // Initialize all arrays used to calculate integrated flow.
4772
4773 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4774 {
4775 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
0328db2d 4776 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
489d5531 4777 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4778 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
b92ea2b9 4779 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 4780 {
4781 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
4782 }
0328db2d 4783 for(Int_t power=0;power<2;power++) // linear or quadratic
4784 {
4785 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4786 }
489d5531 4787 }
4788 for(Int_t power=0;power<2;power++) // linear or quadratic
4789 {
4790 fIntFlowSumOfEventWeights[power] = NULL;
4791 }
b3dacf6b 4792 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 4793 {
4794 fPrintFinalResults[i] = kTRUE;
4795 }
ff70ca91 4796 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4797 {
4798 fIntFlowCorrelationsVsMPro[ci] = NULL;
4799 fIntFlowCorrelationsVsMHist[ci] = NULL;
4800 fIntFlowQcumulantsVsM[ci] = NULL;
4801 fIntFlowVsM[ci] = NULL;
2001bc3a 4802 fIntFlowDetectorBiasVsM[ci] = NULL;
ff70ca91 4803 for(Int_t lc=0;lc<2;lc++)
4804 {
4805 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4806 }
4807 }
4808 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4809 {
4810 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4811 fIntFlowCovariancesVsM[pi] = NULL;
4812 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4813 }
e5834fcb 4814
489d5531 4815} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4816
489d5531 4817//================================================================================================================================
4818
489d5531 4819void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4820{
4821 // Initialize all arrays needed to calculate differential flow.
4822 // a) Initialize lists holding profiles;
4823 // b) Initialize lists holding histograms;
4824 // c) Initialize event-by-event quantities;
4825 // d) Initialize profiles;
4826 // e) Initialize histograms holding final results.
4827
4828 // a) Initialize lists holding profiles;
4829 for(Int_t t=0;t<2;t++) // type (RP, POI)
4830 {
4831 for(Int_t pe=0;pe<2;pe++) // pt or eta
4832 {
4833 fDiffFlowCorrelationsProList[t][pe] = NULL;
4834 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4835 fDiffFlowCorrectionsProList[t][pe] = NULL;
4836 }
4837 }
4838
4839 // b) Initialize lists holding histograms;
4840 for(Int_t t=0;t<2;t++) // type (RP, POI)
4841 {
4842 for(Int_t pe=0;pe<2;pe++) // pt or eta
4843 {
4844 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4845 for(Int_t power=0;power<2;power++)
4846 {
4847 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
4848 } // end of for(Int_t power=0;power<2;power++)
4849 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
4850 fDiffFlowCorrectionsHistList[t][pe] = NULL;
4851 fDiffFlowCovariancesHistList[t][pe] = NULL;
4852 fDiffFlowCumulantsHistList[t][pe] = NULL;
4853 fDiffFlowHistList[t][pe] = NULL;
4854 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4855 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
4856
4857 // c) Initialize event-by-event quantities:
4858 // 1D:
4859 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4860 {
4861 for(Int_t pe=0;pe<2;pe++) // pt or eta
4862 {
4863 for(Int_t m=0;m<4;m++) // multiple of harmonic
4864 {
4865 for(Int_t k=0;k<9;k++) // power of weight
4866 {
4867 fReRPQ1dEBE[t][pe][m][k] = NULL;
4868 fImRPQ1dEBE[t][pe][m][k] = NULL;
4869 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4870 }
4871 }
4872 }
4873 }
4874 // 1D:
4875 for(Int_t t=0;t<2;t++) // type (RP or POI)
4876 {
4877 for(Int_t pe=0;pe<2;pe++) // pt or eta
4878 {
4879 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4880 {
4881 for(Int_t cti=0;cti<9;cti++) // correction term index
4882 {
4883 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
4884 }
4885 }
4886 }
4887 }
4888 // 2D:
4889 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4890 {
4891 for(Int_t m=0;m<4;m++) // multiple of harmonic
4892 {
4893 for(Int_t k=0;k<9;k++) // power of weight
4894 {
4895 fReRPQ2dEBE[t][m][k] = NULL;
4896 fImRPQ2dEBE[t][m][k] = NULL;
4897 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4898 }
4899 }
4900 }
4901
4902 // d) Initialize profiles:
4903 for(Int_t t=0;t<2;t++) // type: RP or POI
4904 {
4905 for(Int_t pe=0;pe<2;pe++) // pt or eta
4906 {
4907 for(Int_t ci=0;ci<4;ci++) // correlation index
4908 {
4909 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
4910 } // end of for(Int_t ci=0;ci<4;ci++)
4911 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4912 {
4913 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4914 {
4915 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
4916 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4917 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4918 // correction terms for nua:
4919 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4920 {
4921 for(Int_t cti=0;cti<9;cti++) // correction term index
4922 {
4923 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
4924 }
4925 }
4926 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4927 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4928
4929 // e) Initialize histograms holding final results.
4930 for(Int_t t=0;t<2;t++) // type: RP or POI
4931 {
4932 for(Int_t pe=0;pe<2;pe++) // pt or eta
4933 {
4934 for(Int_t ci=0;ci<4;ci++) // correlation index
4935 {
4936 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
4937 fDiffFlowCumulants[t][pe][ci] = NULL;
4938 fDiffFlow[t][pe][ci] = NULL;
4939 } // end of for(Int_t ci=0;ci<4;ci++)
4940 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4941 {
4942 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
4943 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4944 // correction terms for nua:
4945 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4946 {
4947 for(Int_t cti=0;cti<9;cti++) // correction term index
4948 {
4949 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
4950 }
4951 }
4952 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4953 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4954
4955 // sum of event weights for reduced correlations:
4956 for(Int_t t=0;t<2;t++) // type = RP or POI
4957 {
4958 for(Int_t pe=0;pe<2;pe++) // pt or eta
4959 {
4960 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
4961 {
4962 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
4963 {
4964 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
4965 }
4966 }
4967 }
4968 }
4969 // product of event weights for both types of correlations:
4970 for(Int_t t=0;t<2;t++) // type = RP or POI
4971 {
4972 for(Int_t pe=0;pe<2;pe++) // pt or eta
4973 {
4974 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4975 {
4976 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4977 {
4978 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
4979 }
4980 }
4981 }
4982 }
4983
4984
4985
4986
4987 /*
4988
4989 // nested lists in fDiffFlowProfiles:
4990 for(Int_t t=0;t<2;t++)
4991 {
4992 fDFPType[t] = NULL;
4993 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
4994 {
4995 fDFPParticleWeights[t][pW] = NULL;
4996 for(Int_t eW=0;eW<2;eW++)
4997 {
4998 fDFPEventWeights[t][pW][eW] = NULL;
4999 fDiffFlowCorrelations[t][pW][eW] = NULL;
5000 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
5001 for(Int_t sc=0;sc<2;sc++)
5002 {
5003 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
5004 }
5005 }
5006 }
5007 }
5008
5009
5010 */
5011
5012
5013
5014 /*
5015 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
5016 {
5017 for(Int_t eW=0;eW<2;eW++)
5018 {
5019 // correlations:
5020 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
5021 {
5022 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
5023 }
5024 // products of correlations:
5025 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
5026 {
5027 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
5028 }
5029 // correction terms:
5030 for(Int_t sc=0;sc<2;sc++)
5031 {
5032 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
5033 {
5034 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
5035 }
5036 }
5037 }
5038 }
5039 */
5040
5041} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5042
5043
5044//================================================================================================================================
5045 /*
5046
5047
5048void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
5049{
5050 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
5051
5052 if(type == "RP") // to be improved (removed)
5053 {
5054 cout<<endl;
5055 }
5056 // ...
5057
5058
5059 Int_t typeFlag = -1;
5060
5061 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
5062 // index:
5063 // 0: <2'>
5064 // 1: <4'>
5065
5066 // multiplicity:
5067 Double_t dMult = (*fSMpk)(0,0);
5068
5069 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5070 Double_t dReQ1n = (*fReQ)(0,0);
5071 Double_t dReQ2n = (*fReQ)(1,0);
5072 //Double_t dReQ3n = (*fReQ)(2,0);
5073 //Double_t dReQ4n = (*fReQ)(3,0);
5074 Double_t dImQ1n = (*fImQ)(0,0);
5075 Double_t dImQ2n = (*fImQ)(1,0);
5076 //Double_t dImQ3n = (*fImQ)(2,0);
5077 //Double_t dImQ4n = (*fImQ)(3,0);
5078
5079 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
5080 for(Int_t p=1;p<=fnBinsPt;p++)
5081 {
5082 for(Int_t e=1;e<=fnBinsEta;e++)
5083 {
5084 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5085 Double_t p1n0kRe = 0.;
5086 Double_t p1n0kIm = 0.;
5087
5088 // number of POIs in particular (pt,eta) bin:
5089 Double_t mp = 0.;
5090
5091 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin):
5092 Double_t q1n0kRe = 0.;
5093 Double_t q1n0kIm = 0.;
5094 Double_t q2n0kRe = 0.;
5095 Double_t q2n0kIm = 0.;
5096
5097 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
5098 Double_t mq = 0.;
5099
5100 // q_{m*n,0}:
5101 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
5102 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
5103 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
5104 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
5105 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
5106 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
5107 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
5108 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
5109
5110 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5111
5112 if(type == "POI")
5113 {
5114 // p_{m*n,0}:
5115 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5116 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5117 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5118 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5119
5120 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5121
5122 typeFlag = 1;
5123 }
5124 else if(type == "RP")
5125 {
5126 // p_{m*n,0} = q_{m*n,0}:
5127 p1n0kRe = q1n0kRe;
5128 p1n0kIm = q1n0kIm;
5129 mp = mq;
5130
5131 typeFlag = 0;
5132 }
5133
5134 // count events with non-empty (pt,eta) bin:
5135 if(mp>0)
5136 {
5137 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
5138 }
5139
5140 // 2'-particle correlation for particular (pt,eta) bin:
5141 Double_t two1n1nPtEta = 0.;
5142 if(mp*dMult-mq)
5143 {
5144 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
5145 / (mp*dMult-mq);
5146
5147 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
5148 if(type == "POI")
5149 {
5150 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5151
5152 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5153 }
5154 else if(type == "RP")
5155 {
5156 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5157 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5158 }
5159 } // end of if(mp*dMult-mq)
5160
5161 // 4'-particle correlation:
5162 Double_t four1n1n1n1nPtEta = 0.;
5163 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5164 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
5165 {
5166 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5167 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
5168 - 2.*q2n0kIm*dReQ1n*dImQ1n
5169 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
5170 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
5171 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5172 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
5173 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
5174 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
5175 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5176 + 2.*mq*dMult
5177 - 6.*mq)
5178 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5179 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5180
5181 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5182 if(type == "POI")
5183 {
5184 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5185 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5186 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5187
5188 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5189 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5190 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5191 }
5192 else if(type == "RP")
5193 {
5194 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5195 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5196 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5197
5198 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5199 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5200 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5201 }
5202 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5203 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
5204
5205 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5206 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5207
5208
5209
5210
5211
5212} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
5213
5214
5215
5216
5217
5218
5219//================================================================================================================================
5220
5221
5222void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5223{
5224 // calculate all weighted correlations needed for differential flow
5225
5226 if(type == "RP") // to be improved (removed)
5227 {
5228 cout<<endl;
5229 }
5230 // ...
5231
5232
5233
5234
5235 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5236 Double_t dReQ1n1k = (*fReQ)(0,1);
5237 Double_t dReQ2n2k = (*fReQ)(1,2);
5238 Double_t dReQ1n3k = (*fReQ)(0,3);
5239 //Double_t dReQ4n4k = (*fReQ)(3,4);
5240 Double_t dImQ1n1k = (*fImQ)(0,1);
5241 Double_t dImQ2n2k = (*fImQ)(1,2);
5242 Double_t dImQ1n3k = (*fImQ)(0,3);
5243 //Double_t dImQ4n4k = (*fImQ)(3,4);
5244
5245 // S^M_{p,k} (see .h file for the definition of fSMpk):
5246 Double_t dSM1p1k = (*fSMpk)(0,1);
5247 Double_t dSM1p2k = (*fSMpk)(0,2);
5248 Double_t dSM1p3k = (*fSMpk)(0,3);
5249 Double_t dSM2p1k = (*fSMpk)(1,1);
5250 Double_t dSM3p1k = (*fSMpk)(2,1);
5251
5252 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
5253 for(Int_t p=1;p<=fnBinsPt;p++)
5254 {
5255 for(Int_t e=1;e<=fnBinsEta;e++)
5256 {
5257 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5258 Double_t p1n0kRe = 0.;
5259 Double_t p1n0kIm = 0.;
5260
5261 // number of POIs in particular (pt,eta) bin):
5262 Double_t mp = 0.;
5263
5264 // real and imaginary parts of q_{m*n,k}:
5265 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
5266 Double_t q1n2kRe = 0.;
5267 Double_t q1n2kIm = 0.;
5268 Double_t q2n1kRe = 0.;
5269 Double_t q2n1kIm = 0.;
5270
5271 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5272 Double_t s1p1k = 0.;
5273 Double_t s1p2k = 0.;
5274 Double_t s1p3k = 0.;
5275
5276 // M0111 from Eq. (118) in QC2c (to be improved (notation))
5277 Double_t dM0111 = 0.;
5278
5279 if(type == "POI")
5280 {
5281 // p_{m*n,0}:
5282 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5283 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5284 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5285 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5286
5287 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5288
5289 // q_{m*n,k}:
5290 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
5291 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
5292 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
5293 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
5294 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
5295 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
5296 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
5297 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
5298
5299 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5300 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
5301 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
5302 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
5303
5304 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5305 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5306 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5307 + 2.*(s1p3k-s1p2k*dSM1p1k));
5308 }
5309 else if(type == "RP")
5310 {
5311 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
5312 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5313 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
5314 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
5315
5316 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5317
5318 // q_{m*n,k}:
5319 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
5320 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
5321 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
5322 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
5323 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
5324 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
5325 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
5326 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
5327
5328 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5329 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
5330 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
5331 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
5332
5333 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5334 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5335 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5336 + 2.*(s1p3k-s1p2k*dSM1p1k));
5337 //...............................................................................................
5338 }
5339
5340 // 2'-particle correlation:
5341 Double_t two1n1nW0W1PtEta = 0.;
5342 if(mp*dSM1p1k-s1p1k)
5343 {
5344 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
5345 / (mp*dSM1p1k-s1p1k);
5346
5347 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5348 if(type == "POI")
5349 {
5350 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5351 // mp*dSM1p1k-s1p1k);
5352 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5353 }
5354 else if(type == "RP")
5355 {
5356 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5357 // mp*dSM1p1k-s1p1k);
5358 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5359 }
5360 } // end of if(mp*dMult-dmPrimePrimePtEta)
5361
5362 // 4'-particle correlation:
5363 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
5364 if(dM0111)
5365 {
5366 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5367 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
5368 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
5369 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
5370 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
5371 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5372 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
5373 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
5374 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
5375 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
5376 + 2.*s1p1k*dSM1p2k
5377 - 6.*s1p3k)
5378 / dM0111; // to be imropoved (notation of dM0111)
5379
5380 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5381 if(type == "POI")
5382 {
5383 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5384 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5385 }
5386 else if(type == "RP")
5387 {
5388 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5389 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5390 }
5391 } // end of if(dM0111)
5392
5393 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5394 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5395
5396
5397
5398
5399} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5400
5401
5402//================================================================================================================================
5403
5404 */
5405
5406/*
5407void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5408{
5409 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
5410 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
5411 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
5412
5413 Int_t typeFlag = -1;
5414 Int_t pWeightsFlag = -1;
5415 Int_t eWeightsFlag = -1;
5416
5417 if(type == "RP")
5418 {
5419 typeFlag = 0;
5420 } else if(type == "POI")
5421 {
5422 typeFlag = 1;
5423 } else
5424 {
5425 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
5426 exit(0);
5427 }
5428
5429 if(!useParticleWeights)
5430 {
5431 pWeightsFlag = 0;
5432 } else
5433 {
5434 pWeightsFlag = 1;
5435 }
5436
5437 if(eventWeights == "exact")
5438 {
5439 eWeightsFlag = 0;
5440 }
5441
5442 // shortcuts:
5443 Int_t t = typeFlag;
5444 Int_t pW = pWeightsFlag;
5445 Int_t eW = eWeightsFlag;
5446
5447 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
5448 // pt:
5449 for(Int_t p=1;p<fnBinsPt;p++)
5450 {
5451 Double_t contentPt = 0.;
5452 for(Int_t e=1;e<=fnBinsEta;e++)
5453 {
5454 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5455 }
5456 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
5457 }
5458 // eta:
5459 for(Int_t e=1;e<fnBinsEta;e++)
5460 {
5461 Double_t contentEta = 0.;
5462 for(Int_t p=1;p<=fnBinsPt;p++)
5463 {
5464 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5465 }
5466 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
5467 }
5468
5469 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
5470 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
5471
5472 for(Int_t pe=0;pe<2;pe++) // pt or eta
5473 {
5474 for(Int_t ci=0;ci<4;ci++) // correlation index
5475 {
5476 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
5477 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
5478 }
5479 }
5480
5481 // transfer 2D profile into 2D histogram:
5482 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
5483 for(Int_t ci=0;ci<4;ci++)
5484 {
5485 for(Int_t p=1;p<=fnBinsPt;p++)
5486 {
5487 for(Int_t e=1;e<=fnBinsEta;e++)
5488 {
5489 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5490 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5491 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
5492 Double_t error = 0.;
5493 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
5494 if(nEvts>0)
5495 {
5496 error = spread/pow(nEvts,0.5);
5497 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
5498 }
5499 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5500 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5501 } // end of for(Int_t ci=0;ci<4;ci++)
5502
5503 // transfer 1D profile into 1D histogram (pt):
5504 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5505 for(Int_t ci=0;ci<4;ci++)
5506 {
5507 for(Int_t p=1;p<=fnBinsPt;p++)
5508 {
5509 if(profile[0][ci])
5510 {
5511 Double_t correlation = profile[0][ci]->GetBinContent(p);
5512 Double_t spread = profile[0][ci]->GetBinError(p);
5513 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
5514 Double_t error = 0.;
5515 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
5516 if(nEvts>0)
5517 {
5518 error = spread/pow(nEvts,0.5);
5519 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
5520 }
5521 }
5522 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5523 } // end of for(Int_t ci=0;ci<4;ci++)
5524
5525 // transfer 1D profile into 1D histogram (eta):
5526 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5527 for(Int_t ci=0;ci<4;ci++)
5528 {
5529 for(Int_t e=1;e<=fnBinsEta;e++)
5530 {
5531 if(profile[1][ci])
5532 {
5533 Double_t correlation = profile[1][ci]->GetBinContent(e);
5534 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
5535 }
5536 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5537 } // end of for(Int_t ci=0;ci<4;ci++)
5538
5539} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5540*/
5541
5542
5543//================================================================================================================================
5544
5545
5546void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5547{
5548 // calcualate cumulants for differential flow from measured correlations
5549 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
5550 // to be improved (description)
5551
5552 Int_t typeFlag = -1;
5553 Int_t ptEtaFlag = -1;
5554
5555 if(type == "RP")
5556 {
5557 typeFlag = 0;
5558 } else if(type == "POI")
5559 {
5560 typeFlag = 1;
5561 }
5562
5563 if(ptOrEta == "Pt")
5564 {
5565 ptEtaFlag = 0;
5566 } else if(ptOrEta == "Eta")
5567 {
5568 ptEtaFlag = 1;
5569 }
5570
5571 // shortcuts:
5572 Int_t t = typeFlag;
5573 Int_t pe = ptEtaFlag;
5574
5575 // common:
5576 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5577
5578 // correlation <<2>>:
5579 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5580
5581 // 1D:
5582 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5583 {
5584 // reduced correlations:
5585 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)
5586 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)
5587 // final statistical error of reduced correlations:
5588 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
5589 // QC{2'}:
5590 Double_t qc2Prime = twoPrime; // QC{2'}
5591 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
5592 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5593 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
5594 // QC{4'}:
5595 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5596 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5597 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5598
5599
5600 /*
5601 // 2D (pt,eta):
5602 // to be improved (see documentation if I can do all this without looping)
5603 for(Int_t p=1;p<=fnBinsPt;p++)
5604 {
5605 for(Int_t e=1;e<=fnBinsEta;e++)
5606 {
5607 // reduced correlations:
5608 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5609 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5610 for(Int_t nua=0;nua<2;nua++)
5611 {
5612 // QC{2'}:
5613 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5614 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
5615 // QC{4'}:
5616 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5617 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
5618 } // end of for(Int_t nua=0;nua<2;nua++)
5619 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5620 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5621 */
5622
5623} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5624
5625
5626//================================================================================================================================
5627
5628
5629void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5630{
5631 // calculate final results for integrated flow of RPs and POIs
5632
5633 Int_t typeFlag = -1;
5634
5635 if(type == "RP")
5636 {
5637 typeFlag = 0;
5638 } else if(type == "POI")
5639 {
5640 typeFlag = 1;
5641 } else
5642 {
5643 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
5644 exit(0);
5645 }
5646
5647 // shortcuts:
5648 Int_t t = typeFlag;
5649
5650 // pt yield:
5651 TH1F *yield2ndPt = NULL;
5652 TH1F *yield4thPt = NULL;
5653 TH1F *yield6thPt = NULL;
5654 TH1F *yield8thPt = NULL;
5655
5656 if(type == "POI")
5657 {
5658 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5659 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5660 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5661 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5662 }
5663 else if(type == "RP")
5664 {
5665 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5666 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5667 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5668 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5669 }
5670
5671 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5672
5673 TH1D *flow2ndPt = NULL;
5674 TH1D *flow4thPt = NULL;
5675 TH1D *flow6thPt = NULL;
5676 TH1D *flow8thPt = NULL;
5677
5678 // to be improved (hardwired pt index)
5679 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5680 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5681 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5682 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
5683
5684 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5685 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5686
5687 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5688 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5689
5690 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5691 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5692
5693 // looping over pt bins:
5694 for(Int_t p=1;p<nBinsPt+1;p++)
5695 {
5696 dvn2nd = flow2ndPt->GetBinContent(p);
5697 dvn4th = flow4thPt->GetBinContent(p);
5698 dvn6th = flow6thPt->GetBinContent(p);
5699 dvn8th = flow8thPt->GetBinContent(p);
5700
5701 dErrvn2nd = flow2ndPt->GetBinError(p);
5702 dErrvn4th = flow4thPt->GetBinError(p);
5703 dErrvn6th = flow6thPt->GetBinError(p);
5704 dErrvn8th = flow8thPt->GetBinError(p);
5705
5706 dYield2nd = yield2ndPt->GetBinContent(p);
5707 dYield4th = yield4thPt->GetBinContent(p);
5708 dYield6th = yield6thPt->GetBinContent(p);
5709 dYield8th = yield8thPt->GetBinContent(p);
5710
5711 dVn2nd += dvn2nd*dYield2nd;
5712 dVn4th += dvn4th*dYield4th;
5713 dVn6th += dvn6th*dYield6th;
5714 dVn8th += dvn8th*dYield8th;
5715
5716 dSum2nd += dYield2nd;
5717 dSum4th += dYield4th;
5718 dSum6th += dYield6th;
5719 dSum8th += dYield8th;
5720
5721 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5722 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5723 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5724 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5725
5726 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5727
5728 // normalizing the results for integrated flow:
5729 if(dSum2nd)
5730 {
5731 dVn2nd /= dSum2nd;
5732 dErrVn2nd /= (dSum2nd*dSum2nd);
5733 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5734 }
5735 if(dSum4th)
5736 {
5737 dVn4th /= dSum4th;
5738 dErrVn4th /= (dSum4th*dSum4th);
5739 dErrVn4th = TMath::Sqrt(dErrVn4th);
5740 }
5741 //if(dSum6th) dVn6th/=dSum6th;
5742 //if(dSum8th) dVn8th/=dSum8th;
5743
5744 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5745 if(type == "POI")
5746 {
5747 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5748 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5749 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5750 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5751 }
5752 else if (type == "RP")
5753 {
5754 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5755 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5756 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5757 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5758 }
5759
5760 delete flow2ndPt;
5761 delete flow4thPt;
5762 //delete flow6thPt;
5763 //delete flow8thPt;
5764
5765 delete yield2ndPt;
5766 delete yield4thPt;
5767 delete yield6thPt;
5768 delete yield8thPt;
5769
5770} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5771
489d5531 5772//================================================================================================================================
5773
489d5531 5774void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5775{
5776 // Initialize all arrays used for distributions.
5777
5778 // a) Initialize arrays of histograms used to hold distributions of correlations;
5779 // b) Initialize array to hold min and max values of correlations.
5780
5781 // a) Initialize arrays of histograms used to hold distributions of correlations:
5782 for(Int_t di=0;di<4;di++) // distribution index
5783 {
5784 fDistributions[di] = NULL;
5785 }
5786
5787 // b) Initialize default min and max values of correlations:
5788 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5789 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5790 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5791 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5792 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5793 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5794 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5795 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5796 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5797
5798} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5799
489d5531 5800//================================================================================================================================
5801
e5834fcb 5802void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5803{
5804 // Initialize all arrays used for various unclassified objects.
5805
5806 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
5807 {
5808 fPhiDistributionForOneEventSettings[p] = 0.;
5809 }
5810
5811} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5812
5813//================================================================================================================================
489d5531 5814
5815void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5816{
5817 // a) Book profile to hold all flags for distributions of correlations;
5818 // b) Book all histograms to hold distributions of correlations.
5819
5820 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5821
5822 // a) Book profile to hold all flags for distributions of correlations:
5823 TString distributionsFlagsName = "fDistributionsFlags";
5824 distributionsFlagsName += fAnalysisLabel->Data();
5825 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5826 fDistributionsFlags->SetTickLength(-0.01,"Y");
5827 fDistributionsFlags->SetMarkerStyle(25);
5828 fDistributionsFlags->SetLabelSize(0.05);
5829 fDistributionsFlags->SetLabelOffset(0.02,"Y");
5830 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
5831 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
5832 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
5833 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
5834 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
5835 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
5836 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
5837 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
5838 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
5839 fDistributionsList->Add(fDistributionsFlags);
5840
5841 // b) Book all histograms to hold distributions of correlations.
5842 if(fStoreDistributions)
5843 {
5844 TString distributionsName = "fDistributions";
5845 distributionsName += fAnalysisLabel->Data();
5846 for(Int_t di=0;di<4;di++) // distribution index
5847 {
5848 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
5849 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
5850 fDistributionsList->Add(fDistributions[di]);
5851 } // end of for(Int_t di=0;di<4;di++) // distribution index
5852 } // end of if(fStoreDistributions)
5853
5854} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5855
489d5531 5856//================================================================================================================================
5857
e5834fcb 5858void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
5859{
5860 // Book all objects for various unclassified quantities.
5861
5862 if(!fStorePhiDistributionForOneEvent){return;}
5863
5864 // a) Book histogram holding phi distribution for single event to illustrate flow.
5865
5866 // a) Book histogram holding phi distribution for single event to illustrate flow:
5867 fPhiDistributionForOneEvent = new TH1D("fPhiDistributionForOneEvent","",360,0.,TMath::TwoPi());
5868 fPhiDistributionForOneEvent->GetXaxis()->SetTitle("#phi");
5869 fVariousList->Add(fPhiDistributionForOneEvent);
5870
5871} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
5872
5873//================================================================================================================================
489d5531 5874
5875void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5876{
5877 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
5878
5879 if(!fDistributionsFlags)
5880 {
5881 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
5882 exit(0);
5883 }
5884
5885 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
5886 // store min and max values of correlations:
5887 for(Int_t di=0;di<4;di++) // distribution index
5888 {
5889 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
5890 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
5891 }
5892
5893} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5894
5895
5896//================================================================================================================================
5897
5898
5899void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5900{
5901 // Store distributions of correlations.
5902
5903 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
5904 {
5905 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
5906 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
5907 exit(0);
5908 }
5909
5910 for(Int_t di=0;di<4;di++) // distribution index
5911 {
5912 if(!fDistributions[di])
5913 {
5914 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
5915 cout<<"di = "<<di<<endl;
5916 exit(0);
5917 } else
5918 {
5919 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
5920 }
5921 } // end of for(Int_t di=0;di<4;di++) // distribution index
5922
5923} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5924
489d5531 5925//================================================================================================================================
5926
489d5531 5927void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5928{
5929 // Book and nest all lists nested in the base list fHistList.
5930 // a) Book and nest lists for integrated flow;
5931 // b) Book and nest lists for differential flow;
5932 // c) Book and nest list for particle weights;
5933 // d) Book and nest list for distributions;
e5834fcb 5934 // e) Book and nest list for various unclassified objects;
5935 // f) Book and nest list for nested loops.
489d5531 5936
5937 // a) Book and nest all lists for integrated flow:
5938 // base list for integrated flow:
5939 fIntFlowList = new TList();
5940 fIntFlowList->SetName("Integrated Flow");
5941 fIntFlowList->SetOwner(kTRUE);
5942 fHistList->Add(fIntFlowList);
5943 // list holding profiles:
5944 fIntFlowProfiles = new TList();
5945 fIntFlowProfiles->SetName("Profiles");
5946 fIntFlowProfiles->SetOwner(kTRUE);
5947 fIntFlowList->Add(fIntFlowProfiles);
5948 // list holding histograms with results:
5949 fIntFlowResults = new TList();
5950 fIntFlowResults->SetName("Results");
5951 fIntFlowResults->SetOwner(kTRUE);
5952 fIntFlowList->Add(fIntFlowResults);
5953
5954 // b) Book and nest lists for differential flow;
5955 fDiffFlowList = new TList();
5956 fDiffFlowList->SetName("Differential Flow");
5957 fDiffFlowList->SetOwner(kTRUE);
5958 fHistList->Add(fDiffFlowList);
5959 // list holding profiles:
5960 fDiffFlowProfiles = new TList();
5961 fDiffFlowProfiles->SetName("Profiles");
5962 fDiffFlowProfiles->SetOwner(kTRUE);
5963 fDiffFlowList->Add(fDiffFlowProfiles);
5964 // list holding histograms with results:
5965 fDiffFlowResults = new TList();
5966 fDiffFlowResults->SetName("Results");
5967 fDiffFlowResults->SetOwner(kTRUE);
5968 fDiffFlowList->Add(fDiffFlowResults);
5969 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
5970 TList list;
5971 list.SetOwner(kTRUE);
5972 TString typeFlag[2] = {"RP","POI"};
5973 TString ptEtaFlag[2] = {"p_{T}","#eta"};
5974 TString powerFlag[2] = {"linear","quadratic"};
5975 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
5976 for(Int_t t=0;t<2;t++) // type: RP or POI
5977 {
5978 for(Int_t pe=0;pe<2;pe++) // pt or eta
5979 {
5980 // list holding profiles with correlations:
5981 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
5982 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5983 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
5984 // list holding profiles with products of correlations:
5985 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
5986 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5987 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
5988 // list holding profiles with corrections:
5989 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
5990 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5991 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
5992 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5993 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5994 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
5995 for(Int_t t=0;t<2;t++) // type: RP or POI
5996 {
5997 for(Int_t pe=0;pe<2;pe++) // pt or eta
5998 {
5999 // list holding histograms with correlations:
6000 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
6001 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6002 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
6003 // list holding histograms with corrections:
6004 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
6005 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6006 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
6007 for(Int_t power=0;power<2;power++)
6008 {
6009 // list holding histograms with sums of event weights:
6010 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
6011 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6012 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
6013 } // end of for(Int_t power=0;power<2;power++)
6014 // list holding histograms with sums of products of event weights:
6015 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
6016 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6017 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
6018 // list holding histograms with covariances of correlations:
6019 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
6020 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6021 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
6022 // list holding histograms with differential Q-cumulants:
6023 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
6024 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6025 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
6026 // list holding histograms with differential flow estimates from Q-cumulants:
6027 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
6028 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6029 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
6030 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6031 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6032
6033 // c) Book and nest list for particle weights:
6034 fWeightsList->SetName("Weights");
6035 fWeightsList->SetOwner(kTRUE);
6036 fHistList->Add(fWeightsList);
6037
6038 // d) Book and nest list for distributions:
6039 fDistributionsList = new TList();
6040 fDistributionsList->SetName("Distributions");
6041 fDistributionsList->SetOwner(kTRUE);
6042 fHistList->Add(fDistributionsList);
6043
e5834fcb 6044 // e) Book and nest list for various unclassified objects:
6045 if(fStorePhiDistributionForOneEvent)
6046 {
6047 fVariousList = new TList();
6048 fVariousList->SetName("Various");
6049 fVariousList->SetOwner(kTRUE);
6050 fHistList->Add(fVariousList);
6051 }
6052
6053 // f) Book and nest list for nested loops:
489d5531 6054 fNestedLoopsList = new TList();
6055 fNestedLoopsList->SetName("Nested Loops");
6056 fNestedLoopsList->SetOwner(kTRUE);
6057 fHistList->Add(fNestedLoopsList);
6058
6059} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6060
6061
6062//================================================================================================================================
6063
6064
6065void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
6066{
6067 // fill common result histograms for differential flow
6068
6069 Int_t typeFlag = -1;
6070 //Int_t ptEtaFlag = -1;
6071
6072 if(type == "RP")
6073 {
6074 typeFlag = 0;
6075 } else if(type == "POI")
6076 {
6077 typeFlag = 1;
6078 }
6079
6080 // shortcuts:
6081 Int_t t = typeFlag;
6082 //Int_t pe = ptEtaFlag;
6083
6084 // to be improved (implement protection here)
6085
6086 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
6087 {
6088 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
6089 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
6090 exit(0);
6091 }
6092
6093 // pt:
6094 for(Int_t p=1;p<=fnBinsPt;p++)
6095 {
6096 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
6097 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
6098 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
6099 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
6100
6101 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
6102 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
6103 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
6104 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
6105
6106 if(type == "RP")
6107 {
6108 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
6109 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
6110 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
6111 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
6112 } else if(type == "POI")
6113 {
6114 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
6115 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
6116 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
6117 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
6118 }
6119 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6120
6121 // eta:
6122 for(Int_t e=1;e<=fnBinsEta;e++)
6123 {
6124 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
6125 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
6126 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
6127 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
6128
6129 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
6130 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
6131 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
6132 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
6133
6134 if(type == "RP")
6135 {
6136 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6137 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6138 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6139 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6140 } else if(type == "POI")
6141 {
6142 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6143 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6144 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6145 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6146 }
6147 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6148
6149} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6150
489d5531 6151//================================================================================================================================
6152
489d5531 6153void AliFlowAnalysisWithQCumulants::AccessConstants()
6154{
b3dacf6b 6155 // Access needed common constants from AliFlowCommonConstants.
489d5531 6156
6157 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6158 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6159 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6160 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
6161 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6162 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6163 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6164 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
6165 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6166 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6167 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6168 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
6169
6170} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
6171
489d5531 6172//================================================================================================================================
6173
489d5531 6174void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6175{
6176 // a) Cross check if the choice for multiplicity weights make sense;
6177
6178 // a) Cross check if the choice for multiplicity weights make sense:
6179 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6180 strcmp(fMultiplicityWeight->Data(),"unit") &&
6181 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6182 {
6183 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6184 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6185 exit(0);
6186 }
6187
6188} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6189
489d5531 6190//================================================================================================================================
6191
489d5531 6192void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6193{
0328db2d 6194 // Calculate sum of linear and quadratic event weights for correlations.
2001bc3a 6195
6196 // multiplicity:
6197 Double_t dMult = (*fSMpk)(0,0);
9f33751d 6198
489d5531 6199 for(Int_t p=0;p<2;p++) // power-1
6200 {
6201 for(Int_t ci=0;ci<4;ci++) // correlation index
6202 {
6203 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
b3dacf6b 6204 if(fCalculateCumulantsVsM)
6205 {
6206 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
6207 }
489d5531 6208 }
6209 }
6210
6211} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6212
489d5531 6213//================================================================================================================================
6214
0328db2d 6215void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6216{
0328db2d 6217 // Calculate sum of linear and quadratic event weights for NUA terms.
6218
6219 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
489d5531 6220 {
0328db2d 6221 for(Int_t p=0;p<2;p++) // power-1
6222 {
b92ea2b9 6223 for(Int_t ci=0;ci<4;ci++) // nua term index
0328db2d 6224 {
6225 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
489d5531 6226 }
0328db2d 6227 }
6228 }
6229
6230} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6231
0328db2d 6232//================================================================================================================================
6233
0328db2d 6234void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6235{
ff70ca91 6236 // Calculate sum of product of event weights for correlations.
2001bc3a 6237
6238 // multiplicity:
6239 Double_t dMult = (*fSMpk)(0,0);
6240
489d5531 6241 Int_t counter = 0;
6242
6243 for(Int_t ci1=1;ci1<4;ci1++)
6244 {
6245 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6246 {
ff70ca91 6247 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6248 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
b3dacf6b 6249 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6250 if(fCalculateCumulantsVsM)
6251 {
6252 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
6253 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6254 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6255 } // end of if(fCalculateCumulantsVsM)
ff70ca91 6256 counter++;
489d5531 6257 }
6258 }
6259
0328db2d 6260} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6261
0328db2d 6262//================================================================================================================================
6263
0328db2d 6264void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6265{
6266 // Calculate sum of product of event weights for NUA terms.
6267
6268 // w_{<2>} * w_{<cos(#phi)>}:
6269 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6270 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6271 // w_{<2>} * w_{<sin(#phi)>}:
6272 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6273 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6274 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6275 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6276 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6277 // w_{<2>} * w{<cos(phi1+phi2)>}
6278 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6279 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6280 // w_{<2>} * w{<sin(phi1+phi2)>}
6281 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6282 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6283 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6284 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6285 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6286 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6287 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6288 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6289 // w_{<4>} * w{<cos(phi1)>}
6290 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6291 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6292 // w_{<4>} * w{<sin(phi1)>}
6293 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6294 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6295 // w_{<4>} * w{<cos(phi1+phi2)>}
6296 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6297 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6298 // w_{<4>} * w{<sin(phi1+phi2)>}
6299 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6300 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6301 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6302 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6303 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6304 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6305 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6306 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6307 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6308 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6309 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6310 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6311 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6312 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6313 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6314 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6315 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6316 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6317 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6318 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6319 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6320 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6321 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6322 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6323 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6324 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6325 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6326 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6327 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6328 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6329 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6330 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6331 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6332 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6333 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6334 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6335 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6336 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6337 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6338 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6339 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6340 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6341 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6342 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6343 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6344 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6345 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6346 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6347 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6348 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6349
6350} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
489d5531 6351
6352
6353//================================================================================================================================
6354
6355
6356void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6357{
6358 // calculate reduced correlations for RPs or POIs in pt or eta bins
6359
6360 // multiplicity:
6361 Double_t dMult = (*fSMpk)(0,0);
6362
6363 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6364 Double_t dReQ1n = (*fReQ)(0,0);
6365 Double_t dReQ2n = (*fReQ)(1,0);
6366 //Double_t dReQ3n = (*fReQ)(2,0);
6367 //Double_t dReQ4n = (*fReQ)(3,0);
6368 Double_t dImQ1n = (*fImQ)(0,0);
6369 Double_t dImQ2n = (*fImQ)(1,0);
6370 //Double_t dImQ3n = (*fImQ)(2,0);
6371 //Double_t dImQ4n = (*fImQ)(3,0);
6372
6373 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6374 //
6375 // 0: <<2'>>
6376 // 1: <<4'>>
6377 // 2: <<6'>>
6378 // 3: <<8'>>
6379
6380 Int_t t = -1; // type flag
6381 Int_t pe = -1; // ptEta flag
6382
6383 if(type == "RP")
6384 {
6385 t = 0;
6386 } else if(type == "POI")
6387 {
6388 t = 1;
6389 }
6390
6391 if(ptOrEta == "Pt")
6392 {
6393 pe = 0;
6394 } else if(ptOrEta == "Eta")
6395 {
6396 pe = 1;
6397 }
6398
6399 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6400 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6401 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6402 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6403
6404 // looping over all bins and calculating reduced correlations:
6405 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6406 {
6407 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6408 Double_t p1n0kRe = 0.;
6409 Double_t p1n0kIm = 0.;
6410
6411 // number of POIs in particular pt or eta bin:
6412 Double_t mp = 0.;
6413
6414 // 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):
6415 Double_t q1n0kRe = 0.;
6416 Double_t q1n0kIm = 0.;
6417 Double_t q2n0kRe = 0.;
6418 Double_t q2n0kIm = 0.;
6419
6420 // number of particles which are both RPs and POIs in particular pt or eta bin:
6421 Double_t mq = 0.;
6422
6423 if(type == "POI")
6424 {
6425 // q_{m*n,0}:
6426 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6427 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6428 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6429 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6430 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6431 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6432 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6433 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6434
6435 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6436 }
6437 else if(type == "RP")
6438 {
6439 // q_{m*n,0}:
6440 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6441 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6442 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6443 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6444 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6445 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6446 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6447 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6448
6449 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6450 }
6451
6452 if(type == "POI")
6453 {
6454 // p_{m*n,0}:
6455 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6456 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6457 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6458 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6459
6460 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6461
6462 t = 1; // typeFlag = RP or POI
6463 }
6464 else if(type == "RP")
6465 {
6466 // p_{m*n,0} = q_{m*n,0}:
6467 p1n0kRe = q1n0kRe;
6468 p1n0kIm = q1n0kIm;
6469
6470 mp = mq;
6471
6472 t = 0; // typeFlag = RP or POI
6473 }
6474
6475 // 2'-particle correlation for particular (pt,eta) bin:
6476 Double_t two1n1nPtEta = 0.;
6477 if(mp*dMult-mq)
6478 {
6479 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6480 / (mp*dMult-mq);
6481
6482 if(type == "POI") // to be improved (I do not this if)
6483 {
6484 // fill profile to get <<2'>> for POIs
6485 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6486 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6487 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
6488 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq);
6489 }
6490 else if(type == "RP") // to be improved (I do not this if)
6491 {
6492 // profile to get <<2'>> for RPs:
6493 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6494 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6495 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
6496 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq);
6497 }
6498 } // end of if(mp*dMult-mq)
6499
6500 // 4'-particle correlation:
6501 Double_t four1n1n1n1nPtEta = 0.;
6502 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6503 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6504 {
6505 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6506 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6507 - 2.*q2n0kIm*dReQ1n*dImQ1n
6508 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6509 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6510 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6511 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6512 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6513 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6514 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6515 + 2.*mq*dMult
6516 - 6.*mq)
6517 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6518 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6519
6520 if(type == "POI")
6521 {
6522 // profile to get <<4'>> for POIs:
6523 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6524 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6525 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6526 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6527 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6528 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6529 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6530 }
6531 else if(type == "RP")
6532 {
6533 // profile to get <<4'>> for RPs:
6534 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6535 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6536 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6537 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6538 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6539 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6540 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6541 }
6542 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6543 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6544
6545 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6546
6547
6548} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6549
6550
6551//================================================================================================================================
6552
6553
6554void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6555{
6556 // Calculate sums of various event weights for reduced correlations.
6557 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6558
6559 Int_t typeFlag = -1;
6560 Int_t ptEtaFlag = -1;
6561
6562 if(type == "RP")
6563 {
6564 typeFlag = 0;
6565 } else if(type == "POI")
6566 {
6567 typeFlag = 1;
6568 }
6569
6570 if(ptOrEta == "Pt")
6571 {
6572 ptEtaFlag = 0;
6573 } else if(ptOrEta == "Eta")
6574 {
6575 ptEtaFlag = 1;
6576 }
6577
6578 // shortcuts:
6579 Int_t t = typeFlag;
6580 Int_t pe = ptEtaFlag;
6581
6582 // binning:
6583 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6584 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6585 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6586 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6587
6588 for(Int_t rpq=0;rpq<3;rpq++)
6589 {
6590 for(Int_t m=0;m<4;m++)
6591 {
6592 for(Int_t k=0;k<9;k++)
6593 {
6594 if(!fReRPQ1dEBE[rpq][pe][m][k])
6595 {
6596 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6597 cout<<"pe = "<<pe<<endl;
6598 cout<<"rpq = "<<rpq<<endl;
6599 cout<<"m = "<<m<<endl;
6600 cout<<"k = "<<k<<endl;
6601 exit(0);
6602 }
6603 }
6604 }
6605 }
6606
6607 // multiplicities:
6608 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6609 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6610 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6611 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6612
6613 // event weights for reduced correlations:
6614 Double_t dw2 = 0.; // event weight for <2'>
6615 Double_t dw4 = 0.; // event weight for <4'>
6616 //Double_t dw6 = 0.; // event weight for <6'>
6617 //Double_t dw8 = 0.; // event weight for <8'>
6618
6619 // looping over bins:
6620 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6621 {
6622 if(type == "RP")
6623 {
6624 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6625 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6626 } else if(type == "POI")
6627 {
6628 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6629 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6630 }
6631
6632 // event weight for <2'>:
6633 dw2 = mp*dMult-mq;
6634 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6635 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6636
6637 // event weight for <4'>:
6638 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6639 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6640 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6641 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6642
6643 // event weight for <6'>:
6644 //dw6 = ...;
6645 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6646 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6647
6648 // event weight for <8'>:
6649 //dw8 = ...;
6650 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6651 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6652 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6653
6654} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6655
6656
6657//================================================================================================================================
6658
6659
6660void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6661{
6662 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6663 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6664 //
6665 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6666 // 1.) i<j
6667 // 2.) do not store terms which DO NOT include reduced correlations;
6668 // Table:
6669 // [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'>]
6670
6671 Int_t typeFlag = -1;
6672 Int_t ptEtaFlag = -1;
6673
6674 if(type == "RP")
6675 {
6676 typeFlag = 0;
6677 } else if(type == "POI")
6678 {
6679 typeFlag = 1;
6680 }
6681
6682 if(ptOrEta == "Pt")
6683 {
6684 ptEtaFlag = 0;
6685 } else if(ptOrEta == "Eta")
6686 {
6687 ptEtaFlag = 1;
6688 }
6689
6690 // shortcuts:
6691 Int_t t = typeFlag;
6692 Int_t pe = ptEtaFlag;
6693
6694 // binning:
6695 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6696 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6697 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6698 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6699
6700 // protection:
6701 for(Int_t rpq=0;rpq<3;rpq++)
6702 {
6703 for(Int_t m=0;m<4;m++)
6704 {
6705 for(Int_t k=0;k<9;k++)
6706 {
6707 if(!fReRPQ1dEBE[rpq][pe][m][k])
6708 {
6709 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6710 cout<<"pe = "<<pe<<endl;
6711 cout<<"rpq = "<<rpq<<endl;
6712 cout<<"m = "<<m<<endl;
6713 cout<<"k = "<<k<<endl;
6714 exit(0);
6715 }
6716 }
6717 }
6718 }
6719
6720 // multiplicities:
6721 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6722 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6723 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6724 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6725
6726 // event weights for correlations:
6727 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6728 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6729 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6730 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6731
6732 // event weights for reduced correlations:
6733 Double_t dw2 = 0.; // event weight for <2'>
6734 Double_t dw4 = 0.; // event weight for <4'>
6735 //Double_t dw6 = 0.; // event weight for <6'>
6736 //Double_t dw8 = 0.; // event weight for <8'>
6737
6738 // looping over bins:
6739 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6740 {
6741 if(type == "RP")
6742 {
6743 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6744 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6745 } else if(type == "POI")
6746 {
6747 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6748 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6749 }
6750
6751 // event weight for <2'>:
6752 dw2 = mp*dMult-mq;
6753 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6754 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6755 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6756 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6757
6758 // event weight for <4'>:
6759 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6760 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6761 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6762 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6763 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6764 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6765 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6766
6767 // event weight for <6'>:
6768 //dw6 = ...;
6769 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6770 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6771 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6772 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6773 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6774 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6775 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6776
6777 // event weight for <8'>:
6778 //dw8 = ...;
6779 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6780 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6781 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6782 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6783 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6784 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6785 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6786
6787 // Table:
6788 // [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'>]
6789
6790 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6791
6792
6793
6794} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6795
6796
6797//================================================================================================================================
6798
6799
6800void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6801{
6802 // Transfer profiles into histograms and calculate statistical errors correctly.
6803
6804 Int_t typeFlag = -1;
6805 Int_t ptEtaFlag = -1;
6806
6807 if(type == "RP")
6808 {
6809 typeFlag = 0;
6810 } else if(type == "POI")
6811 {
6812 typeFlag = 1;
6813 }
6814
6815 if(ptOrEta == "Pt")
6816 {
6817 ptEtaFlag = 0;
6818 } else if(ptOrEta == "Eta")
6819 {
6820 ptEtaFlag = 1;
6821 }
6822
6823 // shortcuts:
6824 Int_t t = typeFlag;
6825 Int_t pe = ptEtaFlag;
6826
6827 for(Int_t rci=0;rci<4;rci++)
6828 {
6829 if(!fDiffFlowCorrelationsPro[t][pe][rci])
6830 {
6831 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6832 cout<<"t = "<<t<<endl;
6833 cout<<"pe = "<<pe<<endl;
6834 cout<<"rci = "<<rci<<endl;
6835 exit(0);
6836 }
6837 for(Int_t power=0;power<2;power++)
6838 {
6839 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
6840 {
6841 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6842 cout<<"t = "<<t<<endl;
6843 cout<<"pe = "<<pe<<endl;
6844 cout<<"power = "<<power<<endl;
6845 cout<<"rci = "<<rci<<endl;
6846 exit(0);
6847 }
6848 } // end of for(Int_t power=0;power<2;power++)
6849 } // end of for(Int_t rci=0;rci<4;rci++)
6850
6851 // common:
6852 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6853
6854 // transfer 1D profile into 1D histogram:
6855 Double_t correlation = 0.;
6856 Double_t spread = 0.;
6857 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
6858 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
6859 Double_t error = 0.; // error = termA * spread * termB
6860 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
6861 // termB = 1/pow(1-termA^2,0.5)
6862 Double_t termA = 0.;
6863 Double_t termB = 0.;
6864 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
6865 {
6866 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
6867 {
6868 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
6869 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);
6870 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
6871 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
6872 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
6873 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
6874 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
6875 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
6876 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
6877 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6878 } // end of for(Int_t rci=0;rci<4;rci++)
6879
6880} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6881
6882
6883//================================================================================================================================
6884
6885
6886void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6887{
6888 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
6889 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
6890 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
6891 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
6892 // <6'><8'>, <8><8'>.
6893
6894 Int_t typeFlag = -1;
6895 Int_t ptEtaFlag = -1;
6896
6897 if(type == "RP")
6898 {
6899 typeFlag = 0;
6900 } else if(type == "POI")
6901 {
6902 typeFlag = 1;
6903 }
6904
6905 if(ptOrEta == "Pt")
6906 {
6907 ptEtaFlag = 0;
6908 } else if(ptOrEta == "Eta")
6909 {
6910 ptEtaFlag = 1;
6911 }
6912
6913 // shortcuts:
6914 Int_t t = typeFlag;
6915 Int_t pe = ptEtaFlag;
6916
6917 // common:
6918 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6919 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6920 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6921
6922 // protections // to be improved (add protection for all pointers in this method)
6923 if(!fIntFlowCorrelationsEBE)
6924 {
6925 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
6926 exit(0);
6927 }
6928
6929 /*
6930 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
6931 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6932 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6933 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6934 */
6935
6936 // e-b-e correlations:
6937 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
6938 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
6939 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
6940 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
6941
6942 // event weights for correlations:
6943 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
6944 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
6945 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
6946 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
6947
6948 // e-b-e reduced correlations:
6949 Double_t twoReducedEBE = 0.; // <2'>
6950 Double_t fourReducedEBE = 0.; // <4'>
6951 Double_t sixReducedEBE = 0.; // <6'>
6952 Double_t eightReducedEBE = 0.; // <8'>
6953
6954 // event weights for reduced correlations:
6955 Double_t dw2 = 0.; // event weight for <2'>
6956 Double_t dw4 = 0.; // event weight for <4'>
6957 //Double_t dw6 = 0.; // event weight for <6'>
6958 //Double_t dw8 = 0.; // event weight for <8'>
6959
6960 // looping over bins:
6961 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6962 {
6963 // e-b-e reduced correlations:
6964 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
6965 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
6966 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
6967 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
6968
6969 /*
6970 // to be improved (I should not do this here again)
6971 if(type == "RP")
6972 {
6973 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6974 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6975 } else if(type == "POI")
6976 {
6977 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6978 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6979 }
6980
6981 // event weights for reduced correlations:
6982 dw2 = mp*dMult-mq; // weight for <2'>
6983 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6984 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
6985 //dw6 = ...
6986 //dw8 = ...
6987
6988 */
6989
6990 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
6991 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
6992
6993 // storing all products:
6994 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
6995 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
6996 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
6997 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
6998
6999 // event weight for <4'>:
7000 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
7001 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
7002 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
7003 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
7004 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
7005
7006 // event weight for <6'>:
7007 //dw6 = ...;
7008 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
7009 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
7010 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
7011 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
7012 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
7013 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
7014 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7015
7016 // event weight for <8'>:
7017 //dw8 = ...;
7018 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
7019 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
7020 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
7021 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
7022 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
7023 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7024 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
7025 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
7026
7027} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7028
7029
7030//================================================================================================================================
7031
7032
7033void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
7034{
7035 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
7036 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
7037 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
7038 //
7039 // 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)]
7040 //
7041 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
7042 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
7043 //
7044 // 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)]
7045 // 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)]
7046 // 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)]
7047 // 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)]
7048 // 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)]
7049 // ...
7050
7051 Int_t typeFlag = -1;
7052 Int_t ptEtaFlag = -1;
7053
7054 if(type == "RP")
7055 {
7056 typeFlag = 0;
7057 } else if(type == "POI")
7058 {
7059 typeFlag = 1;
7060 }
7061
7062 if(ptOrEta == "Pt")
7063 {
7064 ptEtaFlag = 0;
7065 } else if(ptOrEta == "Eta")
7066 {
7067 ptEtaFlag = 1;
7068 }
7069
7070 // shortcuts:
7071 Int_t t = typeFlag;
7072 Int_t pe = ptEtaFlag;
7073
7074 // common:
7075 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7076 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
7077 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7078 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7079
7080 // average correlations:
7081 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7082 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7083 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
7084 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7085
7086 // sum of weights for correlation:
7087 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
7088 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7089 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7090 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7091
7092 // average reduced correlations:
7093 Double_t twoReduced = 0.; // <<2'>>
7094 Double_t fourReduced = 0.; // <<4'>>
7095 //Double_t sixReduced = 0.; // <<6'>>
7096 //Double_t eightReduced = 0.; // <<8'>>
7097
7098 // sum of weights for reduced correlation:
7099 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7100 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7101 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7102 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7103
7104 // product of weights for reduced correlation:
7105 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7106 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7107 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7108 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7109 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7110 // ...
7111
7112 // products for differential flow:
7113 Double_t twoTwoReduced = 0; // <<2><2'>>
7114 Double_t twoFourReduced = 0; // <<2><4'>>
7115 Double_t fourTwoReduced = 0; // <<4><2'>>
7116 Double_t fourFourReduced = 0; // <<4><4'>>
7117 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7118
7119 // denominators in the expressions for the unbiased estimators for covariances:
7120 // denominator = 1 - term1/(term2*term3)
7121 // prefactor = term1/(term2*term3)
7122 Double_t denominator = 0.;
7123 Double_t prefactor = 0.;
7124 Double_t term1 = 0.;
7125 Double_t term2 = 0.;
7126 Double_t term3 = 0.;
7127
7128 // unbiased estimators for covariances for differential flow:
7129 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7130 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7131 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7132 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7133 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7134 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7135 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7136 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7137 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7138 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7139
7140 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7141 {
7142 // average reduced corelations:
7143 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7144 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7145 // average products:
7146 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7147 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7148 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7149 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7150 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7151 // sum of weights for reduced correlations:
7152 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7153 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7154 // products of weights for correlations:
7155 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7156 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7157 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7158 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7159 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7160 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7161 // prefactor (multiplies Cov's) = term1/(term2*term3)
7162 // <2>,<2'>:
7163 term1 = productOfWeightsForTwoTwoReduced;
7164 term2 = sumOfWeightsForTwo;
7165 term3 = sumOfWeightsForTwoReduced;
7166 if(term2*term3>0.)
7167 {
7168 denominator = 1.-term1/(term2*term3);
7169 prefactor = term1/(term2*term3);
0328db2d 7170 if(TMath::Abs(denominator)>1e-6)
489d5531 7171 {
7172 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7173 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7174 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7175 }
7176 }
7177 // <2>,<4'>:
7178 term1 = productOfWeightsForTwoFourReduced;
7179 term2 = sumOfWeightsForTwo;
7180 term3 = sumOfWeightsForFourReduced;
7181 if(term2*term3>0.)
7182 {
7183 denominator = 1.-term1/(term2*term3);
7184 prefactor = term1/(term2*term3);
0328db2d 7185 if(TMath::Abs(denominator)>1e-6)
489d5531 7186 {
7187 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7188 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7189 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7190 }
7191 }
7192 // <4>,<2'>:
7193 term1 = productOfWeightsForFourTwoReduced;
7194 term2 = sumOfWeightsForFour;
7195 term3 = sumOfWeightsForTwoReduced;
7196 if(term2*term3>0.)
7197 {
7198 denominator = 1.-term1/(term2*term3);
7199 prefactor = term1/(term2*term3);
0328db2d 7200 if(TMath::Abs(denominator)>1e-6)
489d5531 7201 {
7202 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7203 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7204 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7205 }
7206 }
7207 // <4>,<4'>:
7208 term1 = productOfWeightsForFourFourReduced;
7209 term2 = sumOfWeightsForFour;
7210 term3 = sumOfWeightsForFourReduced;
7211 if(term2*term3>0.)
7212 {
7213 denominator = 1.-term1/(term2*term3);
7214 prefactor = term1/(term2*term3);
0328db2d 7215 if(TMath::Abs(denominator)>1e-6)
489d5531 7216 {
7217 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7218 wCovFourFourReduced = covFourFourReduced*prefactor;
7219 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7220 }
7221 }
7222 // <2'>,<4'>:
7223 term1 = productOfWeightsForTwoReducedFourReduced;
7224 term2 = sumOfWeightsForTwoReduced;
7225 term3 = sumOfWeightsForFourReduced;
7226 if(term2*term3>0.)
7227 {
7228 denominator = 1.-term1/(term2*term3);
7229 prefactor = term1/(term2*term3);
0328db2d 7230 if(TMath::Abs(denominator)>1e-6)
489d5531 7231 {
7232 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7233 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7234 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7235 }
7236 }
7237 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7238
7239} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
7240
7241
7242//================================================================================================================================
7243
7244
7245void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
7246{
7247 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)
7248
7249 Int_t typeFlag = -1;
7250 Int_t ptEtaFlag = -1;
7251
7252 if(type == "RP")
7253 {
7254 typeFlag = 0;
7255 } else if(type == "POI")
7256 {
7257 typeFlag = 1;
7258 }
7259
7260 if(ptOrEta == "Pt")
7261 {
7262 ptEtaFlag = 0;
7263 } else if(ptOrEta == "Eta")
7264 {
7265 ptEtaFlag = 1;
7266 }
7267
7268 // shortcuts:
7269 Int_t t = typeFlag;
7270 Int_t pe = ptEtaFlag;
7271
7272 // common:
7273 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7274
7275 // correlations:
7276 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7277 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7278
7279 // statistical errors of correlations:
7280 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
7281 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
7282
7283 // reduced correlations:
7284 Double_t twoReduced = 0.; // <<2'>>
7285 Double_t fourReduced = 0.; // <<4'>>
7286
7287 // statistical errors of reduced correlations:
7288 Double_t twoReducedError = 0.;
7289 Double_t fourReducedError = 0.;
7290
7291 // covariances:
8e1cefdd 7292 Double_t wCovTwoFour = 0.; // Cov(<2>,<4>) * prefactor(<2>,<4>)
7293 if(!fForgetAboutCovariances)
7294 {
7295 wCovTwoFour = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(<2>,<4>)
7296 }
489d5531 7297 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
7298 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
7299 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
7300 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
7301 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
7302
7303 // differential flow:
7304 Double_t v2Prime = 0.; // v'{2}
7305 Double_t v4Prime = 0.; // v'{4}
7306
7307 // statistical error of differential flow:
7308 Double_t v2PrimeError = 0.;
7309 Double_t v4PrimeError = 0.;
7310
7311 // squared statistical error of differential flow:
7312 Double_t v2PrimeErrorSquared = 0.;
7313 Double_t v4PrimeErrorSquared = 0.;
7314
7315 // loop over pt or eta bins:
7316 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7317 {
7318 // reduced correlations and statistical errors:
7319 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7320 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
7321 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7322 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
7323 // covariances:
8e1cefdd 7324 if(!fForgetAboutCovariances)
7325 {
7326 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
7327 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
7328 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
7329 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
7330 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
7331 }
489d5531 7332 // differential flow:
7333 // v'{2}:
7334 if(two>0.)
7335 {
7336 v2Prime = twoReduced/pow(two,0.5);
7337 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
7338 (pow(twoReduced,2.)*pow(twoError,2.)
7339 + 4.*pow(two,2.)*pow(twoReducedError,2.)
7340 - 4.*two*twoReduced*wCovTwoTwoReduced);
7341
7342
7343 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
7344 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
60694576 7345 if(TMath::Abs(v2Prime)>1.e-44)fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
489d5531 7346 }
7347 // differential flow:
7348 // v'{4}
7349 if(2.*pow(two,2.)-four > 0.)
7350 {
7351 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
7352 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
7353 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
7354 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
7355 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
7356 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
7357 - (3./2.)*(2.*two*twoReduced-fourReduced)
7358 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
7359 - 4.*two*(2.*pow(two,2.)-four)
7360 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
7361 + 2.*(2.*pow(two,2.)-four)
7362 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
7363 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
7364 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
7365 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
7366 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
7367 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
60694576 7368 if(TMath::Abs(v4Prime)>1.e-44)fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
489d5531 7369 }
7370
7371 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
7372
7373
7374
7375
7376 /*
7377 // 2D:
7378 for(Int_t nua=0;nua<2;nua++)
7379 {
7380 for(Int_t p=1;p<=fnBinsPt;p++)
7381 {
7382 for(Int_t e=1;e<=fnBinsEta;e++)
7383 {
7384 // differential cumulants:
7385 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
7386 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
7387 // differential flow:
7388 Double_t v2Prime = 0.;
7389 Double_t v4Prime = 0.;
7390 if(v2)
7391 {
7392 v2Prime = qc2Prime/v2;
7393 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
7394 }
7395 if(v4)
7396 {
7397 v4Prime = -qc4Prime/pow(v4,3.);
7398 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
7399 }
7400 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7401 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7402 } // end of for(Int_t nua=0;nua<2;nua++)
7403 */
7404
7405} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7406
489d5531 7407//================================================================================================================================
7408
489d5531 7409void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7410{
7411 // a) Store all flags for integrated flow in profile fIntFlowFlags.
7412
7413 if(!fIntFlowFlags)
7414 {
7415 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
7416 exit(0);
7417 }
7418
7419 // particle weights used or not:
7420 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
7421 // which event weights were used:
7422 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
7423 {
7424 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
7425 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
7426 {
7427 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
7428 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
7429 {
7430 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7431 }
7432 // corrected for non-uniform acceptance or not:
7433 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7434 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7435 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7436 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
b3dacf6b 7437 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
7438 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
b77b6434 7439 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorAlsoFromNIT);
b3dacf6b 7440 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
0dd3b008 7441 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
8e1cefdd 7442 fIntFlowFlags->Fill(11.5,(Int_t)fForgetAboutCovariances);
e5834fcb 7443 fIntFlowFlags->Fill(12.5,(Int_t)fStorePhiDistributionForOneEvent);
489d5531 7444} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7445
489d5531 7446//================================================================================================================================
7447
489d5531 7448void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7449{
7450 // Store all flags for differential flow in the profile fDiffFlowFlags.
7451
7452 if(!fDiffFlowFlags)
7453 {
7454 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;
7455 exit(0);
7456 }
7457
7458 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not
7459 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved
7460 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7461 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not
7462
7463} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7464
7465
7466//================================================================================================================================
7467
7468
7469void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7470{
7471 // Access all pointers to common control and common result histograms and profiles.
7472
7473 TString commonHistsName = "AliFlowCommonHistQC";
7474 commonHistsName += fAnalysisLabel->Data();
7475 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
b77b6434 7476 if(commonHist)
7477 {
7478 this->SetCommonHists(commonHist);
7479 if(fCommonHists->GetHarmonic())
7480 {
7481 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
7482 }
7483 } // end of if(commonHist)
489d5531 7484 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7485 commonHists2ndOrderName += fAnalysisLabel->Data();
7486 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7487 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7488 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7489 commonHists4thOrderName += fAnalysisLabel->Data();
7490 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7491 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7492 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7493 commonHists6thOrderName += fAnalysisLabel->Data();
7494 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7495 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7496 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7497 commonHists8thOrderName += fAnalysisLabel->Data();
7498 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
7499 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7500 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7501 commonHistResults2ndOrderName += fAnalysisLabel->Data();
b77b6434 7502 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
7503 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
489d5531 7504 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7505 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7506 commonHistResults4thOrderName += fAnalysisLabel->Data();
7507 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7508 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7509 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7510 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7511 commonHistResults6thOrderName += fAnalysisLabel->Data();
7512 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7513 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7514 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7515 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7516 commonHistResults8thOrderName += fAnalysisLabel->Data();
7517 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7518 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7519 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7520
7521} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7522
7523
7524//================================================================================================================================
7525
7526
7527void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7528{
7529 // Get pointers for histograms with particle weights.
7530
7531 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
7532 if(weightsList) this->SetWeightsList(weightsList);
7533 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7534 fUseParticleWeightsName += fAnalysisLabel->Data();
7535 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7536 if(useParticleWeights)
7537 {
7538 this->SetUseParticleWeights(useParticleWeights);
7539 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7540 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7541 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7542 }
7543} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7544
7545
7546//================================================================================================================================
7547
7548
7549void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7550{
7551 // Get pointers for histograms and profiles relevant for integrated flow:
7552 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7553 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7554 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7555 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7556
7557 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7558 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
ff70ca91 7559 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"}; // to be improved (should I promote this to data member?)
489d5531 7560
7561 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7562 TList *intFlowList = NULL;
7563 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7564 if(!intFlowList)
7565 {
7566 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7567 exit(0);
7568 }
7569
b92ea2b9 7570 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7571 TString intFlowFlagsName = "fIntFlowFlags";
7572 intFlowFlagsName += fAnalysisLabel->Data();
7573 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7574 if(intFlowFlags)
7575 {
7576 this->SetIntFlowFlags(intFlowFlags);
7577 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
7578 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
7579 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
7580 } else
7581 {
7582 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7583 }
489d5531 7584
7585 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7586 TList *intFlowProfiles = NULL;
7587 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7588 if(intFlowProfiles)
7589 {
7590 // average multiplicities:
7591 TString avMultiplicityName = "fAvMultiplicity";
7592 avMultiplicityName += fAnalysisLabel->Data();
7593 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7594 if(avMultiplicity)
7595 {
7596 this->SetAvMultiplicity(avMultiplicity);
7597 } else
7598 {
7599 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7600 }
7601 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7602 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7603 intFlowCorrelationsProName += fAnalysisLabel->Data();
7604 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7605 if(intFlowCorrelationsPro)
7606 {
7607 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7608 } else
7609 {
7610 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7611 }
7612 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
b3dacf6b 7613 if(fCalculateCumulantsVsM)
ff70ca91 7614 {
b3dacf6b 7615 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7616 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7617 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7618 {
b3dacf6b 7619 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7620 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7621 if(intFlowCorrelationsVsMPro)
7622 {
7623 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7624 } else
7625 {
7626 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7627 }
7628 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7629 } // end of if(fCalculateCumulantsVsM)
489d5531 7630 // average all correlations for integrated flow (with wrong errors!):
7631 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7632 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7633 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7634 if(intFlowCorrelationsAllPro)
7635 {
7636 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7637 } else
7638 {
7639 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7640 }
7641 // average extra correlations for integrated flow (which appear only when particle weights are used):
7642 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7643 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7644 {
7645 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7646 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7647 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7648 if(intFlowExtraCorrelationsPro)
7649 {
7650 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7651 } else
7652 {
7653 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7654 }
7655 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7656 // average products of correlations <2>, <4>, <6> and <8>:
7657 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7658 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7659 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7660 if(intFlowProductOfCorrelationsPro)
7661 {
7662 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7663 } else
7664 {
7665 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7666 }
7667 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7668 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 7669 if(fCalculateCumulantsVsM)
7670 {
7671 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7672 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7673 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7674 for(Int_t pi=0;pi<6;pi++)
7675 {
7676 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7677 if(intFlowProductOfCorrelationsVsMPro)
7678 {
7679 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7680 } else
7681 {
7682 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7683 }
7684 } // end of for(Int_t pi=0;pi<6;pi++)
7685 } // end of if(fCalculateCumulantsVsM)
489d5531 7686 // average correction terms for non-uniform acceptance (with wrong errors!):
7687 for(Int_t sc=0;sc<2;sc++)
7688 {
7689 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7690 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7691 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7692 if(intFlowCorrectionTermsForNUAPro)
7693 {
7694 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7695 } else
7696 {
7697 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7698 cout<<"sc = "<<sc<<endl;
7699 }
2001bc3a 7700 // versus multiplicity:
b3dacf6b 7701 if(fCalculateCumulantsVsM)
2001bc3a 7702 {
b3dacf6b 7703 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
7704 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
7705 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
7706 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 7707 {
b3dacf6b 7708 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
7709 if(intFlowCorrectionTermsForNUAVsMPro)
7710 {
7711 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
7712 } else
7713 {
7714 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7715 cout<<"sc = "<<sc<<endl;
7716 cout<<"ci = "<<ci<<endl;
7717 }
7718 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7719 } // end of if(fCalculateCumulantsVsM)
489d5531 7720 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 7721 // average products of correction terms for NUA:
7722 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7723 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7724 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7725 if(intFlowProductOfCorrectionTermsForNUAPro)
7726 {
7727 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7728 } else
7729 {
7730 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7731 }
489d5531 7732 } else // to if(intFlowProfiles)
7733 {
7734 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7735 }
7736
7737 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7738 TList *intFlowResults = NULL;
7739 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7740 if(intFlowResults)
7741 {
7742 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7743 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7744 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7745 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7746 if(intFlowCorrelationsHist)
7747 {
7748 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7749 } else
7750 {
7751 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7752 }
ff70ca91 7753 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
b3dacf6b 7754 if(fCalculateCumulantsVsM)
ff70ca91 7755 {
b3dacf6b 7756 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7757 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7758 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7759 {
b3dacf6b 7760 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7761 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7762 if(intFlowCorrelationsVsMHist)
7763 {
7764 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7765 } else
7766 {
7767 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7768 }
7769 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7770 } // end of if(fCalculateCumulantsVsM)
489d5531 7771 // average all correlations for integrated flow (with correct errors!):
7772 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7773 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7774 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7775 if(intFlowCorrelationsAllHist)
7776 {
7777 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7778 } else
7779 {
7780 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7781 }
7782 // average correction terms for non-uniform acceptance (with correct errors!):
7783 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7784 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7785 for(Int_t sc=0;sc<2;sc++)
7786 {
7787 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7788 if(intFlowCorrectionTermsForNUAHist)
7789 {
7790 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7791 } else
7792 {
7793 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7794 cout<<"sc = "<<sc<<endl;
7795 }
7796 } // end of for(Int_t sc=0;sc<2;sc++)
7797 // covariances (multiplied with weight dependent prefactor):
7798 TString intFlowCovariancesName = "fIntFlowCovariances";
7799 intFlowCovariancesName += fAnalysisLabel->Data();
7800 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7801 if(intFlowCovariances)
7802 {
7803 this->SetIntFlowCovariances(intFlowCovariances);
7804 } else
7805 {
7806 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7807 }
7808 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7809 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7810 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7811 for(Int_t power=0;power<2;power++)
7812 {
7813 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7814 if(intFlowSumOfEventWeights)
7815 {
7816 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7817 } else
7818 {
7819 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7820 cout<<"power = "<<power<<endl;
7821 }
7822 } // end of for(Int_t power=0;power<2;power++)
7823 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7824 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7825 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7826 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7827 if(intFlowSumOfProductOfEventWeights)
7828 {
7829 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7830 } else
7831 {
7832 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7833 }
ff70ca91 7834 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7835 // [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 7836 if(fCalculateCumulantsVsM)
ff70ca91 7837 {
b3dacf6b 7838 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7839 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7840 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7841 for(Int_t ci=0;ci<6;ci++)
7842 {
7843 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7844 if(intFlowCovariancesVsM)
ff70ca91 7845 {
b3dacf6b 7846 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
ff70ca91 7847 } else
7848 {
b3dacf6b 7849 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7850 }
b3dacf6b 7851 } // end of for(Int_t ci=0;ci<6;ci++)
7852 } // end of if(fCalculateCumulantsVsM)
7853 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7854 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7855 if(fCalculateCumulantsVsM)
7856 {
7857 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7858 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7859 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>}"},
7860 {"#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}"}};
7861 for(Int_t si=0;si<4;si++)
7862 {
7863 for(Int_t power=0;power<2;power++)
7864 {
7865 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7866 if(intFlowSumOfEventWeightsVsM)
7867 {
7868 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7869 } else
7870 {
7871 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7872 }
7873 } // end of for(Int_t power=0;power<2;power++)
7874 } // end of for(Int_t si=0;si<4;si++)
7875 } // end of if(fCalculateCumulantsVsM)
ff70ca91 7876 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7877 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7878 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 7879 if(fCalculateCumulantsVsM)
ff70ca91 7880 {
b3dacf6b 7881 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7882 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7883 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>}",
7884 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7885 for(Int_t pi=0;pi<6;pi++)
ff70ca91 7886 {
b3dacf6b 7887 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7888 if(intFlowSumOfProductOfEventWeightsVsM)
7889 {
7890 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7891 } else
7892 {
7893 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7894 }
7895 } // end of for(Int_t pi=0;pi<6;pi++)
7896 } // end of if(fCalculateCumulantsVsM)
0328db2d 7897 // covariances for NUA (multiplied with weight dependent prefactor):
7898 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7899 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7900 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7901 if(intFlowCovariancesNUA)
7902 {
7903 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7904 } else
7905 {
7906 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7907 }
7908 // sum of linear and quadratic event weights NUA terms:
7909 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7910 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7911 for(Int_t sc=0;sc<2;sc++)
7912 {
7913 for(Int_t power=0;power<2;power++)
7914 {
7915 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7916 if(intFlowSumOfEventWeightsNUA)
7917 {
7918 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7919 } else
7920 {
7921 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7922 cout<<"sc = "<<sc<<endl;
7923 cout<<"power = "<<power<<endl;
7924 }
7925 } // end of for(Int_t power=0;power<2;power++)
7926 } // end of for(Int_t sc=0;sc<2;sc++)
7927 // sum of products of event weights for NUA terms:
7928 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7929 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7930 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7931 if(intFlowSumOfProductOfEventWeightsNUA)
7932 {
7933 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7934 } else
7935 {
7936 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7937 }
b3dacf6b 7938 // Final results for reference Q-cumulants:
489d5531 7939 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7940 intFlowQcumulantsName += fAnalysisLabel->Data();
7941 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7942 if(intFlowQcumulants)
7943 {
7944 this->SetIntFlowQcumulants(intFlowQcumulants);
7945 } else
7946 {
7947 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7948 }
b3dacf6b 7949 // Final results for reference Q-cumulants rebinned in M:
7950 if(fCalculateCumulantsVsM)
7951 {
7952 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
7953 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
7954 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
7955 if(intFlowQcumulantsRebinnedInM)
7956 {
7957 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
7958 } else
7959 {
7960 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7961 }
7962 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 7963 // Ratio between error squared: with/without non-isotropic terms:
7964 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
7965 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
7966 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
7967 if(intFlowQcumulantsErrorSquaredRatio)
7968 {
7969 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
7970 } else
7971 {
7972 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7973 }
ff70ca91 7974 // final results for integrated Q-cumulants versus multiplicity:
ff70ca91 7975 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
b3dacf6b 7976 if(fCalculateCumulantsVsM)
ff70ca91 7977 {
b3dacf6b 7978 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7979 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7980 for(Int_t co=0;co<4;co++) // cumulant order
ff70ca91 7981 {
b3dacf6b 7982 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7983 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7984 if(intFlowQcumulantsVsM)
7985 {
7986 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7987 } else
7988 {
7989 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7990 }
7991 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7992 } // end of if(fCalculateCumulantsVsM)
7993 // Final reference flow estimates from Q-cumulants:
489d5531 7994 TString intFlowName = "fIntFlow";
7995 intFlowName += fAnalysisLabel->Data();
7996 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7997 if(intFlow)
7998 {
7999 this->SetIntFlow(intFlow);
8000 } else
8001 {
8002 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 8003 }
b3dacf6b 8004 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
8005 if(fCalculateCumulantsVsM)
ff70ca91 8006 {
b3dacf6b 8007 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
8008 intFlowRebinnedInMName += fAnalysisLabel->Data();
8009 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
8010 if(intFlowRebinnedInM)
ff70ca91 8011 {
b3dacf6b 8012 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
8013 } else
ff70ca91 8014 {
b3dacf6b 8015 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8016 }
8017 } // end of if(fCalculateCumulantsVsM)
8018 // integrated flow from Q-cumulants versus multiplicity:
8019 if(fCalculateCumulantsVsM)
8020 {
8021 TString intFlowVsMName = "fIntFlowVsM";
8022 intFlowVsMName += fAnalysisLabel->Data();
b77b6434 8023 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 8024 for(Int_t co=0;co<4;co++) // cumulant order
8025 {
8026 TH1D *intFlowVsM = dynamic_cast<TH1D*>
b77b6434 8027 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
b3dacf6b 8028 if(intFlowVsM)
8029 {
8030 this->SetIntFlowVsM(intFlowVsM,co);
8031 } else
8032 {
8033 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8034 }
8035 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8036 } // end of if(fCalculateCumulantsVsM)
2001bc3a 8037 // quantifying detector effects effects to correlations:
8038 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
8039 intFlowDetectorBiasName += fAnalysisLabel->Data();
8040 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
8041 if(intFlowDetectorBias)
8042 {
8043 this->SetIntFlowDetectorBias(intFlowDetectorBias);
8044 } else
8045 {
8046 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8047 }
8048 // quantifying detector effects effects to correlations vs multiplicity:
b77b6434 8049 if(fCalculateCumulantsVsM)
2001bc3a 8050 {
3c5d5752 8051 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
8052 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
8053 for(Int_t ci=0;ci<4;ci++) // correlation index
2001bc3a 8054 {
3c5d5752 8055 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
8056 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
8057 if(intFlowDetectorBiasVsM)
8058 {
8059 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
8060 } else
8061 {
8062 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8063 }
8064 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b77b6434 8065 } // end of if(fCalculateCumulantsVsM)
489d5531 8066 } else // to if(intFlowResults)
8067 {
8068 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8069 }
ff70ca91 8070
489d5531 8071} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8072
489d5531 8073//================================================================================================================================
8074
489d5531 8075void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8076{
8077 // Get pointer to all objects relevant for differential flow.
8078 // a) Define flags locally (to be improved: should I promote flags to data members?);
8079 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
8080 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
8081 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8082 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8083
8084 // a) Define flags locally (to be improved: should I promote flags to data members?):
8085 TString typeFlag[2] = {"RP","POI"};
8086 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8087 TString powerFlag[2] = {"linear","quadratic"};
8088 TString sinCosFlag[2] = {"sin","cos"};
8089 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8090 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8091 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8092 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8093 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8094
8095 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
8096 TList *diffFlowList = NULL;
8097 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
8098 if(!diffFlowList)
8099 {
8100 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8101 exit(0);
8102 }
8103 // list holding nested lists containing profiles:
8104 TList *diffFlowListProfiles = NULL;
8105 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
8106 if(!diffFlowListProfiles)
8107 {
8108 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8109 exit(0);
8110 }
8111 // list holding nested lists containing 2D and 1D histograms with final results:
8112 TList *diffFlowListResults = NULL;
8113 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
8114 if(!diffFlowListResults)
8115 {
8116 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8117 exit(0);
8118 }
8119
8120 // c) Get pointer to profile holding all flags for differential flow;
8121 TString diffFlowFlagsName = "fDiffFlowFlags";
8122 diffFlowFlagsName += fAnalysisLabel->Data();
8123 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
8124 Bool_t bCalculate2DFlow = kFALSE;
8125 if(diffFlowFlags)
8126 {
8127 this->SetDiffFlowFlags(diffFlowFlags);
8128 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);
8129 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?)
8130 }
8131
8132 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8133 // correlations:
8134 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
8135 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8136 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8137 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
8138 // products of correlations:
8139 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
8140 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8141 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8142 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
8143 // corrections:
8144 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
8145 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8146 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8147 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
8148 for(Int_t t=0;t<2;t++)
8149 {
8150 for(Int_t pe=0;pe<2;pe++)
8151 {
8152 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8153 if(!diffFlowCorrelationsProList[t][pe])
8154 {
8155 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8156 cout<<"t = "<<t<<endl;
8157 cout<<"pe = "<<pe<<endl;
8158 exit(0);
8159 }
8160 for(Int_t ci=0;ci<4;ci++) // correlation index
8161 {
8162 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())));
8163 if(diffFlowCorrelationsPro[t][pe][ci])
8164 {
8165 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
8166 } else
8167 {
8168 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8169 cout<<"t = "<<t<<endl;
8170 cout<<"pe = "<<pe<<endl;
8171 cout<<"ci = "<<ci<<endl;
8172 }
8173 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8174 // products of correlations:
8175 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8176 if(!diffFlowProductOfCorrelationsProList[t][pe])
8177 {
8178 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8179 cout<<"t = "<<t<<endl;
8180 cout<<"pe = "<<pe<<endl;
8181 exit(0);
8182 }
8183 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8184 {
8185 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8186 {
8187 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())));
8188 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
8189 {
8190 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
8191 } else
8192 {
8193 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8194 cout<<"t = "<<t<<endl;
8195 cout<<"pe = "<<pe<<endl;
8196 cout<<"mci1 = "<<mci1<<endl;
8197 cout<<"mci2 = "<<mci2<<endl;
8198 }
8199 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8200 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8201 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8202 // corrections:
8203 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8204 if(!diffFlowCorrectionsProList[t][pe])
8205 {
8206 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8207 cout<<"t = "<<t<<endl;
8208 cout<<"pe = "<<pe<<endl;
8209 exit(0);
8210 }
8211 // correction terms for NUA:
8212 for(Int_t sc=0;sc<2;sc++) // sin or cos
8213 {
8214 for(Int_t cti=0;cti<9;cti++) // correction term index
8215 {
8216 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)));
8217 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
8218 {
8219 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
8220 } else
8221 {
8222 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8223 cout<<"t = "<<t<<endl;
8224 cout<<"pe = "<<pe<<endl;
8225 cout<<"sc = "<<sc<<endl;
8226 cout<<"cti = "<<cti<<endl;
8227 }
8228 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8229 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8230 // ...
8231 } // end of for(Int_t pe=0;pe<2;pe++)
8232 } // end of for(Int_t t=0;t<2;t++)
8233
8234 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8235 // reduced correlations:
8236 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
8237 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8238 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8239 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
8240 // corrections for NUA:
8241 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
8242 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8243 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8244 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
8245 // differential Q-cumulants:
8246 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
8247 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8248 diffFlowCumulantsName += fAnalysisLabel->Data();
8249 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
8250 // differential flow estimates from Q-cumulants:
8251 TList *diffFlowHistList[2][2] = {{NULL}};
8252 TString diffFlowName = "fDiffFlow";
8253 diffFlowName += fAnalysisLabel->Data();
8254 TH1D *diffFlow[2][2][4] = {{{NULL}}};
8255 // differential covariances:
8256 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
8257 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8258 diffFlowCovariancesName += fAnalysisLabel->Data();
8259 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
8260 for(Int_t t=0;t<2;t++) // type: RP or POI
8261 {
8262 for(Int_t pe=0;pe<2;pe++) // pt or eta
8263 {
8264 // reduced correlations:
8265 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8266 if(!diffFlowCorrelationsHistList[t][pe])
8267 {
8268 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8269 cout<<"t = "<<t<<endl;
8270 cout<<"pe = "<<pe<<endl;
8271 exit(0);
8272 }
8273 for(Int_t index=0;index<4;index++)
8274 {
8275 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())));
8276 if(diffFlowCorrelationsHist[t][pe][index])
8277 {
8278 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8279 } else
8280 {
8281 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8282 cout<<"t = "<<t<<endl;
8283 cout<<"pe = "<<pe<<endl;
8284 cout<<"index = "<<index<<endl;
8285 exit(0);
8286 }
8287 } // end of for(Int_t index=0;index<4;index++)
8288 // corrections:
8289 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8290 if(!diffFlowCorrectionsHistList[t][pe])
8291 {
8292 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8293 cout<<"t = "<<t<<endl;
8294 cout<<"pe = "<<pe<<endl;
8295 exit(0);
8296 }
8297 // correction terms for NUA:
8298 for(Int_t sc=0;sc<2;sc++) // sin or cos
8299 {
8300 for(Int_t cti=0;cti<9;cti++) // correction term index
8301 {
8302 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)));
8303 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8304 {
8305 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8306 } else
8307 {
8308 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8309 cout<<"t = "<<t<<endl;
8310 cout<<"pe = "<<pe<<endl;
8311 cout<<"sc = "<<sc<<endl;
8312 cout<<"cti = "<<cti<<endl;
8313 }
8314 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8315 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8316 // ...
8317 // differential Q-cumulants:
8318 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8319 if(!diffFlowCumulantsHistList[t][pe])
8320 {
8321 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8322 cout<<"t = "<<t<<endl;
8323 cout<<"pe = "<<pe<<endl;
8324 exit(0);
8325 }
8326 for(Int_t index=0;index<4;index++)
8327 {
8328 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())));
8329 if(diffFlowCumulants[t][pe][index])
8330 {
8331 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8332 } else
8333 {
8334 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8335 cout<<"t = "<<t<<endl;
8336 cout<<"pe = "<<pe<<endl;
8337 cout<<"index = "<<index<<endl;
8338 exit(0);
8339 }
8340 } // end of for(Int_t index=0;index<4;index++)
8341 // differential flow estimates from Q-cumulants:
8342 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8343 if(!diffFlowHistList[t][pe])
8344 {
8345 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8346 cout<<"t = "<<t<<endl;
8347 cout<<"pe = "<<pe<<endl;
8348 exit(0);
8349 }
8350 for(Int_t index=0;index<4;index++)
8351 {
8352 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())));
8353 if(diffFlow[t][pe][index])
8354 {
8355 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8356 } else
8357 {
8358 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8359 cout<<"t = "<<t<<endl;
8360 cout<<"pe = "<<pe<<endl;
8361 cout<<"index = "<<index<<endl;
8362 exit(0);
8363 }
8364 } // end of for(Int_t index=0;index<4;index++)
8365 // differential covariances:
8366 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8367 if(!diffFlowCovariancesHistList[t][pe])
8368 {
8369 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8370 cout<<"t = "<<t<<endl;
8371 cout<<"pe = "<<pe<<endl;
8372 exit(0);
8373 }
8374 for(Int_t covIndex=0;covIndex<5;covIndex++)
8375 {
8376 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())));
8377 if(diffFlowCovariances[t][pe][covIndex])
8378 {
8379 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8380 } else
8381 {
8382 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8383 cout<<"t = "<<t<<endl;
8384 cout<<"pe = "<<pe<<endl;
8385 cout<<"covIndex = "<<covIndex<<endl;
8386 exit(0);
8387 }
8388 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8389 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8390 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8391 // sum of event weights for reduced correlations:
8392 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8393 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8394 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8395 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8396 for(Int_t t=0;t<2;t++) // type is RP or POI
8397 {
8398 for(Int_t pe=0;pe<2;pe++) // pt or eta
8399 {
8400 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8401 {
8402 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())));
8403 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8404 {
8405 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8406 cout<<"t = "<<t<<endl;
8407 cout<<"pe = "<<pe<<endl;
8408 cout<<"power = "<<p<<endl;
8409 exit(0);
8410 }
8411 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8412 {
8413 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())));
8414 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8415 {
8416 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8417 } else
8418 {
8419 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8420 cout<<"t = "<<t<<endl;
8421 cout<<"pe = "<<pe<<endl;
8422 cout<<"power = "<<p<<endl;
8423 cout<<"ew = "<<ew<<endl;
8424 exit(0);
8425 }
8426 }
8427 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8428 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8429 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8430 //
8431 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8432 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8433 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8434 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8435 for(Int_t t=0;t<2;t++) // type is RP or POI
8436 {
8437 for(Int_t pe=0;pe<2;pe++) // pt or eta
8438 {
8439 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8440 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8441 {
8442 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8443 cout<<"t = "<<t<<endl;
8444 cout<<"pe = "<<pe<<endl;
8445 exit(0);
8446 }
8447 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8448 {
8449 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8450 {
8451 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())));
8452 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8453 {
8454 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8455 } else
8456 {
8457 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8458 cout<<"t = "<<t<<endl;
8459 cout<<"pe = "<<pe<<endl;
8460 cout<<"mci1 = "<<mci1<<endl;
8461 cout<<"mci2 = "<<mci2<<endl;
8462 exit(0);
8463 }
8464 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8465 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8466 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8467 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8468 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8469
8470} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8471
8472
8473//================================================================================================================================
8474
8475
8476void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8477{
8478 // Book all histograms and profiles needed for differential flow.
8479 // a) Define flags locally (to be improved: should I promote flags to data members?);
8480 // b) Book profile to hold all flags for differential flow;
8481 // c) Book e-b-e quantities;
8482 // d) Book profiles;
8483 // e) Book histograms holding final results.
8484
8485 // a) Define flags locally (to be improved: should I promote flags to data members?):
8486 TString typeFlag[2] = {"RP","POI"};
8487 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8488 TString powerFlag[2] = {"linear","quadratic"};
8489 TString sinCosFlag[2] = {"sin","cos"};
8490 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8491 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8492 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8493 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8494 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8495 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8496 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8497 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
8498
8499 // b) Book profile to hold all flags for differential flow:
8500 TString diffFlowFlagsName = "fDiffFlowFlags";
8501 diffFlowFlagsName += fAnalysisLabel->Data();
8502 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);
8503 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8504 fDiffFlowFlags->SetMarkerStyle(25);
8505 fDiffFlowFlags->SetLabelSize(0.05);
8506 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8507 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");
8508 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");
8509 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");
8510 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");
8511 fDiffFlowList->Add(fDiffFlowFlags);
8512
8513 // c) Book e-b-e quantities:
8514 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8515 // Explanantion of notation:
8516 // 1.) n is harmonic, m is multiple of harmonic;
8517 // 2.) k is power of particle weight;
8518 // 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);
8519 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8520 // (if i-th POI is also RP, than it is weighted with w_i^k);
8521 // 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
8522 // (i-th RP&&POI is weighted with w_i^k)
8523
8524 // 1D:
8525 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8526 {
8527 for(Int_t pe=0;pe<2;pe++) // pt or eta
8528 {
8529 for(Int_t m=0;m<4;m++) // multiple of harmonic
8530 {
8531 for(Int_t k=0;k<9;k++) // power of particle weight
8532 {
8533 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8534 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8535 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8536 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8537 }
8538 }
8539 }
8540 }
8541 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8542 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8543 {
8544 for(Int_t pe=0;pe<2;pe++) // pt or eta
8545 {
8546 for(Int_t k=0;k<9;k++) // power of particle weight
8547 {
8548 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8549 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8550 }
8551 }
8552 }
8553 // correction terms for nua:
8554 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8555 {
8556 for(Int_t pe=0;pe<2;pe++) // pt or eta
8557 {
8558 for(Int_t sc=0;sc<2;sc++) // sin or cos
8559 {
8560 for(Int_t cti=0;cti<9;cti++) // correction term index
8561 {
8562 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8563 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8564 }
8565 }
8566 }
8567 }
8568 // 2D:
b77b6434 8569 if(fCalculate2DFlow)
8570 {
8571 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8572 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8573 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8574 {
8575 for(Int_t m=0;m<4;m++)
8576 {
8577 for(Int_t k=0;k<9;k++)
8578 {
8579 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8580 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8581 }
8582 }
8583 }
8584 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8585 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8586 {
489d5531 8587 for(Int_t k=0;k<9;k++)
8588 {
b77b6434 8589 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
489d5531 8590 }
489d5531 8591 }
b77b6434 8592 } // end of if(fCalculate2DFlow)
489d5531 8593 // reduced correlations e-b-e:
8594 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8595 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8596 for(Int_t t=0;t<2;t++) // type: RP or POI
8597 {
8598 for(Int_t pe=0;pe<2;pe++) // pt or eta
8599 {
8600 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8601 {
8602 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]);
8603 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8604 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8605 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8606 // event weights for reduced correlations e-b-e:
8607 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8608 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8609 for(Int_t t=0;t<2;t++) // type: RP or POI
8610 {
8611 for(Int_t pe=0;pe<2;pe++) // pt or eta
8612 {
8613 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8614 {
8615 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]);
8616 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8617 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8618 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8619
8620 // d) Book profiles;
8621 // reduced correlations:
8622 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8623 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8624 // corrections terms:
8625 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8626 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8627 for(Int_t t=0;t<2;t++) // type: RP or POI
8628 {
8629 for(Int_t pe=0;pe<2;pe++) // pt or eta
8630 {
8631 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8632 {
8633 // reduced correlations:
8634 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");
8635 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8636 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8637 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8638 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8639 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8640 // correction terms for nua:
8641 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8642 {
8643 for(Int_t pe=0;pe<2;pe++) // pt or eta
8644 {
8645 for(Int_t sc=0;sc<2;sc++) // sin or cos
8646 {
8647 for(Int_t cti=0;cti<9;cti++) // correction term index
8648 {
8649 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]);
8650 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8651 }
8652 }
8653 }
8654 }
8655 // e) Book histograms holding final results.
8656 // reduced correlations:
8657 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8658 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8659 // corrections terms:
8660 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8661 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8662 // differential covariances:
8663 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8664 diffFlowCovariancesName += fAnalysisLabel->Data();
8665 // differential Q-cumulants:
8666 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8667 diffFlowCumulantsName += fAnalysisLabel->Data();
8668 // differential flow:
8669 TString diffFlowName = "fDiffFlow";
8670 diffFlowName += fAnalysisLabel->Data();
8671 for(Int_t t=0;t<2;t++) // type: RP or POI
8672 {
8673 for(Int_t pe=0;pe<2;pe++) // pt or eta
8674 {
8675 for(Int_t index=0;index<4;index++)
8676 {
8677 // reduced correlations:
8678 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]);
8679 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8680 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8681 // differential Q-cumulants:
8682 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]);
8683 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8684 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
8685 // differential flow estimates from Q-cumulants:
8686 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]);
8687 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8688 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8689 } // end of for(Int_t index=0;index<4;index++)
8690 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8691 {
8692 // differential covariances:
8693 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]);
8694 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8695 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8696 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8697 // products of both types of correlations:
8698 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8699 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8700 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8701 {
8702 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8703 {
8704 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]);
8705 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8706 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8707 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8708 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8709 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8710 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8711 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8712 // sums of event weights for reduced correlations:
8713 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8714 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8715 for(Int_t t=0;t<2;t++) // type is RP or POI
8716 {
8717 for(Int_t pe=0;pe<2;pe++) // pt or eta
8718 {
8719 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8720 {
8721 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8722 {
8723 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]);
8724 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8725 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8726 }
8727 }
8728 }
8729 }
8730 // sum of products of event weights for both types of correlations:
8731 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8732 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8733 for(Int_t t=0;t<2;t++) // type is RP or POI
8734 {
8735 for(Int_t pe=0;pe<2;pe++) // pt or eta
8736 {
8737 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8738 {
8739 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8740 {
8741 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]);
8742 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8743 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8744 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8745 }
8746 }
8747 }
8748 }
8749 // correction terms for nua:
8750 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8751 {
8752 for(Int_t pe=0;pe<2;pe++) // pt or eta
8753 {
8754 for(Int_t sc=0;sc<2;sc++) // sin or cos
8755 {
8756 for(Int_t cti=0;cti<9;cti++) // correction term index
8757 {
8758 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]);
8759 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8760 }
8761 }
8762 }
8763 }
8764
8765} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8766
489d5531 8767//================================================================================================================================
8768
489d5531 8769void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8770{
8771 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8772
b92ea2b9 8773 // Isotropic cumulants:
8774 Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
8775 Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
8776 Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
8777 Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
8778 //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
8779 //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
8780 //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
8781 //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
8782
8783 // Measured 2-, 4-, 6- and 8-particle correlations:
489d5531 8784 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
b92ea2b9 8785 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
489d5531 8786 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
b92ea2b9 8787 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
489d5531 8788 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
489d5531 8789 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
b92ea2b9 8790 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
489d5531 8791 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
b92ea2b9 8792
8793 // Non-isotropic terms:
8794 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
8795 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
8796 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
8797 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
8798 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
8799 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
8800 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
8801 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
8802 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
8803 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
8804 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
8805 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
8806
8807 // Shortcuts:
8808 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
8809 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
8810 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
8811 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
8812 Double_t a5 = 4.*c1*s1-s2;
8813
8814 // Covariances (including weight dependent prefactor):
8e1cefdd 8815 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
8816 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
8817 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
8818 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
8819 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
8820 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8821 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
8822 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8823 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
8824 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
8825 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8826 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
8827 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
8828 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8829 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
8830 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8831 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
8832 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8833 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8834 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
8835 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
8836 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8837 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8838 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8839 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
8840 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
8841 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8842 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8843 if(!fForgetAboutCovariances)
8844 {
8845 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
8846 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
8847 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
8848 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
8849 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
8850 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8851 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
8852 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8853 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
8854 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
8855 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8856 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
8857 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
8858 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8859 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
8860 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8861 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
8862 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8863 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8864 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
8865 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
8866 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8867 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8868 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8869 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
8870 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
8871 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8872 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8873 } // end of if(!fForgetAboutCovariances)
8874
b92ea2b9 8875 // Calculating generalized QC{2}:
8876 // Generalized QC{2}:
8877 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
8878 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
8879 // Statistical error of generalized QC{2}:
8880 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
8881 + 4.*pow(s1,2.)*pow(s1Error,2.)
8882 - 4*c1*wCov1-4*s1*wCov2
8883 + 8.*c1*s1*wCov3;
8884 // Store ratio of error squared - with/without NUA terms:
8885 Double_t ratioErrorSquaredQC2 = 0.;
8886 if(fIntFlowQcumulants->GetBinError(1)>0.)
8887 {
8888 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
8889 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
8890 }
8891 // If enabled, store error by including non-isotropic terms:
b77b6434 8892 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 8893 {
8894 if(gQC2ErrorSquared>=0.)
8895 {
8896 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
8897 } else
8898 {
8899 fIntFlowQcumulants->SetBinError(1,0.);
8900 cout<<endl;
8901 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
8902 cout<<endl;
8903 }
b77b6434 8904 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 8905 // Quantify detector bias to QC{2}:
8906 if(TMath::Abs(QC2)>0.)
8907 {
8908 fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2);
8909 if(QC2Error>0.)
8910 {
8911 Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
8912 if(errorSquared>0.)
8913 {
8914 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
8915 }
8916 }
8917 } // end of if(TMath::Abs(QC2)>0.)
8918
8919 // Calculating generalized QC{4}:
8920 // Generalized QC{4}:
8921 Double_t gQC4 = four-2.*pow(two,2.)
8922 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
8923 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
8924 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
8925 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
8926 // Statistical error of generalized QC{4}:
8927 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
8928 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
8929 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
8930 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
8931 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
8932 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
8933 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
8934 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
8935 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
8936 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
8937 // Store ratio of error squared - with/without NUA terms:
8938 Double_t ratioErrorSquaredQC4 = 0.;
8939 if(fIntFlowQcumulants->GetBinError(2)>0.)
8940 {
8941 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
8942 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
8943 }
b77b6434 8944 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 8945 {
8946 if(gQC4ErrorSquared>=0.)
8947 {
8948 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
8949 } else
8950 {
8951 fIntFlowQcumulants->SetBinError(2,0.);
8952 cout<<endl;
8953 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
8954 cout<<endl;
8955 }
b77b6434 8956 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 8957 // Quantify detector bias to QC{4}:
8958 if(TMath::Abs(QC4)>0.)
8959 {
8960 fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4);
8961 if(QC4Error>0.)
8962 {
8963 Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
8964 if(errorSquared>0.)
8965 {
8966 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
8967 }
8968 }
8969 } // end of if(TMath::Abs(QC4)>0.)
489d5531 8970
b92ea2b9 8971
8972 // .... to be improved (continued for 6th and 8th order) ....
8973
8974
2001bc3a 8975 // versus multiplicity:
b77b6434 8976 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
2001bc3a 8977 {
8978 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b77b6434 8979 Double_t value[4] = {0.}; // QCs vs M
8980 Double_t error[4] = {0.}; // error of QCs vs M
8981 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
8982 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
2001bc3a 8983 for(Int_t b=1;b<=nBins;b++)
8984 {
b92ea2b9 8985 // Measured correlations:
2001bc3a 8986 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
8987 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
b92ea2b9 8988 // Isotropic cumulants:
8989 QC2 = two;
8990 QC4 = four-2.*pow(two,2.);
8991 // Non-isotropic terms:
8992 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
8993 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
8994 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
8995 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
8996 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
8997 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
8998 // Generalized QC{2} vs M:
8999 gQC2 = two - pow(c1,2.) - pow(s1,2.);
b77b6434 9000 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
b92ea2b9 9001 // Generalized QC{4} vs M:
9002 gQC4 = four-2.*pow(two,2.)
9003 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9004 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9005 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
b77b6434 9006 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
b92ea2b9 9007 // Detector bias vs M:
9008 if(TMath::Abs(QC2)>0.)
9009 {
9010 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2);
9011 } // end of if(TMath::Abs(QC2)>0.)
9012 if(TMath::Abs(QC4)>0.)
9013 {
9014 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4);
b77b6434 9015 } // end of if(TMath::Abs(QC4)>0.)
9016 // Rebin in M:
9017 for(Int_t co=0;co<4;co++)
9018 {
9019 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
9020 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
9021 if(error[co]>0.)
9022 {
9023 dSum1[co]+=value[co]/(error[co]*error[co]);
9024 dSum2[co]+=1./(error[co]*error[co]);
9025 }
9026 } // end of for(Int_t co=0;co<4;co++)
9027 } // end of for(Int_t b=1;b<=nBins;b++)
9028 // Store rebinned Q-cumulants:
9029 if(fApplyCorrectionForNUAVsM)
9030 {
9031 for(Int_t co=0;co<4;co++)
9032 {
9033 if(dSum2[co]>0.)
9034 {
9035 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
9036 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
9037 }
9038 } // end of for(Int_t co=0;co<4;co++)
9039 } // end of if(fApplyCorrectionForNUAVsM)
9040 } // end of if(fCalculateCumulantsVsM)
2001bc3a 9041
489d5531 9042} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
0328db2d 9043
489d5531 9044//================================================================================================================================
9045
489d5531 9046void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9047{
0328db2d 9048 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 9049 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 9050 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 9051 //
9052 // Remark: Statistical error of correction temrs is calculated as:
9053 //
9054 // statistical error = termA * spread * termB:
9055 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
9056 // termB = 1/sqrt(1-termA^2)
9057
b92ea2b9 9058 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
9059 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
9060
489d5531 9061 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
9062 {
b92ea2b9 9063 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 9064 {
9065 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 9066 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
9067 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
9068 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
9069 Double_t termA = 0.;
9070 Double_t termB = 0.;
b92ea2b9 9071 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
0328db2d 9072 {
9073 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
9074 } else
9075 {
b92ea2b9 9076 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9077 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
0328db2d 9078 }
489d5531 9079 if(1.-pow(termA,2.) > 0.)
9080 {
9081 termB = 1./pow(1-pow(termA,2.),0.5);
9082 } else
9083 {
b92ea2b9 9084 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9085 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
489d5531 9086 }
9087 Double_t statisticalError = termA * spread * termB;
489d5531 9088 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 9089 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
b92ea2b9 9090 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
489d5531 9091 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
9092
9093} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9094
489d5531 9095//================================================================================================================================
9096
489d5531 9097void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9098{
9099 // Get pointers to all objects relevant for calculations with nested loops.
9100
9101 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
9102 if(nestedLoopsList)
9103 {
9104 this->SetNestedLoopsList(nestedLoopsList);
9105 } else
9106 {
9107 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9108 exit(0);
9109 }
9110
9111 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
9112 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
9113 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
9114 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
9115
9116 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
9117 evaluateNestedLoopsName += fAnalysisLabel->Data();
9118 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
9119 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
9120 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
9121 if(evaluateNestedLoops)
9122 {
9123 this->SetEvaluateNestedLoops(evaluateNestedLoops);
9124 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
9125 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
9126 }
9127 // nested loops relevant for integrated flow:
9128 if(bEvaluateIntFlowNestedLoops)
9129 {
9130 // correlations:
9131 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
9132 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
9133 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
9134 if(intFlowDirectCorrelations)
9135 {
9136 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
9137 } else
9138 {
9139 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9140 exit(0);
9141 }
9142 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9143 {
9144 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
9145 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
9146 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
9147 if(intFlowExtraDirectCorrelations)
9148 {
9149 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
9150 } else
9151 {
9152 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9153 exit(0);
9154 }
9155 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9156 // correction terms for non-uniform acceptance:
9157 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
9158 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9159 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
9160 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9161 {
9162 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
9163 if(intFlowDirectCorrectionTermsForNUA[sc])
9164 {
9165 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
9166 } else
9167 {
9168 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9169 cout<<"sc = "<<sc<<endl;
9170 exit(0);
9171 }
9172 } // end of for(Int_t sc=0;sc<2;sc++)
9173 } // end of if(bEvaluateIntFlowNestedLoops)
9174
9175 // nested loops relevant for differential flow:
9176 if(bEvaluateDiffFlowNestedLoops)
9177 {
9178 // correlations:
9179 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
9180 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
9181 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
9182 for(Int_t t=0;t<2;t++)
9183 {
9184 for(Int_t pe=0;pe<2;pe++)
9185 {
9186 for(Int_t ci=0;ci<4;ci++) // correlation index
9187 {
9188 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())));
9189 if(diffFlowDirectCorrelations[t][pe][ci])
9190 {
9191 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
9192 } else
9193 {
9194 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9195 cout<<"t = "<<t<<endl;
9196 cout<<"pe = "<<pe<<endl;
9197 cout<<"ci = "<<ci<<endl;
9198 }
9199 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9200 } // end of for(Int_t pe=0;pe<2;pe++)
9201 } // end of for(Int_t t=0;t<2;t++)
9202 // correction terms for non-uniform acceptance:
9203 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
9204 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9205 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
9206 for(Int_t t=0;t<2;t++)
9207 {
9208 for(Int_t pe=0;pe<2;pe++)
9209 {
9210 // correction terms for NUA:
9211 for(Int_t sc=0;sc<2;sc++) // sin or cos
9212 {
9213 for(Int_t cti=0;cti<9;cti++) // correction term index
9214 {
9215 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)));
9216 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
9217 {
9218 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
9219 } else
9220 {
9221 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9222 cout<<"t = "<<t<<endl;
9223 cout<<"pe = "<<pe<<endl;
9224 cout<<"sc = "<<sc<<endl;
9225 cout<<"cti = "<<cti<<endl;
9226 }
9227 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9228 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9229 } // end of for(Int_t pe=0;pe<2;pe++)
9230 } // end of for(Int_t t=0;t<2;t++)
9231 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
9232 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
9233 TH1D *noOfParticlesInBin = NULL;
9234 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
9235 if(noOfParticlesInBin)
9236 {
9237 this->SetNoOfParticlesInBin(noOfParticlesInBin);
9238 } else
9239 {
9240 cout<<endl;
9241 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9242 cout<<endl;
9243 }
9244 } // end of if(bEvaluateDiffFlowNestedLoops)
9245
9246} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9247
9248
9249//================================================================================================================================
9250
9251
9252void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9253{
9254 // Store flow harmonic in common control histograms.
9255
9256 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
9257 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
9258 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
9259 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
9260 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9261
9262} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9263
9264
9265//================================================================================================================================
9266
9267
9268void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9269{
9270 // Calculate all correlations needed for differential flow using particle weights.
9271
9272 Int_t t = -1; // type flag
9273 Int_t pe = -1; // ptEta flag
9274
9275 if(type == "RP")
9276 {
9277 t = 0;
9278 } else if(type == "POI")
9279 {
9280 t = 1;
9281 }
9282
9283 if(ptOrEta == "Pt")
9284 {
9285 pe = 0;
9286 } else if(ptOrEta == "Eta")
9287 {
9288 pe = 1;
9289 }
9290
9291 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9292 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9293 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9294 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9295
9296 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9297 Double_t dReQ1n1k = (*fReQ)(0,1);
9298 Double_t dReQ2n2k = (*fReQ)(1,2);
9299 Double_t dReQ1n3k = (*fReQ)(0,3);
9300 //Double_t dReQ4n4k = (*fReQ)(3,4);
9301 Double_t dImQ1n1k = (*fImQ)(0,1);
9302 Double_t dImQ2n2k = (*fImQ)(1,2);
9303 Double_t dImQ1n3k = (*fImQ)(0,3);
9304 //Double_t dImQ4n4k = (*fImQ)(3,4);
9305
9306 // S^M_{p,k} (see .h file for the definition of fSMpk):
9307 Double_t dSM1p1k = (*fSMpk)(0,1);
9308 Double_t dSM1p2k = (*fSMpk)(0,2);
9309 Double_t dSM1p3k = (*fSMpk)(0,3);
9310 Double_t dSM2p1k = (*fSMpk)(1,1);
9311 Double_t dSM3p1k = (*fSMpk)(2,1);
9312
9313 // looping over all bins and calculating reduced correlations:
9314 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9315 {
9316 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9317 Double_t p1n0kRe = 0.;
9318 Double_t p1n0kIm = 0.;
9319
9320 // number of POIs in particular (pt,eta) bin):
9321 Double_t mp = 0.;
9322
9323 // real and imaginary parts of q_{m*n,k}:
9324 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9325 Double_t q1n2kRe = 0.;
9326 Double_t q1n2kIm = 0.;
9327 Double_t q2n1kRe = 0.;
9328 Double_t q2n1kIm = 0.;
9329
9330 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9331 Double_t s1p1k = 0.;
9332 Double_t s1p2k = 0.;
9333 Double_t s1p3k = 0.;
9334
9335 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9336 Double_t dM0111 = 0.;
9337
9338 if(type == "POI")
9339 {
9340 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9341 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9342 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9343 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9344
9345 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9346
9347 t = 1; // typeFlag = RP or POI
9348
9349 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9350 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9351 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9352 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9353 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9354 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9355 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9356 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9357 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9358
9359 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9360 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9361 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9362 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9363
9364 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9365 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9366 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9367 + 2.*(s1p3k-s1p2k*dSM1p1k));
9368 }
9369 else if(type == "RP")
9370 {
9371 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9372 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9373 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9374 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9375 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9376 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9377 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9378 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9379 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9380
9381 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9382 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9383 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9384 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9385
9386 // to be improved (cross-checked):
9387 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9388 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9389 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9390 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9391
9392 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9393
9394 t = 0; // typeFlag = RP or POI
9395
9396 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9397 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9398 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9399 + 2.*(s1p3k-s1p2k*dSM1p1k));
9400 //...............................................................................................
9401 }
9402
9403 // 2'-particle correlation:
9404 Double_t two1n1nW0W1 = 0.;
9405 if(mp*dSM1p1k-s1p1k)
9406 {
9407 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9408 / (mp*dSM1p1k-s1p1k);
9409
9410 // fill profile to get <<2'>>
9411 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9412 // histogram to store <2'> e-b-e (needed in some other methods):
9413 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9414 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9415 } // end of if(mp*dSM1p1k-s1p1k)
9416
9417 // 4'-particle correlation:
9418 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9419 if(dM0111)
9420 {
9421 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9422 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9423 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9424 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9425 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9426 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9427 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9428 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9429 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9430 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9431 + 2.*s1p1k*dSM1p2k
9432 - 6.*s1p3k)
9433 / dM0111; // to be improved (notation of dM0111)
9434
9435 // fill profile to get <<4'>>
9436 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9437 // histogram to store <4'> e-b-e (needed in some other methods):
9438 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9439 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9440 } // end of if(dM0111)
9441 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9442
9443} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9444
9445
9446//================================================================================================================================
9447
9448
9449void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9450{
9451 // Fill common control histograms.
9452
9453 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9454 fCommonHists->FillControlHistograms(anEvent);
9455 if(nRP>1)
9456 {
9457 fCommonHists2nd->FillControlHistograms(anEvent);
9458 if(nRP>3)
9459 {
9460 fCommonHists4th->FillControlHistograms(anEvent);
9461 if(nRP>5)
9462 {
9463 fCommonHists6th->FillControlHistograms(anEvent);
9464 if(nRP>7)
9465 {
9466 fCommonHists8th->FillControlHistograms(anEvent);
9467 } // end of if(nRP>7)
9468 } // end of if(nRP>5)
9469 } // end of if(nRP>3)
9470 } // end of if(nRP>1)
9471
9472} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9473
9474
9475//================================================================================================================================
9476
9477
9478void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9479{
9480 // Reset all event by event quantities.
9481
9482 // integrated flow:
9483 fReQ->Zero();
9484 fImQ->Zero();
9485 fSMpk->Zero();
9486 fIntFlowCorrelationsEBE->Reset();
9487 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9488 fIntFlowCorrelationsAllEBE->Reset();
9489
b92ea2b9 9490 for(Int_t sc=0;sc<2;sc++)
489d5531 9491 {
b92ea2b9 9492 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
9493 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 9494 }
9495
9496 // differential flow:
9497 // 1D:
9498 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9499 {
9500 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9501 {
9502 for(Int_t m=0;m<4;m++) // multiple of harmonic
9503 {
9504 for(Int_t k=0;k<9;k++) // power of weight
9505 {
9506 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9507 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9508 }
9509 }
9510 }
9511 }
9512
9513 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9514 {
9515 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9516 {
9517 for(Int_t k=0;k<9;k++)
9518 {
9519 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9520 }
9521 }
9522 }
9523
9524 // e-b-e reduced correlations:
9525 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9526 {
9527 for(Int_t pe=0;pe<2;pe++) // pt or eta
9528 {
9529 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9530 {
9531 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9532 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9533 }
9534 }
9535 }
9536
9537 // correction terms for NUA:
9538 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9539 {
9540 for(Int_t pe=0;pe<2;pe++) // pt or eta
9541 {
9542 for(Int_t sc=0;sc<2;sc++) // sin or cos
9543 {
9544 for(Int_t cti=0;cti<9;cti++) // correction term index
9545 {
9546 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
9547 }
9548 }
9549 }
9550 }
9551
9552 // 2D (pt,eta)
9553 if(fCalculate2DFlow)
9554 {
9555 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9556 {
9557 for(Int_t m=0;m<4;m++) // multiple of harmonic
9558 {
9559 for(Int_t k=0;k<9;k++) // power of weight
9560 {
b77b6434 9561 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
9562 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
489d5531 9563 }
9564 }
9565 }
9566 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9567 {
9568 for(Int_t k=0;k<9;k++)
9569 {
b77b6434 9570 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
489d5531 9571 }
9572 }
9573 } // end of if(fCalculate2DFlow)
9574
9575} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9576
9577
9578//================================================================================================================================
9579
9580
9581void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9582{
9583 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9584
9585 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9586 // 0: <<sin n(psi1)>>
9587 // 1: <<sin n(psi1+phi2)>>
9588 // 2: <<sin n(psi1+phi2-phi3)>>
9589 // 3: <<sin n(psi1-phi2-phi3)>>:
9590 // 4:
9591 // 5:
9592 // 6:
9593
9594 // multiplicity:
9595 Double_t dMult = (*fSMpk)(0,0);
9596
9597 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9598 Double_t dReQ1n = (*fReQ)(0,0);
9599 Double_t dReQ2n = (*fReQ)(1,0);
9600 //Double_t dReQ3n = (*fReQ)(2,0);
9601 //Double_t dReQ4n = (*fReQ)(3,0);
9602 Double_t dImQ1n = (*fImQ)(0,0);
9603 Double_t dImQ2n = (*fImQ)(1,0);
9604 //Double_t dImQ3n = (*fImQ)(2,0);
9605 //Double_t dImQ4n = (*fImQ)(3,0);
9606
9607 Int_t t = -1; // type flag
9608 Int_t pe = -1; // ptEta flag
9609
9610 if(type == "RP")
9611 {
9612 t = 0;
9613 } else if(type == "POI")
9614 {
9615 t = 1;
9616 }
9617
9618 if(ptOrEta == "Pt")
9619 {
9620 pe = 0;
9621 } else if(ptOrEta == "Eta")
9622 {
9623 pe = 1;
9624 }
9625
9626 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9627 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9628 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9629 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9630
9631 // looping over all bins and calculating correction terms:
9632 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9633 {
9634 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9635 Double_t p1n0kRe = 0.;
9636 Double_t p1n0kIm = 0.;
9637
9638 // number of POIs in particular pt or eta bin:
9639 Double_t mp = 0.;
9640
9641 // 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):
9642 Double_t q1n0kRe = 0.;
9643 Double_t q1n0kIm = 0.;
9644 Double_t q2n0kRe = 0.;
9645 Double_t q2n0kIm = 0.;
9646
9647 // number of particles which are both RPs and POIs in particular pt or eta bin:
9648 Double_t mq = 0.;
9649
9650 if(type == "POI")
9651 {
9652 // q_{m*n,0}:
9653 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9654 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9655 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9656 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9657 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9658 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9659 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9660 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9661
9662 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9663 }
9664 else if(type == "RP")
9665 {
9666 // q_{m*n,0}:
9667 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9668 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9669 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9670 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9671 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9672 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9673 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9674 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9675
9676 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9677 }
9678 if(type == "POI")
9679 {
9680 // p_{m*n,0}:
9681 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9682 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9683 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9684 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9685
9686 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9687
9688 t = 1; // typeFlag = RP or POI
9689 }
9690 else if(type == "RP")
9691 {
9692 // p_{m*n,0} = q_{m*n,0}:
9693 p1n0kRe = q1n0kRe;
9694 p1n0kIm = q1n0kIm;
9695
9696 mp = mq;
9697
9698 t = 0; // typeFlag = RP or POI
9699 }
9700
9701 // <<sin n(psi1)>>:
9702 Double_t sinP1nPsi = 0.;
9703 if(mp)
9704 {
9705 sinP1nPsi = p1n0kIm/mp;
9706 // fill profile for <<sin n(psi1)>>:
9707 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9708 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9709 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9710 } // end of if(mp)
9711
9712 // <<sin n(psi1+phi2)>>:
9713 Double_t sinP1nPsiP1nPhi = 0.;
9714 if(mp*dMult-mq)
9715 {
9716 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9717 // fill profile for <<sin n(psi1+phi2)>>:
9718 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9719 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9720 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9721 } // end of if(mp*dMult-mq)
9722
9723 // <<sin n(psi1+phi2-phi3)>>:
9724 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9725 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9726 {
9727 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9728 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9729 - mq*dImQ1n+2.*q1n0kIm)
9730 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9731 // fill profile for <<sin n(psi1+phi2)>>:
9732 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9733 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9734 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9735 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9736
9737 // <<sin n(psi1-phi2-phi3)>>:
9738 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9739 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9740 {
9741 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9742 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9743 + 2.*mq*dImQ1n-2.*q1n0kIm)
9744 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9745 // fill profile for <<sin n(psi1+phi2)>>:
9746 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9747 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9748 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9749 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9750 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9751
9752} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9753
9754
9755//================================================================================================================================
9756
9757
9758void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9759{
9760 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9761
9762 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9763 // 0: <<cos n(psi)>>
9764 // 1: <<cos n(psi1+phi2)>>
9765 // 2: <<cos n(psi1+phi2-phi3)>>
9766 // 3: <<cos n(psi1-phi2-phi3)>>
9767 // 4:
9768 // 5:
9769 // 6:
9770
9771 // multiplicity:
9772 Double_t dMult = (*fSMpk)(0,0);
9773
9774 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9775 Double_t dReQ1n = (*fReQ)(0,0);
9776 Double_t dReQ2n = (*fReQ)(1,0);
9777 //Double_t dReQ3n = (*fReQ)(2,0);
9778 //Double_t dReQ4n = (*fReQ)(3,0);
9779 Double_t dImQ1n = (*fImQ)(0,0);
9780 Double_t dImQ2n = (*fImQ)(1,0);
9781 //Double_t dImQ3n = (*fImQ)(2,0);
9782 //Double_t dImQ4n = (*fImQ)(3,0);
9783
9784 Int_t t = -1; // type flag
9785 Int_t pe = -1; // ptEta flag
9786
9787 if(type == "RP")
9788 {
9789 t = 0;
9790 } else if(type == "POI")
9791 {
9792 t = 1;
9793 }
9794
9795 if(ptOrEta == "Pt")
9796 {
9797 pe = 0;
9798 } else if(ptOrEta == "Eta")
9799 {
9800 pe = 1;
9801 }
9802
9803 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9804 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9805 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9806 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9807
9808 // looping over all bins and calculating correction terms:
9809 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9810 {
9811 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9812 Double_t p1n0kRe = 0.;
9813 Double_t p1n0kIm = 0.;
9814
9815 // number of POIs in particular pt or eta bin:
9816 Double_t mp = 0.;
9817
9818 // 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):
9819 Double_t q1n0kRe = 0.;
9820 Double_t q1n0kIm = 0.;
9821 Double_t q2n0kRe = 0.;
9822 Double_t q2n0kIm = 0.;
9823
9824 // number of particles which are both RPs and POIs in particular pt or eta bin:
9825 Double_t mq = 0.;
9826
9827 if(type == "POI")
9828 {
9829 // q_{m*n,0}:
9830 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9831 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9832 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9833 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9834 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9835 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9836 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9837 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9838
9839 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9840 }
9841 else if(type == "RP")
9842 {
9843 // q_{m*n,0}:
9844 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9845 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9846 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9847 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9848 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9849 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9850 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9851 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9852
9853 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9854 }
9855 if(type == "POI")
9856 {
9857 // p_{m*n,0}:
9858 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9859 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9860 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9861 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9862
9863 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9864
9865 t = 1; // typeFlag = RP or POI
9866 }
9867 else if(type == "RP")
9868 {
9869 // p_{m*n,0} = q_{m*n,0}:
9870 p1n0kRe = q1n0kRe;
9871 p1n0kIm = q1n0kIm;
9872
9873 mp = mq;
9874
9875 t = 0; // typeFlag = RP or POI
9876 }
9877
9878 // <<cos n(psi1)>>:
9879 Double_t cosP1nPsi = 0.;
9880 if(mp)
9881 {
9882 cosP1nPsi = p1n0kRe/mp;
9883
9884 // fill profile for <<cos n(psi1)>>:
9885 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
9886 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
9887 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
9888 } // end of if(mp)
9889
9890 // <<cos n(psi1+phi2)>>:
9891 Double_t cosP1nPsiP1nPhi = 0.;
9892 if(mp*dMult-mq)
9893 {
9894 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
9895 // fill profile for <<sin n(psi1+phi2)>>:
9896 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
9897 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9898 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
9899 } // end of if(mp*dMult-mq)
9900
9901 // <<cos n(psi1+phi2-phi3)>>:
9902 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
9903 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9904 {
9905 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9906 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
9907 - mq*dReQ1n+2.*q1n0kRe)
9908 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9909 // fill profile for <<sin n(psi1+phi2)>>:
9910 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9911 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9912 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
9913 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9914
9915 // <<cos n(psi1-phi2-phi3)>>:
9916 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
9917 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9918 {
9919 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
9920 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
9921 - 2.*mq*dReQ1n+2.*q1n0kRe)
9922 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9923 // fill profile for <<sin n(psi1+phi2)>>:
9924 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9925 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9926 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
9927 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9928 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9929
9930} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9931
9932
9933//==================================================================================================================================
9934
9935
9936void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9937{
9938 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)
9939
9940 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging)
9941
9942 Int_t t = -1; // type flag
9943 Int_t pe = -1; // ptEta flag
9944
9945 if(type == "RP")
9946 {
9947 t = 0;
9948 } else if(type == "POI")
9949 {
9950 t = 1;
9951 }
9952
9953 if(ptOrEta == "Pt")
9954 {
9955 pe = 0;
9956 } else if(ptOrEta == "Eta")
9957 {
9958 pe = 1;
9959 }
9960
9961 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9962 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
9963 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9964 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9965
9966 for(Int_t sc=0;sc<2;sc++) // sin or cos
9967 {
9968 for(Int_t cti=0;cti<9;cti++) // correction term index
9969 {
9970 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9971 {
9972 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
9973 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
9974 // to be improved (propagate error correctly)
9975 // ...
9976 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9977 } // correction term index
9978 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9979
9980}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9981
9982
9983//==================================================================================================================================
9984
9985
9986void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9987{
9988 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)
9989
9990 Int_t typeFlag = -1;
9991 Int_t ptEtaFlag = -1;
9992
9993 if(type == "RP")
9994 {
9995 typeFlag = 0;
9996 } else if(type == "POI")
9997 {
9998 typeFlag = 1;
9999 }
10000
10001 if(ptOrEta == "Pt")
10002 {
10003 ptEtaFlag = 0;
10004 } else if(ptOrEta == "Eta")
10005 {
10006 ptEtaFlag = 1;
10007 }
10008
10009 // shortcuts:
10010 Int_t t = typeFlag;
10011 Int_t pe = ptEtaFlag;
10012
10013 // common:
10014 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10015
10016 // 2-particle correlation:
10017 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
10018 // sin term coming from integrated flow:
10019 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
10020 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
10021 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
10022 // cos term coming from integrated flow:
10023 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
10024 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
10025 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
10026
10027 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10028 {
10029 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
10030 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
10031 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
10032 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
10033 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
10034 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
10035 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
10036 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
10037 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
10038 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
10039 // generalized QC{2'}:
10040 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
10041 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
10042 // generalized QC{4'}:
10043 Double_t qc4Prime = fourPrime-2.*twoPrime*two
10044 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
10045 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
10046 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
10047 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
10048 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
10049 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
10050 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
10051 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
10052 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10053 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
10054 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
10055 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10056 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
10057 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
10058 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10059 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10060 - 12.*cosP1nPhi*sinP1nPhi
10061 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
10062 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
10063 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
10064
10065} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10066
10067
10068//==================================================================================================================================
10069
10070
10071void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
10072{
10073 // Calculate differential flow corrected for non-uniform acceptance.
10074
10075 // to be improved (rewritten completely)
10076
10077 Int_t typeFlag = -1;
10078 Int_t ptEtaFlag = -1;
10079
10080 if(type == "RP")
10081 {
10082 typeFlag = 0;
10083 } else if(type == "POI")
10084 {
10085 typeFlag = 1;
10086 }
10087
10088 if(ptOrEta == "Pt")
10089 {
10090 ptEtaFlag = 0;
10091 } else if(ptOrEta == "Eta")
10092 {
10093 ptEtaFlag = 1;
10094 }
10095
10096 // shortcuts:
10097 Int_t t = typeFlag;
10098 Int_t pe = ptEtaFlag;
10099
10100 // common:
10101 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10102
10103 // to be improved: access here generalized QC{2} and QC{4} instead:
10104 Double_t dV2 = fIntFlow->GetBinContent(1);
10105 Double_t dV4 = fIntFlow->GetBinContent(2);
10106
10107 // loop over pt or eta bins:
10108 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10109 {
10110 // generalized QC{2'}:
10111 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);
10112 // v'{2}:
10113 if(dV2>0)
10114 {
10115 Double_t v2Prime = gQC2Prime/dV2;
10116 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
10117 }
10118 // generalized QC{4'}:
10119 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);
10120 // v'{4}:
10121 if(dV4>0)
10122 {
10123 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);
10124 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
10125 }
10126 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
10127
10128} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
10129
10130
10131//==================================================================================================================================
10132
10133
0328db2d 10134void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10135{
10136 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
10137
10138 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
10139 //
10140 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
10141 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
10142 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
10143 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
10144 // 5th bin: ---- EMPTY ----
10145 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
10146 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
10147 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
10148 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
10149 // 10th bin: ---- EMPTY ----
10150 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
10151 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
10152 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
10153 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
10154 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
10155 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
10156 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
10157 // 18th bin: ---- EMPTY ----
10158 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
10159 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
10160 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
10161 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
10162 // 23rd bin: ---- EMPTY ----
10163 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
10164 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
10165 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
10166 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
10167 // 28th bin: ---- EMPTY ----
10168 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
10169 // 30th bin: ---- EMPTY ----
10170 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
10171
10172 Int_t nPrim = anEvent->NumberOfTracks();
10173 AliFlowTrackSimple *aftsTrack = NULL;
10174 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10175 Int_t n = fHarmonic;
10176 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10177 Double_t dMult = (*fSMpk)(0,0);
10178 cout<<endl;
10179 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10180 if(dMult<2)
10181 {
10182 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10183 } else if (dMult>fMaxAllowedMultiplicity)
10184 {
10185 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10186 } else
10187 {
10188 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10189 }
10190
10191 // 2-particle correlations:
10192 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10193 {
10194 for(Int_t i1=0;i1<nPrim;i1++)
10195 {
10196 aftsTrack=anEvent->GetTrack(i1);
10197 if(!(aftsTrack->InRPSelection())) continue;
10198 phi1=aftsTrack->Phi();
10199 for(Int_t i2=0;i2<nPrim;i2++)
10200 {
10201 if(i2==i1)continue;
10202 aftsTrack=anEvent->GetTrack(i2);
10203 if(!(aftsTrack->InRPSelection())) continue;
10204 phi2=aftsTrack->Phi();
10205 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10206 // fill the profile with 2-p correlations:
10207 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
10208 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
10209 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
10210 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
10211 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10212 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10213 } // end of if(nPrim>=2)
10214
10215 // 3-particle correlations:
10216 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10217 {
10218 for(Int_t i1=0;i1<nPrim;i1++)
10219 {
10220 aftsTrack=anEvent->GetTrack(i1);
10221 if(!(aftsTrack->InRPSelection())) continue;
10222 phi1=aftsTrack->Phi();
10223 for(Int_t i2=0;i2<nPrim;i2++)
10224 {
10225 if(i2==i1)continue;
10226 aftsTrack=anEvent->GetTrack(i2);
10227 if(!(aftsTrack->InRPSelection())) continue;
10228 phi2=aftsTrack->Phi();
10229 for(Int_t i3=0;i3<nPrim;i3++)
10230 {
10231 if(i3==i1||i3==i2)continue;
10232 aftsTrack=anEvent->GetTrack(i3);
10233 if(!(aftsTrack->InRPSelection())) continue;
10234 phi3=aftsTrack->Phi();
10235 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10236 // fill the profile with 3-p correlations:
10237 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
10238 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
10239 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
10240 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
10241 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10242 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10243 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10244 } // end of if(nPrim>=3)
10245
10246 // 4-particle correlations:
10247 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10248 {
10249 for(Int_t i1=0;i1<nPrim;i1++)
10250 {
10251 aftsTrack=anEvent->GetTrack(i1);
10252 if(!(aftsTrack->InRPSelection())) continue;
10253 phi1=aftsTrack->Phi();
10254 for(Int_t i2=0;i2<nPrim;i2++)
10255 {
10256 if(i2==i1)continue;
10257 aftsTrack=anEvent->GetTrack(i2);
10258 if(!(aftsTrack->InRPSelection())) continue;
10259 phi2=aftsTrack->Phi();
10260 for(Int_t i3=0;i3<nPrim;i3++)
10261 {
10262 if(i3==i1||i3==i2)continue;
10263 aftsTrack=anEvent->GetTrack(i3);
10264 if(!(aftsTrack->InRPSelection())) continue;
10265 phi3=aftsTrack->Phi();
10266 for(Int_t i4=0;i4<nPrim;i4++)
10267 {
10268 if(i4==i1||i4==i2||i4==i3)continue;
10269 aftsTrack=anEvent->GetTrack(i4);
10270 if(!(aftsTrack->InRPSelection())) continue;
10271 phi4=aftsTrack->Phi();
10272 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10273 // fill the profile with 4-p correlations:
10274 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10275 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10276 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10277 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10278 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10279 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10280 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
10281 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10282 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10283 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10284 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10285 } // end of if(nPrim>=)
10286
10287 // 5-particle correlations:
10288 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10289 {
10290 for(Int_t i1=0;i1<nPrim;i1++)
10291 {
10292 aftsTrack=anEvent->GetTrack(i1);
10293 if(!(aftsTrack->InRPSelection())) continue;
10294 phi1=aftsTrack->Phi();
10295 for(Int_t i2=0;i2<nPrim;i2++)
10296 {
10297 if(i2==i1)continue;
10298 aftsTrack=anEvent->GetTrack(i2);
10299 if(!(aftsTrack->InRPSelection())) continue;
10300 phi2=aftsTrack->Phi();
10301 for(Int_t i3=0;i3<nPrim;i3++)
10302 {
10303 if(i3==i1||i3==i2)continue;
10304 aftsTrack=anEvent->GetTrack(i3);
10305 if(!(aftsTrack->InRPSelection())) continue;
10306 phi3=aftsTrack->Phi();
10307 for(Int_t i4=0;i4<nPrim;i4++)
10308 {
10309 if(i4==i1||i4==i2||i4==i3)continue;
10310 aftsTrack=anEvent->GetTrack(i4);
10311 if(!(aftsTrack->InRPSelection())) continue;
10312 phi4=aftsTrack->Phi();
10313 for(Int_t i5=0;i5<nPrim;i5++)
10314 {
10315 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10316 aftsTrack=anEvent->GetTrack(i5);
10317 if(!(aftsTrack->InRPSelection())) continue;
10318 phi5=aftsTrack->Phi();
10319 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10320 // fill the profile with 5-p correlations:
10321 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10322 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10323 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10324 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
10325 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10326 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10327 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10328 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10329 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10330 } // end of if(nPrim>=5)
10331
10332 // 6-particle correlations:
10333 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10334 {
10335 for(Int_t i1=0;i1<nPrim;i1++)
10336 {
10337 aftsTrack=anEvent->GetTrack(i1);
10338 if(!(aftsTrack->InRPSelection())) continue;
10339 phi1=aftsTrack->Phi();
10340 for(Int_t i2=0;i2<nPrim;i2++)
10341 {
10342 if(i2==i1)continue;
10343 aftsTrack=anEvent->GetTrack(i2);
10344 if(!(aftsTrack->InRPSelection())) continue;
10345 phi2=aftsTrack->Phi();
10346 for(Int_t i3=0;i3<nPrim;i3++)
10347 {
10348 if(i3==i1||i3==i2)continue;
10349 aftsTrack=anEvent->GetTrack(i3);
10350 if(!(aftsTrack->InRPSelection())) continue;
10351 phi3=aftsTrack->Phi();
10352 for(Int_t i4=0;i4<nPrim;i4++)
10353 {
10354 if(i4==i1||i4==i2||i4==i3)continue;
10355 aftsTrack=anEvent->GetTrack(i4);
10356 if(!(aftsTrack->InRPSelection())) continue;
10357 phi4=aftsTrack->Phi();
10358 for(Int_t i5=0;i5<nPrim;i5++)
10359 {
10360 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10361 aftsTrack=anEvent->GetTrack(i5);
10362 if(!(aftsTrack->InRPSelection())) continue;
10363 phi5=aftsTrack->Phi();
10364 for(Int_t i6=0;i6<nPrim;i6++)
10365 {
10366 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10367 aftsTrack=anEvent->GetTrack(i6);
10368 if(!(aftsTrack->InRPSelection())) continue;
10369 phi6=aftsTrack->Phi();
10370 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10371 // fill the profile with 6-p correlations:
10372 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10373 fIntFlowDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,n,n|2n,n,n}
10374 fIntFlowDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,2n|n,n,n,n}
10375 fIntFlowDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n}
10376 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10377 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10378 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10379 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10380 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10381 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10382 } // end of if(nPrim>=6)
10383
10384 // 7-particle correlations:
10385 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10386 {
10387 for(Int_t i1=0;i1<nPrim;i1++)
10388 {
10389 aftsTrack=anEvent->GetTrack(i1);
10390 if(!(aftsTrack->InRPSelection())) continue;
10391 phi1=aftsTrack->Phi();
10392 for(Int_t i2=0;i2<nPrim;i2++)
10393 {
10394 if(i2==i1)continue;
10395 aftsTrack=anEvent->GetTrack(i2);
10396 if(!(aftsTrack->InRPSelection())) continue;
10397 phi2=aftsTrack->Phi();
10398 for(Int_t i3=0;i3<nPrim;i3++)
10399 {
10400 if(i3==i1||i3==i2)continue;
10401 aftsTrack=anEvent->GetTrack(i3);
10402 if(!(aftsTrack->InRPSelection())) continue;
10403 phi3=aftsTrack->Phi();
10404 for(Int_t i4=0;i4<nPrim;i4++)
10405 {
10406 if(i4==i1||i4==i2||i4==i3)continue;
10407 aftsTrack=anEvent->GetTrack(i4);
10408 if(!(aftsTrack->InRPSelection())) continue;
10409 phi4=aftsTrack->Phi();
10410 for(Int_t i5=0;i5<nPrim;i5++)
10411 {
10412 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10413 aftsTrack=anEvent->GetTrack(i5);
10414 if(!(aftsTrack->InRPSelection())) continue;
10415 phi5=aftsTrack->Phi();
10416 for(Int_t i6=0;i6<nPrim;i6++)
10417 {
10418 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10419 aftsTrack=anEvent->GetTrack(i6);
10420 if(!(aftsTrack->InRPSelection())) continue;
10421 phi6=aftsTrack->Phi();
10422 for(Int_t i7=0;i7<nPrim;i7++)
10423 {
10424 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10425 aftsTrack=anEvent->GetTrack(i7);
10426 if(!(aftsTrack->InRPSelection())) continue;
10427 phi7=aftsTrack->Phi();
10428 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10429 // fill the profile with 7-p correlation:
10430 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}
10431 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10432 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10433 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10434 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10435 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10436 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10437 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10438 } // end of if(nPrim>=7)
10439
10440 // 8-particle correlations:
10441 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10442 {
10443 for(Int_t i1=0;i1<nPrim;i1++)
10444 {
10445 aftsTrack=anEvent->GetTrack(i1);
10446 if(!(aftsTrack->InRPSelection())) continue;
10447 phi1=aftsTrack->Phi();
10448 for(Int_t i2=0;i2<nPrim;i2++)
10449 {
10450 if(i2==i1)continue;
10451 aftsTrack=anEvent->GetTrack(i2);
10452 if(!(aftsTrack->InRPSelection())) continue;
10453 phi2=aftsTrack->Phi();
10454 for(Int_t i3=0;i3<nPrim;i3++)
10455 {
10456 if(i3==i1||i3==i2)continue;
10457 aftsTrack=anEvent->GetTrack(i3);
10458 if(!(aftsTrack->InRPSelection())) continue;
10459 phi3=aftsTrack->Phi();
10460 for(Int_t i4=0;i4<nPrim;i4++)
10461 {
10462 if(i4==i1||i4==i2||i4==i3)continue;
10463 aftsTrack=anEvent->GetTrack(i4);
10464 if(!(aftsTrack->InRPSelection())) continue;
10465 phi4=aftsTrack->Phi();
10466 for(Int_t i5=0;i5<nPrim;i5++)
10467 {
10468 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10469 aftsTrack=anEvent->GetTrack(i5);
10470 if(!(aftsTrack->InRPSelection())) continue;
10471 phi5=aftsTrack->Phi();
10472 for(Int_t i6=0;i6<nPrim;i6++)
10473 {
10474 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10475 aftsTrack=anEvent->GetTrack(i6);
10476 if(!(aftsTrack->InRPSelection())) continue;
10477 phi6=aftsTrack->Phi();
10478 for(Int_t i7=0;i7<nPrim;i7++)
10479 {
10480 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10481 aftsTrack=anEvent->GetTrack(i7);
10482 if(!(aftsTrack->InRPSelection())) continue;
10483 phi7=aftsTrack->Phi();
10484 for(Int_t i8=0;i8<nPrim;i8++)
10485 {
10486 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10487 aftsTrack=anEvent->GetTrack(i8);
10488 if(!(aftsTrack->InRPSelection())) continue;
10489 phi8=aftsTrack->Phi();
10490 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10491 // fill the profile with 8-p correlation:
10492 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}
10493 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10494 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10495 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10496 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10497 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10498 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10499 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10500 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10501 } // end of if(nPrim>=8)
10502
10503 cout<<endl;
10504
10505} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10506
10507
10508//==================================================================================================================================
10509
10510
10511void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10512{
10513 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10514
10515 cout<<endl;
10516 cout<<endl;
10517 cout<<" *****************************************"<<endl;
10518 cout<<" **** cross-checking the correlations ****"<<endl;
10519 cout<<" **** for integrated flow ****"<<endl;
10520 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10521 {
10522 cout<<" **** (particle weights not used) ****"<<endl;
10523 } else
10524 {
10525 cout<<" **** (particle weights used) ****"<<endl;
10526 }
10527 cout<<" *****************************************"<<endl;
10528 cout<<endl;
10529 cout<<endl;
10530
10531 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
10532
10533 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10534 {
10535 ciMax = 11;
10536 }
10537
10538 for(Int_t ci=1;ci<=ciMax;ci++)
10539 {
10540 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10541 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10542 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10543 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10544 cout<<endl;
10545 }
10546
10547} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10548
10549
10550//================================================================================================================================
10551
10552
10553void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10554{
10555 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10556
10557 cout<<endl;
10558 cout<<endl;
10559 cout<<" *********************************************"<<endl;
10560 cout<<" **** cross-checking the correction terms ****"<<endl;
10561 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10562 cout<<" **** for integrated flow ****"<<endl;
10563 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10564 {
10565 cout<<" **** (particle weights not used) ****"<<endl;
10566 } else
10567 {
10568 cout<<" **** (particle weights used) ****"<<endl;
10569 }
10570 cout<<" *********************************************"<<endl;
10571 cout<<endl;
10572 cout<<endl;
10573
b92ea2b9 10574 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 10575 {
10576 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10577 {
10578 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10579 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10580 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10581 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10582 cout<<endl;
10583 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10584 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10585
10586} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10587
10588
10589//================================================================================================================================
10590
10591
0328db2d 10592void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 10593{
10594 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10595
10596 // Results are stored in profile fIntFlowDirectCorrelations.
10597 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10598 //
10599 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10600 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10601 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10602 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10603 // 5th bin: ---- EMPTY ----
10604 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10605 // 7th bin: <3>_{3n|2n,1n} = ...
10606 // 8th bin: <3>_{4n|2n,2n} = ...
10607 // 9th bin: <3>_{4n|3n,1n} = ...
10608 // 10th bin: ---- EMPTY ----
10609 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10610 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10611 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10612 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10613 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10614 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10615 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10616 // 18th bin: ---- EMPTY ----
10617 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10618 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10619 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10620 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10621 // 23rd bin: ---- EMPTY ----
10622 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10623 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10624 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10625 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10626 // 28th bin: ---- EMPTY ----
10627 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10628 // 30th bin: ---- EMPTY ----
10629 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 10630
489d5531 10631 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10632 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 10633
489d5531 10634 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10635 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10636 // ...
57340a27 10637
489d5531 10638 Int_t nPrim = anEvent->NumberOfTracks();
10639 AliFlowTrackSimple *aftsTrack = NULL;
10640 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10641 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10642 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10643 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10644 Int_t n = fHarmonic;
10645 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10646 Double_t dMult = (*fSMpk)(0,0);
10647 cout<<endl;
10648 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10649 if(dMult<2)
10650 {
10651 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10652 } else if (dMult>fMaxAllowedMultiplicity)
10653 {
10654 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10655 } else
10656 {
10657 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10658 }
10659
10660 // 2-particle correlations:
10661 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10662 {
10663 // 2 nested loops multiparticle correlations using particle weights:
10664 for(Int_t i1=0;i1<nPrim;i1++)
10665 {
10666 aftsTrack=anEvent->GetTrack(i1);
10667 if(!(aftsTrack->InRPSelection())) continue;
10668 phi1=aftsTrack->Phi();
10669 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10670 for(Int_t i2=0;i2<nPrim;i2++)
10671 {
10672 if(i2==i1)continue;
10673 aftsTrack=anEvent->GetTrack(i2);
10674 if(!(aftsTrack->InRPSelection())) continue;
10675 phi2=aftsTrack->Phi();
10676 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10677 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10678 // 2-p correlations using particle weights:
10679 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10680 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))>
10681 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))>
10682 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))>
10683 // extra correlations:
10684 // 2-p extra correlations (do not appear if particle weights are not used):
10685 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10686 // ...
10687 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10688 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10689 } // end of if(nPrim>=2)
10690
10691 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 10692 {
489d5531 10693 // 3 nested loops multiparticle correlations using particle weights:
10694 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10695 {
489d5531 10696 aftsTrack=anEvent->GetTrack(i1);
10697 if(!(aftsTrack->InRPSelection())) continue;
10698 phi1=aftsTrack->Phi();
10699 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10700 for(Int_t i2=0;i2<nPrim;i2++)
10701 {
10702 if(i2==i1)continue;
10703 aftsTrack=anEvent->GetTrack(i2);
10704 if(!(aftsTrack->InRPSelection())) continue;
10705 phi2=aftsTrack->Phi();
10706 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10707 for(Int_t i3=0;i3<nPrim;i3++)
10708 {
10709 if(i3==i1||i3==i2)continue;
10710 aftsTrack=anEvent->GetTrack(i3);
10711 if(!(aftsTrack->InRPSelection())) continue;
10712 phi3=aftsTrack->Phi();
10713 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10714 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10715 // 3-p correlations using particle weights:
10716 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))>
10717 // ...
10718 // extra correlations:
10719 // 2-p extra correlations (do not appear if particle weights are not used):
10720 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10721 // ...
10722 // 3-p extra correlations (do not appear if particle weights are not used):
10723 // ...
10724 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10725 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10726 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10727 } // end of if(nPrim>=3)
57340a27 10728
489d5531 10729 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10730 {
10731 // 4 nested loops multiparticle correlations using particle weights:
10732 for(Int_t i1=0;i1<nPrim;i1++)
10733 {
10734 aftsTrack=anEvent->GetTrack(i1);
10735 if(!(aftsTrack->InRPSelection())) continue;
10736 phi1=aftsTrack->Phi();
10737 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10738 for(Int_t i2=0;i2<nPrim;i2++)
10739 {
10740 if(i2==i1)continue;
10741 aftsTrack=anEvent->GetTrack(i2);
10742 if(!(aftsTrack->InRPSelection())) continue;
10743 phi2=aftsTrack->Phi();
10744 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10745 for(Int_t i3=0;i3<nPrim;i3++)
10746 {
10747 if(i3==i1||i3==i2)continue;
10748 aftsTrack=anEvent->GetTrack(i3);
10749 if(!(aftsTrack->InRPSelection())) continue;
10750 phi3=aftsTrack->Phi();
10751 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10752 for(Int_t i4=0;i4<nPrim;i4++)
10753 {
10754 if(i4==i1||i4==i2||i4==i3)continue;
10755 aftsTrack=anEvent->GetTrack(i4);
10756 if(!(aftsTrack->InRPSelection())) continue;
10757 phi4=aftsTrack->Phi();
10758 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10759 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10760 // 4-p correlations using particle weights:
10761 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10762 // extra correlations:
10763 // 2-p extra correlations (do not appear if particle weights are not used):
10764 // ...
10765 // 3-p extra correlations (do not appear if particle weights are not used):
10766 // ...
10767 // 4-p extra correlations (do not appear if particle weights are not used):
10768 // ...
10769 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10770 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10771 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10772 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10773 } // end of if(nPrim>=4)
57340a27 10774
489d5531 10775 cout<<endl;
57340a27 10776
489d5531 10777} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 10778
489d5531 10779
10780//================================================================================================================================
10781
10782
10783void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10784{
489d5531 10785 // Cross-check results for extra multiparticle correlations needed for int. flow
10786 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 10787
489d5531 10788 cout<<endl;
10789 cout<<endl;
10790 cout<<" ***********************************************"<<endl;
10791 cout<<" **** cross-checking the extra correlations ****"<<endl;
10792 cout<<" **** for integrated flow ****"<<endl;
10793 cout<<" ***********************************************"<<endl;
10794 cout<<endl;
10795 cout<<endl;
10796
10797 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 10798 {
489d5531 10799 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
10800 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
10801 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
10802 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
10803 cout<<endl;
10804 }
57340a27 10805
489d5531 10806} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10807
10808
489d5531 10809//================================================================================================================================
3b552efe 10810
10811
0328db2d 10812void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10813{
10814 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
10815 //
10816 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
10817 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
10818 // (sc stands for either sin or cos):
10819
10820 // 1st bin: <<sc(n*(phi1))>>
10821 // 2nd bin: <<sc(n*(phi1+phi2))>>
10822 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
10823 // 4th bin: <<sc(n*(2phi1-phi2))>>
10824
10825 Int_t nPrim = anEvent->NumberOfTracks();
10826 AliFlowTrackSimple *aftsTrack = NULL;
10827 Double_t phi1=0., phi2=0., phi3=0.;
10828 Int_t n = fHarmonic;
10829 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10830 Double_t dMult = (*fSMpk)(0,0);
10831 cout<<endl;
10832 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10833 if(dMult<1)
3b552efe 10834 {
489d5531 10835 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10836 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 10837 {
489d5531 10838 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10839 } else
10840 {
10841 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10842 }
10843
10844 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10845 {
10846 // 1-particle correction terms for non-uniform acceptance:
10847 for(Int_t i1=0;i1<nPrim;i1++)
10848 {
10849 aftsTrack=anEvent->GetTrack(i1);
10850 if(!(aftsTrack->InRPSelection())) continue;
10851 phi1=aftsTrack->Phi();
10852 if(nPrim==1) cout<<i1<<"\r"<<flush;
10853 // sin terms:
10854 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
10855 // cos terms:
10856 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
10857 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10858 } // end of if(nPrim>=1)
10859
10860 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10861 {
10862 // 2-particle correction terms for non-uniform acceptance:
10863 for(Int_t i1=0;i1<nPrim;i1++)
10864 {
10865 aftsTrack=anEvent->GetTrack(i1);
10866 if(!(aftsTrack->InRPSelection())) continue;
10867 phi1=aftsTrack->Phi();
10868 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 10869 {
489d5531 10870 if(i2==i1)continue;
10871 aftsTrack=anEvent->GetTrack(i2);
10872 if(!(aftsTrack->InRPSelection())) continue;
10873 phi2=aftsTrack->Phi();
10874 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10875 // sin terms:
3b552efe 10876 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 10877 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
10878 // cos terms:
3b552efe 10879 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 10880 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
10881 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10882 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10883 } // end of if(nPrim>=2)
10884
10885 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10886 {
10887 // 3-particle correction terms for non-uniform acceptance:
10888 for(Int_t i1=0;i1<nPrim;i1++)
10889 {
10890 aftsTrack=anEvent->GetTrack(i1);
10891 if(!(aftsTrack->InRPSelection())) continue;
10892 phi1=aftsTrack->Phi();
10893 for(Int_t i2=0;i2<nPrim;i2++)
10894 {
10895 if(i2==i1)continue;
10896 aftsTrack=anEvent->GetTrack(i2);
10897 if(!(aftsTrack->InRPSelection())) continue;
10898 phi2=aftsTrack->Phi();
10899 for(Int_t i3=0;i3<nPrim;i3++)
10900 {
10901 if(i3==i1||i3==i2)continue;
10902 aftsTrack=anEvent->GetTrack(i3);
10903 if(!(aftsTrack->InRPSelection())) continue;
10904 phi3=aftsTrack->Phi();
10905 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
10906 // sin terms:
10907 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
10908 // cos terms:
10909 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
10910 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10911 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10912 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10913 } // end of if(nPrim>=3)
10914
10915 cout<<endl;
10916}
10917//================================================================================================================================
0328db2d 10918void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 10919{
10920 // Evaluate reduced correlations with nested loops without using the particle weights.
10921
10922 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10923 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
10924 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
10925 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
10926 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
10927 // ...
10928
10929 Int_t typeFlag = -1;
10930 Int_t ptEtaFlag = -1;
10931 if(type == "RP")
10932 {
10933 typeFlag = 0;
10934 } else if(type == "POI")
10935 {
10936 typeFlag = 1;
10937 }
10938 if(ptOrEta == "Pt")
10939 {
10940 ptEtaFlag = 0;
10941 } else if(ptOrEta == "Eta")
10942 {
10943 ptEtaFlag = 1;
10944 }
10945 // shortcuts:
10946 Int_t t = typeFlag;
10947 Int_t pe = ptEtaFlag;
10948
10949 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10950 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10951 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10952
10953 Int_t nPrim = anEvent->NumberOfTracks();
10954 AliFlowTrackSimple *aftsTrack = NULL;
10955
10956 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10957
3b552efe 10958 Int_t n = fHarmonic;
489d5531 10959
10960 // 2'-particle correlations:
10961 for(Int_t i1=0;i1<nPrim;i1++)
10962 {
10963 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10964 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10965 if(typeFlag==1) // this is diff flow of POIs
489d5531 10966 {
10967 if(ptOrEta == "Pt")
10968 {
10969 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10970 } else if (ptOrEta == "Eta")
10971 {
10972 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10973 }
10974 } else // this is diff flow of RPs
10975 {
489d5531 10976 if(ptOrEta == "Pt")
10977 {
10978 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10979 } else if (ptOrEta == "Eta")
10980 {
10981 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10982 }
10983 }
489d5531 10984
10985 psi1=aftsTrack->Phi();
10986 for(Int_t i2=0;i2<nPrim;i2++)
10987 {
10988 if(i2==i1)continue;
10989 aftsTrack=anEvent->GetTrack(i2);
10990 // RP condition (!(first) particle in the correlator must be RP):
10991 if(!(aftsTrack->InRPSelection()))continue;
10992 phi2=aftsTrack->Phi();
10993 // 2'-particle correlations:
10994 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
10995 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10996 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10997
10998 /*
10999
11000 // 3'-particle correlations:
11001 for(Int_t i1=0;i1<nPrim;i1++)
11002 {
11003 aftsTrack=anEvent->GetTrack(i1);
11004 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11005 if(ptOrEta == "Pt")
11006 {
11007 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11008 } else if (ptOrEta == "Eta")
11009 {
11010 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11011 }
11012 psi1=aftsTrack->Phi();
11013 for(Int_t i2=0;i2<nPrim;i2++)
11014 {
11015 if(i2==i1)continue;
11016 aftsTrack=anEvent->GetTrack(i2);
11017 // RP condition (!(first) particle in the correlator must be RP):
11018 if(!(aftsTrack->InRPSelection())) continue;
11019 phi2=aftsTrack->Phi();
11020 for(Int_t i3=0;i3<nPrim;i3++)
11021 {
11022 if(i3==i1||i3==i2)continue;
11023 aftsTrack=anEvent->GetTrack(i3);
11024 // RP condition (!(first) particle in the correlator must be RP):
11025 if(!(aftsTrack->InRPSelection())) continue;
11026 phi3=aftsTrack->Phi();
11027 // 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))>
11028 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11029 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11030 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11031
11032 */
11033
11034 // 4'-particle correlations:
11035 for(Int_t i1=0;i1<nPrim;i1++)
11036 {
11037 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11038 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11039 if(typeFlag==1) // this is diff flow of POIs
489d5531 11040 {
11041 if(ptOrEta == "Pt")
11042 {
11043 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11044 } else if (ptOrEta == "Eta")
11045 {
11046 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11047 }
11048 } else // this is diff flow of RPs
11049 {
489d5531 11050 if(ptOrEta == "Pt")
11051 {
11052 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11053 } else if (ptOrEta == "Eta")
11054 {
11055 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11056 }
11057 }
489d5531 11058
11059 psi1=aftsTrack->Phi();
11060 for(Int_t i2=0;i2<nPrim;i2++)
11061 {
11062 if(i2==i1) continue;
11063 aftsTrack=anEvent->GetTrack(i2);
11064 // RP condition (!(first) particle in the correlator must be RP):
11065 if(!(aftsTrack->InRPSelection())) continue;
11066 phi2=aftsTrack->Phi();
11067 for(Int_t i3=0;i3<nPrim;i3++)
11068 {
11069 if(i3==i1||i3==i2) continue;
11070 aftsTrack=anEvent->GetTrack(i3);
11071 // RP condition (!(first) particle in the correlator must be RP):
11072 if(!(aftsTrack->InRPSelection())) continue;
11073 phi3=aftsTrack->Phi();
11074 for(Int_t i4=0;i4<nPrim;i4++)
11075 {
11076 if(i4==i1||i4==i2||i4==i3) continue;
11077 aftsTrack=anEvent->GetTrack(i4);
11078 // RP condition (!(first) particle in the correlator must be RP):
11079 if(!(aftsTrack->InRPSelection())) continue;
11080 phi4=aftsTrack->Phi();
11081 // 4'-particle correlations:
11082 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
11083 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11084 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11085 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11086 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11087
11088 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 11089 for(Int_t i=0;i<nPrim;i++)
11090 {
11091 aftsTrack=anEvent->GetTrack(i);
11092 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11093 if(typeFlag==1) // this is diff flow of POIs
489d5531 11094 {
11095 if(ptOrEta == "Pt")
11096 {
11097 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11098 } else if (ptOrEta == "Eta")
11099 {
11100 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11101 }
11102 } else // this is diff flow of RPs
11103 {
489d5531 11104 if(ptOrEta == "Pt")
11105 {
11106 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11107 } else if (ptOrEta == "Eta")
11108 {
11109 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11110 }
11111 }
11112 if(t==1)t++;
11113 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 11114 }
11115
11116} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11117
11118
11119//================================================================================================================================
11120
11121
11122void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11123{
11124 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11125
11126 Int_t typeFlag = -1;
11127 Int_t ptEtaFlag = -1;
11128 if(type == "RP")
11129 {
11130 typeFlag = 0;
11131 } else if(type == "POI")
11132 {
11133 typeFlag = 1;
11134 }
11135 if(ptOrEta == "Pt")
11136 {
11137 ptEtaFlag = 0;
11138 } else if(ptOrEta == "Eta")
11139 {
11140 ptEtaFlag = 1;
11141 }
11142 // shortcuts:
11143 Int_t t = typeFlag;
11144 Int_t pe = ptEtaFlag;
11145
11146 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11147 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11148 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
11149 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11150 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11151
11152 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11153
11154
11155 cout<<endl;
11156 cout<<" *****************************************"<<endl;
11157 cout<<" **** cross-checking the correlations ****"<<endl;
11158 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11159 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11160 {
11161 cout<<" **** (particle weights not used) ****"<<endl;
11162 } else
11163 {
11164 cout<<" **** (particle weights used) ****"<<endl;
11165 }
11166 cout<<" *****************************************"<<endl;
11167 cout<<endl;
11168 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11169 cout<<endl;
11170
11171 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
11172 {
11173 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
11174 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11175 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
11176 cout<<endl;
11177 } // end of for(Int_t rci=0;rci<4;rci++)
11178
11179} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11180
3b552efe 11181//================================================================================================================================
11182
489d5531 11183void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 11184{
11185 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
11186
11187 cout<<endl;
11188 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
11189 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
11190 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
11191 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
11192
489d5531 11193} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11194
3b552efe 11195//================================================================================================================================
11196
0328db2d 11197void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11198{
11199 // Evaluate reduced correlations with nested loops without using the particle weights.
11200
11201 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11202 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11203 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11204 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
11205 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
11206 // ...
11207
11208 Int_t typeFlag = -1;
11209 Int_t ptEtaFlag = -1;
11210 if(type == "RP")
11211 {
11212 typeFlag = 0;
11213 } else if(type == "POI")
11214 {
11215 typeFlag = 1;
11216 }
11217 if(ptOrEta == "Pt")
11218 {
11219 ptEtaFlag = 0;
11220 } else if(ptOrEta == "Eta")
11221 {
11222 ptEtaFlag = 1;
11223 }
11224 // shortcuts:
11225 Int_t t = typeFlag;
11226 Int_t pe = ptEtaFlag;
11227
11228 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11229 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11230 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11231
11232 Int_t nPrim = anEvent->NumberOfTracks();
11233 AliFlowTrackSimple *aftsTrack = NULL;
11234
11235 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11236 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11237
11238 Int_t n = fHarmonic;
11239
11240 // 2'-particle correlations:
11241 for(Int_t i1=0;i1<nPrim;i1++)
11242 {
11243 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11244 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11245 if(typeFlag==1) // this is diff flow of POIs
489d5531 11246 {
11247 if(ptOrEta == "Pt")
11248 {
11249 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11250 } else if (ptOrEta == "Eta")
11251 {
11252 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11253 }
11254 } else // this is diff flow of RPs
11255 {
489d5531 11256 if(ptOrEta == "Pt")
11257 {
11258 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11259 } else if (ptOrEta == "Eta")
11260 {
11261 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11262 }
489d5531 11263 }
11264 psi1=aftsTrack->Phi();
11265 for(Int_t i2=0;i2<nPrim;i2++)
11266 {
11267 if(i2==i1) continue;
11268 aftsTrack=anEvent->GetTrack(i2);
11269 // RP condition (!(first) particle in the correlator must be RP):
11270 if(!(aftsTrack->InRPSelection())) continue;
11271 phi2=aftsTrack->Phi();
11272 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11273 // 2'-particle correlations:
11274 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11275 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11276 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11277
11278 // 4'-particle correlations:
11279 for(Int_t i1=0;i1<nPrim;i1++)
11280 {
11281 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11282 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11283 if(typeFlag==1) // this is diff flow of POIs
489d5531 11284 {
11285 if(ptOrEta == "Pt")
11286 {
11287 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11288 } else if (ptOrEta == "Eta")
11289 {
11290 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11291 }
11292 } else // this is diff flow of RPs
11293 {
489d5531 11294 if(ptOrEta == "Pt")
11295 {
11296 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11297 } else if (ptOrEta == "Eta")
11298 {
11299 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11300 }
489d5531 11301 }
11302 psi1=aftsTrack->Phi();
11303 for(Int_t i2=0;i2<nPrim;i2++)
11304 {
11305 if(i2==i1) continue;
11306 aftsTrack=anEvent->GetTrack(i2);
11307 // RP condition (!(first) particle in the correlator must be RP):
11308 if(!(aftsTrack->InRPSelection())) continue;
11309 phi2=aftsTrack->Phi();
11310 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11311 for(Int_t i3=0;i3<nPrim;i3++)
11312 {
11313 if(i3==i1||i3==i2) continue;
11314 aftsTrack=anEvent->GetTrack(i3);
11315 // RP condition (!(first) particle in the correlator must be RP):
11316 if(!(aftsTrack->InRPSelection())) continue;
11317 phi3=aftsTrack->Phi();
11318 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11319 for(Int_t i4=0;i4<nPrim;i4++)
11320 {
11321 if(i4==i1||i4==i2||i4==i3) continue;
11322 aftsTrack=anEvent->GetTrack(i4);
11323 // RP condition (!(first) particle in the correlator must be RP):
11324 if(!(aftsTrack->InRPSelection())) continue;
11325 phi4=aftsTrack->Phi();
11326 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11327 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11328 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11329 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11330 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11331 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11332 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11333
11334 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 11335 for(Int_t i=0;i<nPrim;i++)
11336 {
489d5531 11337 aftsTrack=anEvent->GetTrack(i);
11338 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11339 if(typeFlag==1) // this is diff flow of POIs
11340 {
11341 if(ptOrEta == "Pt")
11342 {
11343 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11344 } else if (ptOrEta == "Eta")
11345 {
11346 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11347 }
11348 } else // this is diff flow of RPs
11349 {
11350 if(ptOrEta == "Pt")
11351 {
11352 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11353 } else if (ptOrEta == "Eta")
11354 {
11355 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11356 }
11357 }
11358 if(t==1)t++;
11359 fNoOfParticlesInBin->Fill(t+pe+0.5);
11360 }
11361
11362} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11363
11364
11365//================================================================================================================================
11366
11367
0328db2d 11368void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11369{
11370 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11371
11372 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11373 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11374 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11375 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11376 // cti:
11377 // 0: <<sc n(psi1)>>
11378 // 1: <<sc n(psi1+phi2)>>
11379 // 2: <<sc n(psi1+phi2-phi3)>>
11380 // 3: <<sc n(psi1-phi2-phi3)>>
11381 // 4:
11382 // 5:
11383 // 6:
11384
11385 Int_t typeFlag = -1;
11386 Int_t ptEtaFlag = -1;
11387 if(type == "RP")
11388 {
11389 typeFlag = 0;
11390 } else if(type == "POI")
11391 {
11392 typeFlag = 1;
11393 }
11394 if(ptOrEta == "Pt")
11395 {
11396 ptEtaFlag = 0;
11397 } else if(ptOrEta == "Eta")
11398 {
11399 ptEtaFlag = 1;
11400 }
11401 // shortcuts:
11402 Int_t t = typeFlag;
11403 Int_t pe = ptEtaFlag;
11404
11405 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11406 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11407 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11408
11409 Int_t nPrim = anEvent->NumberOfTracks();
11410 AliFlowTrackSimple *aftsTrack = NULL;
11411
11412 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11413
11414 Int_t n = fHarmonic;
11415
11416 // 1-particle correction terms:
11417 for(Int_t i1=0;i1<nPrim;i1++)
11418 {
11419 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11420 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11421 if(typeFlag==1) // this is diff flow of POIs
489d5531 11422 {
11423 if(ptOrEta == "Pt")
11424 {
11425 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11426 } else if (ptOrEta == "Eta")
11427 {
11428 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11429 }
11430 } else // this is diff flow of RPs
11431 {
489d5531 11432 if(ptOrEta == "Pt")
11433 {
11434 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11435 } else if (ptOrEta == "Eta")
11436 {
11437 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11438 }
11439 }
489d5531 11440 psi1=aftsTrack->Phi();
11441 // sin terms:
11442 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11443 // cos terms:
11444 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11445 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11446
11447 // 2-particle correction terms:
11448 for(Int_t i1=0;i1<nPrim;i1++)
11449 {
11450 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11451 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11452 if(typeFlag==1) // this is diff flow of POIs
489d5531 11453 {
11454 if(ptOrEta == "Pt")
11455 {
11456 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11457 } else if (ptOrEta == "Eta")
11458 {
11459 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11460 }
11461 } else // this is diff flow of RPs
11462 {
489d5531 11463 if(ptOrEta == "Pt")
11464 {
11465 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11466 } else if (ptOrEta == "Eta")
11467 {
11468 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11469 }
489d5531 11470 }
11471 psi1=aftsTrack->Phi();
11472 for(Int_t i2=0;i2<nPrim;i2++)
11473 {
11474 if(i2==i1) continue;
11475 aftsTrack=anEvent->GetTrack(i2);
11476 // RP condition (!(first) particle in the correlator must be RP):
11477 if(!(aftsTrack->InRPSelection())) continue;
11478 phi2=aftsTrack->Phi();
11479 // sin terms:
11480 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11481 // cos terms:
11482 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11483 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11484 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11485
11486 // 3-particle correction terms:
11487 for(Int_t i1=0;i1<nPrim;i1++)
11488 {
11489 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11490 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11491 if(typeFlag==1) // this is diff flow of POIs
489d5531 11492 {
11493 if(ptOrEta == "Pt")
11494 {
11495 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11496 } else if (ptOrEta == "Eta")
11497 {
11498 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11499 }
11500 } else // this is diff flow of RPs
11501 {
489d5531 11502 if(ptOrEta == "Pt")
11503 {
11504 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11505 } else if (ptOrEta == "Eta")
11506 {
11507 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11508 }
489d5531 11509 }
11510 psi1=aftsTrack->Phi();
11511 for(Int_t i2=0;i2<nPrim;i2++)
11512 {
11513 if(i2==i1) continue;
11514 aftsTrack=anEvent->GetTrack(i2);
11515 // RP condition (!(first) particle in the correlator must be RP):
11516 if(!(aftsTrack->InRPSelection())) continue;
11517 phi2=aftsTrack->Phi();
11518 for(Int_t i3=0;i3<nPrim;i3++)
11519 {
11520 if(i3==i1||i3==i2) continue;
11521 aftsTrack=anEvent->GetTrack(i3);
11522 // RP condition (!(first) particle in the correlator must be RP):
11523 if(!(aftsTrack->InRPSelection())) continue;
11524 phi3=aftsTrack->Phi();
11525 // sin terms:
11526 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11527 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11528 // cos terms:
11529 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11530 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11531 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11532 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11533 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11534
11535} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11536
11537
11538//================================================================================================================================
11539
11540
11541void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11542{
11543 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11544
11545 Int_t typeFlag = -1;
11546 Int_t ptEtaFlag = -1;
11547 if(type == "RP")
11548 {
11549 typeFlag = 0;
11550 } else if(type == "POI")
11551 {
11552 typeFlag = 1;
11553 }
11554 if(ptOrEta == "Pt")
11555 {
11556 ptEtaFlag = 0;
11557 } else if(ptOrEta == "Eta")
11558 {
11559 ptEtaFlag = 1;
11560 }
11561 // shortcuts:
11562 Int_t t = typeFlag;
11563 Int_t pe = ptEtaFlag;
11564
11565 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11566 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11567 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11568 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)
11569 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)
11570 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11571 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11572
11573 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11574
11575 cout<<endl;
11576 cout<<" ******************************************"<<endl;
11577 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 11578 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 11579 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11580 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11581 {
11582 cout<<" **** (particle weights not used) ****"<<endl;
11583 } else
11584 {
11585 cout<<" **** (particle weights used) ****"<<endl;
11586 }
11587 cout<<" ******************************************"<<endl;
11588 cout<<endl;
11589 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11590 cout<<endl;
11591
11592 for(Int_t cti=0;cti<4;cti++) // correction term index
11593 {
11594 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11595 {
11596 if(sc==0) // to be improved (this can be implemented better)
11597 {
11598 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11599 } else
11600 {
11601 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11602 }
11603 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11604 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11605 cout<<endl;
11606 }
11607 } // end of for(Int_t rci=0;rci<4;rci++)
11608
11609} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11610
11611
57340a27 11612//================================================================================================================================
11613
489d5531 11614
11615void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11616{
11617 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11618
11619 // **********************************************************************
11620 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11621 // **********************************************************************
57340a27 11622
489d5531 11623 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 11624 //
489d5531 11625 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11626 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11627 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11628 // ...
11629
11630 // multiplicity (number of particles used to determine the reaction plane)
11631 Double_t dMult = (*fSMpk)(0,0);
11632
11633 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11634 Double_t dReQ1n1k = (*fReQ)(0,1);
11635 Double_t dReQ2n2k = (*fReQ)(1,2);
11636 //Double_t dReQ3n3k = (*fReQ)(2,3);
11637 //Double_t dReQ4n4k = (*fReQ)(3,4);
11638 Double_t dReQ1n3k = (*fReQ)(0,3);
11639 Double_t dImQ1n1k = (*fImQ)(0,1);
11640 Double_t dImQ2n2k = (*fImQ)(1,2);
11641 //Double_t dImQ3n3k = (*fImQ)(2,3);
11642 //Double_t dImQ4n4k = (*fImQ)(3,4);
11643 //Double_t dImQ1n3k = (*fImQ)(0,3);
11644
11645 // dMs are variables introduced in order to simplify some Eqs. bellow:
11646 //..............................................................................................
11647 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11648 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11649 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11650 //..............................................................................................
ecac11c2 11651 // 1-particle:
489d5531 11652 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11653
0328db2d 11654 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11655 {
11656 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1);
11657
11658 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11659 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11660
11661 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
11662 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1));
11663 }
11664
11665 // 2-particle:
11666 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11667
0328db2d 11668 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11669 {
11670 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11671
11672 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11673 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11674
11675 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11676 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11677 }
11678
11679 // 3-particle:
11680 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11681
0328db2d 11682 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11683 {
57340a27 11684 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11685 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
11686 - 2.*((*fSMpk)(0,2))*dReQ1n1k
489d5531 11687 + 2.*dReQ1n3k)
11688 / dM111;
11689
11690 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11691 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11692
11693 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11694 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11695 }
11696
11697} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11698
11699
11700//================================================================================================================================
11701
11702
11703void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11704{
11705 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11706
11707 // **********************************************************************
11708 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11709 // **********************************************************************
11710
11711 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 11712 //
489d5531 11713 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11714 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11715 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11716 // ...
11717
11718 // multiplicity (number of particles used to determine the reaction plane)
11719 Double_t dMult = (*fSMpk)(0,0);
11720
11721 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11722 Double_t dReQ1n1k = (*fReQ)(0,1);
11723 Double_t dReQ2n2k = (*fReQ)(1,2);
11724 //Double_t dReQ3n3k = (*fReQ)(2,3);
11725 //Double_t dReQ4n4k = (*fReQ)(3,4);
11726 //Double_t dReQ1n3k = (*fReQ)(0,3);
11727 Double_t dImQ1n1k = (*fImQ)(0,1);
11728 Double_t dImQ2n2k = (*fImQ)(1,2);
11729 //Double_t dImQ3n3k = (*fImQ)(2,3);
11730 //Double_t dImQ4n4k = (*fImQ)(3,4);
11731 Double_t dImQ1n3k = (*fImQ)(0,3);
11732
11733 // dMs are variables introduced in order to simplify some Eqs. bellow:
11734 //..............................................................................................
11735 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11736 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11737 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11738 //..............................................................................................
11739
11740 // 1-particle:
11741 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11742
0328db2d 11743 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11744 {
11745 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1));
11746
11747 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11748 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11749
11750 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11751 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1));
11752 }
11753
11754 // 2-particle:
11755 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11756
0328db2d 11757 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11758 {
11759 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11760
11761 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11762 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11763
11764 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11765 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11766 }
11767
11768 // 3-particle:
11769 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11770
0328db2d 11771 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11772 {
57340a27 11773 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11774 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
11775 + 2.*((*fSMpk)(0,2))*dImQ1n1k
489d5531 11776 - 2.*dImQ1n3k)
11777 / dM111;
11778
11779 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11780 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11781
11782 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11783 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11784 }
11785
11786} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11787
11788
57340a27 11789//================================================================================================================================
489d5531 11790
11791
0328db2d 11792void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11793{
11794 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11795
57340a27 11796 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11797 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 11798
57340a27 11799 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 11800 // organized as follows (sc stands for either sin or cos):
11801 //
11802 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
11803 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
11804 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 11805 // ...
489d5531 11806
11807 Int_t nPrim = anEvent->NumberOfTracks();
11808 AliFlowTrackSimple *aftsTrack = NULL;
11809 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11810 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11811 Double_t phi1=0., phi2=0., phi3=0.;
11812 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
11813 Int_t n = fHarmonic;
11814 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11815 Double_t dMult = (*fSMpk)(0,0);
11816 cout<<endl;
11817 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11818 if(dMult<1)
11819 {
11820 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11821 } else if (dMult>fMaxAllowedMultiplicity)
11822 {
11823 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11824 } else
11825 {
11826 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11827 }
11828
11829 // 1-particle correction terms using particle weights:
11830 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11831 {
11832 for(Int_t i1=0;i1<nPrim;i1++)
11833 {
11834 aftsTrack=anEvent->GetTrack(i1);
11835 if(!(aftsTrack->InRPSelection())) continue;
11836 phi1=aftsTrack->Phi();
11837 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 11838 // 1-particle correction terms using particle weights:
489d5531 11839 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
11840 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 11841 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11842 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11843
489d5531 11844 // 2-particle correction terms using particle weights:
11845 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11846 {
11847 for(Int_t i1=0;i1<nPrim;i1++)
11848 {
11849 aftsTrack=anEvent->GetTrack(i1);
11850 if(!(aftsTrack->InRPSelection())) continue;
11851 phi1=aftsTrack->Phi();
11852 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11853 for(Int_t i2=0;i2<nPrim;i2++)
11854 {
11855 if(i2==i1)continue;
11856 aftsTrack=anEvent->GetTrack(i2);
11857 if(!(aftsTrack->InRPSelection())) continue;
11858 phi2=aftsTrack->Phi();
11859 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11860 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 11861 // 2-p correction terms using particle weights:
489d5531 11862 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
11863 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
11864 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11865 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11866 } // end of if(nPrim>=2)
11867
11868 // 3-particle correction terms using particle weights:
11869 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11870 {
11871 for(Int_t i1=0;i1<nPrim;i1++)
11872 {
11873 aftsTrack=anEvent->GetTrack(i1);
11874 if(!(aftsTrack->InRPSelection())) continue;
11875 phi1=aftsTrack->Phi();
11876 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11877 for(Int_t i2=0;i2<nPrim;i2++)
11878 {
11879 if(i2==i1)continue;
11880 aftsTrack=anEvent->GetTrack(i2);
11881 if(!(aftsTrack->InRPSelection())) continue;
11882 phi2=aftsTrack->Phi();
11883 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11884 for(Int_t i3=0;i3<nPrim;i3++)
11885 {
11886 if(i3==i1||i3==i2)continue;
11887 aftsTrack=anEvent->GetTrack(i3);
11888 if(!(aftsTrack->InRPSelection())) continue;
11889 phi3=aftsTrack->Phi();
11890 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11891 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 11892 // 3-p correction terms using particle weights:
489d5531 11893 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
11894 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
11895 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11896 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11897 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11898 } // end of if(nPrim>=3)
11899
57340a27 11900 /*
11901
489d5531 11902 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11903 {
11904 // 4 nested loops multiparticle correlations using particle weights:
11905 for(Int_t i1=0;i1<nPrim;i1++)
11906 {
11907 aftsTrack=anEvent->GetTrack(i1);
11908 if(!(aftsTrack->InRPSelection())) continue;
11909 phi1=aftsTrack->Phi();
11910 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11911 for(Int_t i2=0;i2<nPrim;i2++)
11912 {
11913 if(i2==i1)continue;
11914 aftsTrack=anEvent->GetTrack(i2);
11915 if(!(aftsTrack->InRPSelection())) continue;
11916 phi2=aftsTrack->Phi();
11917 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11918 for(Int_t i3=0;i3<nPrim;i3++)
11919 {
11920 if(i3==i1||i3==i2)continue;
11921 aftsTrack=anEvent->GetTrack(i3);
11922 if(!(aftsTrack->InRPSelection())) continue;
11923 phi3=aftsTrack->Phi();
11924 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11925 for(Int_t i4=0;i4<nPrim;i4++)
11926 {
11927 if(i4==i1||i4==i2||i4==i3)continue;
11928 aftsTrack=anEvent->GetTrack(i4);
11929 if(!(aftsTrack->InRPSelection())) continue;
11930 phi4=aftsTrack->Phi();
11931 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11932 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11933 // 4-p correlations using particle weights:
11934 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11935 // extra correlations:
11936 // 2-p extra correlations (do not appear if particle weights are not used):
11937 // ...
11938 // 3-p extra correlations (do not appear if particle weights are not used):
11939 // ...
11940 // 4-p extra correlations (do not appear if particle weights are not used):
11941 // ...
11942 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11943 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11944 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11945 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11946 } // end of if(nPrim>=4)
11947
11948 */
11949
11950 cout<<endl;
11951
11952} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
11953
11954
57340a27 11955//================================================================================================================================
489d5531 11956
11957
11958void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
11959{
11960 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 11961
489d5531 11962 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 11963 //
489d5531 11964 // 0: <<cos n(psi)>>
11965 // 1: <<w2 cos n(psi1+phi2)>>
11966 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
11967 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
11968 // 4:
11969 // 5:
11970 // 6:
11971
11972 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11973 Double_t dReQ1n1k = (*fReQ)(0,1);
11974 Double_t dReQ2n2k = (*fReQ)(1,2);
11975 //Double_t dReQ1n3k = (*fReQ)(0,3);
11976 //Double_t dReQ4n4k = (*fReQ)(3,4);
11977 Double_t dImQ1n1k = (*fImQ)(0,1);
11978 Double_t dImQ2n2k = (*fImQ)(1,2);
11979 //Double_t dImQ1n3k = (*fImQ)(0,3);
11980 //Double_t dImQ4n4k = (*fImQ)(3,4);
11981
11982 // S^M_{p,k} (see .h file for the definition of fSMpk):
11983 Double_t dSM1p1k = (*fSMpk)(0,1);
11984 Double_t dSM1p2k = (*fSMpk)(0,2);
11985 Double_t dSM2p1k = (*fSMpk)(1,1);
11986
11987 Int_t t = -1; // type flag
11988 Int_t pe = -1; // ptEta flag
11989
11990 if(type == "RP")
11991 {
11992 t = 0;
11993 } else if(type == "POI")
11994 {
11995 t = 1;
11996 }
11997
11998 if(ptOrEta == "Pt")
11999 {
12000 pe = 0;
12001 } else if(ptOrEta == "Eta")
12002 {
12003 pe = 1;
12004 }
12005
12006 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12007 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12008 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12009 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12010
12011 // looping over all bins and calculating correction terms:
12012 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12013 {
12014 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12015 Double_t p1n0kRe = 0.;
12016 Double_t p1n0kIm = 0.;
12017
12018 // number of POIs in particular pt or eta bin:
12019 Double_t mp = 0.;
12020
12021 // 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):
12022 Double_t q1n2kRe = 0.;
12023 Double_t q1n2kIm = 0.;
12024 Double_t q2n1kRe = 0.;
12025 Double_t q2n1kIm = 0.;
46b94261 12026
489d5531 12027 // s_{1,1}, s_{1,2} // to be improved (add explanation)
12028 Double_t s1p1k = 0.;
12029 Double_t s1p2k = 0.;
46b94261 12030
489d5531 12031 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12032 Double_t mq = 0.;
489d5531 12033
12034 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12035 Double_t dM01 = 0.;
12036 Double_t dM011 = 0.;
12037
12038 if(type == "POI")
12039 {
12040 // q_{m*n,k}:
12041 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12042 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12043 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12044 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12045 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12046 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12047 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12048 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12049 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 12050
489d5531 12051 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12052 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12053 }else if(type == "RP")
12054 {
12055 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12056 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12057 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12058 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12059 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12060 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12061 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12062 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12063 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12064 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12065 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12066 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 12067 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12068
489d5531 12069 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12070 }
3b552efe 12071
489d5531 12072 if(type == "POI")
3b552efe 12073 {
12074 // p_{m*n,k}:
489d5531 12075 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12076 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12077 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12078 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12079 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 12080 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12081 dM01 = mp*dSM1p1k-s1p1k;
12082 dM011 = mp*(dSM2p1k-dSM1p2k)
12083 - 2.*(s1p1k*dSM1p1k-s1p2k);
12084
12085 // typeFlag = RP (0) or POI (1):
12086 t = 1;
12087 } else if(type == "RP")
489d5531 12088 {
12089 // to be improved (cross-checked):
12090 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12091 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12092 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12093 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12094 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12095 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12096 dM01 = mp*dSM1p1k-s1p1k;
12097 dM011 = mp*(dSM2p1k-dSM1p2k)
12098 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 12099 // typeFlag = RP (0) or POI (1):
3b552efe 12100 t = 0;
12101 }
489d5531 12102
12103 // <<cos n(psi1)>>:
12104 Double_t cosP1nPsi = 0.;
12105 if(mp)
12106 {
12107 cosP1nPsi = p1n0kRe/mp;
12108
12109 // fill profile for <<cos n(psi1)>>:
12110 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
12111 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
12112 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 12113 } // end of if(mp)
57340a27 12114
489d5531 12115 // <<w2 cos n(psi1+phi2)>>:
12116 Double_t cosP1nPsiP1nPhiW2 = 0.;
12117 if(dM01)
12118 {
12119 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
12120 // fill profile for <<w2 cos n(psi1+phi2)>>:
12121 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
12122 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12123 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
12124 } // end of if(dM01)
12125
12126 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
12127 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12128 if(dM011)
12129 {
46b94261 12130 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12131 - p1n0kRe*dSM1p2k
12132 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
12133 - s1p1k*dReQ1n1k
12134 + 2.*q1n2kRe)
12135 / dM011;
489d5531 12136 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12137 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12138 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12139 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
12140 } // end of if(dM011)
12141
12142 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
12143 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12144 if(dM011)
12145 {
12146 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
12147 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 12148 - 2.*s1p1k*dReQ1n1k
489d5531 12149 + 2.*q1n2kRe)
12150 / dM011;
12151 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12152 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12153 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12154 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
12155 } // end of if(dM011)
12156
12157 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 12158
57340a27 12159} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12160
489d5531 12161
12162//================================================================================================================================
12163
12164
12165void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12166{
12167 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
12168
12169 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
12170 // 0: <<sin n(psi1)>>
12171 // 1: <<w2 sin n(psi1+phi2)>>
12172 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
12173 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
12174 // 4:
12175 // 5:
12176 // 6:
12177
12178 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12179 Double_t dReQ1n1k = (*fReQ)(0,1);
12180 Double_t dReQ2n2k = (*fReQ)(1,2);
12181 //Double_t dReQ1n3k = (*fReQ)(0,3);
12182 //Double_t dReQ4n4k = (*fReQ)(3,4);
12183 Double_t dImQ1n1k = (*fImQ)(0,1);
12184 Double_t dImQ2n2k = (*fImQ)(1,2);
12185 //Double_t dImQ1n3k = (*fImQ)(0,3);
12186 //Double_t dImQ4n4k = (*fImQ)(3,4);
12187
12188 // S^M_{p,k} (see .h file for the definition of fSMpk):
12189 Double_t dSM1p1k = (*fSMpk)(0,1);
12190 Double_t dSM1p2k = (*fSMpk)(0,2);
12191 Double_t dSM2p1k = (*fSMpk)(1,1);
12192
12193 Int_t t = -1; // type flag
12194 Int_t pe = -1; // ptEta flag
12195
12196 if(type == "RP")
12197 {
12198 t = 0;
12199 } else if(type == "POI")
12200 {
12201 t = 1;
12202 }
12203
12204 if(ptOrEta == "Pt")
12205 {
12206 pe = 0;
12207 } else if(ptOrEta == "Eta")
12208 {
12209 pe = 1;
12210 }
12211
12212 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12213 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12214 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12215 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12216
12217 // looping over all bins and calculating correction terms:
12218 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12219 {
12220 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12221 Double_t p1n0kRe = 0.;
12222 Double_t p1n0kIm = 0.;
12223
12224 // number of POIs in particular pt or eta bin:
12225 Double_t mp = 0.;
12226
12227 // 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):
12228 Double_t q1n2kRe = 0.;
12229 Double_t q1n2kIm = 0.;
12230 Double_t q2n1kRe = 0.;
12231 Double_t q2n1kIm = 0.;
46b94261 12232
489d5531 12233 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12234 Double_t s1p1k = 0.;
12235 Double_t s1p2k = 0.;
46b94261 12236
489d5531 12237 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12238 Double_t mq = 0.;
489d5531 12239
12240 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12241 Double_t dM01 = 0.;
12242 Double_t dM011 = 0.;
12243
12244 if(type == "POI")
12245 {
12246 // q_{m*n,k}:
12247 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12248 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12249 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12250 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12251 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12252 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12253 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12254 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12255 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 12256
489d5531 12257 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12258 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12259 }else if(type == "RP")
12260 {
12261 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12262 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12263 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12264 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12265 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12266 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12267 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12268 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12269 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12270 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12271 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12272 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12273 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 12274 }
12275
12276 if(type == "POI")
12277 {
12278 // p_{m*n,k}:
489d5531 12279 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12280 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12281 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12282 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12283 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 12284 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12285 dM01 = mp*dSM1p1k-s1p1k;
12286 dM011 = mp*(dSM2p1k-dSM1p2k)
12287 - 2.*(s1p1k*dSM1p1k-s1p2k);
12288 // typeFlag = RP (0) or POI (1):
12289 t = 1;
489d5531 12290 } else if(type == "RP")
3b552efe 12291 {
489d5531 12292 // to be improved (cross-checked):
12293 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12294 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12295 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12296 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12297 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12298 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12299 dM01 = mp*dSM1p1k-s1p1k;
12300 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 12301 - 2.*(s1p1k*dSM1p1k-s1p2k);
12302 // typeFlag = RP (0) or POI (1):
3b552efe 12303 t = 0;
12304 }
12305
489d5531 12306 // <<sin n(psi1)>>:
12307 Double_t sinP1nPsi = 0.;
12308 if(mp)
12309 {
12310 sinP1nPsi = p1n0kIm/mp;
12311
12312 // fill profile for <<sin n(psi1)>>:
12313 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12314 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12315 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 12316 } // end of if(mp)
12317
489d5531 12318 // <<w2 sin n(psi1+phi2)>>:
12319 Double_t sinP1nPsiP1nPhiW2 = 0.;
12320 if(dM01)
12321 {
12322 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12323 // fill profile for <<w2 sin n(psi1+phi2)>>:
12324 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12325 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12326 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12327 } // end of if(mp*dMult-mq)
12328
12329 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12330 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12331 if(dM011)
12332 {
46b94261 12333 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12334 - p1n0kIm*dSM1p2k
12335 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12336 - s1p1k*dImQ1n1k
12337 + 2.*q1n2kIm)
12338 / dM011;
489d5531 12339 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12340 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12341 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12342 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12343 } // end of if(dM011)
12344
12345 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12346 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12347 if(dM011)
12348 {
12349 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12350 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 12351 + 2.*s1p1k*dImQ1n1k
489d5531 12352 - 2.*q1n2kIm)
12353 / dM011;
12354 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12355 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12356 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12357 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12358 } // end of if(dM011)
12359
12360 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12361
12362} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12363
12364
12365//================================================================================================================================
12366
12367
0328db2d 12368void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12369{
57340a27 12370 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 12371 // with using particle weights (both sin and cos terms) relevant for differential flow.
12372
57340a27 12373 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12374 // flagged both as POI and RP.
489d5531 12375 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12376 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12377 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12378 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12379 // cti:
12380 // 0: <<sc n(psi1)>>
12381 // 1: <<w2 sc n(psi1+phi2)>>
12382 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12383 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12384 // 4:
12385 // 5:
12386 // 6:
46b94261 12387
489d5531 12388 Int_t typeFlag = -1;
12389 Int_t ptEtaFlag = -1;
12390 if(type == "RP")
12391 {
12392 typeFlag = 0;
12393 } else if(type == "POI")
12394 {
12395 typeFlag = 1;
12396 }
12397 if(ptOrEta == "Pt")
12398 {
12399 ptEtaFlag = 0;
12400 } else if(ptOrEta == "Eta")
12401 {
12402 ptEtaFlag = 1;
12403 }
12404 // shortcuts:
12405 Int_t t = typeFlag;
12406 Int_t pe = ptEtaFlag;
12407
12408 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12409 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12410 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12411
12412 Int_t nPrim = anEvent->NumberOfTracks();
12413 AliFlowTrackSimple *aftsTrack = NULL;
12414
12415 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12416 Double_t wPhi2=1., wPhi3=1.;
12417
12418 Int_t n = fHarmonic;
12419
12420 // 1'-particle correction terms:
12421 for(Int_t i1=0;i1<nPrim;i1++)
12422 {
12423 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12424 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12425 if(typeFlag==1) // this is diff flow of POIs
489d5531 12426 {
12427 if(ptOrEta == "Pt")
12428 {
12429 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12430 } else if (ptOrEta == "Eta")
12431 {
12432 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12433 }
12434 } else // this is diff flow of RPs
12435 {
489d5531 12436 if(ptOrEta == "Pt")
12437 {
12438 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12439 } else if (ptOrEta == "Eta")
12440 {
12441 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12442 }
489d5531 12443 }
12444 psi1=aftsTrack->Phi();
12445 // sin terms:
12446 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12447 // cos terms:
12448 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12449 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12450
12451 // 2'-particle correction terms:
12452 for(Int_t i1=0;i1<nPrim;i1++)
12453 {
12454 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12455 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12456 if(typeFlag==1) // this is diff flow of POIs
489d5531 12457 {
12458 if(ptOrEta == "Pt")
12459 {
12460 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12461 } else if (ptOrEta == "Eta")
12462 {
12463 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12464 }
12465 } else // this is diff flow of RPs
12466 {
489d5531 12467 if(ptOrEta == "Pt")
12468 {
12469 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12470 } else if (ptOrEta == "Eta")
12471 {
12472 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12473 }
489d5531 12474 }
12475 psi1=aftsTrack->Phi();
12476 for(Int_t i2=0;i2<nPrim;i2++)
12477 {
12478 if(i2==i1) continue;
12479 aftsTrack=anEvent->GetTrack(i2);
12480 // RP condition (!(first) particle in the correlator must be RP):
12481 if(!(aftsTrack->InRPSelection())) continue;
46b94261 12482 phi2=aftsTrack->Phi();
489d5531 12483 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12484 // sin terms:
12485 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12486 // cos terms:
12487 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12488 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12489 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12490
12491 // 3'-particle correction terms:
12492 for(Int_t i1=0;i1<nPrim;i1++)
12493 {
12494 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12495 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12496 if(typeFlag==1) // this is diff flow of POIs
489d5531 12497 {
12498 if(ptOrEta == "Pt")
12499 {
12500 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12501 } else if (ptOrEta == "Eta")
12502 {
12503 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12504 }
12505 } else // this is diff flow of RPs
12506 {
489d5531 12507 if(ptOrEta == "Pt")
12508 {
12509 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12510 } else if (ptOrEta == "Eta")
12511 {
12512 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12513 }
489d5531 12514 }
12515 psi1=aftsTrack->Phi();
12516 for(Int_t i2=0;i2<nPrim;i2++)
12517 {
12518 if(i2==i1) continue;
12519 aftsTrack=anEvent->GetTrack(i2);
12520 // RP condition (!(first) particle in the correlator must be RP):
12521 if(!(aftsTrack->InRPSelection())) continue;
12522 phi2=aftsTrack->Phi();
12523 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12524 for(Int_t i3=0;i3<nPrim;i3++)
12525 {
12526 if(i3==i1||i3==i2) continue;
12527 aftsTrack=anEvent->GetTrack(i3);
12528 // RP condition (!(first) particle in the correlator must be RP):
12529 if(!(aftsTrack->InRPSelection())) continue;
12530 phi3=aftsTrack->Phi();
12531 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12532 // sin terms:
12533 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))>>
12534 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))>>
12535 // cos terms:
12536 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))>>
12537 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))>>
12538 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12539 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 12540 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 12541
12542} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12543
2001bc3a 12544//================================================================================================================================
12545
b3dacf6b 12546void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12547{
12548 // Check all pointers used in method Finish().
12549
b77b6434 12550 if(!fAvMultiplicity)
12551 {
12552 cout<<endl;
12553 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12554 cout<<endl;
12555 exit(0);
12556 }
b3dacf6b 12557 if(!fIntFlowCorrelationsPro)
12558 {
12559 cout<<endl;
12560 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12561 cout<<endl;
12562 exit(0);
12563 }
12564 if(!fIntFlowCorrelationsHist)
12565 {
12566 cout<<endl;
12567 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12568 cout<<endl;
12569 exit(0);
12570 }
b77b6434 12571 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12572 {
12573 cout<<endl;
12574 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12575 cout<<endl;
12576 exit(0);
12577 }
b3dacf6b 12578 for(Int_t power=0;power<2;power++)
12579 {
12580 if(!fIntFlowSumOfEventWeights[power])
12581 {
12582 cout<<endl;
12583 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
12584 cout<<endl;
12585 exit(0);
12586 }
12587 } // end of for(Int_t power=0;power<2;power++)
12588 if(!fIntFlowProductOfCorrelationsPro)
12589 {
12590 cout<<endl;
12591 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12592 cout<<endl;
12593 exit(0);
12594 }
12595 if(!fIntFlowSumOfProductOfEventWeights)
12596 {
12597 cout<<endl;
12598 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12599 cout<<endl;
12600 exit(0);
12601 }
12602 if(!fIntFlowCovariances)
12603 {
12604 cout<<endl;
12605 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12606 cout<<endl;
12607 exit(0);
12608 }
12609 if(!fIntFlowQcumulants)
12610 {
12611 cout<<endl;
12612 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12613 cout<<endl;
12614 exit(0);
12615 }
0dd3b008 12616 if(!fIntFlow)
12617 {
12618 cout<<endl;
12619 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12620 cout<<endl;
12621 exit(0);
12622 }
12623 if(!fCommonHists)
12624 {
12625 cout<<endl;
12626 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12627 cout<<endl;
12628 exit(0);
12629 }
12630 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
12631 {
12632 cout<<endl;
12633 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
12634 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12635 cout<<endl;
12636 exit(0);
12637 }
b3dacf6b 12638
b92ea2b9 12639 // NUA stuff:
12640 for(Int_t sc=0;sc<2;sc++) // sin/cos
12641 {
12642 if(!fIntFlowCorrectionTermsForNUAPro[sc])
12643 {
12644 cout<<endl;
12645 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12646 cout<<endl;
12647 exit(0);
12648 }
12649 if(!fIntFlowCorrectionTermsForNUAHist[sc])
12650 {
12651 cout<<endl;
12652 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12653 cout<<endl;
12654 exit(0);
12655 }
12656 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12657 {
12658 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
12659 {
12660 cout<<endl;
12661 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
12662 cout<<endl;
12663 exit(0);
12664 }
12665 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12666 } // end of for(Int_t power=0;power<2;power++)
12667 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
12668 {
12669 cout<<endl;
12670 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12671 cout<<endl;
12672 exit(0);
12673 }
12674 if(!fIntFlowSumOfProductOfEventWeightsNUA)
12675 {
12676 cout<<endl;
12677 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12678 cout<<endl;
12679 exit(0);
12680 }
12681 if(!fIntFlowCovariancesNUA)
12682 {
12683 cout<<endl;
12684 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12685 cout<<endl;
12686 exit(0);
12687 }
12688 if(!fIntFlowQcumulantsErrorSquaredRatio)
12689 {
12690 cout<<endl;
12691 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12692 cout<<endl;
12693 exit(0);
12694 }
12695 if(!fIntFlowDetectorBias)
12696 {
12697 cout<<endl;
12698 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12699 cout<<endl;
12700 exit(0);
12701 }
12702
b3dacf6b 12703 // Versus multiplicity:
12704 if(!fCalculateCumulantsVsM){return;}
b77b6434 12705 for(Int_t co=0;co<=3;co++) // cumulant order
b3dacf6b 12706 {
b77b6434 12707 if(!fIntFlowQcumulantsVsM[co])
b3dacf6b 12708 {
12709 cout<<endl;
b77b6434 12710 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
b3dacf6b 12711 cout<<endl;
12712 exit(0);
12713 }
b77b6434 12714 if(!fIntFlowVsM[co])
b3dacf6b 12715 {
12716 cout<<endl;
b77b6434 12717 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12718 cout<<endl;
12719 exit(0);
12720 }
12721 if(!fIntFlowDetectorBiasVsM[co])
12722 {
12723 cout<<endl;
12724 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12725 cout<<endl;
12726 exit(0);
12727 }
12728 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
12729 for(Int_t ci=0;ci<=3;ci++) // correlation index
12730 {
12731 if(!fIntFlowCorrelationsVsMPro[ci])
12732 {
12733 cout<<endl;
12734 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b3dacf6b 12735 cout<<endl;
12736 exit(0);
12737 }
b77b6434 12738 if(!fIntFlowCorrelationsVsMHist[ci])
b92ea2b9 12739 {
12740 cout<<endl;
b77b6434 12741 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b92ea2b9 12742 cout<<endl;
12743 exit(0);
12744 }
b3dacf6b 12745 for(Int_t power=0;power<2;power++)
12746 {
12747 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
12748 {
12749 cout<<endl;
12750 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
12751 cout<<endl;
12752 exit(0);
12753 }
12754 } // end of for(Int_t power=0;power<2;power++)
12755 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
12756 for(Int_t i=0;i<6;i++)
12757 {
12758 if(!fIntFlowProductOfCorrelationsVsMPro[i])
12759 {
12760 cout<<endl;
12761 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12762 cout<<endl;
12763 exit(0);
12764 }
12765 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
12766 {
12767 cout<<endl;
12768 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12769 cout<<endl;
12770 exit(0);
12771 }
12772 if(!fIntFlowCovariancesVsM[i])
12773 {
12774 cout<<endl;
12775 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12776 cout<<endl;
12777 exit(0);
12778 }
12779 } // end of for(Int_t i=0;i<6;i++)
12780 if(!fIntFlowRebinnedInM)
12781 {
12782 cout<<endl;
12783 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12784 cout<<endl;
12785 exit(0);
12786 }
12787 if(!fIntFlowQcumulantsRebinnedInM)
12788 {
12789 cout<<endl;
12790 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12791 cout<<endl;
12792 exit(0);
12793 }
12794
12795} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12796
12797//================================================================================================================================
12798
12799void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
12800{
12801 // Check all pointers used in method Make().
12802
b77b6434 12803 if(!fAvMultiplicity)
12804 {
12805 cout<<endl;
12806 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!"<<endl;
12807 cout<<endl;
12808 exit(0);
12809 }
12810 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12811 {
12812 cout<<endl;
12813 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!"<<endl;
12814 cout<<endl;
12815 exit(0);
12816 }
b3dacf6b 12817
12818} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
12819
57340a27 12820