]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
fixes for pid
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithQCumulants.cxx
CommitLineData
489d5531 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/**********************************
17 * flow analysis with Q-cumulants *
18 * *
ff70ca91 19 * author: Ante Bilandzic *
20 * (abilandzic@gmail.com) *
489d5531 21 *********************************/
22
23#define AliFlowAnalysisWithQCumulants_cxx
24
25#include "Riostream.h"
26#include "AliFlowCommonConstants.h"
27#include "AliFlowCommonHist.h"
28#include "AliFlowCommonHistResults.h"
29#include "TChain.h"
30
31#include "TFile.h"
32#include "TList.h"
33#include "TGraph.h"
34#include "TParticle.h"
35#include "TRandom3.h"
36#include "TStyle.h"
37#include "TProfile.h"
38#include "TProfile2D.h"
489d5531 39#include "TMath.h"
40#include "TArrow.h"
41#include "TPaveLabel.h"
42#include "TCanvas.h"
43#include "AliFlowEventSimple.h"
44#include "AliFlowTrackSimple.h"
45#include "AliFlowAnalysisWithQCumulants.h"
46#include "TArrayD.h"
47#include "TRandom.h"
48#include "TF1.h"
49
50class TH1;
51class TH2;
52class TGraph;
53class TPave;
54class TLatex;
55class TMarker;
56class TRandom3;
57class TObjArray;
58class TList;
59class TCanvas;
60class TSystem;
61class TROOT;
62class AliFlowVector;
63class TVector;
64
489d5531 65//================================================================================================================
66
489d5531 67ClassImp(AliFlowAnalysisWithQCumulants)
68
69AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
70 // 0.) base:
71 fHistList(NULL),
72 // 1.) common:
73 fCommonHists(NULL),
74 fCommonHists2nd(NULL),
75 fCommonHists4th(NULL),
76 fCommonHists6th(NULL),
77 fCommonHists8th(NULL),
78 fCommonHistsResults2nd(NULL),
79 fCommonHistsResults4th(NULL),
80 fCommonHistsResults6th(NULL),
81 fCommonHistsResults8th(NULL),
82 fnBinsPhi(0),
83 fPhiMin(0),
84 fPhiMax(0),
85 fPhiBinWidth(0),
86 fnBinsPt(0),
87 fPtMin(0),
88 fPtMax(0),
89 fPtBinWidth(0),
90 fnBinsEta(0),
91 fEtaMin(0),
92 fEtaMax(0),
93 fEtaBinWidth(0),
1268c371 94 fCommonConstants(NULL),
dd442cd2 95 fFillMultipleControlHistograms(kFALSE),
489d5531 96 fHarmonic(2),
97 fAnalysisLabel(NULL),
98 // 2a.) particle weights:
99 fWeightsList(NULL),
100 fUsePhiWeights(kFALSE),
101 fUsePtWeights(kFALSE),
102 fUseEtaWeights(kFALSE),
103 fUseParticleWeights(NULL),
104 fPhiWeights(NULL),
105 fPtWeights(NULL),
106 fEtaWeights(NULL),
107 // 2b.) event weights:
108 fMultiplicityWeight(NULL),
109 // 3.) integrated flow:
110 fIntFlowList(NULL),
111 fIntFlowProfiles(NULL),
112 fIntFlowResults(NULL),
113 fIntFlowFlags(NULL),
b92ea2b9 114 fApplyCorrectionForNUA(kFALSE),
2001bc3a 115 fApplyCorrectionForNUAVsM(kFALSE),
9da1a4f3 116 fnBinsMult(10000),
067e9bc8 117 fMinMult(0.),
118 fMaxMult(10000.),
b77b6434 119 fPropagateErrorAlsoFromNIT(kFALSE),
8ed4edc7 120 fCalculateCumulantsVsM(kFALSE),
0dd3b008 121 fMinimumBiasReferenceFlow(kTRUE),
e5834fcb 122 fForgetAboutCovariances(kFALSE),
123 fStorePhiDistributionForOneEvent(kFALSE),
489d5531 124 fReQ(NULL),
125 fImQ(NULL),
1268c371 126 fSpk(NULL),
489d5531 127 fIntFlowCorrelationsEBE(NULL),
128 fIntFlowEventWeightsForCorrelationsEBE(NULL),
129 fIntFlowCorrelationsAllEBE(NULL),
e5834fcb 130 fReferenceMultiplicityEBE(0.),
489d5531 131 fAvMultiplicity(NULL),
132 fIntFlowCorrelationsPro(NULL),
b40a910e 133 fIntFlowSquaredCorrelationsPro(NULL),
489d5531 134 fIntFlowCorrelationsAllPro(NULL),
135 fIntFlowExtraCorrelationsPro(NULL),
136 fIntFlowProductOfCorrelationsPro(NULL),
0328db2d 137 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
489d5531 138 fIntFlowCorrelationsHist(NULL),
139 fIntFlowCorrelationsAllHist(NULL),
140 fIntFlowCovariances(NULL),
141 fIntFlowSumOfProductOfEventWeights(NULL),
0328db2d 142 fIntFlowCovariancesNUA(NULL),
143 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
489d5531 144 fIntFlowQcumulants(NULL),
b92ea2b9 145 fIntFlowQcumulantsRebinnedInM(NULL),
146 fIntFlowQcumulantsErrorSquaredRatio(NULL),
489d5531 147 fIntFlow(NULL),
b3dacf6b 148 fIntFlowRebinnedInM(NULL),
2001bc3a 149 fIntFlowDetectorBias(NULL),
489d5531 150 // 4.) differential flow:
151 fDiffFlowList(NULL),
152 fDiffFlowProfiles(NULL),
153 fDiffFlowResults(NULL),
1268c371 154 fDiffFlow2D(NULL),
489d5531 155 fDiffFlowFlags(NULL),
1268c371 156 fCalculateDiffFlow(kTRUE),
157 fCalculate2DDiffFlow(kFALSE),
489d5531 158 // 5.) distributions:
57340a27 159 fDistributionsList(NULL),
160 fDistributionsFlags(NULL),
489d5531 161 fStoreDistributions(kFALSE),
e5834fcb 162 // 6.) various:
163 fVariousList(NULL),
164 fPhiDistributionForOneEvent(NULL),
489d5531 165 // x.) debugging and cross-checking:
166 fNestedLoopsList(NULL),
167 fEvaluateIntFlowNestedLoops(kFALSE),
168 fEvaluateDiffFlowNestedLoops(kFALSE),
169 fMaxAllowedMultiplicity(10),
170 fEvaluateNestedLoops(NULL),
171 fIntFlowDirectCorrelations(NULL),
172 fIntFlowExtraDirectCorrelations(NULL),
173 fCrossCheckInPtBinNo(10),
3b552efe 174 fCrossCheckInEtaBinNo(20),
489d5531 175 fNoOfParticlesInBin(NULL)
176 {
177 // constructor
178
179 // base list to hold all output objects:
180 fHistList = new TList();
181 fHistList->SetName("cobjQC");
182 fHistList->SetOwner(kTRUE);
183
184 // list to hold histograms with phi, pt and eta weights:
185 fWeightsList = new TList();
186
187 // multiplicity weight:
188 fMultiplicityWeight = new TString("combinations");
189
190 // analysis label;
191 fAnalysisLabel = new TString();
192
193 // initialize all arrays:
194 this->InitializeArraysForIntFlow();
195 this->InitializeArraysForDiffFlow();
196 this->InitializeArraysForDistributions();
e5834fcb 197 this->InitializeArraysForVarious();
489d5531 198 this->InitializeArraysForNestedLoops();
199
200 } // end of constructor
201
489d5531 202//================================================================================================================
203
489d5531 204AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
205{
206 // destructor
207
208 delete fHistList;
209
210} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
211
489d5531 212//================================================================================================================
213
489d5531 214void AliFlowAnalysisWithQCumulants::Init()
215{
3b552efe 216 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 217 // b) Access all common constants;
218 // c) Book all objects;
3b552efe 219 // d) Store flags for integrated and differential flow;
489d5531 220 // e) Store flags for distributions of corelations;
221 // f) Store harmonic which will be estimated.
3b552efe 222
489d5531 223 //save old value and prevent histograms from being added to directory
224 //to avoid name clashes in case multiple analaysis objects are used
225 //in an analysis
226 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
227 TH1::AddDirectory(kFALSE);
228
3b552efe 229 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 230 this->CrossCheckSettings();
1268c371 231 // b) Access all common constants and book a profile to hold them:
232 this->CommonConstants("Init");
489d5531 233 // c) Book all objects:
1268c371 234 this->BookAndFillWeightsHistograms();
489d5531 235 this->BookAndNestAllLists();
236 this->BookCommonHistograms();
237 this->BookEverythingForIntegratedFlow();
238 this->BookEverythingForDifferentialFlow();
1268c371 239 this->BookEverythingFor2DDifferentialFlow();
489d5531 240 this->BookEverythingForDistributions();
e5834fcb 241 this->BookEverythingForVarious();
489d5531 242 this->BookEverythingForNestedLoops();
243 // d) Store flags for integrated and differential flow:
244 this->StoreIntFlowFlags();
3b552efe 245 this->StoreDiffFlowFlags();
489d5531 246 // e) Store flags for distributions of corelations:
247 this->StoreFlagsForDistributions();
248 // f) Store harmonic which will be estimated:
249 this->StoreHarmonic();
250
251 TH1::AddDirectory(oldHistAddStatus);
252} // end of void AliFlowAnalysisWithQCumulants::Init()
253
489d5531 254//================================================================================================================
255
489d5531 256void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
257{
258 // Running over data only in this method.
259
b3dacf6b 260 // a) Check all pointers used in this method;
261 // b) Define local variables;
262 // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
1268c371 263 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k};
264 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!);
265 // f) Call the methods which calculate correlations for reference flow;
266 // g) Call the methods which calculate correlations for differential flow;
267 // h) Call the methods which calculate correlations for 2D differential flow;
268 // i) Distributions of correlations;
269 // j) Store phi distribution for one event to illustrate flow;
270 // k) Cross-check with nested loops correlators for reference flow;
271 // l) Cross-check with nested loops correlators for differential flow;
272 // m) Reset all event-by-event quantities (very important !!!!).
489d5531 273
b3dacf6b 274 // a) Check all pointers used in this method:
275 this->CheckPointersUsedInMake();
276
277 // b) Define local variables:
489d5531 278 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
279 Double_t dPt = 0.; // transverse momentum
280 Double_t dEta = 0.; // pseudorapidity
489d5531 281 Double_t wPhi = 1.; // phi weight
282 Double_t wPt = 1.; // pt weight
283 Double_t wEta = 1.; // eta weight
1268c371 284 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of reference particles)
e5834fcb 285 fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
1268c371 286 Double_t ptEta[2] = {0.,0.}; // 0 = dPt, 1 = dEta
9f33751d 287
b3dacf6b 288 // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
489d5531 289 this->FillCommonControlHistograms(anEvent);
290 this->FillAverageMultiplicities(nRP);
291
1268c371 292 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k}:
9f33751d 293 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
1268c371 294 // nRP = # of reference particles;
295 // nPOI = # of particles of interest.
489d5531 296 AliFlowTrackSimple *aftsTrack = NULL;
1268c371 297 Int_t n = fHarmonic; // shortcut for the harmonic
489d5531 298 for(Int_t i=0;i<nPrim;i++)
299 {
300 aftsTrack=anEvent->GetTrack(i);
301 if(aftsTrack)
302 {
1268c371 303 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())){continue;} // safety measure: consider only tracks which are RPs or POIs
489d5531 304 if(aftsTrack->InRPSelection()) // RP condition:
305 {
306 dPhi = aftsTrack->Phi();
307 dPt = aftsTrack->Pt();
308 dEta = aftsTrack->Eta();
309 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
310 {
311 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
312 }
313 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
314 {
315 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
316 }
317 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
318 {
319 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
1268c371 320 }
321 // Calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}] for this event (m = 1,2,...,6, k = 0,1,...,8):
322 for(Int_t m=0;m<6;m++) // to be improved - hardwired 6
489d5531 323 {
1268c371 324 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 325 {
326 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
327 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
328 }
329 }
1268c371 330 // Calculate S_{p,k} for this event (Remark: final calculation of S_{p,k} follows after the loop over data bellow):
489d5531 331 for(Int_t p=0;p<8;p++)
332 {
333 for(Int_t k=0;k<9;k++)
334 {
1268c371 335 (*fSpk)(p,k)+=pow(wPhi*wPt*wEta,k);
489d5531 336 }
337 }
1268c371 338 // Differential flow:
339 if(fCalculateDiffFlow || fCalculate2DDiffFlow)
489d5531 340 {
1268c371 341 ptEta[0] = dPt;
342 ptEta[1] = dEta;
343 // Calculate r_{m*n,k} and s_{p,k} (r_{m,k} is 'p-vector' for RPs):
344 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 345 {
1268c371 346 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 347 {
1268c371 348 if(fCalculateDiffFlow)
349 {
350 for(Int_t pe=0;pe<2;pe++) // pt or eta
351 {
352 fReRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
353 fImRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
354 if(m==0) // s_{p,k} does not depend on index m
355 {
356 fs1dEBE[0][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k),1.);
357 } // end of if(m==0) // s_{p,k} does not depend on index m
358 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
359 } // end of if(fCalculateDiffFlow)
360 if(fCalculate2DDiffFlow)
361 {
362 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
363 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
364 if(m==0) // s_{p,k} does not depend on index m
365 {
366 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
367 } // end of if(m==0) // s_{p,k} does not depend on index m
368 } // end of if(fCalculate2DDiffFlow)
369 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
370 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
371 // Checking if RP particle is also POI particle:
372 if(aftsTrack->InPOISelection())
489d5531 373 {
1268c371 374 // Calculate q_{m*n,k} and s_{p,k} ('q-vector' and 's' for RPs && POIs):
375 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 376 {
1268c371 377 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 378 {
1268c371 379 if(fCalculateDiffFlow)
380 {
381 for(Int_t pe=0;pe<2;pe++) // pt or eta
382 {
383 fReRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
384 fImRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
385 if(m==0) // s_{p,k} does not depend on index m
386 {
387 fs1dEBE[2][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k),1.);
388 } // end of if(m==0) // s_{p,k} does not depend on index m
389 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
390 } // end of if(fCalculateDiffFlow)
391 if(fCalculate2DDiffFlow)
392 {
393 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
394 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
395 if(m==0) // s_{p,k} does not depend on index m
396 {
397 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
398 } // end of if(m==0) // s_{p,k} does not depend on index m
399 } // end of if(fCalculate2DDiffFlow)
400 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
401 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
402 } // end of if(aftsTrack->InPOISelection())
403 } // end of if(fCalculateDiffFlow || fCalculate2DDiffFlow)
489d5531 404 } // end of if(pTrack->InRPSelection())
489d5531 405 if(aftsTrack->InPOISelection())
406 {
407 dPhi = aftsTrack->Phi();
408 dPt = aftsTrack->Pt();
409 dEta = aftsTrack->Eta();
1268c371 410 ptEta[0] = dPt;
411 ptEta[1] = dEta;
412 // Calculate p_{m*n,k} ('p-vector' for POIs):
413 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
489d5531 414 {
1268c371 415 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
489d5531 416 {
1268c371 417 if(fCalculateDiffFlow)
418 {
419 for(Int_t pe=0;pe<2;pe++) // pt or eta
420 {
421 fReRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
422 fImRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
423 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
424 } // end of if(fCalculateDiffFlow)
425 if(fCalculate2DDiffFlow)
426 {
427 fReRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
428 fImRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
429 } // end of if(fCalculate2DDiffFlow)
430 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
431 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
b77b6434 432 } // end of if(pTrack->InPOISelection())
489d5531 433 } else // to if(aftsTrack)
434 {
1268c371 435 printf(" WARNING (QC): No particle (i.e. aftsTrack is a NULL pointer in AFAWQC::Make())!!!!\n\n");
489d5531 436 }
437 } // end of for(Int_t i=0;i<nPrim;i++)
438
1268c371 439 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!):
489d5531 440 for(Int_t p=0;p<8;p++)
441 {
442 for(Int_t k=0;k<9;k++)
443 {
1268c371 444 (*fSpk)(p,k)=pow((*fSpk)(p,k),p+1);
445 // ... for the time being s_{p,k} dosn't need higher powers, so no need to finalize it here ...
446 } // end of for(Int_t k=0;k<9;k++)
447 } // end of for(Int_t p=0;p<8;p++)
489d5531 448
1268c371 449 // f) Call the methods which calculate correlations for reference flow:
489d5531 450 if(!fEvaluateIntFlowNestedLoops)
451 {
452 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
453 {
1268c371 454 if(nRP>1){this->CalculateIntFlowCorrelations();} // without using particle weights
0328db2d 455 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 456 {
1268c371 457 if(nRP>1){this->CalculateIntFlowCorrelationsUsingParticleWeights();} // with using particle weights
458 }
459 // Whether or not using particle weights the following is calculated in the same way:
460 if(nRP>3){this->CalculateIntFlowProductOfCorrelations();}
461 if(nRP>1){this->CalculateIntFlowSumOfEventWeights();}
462 if(nRP>1){this->CalculateIntFlowSumOfProductOfEventWeights();}
463 // Non-isotropic terms:
b92ea2b9 464 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 465 {
1268c371 466 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTerms();}
467 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTerms();}
b92ea2b9 468 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
469 {
1268c371 470 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();}
471 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();}
472 }
473 // Whether or not using particle weights the following is calculated in the same way:
474 if(nRP>0){this->CalculateIntFlowProductOfCorrectionTermsForNUA();}
475 if(nRP>0){this->CalculateIntFlowSumOfEventWeightsNUA();}
476 if(nRP>0){this->CalculateIntFlowSumOfProductOfEventWeightsNUA();}
489d5531 477 } // end of if(!fEvaluateIntFlowNestedLoops)
478
1268c371 479 // g) Call the methods which calculate correlations for differential flow:
480 if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 481 {
482 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
483 {
1268c371 484 // Without using particle weights:
489d5531 485 this->CalculateDiffFlowCorrelations("RP","Pt");
486 this->CalculateDiffFlowCorrelations("RP","Eta");
487 this->CalculateDiffFlowCorrelations("POI","Pt");
57340a27 488 this->CalculateDiffFlowCorrelations("POI","Eta");
1268c371 489 // Non-isotropic terms:
b92ea2b9 490 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
491 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
492 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
493 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
494 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
495 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
496 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
497 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
489d5531 498 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
499 {
1268c371 500 // With using particle weights:
489d5531 501 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
502 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
503 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
504 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
1268c371 505 // Non-isotropic terms:
b92ea2b9 506 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
507 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
508 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
509 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
510 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
511 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
512 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
513 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
1268c371 514 }
515 // Whether or not using particle weights the following is calculated in the same way:
489d5531 516 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
517 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
518 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
519 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
520 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
521 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
522 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
523 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
524 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
525 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
526 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
527 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
1268c371 528 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 529
1268c371 530 // h) Call the methods which calculate correlations for 2D differential flow:
531 if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
532 {
533 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 534 {
1268c371 535 // Without using particle weights:
536 this->Calculate2DDiffFlowCorrelations("RP");
537 this->Calculate2DDiffFlowCorrelations("POI");
538 // Non-isotropic terms:
539 // ... to be ctd ...
540 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
541 {
542 // With using particle weights:
543 // ... to be ctd ...
544 // Non-isotropic terms:
545 // ... to be ctd ...
546 }
547 // Whether or not using particle weights the following is calculated in the same way:
548 // ... to be ctd ...
549 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
550
551 // i) Distributions of correlations:
e5834fcb 552 if(fStoreDistributions){this->StoreDistributionsOfCorrelations();}
553
1268c371 554 // j) Store phi distribution for one event to illustrate flow:
e5834fcb 555 if(fStorePhiDistributionForOneEvent){this->StorePhiDistributionForOneEvent(anEvent);}
1268c371 556
557 // k) Cross-check with nested loops correlators for reference flow:
558 if(fEvaluateIntFlowNestedLoops){this->EvaluateIntFlowNestedLoops(anEvent);}
559
560 // l) Cross-check with nested loops correlators for differential flow:
561 if(fEvaluateDiffFlowNestedLoops){this->EvaluateDiffFlowNestedLoops(anEvent);}
489d5531 562
1268c371 563 // m) Reset all event-by-event quantities (very important !!!!):
489d5531 564 this->ResetEventByEventQuantities();
565
566} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
567
489d5531 568//================================================================================================================================
569
489d5531 570void AliFlowAnalysisWithQCumulants::Finish()
571{
572 // Calculate the final results.
489d5531 573
b3dacf6b 574 // a) Check all pointers used in this method;
575 // b) Acces the constants;
576 // c) Access the flags;
b92ea2b9 577 // d) Calculate reference cumulants (not corrected for detector effects);
578 // e) Correct reference cumulants for detector effects;
579 // f) Calculate reference flow;
b77b6434 580 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
b92ea2b9 581 // h) Calculate the final results for differential flow (without/with weights);
582 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
583 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
584 // k) Store results for differential flow in AliFlowCommonHistResults;
585 // l) Print the final results for integrated flow (RP/POI) on the screen;
586 // m) Cross-checking: Results from Q-vectors vs results from nested loops.
b3dacf6b 587
588 // a) Check all pointers used in this method:
589 this->CheckPointersUsedInFinish();
590
591 // b) Acces the constants:
1268c371 592 this->CommonConstants("Finish");
489d5531 593
b3dacf6b 594 if(fCommonHists && fCommonHists->GetHarmonic()) // to be improved (moved somewhere else)
489d5531 595 {
b3dacf6b 596 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
489d5531 597 }
b3dacf6b 598
1268c371 599 // c) Access the flags: // to be improved (implement a method for this? should I store again the flags becose they can get modified with redoFinish?)
b3dacf6b 600 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
601 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
602 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
603 fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
604 fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
605 fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
606 fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
607 fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
608 fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
b77b6434 609 fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
0dd3b008 610 fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
611 fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
e5834fcb 612 fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
613 fStorePhiDistributionForOneEvent = (Bool_t)fIntFlowFlags->GetBinContent(13);
dd442cd2 614 fFillMultipleControlHistograms = (Bool_t)fIntFlowFlags->GetBinContent(14);
b3dacf6b 615 fEvaluateIntFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(1);
616 fEvaluateDiffFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(2);
489d5531 617 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
618 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
1268c371 619
b92ea2b9 620 // d) Calculate reference cumulants (not corrected for detector effects):
489d5531 621 this->FinalizeCorrelationsIntFlow();
622 this->CalculateCovariancesIntFlow();
623 this->CalculateCumulantsIntFlow();
489d5531 624
b92ea2b9 625 // e) Correct reference cumulants for detector effects:
626 this->FinalizeCorrectionTermsForNUAIntFlow();
627 this->CalculateCovariancesNUAIntFlow();
628 this->CalculateQcumulantsCorrectedForNUAIntFlow();
629
630 // f) Calculate reference flow:
631 this->CalculateReferenceFlow();
489d5531 632
b77b6434 633 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
489d5531 634 this->FillCommonHistResultsIntFlow();
b3dacf6b 635 if(fPrintFinalResults[0]){this->PrintFinalResultsForIntegratedFlow("RF");}
636 if(fPrintFinalResults[3] && fCalculateCumulantsVsM){this->PrintFinalResultsForIntegratedFlow("RF, rebinned in M");}
489d5531 637
1268c371 638 // h) Calculate the final results for differential flow (without/with weights):
639 if(fCalculateDiffFlow)
640 {
641 this->FinalizeReducedCorrelations("RP","Pt");
642 this->FinalizeReducedCorrelations("RP","Eta");
643 this->FinalizeReducedCorrelations("POI","Pt");
644 this->FinalizeReducedCorrelations("POI","Eta");
645 this->CalculateDiffFlowCovariances("RP","Pt");
646 this->CalculateDiffFlowCovariances("RP","Eta");
647 this->CalculateDiffFlowCovariances("POI","Pt");
648 this->CalculateDiffFlowCovariances("POI","Eta");
649 this->CalculateDiffFlowCumulants("RP","Pt");
650 this->CalculateDiffFlowCumulants("RP","Eta");
651 this->CalculateDiffFlowCumulants("POI","Pt");
652 this->CalculateDiffFlowCumulants("POI","Eta");
653 this->CalculateDiffFlow("RP","Pt");
654 this->CalculateDiffFlow("RP","Eta");
655 this->CalculateDiffFlow("POI","Pt");
656 this->CalculateDiffFlow("POI","Eta");
657 } // if(fCalculateDiffFlow)
658
659 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
660 if(fCalculateDiffFlow)
489d5531 661 {
662 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
663 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
664 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
665 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
666 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
667 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
668 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
669 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
1268c371 670 if(fApplyCorrectionForNUA)
671 {
672 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
673 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
674 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
675 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
676 }
677 } // end of if(fCalculateDiffFlow && fApplyCorrectionForNUA)
678
679 // i) Calcualate final results for 2D differential flow:
680 if(fCalculate2DDiffFlow)
681 {
682 this->Calculate2DDiffFlowCumulants("RP");
683 this->Calculate2DDiffFlowCumulants("POI");
684 this->Calculate2DDiffFlow("RP");
685 this->Calculate2DDiffFlow("POI");
686 } // end of if(fCalculate2DDiffFlow)
687
688 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
689 if(fCalculateDiffFlow)
690 {
691 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
692 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
3b552efe 693 }
489d5531 694
1268c371 695 // k) Store results for differential flow in AliFlowCommonHistResults:
696 if(fCalculateDiffFlow)
697 {
698 this->FillCommonHistResultsDiffFlow("RP");
699 this->FillCommonHistResultsDiffFlow("POI");
700 }
701
702 // l) Print the final results for integrated flow (RP/POI) on the screen:
703 if(fPrintFinalResults[1] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("RP");}
704 if(fPrintFinalResults[2] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("POI");}
705
706 // m) Cross-checking: Results from Q-vectors vs results from nested loops:
707 // m1) Reference flow:
489d5531 708 if(fEvaluateIntFlowNestedLoops)
709 {
710 this->CrossCheckIntFlowCorrelations();
711 this->CrossCheckIntFlowCorrectionTermsForNUA();
1268c371 712 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights){this->CrossCheckIntFlowExtraCorrelations();}
489d5531 713 } // end of if(fEvaluateIntFlowNestedLoops)
1268c371 714 // m2) Differential flow:
715 if(fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
489d5531 716 {
b3dacf6b 717 // Correlations:
489d5531 718 this->PrintNumberOfParticlesInSelectedBin();
719 this->CrossCheckDiffFlowCorrelations("RP","Pt");
720 this->CrossCheckDiffFlowCorrelations("RP","Eta");
721 this->CrossCheckDiffFlowCorrelations("POI","Pt");
722 this->CrossCheckDiffFlowCorrelations("POI","Eta");
b3dacf6b 723 // Correction terms for non-uniform acceptance:
489d5531 724 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
725 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
726 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
727 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
728 } // end of if(fEvaluateDiffFlowNestedLoops)
729
730} // end of AliFlowAnalysisWithQCumulants::Finish()
731
489d5531 732//================================================================================================================================
733
1268c371 734void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
735{
736 // Evalauted all correlators for reference flow with nested loops.
737
738 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
739 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
740 {
741 // Without using particle weights:
742 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
743 {
744 // Correlations:
745 this->CalculateIntFlowCorrelations(); // from Q-vectors
746 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
747 // Correction for non-uniform acceptance:
748 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
749 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
750 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
751 }
752 // Using particle weights:
753 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
754 {
755 // Correlations
756 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
757 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
758 // Correction for non-uniform acceptance:
759 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
760 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
761 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
762 }
763 } else if(nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
764 {
765 cout<<endl;
766 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
767 } else
768 {
769 cout<<endl;
770 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
771 }
772
773} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
774
775//================================================================================================================================
776
777void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
778{
779 // Evalauted all correlators for differential flow with nested loops.
780
781 if(!fCalculateDiffFlow){return;}
782
783 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
784 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
785 {
786 // Without using particle weights:
787 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
788 {
789 // Reduced correlations:
790 // Q-vectors:
791 this->CalculateDiffFlowCorrelations("RP","Pt");
792 this->CalculateDiffFlowCorrelations("RP","Eta");
793 this->CalculateDiffFlowCorrelations("POI","Pt");
794 this->CalculateDiffFlowCorrelations("POI","Eta");
795 // Nested loops:
796 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
797 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
798 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
799 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
800 // Reduced corrections for non-uniform acceptance:
801 // Q-vectors:
802 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
803 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
804 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
805 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
806 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
807 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
808 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
809 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
810 // Nested loops:
811 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
812 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
813 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
814 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
815 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
816 // Using particle weights:
817 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
818 {
819 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
820 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
821 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
822 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
823 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
824 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
825 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
826 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
827 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
828 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
829 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
830 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
831 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
832 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
833 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
834 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
835 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
836 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
837 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
838 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
839 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
840 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
841
842} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
843
844//================================================================================================================================
845
489d5531 846void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
847{
b92ea2b9 848 // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
489d5531 849
850 // multiplicity:
1268c371 851 Double_t dMult = (*fSpk)(0,0);
489d5531 852
853 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
854 Double_t dReQ1n = (*fReQ)(0,0);
855 Double_t dReQ2n = (*fReQ)(1,0);
856 //Double_t dReQ3n = (*fReQ)(2,0);
857 //Double_t dReQ4n = (*fReQ)(3,0);
858 Double_t dImQ1n = (*fImQ)(0,0);
859 Double_t dImQ2n = (*fImQ)(1,0);
860 //Double_t dImQ3n = (*fImQ)(2,0);
861 //Double_t dImQ4n = (*fImQ)(3,0);
862
863 // *************************************************************
864 // **** corrections for non-uniform acceptance (cos terms): ****
865 // *************************************************************
866 //
867 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
868 // are stored in 1D profile fQCorrectionsCos.
869 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
870 // --------------------------------------------------------------------------------------------------------------------
871 // 1st bin: <<cos(n*(phi1))>> = cosP1n
872 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
873 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
874 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
875 // --------------------------------------------------------------------------------------------------------------------
876
877 // 1-particle:
878 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
879
880 if(dMult>0)
881 {
882 cosP1n = dReQ1n/dMult;
883
884 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
885 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
0328db2d 886 // event weights for NUA terms:
887 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
489d5531 888
889 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
890 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
b3dacf6b 891 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);}
489d5531 892 }
893
894 // 2-particle:
3b552efe 895 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
489d5531 896 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
897
898 if(dMult>1)
899 {
900 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
901 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
902
903 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
3b552efe 904 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
489d5531 905 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
0328db2d 906 // event weights for NUA terms:
907 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
908 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
909
489d5531 910 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
3b552efe 911 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
489d5531 912 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
b3dacf6b 913 if(fCalculateCumulantsVsM)
914 {
915 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
916 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
917 }
489d5531 918 }
919
920 // 3-particle:
921 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
922
923 if(dMult>2)
924 {
925 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
926 / (dMult*(dMult-1)*(dMult-2));
927
928 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
929 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
0328db2d 930 // event weights for NUA terms:
931 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 932
933 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
2001bc3a 934 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 935 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 936 }
937
938} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
939
940
941//================================================================================================================================
942
943
944void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
945{
946 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
947
948 // multiplicity:
1268c371 949 Double_t dMult = (*fSpk)(0,0);
489d5531 950
951 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
952 Double_t dReQ1n = (*fReQ)(0,0);
953 Double_t dReQ2n = (*fReQ)(1,0);
954 //Double_t dReQ3n = (*fReQ)(2,0);
955 //Double_t dReQ4n = (*fReQ)(3,0);
956 Double_t dImQ1n = (*fImQ)(0,0);
957 Double_t dImQ2n = (*fImQ)(1,0);
958 //Double_t dImQ3n = (*fImQ)(2,0);
959 //Double_t dImQ4n = (*fImQ)(3,0);
960
961 // *************************************************************
962 // **** corrections for non-uniform acceptance (sin terms): ****
963 // *************************************************************
964 //
965 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
966 // are stored in 1D profile fQCorrectionsSin.
967 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
968 // --------------------------------------------------------------------------------------------------------------------
969 // 1st bin: <<sin(n*(phi1))>> = sinP1n
970 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
971 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
972 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
973 // --------------------------------------------------------------------------------------------------------------------
974
975 // 1-particle:
976 Double_t sinP1n = 0.; // <sin(n*(phi1))>
977
978 if(dMult>0)
979 {
980 sinP1n = dImQ1n/dMult;
981
982 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
0328db2d 983 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
984 // event weights for NUA terms:
985 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
489d5531 986
987 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
988 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
b3dacf6b 989 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);}
489d5531 990 }
991
992 // 2-particle:
993 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
994 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
995 if(dMult>1)
996 {
3b552efe 997 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
489d5531 998 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
999
1000 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1001 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
3b552efe 1002 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
0328db2d 1003 // event weights for NUA terms:
1004 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1005 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
489d5531 1006
1007 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1008 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1009 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
b3dacf6b 1010 if(fCalculateCumulantsVsM)
1011 {
1012 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1013 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
1014 }
489d5531 1015 }
1016
1017 // 3-particle:
1018 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1019
1020 if(dMult>2)
1021 {
1022 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1023 / (dMult*(dMult-1)*(dMult-2));
1024
1025 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1026 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
0328db2d 1027 // event weights for NUA terms:
1028 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1029
1030 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
2001bc3a 1031 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
b3dacf6b 1032 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
489d5531 1033 }
1034
1035} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1036
489d5531 1037//================================================================================================================================
1038
489d5531 1039void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1040{
1268c371 1041 // a) Get pointers for common control and common result histograms;
1042 // b) Get pointers for histograms holding particle weights;
1043 // c) Get pointers for reference flow histograms;
1044 // d) Get pointers for differential flow histograms;
1045 // e) Get pointers for 2D differential flow histograms;
1046 // f) Get pointers for nested loops' histograms.
489d5531 1047
1048 if(outputListHistos)
3b552efe 1049 {
1050 this->SetHistList(outputListHistos);
1051 if(!fHistList)
1052 {
1268c371 1053 printf("\n WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!\n\n");
3b552efe 1054 exit(0);
489d5531 1055 }
1056 this->GetPointersForCommonHistograms();
1057 this->GetPointersForParticleWeightsHistograms();
1058 this->GetPointersForIntFlowHistograms();
1059 this->GetPointersForDiffFlowHistograms();
1268c371 1060 this->GetPointersFor2DDiffFlowHistograms();
489d5531 1061 this->GetPointersForNestedLoopsHistograms();
3b552efe 1062 } else
1063 {
1268c371 1064 printf("\n WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!\n\n");
3b552efe 1065 exit(0);
489d5531 1066 }
1067
1068} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
ad87ae62 1069
489d5531 1070//================================================================================================================================
1071
489d5531 1072TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
ad87ae62 1073{
489d5531 1074 // project 2D profile onto pt axis to get 1D profile
1075
1076 Int_t nBinsPt = profilePtEta->GetNbinsX();
1077 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1078 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1079
1080 Int_t nBinsEta = profilePtEta->GetNbinsY();
1081
1082 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1083
1084 for(Int_t p=1;p<=nBinsPt;p++)
1085 {
1086 Double_t contentPt = 0.;
1087 Double_t entryPt = 0.;
1088 Double_t spreadPt = 0.;
1089 Double_t sum1 = 0.;
1090 Double_t sum2 = 0.;
1091 Double_t sum3 = 0.;
1092 for(Int_t e=1;e<=nBinsEta;e++)
1093 {
1094 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1095 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1096 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1097
1098 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1099 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1100 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1101 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1102 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1103 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1104 }
1105 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1106 {
1107 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1108 }
1109 profilePt->SetBinContent(p,contentPt);
1110 profilePt->SetBinEntries(p,entryPt);
1111 {
1112 profilePt->SetBinError(p,spreadPt);
1113 }
1114
1115 }
1116
1117 return profilePt;
1118
1119} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1120
1121
1122//================================================================================================================================
1123
1124
1125TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1126{
1127 // project 2D profile onto eta axis to get 1D profile
1128
1129 Int_t nBinsEta = profilePtEta->GetNbinsY();
1130 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1131 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1132
1133 Int_t nBinsPt = profilePtEta->GetNbinsX();
1134
1135 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1136
1137 for(Int_t e=1;e<=nBinsEta;e++)
1138 {
1139 Double_t contentEta = 0.;
1140 Double_t entryEta = 0.;
1141 for(Int_t p=1;p<=nBinsPt;p++)
1142 {
1143 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1144 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1145 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1146 }
1147 profileEta->SetBinContent(e,contentEta);
1148 profileEta->SetBinEntries(e,entryEta);
1149 }
1150
1151 return profileEta;
1152
1153} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1154
489d5531 1155//================================================================================================================================
1156
489d5531 1157void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1158{
2001bc3a 1159 // Printing on the screen the final results for integrated flow (RF, POI and RP).
489d5531 1160
1161 Int_t n = fHarmonic;
1162
489d5531 1163 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1164 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1165
2001bc3a 1166 if(type == "RF")
489d5531 1167 {
0dd3b008 1168 for(Int_t b=0;b<4;b++)
1169 {
b77b6434 1170 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1171 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1172 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1173 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1174 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1175 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1176 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1177 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
0dd3b008 1178 }
489d5531 1179 } else if(type == "RP")
1180 {
1181 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1182 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1183 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1184 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1185 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1186 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1187 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1188 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1189 } else if(type == "POI")
1190 {
1191 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1192 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1193 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1194 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1195 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1196 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1197 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1198 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
b77b6434 1199 } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
b3dacf6b 1200 {
0dd3b008 1201 for(Int_t b=0;b<4;b++)
1202 {
1203 dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
1204 dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
1205 }
b3dacf6b 1206 }
489d5531 1207
1208 TString title = " flow estimates from Q-cumulants";
1209 TString subtitle = " (";
b3dacf6b 1210 TString subtitle2 = " (rebinned in M)";
489d5531 1211
b3dacf6b 1212 if(type != "RF, rebinned in M")
489d5531 1213 {
b3dacf6b 1214 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1215 {
1216 subtitle.Append(type);
1217 subtitle.Append(", without weights)");
1218 } else
1219 {
1220 subtitle.Append(type);
1221 subtitle.Append(", with weights)");
1222 }
1223 } else
489d5531 1224 {
b3dacf6b 1225 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1226 {
1227 subtitle.Append("RF");
1228 subtitle.Append(", without weights)");
1229 } else
1230 {
1231 subtitle.Append("RF");
1232 subtitle.Append(", with weights)");
1233 }
1234 }
1235
489d5531 1236 cout<<endl;
1237 cout<<"*************************************"<<endl;
1238 cout<<"*************************************"<<endl;
1239 cout<<title.Data()<<endl;
1240 cout<<subtitle.Data()<<endl;
b3dacf6b 1241 if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
489d5531 1242 cout<<endl;
1243
1244 for(Int_t i=0;i<4;i++)
1245 {
2001bc3a 1246 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
489d5531 1247 }
2001bc3a 1248
489d5531 1249 cout<<endl;
b92ea2b9 1250 if(type == "RF")
1251 {
b77b6434 1252 if(fApplyCorrectionForNUA)
1253 {
1254 cout<<" detector bias (corrected for): "<<endl;
1255 } else
1256 {
1257 cout<<" detector bias (not corrected for):"<<endl;
1258 }
b92ea2b9 1259 cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
1260 cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
1261 cout<<endl;
1262 }
b3dacf6b 1263 if(type == "RF" || type == "RF, rebinned in M")
489d5531 1264 {
2001bc3a 1265 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1266 }
1267 else if (type == "RP")
1268 {
2001bc3a 1269 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1270 }
1271 else if (type == "POI")
1272 {
2001bc3a 1273 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1274 }
1275
489d5531 1276 cout<<"*************************************"<<endl;
1277 cout<<"*************************************"<<endl;
1278 cout<<endl;
1279
2001bc3a 1280}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
489d5531 1281
1282//================================================================================================================================
1283
489d5531 1284void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1285{
1286 //store the final results in output .root file
1287 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1288 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1289 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1290 delete output;
1291}
1292
1293
1294//================================================================================================================================
1295
1296
1297void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1298{
1299 //store the final results in output .root file
1300 fHistList->SetName("cobjQC");
1301 fHistList->SetOwner(kTRUE);
1302 outputFileName->Add(fHistList);
1303 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1304}
1305
489d5531 1306//================================================================================================================================
1307
489d5531 1308void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1309{
1310 // Book common control histograms and common histograms for final results.
1268c371 1311 // a) Book common control histograms;
1312 // b) Book common result histograms.
1313
1314 // a) Book common control histograms:
1315 // Common control histograms (all events):
489d5531 1316 TString commonHistsName = "AliFlowCommonHistQC";
1317 commonHistsName += fAnalysisLabel->Data();
1318 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1319 fHistList->Add(fCommonHists);
1268c371 1320 // Common control histograms (selected events):
dd442cd2 1321 if(fFillMultipleControlHistograms)
1322 {
1268c371 1323 // Common control histogram filled for events with 2 and more reference particles:
dd442cd2 1324 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1325 commonHists2ndOrderName += fAnalysisLabel->Data();
1326 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1327 fHistList->Add(fCommonHists2nd);
1268c371 1328 // Common control histogram filled for events with 2 and more reference particles:
dd442cd2 1329 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1330 commonHists4thOrderName += fAnalysisLabel->Data();
1331 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1332 fHistList->Add(fCommonHists4th);
1268c371 1333 // Common control histogram filled for events with 6 and more reference particles:
dd442cd2 1334 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1335 commonHists6thOrderName += fAnalysisLabel->Data();
1336 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1337 fHistList->Add(fCommonHists6th);
1268c371 1338 // Common control histogram filled for events with 8 and more reference particles:
dd442cd2 1339 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1340 commonHists8thOrderName += fAnalysisLabel->Data();
1341 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1342 fHistList->Add(fCommonHists8th);
1343 } // end of if(fFillMultipleControlHistograms)
1344
1268c371 1345 // b) Book common result histograms:
1346 // Common result histograms for QC{2}:
489d5531 1347 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1348 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1349 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1350 fHistList->Add(fCommonHistsResults2nd);
1268c371 1351 // Common result histograms for QC{4}:
489d5531 1352 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1353 commonHistResults4thOrderName += fAnalysisLabel->Data();
1354 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1355 fHistList->Add(fCommonHistsResults4th);
1268c371 1356 // Common result histograms for QC{6}:
489d5531 1357 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1358 commonHistResults6thOrderName += fAnalysisLabel->Data();
1359 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1360 fHistList->Add(fCommonHistsResults6th);
1268c371 1361 // Common result histograms for QC{8}:
489d5531 1362 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1363 commonHistResults8thOrderName += fAnalysisLabel->Data();
1364 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1365 fHistList->Add(fCommonHistsResults8th);
1366
1367} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1368
489d5531 1369//================================================================================================================================
1370
489d5531 1371void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1372{
1268c371 1373 // Book and fill histograms which hold phi, pt and eta weights.
489d5531 1374
1375 if(!fWeightsList)
1376 {
1268c371 1377 printf("\n WARNING (QC): fWeightsList is NULL in AFAWQC::BAFWH() !!!! \n\n");
489d5531 1378 exit(0);
1379 }
1380
1381 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1382 fUseParticleWeightsName += fAnalysisLabel->Data();
1383 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1384 fUseParticleWeights->SetLabelSize(0.06);
1385 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1386 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1387 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1388 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1389 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1390 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1391 fWeightsList->Add(fUseParticleWeights);
1392
1393 if(fUsePhiWeights)
1394 {
1395 if(fWeightsList->FindObject("phi_weights"))
1396 {
1397 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1268c371 1398 if(!fPhiWeights)
1399 {
1400 printf("\n WARNING (QC): fPhiWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1401 exit(0);
1402 }
489d5531 1403 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1404 {
1405 cout<<endl;
1406 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1407 cout<<endl;
6fbbbbf1 1408 //exit(0);
489d5531 1409 }
1410 } else
1411 {
1412 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1413 exit(0);
1414 }
1415 } // end of if(fUsePhiWeights)
1416
1417 if(fUsePtWeights)
1418 {
1419 if(fWeightsList->FindObject("pt_weights"))
1420 {
1421 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1268c371 1422 if(!fPtWeights)
1423 {
1424 printf("\n WARNING (QC): fPtWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1425 exit(0);
1426 }
489d5531 1427 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1428 {
1429 cout<<endl;
1430 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1431 cout<<endl;
6fbbbbf1 1432 //exit(0);
489d5531 1433 }
1434 } else
1435 {
1436 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1437 exit(0);
1438 }
1439 } // end of if(fUsePtWeights)
1440
1441 if(fUseEtaWeights)
1442 {
1443 if(fWeightsList->FindObject("eta_weights"))
1444 {
1445 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1268c371 1446 if(!fEtaWeights)
1447 {
1448 printf("\n WARNING (QC): fEtaWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1449 exit(0);
1450 }
489d5531 1451 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1452 {
1453 cout<<endl;
1454 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1455 cout<<endl;
6fbbbbf1 1456 //exit(0);
489d5531 1457 }
1458 } else
1459 {
1460 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1461 exit(0);
1462 }
1463 } // end of if(fUseEtaWeights)
1464
1465} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1466
489d5531 1467//================================================================================================================================
1468
489d5531 1469void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1470{
1471 // Book all objects for integrated flow:
e5834fcb 1472 // a) Book profile to hold all flags for integrated flow;
1473 // b) Book event-by-event quantities;
1474 // c) Book profiles; // to be improved (comment)
489d5531 1475 // d) Book histograms holding the final results.
1476
1477 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1478 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1479
1480 // a) Book profile to hold all flags for integrated flow:
1481 TString intFlowFlagsName = "fIntFlowFlags";
1482 intFlowFlagsName += fAnalysisLabel->Data();
dd442cd2 1483 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",14,0,14);
489d5531 1484 fIntFlowFlags->SetTickLength(-0.01,"Y");
1485 fIntFlowFlags->SetMarkerStyle(25);
1486 fIntFlowFlags->SetLabelSize(0.05);
1487 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1488 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1489 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1490 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
b3dacf6b 1491 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
489d5531 1492 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
3b552efe 1493 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
b3dacf6b 1494 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
1495 fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
1496 fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
1497 fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
0dd3b008 1498 fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
8e1cefdd 1499 fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
e5834fcb 1500 fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStorePhiDistributionForOneEvent");
dd442cd2 1501 fIntFlowFlags->GetXaxis()->SetBinLabel(14,"fFillMultipleControlHistograms");
489d5531 1502 fIntFlowList->Add(fIntFlowFlags);
1503
1504 // b) Book event-by-event quantities:
1505 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
8ed4edc7 1506 fReQ = new TMatrixD(6,9);
1507 fImQ = new TMatrixD(6,9);
1268c371 1508 fSpk = new TMatrixD(8,9);
489d5531 1509 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1510 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1511 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1512 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1513 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1514 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1515 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1516 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1517 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1518 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1519 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
8ed4edc7 1520 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),34,0,34);
489d5531 1521 // average correction terms for non-uniform acceptance for single event
1522 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1523 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1524 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1525 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1526 {
b92ea2b9 1527 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 1528 }
0328db2d 1529 // event weights for terms for non-uniform acceptance:
1530 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1531 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1532 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1533 {
b92ea2b9 1534 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 1535 }
489d5531 1536 // c) Book profiles: // to be improved (comment)
1537 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1538 TString avMultiplicityName = "fAvMultiplicity";
1539 avMultiplicityName += fAnalysisLabel->Data();
1540 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1541 fAvMultiplicity->SetTickLength(-0.01,"Y");
1542 fAvMultiplicity->SetMarkerStyle(25);
1543 fAvMultiplicity->SetLabelSize(0.05);
1544 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1545 fAvMultiplicity->SetYTitle("Average Multiplicity");
1546 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1547 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1548 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1549 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1550 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1551 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1552 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1553 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1554 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1555 fIntFlowProfiles->Add(fAvMultiplicity);
b40a910e 1556 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1557 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
489d5531 1558 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1559 intFlowCorrelationsProName += fAnalysisLabel->Data();
1560 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
b40a910e 1561 fIntFlowCorrelationsPro->Sumw2();
489d5531 1562 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1563 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1564 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1565 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 1566 for(Int_t b=0;b<4;b++)
b3dacf6b 1567 {
68a3b4b1 1568 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
b3dacf6b 1569 }
489d5531 1570 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
b40a910e 1571 // Average correlations squared <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> for all events:
1572 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"};
1573 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
1574 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
1575 fIntFlowSquaredCorrelationsPro = new TProfile(intFlowSquaredCorrelationsProName.Data(),"Average squared correlations for all events",4,0,4,"s");
1576 fIntFlowSquaredCorrelationsPro->Sumw2();
1577 fIntFlowSquaredCorrelationsPro->SetTickLength(-0.01,"Y");
1578 fIntFlowSquaredCorrelationsPro->SetMarkerStyle(25);
1579 fIntFlowSquaredCorrelationsPro->SetLabelSize(0.06);
1580 fIntFlowSquaredCorrelationsPro->SetLabelOffset(0.01,"Y");
1581 for(Int_t b=0;b<4;b++)
1582 {
1583 (fIntFlowSquaredCorrelationsPro->GetXaxis())->SetBinLabel(b+1,squaredCorrelationFlag[b].Data());
1584 }
1585 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsPro);
b3dacf6b 1586 if(fCalculateCumulantsVsM)
1587 {
1588 for(Int_t ci=0;ci<4;ci++) // correlation index
1589 {
b40a910e 1590 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
b3dacf6b 1591 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1592 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1593 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1594 Form("%s vs multiplicity",correlationFlag[ci].Data()),
b40a910e 1595 fnBinsMult,fMinMult,fMaxMult,"s");
1596 fIntFlowCorrelationsVsMPro[ci]->Sumw2();
b3dacf6b 1597 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1598 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1599 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
b40a910e 1600 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
1601 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
1602 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
1603 fIntFlowSquaredCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data()),
1604 Form("%s vs multiplicity",squaredCorrelationFlag[ci].Data()),
1605 fnBinsMult,fMinMult,fMaxMult,"s");
1606 fIntFlowSquaredCorrelationsVsMPro[ci]->Sumw2();
1607 fIntFlowSquaredCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(squaredCorrelationFlag[ci].Data());
1608 fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1609 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsVsMPro[ci]);
b3dacf6b 1610 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1611 } // end of if(fCalculateCumulantsVsM)
489d5531 1612 // averaged all correlations for all events (with wrong errors!):
1613 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1614 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
8ed4edc7 1615 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",34,0,34,"s");
489d5531 1616 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1617 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1618 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1619 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1620 // 2-p correlations:
1621 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1622 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1623 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1624 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1625 // 3-p correlations:
1626 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1627 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1628 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1629 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1630 // 4-p correlations:
1631 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1632 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1633 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1634 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1635 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1636 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1637 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1638 // 5-p correlations:
1639 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1640 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1641 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1642 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1643 // 6-p correlations:
1644 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1645 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1646 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1647 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1648 // 7-p correlations:
1649 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1650 // 8-p correlations:
1651 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
8ed4edc7 1652 // EXTRA correlations:
1653 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(33,"<<4>>_{4n,2n|3n,3n}");
1654 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(34,"<<5>>_{2n,2n,2n|3n,3n}");
489d5531 1655 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1656 // when particle weights are used some extra correlations appear:
1657 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1658 {
1659 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1660 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1661 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1662 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1663 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1664 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1665 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1666 // extra 2-p correlations:
1667 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1668 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1669 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1670 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1671 // average product of correlations <2>, <4>, <6> and <8>:
b3dacf6b 1672 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
489d5531 1673 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1674 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1675 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1676 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1677 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1678 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1679 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
68a3b4b1 1680 for(Int_t b=0;b<6;b++)
b3dacf6b 1681 {
68a3b4b1 1682 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
b3dacf6b 1683 }
1684 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
ff70ca91 1685 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1686 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 1687 if(fCalculateCumulantsVsM)
1688 {
1689 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1690 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1691 for(Int_t pi=0;pi<6;pi++)
1692 {
1693 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1694 Form("%s versus multiplicity",productFlag[pi].Data()),
1695 fnBinsMult,fMinMult,fMaxMult);
1696 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1697 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1698 } // end of for(Int_t pi=0;pi<6;pi++)
1699 } // end of if(fCalculateCumulantsVsM)
0328db2d 1700 // average product of correction terms for NUA:
1701 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1702 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1703 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1704 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1705 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1706 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1707 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1708 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1709 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1710 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1711 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1712 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1713 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1714 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1715 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1716 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1717 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1718 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1719 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1720 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1721 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1722 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1723 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1724 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1725 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1726 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1727 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1728 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1729 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1730 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1731 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1732 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1733 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1734 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1735 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
489d5531 1736 // average correction terms for non-uniform acceptance (with wrong errors!):
1737 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1738 {
1739 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1740 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b92ea2b9 1741 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 1742 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1743 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1744 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1745 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
b92ea2b9 1746 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(phi1))#GT#GT",sinCosFlag[sc].Data()));
1747 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1748 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1749 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
489d5531 1750 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
2001bc3a 1751 // versus multiplicity:
b3dacf6b 1752 if(fCalculateCumulantsVsM)
1753 {
1754 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
1755 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
1756 {
1757 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
1758 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
1759 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");
1760 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
1761 }
1762 } // end of if(fCalculateCumulantsVsM)
489d5531 1763 } // end of for(Int_t sc=0;sc<2;sc++)
1764
1765 // d) Book histograms holding the final results:
1766 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1767 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1768 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1769 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1770 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1771 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1772 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1773 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1774 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1775 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1776 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1777 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1778 fIntFlowResults->Add(fIntFlowCorrelationsHist);
ff70ca91 1779 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
b3dacf6b 1780 if(fCalculateCumulantsVsM)
1781 {
1782 for(Int_t ci=0;ci<4;ci++) // correlation index
1783 {
1784 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1785 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1786 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1787 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1788 fnBinsMult,fMinMult,fMaxMult);
1789 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1790 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1791 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1792 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1793 } // end of if(fCalculateCumulantsVsM)
489d5531 1794 // average all correlations for all events (with correct errors!):
1795 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1796 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
8ed4edc7 1797 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",34,0,34);
489d5531 1798 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1799 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1800 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1801 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1802 // 2-p correlations:
1803 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1804 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1805 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1806 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1807 // 3-p correlations:
1808 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1809 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1810 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1811 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1812 // 4-p correlations:
1813 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1814 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1815 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1816 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1817 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1818 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1819 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1820 // 5-p correlations:
1821 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1822 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1823 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1824 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1825 // 6-p correlations:
1826 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1827 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1828 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1829 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1830 // 7-p correlations:
1831 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1832 // 8-p correlations:
1833 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1834 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1835 // average correction terms for non-uniform acceptance (with correct errors!):
1836 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1837 {
1838 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1839 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
b92ea2b9 1840 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 1841 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1842 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1843 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1844 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
b92ea2b9 1845 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
1846 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1847 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1848 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
489d5531 1849 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1850 } // end of for(Int_t sc=0;sc<2;sc++)
1851 // covariances (multiplied with weight dependent prefactor):
1852 TString intFlowCovariancesName = "fIntFlowCovariances";
1853 intFlowCovariancesName += fAnalysisLabel->Data();
1854 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1855 fIntFlowCovariances->SetLabelSize(0.04);
1856 fIntFlowCovariances->SetMarkerStyle(25);
1857 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1858 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1859 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1860 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1861 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1862 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1863 fIntFlowResults->Add(fIntFlowCovariances);
1864 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1865 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1866 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1867 for(Int_t power=0;power<2;power++)
1868 {
1869 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);
1870 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1871 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1872 if(power == 0)
1873 {
1874 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1875 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1876 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1877 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1878 } else if (power == 1)
1879 {
1880 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1881 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1882 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1883 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1884 }
1885 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1886 }
1887 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1888 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1889 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1890 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1891 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1892 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1893 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1894 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1895 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1896 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1897 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1898 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1899 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
ff70ca91 1900 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1901 // [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 1902 if(fCalculateCumulantsVsM)
ff70ca91 1903 {
b3dacf6b 1904 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1905 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1906 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1907 for(Int_t ci=0;ci<6;ci++)
1908 {
1909 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1910 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
1911 fnBinsMult,fMinMult,fMaxMult);
1912 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1913 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1914 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1915 }
1916 } // end of if(fCalculateCumulantsVsM)
ff70ca91 1917 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1918 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
b3dacf6b 1919 if(fCalculateCumulantsVsM)
ff70ca91 1920 {
b3dacf6b 1921 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1922 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1923 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>}"},
1924 {"#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}"}};
1925 for(Int_t si=0;si<4;si++)
ff70ca91 1926 {
b3dacf6b 1927 for(Int_t power=0;power<2;power++)
1928 {
1929 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1930 Form("%s vs multiplicity",sumFlag[power][si].Data()),
1931 fnBinsMult,fMinMult,fMaxMult);
1932 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1933 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1934 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1935 } // end of for(Int_t power=0;power<2;power++)
1936 } // end of for(Int_t si=0;si<4;si++)
1937 } // end of if(fCalculateCumulantsVsM)
ff70ca91 1938 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1939 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1940 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 1941 if(fCalculateCumulantsVsM)
1942 {
1943 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1944 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1945 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>}",
1946 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1947 for(Int_t pi=0;pi<6;pi++)
1948 {
1949 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1950 Form("%s versus multiplicity",sopowFlag[pi].Data()),
1951 fnBinsMult,fMinMult,fMaxMult);
1952 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1953 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1954 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1955 } // end of for(Int_t pi=0;pi<6;pi++)
1956 } // end of if(fCalculateCumulantsVsM)
0328db2d 1957 // covariances of NUA terms (multiplied with weight dependent prefactor):
1958 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1959 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1960 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1961 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1962 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1963 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1964 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1965 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1966 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1967 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1968 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1969 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1970 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1971 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1972 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1973 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1974 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1975 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1976 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1977 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1978 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1979 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1980 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1981 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1982 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1983 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1984 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1985 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1986 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1987 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1988 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1989 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1990 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1991 fIntFlowResults->Add(fIntFlowCovariancesNUA);
1992 // sum of linear and quadratic event weights for NUA terms:
1993 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
1994 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
1995 for(Int_t sc=0;sc<2;sc++)
1996 {
1997 for(Int_t power=0;power<2;power++)
1998 {
b92ea2b9 1999 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 2000 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
2001 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
2002 if(power == 0)
2003 {
2004 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
2005 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
b92ea2b9 2006 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
2007 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
0328db2d 2008 } else if(power == 1)
2009 {
2010 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
2011 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
2012 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
b92ea2b9 2013 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
0328db2d 2014 }
2015 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
2016 }
2017 }
2018 // sum of products of event weights for NUA terms:
2019 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
2020 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
2021 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
2022 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
2023 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
2024 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
2025 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
2026 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
2027 // ....
2028 // to be improved - add labels for remaining bins
2029 // ....
2030 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
b3dacf6b 2031 // Final results for reference Q-cumulants:
2032 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
489d5531 2033 TString intFlowQcumulantsName = "fIntFlowQcumulants";
2034 intFlowQcumulantsName += fAnalysisLabel->Data();
b92ea2b9 2035 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
b77b6434 2036 if(fPropagateErrorAlsoFromNIT)
b92ea2b9 2037 {
b77b6434 2038 fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
b92ea2b9 2039 }
489d5531 2040 fIntFlowQcumulants->SetLabelSize(0.05);
2041 fIntFlowQcumulants->SetMarkerStyle(25);
68a3b4b1 2042 for(Int_t b=0;b<4;b++)
b3dacf6b 2043 {
68a3b4b1 2044 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2045 }
489d5531 2046 fIntFlowResults->Add(fIntFlowQcumulants);
b3dacf6b 2047 // Final results for reference Q-cumulants rebinned in M:
2048 if(fCalculateCumulantsVsM)
2049 {
2050 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
2051 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
2052 fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
2053 fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
2054 fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2055 for(Int_t b=0;b<4;b++)
b3dacf6b 2056 {
68a3b4b1 2057 (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
b3dacf6b 2058 }
2059 fIntFlowResults->Add(fIntFlowQcumulantsRebinnedInM);
2060 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 2061 // Ratio between error squared: with/without non-isotropic terms:
2062 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
2063 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
2064 fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
2065 fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
2066 fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
2067 for(Int_t b=0;b<4;b++)
2068 {
2069 (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2070 }
2071 fIntFlowResults->Add(fIntFlowQcumulantsErrorSquaredRatio);
ff70ca91 2072 // final results for integrated Q-cumulants versus multiplicity:
b3dacf6b 2073 if(fCalculateCumulantsVsM)
2074 {
2075 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
2076 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2077 for(Int_t co=0;co<4;co++) // cumulant order
2078 {
2079 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2080 Form("%s vs multipicity",cumulantFlag[co].Data()),
2081 fnBinsMult,fMinMult,fMaxMult);
2082 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2083 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2084 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2085 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2086 } // end of if(fCalculateCumulantsVsM)
489d5531 2087 // final integrated flow estimates from Q-cumulants:
b3dacf6b 2088 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 2089 TString intFlowName = "fIntFlow";
2090 intFlowName += fAnalysisLabel->Data();
2091 // integrated flow from Q-cumulants:
b3dacf6b 2092 fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
489d5531 2093 fIntFlow->SetLabelSize(0.05);
2094 fIntFlow->SetMarkerStyle(25);
68a3b4b1 2095 for(Int_t b=0;b<4;b++)
b3dacf6b 2096 {
68a3b4b1 2097 (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2098 }
ff70ca91 2099 fIntFlowResults->Add(fIntFlow);
b3dacf6b 2100 // Reference flow vs M rebinned in one huge bin:
2101 if(fCalculateCumulantsVsM)
2102 {
2103 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
2104 intFlowRebinnedInMName += fAnalysisLabel->Data();
2105 fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
2106 fIntFlowRebinnedInM->SetLabelSize(0.05);
2107 fIntFlowRebinnedInM->SetMarkerStyle(25);
68a3b4b1 2108 for(Int_t b=0;b<4;b++)
b3dacf6b 2109 {
68a3b4b1 2110 (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
b3dacf6b 2111 }
2112 fIntFlowResults->Add(fIntFlowRebinnedInM);
2113 }
ff70ca91 2114 // integrated flow from Q-cumulants: versus multiplicity:
b3dacf6b 2115 if(fCalculateCumulantsVsM)
2116 {
2117 TString intFlowVsMName = "fIntFlowVsM";
2118 intFlowVsMName += fAnalysisLabel->Data();
2119 for(Int_t co=0;co<4;co++) // cumulant order
2120 {
2121 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2122 Form("%s vs multipicity",flowFlag[co].Data()),
2123 fnBinsMult,fMinMult,fMaxMult);
2124 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2125 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2126 fIntFlowResults->Add(fIntFlowVsM[co]);
2127 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2128 } // end of if(fCalculateCumulantsVsM)
2001bc3a 2129 // quantifying detector effects effects to correlations:
2130 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2131 intFlowDetectorBiasName += fAnalysisLabel->Data();
2132 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2133 fIntFlowDetectorBias->SetLabelSize(0.05);
2134 fIntFlowDetectorBias->SetMarkerStyle(25);
2135 for(Int_t ci=0;ci<4;ci++)
2136 {
2137 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2138 }
2139 fIntFlowResults->Add(fIntFlowDetectorBias);
2140 // quantifying detector effects to correlations versus multiplicity:
b3dacf6b 2141 if(fCalculateCumulantsVsM)
2001bc3a 2142 {
b3dacf6b 2143 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2144 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2145 for(Int_t ci=0;ci<4;ci++) // correlation index
2146 {
2147 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2148 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2149 fnBinsMult,fMinMult,fMaxMult);
2150 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2151 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
b77b6434 2152 fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);
b3dacf6b 2153 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2154 } // end of if(fCalculateCumulantsVsM)
1268c371 2155
489d5531 2156} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2157
489d5531 2158//================================================================================================================================
2159
489d5531 2160void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2161{
2162 // Initialize arrays of all objects relevant for calculations with nested loops.
2163
2164 // integrated flow:
2165 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2166 {
2167 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2168 }
2169
2170 // differential flow:
2171 // correlations:
2172 for(Int_t t=0;t<2;t++) // type: RP or POI
2173 {
2174 for(Int_t pe=0;pe<2;pe++) // pt or eta
2175 {
2176 for(Int_t ci=0;ci<4;ci++) // correlation index
2177 {
2178 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2179 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2180 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2181 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2182 // correction terms for non-uniform acceptance:
2183 for(Int_t t=0;t<2;t++) // type: RP or POI
2184 {
2185 for(Int_t pe=0;pe<2;pe++) // pt or eta
2186 {
2187 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2188 {
2189 for(Int_t cti=0;cti<9;cti++) // correction term index
2190 {
2191 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2192 }
2193 }
2194 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2195 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2196
2197
2198} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2199
2200
2201//================================================================================================================================
2202
2203
2204void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2205{
2206 // Book all objects relevant for calculations with nested loops.
2207
2208 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2209 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2210 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2211 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2212 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2213 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2214
2215 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2216 evaluateNestedLoopsName += fAnalysisLabel->Data();
2217 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2218 fEvaluateNestedLoops->SetLabelSize(0.03);
2219 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2220 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2221 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2222 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2223 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2224 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2225 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2226 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2227 fNestedLoopsList->Add(fEvaluateNestedLoops);
2228 // nested loops for integrated flow:
2229 if(fEvaluateIntFlowNestedLoops)
2230 {
2231 // correlations:
2232 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2233 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
8ed4edc7 2234 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",34,0,34,"s");
489d5531 2235 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2236 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2237 {
2238 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2239 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2240 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2241 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2242 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2243 // correction terms for non-uniform acceptance:
2244 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2245 {
2246 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2247 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2248 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");
2249 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2250 } // end of for(Int_t sc=0;sc<2;sc++)
2251 } // end of if(fEvaluateIntFlowNestedLoops)
2252
2253 // nested loops for differential flow:
2254 if(fEvaluateDiffFlowNestedLoops)
2255 {
2256 // reduced correlations:
2257 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2258 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2259 for(Int_t t=0;t<2;t++) // type: RP or POI
2260 {
2261 for(Int_t pe=0;pe<2;pe++) // pt or eta
2262 {
2263 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2264 {
2265 // reduced correlations:
2266 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");
2267 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2268 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2269 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2270 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2271 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2272 // correction terms for non-uniform acceptance:
2273 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2274 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2275 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2276 {
2277 for(Int_t pe=0;pe<2;pe++) // pt or eta
2278 {
2279 for(Int_t sc=0;sc<2;sc++) // sin or cos
2280 {
2281 for(Int_t cti=0;cti<9;cti++) // correction term index
2282 {
2283 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");
2284 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2285 }
2286 }
2287 }
3b552efe 2288 }
2289 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2290 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2291 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
489d5531 2292 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2293 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2294 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
3b552efe 2295 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
489d5531 2296 fNestedLoopsList->Add(fNoOfParticlesInBin);
2297 } // end of if(fEvaluateDiffFlowNestedLoops)
2298
2299} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2300
2301
2302//================================================================================================================================
2303
2304
2305void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2306{
2307 // calculate all correlations needed for integrated flow
57340a27 2308
489d5531 2309 // multiplicity:
1268c371 2310 Double_t dMult = (*fSpk)(0,0);
57340a27 2311
489d5531 2312 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2313 Double_t dReQ1n = (*fReQ)(0,0);
2314 Double_t dReQ2n = (*fReQ)(1,0);
2315 Double_t dReQ3n = (*fReQ)(2,0);
2316 Double_t dReQ4n = (*fReQ)(3,0);
8ed4edc7 2317 //Double_t dReQ5n = (*fReQ)(4,0);
2318 Double_t dReQ6n = (*fReQ)(5,0);
489d5531 2319 Double_t dImQ1n = (*fImQ)(0,0);
2320 Double_t dImQ2n = (*fImQ)(1,0);
2321 Double_t dImQ3n = (*fImQ)(2,0);
2322 Double_t dImQ4n = (*fImQ)(3,0);
8ed4edc7 2323 //Double_t dImQ5n = (*fImQ)(4,0);
2324 Double_t dImQ6n = (*fImQ)(5,0);
489d5531 2325
2326 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2327 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2328
2329 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2330 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2331
2332 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2333 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2334
2335 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2336 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2337
2338 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2339 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2340 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2341
2342 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2343 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2344
2345 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2346 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2347
2348 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2349 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2350
2351 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2352 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2353
2354 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2355 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2356
2357 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2358 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2359
2360 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2361 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2362
2363 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2364 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2365
2366 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2367 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2368 + dImQ3n*dImQ2n*dReQ1n;
2369
2370 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2371 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2372
2373 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2374 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2375
2376 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2377 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2378 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2379
2380 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2381 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2382
2383 // |Q_{2n}|^2 |Q_{n}|^2
2384 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2385
2386 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2387 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2388 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2389
2390 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2391 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2392
2393 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2394 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2395 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2396
2397 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2398 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2399
2400 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2401 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2402 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2403
2404 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2405 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2406 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2407
2408 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2409 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2410 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2411 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2412
2413 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2414 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2415 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2416 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2417
2418 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2419 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2420 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2421
2422 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2423 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2424 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2425
2426
2427 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2428 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2429 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2430 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2431 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2432
2433 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2434 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2435 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2436 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2437
2438 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2439 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2440 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2441 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2442
2443 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2444 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2445 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2446 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2447
2448 // |Q_{2n}|^2 |Q_{n}|^4
2449 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2450
2451 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2452 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2453 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2454 + 2.*dReQ1n*dImQ1n*dImQ2n);
2455
2456 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2457 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2458 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2459 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2460
2461
2462
2463
2464 // **************************************
2465 // **** multi-particle correlations: ****
2466 // **************************************
2467 //
8ed4edc7 2468 // Remark 1: All multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fIntFlowCorrelationsAllPro;
2469 // Remark 2: There is a special profile fIntFlowCorrelationsPro holding results ONLY for same harmonic's <<2>>, <<4>>, <<6>> and <<8>>;
2470 // Remark 3: Binning of fIntFlowCorrelationsAllPro is organized as follows:
489d5531 2471 // --------------------------------------------------------------------------------------------------------------------
2472 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2473 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2474 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2475 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2476 // 5th bin: ---- EMPTY ----
2477 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2478 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2479 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2480 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2481 // 10th bin: ---- EMPTY ----
2482 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2483 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2484 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2485 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2486 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2487 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2488 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2489 // 18th bin: ---- EMPTY ----
2490 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2491 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2492 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2493 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2494 // 23rd bin: ---- EMPTY ----
2495 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2496 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2497 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2498 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2499 // 28th bin: ---- EMPTY ----
2500 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2501 // 30th bin: ---- EMPTY ----
2502 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
8ed4edc7 2503 // 32nd bin: ---- EMPTY ----
2504 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2505 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
489d5531 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);
b40a910e 2551 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1n*two1n1n,mWeight2p);
2552 if(fCalculateCumulantsVsM)
2553 {
2554 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2555 fIntFlowSquaredCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n*two1n1n,mWeight2p);
2556 }
489d5531 2557 // distribution of <cos(n*(phi1-phi2))>:
2558 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2559 } // end of if(dMult>1)
2560
2561 // 3-particle:
2562 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2563 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2564 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2565 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2566
2567 if(dMult>2)
2568 {
2569 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2570 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2571 / (dMult*(dMult-1.)*(dMult-2.));
2572 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2573 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2574 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2575 / (dMult*(dMult-1.)*(dMult-2.));
2576 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2577 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2578 / (dMult*(dMult-1.)*(dMult-2.));
2579 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2580 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2581 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2582 / (dMult*(dMult-1.)*(dMult-2.));
2583
2584 // average 3-particle correlations for single event:
2585 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2586 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2587 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2588 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2589
2590 // average 3-particle correlations for all events:
2591 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2592 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2593 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2594 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2595 } // end of if(dMult>2)
2596
2597 // 4-particle:
2598 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2599 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2600 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2601 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2602 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2603 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2604 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2605
2606 if(dMult>3)
2607 {
2608 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2609 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2610 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2611 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2612 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2613 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2614 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2615 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2616 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2617 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2618 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2619 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2620 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2621 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2622 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2623 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2624 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2625 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2626 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2627 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2628 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2629 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2630 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2631 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2632 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2633 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2634 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2635 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2636 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2637 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2638 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2639 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2640 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2641 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2642 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2643 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2644
2645 // average 4-particle correlations for single event:
2646 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2647 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2648 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2649 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2650 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2651 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2652 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2653
2654 // average 4-particle correlations for all events:
2655 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2656 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2657 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2658 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2659 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2660 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2661 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2662
2663 // store separetately <4> (to be improved: do I really need this?)
2664 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2665
2666 // to be improved (this can be implemented better):
2667 Double_t mWeight4p = 0.;
2668 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2669 {
2670 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2671 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2672 {
2673 mWeight4p = 1.;
2674 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2675 {
2676 mWeight4p = dMult;
2677 }
2678
2679 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2680 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
b40a910e 2681 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
2682 if(fCalculateCumulantsVsM)
2683 {
2684 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
2685 fIntFlowSquaredCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
2686 }
489d5531 2687 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2688 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2689
2690 } // end of if(dMult>3)
2691
2692 // 5-particle:
2693 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2694 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2695 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2696 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2697
2698 if(dMult>4)
2699 {
2700 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2701 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2702 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2703 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2704 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2705 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2706 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2707 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2708 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2709 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2710 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2711
2712 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2713 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2714 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2715 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2716 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2717 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2718 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2719 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2720 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2721 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2722 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2723 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2724 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2725
2726 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2727 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2728 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2729 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2730 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2731 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2732 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2733
2734 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2735 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2736 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2737 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2738 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2739 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2740 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2741 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2742 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2743 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2744 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2745 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2746 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2747 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2748 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2749 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2750
2751 // average 5-particle correlations for single event:
2752 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2753 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2754 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2755 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2756
2757 // average 5-particle correlations for all events:
2758 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2759 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2760 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2761 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2762 } // end of if(dMult>4)
2763
2764 // 6-particle:
2765 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2766 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2767 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2768 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2769
2770 if(dMult>5)
2771 {
2772 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2773 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2774 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2775 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2776 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2777 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2778 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2779 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2780 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2781 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2782 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2783
2784 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2785 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2786 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2787 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2788 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2789 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2790 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2791 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2792 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2793 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2794 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2795 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2796 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2797 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2798
2799 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2800 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2801 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2802 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2803 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2804 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2805 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2806
2807 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2808 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2809 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2810 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2811 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2812 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2813 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2814 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2815
2816 // average 6-particle correlations for single event:
2817 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2818 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2819 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2820 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2821
2822 // average 6-particle correlations for all events:
2823 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2824 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2825 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2826 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2827
2828 // store separetately <6> (to be improved: do I really need this?)
2829 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2830
2831 // to be improved (this can be implemented better):
2832 Double_t mWeight6p = 0.;
2833 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2834 {
2835 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2836 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2837 {
2838 mWeight6p = 1.;
2839 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2840 {
2841 mWeight6p = dMult;
2842 }
2843
2844 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2845 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
b40a910e 2846 fIntFlowSquaredCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
2847 if(fCalculateCumulantsVsM)
2848 {
2849 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
2850 fIntFlowSquaredCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
2851 }
489d5531 2852 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2853 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2854 } // end of if(dMult>5)
2855
2856 // 7-particle:
2857 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2858
2859 if(dMult>6)
2860 {
2861 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2862 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2863 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2864 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2865 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2866 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2867 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2868 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2869 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2870 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2871 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2872 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2873 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2874 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2875 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2876 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2877
2878 // average 7-particle correlations for single event:
2879 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2880
2881 // average 7-particle correlations for all events:
2882 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2883 } // end of if(dMult>6)
2884
2885 // 8-particle:
2886 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2887 if(dMult>7)
2888 {
2889 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2890 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2891 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2892 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2893 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2894 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2895 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2896 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2897 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2898 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2899 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2900 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2901 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2902
2903 // average 8-particle correlations for single event:
2904 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2905
2906 // average 8-particle correlations for all events:
2907 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2908
2909 // store separetately <8> (to be improved: do I really need this?)
2910 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2911
2912 // to be improved (this can be implemented better):
2913 Double_t mWeight8p = 0.;
2914 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2915 {
2916 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2917 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2918 {
2919 mWeight8p = 1.;
2920 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2921 {
2922 mWeight8p = dMult;
2923 }
2924
2925 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
b40a910e 2926 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2927 fIntFlowSquaredCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
2928 if(fCalculateCumulantsVsM)
2929 {
2930 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2931 fIntFlowSquaredCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
2932 }
489d5531 2933 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2934 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2935 } // end of if(dMult>7)
2936
11d3e40e 2937 // EXTRA: // to be improved (reorganized)
8ed4edc7 2938
2939 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2940 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
2941
2942 // 4-particle:
2943 Double_t four4n2n3n3n = 0.; // <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2944 Double_t reQ4nQ2nQ3nstarQ3nstar = (dReQ4n*dReQ2n-dImQ4n*dImQ2n)*(dReQ3n*dReQ3n-dImQ3n*dImQ3n)
2945 + 2.*(dReQ4n*dImQ2n+dImQ4n*dReQ2n)*dReQ3n*dImQ3n;
8ed4edc7 2946 Double_t reQ6nQ4nstarQ2nstar = dReQ6n*dReQ4n*dReQ2n-dReQ6n*dImQ4n*dImQ2n+dImQ6n*dReQ4n*dImQ2n
2947 + dImQ6n*dImQ4n*dReQ2n;
11d3e40e 2948 Double_t reQ6nQ3nstarQ3nstar = pow(dReQ3n,2.)*dReQ6n + 2.*dReQ3n*dImQ3n*dImQ6n
2949 - pow(dImQ3n,2.)*dReQ6n;
8ed4edc7 2950 if(dMult>3.)
2951 {
11d3e40e 2952 four4n2n3n3n = (reQ4nQ2nQ3nstarQ3nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar
2953 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
2954 + (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2955 + 2.*(2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2956 + (pow(dReQ1n,2.)+pow(dImQ1n,2.))-3.*dMult))
2957 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2958
8ed4edc7 2959 fIntFlowCorrelationsAllPro->Fill(32.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
11d3e40e 2960 } // end of if(dMult>3.)
8ed4edc7 2961
2962 // 5-particle:
2963 Double_t five2n2n2n3n3n = 0.; // <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
2964 Double_t reQ2nQ2nQ2nQ3nstarQ3nstar = pow(dReQ2n,3.)*pow(dReQ3n,2.)
11d3e40e 2965 - 3.*dReQ2n*pow(dReQ3n,2.)*pow(dImQ2n,2.)
2966 + 6.*pow(dReQ2n,2.)*dReQ3n*dImQ2n*dImQ3n
2967 - 2.*dReQ3n*pow(dImQ2n,3.)*dImQ3n-pow(dReQ2n,3.)*pow(dImQ3n,2.)
2968 + 3.*dReQ2n*pow(dImQ2n,2.)*pow(dImQ3n,2.);
2969 Double_t reQ2nQ2nQ2nQ6nstar = dReQ6n*pow(dReQ2n,3)-3.*dReQ2n*dReQ6n*pow(dImQ2n,2)
2970 + 3.*dImQ2n*dImQ6n*pow(dReQ2n,2)-dImQ6n*pow(dImQ2n,3);
2971 Double_t reQ2nQ2nQ1nstarQ3nstar = reQ3nQ1nQ2nstarQ2nstar;
2972 Double_t reQ4nQ2nQ6nstar = reQ6nQ4nstarQ2nstar;
2973 Double_t reQ4nQ1nstarQ3nstar = reQ3nQ1nQ4nstar;
8ed4edc7 2974 if(dMult>4.)
2975 {
11d3e40e 2976 five2n2n2n3n3n = (reQ2nQ2nQ2nQ3nstarQ3nstar-reQ2nQ2nQ2nQ6nstar-3.*reQ4nQ2nQ3nstarQ3nstar
2977 - 6.*reQ2nQ2nQ1nstarQ3nstar+2.*reQ6nQ3nstarQ3nstar+3.*reQ4nQ2nQ6nstar
2978 + 6.*reQ4nQ1nstarQ3nstar+6.*reQ2nQ2nQ4nstar
2979 + 12.*reQ2nQ1nQ3nstar+6.*reQ2nQ1nstarQ1nstar
2980 - 2.*((pow(dReQ6n,2.)+pow(dImQ6n,2.))
2981 + 3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2982 + 6.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2983 + 9.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2984 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-12.*dMult))
2985 /(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2986
8ed4edc7 2987 fIntFlowCorrelationsAllPro->Fill(33.5,five2n2n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
11d3e40e 2988 } // end of if(dMult>4.)
8ed4edc7 2989
489d5531 2990} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2991
489d5531 2992//================================================================================================================================
2993
e5834fcb 2994void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
2995{
2996 // Store phi distribution for one event to illustrate flow.
2997
2998 if(fPhiDistributionForOneEvent->GetEntries()>0){return;} // store only phi distribution for one event
2999
3000 Double_t vMin = fPhiDistributionForOneEventSettings[0];
3001 Double_t vMax = fPhiDistributionForOneEventSettings[1];
3002 Double_t refMultMin = fPhiDistributionForOneEventSettings[2];
3003 Double_t refMultMax = fPhiDistributionForOneEventSettings[3];
3004
3005 Double_t vEBE = 0.;
3006 Double_t cumulant4thEBE = fIntFlowCorrelationsEBE->GetBinContent(2)-2.*pow(fIntFlowCorrelationsEBE->GetBinContent(1),2.);
3007 if(cumulant4thEBE<0.)
3008 {
3009 vEBE = pow(-1.*cumulant4thEBE,0.25);
3010 if((vEBE>vMin && vEBE<vMax) && (fReferenceMultiplicityEBE>refMultMin && fReferenceMultiplicityEBE<refMultMax))
3011 {
3958eee6 3012 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f",fHarmonic,vEBE));
e5834fcb 3013 for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3014 {
3015 if(anEvent->GetTrack(p)->InRPSelection())
3016 {
3017 fPhiDistributionForOneEvent->Fill(anEvent->GetTrack(p)->Phi());
3018 }
3019 } // end of for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3958eee6 3020 } else
3021 {
3022 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f, out of specified boundaries",fHarmonic,vEBE));
3023 }
3024
e5834fcb 3025 } // end of if(cumulant4thEBE<0.)
3026
3027} // end of void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3028
3029//================================================================================================================================
489d5531 3030
3031void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3032{
0328db2d 3033 // Calculate averages of products of correlations for integrated flow.
489d5531 3034
2001bc3a 3035 // multiplicity:
1268c371 3036 Double_t dMult = (*fSpk)(0,0);
2001bc3a 3037
489d5531 3038 Int_t counter = 0;
3039
3040 for(Int_t ci1=1;ci1<4;ci1++)
3041 {
3042 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
3043 {
ff70ca91 3044 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
3045 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3046 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3047 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3048 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3049 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 3050 if(fCalculateCumulantsVsM)
3051 {
3052 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
3053 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3054 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3055 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3056 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3057 } // end of if(fCalculateCumulantsVsM)
ff70ca91 3058 counter++;
489d5531 3059 }
3060 }
3061
3062} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3063
3064
3065//================================================================================================================================
3066
3067
0328db2d 3068void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3069{
3070 // Calculate averages of products of correction terms for NUA.
3071
3072 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
3073 // 1st bin: <<2><cos(phi)>>
3074 // 2nd bin: <<2><sin(phi)>>
3075 // 3rd bin: <<cos(phi)><sin(phi)>>
3076 // 4th bin: <<2><cos(phi1+phi2)>>
3077 // 5th bin: <<2><sin(phi1+phi2)>>
3078 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
3079 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
3080 // 8th bin: <<4><cos(phi1)>>
3081 // 9th bin: <<4><sin(phi1)>>
3082 // 10th bin: <<4><cos(phi1+phi2)>>
3083 // 11th bin: <<4><sin(phi1+phi2)>>
3084 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
3085 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
3086 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
3087 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
3088 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
3089 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
3090 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
3091 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
3092 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
3093 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
3094 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
3095 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3096 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3097 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3098 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3099 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3100
3101 // <<2><cos(phi)>>:
3102 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
3103 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3104 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3105 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3106 // <<2><sin(phi)>>:
3107 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
3108 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3109 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3110 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3111 // <<cos(phi)><sin(phi)>>:
3112 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
3113 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3114 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3115 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3116 // <<2><cos(phi1+phi2)>>:
3117 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
3118 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3119 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3120 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3121 // <<2><sin(phi1+phi2)>>:
3122 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
3123 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3124 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3125 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3126 // <<2><cos(phi1-phi2-phi3)>>:
3127 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
3128 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3129 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3130 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3131 // <<2><sin(phi1-phi2-phi3)>>:
3132 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3133 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3134 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3135 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3136 // <<4><cos(phi1)>>:
3137 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3138 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3139 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3140 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3141 // <<4><sin(phi1)>>:
3142 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3143 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3144 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3145 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3146 // <<4><cos(phi1+phi2)>>:
3147 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3148 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3149 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3150 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3151 // <<4><sin(phi1+phi2)>>:
3152 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3153 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3154 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3155 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3156 // <<4><cos(phi1-phi2-phi3)>>:
3157 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3158 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3159 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3160 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3161 // <<4><sin(phi1-phi2-phi3)>>:
3162 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3163 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3164 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3165 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3166 // <<cos(phi1)><cos(phi1+phi2)>>:
3167 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3168 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3169 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3170 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3171 // <<cos(phi1)><sin(phi1+phi2)>>:
3172 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3173 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3174 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3175 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3176 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3177 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3178 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3179 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3180 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3181 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3182 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3183 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3184 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3185 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3186 // <<sin(phi1)><cos(phi1+phi2)>>:
3187 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3188 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3189 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3190 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3191 // <<sin(phi1)><sin(phi1+phi2)>>:
3192 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3193 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3194 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3195 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3196 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3197 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3198 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3199 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3200 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3201 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3202 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3203 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3204 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3205 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3206 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3207 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3208 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3209 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3210 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3211 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3212 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3213 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3214 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3215 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3216 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3217 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3218 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3219 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3220 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3221 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3222 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3223 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3224 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3225 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3226 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3227 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3228 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3229 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3230 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3231 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3232 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3233 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3234 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3235 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3236
3237} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3238
0328db2d 3239//================================================================================================================================
3240
489d5531 3241void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3242{
3243 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3244 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3245 // b) Store in histogram fIntFlowCovariances for instance the following:
3246 //
3247 // 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)]
3248 //
3249 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3250 // c) Binning of fIntFlowCovariances is organized as follows:
3251 //
3252 // 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)]
3253 // 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)]
3254 // 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)]
3255 // 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)]
3256 // 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)]
3257 // 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 3258 //
489d5531 3259
b3dacf6b 3260 // Average 2-, 4-, 6- and 8-particle correlations for all events:
489d5531 3261 Double_t correlation[4] = {0.};
3262 for(Int_t ci=0;ci<4;ci++)
3263 {
3264 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3265 }
b3dacf6b 3266 // Average products of 2-, 4-, 6- and 8-particle correlations:
489d5531 3267 Double_t productOfCorrelations[4][4] = {{0.}};
3268 Int_t productOfCorrelationsLabel = 1;
b3dacf6b 3269 // Denominators in the expressions for the unbiased estimator for covariance:
489d5531 3270 Double_t denominator[4][4] = {{0.}};
3271 Int_t sumOfProductOfEventWeightsLabel1 = 1;
b3dacf6b 3272 // Weight dependent prefactor which multiply unbiased estimators for covariances:
489d5531 3273 Double_t wPrefactor[4][4] = {{0.}};
3274 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3275 for(Int_t c1=0;c1<4;c1++)
3276 {
3277 for(Int_t c2=c1+1;c2<4;c2++)
3278 {
3279 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
b3dacf6b 3280 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
3281 {
3282 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
3283 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3284 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3285 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
3286 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3287 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
489d5531 3288 }
b3dacf6b 3289 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
489d5531 3290 sumOfProductOfEventWeightsLabel1++;
3291 sumOfProductOfEventWeightsLabel2++;
b3dacf6b 3292 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3293 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 3294
489d5531 3295 Int_t covarianceLabel = 1;
3296 for(Int_t c1=0;c1<4;c1++)
3297 {
3298 for(Int_t c2=c1+1;c2<4;c2++)
3299 {
b3dacf6b 3300 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
489d5531 3301 {
b3dacf6b 3302 // Covariances:
489d5531 3303 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
b3dacf6b 3304 // Covariances multiplied with weight dependent prefactor:
489d5531 3305 Double_t wCov = cov * wPrefactor[c1][c2];
3306 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3307 }
3308 covarianceLabel++;
b3dacf6b 3309 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3310 } // end of for(Int_t c1=0;c1<4;c1++)
489d5531 3311
b3dacf6b 3312 // Versus multiplicity:
3313 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 3314 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3315 for(Int_t b=1;b<=nBins;b++)
3316 {
b3dacf6b 3317 // Average 2-, 4-, 6- and 8-particle correlations for all events:
9da1a4f3 3318 Double_t correlationVsM[4] = {0.};
3319 for(Int_t ci=0;ci<4;ci++)
3320 {
3321 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3322 } // end of for(Int_t ci=0;ci<4;ci++)
b3dacf6b 3323 // Average products of 2-, 4-, 6- and 8-particle correlations:
9da1a4f3 3324 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
3325 Int_t productOfCorrelationsLabelVsM = 1;
b3dacf6b 3326 // Denominators in the expressions for the unbiased estimator for covariance:
9da1a4f3 3327 Double_t denominatorVsM[4][4] = {{0.}};
3328 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
b3dacf6b 3329 // Weight dependent prefactor which multiply unbiased estimators for covariances:
9da1a4f3 3330 Double_t wPrefactorVsM[4][4] = {{0.}};
3331 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
3332 for(Int_t c1=0;c1<4;c1++)
3333 {
3334 for(Int_t c2=c1+1;c2<4;c2++)
3335 {
3336 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
b3dacf6b 3337 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
3338 {
3339 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
3340 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3341 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3342 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
3343 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3344 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
9da1a4f3 3345 }
3346 productOfCorrelationsLabelVsM++;
3347 sumOfProductOfEventWeightsLabel1VsM++;
3348 sumOfProductOfEventWeightsLabel2VsM++;
3349 } // end of for(Int_t c1=0;c1<4;c1++)
3350 } // end of for(Int_t c2=c1+1;c2<4;c2++)
b3dacf6b 3351
9da1a4f3 3352 Int_t covarianceLabelVsM = 1;
3353 for(Int_t c1=0;c1<4;c1++)
3354 {
3355 for(Int_t c2=c1+1;c2<4;c2++)
3356 {
b3dacf6b 3357 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
9da1a4f3 3358 {
b3dacf6b 3359 // Covariances:
9da1a4f3 3360 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
b3dacf6b 3361 // Covariances multiplied with weight dependent prefactor:
9da1a4f3 3362 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
3363 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
3364 }
3365 covarianceLabelVsM++;
b3dacf6b 3366 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3367 } // end of for(Int_t c1=0;c1<4;c1++)
9da1a4f3 3368 } // end of for(Int_t b=1;b<=nBins;b++)
3369
489d5531 3370} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3371
489d5531 3372//================================================================================================================================
3373
0328db2d 3374void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3375{
3376 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3377 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3378 //
3379 // 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)]
3380 //
3381 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3382 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3383 //
3384 // 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)]
3385 // 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)]
3386 // 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)]
3387 // ...
3388
3389 // Cov(<2>,<cos(phi)>):
3390 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3391 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3392 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3393 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3394 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3395 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3396 // numerator in the expression for the the unbiased estimator for covariance:
3397 Double_t numerator1 = product1 - term1st1*term2nd1;
3398 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3399 Double_t denominator1 = 0.;
3400 if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3401 {
3402 denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3403 if(TMath::Abs(denominator1)>0.)
3404 {
3405 // covariance:
3406 Double_t covariance1 = numerator1/denominator1;
3407 // weight dependent prefactor for covariance:
3408 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3409 // finally, store "weighted" covariance:
3410 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3411 } // end of if(TMath::Abs(denominator)>0.)
3412 } // end of if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3413
0328db2d 3414 // Cov(<2>,<sin(phi)>):
3415 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3416 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3417 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3418 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3419 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3420 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3421 // numerator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3422 Double_t numerator2 = product2 - term1st2*term2nd2;
0328db2d 3423 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3424 Double_t denominator2 = 0.;
3425 if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
3426 {
3427 denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3428 if(TMath::Abs(denominator2)>0.)
3429 {
3430 // covariance:
3431 Double_t covariance2 = numerator2/denominator2;
3432 // weight dependent prefactor for covariance:
3433 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3434 // finally, store "weighted" covariance:
3435 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3436 } // end of if(TMath::Abs(denominator2)>0.)
3437 } // end of if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
0328db2d 3438
3439 // Cov(<cos(phi)>,<sin(phi)>):
3440 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3441 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3442 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3443 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3444 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3445 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3446 // numerator in the expression for the the unbiased estimator for covariance:
3447 Double_t numerator3 = product3 - term1st3*term2nd3;
3448 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3449 Double_t denominator3 = 0;
3450 if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
3451 {
3452 denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3453 if(TMath::Abs(denominator3)>0.)
3454 {
3455 // covariance:
3456 Double_t covariance3 = numerator3/denominator3;
3457 // weight dependent prefactor for covariance:
3458 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3459 // finally, store "weighted" covariance:
3460 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3461 } // end of if(TMath::Abs(denominator3)>0.)
3462 } // end of if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
0328db2d 3463
3464 // Cov(<2>,<cos(phi1+phi2)>):
3465 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3466 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3467 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3468 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3469 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3470 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3471 // numerator in the expression for the the unbiased estimator for covariance:
3472 Double_t numerator4 = product4 - term1st4*term2nd4;
3473 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3474 Double_t denominator4 = 0.;
3475 if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3476 {
3477 denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3478 if(TMath::Abs(denominator4)>0.)
3479 {
3480 // covariance:
3481 Double_t covariance4 = numerator4/denominator4;
3482 // weight dependent prefactor for covariance:
3483 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3484 // finally, store "weighted" covariance:
3485 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3486 } // end of if(TMath::Abs(denominator4)>0.)
3487 } // end of if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3488
0328db2d 3489 // Cov(<2>,<sin(phi1+phi2)>):
3490 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3491 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3492 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3493 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3494 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3495 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3496 // numerator in the expression for the the unbiased estimator for covariance:
3497 Double_t numerator5 = product5 - term1st5*term2nd5;
3498 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3499 Double_t denominator5 = 0.;
3500 if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3501 {
3502 denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3503 if(TMath::Abs(denominator5)>0.)
3504 {
3505 // covariance:
3506 Double_t covariance5 = numerator5/denominator5;
3507 // weight dependent prefactor for covariance:
3508 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3509 // finally, store "weighted" covariance:
3510 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3511 } // end of if(TMath::Abs(denominator5)>0.)
3512 } // end of if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3513
0328db2d 3514 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3515 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3516 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3517 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3518 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3519 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3520 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3521 // numerator in the expression for the the unbiased estimator for covariance:
3522 Double_t numerator6 = product6 - term1st6*term2nd6;
3523 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3524 Double_t denominator6 = 0.;
3525 if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3526 {
3527 denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3528 if(TMath::Abs(denominator6)>0.)
3529 {
3530 // covariance:
3531 Double_t covariance6 = numerator6/denominator6;
3532 // weight dependent prefactor for covariance:
3533 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3534 // finally, store "weighted" covariance:
3535 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3536 } // end of if(TMath::Abs(denominator6)>0.)
3537 } // end of if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3538
0328db2d 3539 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3540 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3541 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3542 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3543 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3544 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3545 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3546 // numerator in the expression for the the unbiased estimator for covariance:
3547 Double_t numerator7 = product7 - term1st7*term2nd7;
3548 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3549 Double_t denominator7 = 0.;
3550 if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3551 {
3552 denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3553 if(TMath::Abs(denominator7)>0.)
3554 {
3555 // covariance:
3556 Double_t covariance7 = numerator7/denominator7;
3557 // weight dependent prefactor for covariance:
3558 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3559 // finally, store "weighted" covariance:
3560 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3561 } // end of if(TMath::Abs(denominator7)>0.)
3562 } // end of if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3563
0328db2d 3564 // Cov(<4>,<cos(phi1>):
3565 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3566 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3567 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3568 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3569 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3570 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3571 // numerator in the expression for the the unbiased estimator for covariance:
3572 Double_t numerator8 = product8 - term1st8*term2nd8;
3573 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3574 Double_t denominator8 = 0.;
3575 if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3576 {
3577 denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3578 if(TMath::Abs(denominator8)>0.)
3579 {
3580 // covariance:
3581 Double_t covariance8 = numerator8/denominator8;
3582 // weight dependent prefactor for covariance:
3583 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3584 // finally, store "weighted" covariance:
3585 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3586 } // end of if(TMath::Abs(denominator8)>0.)
3587 } // end of if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3588
0328db2d 3589 // Cov(<4>,<sin(phi1)>):
3590 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3591 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3592 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3593 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3594 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3595 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3596 // numerator in the expression for the the unbiased estimator for covariance:
3597 Double_t numerator9 = product9 - term1st9*term2nd9;
3598 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3599 Double_t denominator9 = 0.;
3600 if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3601 {
3602 denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3603 if(TMath::Abs(denominator9)>0.)
3604 {
3605 // covariance:
3606 Double_t covariance9 = numerator9/denominator9;
3607 // weight dependent prefactor for covariance:
3608 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3609 // finally, store "weighted" covariance:
3610 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3611 }
3612 } // end of if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3613
0328db2d 3614 // Cov(<4>,<cos(phi1+phi2)>):
3615 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3616 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3617 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3618 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3619 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3620 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3621 // numerator in the expression for the the unbiased estimator for covariance:
3622 Double_t numerator10 = product10 - term1st10*term2nd10;
3623 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3624 Double_t denominator10 = 0.;
3625 if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3626 {
3627 denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3628 if(TMath::Abs(denominator10)>0.)
3629 {
3630 // covariance:
3631 Double_t covariance10 = numerator10/denominator10;
3632 // weight dependent prefactor for covariance:
3633 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3634 // finally, store "weighted" covariance:
3635 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3636 } // end of if(TMath::Abs(denominator10)>0.)
3637 } // end of if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3638
0328db2d 3639 // Cov(<4>,<sin(phi1+phi2)>):
3640 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3641 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3642 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3643 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3644 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3645 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3646 // numerator in the expression for the the unbiased estimator for covariance:
3647 Double_t numerator11 = product11 - term1st11*term2nd11;
3648 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3649 Double_t denominator11 = 0.;
3650 if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
3651 {
3652 denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3653 if(TMath::Abs(denominator11)>0.)
3654 {
3655 // covariance:
3656 Double_t covariance11 = numerator11/denominator11;
3657 // weight dependent prefactor for covariance:
3658 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3659 // finally, store "weighted" covariance:
3660 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3661 } // end of if(TMath::Abs(denominator11)>0.)
3662 } // end of if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
0328db2d 3663
3664 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3665 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3666 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3667 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3668 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3669 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3670 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3671 // numerator in the expression for the the unbiased estimator for covariance:
3672 Double_t numerator12 = product12 - term1st12*term2nd12;
3673 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3674 Double_t denominator12 = 0.;
3675 if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
3676 {
3677 denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3678 if(TMath::Abs(denominator12)>0.)
3679 {
3680 // covariance:
3681 Double_t covariance12 = numerator12/denominator12;
3682 // weight dependent prefactor for covariance:
3683 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3684 // finally, store "weighted" covariance:
3685 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3686 } // end of if(TMath::Abs(denominator12)>0.)
3687 } // end of if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
0328db2d 3688
3689 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3690 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3691 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3692 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3693 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3694 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3695 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3696 // numerator in the expression for the the unbiased estimator for covariance:
3697 Double_t numerator13 = product13 - term1st13*term2nd13;
3698 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3699 Double_t denominator13 = 0.;
3700 if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
3701 {
3702 denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3703 if(TMath::Abs(denominator13)>0.)
3704 {
3705 // covariance:
3706 Double_t covariance13 = numerator13/denominator13;
3707 // weight dependent prefactor for covariance:
3708 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3709 // finally, store "weighted" covariance:
3710 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3711 } // end of if(TMath::Abs(denominator13)>0.)
3712 } // end of if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
0328db2d 3713
3714 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3715 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3716 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3717 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3718 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3719 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3720 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3721 // numerator in the expression for the the unbiased estimator for covariance:
3722 Double_t numerator14 = product14 - term1st14*term2nd14;
3723 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3724 Double_t denominator14 = 0.;
3725 if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
3726 {
3727 denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3728 if(TMath::Abs(denominator14)>0.)
3729 {
3730 // covariance:
3731 Double_t covariance14 = numerator14/denominator14;
3732 // weight dependent prefactor for covariance:
3733 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3734 // finally, store "weighted" covariance:
3735 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3736 } // end of if(TMath::Abs(denominator14)>0.)
3737 } // end of if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
0328db2d 3738
3739 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3740 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3741 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3742 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3743 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3744 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3745 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3746 // numerator in the expression for the the unbiased estimator for covariance:
3747 Double_t numerator15 = product15 - term1st15*term2nd15;
3748 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3749 Double_t denominator15 = 0.;
3750 if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3751 {
3752 denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3753 if(TMath::Abs(denominator15)>0.)
3754 {
3755 // covariance:
3756 Double_t covariance15 = numerator15/denominator15;
3757 // weight dependent prefactor for covariance:
3758 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3759 // finally, store "weighted" covariance:
3760 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3761 } // end of if(TMath::Abs(denominator15)>0.)
3762 } // end of if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3763
0328db2d 3764 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3765 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3766 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3767 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3768 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3769 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3770 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3771 // numerator in the expression for the the unbiased estimator for covariance:
3772 Double_t numerator16 = product16 - term1st16*term2nd16;
3773 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3774 Double_t denominator16 = 0.;
3775 if(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3776 {
3777 denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3778 if(TMath::Abs(denominator16)>0.)
3779 {
3780 // covariance:
3781 Double_t covariance16 = numerator16/denominator16;
3782 // weight dependent prefactor for covariance:
3783 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3784 // finally, store "weighted" covariance:
3785 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3786 } // end of if(TMath::Abs(denominator16)>0.)
3787 } // end ofif(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3788
0328db2d 3789 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3790 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3791 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3792 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3793 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3794 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3795 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3796 // numerator in the expression for the the unbiased estimator for covariance:
3797 Double_t numerator17 = product17 - term1st17*term2nd17;
3798 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3799 Double_t denominator17 = 0.;
3800 if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
3801 {
3802 denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3803 if(TMath::Abs(denominator17)>0.)
3804 {
3805 // covariance:
3806 Double_t covariance17 = numerator17/denominator17;
3807 // weight dependent prefactor for covariance:
3808 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3809 // finally, store "weighted" covariance:
3810 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3811 } // end of if(TMath::Abs(denominator17)>0.)
3812 } // end of if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
0328db2d 3813
3814 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3815 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3816 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3817 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3818 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3819 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3820 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3821 // numerator in the expression for the the unbiased estimator for covariance:
3822 Double_t numerator18 = product18 - term1st18*term2nd18;
3823 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3824 Double_t denominator18 = 0.;
3825 if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
3826 {
3827 denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3828 if(TMath::Abs(denominator18)>0.)
3829 {
3830 // covariance:
3831 Double_t covariance18 = numerator18/denominator18;
3832 // weight dependent prefactor for covariance:
3833 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3834 // finally, store "weighted" covariance:
3835 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3836 } // end of if(TMath::Abs(denominator18)>0.)
3837 } // end of if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
0328db2d 3838
3839 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3840 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3841 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3842 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3843 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3844 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3845 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3846 // numerator in the expression for the the unbiased estimator for covariance:
3847 Double_t numerator19 = product19 - term1st19*term2nd19;
3848 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3849 Double_t denominator19 = 0.;
3850 if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3851 {
3852 denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3853 if(TMath::Abs(denominator19)>0.)
3854 {
3855 // covariance:
3856 Double_t covariance19 = numerator19/denominator19;
3857 // weight dependent prefactor for covariance:
3858 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3859 // finally, store "weighted" covariance:
3860 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3861 } // end of if(TMath::Abs(denominator19)>0.)
3862 } // end of if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3863
0328db2d 3864 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3865 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3866 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3867 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3868 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3869 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3870 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3871 // numerator in the expression for the the unbiased estimator for covariance:
3872 Double_t numerator20 = product20 - term1st20*term2nd20;
3873 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3874 Double_t denominator20 = 0.;
3875 if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
3876 {
3877 denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3878 if(TMath::Abs(denominator20)>0.)
3879 {
3880 // covariance:
3881 Double_t covariance20 = numerator20/denominator20;
3882 // weight dependent prefactor for covariance:
3883 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3884 // finally, store "weighted" covariance:
3885 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3886 } // end of if(TMath::Abs(denominator20)>0.)
3887 } // end of if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
0328db2d 3888
3889 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3890 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3891 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3892 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3893 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3894 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3895 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3896 // numerator in the expression for the the unbiased estimator for covariance:
3897 Double_t numerator21 = product21 - term1st21*term2nd21;
3898 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3899 Double_t denominator21 = 0.;
3900 if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
3901 {
3902 denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3903 if(TMath::Abs(denominator21)>0.)
3904 {
3905 // covariance:
3906 Double_t covariance21 = numerator21/denominator21;
3907 // weight dependent prefactor for covariance:
3908 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3909 // finally, store "weighted" covariance:
3910 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3911 } // end of if(TMath::Abs(denominator21)>0.)
3912 } // end of if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
0328db2d 3913
3914 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3915 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3916 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3917 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3918 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3919 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3920 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3921 // numerator in the expression for the the unbiased estimator for covariance:
3922 Double_t numerator22 = product22 - term1st22*term2nd22;
3923 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3924 Double_t denominator22 = 0.;
3925 if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
3926 {
3927 denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3928 if(TMath::Abs(denominator22)>0.)
3929 {
3930 // covariance:
3931 Double_t covariance22 = numerator22/denominator22;
3932 // weight dependent prefactor for covariance:
3933 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3934 // finally, store "weighted" covariance:
3935 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3936 } // end of if(TMath::Abs(denominator22)>0.)
3937 } // end of if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
0328db2d 3938
3939 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3940 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3941 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3942 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3943 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3944 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3945 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3946 // numerator in the expression for the the unbiased estimator for covariance:
3947 Double_t numerator23 = product23 - term1st23*term2nd23;
3948 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3949 Double_t denominator23 = 0.;
3950 if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
3951 {
3952 denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3953 if(TMath::Abs(denominator23)>0.)
3954 {
3955 // covariance:
3956 Double_t covariance23 = numerator23/denominator23;
3957 // weight dependent prefactor for covariance:
3958 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3959 // finally, store "weighted" covariance:
3960 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
3961 } // end of if(TMath::Abs(denominator23)>0.)
3962 } // end of if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
3963
0328db2d 3964 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3965 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3966 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3967 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3968 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3969 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3970 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3971 // numerator in the expression for the the unbiased estimator for covariance:
3972 Double_t numerator24 = product24 - term1st24*term2nd24;
3973 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3974 Double_t denominator24 = 0.;
3975 if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
3976 {
3977 denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3978 if(TMath::Abs(denominator24)>0.)
3979 {
3980 // covariance:
3981 Double_t covariance24 = numerator24/denominator24;
3982 // weight dependent prefactor for covariance:
3983 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3984 // finally, store "weighted" covariance:
3985 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
3986 } // end of if(TMath::Abs(denominator24)>0.)
3987 } // end of if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
0328db2d 3988
3989 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3990 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3991 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3992 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3993 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3994 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3995 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3996 // numerator in the expression for the the unbiased estimator for covariance:
3997 Double_t numerator25 = product25 - term1st25*term2nd25;
3998 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 3999 Double_t denominator25 = 0.;
4000 if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4001 {
4002 denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4003 if(TMath::Abs(denominator25)>0.)
4004 {
4005 // covariance:
4006 Double_t covariance25 = numerator25/denominator25;
4007 // weight dependent prefactor for covariance:
4008 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4009 // finally, store "weighted" covariance:
4010 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
4011 } // end of if(TMath::Abs(denominator25)>0.)
4012 } // end of if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4013
0328db2d 4014 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4015 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
4016 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4017 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4018 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4019 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4020 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4021 // numerator in the expression for the the unbiased estimator for covariance:
4022 Double_t numerator26 = product26 - term1st26*term2nd26;
4023 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4024 Double_t denominator26 = 0.;
4025 if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4026 {
4027 denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4028 if(TMath::Abs(denominator26)>0.)
4029 {
4030 // covariance:
4031 Double_t covariance26 = numerator26/denominator26;
4032 // weight dependent prefactor for covariance:
4033 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4034 // finally, store "weighted" covariance:
4035 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
4036 } // end of if(TMath::Abs(denominator26)>0.)
4037 } // end of if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4038
0328db2d 4039 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
4040 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
b92ea2b9 4041 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
0328db2d 4042 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
b92ea2b9 4043 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
0328db2d 4044 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4045 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
4046 // numerator in the expression for the the unbiased estimator for covariance:
4047 Double_t numerator27 = product27 - term1st27*term2nd27;
4048 // denominator in the expression for the the unbiased estimator for covariance:
b92ea2b9 4049 Double_t denominator27 = 0.;
4050 if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4051 {
4052 denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4053 if(TMath::Abs(denominator27)>0.)
4054 {
4055 // covariance:
4056 Double_t covariance27 = numerator27/denominator27;
4057 // weight dependent prefactor for covariance:
4058 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4059 // finally, store "weighted" covariance:
4060 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
4061 } // end of if(TMath::Abs(denominator27)>0.)
4062 } // end of if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4063
0328db2d 4064} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4065
0328db2d 4066//================================================================================================================================
4067
489d5531 4068void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4069{
4070 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
4071 // correctly calculate the statistical errors and store the final results and
4072 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
4073 //
4074 // Remark: Statistical error of correlation is calculated as:
4075 //
4076 // statistical error = termA * spread * termB:
4077 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
4078 // termB = 1/sqrt(1-termA^2)
b3dacf6b 4079 //
4080
489d5531 4081 for(Int_t ci=1;ci<=4;ci++) // correlation index
4082 {
b40a910e 4083 if(fIntFlowCorrelationsPro->GetBinEffectiveEntries(ci) < 2 || fIntFlowSquaredCorrelationsPro->GetBinEffectiveEntries(ci) < 2)
4084 {
4085 fIntFlowCorrelationsPro->SetBinError(ci,0.);
4086 fIntFlowSquaredCorrelationsPro->SetBinError(ci,0.);
4087 continue;
4088 }
489d5531 4089 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
b40a910e 4090 Double_t squaredCorrelation = fIntFlowSquaredCorrelationsPro->GetBinContent(ci);
4091 Double_t spread = 0.;
4092 if(squaredCorrelation-correlation*correlation >= 0.)
4093 {
4094 spread = pow(squaredCorrelation-correlation*correlation,0.5);
4095 } else
4096 {
4097 cout<<endl;
4098 cout<<Form(" WARNING: Imaginary 'spread' for %d-particle correlation!!!! ",2*ci)<<endl;
4099 cout<<endl;
4100 }
489d5531 4101 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
4102 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
4103 Double_t termA = 0.;
4104 Double_t termB = 0.;
b3dacf6b 4105 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
489d5531 4106 {
4107 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
4108 } else
4109 {
b3dacf6b 4110 cout<<endl;
4111 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4112 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4113 cout<<endl;
489d5531 4114 }
4115 if(1.-pow(termA,2.) > 0.)
4116 {
4117 termB = 1./pow(1-pow(termA,2.),0.5);
4118 } else
4119 {
b3dacf6b 4120 cout<<endl;
4121 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4122 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4123 cout<<endl;
489d5531 4124 }
4125 Double_t statisticalError = termA * spread * termB;
4126 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
4127 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
ff70ca91 4128 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4129
b3dacf6b 4130 // Versus multiplicity:
4131 if(!fCalculateCumulantsVsM){return;}
ff70ca91 4132 for(Int_t ci=0;ci<=3;ci++) // correlation index
4133 {
4134 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
4135 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
4136 {
b40a910e 4137 if(fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2 || fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2)
4138 {
4139 fIntFlowCorrelationsVsMPro[ci]->SetBinError(b,0.);
4140 fIntFlowSquaredCorrelationsVsMPro[ci]->SetBinError(b,0.);
4141 continue;
4142 }
ff70ca91 4143 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
b40a910e 4144 Double_t squaredCorrelationVsM = fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinContent(b);
4145 Double_t spreadVsM = 0.;
4146 if(squaredCorrelationVsM-correlationVsM*correlationVsM >= 0.)
4147 {
4148 spreadVsM = pow(squaredCorrelationVsM-correlationVsM*correlationVsM,0.5);
4149 } else
4150 {
4151 cout<<endl;
4152 cout<<Form(" WARNING (QC): Imaginary 'spreadVsM' for ci = %d, bin = %d, entries = %f !!!!",
4153 ci,b,fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b))<<endl;
4154 cout<<endl;
4155 }
ff70ca91 4156 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
4157 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
4158 Double_t termAVsM = 0.;
4159 Double_t termBVsM = 0.;
b40a910e 4160 if(sumOfLinearEventWeightsVsM > 0.)
ff70ca91 4161 {
4162 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
b3dacf6b 4163 }
ff70ca91 4164 if(1.-pow(termAVsM,2.) > 0.)
4165 {
4166 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
b3dacf6b 4167 }
ff70ca91 4168 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
4169 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
4170 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
4171 } // end of for(Int_t b=1;b<=nBins;b++)
4172 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4173
489d5531 4174} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4175
489d5531 4176//================================================================================================================================
4177
489d5531 4178void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
4179{
b77b6434 4180 // Fill profile fAverageMultiplicity to hold average multiplicities and
4181 // number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
489d5531 4182
4183 // Binning of fAverageMultiplicity is organized as follows:
4184 // 1st bin: all events (including the empty ones)
4185 // 2nd bin: event with # of RPs greater or equal to 1
4186 // 3rd bin: event with # of RPs greater or equal to 2
4187 // 4th bin: event with # of RPs greater or equal to 3
4188 // 5th bin: event with # of RPs greater or equal to 4
4189 // 6th bin: event with # of RPs greater or equal to 5
4190 // 7th bin: event with # of RPs greater or equal to 6
4191 // 8th bin: event with # of RPs greater or equal to 7
4192 // 9th bin: event with # of RPs greater or equal to 8
4193
489d5531 4194 if(nRP<0)
4195 {
b77b6434 4196 cout<<endl;
4197 cout<<" WARNING (QC): nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
4198 cout<<endl;
489d5531 4199 exit(0);
4200 }
4201
4202 for(Int_t i=0;i<9;i++)
4203 {
b77b6434 4204 if(nRP>=i){fAvMultiplicity->Fill(i+0.5,nRP,1);}
489d5531 4205 }
4206
4207} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
4208
489d5531 4209//================================================================================================================================
4210
489d5531 4211void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
b3dacf6b 4212{
b92ea2b9 4213 // a) Calculate Q-cumulants from the measured multiparticle correlations;
4214 // b) Propagate the statistical errors from measured multiparticle correlations to statistical errors of Q-cumulants;
4215 // c) Remark: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
4216 // Method CalculateQcumulantsCorrectedForNUAIntFlow() is called afterwards to correct for this bias;
4217 // d) Store the results and statistical error of Q-cumulants in histogram fIntFlowQcumulants.
4218 // Binning of fIntFlowQcumulants is organized as follows:
489d5531 4219 //
b3dacf6b 4220 // 1st bin: QC{2}
4221 // 2nd bin: QC{4}
4222 // 3rd bin: QC{6}
4223 // 4th bin: QC{8}
4224 //
489d5531 4225
b3dacf6b 4226 // Correlations:
489d5531 4227 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4228 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4229 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4230 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
b3dacf6b 4231 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
489d5531 4232 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4233 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4234 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4235 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
b3dacf6b 4236 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 4237 Double_t wCov24 = 0.; // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4238 Double_t wCov26 = 0.; // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4239 Double_t wCov28 = 0.; // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4240 Double_t wCov46 = 0.; // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4241 Double_t wCov48 = 0.; // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4242 Double_t wCov68 = 0.; // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4243 if(!fForgetAboutCovariances)
4244 {
4245 wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4246 wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4247 wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4248 wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4249 wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4250 wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4251 }
489d5531 4252 // Q-cumulants:
4253 Double_t qc2 = 0.; // QC{2}
4254 Double_t qc4 = 0.; // QC{4}
4255 Double_t qc6 = 0.; // QC{6}
4256 Double_t qc8 = 0.; // QC{8}
b3dacf6b 4257 if(TMath::Abs(two) > 0.){qc2 = two;}
4258 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4259 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4260 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4261 // Statistical errors of Q-cumulants:
489d5531 4262 Double_t qc2Error = 0.;
4263 Double_t qc4Error = 0.;
4264 Double_t qc6Error = 0.;
b3dacf6b 4265 Double_t qc8Error = 0.;
4266 // Squared statistical errors of Q-cumulants:
489d5531 4267 //Double_t qc2ErrorSquared = 0.;
4268 Double_t qc4ErrorSquared = 0.;
4269 Double_t qc6ErrorSquared = 0.;
b3dacf6b 4270 Double_t qc8ErrorSquared = 0.;
4271 // Statistical error of QC{2}:
4272 qc2Error = twoError;
4273 // Statistical error of QC{4}:
489d5531 4274 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4275 - 8.*two*wCov24;
4276 if(qc4ErrorSquared>0.)
4277 {
4278 qc4Error = pow(qc4ErrorSquared,0.5);
4279 } else
4280 {
b3dacf6b 4281 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
4282 }
4283 // Statistical error of QC{6}:
489d5531 4284 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4285 + 81.*pow(two,2.)*pow(fourError,2.)
4286 + pow(sixError,2.)
4287 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4288 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 4289 - 18.*two*wCov46;
489d5531 4290 if(qc6ErrorSquared>0.)
4291 {
4292 qc6Error = pow(qc6ErrorSquared,0.5);
4293 } else
4294 {
b3dacf6b 4295 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
4296 }
4297 // Statistical error of QC{8}:
489d5531 4298 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4299 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4300 + 256.*pow(two,2.)*pow(sixError,2.)
4301 + pow(eightError,2.)
4302 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4303 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4304 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4305 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4306 + 72.*(4.*pow(two,2.)-four)*wCov48
4307 - 32.*two*wCov68;
4308 if(qc8ErrorSquared>0.)
4309 {
4310 qc8Error = pow(qc8ErrorSquared,0.5);
4311 } else
4312 {
b3dacf6b 4313 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
489d5531 4314 }
b3dacf6b 4315 // Store the results and statistical errors for Q-cumulants:
4316 if(TMath::Abs(qc2)>0.)
4317 {
4318 fIntFlowQcumulants->SetBinContent(1,qc2);
4319 fIntFlowQcumulants->SetBinError(1,qc2Error);
4320 }
4321 if(TMath::Abs(qc4)>0.)
4322 {
4323 fIntFlowQcumulants->SetBinContent(2,qc4);
4324 fIntFlowQcumulants->SetBinError(2,qc4Error);
4325 }
4326 if(TMath::Abs(qc6)>0.)
4327 {
4328 fIntFlowQcumulants->SetBinContent(3,qc6);
4329 fIntFlowQcumulants->SetBinError(3,qc6Error);
4330 }
4331 if(TMath::Abs(qc8)>0.)
4332 {
4333 fIntFlowQcumulants->SetBinContent(4,qc8);
4334 fIntFlowQcumulants->SetBinError(4,qc8Error);
4335 }
4336
4337 // Versus multiplicity:
4338 if(!fCalculateCumulantsVsM){return;}
9da1a4f3 4339 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b3dacf6b 4340 Double_t value[4] = {0.}; // QCs vs M
4341 Double_t error[4] = {0.}; // error of QCs vs M
4342 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
4343 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
9da1a4f3 4344 for(Int_t b=1;b<=nBins;b++)
4345 {
b3dacf6b 4346 // Correlations:
9da1a4f3 4347 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
4348 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
4349 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
4350 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
b3dacf6b 4351 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
9da1a4f3 4352 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
4353 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
4354 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
4355 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
b3dacf6b 4356 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
8e1cefdd 4357 if(!fForgetAboutCovariances)
4358 {
4359 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4360 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4361 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4362 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4363 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4364 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4365 }
9da1a4f3 4366 // Q-cumulants:
4367 qc2 = 0.; // QC{2}
4368 qc4 = 0.; // QC{4}
4369 qc6 = 0.; // QC{6}
4370 qc8 = 0.; // QC{8}
b3dacf6b 4371 if(TMath::Abs(two) > 0.){qc2 = two;}
4372 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4373 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4374 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4375 // Statistical errors of Q-cumulants:
9da1a4f3 4376 qc2Error = 0.;
4377 qc4Error = 0.;
4378 qc6Error = 0.;
b3dacf6b 4379 qc8Error = 0.;
4380 // Squared statistical errors of Q-cumulants:
9da1a4f3 4381 //Double_t qc2ErrorSquared = 0.;
4382 qc4ErrorSquared = 0.;
4383 qc6ErrorSquared = 0.;
b3dacf6b 4384 qc8ErrorSquared = 0.;
4385 // Statistical error of QC{2}:
4386 qc2Error = twoError;
4387 // Statistical error of QC{4}:
9da1a4f3 4388 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4389 - 8.*two*wCov24;
4390 if(qc4ErrorSquared>0.)
4391 {
4392 qc4Error = pow(qc4ErrorSquared,0.5);
4393 } else
4394 {
4395 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 4396 }
4397 // Statistical error of QC{6}:
9da1a4f3 4398 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4399 + 81.*pow(two,2.)*pow(fourError,2.)
4400 + pow(sixError,2.)
4401 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4402 + 18.*(4.*pow(two,2.)-four)*wCov26
b3dacf6b 4403 - 18.*two*wCov46;
9da1a4f3 4404 if(qc6ErrorSquared>0.)
4405 {
4406 qc6Error = pow(qc6ErrorSquared,0.5);
4407 } else
4408 {
4409 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
b3dacf6b 4410 }
4411 // Statistical error of QC{8}:
9da1a4f3 4412 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4413 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4414 + 256.*pow(two,2.)*pow(sixError,2.)
4415 + pow(eightError,2.)
4416 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4417 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4418 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4419 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4420 + 72.*(4.*pow(two,2.)-four)*wCov48
4421 - 32.*two*wCov68;
4422 if(qc8ErrorSquared>0.)
4423 {
4424 qc8Error = pow(qc8ErrorSquared,0.5);
4425 } else
4426 {
4427 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4428 }
b3dacf6b 4429 // Store the results and statistical errors for Q-cumulants:
4430 if(TMath::Abs(qc2)>0.)
4431 {
4432 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
4433 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
4434 }
4435 if(TMath::Abs(qc4)>0.)
4436 {
4437 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
4438 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
4439 }
4440 if(TMath::Abs(qc6)>0.)
4441 {
4442 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
4443 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
4444 }
4445 if(TMath::Abs(qc8)>0.)
4446 {
4447 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
4448 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
4449 }
4450 // Rebin in M:
4451 for(Int_t co=0;co<4;co++)
4452 {
b40a910e 4453 if(fIntFlowCorrelationsVsMPro[co]->GetBinEffectiveEntries(b)<2){continue;}
b3dacf6b 4454 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
4455 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
4456 if(error[co]>0.)
4457 {
4458 dSum1[co]+=value[co]/(error[co]*error[co]);
4459 dSum2[co]+=1./(error[co]*error[co]);
4460 }
4461 } // end of for(Int_t co=0;co<4;co++)
9da1a4f3 4462 } // end of for(Int_t b=1;b<=nBins;b++)
b3dacf6b 4463 // Store rebinned Q-cumulants:
4464 for(Int_t co=0;co<4;co++)
4465 {
4466 if(dSum2[co]>0.)
4467 {
4468 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
4469 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
4470 }
4471 } // end of for(Int_t co=0;co<4;co++)
4472
489d5531 4473} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4474
489d5531 4475//================================================================================================================================
4476
b92ea2b9 4477void AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 4478{
b92ea2b9 4479 // a) Calculate the final results for reference flow estimates from Q-cumulants;
4480 // b) Propagate the statistical errors to reference flow estimates from statistical error of Q-cumulants;
0328db2d 4481 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
489d5531 4482 // Binning of fIntFlow is organized as follows:
4483 //
b3dacf6b 4484 // 1st bin: v{2,QC}
4485 // 2nd bin: v{4,QC}
4486 // 3rd bin: v{6,QC}
4487 // 4th bin: v{8,QC}
4488 //
489d5531 4489
b3dacf6b 4490 // Reference flow estimates:
489d5531 4491 Double_t v2 = 0.; // v{2,QC}
4492 Double_t v4 = 0.; // v{4,QC}
4493 Double_t v6 = 0.; // v{6,QC}
4494 Double_t v8 = 0.; // v{8,QC}
b3dacf6b 4495 // Reference flow's statistical errors:
4496 Double_t v2Error = 0.; // v{2,QC} stat. error
4497 Double_t v4Error = 0.; // v{4,QC} stat. error
4498 Double_t v6Error = 0.; // v{6,QC} stat. error
4499 Double_t v8Error = 0.; // v{8,QC} stat. error
4500
b92ea2b9 4501 // Q-cumulants:
4502 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
4503 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
4504 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
4505 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
4506 // Q-cumulants's statistical errors:
4507 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
4508 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
4509 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
4510 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
4511 // Calculate reference flow estimates from Q-cumulants:
1268c371 4512 if(qc2>=0.){v2 = pow(qc2,0.5);}
b92ea2b9 4513 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
4514 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
4515 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
4516 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 4517 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-0.5)*qc2Error;}
b92ea2b9 4518 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
4519 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
4520 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
4521 // Print warnings for the 'wrong sign' cumulants:
4522 if(TMath::Abs(v2) < 1.e-44)
4523 {
4524 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
4525 }
4526 if(TMath::Abs(v4) < 1.e-44)
4527 {
4528 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
4529 }
4530 if(TMath::Abs(v6) < 1.e-44)
4531 {
4532 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
4533 }
4534 if(TMath::Abs(v8) < 1.e-44)
4535 {
4536 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
4537 }
4538 // Store the results and statistical errors of integrated flow estimates:
4539 fIntFlow->SetBinContent(1,v2);
4540 fIntFlow->SetBinError(1,v2Error);
4541 fIntFlow->SetBinContent(2,v4);
4542 fIntFlow->SetBinError(2,v4Error);
4543 fIntFlow->SetBinContent(3,v6);
4544 fIntFlow->SetBinError(3,v6Error);
4545 fIntFlow->SetBinContent(4,v8);
4546 fIntFlow->SetBinError(4,v8Error);
4547
4548 // Versus multiplicity:
4549 if(!fCalculateCumulantsVsM){return;}
4550 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4551 for(Int_t b=1;b<=nBins;b++)
9da1a4f3 4552 {
4553 // Q-cumulants:
b92ea2b9 4554 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
4555 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
4556 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
4557 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
b3dacf6b 4558 // Q-cumulants's statistical errors:
b92ea2b9 4559 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
4560 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
4561 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
4562 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
b3dacf6b 4563 // Reference flow estimates:
b92ea2b9 4564 Double_t v2VsM = 0.; // v{2,QC}
4565 Double_t v4VsM = 0.; // v{4,QC}
4566 Double_t v6VsM = 0.; // v{6,QC}
4567 Double_t v8VsM = 0.; // v{8,QC}
4568 // Reference flow estimates errors:
4569 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
4570 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
4571 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
4572 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
b3dacf6b 4573 // Calculate reference flow estimates from Q-cumulants:
1268c371 4574 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,0.5);}
b92ea2b9 4575 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
4576 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
4577 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
b3dacf6b 4578 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 4579 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-0.5)*qc2ErrorVsM;}
b92ea2b9 4580 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
4581 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
4582 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
b3dacf6b 4583 // Store the results and statistical errors of integrated flow estimates:
b92ea2b9 4584 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
4585 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
4586 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
4587 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
4588 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
4589 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
4590 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
4591 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
4592 } // end of for(Int_t b=1;b<=nBins;b++)
4593
4594 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
4595 // Reference flow estimates:
4596 Double_t v2RebinnedInM = 0.; // v{2,QC}
4597 Double_t v4RebinnedInM = 0.; // v{4,QC}
4598 Double_t v6RebinnedInM = 0.; // v{6,QC}
4599 Double_t v8RebinnedInM = 0.; // v{8,QC}
4600 // Reference flow's statistical errors:
4601 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
4602 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
4603 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
4604 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
4605 // Q-cumulants:
4606 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
4607 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
4608 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
4609 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
4610 // Q-cumulants's statistical errors:
4611 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
4612 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
4613 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
4614 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
4615 // Calculate reference flow estimates from Q-cumulants:
1268c371 4616 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,0.5);}
b92ea2b9 4617 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
4618 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
4619 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
4620 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
1268c371 4621 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-0.5)*qc2ErrorRebinnedInM;}
b92ea2b9 4622 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
4623 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
4624 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
4625 // Print warnings for the 'wrong sign' cumulants:
4626 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
4627 {
4628 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
4629 }
4630 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
4631 {
4632 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
4633 }
4634 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
4635 {
4636 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
4637 }
4638 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
4639 {
4640 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
4641 }
4642 // Store the results and statistical errors of integrated flow estimates:
4643 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
4644 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
4645 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
4646 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
4647 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
4648 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
4649 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
4650 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
4651
4652} // end of AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
489d5531 4653
489d5531 4654//================================================================================================================================
4655
489d5531 4656void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4657{
0dd3b008 4658 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
489d5531 4659
0dd3b008 4660 // There are two possibilities here:
4661 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
4662 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
4663 // also stored in local histogram fIntFlow;
4664 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
4665 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
4666 // is also stored in local histogram fIntFlowRebinnedInM.
489d5531 4667
0dd3b008 4668 // Reference flow estimates:
4669 Double_t v[4] = {0.};
4670 // Statistical errors of reference flow estimates:
4671 Double_t vError[4] = {0.};
489d5531 4672
0dd3b008 4673 for(Int_t b=0;b<4;b++)
4674 {
4675 if(fMinimumBiasReferenceFlow)
4676 {
4677 v[b] = fIntFlow->GetBinContent(b+1);
4678 vError[b] = fIntFlow->GetBinError(b+1);
4679 } else
4680 {
4681 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
4682 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
4683 }
4684 } // end of for(Int_t b=0;b<4;b++)
4685
4686 // Fill AliFlowCommonHistResults histogram:
4687 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
4688 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
489d5531 4689 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4690 {
0dd3b008 4691 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
4692 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
489d5531 4693 }
4694
4695} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4696
489d5531 4697//================================================================================================================================
4698
489d5531 4699void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4700{
4701 // Calculate all correlations needed for integrated flow using particle weights.
4702
4703 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4704 //
4705 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4706 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4707 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4708 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4709 // 5th bin: ---- EMPTY ----
4710 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4711 // 7th bin: <3>_{3n|2n,1n} = ...
4712 // 8th bin: <3>_{4n|2n,2n} = ...
4713 // 9th bin: <3>_{4n|3n,1n} = ...
4714 // 10th bin: ---- EMPTY ----
4715 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4716 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4717 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4718 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4719 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4720 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4721 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4722 // 18th bin: ---- EMPTY ----
4723 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4724 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4725 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4726 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4727 // 23rd bin: ---- EMPTY ----
4728 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4729 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4730 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4731 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4732 // 28th bin: ---- EMPTY ----
4733 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4734 // 30th bin: ---- EMPTY ----
4735 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4736
4737 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4738 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4739
4740 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4741 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4742
4743 // multiplicity (number of particles used to determine the reaction plane)
1268c371 4744 Double_t dMult = (*fSpk)(0,0);
489d5531 4745
4746 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4747 Double_t dReQ1n1k = (*fReQ)(0,1);
4748 Double_t dReQ2n2k = (*fReQ)(1,2);
4749 Double_t dReQ3n3k = (*fReQ)(2,3);
4750 Double_t dReQ4n4k = (*fReQ)(3,4);
4751 Double_t dReQ1n3k = (*fReQ)(0,3);
4752 Double_t dImQ1n1k = (*fImQ)(0,1);
4753 Double_t dImQ2n2k = (*fImQ)(1,2);
4754 Double_t dImQ3n3k = (*fImQ)(2,3);
4755 Double_t dImQ4n4k = (*fImQ)(3,4);
4756 Double_t dImQ1n3k = (*fImQ)(0,3);
4757
4758 // dMs are variables introduced in order to simplify some Eqs. bellow:
4759 //..............................................................................................
1268c371 4760 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4761 Double_t dM22 = (*fSpk)(1,2)-(*fSpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4762 Double_t dM33 = (*fSpk)(1,3)-(*fSpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4763 Double_t dM44 = (*fSpk)(1,4)-(*fSpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4764 Double_t dM31 = (*fSpk)(0,3)*(*fSpk)(0,1)-(*fSpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j
4765 Double_t dM211 = (*fSpk)(0,2)*(*fSpk)(1,1)-2.*(*fSpk)(0,3)*(*fSpk)(0,1)
4766 - (*fSpk)(1,2)+2.*(*fSpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4767 Double_t dM1111 = (*fSpk)(3,1)-6.*(*fSpk)(0,2)*(*fSpk)(1,1)
4768 + 8.*(*fSpk)(0,3)*(*fSpk)(0,1)
4769 + 3.*(*fSpk)(1,2)-6.*(*fSpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
489d5531 4770 //..............................................................................................
4771
4772 // 2-particle correlations:
4773 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4774 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4775 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4776 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4777 if(dMult>1)
4778 {
4779 if(dM11)
4780 {
1268c371 4781 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))/dM11;
489d5531 4782 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4783 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4784 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4785 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
b40a910e 4786 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4787 // average squared correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4788 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1nW1W1*two1n1nW1W1,dM11);
489d5531 4789 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4790 }
4791 if(dM22)
4792 {
1268c371 4793 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSpk)(0,4))/dM22;
489d5531 4794 // ...
4795 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4796 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4797 }
4798 if(dM33)
4799 {
1268c371 4800 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSpk)(0,6))/dM33;
489d5531 4801 // ...
4802 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4803 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4804 }
4805 if(dM44)
4806 {
1268c371 4807 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSpk)(0,8))/dM44;
489d5531 4808 // ...
4809 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4810 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4811 }
4812 } // end of if(dMult>1)
4813
4814 // extra 2-particle correlations:
4815 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4816 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4817 if(dMult>1)
4818 {
4819 if(dM31)
4820 {
1268c371 4821 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSpk)(0,4))/dM31;
489d5531 4822 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4823 }
4824 if(dM211)
4825 {
1268c371 4826 two1n1nW1W1W2 = ((*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))
489d5531 4827 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
1268c371 4828 - (*fSpk)(0,4)))/dM211;
489d5531 4829 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4830 }
4831 } // end of if(dMult>1)
4832 //..............................................................................................
4833
4834 //..............................................................................................
4835 // 3-particle correlations:
4836 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4837
4838 if(dMult>2)
4839 {
4840 if(dM211)
4841 {
4842 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4843 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4844 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
1268c371 4845 + 2.*(*fSpk)(0,4))/dM211;
489d5531 4846 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4847 }
4848 } // end of if(dMult>2)
4849 //..............................................................................................
4850
4851 //..............................................................................................
4852 // 4-particle correlations:
4853 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4854 if(dMult>3)
4855 {
4856 if(dM1111)
4857 {
4858 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4859 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4860 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4861 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
1268c371 4862 - 4.*(*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4863 - 6.*(*fSpk)(0,4)+2.*(*fSpk)(1,2))/dM1111;
489d5531 4864
4865 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4866 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4867 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4868 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4869 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
b40a910e 4870 // average squared correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4871 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1*four1n1n1n1nW1W1W1W1,dM1111);
489d5531 4872 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4873 }
4874 } // end of if(dMult>3)
4875 //..............................................................................................
4876
4877} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4878
489d5531 4879//================================================================================================================================
4880
489d5531 4881void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4882{
4883 // Initialize all arrays used to calculate integrated flow.
4884
4885 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4886 {
4887 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
0328db2d 4888 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
489d5531 4889 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4890 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
b92ea2b9 4891 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 4892 {
4893 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
4894 }
0328db2d 4895 for(Int_t power=0;power<2;power++) // linear or quadratic
4896 {
4897 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4898 }
489d5531 4899 }
4900 for(Int_t power=0;power<2;power++) // linear or quadratic
4901 {
4902 fIntFlowSumOfEventWeights[power] = NULL;
4903 }
b3dacf6b 4904 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 4905 {
4906 fPrintFinalResults[i] = kTRUE;
4907 }
ff70ca91 4908 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4909 {
4910 fIntFlowCorrelationsVsMPro[ci] = NULL;
b40a910e 4911 fIntFlowSquaredCorrelationsVsMPro[ci] = NULL;
ff70ca91 4912 fIntFlowCorrelationsVsMHist[ci] = NULL;
4913 fIntFlowQcumulantsVsM[ci] = NULL;
4914 fIntFlowVsM[ci] = NULL;
2001bc3a 4915 fIntFlowDetectorBiasVsM[ci] = NULL;
ff70ca91 4916 for(Int_t lc=0;lc<2;lc++)
4917 {
4918 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4919 }
4920 }
4921 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4922 {
4923 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4924 fIntFlowCovariancesVsM[pi] = NULL;
4925 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4926 }
e5834fcb 4927
489d5531 4928} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4929
489d5531 4930//================================================================================================================================
4931
489d5531 4932void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4933{
4934 // Initialize all arrays needed to calculate differential flow.
4935 // a) Initialize lists holding profiles;
4936 // b) Initialize lists holding histograms;
4937 // c) Initialize event-by-event quantities;
4938 // d) Initialize profiles;
4939 // e) Initialize histograms holding final results.
4940
4941 // a) Initialize lists holding profiles;
4942 for(Int_t t=0;t<2;t++) // type (RP, POI)
4943 {
4944 for(Int_t pe=0;pe<2;pe++) // pt or eta
4945 {
4946 fDiffFlowCorrelationsProList[t][pe] = NULL;
4947 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4948 fDiffFlowCorrectionsProList[t][pe] = NULL;
4949 }
1268c371 4950 // 2D:
4951 f2DDiffFlowCorrelationsProList[t] = NULL;
489d5531 4952 }
4953
4954 // b) Initialize lists holding histograms;
4955 for(Int_t t=0;t<2;t++) // type (RP, POI)
4956 {
4957 for(Int_t pe=0;pe<2;pe++) // pt or eta
4958 {
4959 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4960 for(Int_t power=0;power<2;power++)
4961 {
4962 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
4963 } // end of for(Int_t power=0;power<2;power++)
4964 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
4965 fDiffFlowCorrectionsHistList[t][pe] = NULL;
4966 fDiffFlowCovariancesHistList[t][pe] = NULL;
4967 fDiffFlowCumulantsHistList[t][pe] = NULL;
1268c371 4968 fDiffFlowDetectorBiasHistList[t][pe] = NULL;
489d5531 4969 fDiffFlowHistList[t][pe] = NULL;
4970 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4971 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
4972
4973 // c) Initialize event-by-event quantities:
4974 // 1D:
4975 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4976 {
4977 for(Int_t pe=0;pe<2;pe++) // pt or eta
4978 {
4979 for(Int_t m=0;m<4;m++) // multiple of harmonic
4980 {
4981 for(Int_t k=0;k<9;k++) // power of weight
4982 {
4983 fReRPQ1dEBE[t][pe][m][k] = NULL;
4984 fImRPQ1dEBE[t][pe][m][k] = NULL;
4985 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4986 }
4987 }
4988 }
4989 }
4990 // 1D:
4991 for(Int_t t=0;t<2;t++) // type (RP or POI)
4992 {
4993 for(Int_t pe=0;pe<2;pe++) // pt or eta
4994 {
4995 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4996 {
4997 for(Int_t cti=0;cti<9;cti++) // correction term index
4998 {
4999 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
5000 }
5001 }
5002 }
5003 }
5004 // 2D:
5005 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5006 {
5007 for(Int_t m=0;m<4;m++) // multiple of harmonic
5008 {
5009 for(Int_t k=0;k<9;k++) // power of weight
5010 {
5011 fReRPQ2dEBE[t][m][k] = NULL;
5012 fImRPQ2dEBE[t][m][k] = NULL;
5013 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5014 }
5015 }
5016 }
5017
5018 // d) Initialize profiles:
5019 for(Int_t t=0;t<2;t++) // type: RP or POI
5020 {
5021 for(Int_t pe=0;pe<2;pe++) // pt or eta
5022 {
5023 for(Int_t ci=0;ci<4;ci++) // correlation index
5024 {
5025 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
b40a910e 5026 fDiffFlowSquaredCorrelationsPro[t][pe][ci] = NULL;
489d5531 5027 } // end of for(Int_t ci=0;ci<4;ci++)
5028 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5029 {
5030 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5031 {
5032 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
5033 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5034 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5035 // correction terms for nua:
5036 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5037 {
5038 for(Int_t cti=0;cti<9;cti++) // correction term index
5039 {
5040 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
5041 }
5042 }
5043 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1268c371 5044 for(Int_t ci=0;ci<4;ci++) // correlation index
5045 {
5046 f2DDiffFlowCorrelationsPro[t][ci] = NULL;
5047 }
489d5531 5048 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5049
5050 // e) Initialize histograms holding final results.
5051 for(Int_t t=0;t<2;t++) // type: RP or POI
5052 {
5053 for(Int_t pe=0;pe<2;pe++) // pt or eta
5054 {
5055 for(Int_t ci=0;ci<4;ci++) // correlation index
5056 {
5057 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
5058 fDiffFlowCumulants[t][pe][ci] = NULL;
1268c371 5059 fDiffFlowDetectorBias[t][pe][ci] = NULL;
489d5531 5060 fDiffFlow[t][pe][ci] = NULL;
5061 } // end of for(Int_t ci=0;ci<4;ci++)
5062 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5063 {
5064 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
5065 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5066 // correction terms for nua:
5067 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5068 {
5069 for(Int_t cti=0;cti<9;cti++) // correction term index
5070 {
5071 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
5072 }
5073 }
5074 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1268c371 5075 for(Int_t ci=0;ci<4;ci++) // correlation index
5076 {
5077 f2DDiffFlowCumulants[t][ci] = NULL;
5078 f2DDiffFlow[t][ci] = NULL;
5079 }
489d5531 5080 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5081
5082 // sum of event weights for reduced correlations:
5083 for(Int_t t=0;t<2;t++) // type = RP or POI
5084 {
5085 for(Int_t pe=0;pe<2;pe++) // pt or eta
5086 {
5087 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
5088 {
5089 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
5090 {
5091 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
5092 }
5093 }
5094 }
5095 }
5096 // product of event weights for both types of correlations:
5097 for(Int_t t=0;t<2;t++) // type = RP or POI
5098 {
5099 for(Int_t pe=0;pe<2;pe++) // pt or eta
5100 {
5101 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5102 {
5103 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5104 {
5105 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
5106 }
5107 }
5108 }
5109 }
1268c371 5110
5111} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5112
5113//================================================================================================================================
489d5531 5114
1268c371 5115void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5116{
5117 // Calculate differential flow cumulants from measured multiparticle correlations.
489d5531 5118
1268c371 5119 // REMARK: Cumulants calculated in this method are NOT corrected for non-uniform acceptance.
5120 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied
5121 // in the method CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
489d5531 5122
1268c371 5123 Int_t t = 0;
5124 Int_t pe = 0;
5125
5126 if(type == "RP")
5127 {
5128 t = 0;
5129 } else if(type == "POI")
5130 {
5131 t = 1;
5132 }
5133
5134 if(ptOrEta == "Pt")
5135 {
5136 pe = 0;
5137 } else if(ptOrEta == "Eta")
5138 {
5139 pe = 1;
5140 }
5141
5142 // Common:
5143 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 5144
1268c371 5145 // Correlation <<2>>:
5146 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5147 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
489d5531 5148
1268c371 5149 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
489d5531 5150 {
1268c371 5151 // Reduced correlations:
5152 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
5153 Double_t twoPrimeError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b); // stat. error of <<2'>>
5154 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
5155 Double_t fourPrimeError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b); // stat. error of <<4'>>
5156 // Covariances:
5157 Double_t wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b); // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
5158 Double_t wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b); // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
5159 Double_t wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b); // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
5160 // QC{2'}:
5161 Double_t qc2Prime = twoPrime; // QC{2'}
5162 Double_t qc2PrimeError = twoPrimeError; // stat. error of QC{2'}
5163 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5164 fDiffFlowCumulants[t][pe][0]->SetBinError(b,qc2PrimeError);
5165 // QC{4'}:
5166 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5167 Double_t qc4PrimeError = 0.; // stat. error of QC{4'}
5168 Double_t qc4PrimeErrorSquared = 4.*pow(twoPrime,2.)*pow(twoError,2.)
5169 + 4.*pow(two,2.)*pow(twoPrimeError,2.)
5170 + pow(fourPrimeError,2.)
5171 + 8.*two*twoPrime*wCovTwoTwoReduced
5172 - 4.*twoPrime*wCovTwoFourReduced
5173 - 4.*two*wCovTwoReducedFourReduced;
5174 if(qc4PrimeErrorSquared>0.)
5175 {
5176 qc4PrimeError = pow(qc4PrimeErrorSquared,0.5);
489d5531 5177 }
1268c371 5178 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5179 fDiffFlowCumulants[t][pe][1]->SetBinError(b,qc4PrimeError);
489d5531 5180 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 5181
1268c371 5182} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
489d5531 5183
5184//================================================================================================================================
5185
1268c371 5186void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
489d5531 5187{
1268c371 5188 // Calculate 2D differential cumulants.
489d5531 5189
1268c371 5190 // Remark: correction for detector effects and error propagation not implemented yet for 2D differential cumulants.
489d5531 5191
1268c371 5192 Int_t t = 0;
489d5531 5193
5194 if(type == "RP")
5195 {
1268c371 5196 t = 0;
489d5531 5197 } else if(type == "POI")
5198 {
1268c371 5199 t = 1;
5200 }
5201
5202 // Reference correlation <<2>>:
5203 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
489d5531 5204
1268c371 5205 // Looping over all (pt,eta) bins and calculating differential flow cumulants:
5206 for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 5207 {
5208 for(Int_t e=1;e<=fnBinsEta;e++)
5209 {
1268c371 5210 // Reduced correlations:
5211 Double_t twoPrime = f2DDiffFlowCorrelationsPro[t][0]->GetBinContent(f2DDiffFlowCorrelationsPro[t][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5212 Double_t fourPrime = f2DDiffFlowCorrelationsPro[t][1]->GetBinContent(f2DDiffFlowCorrelationsPro[t][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5213 // Cumulants:
5214 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5215 f2DDiffFlowCumulants[t][0]->SetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e),qc2Prime);
5216 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5217 f2DDiffFlowCumulants[t][1]->SetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e),qc4Prime);
489d5531 5218 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
489d5531 5219 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5220
1268c371 5221} // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
489d5531 5222
489d5531 5223//================================================================================================================================
5224
489d5531 5225void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5226{
1268c371 5227 // Calculate final results for integrated flow of RPs and POIs.
489d5531 5228
1268c371 5229 // to be improved - check if the integrated flow calculation here is actually correct
5230
5231 Int_t t = 0; // RP = 0, POI = 1
489d5531 5232
5233 if(type == "RP")
5234 {
1268c371 5235 t = 0;
489d5531 5236 } else if(type == "POI")
5237 {
1268c371 5238 t = 1;
5239 }
489d5531 5240
489d5531 5241 // pt yield:
5242 TH1F *yield2ndPt = NULL;
5243 TH1F *yield4thPt = NULL;
5244 TH1F *yield6thPt = NULL;
5245 TH1F *yield8thPt = NULL;
5246
5247 if(type == "POI")
5248 {
dd442cd2 5249 if(fFillMultipleControlHistograms)
5250 {
5251 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5252 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5253 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5254 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5255 } else
5256 {
5257 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5258 yield4thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5259 yield6thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5260 yield8thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5261 }
489d5531 5262 }
5263 else if(type == "RP")
5264 {
dd442cd2 5265 if(fFillMultipleControlHistograms)
5266 {
5267 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5268 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5269 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5270 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5271 } else
5272 {
5273 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5274 yield4thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5275 yield6thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5276 yield8thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5277 }
489d5531 5278 }
5279
0d11c335 5280 if(!yield2ndPt){return;}
5281 if(!yield4thPt){return;}
5282 if(!yield6thPt){return;}
5283 if(!yield8thPt){return;}
5284
489d5531 5285 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5286
5287 TH1D *flow2ndPt = NULL;
5288 TH1D *flow4thPt = NULL;
5289 TH1D *flow6thPt = NULL;
5290 TH1D *flow8thPt = NULL;
5291
5292 // to be improved (hardwired pt index)
5293 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5294 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5295 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5296 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
0d11c335 5297
5298 if(!flow2ndPt){return;}
5299 if(!flow4thPt){return;}
5300 if(!flow6thPt){return;}
5301 if(!flow8thPt){return;}
489d5531 5302
5303 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5304 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5305
5306 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5307 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5308
5309 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5310 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5311
5312 // looping over pt bins:
5313 for(Int_t p=1;p<nBinsPt+1;p++)
5314 {
5315 dvn2nd = flow2ndPt->GetBinContent(p);
5316 dvn4th = flow4thPt->GetBinContent(p);
5317 dvn6th = flow6thPt->GetBinContent(p);
5318 dvn8th = flow8thPt->GetBinContent(p);
5319
5320 dErrvn2nd = flow2ndPt->GetBinError(p);
5321 dErrvn4th = flow4thPt->GetBinError(p);
5322 dErrvn6th = flow6thPt->GetBinError(p);
5323 dErrvn8th = flow8thPt->GetBinError(p);
5324
5325 dYield2nd = yield2ndPt->GetBinContent(p);
5326 dYield4th = yield4thPt->GetBinContent(p);
5327 dYield6th = yield6thPt->GetBinContent(p);
5328 dYield8th = yield8thPt->GetBinContent(p);
5329
5330 dVn2nd += dvn2nd*dYield2nd;
5331 dVn4th += dvn4th*dYield4th;
5332 dVn6th += dvn6th*dYield6th;
5333 dVn8th += dvn8th*dYield8th;
5334
5335 dSum2nd += dYield2nd;
5336 dSum4th += dYield4th;
5337 dSum6th += dYield6th;
5338 dSum8th += dYield8th;
5339
5340 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5341 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5342 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5343 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5344
5345 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5346
5347 // normalizing the results for integrated flow:
5348 if(dSum2nd)
5349 {
5350 dVn2nd /= dSum2nd;
5351 dErrVn2nd /= (dSum2nd*dSum2nd);
5352 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5353 }
5354 if(dSum4th)
5355 {
5356 dVn4th /= dSum4th;
5357 dErrVn4th /= (dSum4th*dSum4th);
5358 dErrVn4th = TMath::Sqrt(dErrVn4th);
5359 }
5360 //if(dSum6th) dVn6th/=dSum6th;
5361 //if(dSum8th) dVn8th/=dSum8th;
5362
5363 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5364 if(type == "POI")
5365 {
5366 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5367 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5368 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5369 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5370 }
5371 else if (type == "RP")
5372 {
5373 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5374 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5375 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5376 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5377 }
5378
5379 delete flow2ndPt;
5380 delete flow4thPt;
5381 //delete flow6thPt;
5382 //delete flow8thPt;
5383
5384 delete yield2ndPt;
5385 delete yield4thPt;
5386 delete yield6thPt;
5387 delete yield8thPt;
5388
5389} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5390
489d5531 5391//================================================================================================================================
5392
489d5531 5393void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5394{
5395 // Initialize all arrays used for distributions.
5396
5397 // a) Initialize arrays of histograms used to hold distributions of correlations;
5398 // b) Initialize array to hold min and max values of correlations.
5399
5400 // a) Initialize arrays of histograms used to hold distributions of correlations:
5401 for(Int_t di=0;di<4;di++) // distribution index
5402 {
5403 fDistributions[di] = NULL;
5404 }
5405
5406 // b) Initialize default min and max values of correlations:
5407 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5408 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5409 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5410 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5411 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5412 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5413 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5414 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5415 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5416
5417} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5418
489d5531 5419//================================================================================================================================
5420
e5834fcb 5421void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5422{
5423 // Initialize all arrays used for various unclassified objects.
5424
5425 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
5426 {
5427 fPhiDistributionForOneEventSettings[p] = 0.;
5428 }
5429
5430} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5431
5432//================================================================================================================================
489d5531 5433
5434void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5435{
5436 // a) Book profile to hold all flags for distributions of correlations;
5437 // b) Book all histograms to hold distributions of correlations.
5438
5439 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5440
5441 // a) Book profile to hold all flags for distributions of correlations:
5442 TString distributionsFlagsName = "fDistributionsFlags";
5443 distributionsFlagsName += fAnalysisLabel->Data();
5444 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5445 fDistributionsFlags->SetTickLength(-0.01,"Y");
5446 fDistributionsFlags->SetMarkerStyle(25);
5447 fDistributionsFlags->SetLabelSize(0.05);
5448 fDistributionsFlags->SetLabelOffset(0.02,"Y");
5449 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
5450 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
5451 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
5452 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
5453 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
5454 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
5455 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
5456 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
5457 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
5458 fDistributionsList->Add(fDistributionsFlags);
5459
5460 // b) Book all histograms to hold distributions of correlations.
5461 if(fStoreDistributions)
5462 {
5463 TString distributionsName = "fDistributions";
5464 distributionsName += fAnalysisLabel->Data();
5465 for(Int_t di=0;di<4;di++) // distribution index
5466 {
5467 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
5468 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
5469 fDistributionsList->Add(fDistributions[di]);
5470 } // end of for(Int_t di=0;di<4;di++) // distribution index
5471 } // end of if(fStoreDistributions)
5472
5473} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5474
489d5531 5475//================================================================================================================================
5476
e5834fcb 5477void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
5478{
5479 // Book all objects for various unclassified quantities.
5480
5481 if(!fStorePhiDistributionForOneEvent){return;}
5482
5483 // a) Book histogram holding phi distribution for single event to illustrate flow.
5484
5485 // a) Book histogram holding phi distribution for single event to illustrate flow:
5486 fPhiDistributionForOneEvent = new TH1D("fPhiDistributionForOneEvent","",360,0.,TMath::TwoPi());
5487 fPhiDistributionForOneEvent->GetXaxis()->SetTitle("#phi");
5488 fVariousList->Add(fPhiDistributionForOneEvent);
5489
5490} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
5491
5492//================================================================================================================================
489d5531 5493
5494void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5495{
5496 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
5497
5498 if(!fDistributionsFlags)
5499 {
5500 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
5501 exit(0);
5502 }
5503
5504 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
5505 // store min and max values of correlations:
5506 for(Int_t di=0;di<4;di++) // distribution index
5507 {
5508 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
5509 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
5510 }
5511
5512} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5513
489d5531 5514//================================================================================================================================
5515
489d5531 5516void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5517{
5518 // Store distributions of correlations.
5519
5520 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
5521 {
5522 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
5523 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
5524 exit(0);
5525 }
5526
5527 for(Int_t di=0;di<4;di++) // distribution index
5528 {
5529 if(!fDistributions[di])
5530 {
5531 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
5532 cout<<"di = "<<di<<endl;
5533 exit(0);
5534 } else
5535 {
5536 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
5537 }
5538 } // end of for(Int_t di=0;di<4;di++) // distribution index
5539
5540} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5541
489d5531 5542//================================================================================================================================
5543
489d5531 5544void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5545{
5546 // Book and nest all lists nested in the base list fHistList.
5547 // a) Book and nest lists for integrated flow;
5548 // b) Book and nest lists for differential flow;
5549 // c) Book and nest list for particle weights;
5550 // d) Book and nest list for distributions;
e5834fcb 5551 // e) Book and nest list for various unclassified objects;
5552 // f) Book and nest list for nested loops.
489d5531 5553
5554 // a) Book and nest all lists for integrated flow:
1268c371 5555 // Base list for integrated flow:
489d5531 5556 fIntFlowList = new TList();
5557 fIntFlowList->SetName("Integrated Flow");
5558 fIntFlowList->SetOwner(kTRUE);
5559 fHistList->Add(fIntFlowList);
1268c371 5560 // List holding profiles:
489d5531 5561 fIntFlowProfiles = new TList();
5562 fIntFlowProfiles->SetName("Profiles");
5563 fIntFlowProfiles->SetOwner(kTRUE);
5564 fIntFlowList->Add(fIntFlowProfiles);
1268c371 5565 // List holding histograms with results:
489d5531 5566 fIntFlowResults = new TList();
5567 fIntFlowResults->SetName("Results");
5568 fIntFlowResults->SetOwner(kTRUE);
5569 fIntFlowList->Add(fIntFlowResults);
5570
1268c371 5571 // b) Book and nest lists for differential flow:
5572 this->BookAndNestListsForDifferentialFlow();
5573
5574 // c) Book and nest list for particle weights:
5575 fWeightsList->SetName("Weights");
5576 fWeightsList->SetOwner(kTRUE);
5577 fHistList->Add(fWeightsList);
5578
5579 // d) Book and nest list for distributions:
5580 fDistributionsList = new TList();
5581 fDistributionsList->SetName("Distributions");
5582 fDistributionsList->SetOwner(kTRUE);
5583 fHistList->Add(fDistributionsList);
5584
5585 // e) Book and nest list for various unclassified objects:
5586 if(fStorePhiDistributionForOneEvent)
5587 {
5588 fVariousList = new TList();
5589 fVariousList->SetName("Various");
5590 fVariousList->SetOwner(kTRUE);
5591 fHistList->Add(fVariousList);
5592 }
5593
5594 // f) Book and nest list for nested loops:
5595 fNestedLoopsList = new TList();
5596 fNestedLoopsList->SetName("Nested Loops");
5597 fNestedLoopsList->SetOwner(kTRUE);
5598 fHistList->Add(fNestedLoopsList);
5599
5600} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5601
5602//================================================================================================================================
5603
5604void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
5605{
5606 // Book and nest lists for differential flow.
5607
5608 // Base list for differential flow objects:
489d5531 5609 fDiffFlowList = new TList();
5610 fDiffFlowList->SetName("Differential Flow");
5611 fDiffFlowList->SetOwner(kTRUE);
5612 fHistList->Add(fDiffFlowList);
1268c371 5613
5614 // Local flags:
5615 TString typeFlag[2] = {"RP","POI"};
5616 TString ptEtaFlag[2] = {"p_{T}","#eta"};
5617 TString powerFlag[2] = {"linear","quadratic"};
5618
5619 // 2D:
5620 if(fCalculate2DDiffFlow)
5621 {
5622 fDiffFlow2D = new TList();
5623 fDiffFlow2D->SetName("2D");
5624 fDiffFlow2D->SetOwner(kTRUE);
5625 fDiffFlowList->Add(fDiffFlow2D);
5626 for(Int_t t=0;t<2;t++)
5627 {
5628 f2DDiffFlowCorrelationsProList[t] = new TList();
5629 f2DDiffFlowCorrelationsProList[t]->SetOwner(kTRUE);
5630 f2DDiffFlowCorrelationsProList[t]->SetName(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data()));
5631 fDiffFlow2D->Add(f2DDiffFlowCorrelationsProList[t]);
5632 } // end of for(Int_t t=0;t<2;t++)
5633 } // end of if(fCalculate2DDiffFlow)
5634
5635 // What follows bellow in this method is relevant only for 1D differential flow:
5636 if(!fCalculateDiffFlow){return;}
5637
5638 // List holding profiles:
489d5531 5639 fDiffFlowProfiles = new TList();
5640 fDiffFlowProfiles->SetName("Profiles");
5641 fDiffFlowProfiles->SetOwner(kTRUE);
5642 fDiffFlowList->Add(fDiffFlowProfiles);
1268c371 5643 // List holding histograms with results:
489d5531 5644 fDiffFlowResults = new TList();
5645 fDiffFlowResults->SetName("Results");
5646 fDiffFlowResults->SetOwner(kTRUE);
5647 fDiffFlowList->Add(fDiffFlowResults);
1268c371 5648 // Flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
489d5531 5649 TList list;
5650 list.SetOwner(kTRUE);
1268c371 5651 // Nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
489d5531 5652 for(Int_t t=0;t<2;t++) // type: RP or POI
5653 {
5654 for(Int_t pe=0;pe<2;pe++) // pt or eta
5655 {
5656 // list holding profiles with correlations:
5657 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
5658 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5659 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
5660 // list holding profiles with products of correlations:
5661 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
5662 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5663 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
5664 // list holding profiles with corrections:
5665 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
5666 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5667 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
5668 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5669 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5670 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
5671 for(Int_t t=0;t<2;t++) // type: RP or POI
5672 {
5673 for(Int_t pe=0;pe<2;pe++) // pt or eta
5674 {
5675 // list holding histograms with correlations:
5676 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
5677 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5678 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
5679 // list holding histograms with corrections:
5680 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
5681 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5682 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
5683 for(Int_t power=0;power<2;power++)
5684 {
5685 // list holding histograms with sums of event weights:
5686 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
5687 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5688 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
5689 } // end of for(Int_t power=0;power<2;power++)
5690 // list holding histograms with sums of products of event weights:
5691 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
5692 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5693 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
5694 // list holding histograms with covariances of correlations:
5695 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
5696 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5697 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
5698 // list holding histograms with differential Q-cumulants:
5699 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
5700 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5701 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
1268c371 5702 // list holding histograms which quantify detector bias to differential Q-cumulants:
5703 fDiffFlowDetectorBiasHistList[t][pe] = (TList*)list.Clone();
5704 fDiffFlowDetectorBiasHistList[t][pe]->SetName(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5705 fDiffFlowResults->Add(fDiffFlowDetectorBiasHistList[t][pe]);
489d5531 5706 // list holding histograms with differential flow estimates from Q-cumulants:
5707 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
5708 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5709 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
5710 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5711 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5712
1268c371 5713} // end of void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
489d5531 5714
5715//================================================================================================================================
5716
489d5531 5717void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
5718{
1268c371 5719 // Fill common result histograms for differential flow.
489d5531 5720
1268c371 5721 Int_t t = 0;
489d5531 5722
5723 if(type == "RP")
5724 {
1268c371 5725 t = 0;
489d5531 5726 } else if(type == "POI")
5727 {
1268c371 5728 t = 1;
489d5531 5729 }
1268c371 5730
5731 // to be improved - check all pointers used in this method
489d5531 5732
5733 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
5734 {
5735 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
5736 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5737 exit(0);
5738 }
5739
5740 // pt:
5741 for(Int_t p=1;p<=fnBinsPt;p++)
5742 {
5743 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
5744 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
5745 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
5746 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
5747
5748 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
5749 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
5750 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
5751 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
5752
5753 if(type == "RP")
5754 {
5755 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
5756 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
5757 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
5758 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
5759 } else if(type == "POI")
5760 {
5761 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
5762 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
5763 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
5764 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
5765 }
5766 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5767
5768 // eta:
5769 for(Int_t e=1;e<=fnBinsEta;e++)
5770 {
5771 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
5772 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
5773 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
5774 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
5775
5776 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
5777 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
5778 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
5779 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
5780
5781 if(type == "RP")
5782 {
5783 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
5784 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
5785 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
5786 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
5787 } else if(type == "POI")
5788 {
5789 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
5790 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
5791 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
5792 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
5793 }
5794 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5795
5796} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5797
489d5531 5798//================================================================================================================================
5799
1268c371 5800void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
489d5531 5801{
1268c371 5802 // Access and store common constants.
5803
5804 // a) If this method was called in Init() access common constants from AliFlowCommonConstants;
5805 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a);
5806 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b).
5807
5808 if(method == "Init")
5809 {
5810 // a) If this method was called in Init() access common constants from AliFlowCommonConstants:
5811 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
5812 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
5813 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
5814 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
5815 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
5816 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
5817 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
5818 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
5819 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
5820 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
5821 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
5822 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
5823
5824 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a):
5825 TString fCommonConstantsName = "fCommonConstants";
5826 fCommonConstantsName += fAnalysisLabel->Data();
5827 fCommonConstants = new TProfile(fCommonConstantsName.Data(),"Common constants",9,0.,9.);
5828 fCommonConstants->SetLabelSize(0.05);
5829 fCommonConstants->GetXaxis()->SetBinLabel(1,"nBins (#phi)");
5830 fCommonConstants->Fill(0.5,fnBinsPhi);
5831 fCommonConstants->GetXaxis()->SetBinLabel(2,"#phi_{min}");
5832 fCommonConstants->Fill(1.5,fPhiMin);
5833 fCommonConstants->GetXaxis()->SetBinLabel(3,"#phi_{max}");
5834 fCommonConstants->Fill(2.5,fPhiMax);
5835 fCommonConstants->GetXaxis()->SetBinLabel(4,"nBins (p_{t})");
5836 fCommonConstants->Fill(3.5,fnBinsPt);
5837 fCommonConstants->GetXaxis()->SetBinLabel(5,"(p_{t})_{min}");
5838 fCommonConstants->Fill(4.5,fPtMin);
5839 fCommonConstants->GetXaxis()->SetBinLabel(6,"(p_{t})_{max}");
5840 fCommonConstants->Fill(5.5,fPtMax);
5841 fCommonConstants->GetXaxis()->SetBinLabel(7,"nBins (#eta)");
5842 fCommonConstants->Fill(6.5,fnBinsEta);
5843 fCommonConstants->GetXaxis()->SetBinLabel(8,"#eta_{min}");
5844 fCommonConstants->Fill(7.5,fEtaMin);
5845 fCommonConstants->GetXaxis()->SetBinLabel(9,"#eta_{max}");
5846 fCommonConstants->Fill(8.5,fEtaMax);
5847 fHistList->Add(fCommonConstants);
5848 } // end of if(method == "Init")
5849 else if(method == "Finish")
5850 {
5851 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b):
5852 if(!fCommonConstants)
5853 {
5854 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::AC(\"%s\") !!!!\n\n",method.Data());
5855 exit(0);
5856 }
5857 fnBinsPhi = (Int_t)fCommonConstants->GetBinContent(1);
5858 fPhiMin = fCommonConstants->GetBinContent(2);
5859 fPhiMax = fCommonConstants->GetBinContent(3);
5860 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
5861 fnBinsPt = (Int_t)fCommonConstants->GetBinContent(4);
5862 fPtMin = fCommonConstants->GetBinContent(5);
5863 fPtMax = fCommonConstants->GetBinContent(6);
5864 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
5865 fnBinsEta = (Int_t)fCommonConstants->GetBinContent(7);
5866 fEtaMin = fCommonConstants->GetBinContent(8);
5867 fEtaMax = fCommonConstants->GetBinContent(9);
5868 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
5869 } // end of else if(method == "Finish")
5870
5871} // end of void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
489d5531 5872
489d5531 5873//================================================================================================================================
5874
489d5531 5875void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
5876{
1268c371 5877 // a) Cross check if the choice for multiplicity weights make sense.
489d5531 5878
5879 // a) Cross check if the choice for multiplicity weights make sense:
5880 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
5881 strcmp(fMultiplicityWeight->Data(),"unit") &&
5882 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
5883 {
5884 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
5885 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
5886 exit(0);
5887 }
5888
5889} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
5890
489d5531 5891//================================================================================================================================
5892
489d5531 5893void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
5894{
0328db2d 5895 // Calculate sum of linear and quadratic event weights for correlations.
2001bc3a 5896
5897 // multiplicity:
1268c371 5898 Double_t dMult = (*fSpk)(0,0);
9f33751d 5899
489d5531 5900 for(Int_t p=0;p<2;p++) // power-1
5901 {
5902 for(Int_t ci=0;ci<4;ci++) // correlation index
5903 {
5904 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
b3dacf6b 5905 if(fCalculateCumulantsVsM)
5906 {
5907 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
5908 }
489d5531 5909 }
5910 }
5911
5912} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
5913
489d5531 5914//================================================================================================================================
5915
0328db2d 5916void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 5917{
0328db2d 5918 // Calculate sum of linear and quadratic event weights for NUA terms.
5919
5920 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
489d5531 5921 {
0328db2d 5922 for(Int_t p=0;p<2;p++) // power-1
5923 {
b92ea2b9 5924 for(Int_t ci=0;ci<4;ci++) // nua term index
0328db2d 5925 {
5926 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
489d5531 5927 }
0328db2d 5928 }
5929 }
5930
5931} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 5932
0328db2d 5933//================================================================================================================================
5934
0328db2d 5935void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
5936{
ff70ca91 5937 // Calculate sum of product of event weights for correlations.
2001bc3a 5938
5939 // multiplicity:
1268c371 5940 Double_t dMult = (*fSpk)(0,0);
2001bc3a 5941
489d5531 5942 Int_t counter = 0;
5943
5944 for(Int_t ci1=1;ci1<4;ci1++)
5945 {
5946 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
5947 {
ff70ca91 5948 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
5949 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
b3dacf6b 5950 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
5951 if(fCalculateCumulantsVsM)
5952 {
5953 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
5954 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
5955 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
5956 } // end of if(fCalculateCumulantsVsM)
ff70ca91 5957 counter++;
489d5531 5958 }
5959 }
5960
0328db2d 5961} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
5962
0328db2d 5963//================================================================================================================================
5964
0328db2d 5965void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
5966{
5967 // Calculate sum of product of event weights for NUA terms.
5968
5969 // w_{<2>} * w_{<cos(#phi)>}:
5970 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5971 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
5972 // w_{<2>} * w_{<sin(#phi)>}:
5973 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5974 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
5975 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
5976 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
5977 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
5978 // w_{<2>} * w{<cos(phi1+phi2)>}
5979 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5980 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
5981 // w_{<2>} * w{<sin(phi1+phi2)>}
5982 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5983 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
5984 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
5985 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5986 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
5987 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
5988 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5989 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5990 // w_{<4>} * w{<cos(phi1)>}
5991 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5992 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
5993 // w_{<4>} * w{<sin(phi1)>}
5994 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5995 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
5996 // w_{<4>} * w{<cos(phi1+phi2)>}
5997 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5998 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
5999 // w_{<4>} * w{<sin(phi1+phi2)>}
6000 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6001 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6002 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6003 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6004 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6005 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6006 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6007 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6008 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6009 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6010 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6011 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6012 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6013 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6014 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6015 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6016 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6017 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6018 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6019 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6020 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6021 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6022 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6023 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6024 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6025 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6026 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6027 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6028 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6029 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6030 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6031 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6032 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6033 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6034 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6035 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6036 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6037 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6038 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6039 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6040 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6041 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6042 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6043 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6044 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6045 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6046 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6047 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6048 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6049 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6050
6051} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
489d5531 6052
489d5531 6053//================================================================================================================================
6054
489d5531 6055void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6056{
1268c371 6057 // Calculate reduced correlations for RPs or POIs for all pt and eta bins.
489d5531 6058
1268c371 6059 // Multiplicity:
6060 Double_t dMult = (*fSpk)(0,0);
489d5531 6061
6062 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6063 Double_t dReQ1n = (*fReQ)(0,0);
6064 Double_t dReQ2n = (*fReQ)(1,0);
6065 //Double_t dReQ3n = (*fReQ)(2,0);
6066 //Double_t dReQ4n = (*fReQ)(3,0);
6067 Double_t dImQ1n = (*fImQ)(0,0);
6068 Double_t dImQ2n = (*fImQ)(1,0);
6069 //Double_t dImQ3n = (*fImQ)(2,0);
6070 //Double_t dImQ4n = (*fImQ)(3,0);
6071
6072 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6073 //
6074 // 0: <<2'>>
6075 // 1: <<4'>>
6076 // 2: <<6'>>
6077 // 3: <<8'>>
6078
2a98ceb8 6079 Int_t t = 0; // type flag
6080 Int_t pe = 0; // ptEta flag
489d5531 6081
6082 if(type == "RP")
6083 {
6084 t = 0;
6085 } else if(type == "POI")
6086 {
6087 t = 1;
6088 }
6089
6090 if(ptOrEta == "Pt")
6091 {
6092 pe = 0;
6093 } else if(ptOrEta == "Eta")
6094 {
6095 pe = 1;
6096 }
6097
6098 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6099 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6100 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6101 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6102
6103 // looping over all bins and calculating reduced correlations:
6104 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6105 {
6106 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6107 Double_t p1n0kRe = 0.;
6108 Double_t p1n0kIm = 0.;
6109
6110 // number of POIs in particular pt or eta bin:
6111 Double_t mp = 0.;
6112
6113 // 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):
6114 Double_t q1n0kRe = 0.;
6115 Double_t q1n0kIm = 0.;
6116 Double_t q2n0kRe = 0.;
6117 Double_t q2n0kIm = 0.;
6118
6119 // number of particles which are both RPs and POIs in particular pt or eta bin:
6120 Double_t mq = 0.;
6121
6122 if(type == "POI")
6123 {
6124 // q_{m*n,0}:
6125 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6126 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6127 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6128 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6129 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6130 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6131 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6132 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6133
6134 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6135 }
6136 else if(type == "RP")
6137 {
6138 // q_{m*n,0}:
6139 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6140 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6141 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6142 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6143 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6144 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6145 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6146 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6147
6148 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6149 }
6150
6151 if(type == "POI")
6152 {
6153 // p_{m*n,0}:
6154 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6155 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6156 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6157 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6158
6159 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6160
6161 t = 1; // typeFlag = RP or POI
6162 }
6163 else if(type == "RP")
6164 {
6165 // p_{m*n,0} = q_{m*n,0}:
6166 p1n0kRe = q1n0kRe;
6167 p1n0kIm = q1n0kIm;
6168
6169 mp = mq;
6170
6171 t = 0; // typeFlag = RP or POI
6172 }
6173
1268c371 6174 // 2'-particle correlation for particular pt or eta bin:
489d5531 6175 Double_t two1n1nPtEta = 0.;
b40a910e 6176 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
489d5531 6177 if(mp*dMult-mq)
6178 {
6179 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6180 / (mp*dMult-mq);
b40a910e 6181 // determine multiplicity weight:
6182 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6183 {
6184 mWeight2pPrime = mp*dMult-mq;
6185 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6186 {
6187 mWeight2pPrime = 1.;
6188 }
489d5531 6189 if(type == "POI") // to be improved (I do not this if)
6190 {
6191 // fill profile to get <<2'>> for POIs
b40a910e 6192 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6193 // fill profile to get <<2'>^2> for POIs
6194 fDiffFlowSquaredCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
489d5531 6195 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6196 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
b40a910e 6197 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mWeight2pPrime);
489d5531 6198 }
6199 else if(type == "RP") // to be improved (I do not this if)
6200 {
6201 // profile to get <<2'>> for RPs:
b40a910e 6202 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6203 // profile to get <<2'>^2> for RPs:
6204 fDiffFlowSquaredCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
489d5531 6205 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6206 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
b40a910e 6207 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mWeight2pPrime);
489d5531 6208 }
6209 } // end of if(mp*dMult-mq)
6210
6211 // 4'-particle correlation:
6212 Double_t four1n1n1n1nPtEta = 0.;
b40a910e 6213 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
489d5531 6214 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6215 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6216 {
6217 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6218 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6219 - 2.*q2n0kIm*dReQ1n*dImQ1n
6220 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6221 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6222 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6223 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6224 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6225 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6226 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6227 + 2.*mq*dMult
6228 - 6.*mq)
6229 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6230 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
b40a910e 6231 // determine multiplicity weight:
6232 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6233 {
6234 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6235 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6236 {
6237 mWeight4pPrime = 1.;
6238 }
489d5531 6239 if(type == "POI")
6240 {
6241 // profile to get <<4'>> for POIs:
b40a910e 6242 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6243 // profile to get <<4'>^2> for POIs:
6244 fDiffFlowSquaredCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
489d5531 6245 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6246 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
b40a910e 6247 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,mWeight4pPrime);
489d5531 6248 }
6249 else if(type == "RP")
6250 {
6251 // profile to get <<4'>> for RPs:
b40a910e 6252 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6253 // profile to get <<4'>^2> for RPs:
6254 fDiffFlowSquaredCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
489d5531 6255 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6256 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
b40a910e 6257 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,mWeight4pPrime);
489d5531 6258 }
6259 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6260 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6261
6262 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6263
6264
6265} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6266
489d5531 6267//================================================================================================================================
6268
1268c371 6269void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
6270{
6271 // Calculate all reduced correlations needed for 2D differential flow for each (pt,eta) bin.
6272
6273 // Multiplicity:
6274 Double_t dMult = (*fSpk)(0,0);
6275 // Real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6276 Double_t dReQ1n = (*fReQ)(0,0);
6277 Double_t dReQ2n = (*fReQ)(1,0);
6278 //Double_t dReQ3n = (*fReQ)(2,0);
6279 //Double_t dReQ4n = (*fReQ)(3,0);
6280 Double_t dImQ1n = (*fImQ)(0,0);
6281 Double_t dImQ2n = (*fImQ)(1,0);
6282 //Double_t dImQ3n = (*fImQ)(2,0);
6283 //Double_t dImQ4n = (*fImQ)(3,0);
6284
6285 // 2D reduced correlations are stored in TProfile2D f2DDiffFlowCorrelationsPro[0=RP,1=POI][correlation index].
6286 // Correlation index runs as follows:
6287 // 0: <<2'>>
6288 // 1: <<4'>>
6289 // 2: <<6'>>
6290 // 3: <<8'>>
6291
6292 Int_t t = 0; // type flag
6293 if(type == "RP")
6294 {
6295 t = 0;
6296 } else if(type == "POI")
6297 {
6298 t = 1;
6299 }
6300
6301 // Looping over all (pt,eta) bins and calculating correlations needed for differential flow:
6302 for(Int_t p=1;p<=fnBinsPt;p++)
6303 {
6304 for(Int_t e=1;e<=fnBinsEta;e++)
6305 {
6306 // Real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
6307 Double_t p1n0kRe = 0.;
6308 Double_t p1n0kIm = 0.;
6309 // Number of POIs in particular pt or eta bin:
6310 Double_t mp = 0.;
6311 // Real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for 'RP && POI particles' in particular pt or eta bin):
6312 Double_t q1n0kRe = 0.;
6313 Double_t q1n0kIm = 0.;
6314 Double_t q2n0kRe = 0.;
6315 Double_t q2n0kIm = 0.;
6316 // Number of 'RP && POI particles' in particular pt or eta bin:
6317 Double_t mq = 0.;
6318 if(type == "POI")
6319 {
6320 // q_{m*n,0}:
6321 q1n0kRe = fReRPQ2dEBE[2][0][0]->GetBinContent(fReRPQ2dEBE[2][0][0]->GetBin(p,e))
6322 * fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e));
6323 q1n0kIm = fImRPQ2dEBE[2][0][0]->GetBinContent(fImRPQ2dEBE[2][0][0]->GetBin(p,e))
6324 * fImRPQ2dEBE[2][0][0]->GetBinEntries(fImRPQ2dEBE[2][0][0]->GetBin(p,e));
6325 q2n0kRe = fReRPQ2dEBE[2][1][0]->GetBinContent(fReRPQ2dEBE[2][1][0]->GetBin(p,e))
6326 * fReRPQ2dEBE[2][1][0]->GetBinEntries(fReRPQ2dEBE[2][1][0]->GetBin(p,e));
6327 q2n0kIm = fImRPQ2dEBE[2][1][0]->GetBinContent(fImRPQ2dEBE[2][1][0]->GetBin(p,e))
6328 * fImRPQ2dEBE[2][1][0]->GetBinEntries(fImRPQ2dEBE[2][1][0]->GetBin(p,e));
6329 // m_{q}:
6330 mq = fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6331 } // end of if(type == "POI")
6332 else if(type == "RP")
6333 {
6334 // q_{m*n,0}:
6335 q1n0kRe = fReRPQ2dEBE[0][0][0]->GetBinContent(fReRPQ2dEBE[0][0][0]->GetBin(p,e))
6336 * fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e));
6337 q1n0kIm = fImRPQ2dEBE[0][0][0]->GetBinContent(fImRPQ2dEBE[0][0][0]->GetBin(p,e))
6338 * fImRPQ2dEBE[0][0][0]->GetBinEntries(fImRPQ2dEBE[0][0][0]->GetBin(p,e));
6339 q2n0kRe = fReRPQ2dEBE[0][1][0]->GetBinContent(fReRPQ2dEBE[0][1][0]->GetBin(p,e))
6340 * fReRPQ2dEBE[0][1][0]->GetBinEntries(fReRPQ2dEBE[0][1][0]->GetBin(p,e));
6341 q2n0kIm = fImRPQ2dEBE[0][1][0]->GetBinContent(fImRPQ2dEBE[0][1][0]->GetBin(p,e))
6342 * fImRPQ2dEBE[0][1][0]->GetBinEntries(fImRPQ2dEBE[0][1][0]->GetBin(p,e));
6343 // m_{q}:
6344 mq = fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6345 } // end of else if(type == "RP")
6346 if(type == "POI")
6347 {
6348 // p_{m*n,0}:
6349 p1n0kRe = fReRPQ2dEBE[1][0][0]->GetBinContent(fReRPQ2dEBE[1][0][0]->GetBin(p,e))
6350 * fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e));
6351 p1n0kIm = fImRPQ2dEBE[1][0][0]->GetBinContent(fImRPQ2dEBE[1][0][0]->GetBin(p,e))
6352 * fImRPQ2dEBE[1][0][0]->GetBinEntries(fImRPQ2dEBE[1][0][0]->GetBin(p,e));
6353 // m_{p}
6354 mp = fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6355
6356 t = 1; // typeFlag = RP or POI
6357 } // end of if(type == "POI")
6358 else if(type == "RP")
6359 {
6360 // p_{m*n,0} = q_{m*n,0}:
6361 p1n0kRe = q1n0kRe;
6362 p1n0kIm = q1n0kIm;
6363 // m_{p} = m_{q}:
6364 mp = mq;
6365
6366 t = 0; // typeFlag = RP or POI
6367 } // end of if(type == "RP")
6368
6369 // 2'-particle correlation for particular (pt,eta) bin:
6370 Double_t two1n1nPtEta = 0.;
6371 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
6372 if(mp*dMult-mq)
6373 {
6374 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6375 / (mp*dMult-mq);
6376 // Determine multiplicity weight:
6377 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6378 {
6379 mWeight2pPrime = mp*dMult-mq;
6380 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6381 {
6382 mWeight2pPrime = 1.;
6383 }
6384 // Fill 2D profile holding <<2'>>:
6385 f2DDiffFlowCorrelationsPro[t][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mWeight2pPrime);
6386 } // end of if(mp*dMult-mq)
6387
6388 // 4'-particle correlation:
6389 Double_t four1n1n1n1nPtEta = 0.;
6390 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
6391 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6392 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6393 {
6394 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6395 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6396 - 2.*q2n0kIm*dReQ1n*dImQ1n
6397 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6398 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6399 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6400 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6401 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6402 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6403 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6404 + 2.*mq*dMult
6405 - 6.*mq)
6406 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6407 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6408 // Determine multiplicity weight:
6409 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6410 {
6411 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6412 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6413 {
6414 mWeight4pPrime = 1.;
6415 }
6416 // Fill 2D profile holding <<4'>>:
6417 f2DDiffFlowCorrelationsPro[t][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,mWeight4pPrime);
6418 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6419 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6420 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6421 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6422
6423} // end of AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
6424
6425//================================================================================================================================
6426
489d5531 6427void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6428{
6429 // Calculate sums of various event weights for reduced correlations.
6430 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6431
2a98ceb8 6432 Int_t typeFlag = 0;
6433 Int_t ptEtaFlag = 0;
489d5531 6434
6435 if(type == "RP")
6436 {
6437 typeFlag = 0;
6438 } else if(type == "POI")
6439 {
6440 typeFlag = 1;
6441 }
6442
6443 if(ptOrEta == "Pt")
6444 {
6445 ptEtaFlag = 0;
6446 } else if(ptOrEta == "Eta")
6447 {
6448 ptEtaFlag = 1;
6449 }
6450
6451 // shortcuts:
6452 Int_t t = typeFlag;
6453 Int_t pe = ptEtaFlag;
6454
6455 // binning:
6456 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6457 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6458 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6459 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6460
6461 for(Int_t rpq=0;rpq<3;rpq++)
6462 {
6463 for(Int_t m=0;m<4;m++)
6464 {
6465 for(Int_t k=0;k<9;k++)
6466 {
6467 if(!fReRPQ1dEBE[rpq][pe][m][k])
6468 {
6469 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6470 cout<<"pe = "<<pe<<endl;
6471 cout<<"rpq = "<<rpq<<endl;
6472 cout<<"m = "<<m<<endl;
6473 cout<<"k = "<<k<<endl;
6474 exit(0);
6475 }
6476 }
6477 }
6478 }
6479
6480 // multiplicities:
1268c371 6481 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
489d5531 6482 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6483 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6484 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6485
6486 // event weights for reduced correlations:
6487 Double_t dw2 = 0.; // event weight for <2'>
6488 Double_t dw4 = 0.; // event weight for <4'>
6489 //Double_t dw6 = 0.; // event weight for <6'>
6490 //Double_t dw8 = 0.; // event weight for <8'>
6491
6492 // looping over bins:
6493 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6494 {
6495 if(type == "RP")
6496 {
6497 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6498 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6499 } else if(type == "POI")
6500 {
6501 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6502 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6503 }
6504
6505 // event weight for <2'>:
6506 dw2 = mp*dMult-mq;
6507 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6508 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6509
6510 // event weight for <4'>:
6511 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6512 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6513 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6514 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6515
6516 // event weight for <6'>:
6517 //dw6 = ...;
6518 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6519 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6520
6521 // event weight for <8'>:
6522 //dw8 = ...;
6523 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6524 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6525 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6526
6527} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6528
6529
6530//================================================================================================================================
6531
6532
6533void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6534{
6535 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6536 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6537 //
6538 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6539 // 1.) i<j
6540 // 2.) do not store terms which DO NOT include reduced correlations;
6541 // Table:
6542 // [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'>]
6543
2a98ceb8 6544 Int_t typeFlag = 0;
6545 Int_t ptEtaFlag = 0;
489d5531 6546
6547 if(type == "RP")
6548 {
6549 typeFlag = 0;
6550 } else if(type == "POI")
6551 {
6552 typeFlag = 1;
6553 }
6554
6555 if(ptOrEta == "Pt")
6556 {
6557 ptEtaFlag = 0;
6558 } else if(ptOrEta == "Eta")
6559 {
6560 ptEtaFlag = 1;
6561 }
6562
6563 // shortcuts:
6564 Int_t t = typeFlag;
6565 Int_t pe = ptEtaFlag;
6566
6567 // binning:
6568 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6569 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6570 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6571 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6572
6573 // protection:
6574 for(Int_t rpq=0;rpq<3;rpq++)
6575 {
6576 for(Int_t m=0;m<4;m++)
6577 {
6578 for(Int_t k=0;k<9;k++)
6579 {
6580 if(!fReRPQ1dEBE[rpq][pe][m][k])
6581 {
6582 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6583 cout<<"pe = "<<pe<<endl;
6584 cout<<"rpq = "<<rpq<<endl;
6585 cout<<"m = "<<m<<endl;
6586 cout<<"k = "<<k<<endl;
6587 exit(0);
6588 }
6589 }
6590 }
6591 }
6592
6593 // multiplicities:
1268c371 6594 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
489d5531 6595 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6596 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6597 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6598
6599 // event weights for correlations:
6600 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6601 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6602 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6603 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6604
6605 // event weights for reduced correlations:
6606 Double_t dw2 = 0.; // event weight for <2'>
6607 Double_t dw4 = 0.; // event weight for <4'>
6608 //Double_t dw6 = 0.; // event weight for <6'>
6609 //Double_t dw8 = 0.; // event weight for <8'>
6610
6611 // looping over bins:
6612 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6613 {
6614 if(type == "RP")
6615 {
6616 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6617 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6618 } else if(type == "POI")
6619 {
6620 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6621 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6622 }
6623
6624 // event weight for <2'>:
6625 dw2 = mp*dMult-mq;
6626 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6627 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6628 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6629 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6630
6631 // event weight for <4'>:
6632 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6633 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6634 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6635 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6636 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6637 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6638 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6639
6640 // event weight for <6'>:
6641 //dw6 = ...;
6642 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6643 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6644 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6645 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6646 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6647 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6648 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6649
6650 // event weight for <8'>:
6651 //dw8 = ...;
6652 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6653 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6654 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6655 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6656 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6657 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6658 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6659
6660 // Table:
6661 // [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'>]
6662
6663 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6664
6665
6666
6667} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6668
489d5531 6669//================================================================================================================================
6670
489d5531 6671void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6672{
6673 // Transfer profiles into histograms and calculate statistical errors correctly.
6674
1268c371 6675 Int_t t = 0; // RP or POI
6676 Int_t pe = 0; // pt or eta
489d5531 6677
6678 if(type == "RP")
6679 {
1268c371 6680 t = 0;
489d5531 6681 } else if(type == "POI")
6682 {
1268c371 6683 t = 1;
489d5531 6684 }
6685
6686 if(ptOrEta == "Pt")
6687 {
1268c371 6688 pe = 0;
489d5531 6689 } else if(ptOrEta == "Eta")
6690 {
1268c371 6691 pe = 1;
489d5531 6692 }
1268c371 6693
6694 for(Int_t rci=0;rci<4;rci++) // to be improved - moved into the method CheckPointersUsedInFinish()
489d5531 6695 {
6696 if(!fDiffFlowCorrelationsPro[t][pe][rci])
6697 {
6698 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6699 cout<<"t = "<<t<<endl;
6700 cout<<"pe = "<<pe<<endl;
6701 cout<<"rci = "<<rci<<endl;
6702 exit(0);
6703 }
b40a910e 6704 if(!fDiffFlowSquaredCorrelationsPro[t][pe][rci])
6705 {
6706 cout<<"WARNING: fDiffFlowSquaredCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6707 cout<<"t = "<<t<<endl;
6708 cout<<"pe = "<<pe<<endl;
6709 cout<<"rci = "<<rci<<endl;
6710 exit(0);
6711 }
489d5531 6712 for(Int_t power=0;power<2;power++)
6713 {
6714 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
6715 {
6716 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6717 cout<<"t = "<<t<<endl;
6718 cout<<"pe = "<<pe<<endl;
6719 cout<<"power = "<<power<<endl;
6720 cout<<"rci = "<<rci<<endl;
6721 exit(0);
6722 }
6723 } // end of for(Int_t power=0;power<2;power++)
6724 } // end of for(Int_t rci=0;rci<4;rci++)
6725
6726 // common:
b40a910e 6727 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 6728 // transfer 1D profile into 1D histogram:
6729 Double_t correlation = 0.;
b40a910e 6730 Double_t squaredCorrelation = 0.;
489d5531 6731 Double_t spread = 0.;
6732 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
6733 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
6734 Double_t error = 0.; // error = termA * spread * termB
6735 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
6736 // termB = 1/pow(1-termA^2,0.5)
6737 Double_t termA = 0.;
6738 Double_t termB = 0.;
6739 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
6740 {
6741 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
6742 {
b40a910e 6743 if(fDiffFlowCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2 ||
6744 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2)
6745 {
6746 fDiffFlowCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
6747 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
6748 continue; // to be improved - should I ignore results in pt bins with one entry for reduced correlations or not?
6749 }
489d5531 6750 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
b40a910e 6751 squaredCorrelation = fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinContent(b);
6752 if(squaredCorrelation-correlation*correlation >= 0.)
6753 {
6754 spread = pow(squaredCorrelation-correlation*correlation,0.5);
6755 } else
6756 {
6757 cout<<endl;
6758 cout<<Form(" WARNING: Imaginary 'spread' for rci = %d, pe = %d, bin = %d !!!!",rci,pe,b)<<endl;
6759 cout<<endl;
6760 }
489d5531 6761 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
6762 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
1268c371 6763 if(TMath::Abs(sumOfWeights)>0.){termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);}
6764 if(1.-pow(termA,2.)>0.){termB = 1./pow(1.-pow(termA,2.),0.5);}
489d5531 6765 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
6766 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
6767 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
6768 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6769 } // end of for(Int_t rci=0;rci<4;rci++)
6770
6771} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6772
489d5531 6773//================================================================================================================================
6774
489d5531 6775void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6776{
6777 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
6778 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
6779 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
6780 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
6781 // <6'><8'>, <8><8'>.
6782
2a98ceb8 6783 Int_t typeFlag = 0;
6784 Int_t ptEtaFlag = 0;
489d5531 6785
6786 if(type == "RP")
6787 {
6788 typeFlag = 0;
6789 } else if(type == "POI")
6790 {
6791 typeFlag = 1;
6792 }
6793
6794 if(ptOrEta == "Pt")
6795 {
6796 ptEtaFlag = 0;
6797 } else if(ptOrEta == "Eta")
6798 {
6799 ptEtaFlag = 1;
6800 }
6801
6802 // shortcuts:
6803 Int_t t = typeFlag;
6804 Int_t pe = ptEtaFlag;
6805
6806 // common:
6807 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6808 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6809 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6810
6811 // protections // to be improved (add protection for all pointers in this method)
6812 if(!fIntFlowCorrelationsEBE)
6813 {
6814 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
6815 exit(0);
6816 }
6817
6818 /*
1268c371 6819 Double_t dMult = (*fSpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
489d5531 6820 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6821 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6822 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6823 */
6824
6825 // e-b-e correlations:
6826 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
6827 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
6828 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
6829 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
6830
6831 // event weights for correlations:
6832 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
6833 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
6834 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
6835 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
6836
6837 // e-b-e reduced correlations:
6838 Double_t twoReducedEBE = 0.; // <2'>
6839 Double_t fourReducedEBE = 0.; // <4'>
6840 Double_t sixReducedEBE = 0.; // <6'>
6841 Double_t eightReducedEBE = 0.; // <8'>
6842
6843 // event weights for reduced correlations:
6844 Double_t dw2 = 0.; // event weight for <2'>
6845 Double_t dw4 = 0.; // event weight for <4'>
6846 //Double_t dw6 = 0.; // event weight for <6'>
6847 //Double_t dw8 = 0.; // event weight for <8'>
6848
6849 // looping over bins:
6850 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6851 {
6852 // e-b-e reduced correlations:
6853 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
6854 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
6855 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
6856 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
6857
6858 /*
6859 // to be improved (I should not do this here again)
6860 if(type == "RP")
6861 {
6862 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6863 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6864 } else if(type == "POI")
6865 {
6866 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6867 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6868 }
6869
6870 // event weights for reduced correlations:
6871 dw2 = mp*dMult-mq; // weight for <2'>
6872 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6873 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
6874 //dw6 = ...
6875 //dw8 = ...
6876
6877 */
6878
6879 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
6880 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
6881
6882 // storing all products:
6883 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
6884 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
6885 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
6886 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
6887
6888 // event weight for <4'>:
6889 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
6890 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
6891 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
6892 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
6893 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
6894
6895 // event weight for <6'>:
6896 //dw6 = ...;
6897 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
6898 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
6899 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
6900 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
6901 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
6902 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
6903 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6904
6905 // event weight for <8'>:
6906 //dw8 = ...;
6907 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
6908 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
6909 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
6910 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
6911 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
6912 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6913 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
6914 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
6915
6916} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6917
489d5531 6918//================================================================================================================================
6919
489d5531 6920void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
6921{
6922 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
6923 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
6924 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
6925 //
6926 // 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)]
6927 //
6928 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
6929 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
6930 //
6931 // 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)]
6932 // 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)]
6933 // 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)]
6934 // 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)]
6935 // 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)]
6936 // ...
6937
2a98ceb8 6938 Int_t typeFlag = 0;
6939 Int_t ptEtaFlag = 0;
489d5531 6940
6941 if(type == "RP")
6942 {
6943 typeFlag = 0;
6944 } else if(type == "POI")
6945 {
6946 typeFlag = 1;
6947 }
6948
6949 if(ptOrEta == "Pt")
6950 {
6951 ptEtaFlag = 0;
6952 } else if(ptOrEta == "Eta")
6953 {
6954 ptEtaFlag = 1;
6955 }
6956
6957 // shortcuts:
6958 Int_t t = typeFlag;
6959 Int_t pe = ptEtaFlag;
6960
6961 // common:
6962 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6963 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
6964 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6965 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6966
6967 // average correlations:
6968 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
6969 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
6970 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
6971 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
6972
6973 // sum of weights for correlation:
6974 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
6975 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
6976 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
6977 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
6978
6979 // average reduced correlations:
6980 Double_t twoReduced = 0.; // <<2'>>
6981 Double_t fourReduced = 0.; // <<4'>>
6982 //Double_t sixReduced = 0.; // <<6'>>
6983 //Double_t eightReduced = 0.; // <<8'>>
6984
6985 // sum of weights for reduced correlation:
6986 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
6987 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
6988 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
6989 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
6990
6991 // product of weights for reduced correlation:
6992 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
6993 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
6994 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
6995 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
6996 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
6997 // ...
6998
6999 // products for differential flow:
7000 Double_t twoTwoReduced = 0; // <<2><2'>>
7001 Double_t twoFourReduced = 0; // <<2><4'>>
7002 Double_t fourTwoReduced = 0; // <<4><2'>>
7003 Double_t fourFourReduced = 0; // <<4><4'>>
7004 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7005
7006 // denominators in the expressions for the unbiased estimators for covariances:
7007 // denominator = 1 - term1/(term2*term3)
7008 // prefactor = term1/(term2*term3)
7009 Double_t denominator = 0.;
7010 Double_t prefactor = 0.;
7011 Double_t term1 = 0.;
7012 Double_t term2 = 0.;
7013 Double_t term3 = 0.;
7014
7015 // unbiased estimators for covariances for differential flow:
7016 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7017 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7018 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7019 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7020 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7021 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7022 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7023 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7024 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7025 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7026
7027 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7028 {
7029 // average reduced corelations:
7030 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7031 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7032 // average products:
7033 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7034 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7035 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7036 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7037 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7038 // sum of weights for reduced correlations:
7039 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7040 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7041 // products of weights for correlations:
7042 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7043 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7044 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7045 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7046 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7047 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7048 // prefactor (multiplies Cov's) = term1/(term2*term3)
7049 // <2>,<2'>:
7050 term1 = productOfWeightsForTwoTwoReduced;
7051 term2 = sumOfWeightsForTwo;
7052 term3 = sumOfWeightsForTwoReduced;
7053 if(term2*term3>0.)
7054 {
7055 denominator = 1.-term1/(term2*term3);
7056 prefactor = term1/(term2*term3);
1268c371 7057 if(TMath::Abs(denominator)>1.e-6)
489d5531 7058 {
7059 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7060 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7061 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7062 }
7063 }
7064 // <2>,<4'>:
7065 term1 = productOfWeightsForTwoFourReduced;
7066 term2 = sumOfWeightsForTwo;
7067 term3 = sumOfWeightsForFourReduced;
7068 if(term2*term3>0.)
7069 {
7070 denominator = 1.-term1/(term2*term3);
7071 prefactor = term1/(term2*term3);
1268c371 7072 if(TMath::Abs(denominator)>1.e-6)
489d5531 7073 {
7074 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7075 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7076 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7077 }
7078 }
7079 // <4>,<2'>:
7080 term1 = productOfWeightsForFourTwoReduced;
7081 term2 = sumOfWeightsForFour;
7082 term3 = sumOfWeightsForTwoReduced;
7083 if(term2*term3>0.)
7084 {
7085 denominator = 1.-term1/(term2*term3);
7086 prefactor = term1/(term2*term3);
1268c371 7087 if(TMath::Abs(denominator)>1.e-6)
489d5531 7088 {
7089 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7090 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7091 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7092 }
7093 }
7094 // <4>,<4'>:
7095 term1 = productOfWeightsForFourFourReduced;
7096 term2 = sumOfWeightsForFour;
7097 term3 = sumOfWeightsForFourReduced;
7098 if(term2*term3>0.)
7099 {
7100 denominator = 1.-term1/(term2*term3);
7101 prefactor = term1/(term2*term3);
1268c371 7102 if(TMath::Abs(denominator)>1.e-6)
489d5531 7103 {
7104 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7105 wCovFourFourReduced = covFourFourReduced*prefactor;
7106 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7107 }
7108 }
7109 // <2'>,<4'>:
7110 term1 = productOfWeightsForTwoReducedFourReduced;
7111 term2 = sumOfWeightsForTwoReduced;
7112 term3 = sumOfWeightsForFourReduced;
7113 if(term2*term3>0.)
7114 {
7115 denominator = 1.-term1/(term2*term3);
7116 prefactor = term1/(term2*term3);
1268c371 7117 if(TMath::Abs(denominator)>1.e-6)
489d5531 7118 {
7119 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7120 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7121 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7122 }
7123 }
7124 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7125
7126} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
7127
489d5531 7128//================================================================================================================================
7129
489d5531 7130void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
7131{
1268c371 7132 // Calculate final results for differential flow.
489d5531 7133
1268c371 7134 // REMARK: Differential flow calculated in this method is NOT corrected for non-uniform acceptance.
7135 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied in the method
7136 // CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
7137
7138 Int_t t = 0; // RP or POI
7139 Int_t pe = 0; // pt or eta
489d5531 7140
7141 if(type == "RP")
7142 {
1268c371 7143 t = 0;
489d5531 7144 } else if(type == "POI")
7145 {
1268c371 7146 t = 1;
489d5531 7147 }
7148
7149 if(ptOrEta == "Pt")
7150 {
1268c371 7151 pe = 0;
489d5531 7152 } else if(ptOrEta == "Eta")
7153 {
1268c371 7154 pe = 1;
489d5531 7155 }
1268c371 7156
7157 // Common:
489d5531 7158 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
1268c371 7159 // Correlations:
489d5531 7160 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
1268c371 7161 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7162 // Statistical errors of correlations:
489d5531 7163 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
7164 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
1268c371 7165 // Reduced correlations:
489d5531 7166 Double_t twoReduced = 0.; // <<2'>>
7167 Double_t fourReduced = 0.; // <<4'>>
1268c371 7168 // Statistical errors of reduced correlations:
489d5531 7169 Double_t twoReducedError = 0.;
7170 Double_t fourReducedError = 0.;
1268c371 7171 // Covariances:
8e1cefdd 7172 Double_t wCovTwoFour = 0.; // Cov(<2>,<4>) * prefactor(<2>,<4>)
7173 if(!fForgetAboutCovariances)
7174 {
7175 wCovTwoFour = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(<2>,<4>)
7176 }
489d5531 7177 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
7178 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
7179 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
7180 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
7181 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
1268c371 7182 // Differential flow:
489d5531 7183 Double_t v2Prime = 0.; // v'{2}
7184 Double_t v4Prime = 0.; // v'{4}
1268c371 7185 // Statistical error of differential flow:
489d5531 7186 Double_t v2PrimeError = 0.;
7187 Double_t v4PrimeError = 0.;
1268c371 7188 // Squared statistical error of differential flow:
489d5531 7189 Double_t v2PrimeErrorSquared = 0.;
7190 Double_t v4PrimeErrorSquared = 0.;
1268c371 7191 // Loop over pt or eta bins:
489d5531 7192 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7193 {
1268c371 7194 // Reduced correlations and statistical errors:
489d5531 7195 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7196 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
7197 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7198 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
1268c371 7199 // Covariances:
8e1cefdd 7200 if(!fForgetAboutCovariances)
7201 {
7202 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
7203 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
7204 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
7205 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
7206 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
7207 }
1268c371 7208 // Differential flow:
489d5531 7209 // v'{2}:
7210 if(two>0.)
7211 {
7212 v2Prime = twoReduced/pow(two,0.5);
1268c371 7213 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*(pow(twoReduced,2.)*pow(twoError,2.)
7214 + 4.*pow(two,2.)*pow(twoReducedError,2.)
7215 - 4.*two*twoReduced*wCovTwoTwoReduced);
7216 if(v2PrimeErrorSquared>0.){v2PrimeError = pow(v2PrimeErrorSquared,0.5);}
7217 if(TMath::Abs(v2Prime)>0.)
7218 {
7219 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
7220 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
7221 }
7222 } // end of if(two>0.)
489d5531 7223 // differential flow:
7224 // v'{4}
7225 if(2.*pow(two,2.)-four > 0.)
7226 {
7227 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
1268c371 7228 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)
7229 * (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
7230 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
7231 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
7232 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
7233 - (3./2.)*(2.*two*twoReduced-fourReduced)
7234 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
7235 - 4.*two*(2.*pow(two,2.)-four)
7236 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
7237 + 2.*(2.*pow(two,2.)-four)
7238 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
7239 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
7240 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
7241 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
7242 if(v4PrimeErrorSquared>0.){v4PrimeError = pow(v4PrimeErrorSquared,0.5);}
7243 if(TMath::Abs(v4Prime)>0.)
7244 {
7245 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
7246 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
7247 }
7248 } // end of if(2.*pow(two,2.)-four > 0.)
489d5531 7249 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
1268c371 7250
7251} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7252
7253//================================================================================================================================
7254
7255void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
7256{
7257 // Calculate final results for 2D diferential flow.
7258
7259 // to be improved - check pointers used in this method
7260
7261 Int_t t = 0; // RP or POI
7262
7263 if(type == "RP")
7264 {
7265 t = 0;
7266 } else if(type == "POI")
7267 {
7268 t = 1;
7269 }
489d5531 7270
1268c371 7271 // Differential flow:
7272 Double_t v2Prime = 0.; // v'{2}
7273 Double_t v4Prime = 0.; // v'{4}
7274 // Differential cumulants:
7275 Double_t qc2Prime = 0.; // QC{2'}
7276 Double_t qc4Prime = 0.; // QC{4'}
7277 // Looping over all (pt,eta) bins and calculating differential flow:
7278 for(Int_t p=1;p<=fnBinsPt;p++)
489d5531 7279 {
1268c371 7280 for(Int_t e=1;e<=fnBinsEta;e++)
489d5531 7281 {
1268c371 7282 // QC{2'}:
7283 qc2Prime = f2DDiffFlowCumulants[t][0]->GetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e));
7284 if(qc2Prime>=0.)
7285 {
7286 v2Prime = pow(qc2Prime,0.5);
7287 f2DDiffFlow[t][0]->SetBinContent(f2DDiffFlow[t][0]->GetBin(p,e),v2Prime);
7288 }
7289 // QC{4'}:
7290 qc4Prime = f2DDiffFlowCumulants[t][1]->GetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e));
7291 if(qc4Prime<=0.)
7292 {
7293 v4Prime = pow(-1.*qc4Prime,1./4.);
7294 f2DDiffFlow[t][1]->SetBinContent(f2DDiffFlow[t][1]->GetBin(p,e),v4Prime);
7295 }
7296 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7297 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7298
7299} // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
489d5531 7300
489d5531 7301//================================================================================================================================
7302
489d5531 7303void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7304{
7305 // a) Store all flags for integrated flow in profile fIntFlowFlags.
7306
7307 if(!fIntFlowFlags)
7308 {
7309 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
7310 exit(0);
7311 }
7312
7313 // particle weights used or not:
7314 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
7315 // which event weights were used:
7316 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
7317 {
7318 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
7319 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
7320 {
7321 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
7322 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
7323 {
7324 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7325 }
489d5531 7326 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7327 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7328 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7329 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
b3dacf6b 7330 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
7331 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
b77b6434 7332 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorAlsoFromNIT);
b3dacf6b 7333 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
0dd3b008 7334 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
8e1cefdd 7335 fIntFlowFlags->Fill(11.5,(Int_t)fForgetAboutCovariances);
e5834fcb 7336 fIntFlowFlags->Fill(12.5,(Int_t)fStorePhiDistributionForOneEvent);
dd442cd2 7337 fIntFlowFlags->Fill(13.5,(Int_t)fFillMultipleControlHistograms);
489d5531 7338} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7339
489d5531 7340//================================================================================================================================
7341
489d5531 7342void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7343{
7344 // Store all flags for differential flow in the profile fDiffFlowFlags.
7345
7346 if(!fDiffFlowFlags)
7347 {
1268c371 7348 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::SDFF() !!!!\n\n");
489d5531 7349 exit(0);
7350 }
7351
1268c371 7352 fDiffFlowFlags->Fill(0.5,fCalculateDiffFlow); // calculate differential flow
7353 fDiffFlowFlags->Fill(1.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not?
7354 //fDiffFlowFlags->Fill(2.5,""); // which event weight was used? ("combinations", "unit" or "multiplicity") to be improved - finalized
7355 fDiffFlowFlags->Fill(3.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7356 fDiffFlowFlags->Fill(4.5,fCalculate2DDiffFlow); // calculate also 2D differential flow vs (pt,eta)
7357
489d5531 7358} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7359
489d5531 7360//================================================================================================================================
7361
489d5531 7362void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7363{
7364 // Access all pointers to common control and common result histograms and profiles.
7365
1268c371 7366 TString sCommonConstantsName = "fCommonConstants";
7367 sCommonConstantsName += fAnalysisLabel->Data();
7368 fCommonConstants = dynamic_cast<TProfile*>(fHistList->FindObject(sCommonConstantsName.Data()));
7369 if(!fCommonConstants)
7370 {
7371 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::GPFCH() !!!!\n\n");
7372 exit(0);
7373 }
7374
7375 // to be improved - lines bellow can be implemented better.
7376
489d5531 7377 TString commonHistsName = "AliFlowCommonHistQC";
7378 commonHistsName += fAnalysisLabel->Data();
7379 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
b77b6434 7380 if(commonHist)
7381 {
7382 this->SetCommonHists(commonHist);
7383 if(fCommonHists->GetHarmonic())
7384 {
7385 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
7386 }
7387 } // end of if(commonHist)
489d5531 7388 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7389 commonHists2ndOrderName += fAnalysisLabel->Data();
7390 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7391 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7392 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7393 commonHists4thOrderName += fAnalysisLabel->Data();
7394 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7395 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7396 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7397 commonHists6thOrderName += fAnalysisLabel->Data();
7398 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7399 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7400 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7401 commonHists8thOrderName += fAnalysisLabel->Data();
7402 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
dd442cd2 7403 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7404
489d5531 7405 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7406 commonHistResults2ndOrderName += fAnalysisLabel->Data();
b77b6434 7407 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
7408 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
489d5531 7409 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7410 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7411 commonHistResults4thOrderName += fAnalysisLabel->Data();
7412 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7413 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7414 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7415 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7416 commonHistResults6thOrderName += fAnalysisLabel->Data();
7417 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7418 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7419 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7420 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7421 commonHistResults8thOrderName += fAnalysisLabel->Data();
7422 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7423 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7424 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7425
7426} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7427
7428
7429//================================================================================================================================
7430
7431
7432void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7433{
7434 // Get pointers for histograms with particle weights.
7435
7436 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
ca5f47e7 7437 if(!weightsList){printf("\n WARNING (QC): weightsList is NULL in AFAWQC::GPFPWH() !!!!\n");exit(0);}
7438 this->SetWeightsList(weightsList);
489d5531 7439 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7440 fUseParticleWeightsName += fAnalysisLabel->Data();
7441 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7442 if(useParticleWeights)
7443 {
7444 this->SetUseParticleWeights(useParticleWeights);
7445 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7446 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7447 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7448 }
7449} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7450
7451
7452//================================================================================================================================
7453
7454
7455void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7456{
7457 // Get pointers for histograms and profiles relevant for integrated flow:
7458 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7459 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7460 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7461 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7462
7463 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7464 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
b40a910e 7465 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"}; // to be improved (should I promote this to data member?)
7466 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"}; // to be improved (should I promote this to data member?)
489d5531 7467
7468 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7469 TList *intFlowList = NULL;
7470 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7471 if(!intFlowList)
7472 {
7473 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7474 exit(0);
7475 }
7476
b92ea2b9 7477 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7478 TString intFlowFlagsName = "fIntFlowFlags";
7479 intFlowFlagsName += fAnalysisLabel->Data();
7480 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7481 if(intFlowFlags)
7482 {
7483 this->SetIntFlowFlags(intFlowFlags);
7484 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
7485 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
7486 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
7487 } else
7488 {
7489 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7490 }
489d5531 7491
7492 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7493 TList *intFlowProfiles = NULL;
7494 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7495 if(intFlowProfiles)
7496 {
7497 // average multiplicities:
7498 TString avMultiplicityName = "fAvMultiplicity";
7499 avMultiplicityName += fAnalysisLabel->Data();
7500 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7501 if(avMultiplicity)
7502 {
7503 this->SetAvMultiplicity(avMultiplicity);
7504 } else
7505 {
7506 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7507 }
7508 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7509 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7510 intFlowCorrelationsProName += fAnalysisLabel->Data();
7511 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7512 if(intFlowCorrelationsPro)
7513 {
7514 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7515 } else
7516 {
7517 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7518 }
b40a910e 7519 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8^2>>:
7520 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
7521 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
7522 TProfile *intFlowSquaredCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowSquaredCorrelationsProName.Data()));
7523 if(intFlowSquaredCorrelationsPro)
7524 {
7525 this->SetIntFlowSquaredCorrelationsPro(intFlowSquaredCorrelationsPro);
7526 } else
7527 {
7528 cout<<"WARNING: intFlowSquaredCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7529 }
b3dacf6b 7530 if(fCalculateCumulantsVsM)
ff70ca91 7531 {
b40a910e 7532 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
b3dacf6b 7533 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7534 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7535 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7536 {
b3dacf6b 7537 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7538 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7539 if(intFlowCorrelationsVsMPro)
7540 {
7541 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7542 } else
7543 {
7544 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7545 }
7546 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b40a910e 7547 // Average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
7548 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
7549 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
7550 for(Int_t ci=0;ci<4;ci++) // correlation index
7551 {
7552 TProfile *intFlowSquaredCorrelationsVsMPro = dynamic_cast<TProfile*>
7553 (intFlowProfiles->FindObject(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data())));
7554 if(intFlowSquaredCorrelationsVsMPro)
7555 {
7556 this->SetIntFlowSquaredCorrelationsVsMPro(intFlowSquaredCorrelationsVsMPro,ci);
7557 } else
7558 {
7559 cout<<"WARNING: "<<Form("intFlowSquaredCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7560 }
7561 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b3dacf6b 7562 } // end of if(fCalculateCumulantsVsM)
489d5531 7563 // average all correlations for integrated flow (with wrong errors!):
7564 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7565 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7566 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7567 if(intFlowCorrelationsAllPro)
7568 {
7569 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7570 } else
7571 {
7572 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7573 }
7574 // average extra correlations for integrated flow (which appear only when particle weights are used):
7575 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7576 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7577 {
7578 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7579 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7580 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7581 if(intFlowExtraCorrelationsPro)
7582 {
7583 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7584 } else
7585 {
7586 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7587 }
7588 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7589 // average products of correlations <2>, <4>, <6> and <8>:
7590 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7591 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7592 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7593 if(intFlowProductOfCorrelationsPro)
7594 {
7595 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7596 } else
7597 {
7598 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7599 }
7600 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7601 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 7602 if(fCalculateCumulantsVsM)
7603 {
7604 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7605 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7606 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7607 for(Int_t pi=0;pi<6;pi++)
7608 {
7609 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7610 if(intFlowProductOfCorrelationsVsMPro)
7611 {
7612 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7613 } else
7614 {
7615 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7616 }
7617 } // end of for(Int_t pi=0;pi<6;pi++)
7618 } // end of if(fCalculateCumulantsVsM)
489d5531 7619 // average correction terms for non-uniform acceptance (with wrong errors!):
7620 for(Int_t sc=0;sc<2;sc++)
7621 {
7622 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7623 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7624 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7625 if(intFlowCorrectionTermsForNUAPro)
7626 {
7627 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7628 } else
7629 {
7630 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7631 cout<<"sc = "<<sc<<endl;
7632 }
2001bc3a 7633 // versus multiplicity:
b3dacf6b 7634 if(fCalculateCumulantsVsM)
2001bc3a 7635 {
b3dacf6b 7636 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
7637 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
7638 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
7639 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 7640 {
b3dacf6b 7641 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
7642 if(intFlowCorrectionTermsForNUAVsMPro)
7643 {
7644 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
7645 } else
7646 {
7647 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7648 cout<<"sc = "<<sc<<endl;
7649 cout<<"ci = "<<ci<<endl;
7650 }
7651 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7652 } // end of if(fCalculateCumulantsVsM)
489d5531 7653 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 7654 // average products of correction terms for NUA:
7655 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7656 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7657 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7658 if(intFlowProductOfCorrectionTermsForNUAPro)
7659 {
7660 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7661 } else
7662 {
7663 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7664 }
489d5531 7665 } else // to if(intFlowProfiles)
7666 {
7667 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7668 }
7669
7670 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7671 TList *intFlowResults = NULL;
7672 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7673 if(intFlowResults)
7674 {
7675 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7676 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7677 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7678 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7679 if(intFlowCorrelationsHist)
7680 {
7681 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7682 } else
7683 {
7684 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7685 }
ff70ca91 7686 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
b3dacf6b 7687 if(fCalculateCumulantsVsM)
ff70ca91 7688 {
b3dacf6b 7689 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7690 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7691 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7692 {
b3dacf6b 7693 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7694 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7695 if(intFlowCorrelationsVsMHist)
7696 {
7697 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7698 } else
7699 {
7700 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7701 }
7702 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7703 } // end of if(fCalculateCumulantsVsM)
489d5531 7704 // average all correlations for integrated flow (with correct errors!):
7705 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7706 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7707 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7708 if(intFlowCorrelationsAllHist)
7709 {
7710 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7711 } else
7712 {
7713 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7714 }
7715 // average correction terms for non-uniform acceptance (with correct errors!):
7716 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7717 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7718 for(Int_t sc=0;sc<2;sc++)
7719 {
7720 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7721 if(intFlowCorrectionTermsForNUAHist)
7722 {
7723 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7724 } else
7725 {
7726 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7727 cout<<"sc = "<<sc<<endl;
7728 }
7729 } // end of for(Int_t sc=0;sc<2;sc++)
7730 // covariances (multiplied with weight dependent prefactor):
7731 TString intFlowCovariancesName = "fIntFlowCovariances";
7732 intFlowCovariancesName += fAnalysisLabel->Data();
7733 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7734 if(intFlowCovariances)
7735 {
7736 this->SetIntFlowCovariances(intFlowCovariances);
7737 } else
7738 {
7739 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7740 }
7741 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7742 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7743 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7744 for(Int_t power=0;power<2;power++)
7745 {
7746 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7747 if(intFlowSumOfEventWeights)
7748 {
7749 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7750 } else
7751 {
7752 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7753 cout<<"power = "<<power<<endl;
7754 }
7755 } // end of for(Int_t power=0;power<2;power++)
7756 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7757 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7758 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7759 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7760 if(intFlowSumOfProductOfEventWeights)
7761 {
7762 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7763 } else
7764 {
7765 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7766 }
ff70ca91 7767 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7768 // [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 7769 if(fCalculateCumulantsVsM)
ff70ca91 7770 {
b3dacf6b 7771 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7772 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7773 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7774 for(Int_t ci=0;ci<6;ci++)
7775 {
7776 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7777 if(intFlowCovariancesVsM)
ff70ca91 7778 {
b3dacf6b 7779 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
ff70ca91 7780 } else
7781 {
b3dacf6b 7782 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7783 }
b3dacf6b 7784 } // end of for(Int_t ci=0;ci<6;ci++)
7785 } // end of if(fCalculateCumulantsVsM)
7786 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7787 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7788 if(fCalculateCumulantsVsM)
7789 {
7790 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7791 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7792 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>}"},
7793 {"#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}"}};
7794 for(Int_t si=0;si<4;si++)
7795 {
7796 for(Int_t power=0;power<2;power++)
7797 {
7798 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7799 if(intFlowSumOfEventWeightsVsM)
7800 {
7801 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7802 } else
7803 {
7804 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7805 }
7806 } // end of for(Int_t power=0;power<2;power++)
7807 } // end of for(Int_t si=0;si<4;si++)
7808 } // end of if(fCalculateCumulantsVsM)
ff70ca91 7809 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7810 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7811 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 7812 if(fCalculateCumulantsVsM)
ff70ca91 7813 {
b3dacf6b 7814 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7815 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7816 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>}",
7817 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7818 for(Int_t pi=0;pi<6;pi++)
ff70ca91 7819 {
b3dacf6b 7820 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7821 if(intFlowSumOfProductOfEventWeightsVsM)
7822 {
7823 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7824 } else
7825 {
7826 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7827 }
7828 } // end of for(Int_t pi=0;pi<6;pi++)
7829 } // end of if(fCalculateCumulantsVsM)
0328db2d 7830 // covariances for NUA (multiplied with weight dependent prefactor):
7831 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7832 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7833 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7834 if(intFlowCovariancesNUA)
7835 {
7836 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7837 } else
7838 {
7839 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7840 }
7841 // sum of linear and quadratic event weights NUA terms:
7842 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7843 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7844 for(Int_t sc=0;sc<2;sc++)
7845 {
7846 for(Int_t power=0;power<2;power++)
7847 {
7848 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7849 if(intFlowSumOfEventWeightsNUA)
7850 {
7851 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7852 } else
7853 {
7854 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7855 cout<<"sc = "<<sc<<endl;
7856 cout<<"power = "<<power<<endl;
7857 }
7858 } // end of for(Int_t power=0;power<2;power++)
7859 } // end of for(Int_t sc=0;sc<2;sc++)
7860 // sum of products of event weights for NUA terms:
7861 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7862 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7863 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7864 if(intFlowSumOfProductOfEventWeightsNUA)
7865 {
7866 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7867 } else
7868 {
7869 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7870 }
b3dacf6b 7871 // Final results for reference Q-cumulants:
489d5531 7872 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7873 intFlowQcumulantsName += fAnalysisLabel->Data();
7874 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7875 if(intFlowQcumulants)
7876 {
7877 this->SetIntFlowQcumulants(intFlowQcumulants);
7878 } else
7879 {
7880 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7881 }
b3dacf6b 7882 // Final results for reference Q-cumulants rebinned in M:
7883 if(fCalculateCumulantsVsM)
7884 {
7885 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
7886 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
7887 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
7888 if(intFlowQcumulantsRebinnedInM)
7889 {
7890 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
7891 } else
7892 {
7893 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7894 }
7895 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 7896 // Ratio between error squared: with/without non-isotropic terms:
7897 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
7898 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
7899 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
7900 if(intFlowQcumulantsErrorSquaredRatio)
7901 {
7902 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
7903 } else
7904 {
7905 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7906 }
ff70ca91 7907 // final results for integrated Q-cumulants versus multiplicity:
ff70ca91 7908 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
b3dacf6b 7909 if(fCalculateCumulantsVsM)
ff70ca91 7910 {
b3dacf6b 7911 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7912 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7913 for(Int_t co=0;co<4;co++) // cumulant order
ff70ca91 7914 {
b3dacf6b 7915 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7916 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7917 if(intFlowQcumulantsVsM)
7918 {
7919 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7920 } else
7921 {
7922 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7923 }
7924 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7925 } // end of if(fCalculateCumulantsVsM)
7926 // Final reference flow estimates from Q-cumulants:
489d5531 7927 TString intFlowName = "fIntFlow";
7928 intFlowName += fAnalysisLabel->Data();
7929 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7930 if(intFlow)
7931 {
7932 this->SetIntFlow(intFlow);
7933 } else
7934 {
7935 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7936 }
b3dacf6b 7937 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
7938 if(fCalculateCumulantsVsM)
ff70ca91 7939 {
b3dacf6b 7940 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
7941 intFlowRebinnedInMName += fAnalysisLabel->Data();
7942 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
7943 if(intFlowRebinnedInM)
ff70ca91 7944 {
b3dacf6b 7945 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
7946 } else
ff70ca91 7947 {
b3dacf6b 7948 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7949 }
7950 } // end of if(fCalculateCumulantsVsM)
7951 // integrated flow from Q-cumulants versus multiplicity:
7952 if(fCalculateCumulantsVsM)
7953 {
7954 TString intFlowVsMName = "fIntFlowVsM";
7955 intFlowVsMName += fAnalysisLabel->Data();
b77b6434 7956 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 7957 for(Int_t co=0;co<4;co++) // cumulant order
7958 {
7959 TH1D *intFlowVsM = dynamic_cast<TH1D*>
b77b6434 7960 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
b3dacf6b 7961 if(intFlowVsM)
7962 {
7963 this->SetIntFlowVsM(intFlowVsM,co);
7964 } else
7965 {
7966 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7967 }
7968 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7969 } // end of if(fCalculateCumulantsVsM)
2001bc3a 7970 // quantifying detector effects effects to correlations:
7971 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
7972 intFlowDetectorBiasName += fAnalysisLabel->Data();
7973 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
7974 if(intFlowDetectorBias)
7975 {
7976 this->SetIntFlowDetectorBias(intFlowDetectorBias);
7977 } else
7978 {
7979 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7980 }
7981 // quantifying detector effects effects to correlations vs multiplicity:
b77b6434 7982 if(fCalculateCumulantsVsM)
2001bc3a 7983 {
3c5d5752 7984 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
7985 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
7986 for(Int_t ci=0;ci<4;ci++) // correlation index
2001bc3a 7987 {
3c5d5752 7988 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
7989 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
7990 if(intFlowDetectorBiasVsM)
7991 {
7992 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
7993 } else
7994 {
7995 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7996 }
7997 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b77b6434 7998 } // end of if(fCalculateCumulantsVsM)
489d5531 7999 } else // to if(intFlowResults)
8000 {
8001 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8002 }
ff70ca91 8003
489d5531 8004} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8005
489d5531 8006//================================================================================================================================
8007
1268c371 8008void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8009{
8010 // Get pointers for 2D differential flow histograms.
8011 // a) Check pointers used in this method;
8012 // b) Get pointers to 2D differential flow lists;
8013 // c) Get pointers to 2D differential flow profiles;
8014 // d) Get pointers to 2D differential flow histograms.
8015
8016 // a) Check pointers used in this method:
8017 if(!fDiffFlowList)
8018 {
8019 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPF2DDFH() !!!!\n");
8020 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8021 exit(0);
8022 }
8023 if(!fDiffFlowFlags)
8024 {
8025 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPF2DDFH() !!!!\n\n");
8026 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8027 exit(0);
8028 }
8029
8030 // b) Get pointers to 2D differential flow lists:
8031 this->SetCalculate2DDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(5)); // to be improved - hardwired 5
8032 if(!fCalculate2DDiffFlow){return;}
8033 TString typeFlag[2] = {"RP","POI"};
8034 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8035 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8036 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8037 // Base list:
8038 TString diffFlow2DListName = "2D";
8039 diffFlow2DListName += fAnalysisLabel->Data();
8040 fDiffFlow2D = dynamic_cast<TList*>(fDiffFlowList->FindObject(diffFlow2DListName.Data()));
8041 if(!fDiffFlow2D)
8042 {
8043 printf("\n WARNING (QC): fDiffFlow2D is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8044 exit(0);
8045 }
8046 // Lists holding profiles with 2D correlations:
8047 TString s2DDiffFlowCorrelationsProListName = "Profiles with 2D correlations";
8048 s2DDiffFlowCorrelationsProListName += fAnalysisLabel->Data(); // to be improved
8049 for(Int_t t=0;t<2;t++)
8050 {
8051 f2DDiffFlowCorrelationsProList[t] = dynamic_cast<TList*>(fDiffFlow2D->FindObject(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data())));
8052 if(!f2DDiffFlowCorrelationsProList[t])
8053 {
8054 printf("\n WARNING (QC): f2DDiffFlowCorrelationsProList[%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t);
8055 exit(0);
8056 }
8057 } // end of for(Int_t t=0;t<2;t++)
8058
8059 // c) Get pointers to 2D differential flow profiles:
8060 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8061 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8062 for(Int_t t=0;t<2;t++) // type: RP or POI
8063 {
8064 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8065 {
8066 f2DDiffFlowCorrelationsPro[t][rci] = dynamic_cast<TProfile2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data())));
8067 if(!f2DDiffFlowCorrelationsPro[t][rci])
8068 {
8069 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8070 exit(0);
8071 } else
8072 {
8073 this->Set2DDiffFlowCorrelationsPro(f2DDiffFlowCorrelationsPro[t][rci],t,rci);
8074 }
8075 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8076 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8077
8078 // d) Get pointers to 2D differential flow histograms:
8079 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8080 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8081 TString s2DDiffFlowName = "f2DDiffFlow";
8082 s2DDiffFlowName += fAnalysisLabel->Data();
8083 for(Int_t t=0;t<2;t++) // type: RP or POI
8084 {
8085 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8086 {
8087 // 2D differential cumulants:
8088 f2DDiffFlowCumulants[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data())));
8089 if(!f2DDiffFlowCumulants[t][rci])
8090 {
8091 printf("\n WARNING (QC): f2DDiffFlowCumulants[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8092 exit(0);
8093 } else
8094 {
8095 this->Set2DDiffFlowCumulants(f2DDiffFlowCumulants[t][rci],t,rci);
8096 }
8097 // 2D differential flow:
8098 f2DDiffFlow[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data())));
8099 if(!f2DDiffFlow[t][rci])
8100 {
8101 printf("\n WARNING (QC): f2DDiffFlow[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8102 exit(0);
8103 } else
8104 {
8105 this->Set2DDiffFlow(f2DDiffFlow[t][rci],t,rci);
8106 }
8107 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8108 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8109
8110} // end of void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8111
8112//================================================================================================================================
8113
489d5531 8114void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8115{
8116 // Get pointer to all objects relevant for differential flow.
1268c371 8117 // a) Get pointer to base list for differential flow fDiffFlowList;
8118 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags;
8119 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults;
8120 // d) Define flags locally (to be improved: should I promote these flags to data members?);
8121 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8122 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8123
8124 // a) Get pointer to base list for differential flow fDiffFlowList:
8125 fDiffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
8126 if(!fDiffFlowList)
489d5531 8127 {
1268c371 8128 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8129 exit(0);
8130 }
1268c371 8131
8132 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags:
8133 TString diffFlowFlagsName = "fDiffFlowFlags";
8134 diffFlowFlagsName += fAnalysisLabel->Data();
8135 fDiffFlowFlags = dynamic_cast<TProfile*>(fDiffFlowList->FindObject(diffFlowFlagsName.Data()));
8136 if(fDiffFlowFlags)
8137 {
8138 this->SetCalculateDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(1)); // to be improved - hardwired 5
8139 } else
8140 {
8141 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8142 printf("\n Flags in method Finish() are wrong.\n\n");
8143 exit(0);
8144 }
8145
8146 if(!fCalculateDiffFlow){return;} // IMPORTANT: do not move this anywhere above in this method (to be improved)
8147
8148 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults:
8149 // List holding nested lists holding profiles:
489d5531 8150 TList *diffFlowListProfiles = NULL;
1268c371 8151 diffFlowListProfiles = dynamic_cast<TList*>(fDiffFlowList->FindObject("Profiles"));
489d5531 8152 if(!diffFlowListProfiles)
8153 {
1268c371 8154 printf("\n WARNING (QC): diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8155 exit(0);
8156 }
1268c371 8157 // List holding nested lists holding histograms with final results:
489d5531 8158 TList *diffFlowListResults = NULL;
1268c371 8159 diffFlowListResults = dynamic_cast<TList*>(fDiffFlowList->FindObject("Results"));
489d5531 8160 if(!diffFlowListResults)
8161 {
1268c371 8162 printf("\n WARNING (QC): diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8163 exit(0);
8164 }
8165
1268c371 8166 // d) Define flags locally (to be improved: should I promote these flags to data members?):
8167 TString typeFlag[2] = {"RP","POI"};
8168 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8169 TString powerFlag[2] = {"linear","quadratic"};
8170 TString sinCosFlag[2] = {"sin","cos"};
8171 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8172 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8173 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8174 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
8175 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8176 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
489d5531 8177
1268c371 8178 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold:
489d5531 8179 // correlations:
8180 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
8181 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8182 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 8183 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
8184 // squared correlations:
8185 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8186 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8187 TProfile *diffFlowSquaredCorrelationsPro[2][2][4] = {{{NULL}}};
489d5531 8188 // products of correlations:
8189 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
8190 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8191 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8192 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
8193 // corrections:
8194 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
8195 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8196 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8197 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
8198 for(Int_t t=0;t<2;t++)
8199 {
8200 for(Int_t pe=0;pe<2;pe++)
8201 {
8202 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8203 if(!diffFlowCorrelationsProList[t][pe])
8204 {
8205 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8206 cout<<"t = "<<t<<endl;
8207 cout<<"pe = "<<pe<<endl;
8208 exit(0);
8209 }
8210 for(Int_t ci=0;ci<4;ci++) // correlation index
8211 {
b40a910e 8212 // reduced correlations:
489d5531 8213 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())));
8214 if(diffFlowCorrelationsPro[t][pe][ci])
8215 {
8216 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
8217 } else
8218 {
8219 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8220 cout<<"t = "<<t<<endl;
8221 cout<<"pe = "<<pe<<endl;
8222 cout<<"ci = "<<ci<<endl;
8223 }
b40a910e 8224 // reduced squared correlations:
8225 diffFlowSquaredCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[ci].Data())));
8226 if(diffFlowSquaredCorrelationsPro[t][pe][ci])
8227 {
8228 this->SetDiffFlowSquaredCorrelationsPro(diffFlowSquaredCorrelationsPro[t][pe][ci],t,pe,ci);
8229 } else
8230 {
8231 cout<<"WARNING: diffFlowSquaredCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8232 cout<<"t = "<<t<<endl;
8233 cout<<"pe = "<<pe<<endl;
8234 cout<<"ci = "<<ci<<endl;
8235 }
489d5531 8236 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8237 // products of correlations:
8238 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8239 if(!diffFlowProductOfCorrelationsProList[t][pe])
8240 {
8241 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8242 cout<<"t = "<<t<<endl;
8243 cout<<"pe = "<<pe<<endl;
8244 exit(0);
8245 }
8246 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8247 {
8248 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8249 {
8250 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())));
8251 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
8252 {
8253 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
8254 } else
8255 {
b40a910e 8256 cout<<"WARNING: diffFlowProductOfCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
489d5531 8257 cout<<"t = "<<t<<endl;
8258 cout<<"pe = "<<pe<<endl;
8259 cout<<"mci1 = "<<mci1<<endl;
8260 cout<<"mci2 = "<<mci2<<endl;
8261 }
8262 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8263 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8264 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8265 // corrections:
8266 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8267 if(!diffFlowCorrectionsProList[t][pe])
8268 {
8269 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8270 cout<<"t = "<<t<<endl;
8271 cout<<"pe = "<<pe<<endl;
8272 exit(0);
8273 }
8274 // correction terms for NUA:
8275 for(Int_t sc=0;sc<2;sc++) // sin or cos
8276 {
8277 for(Int_t cti=0;cti<9;cti++) // correction term index
8278 {
8279 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)));
8280 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
8281 {
8282 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
8283 } else
8284 {
8285 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8286 cout<<"t = "<<t<<endl;
8287 cout<<"pe = "<<pe<<endl;
8288 cout<<"sc = "<<sc<<endl;
8289 cout<<"cti = "<<cti<<endl;
8290 }
8291 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8292 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8293 // ...
8294 } // end of for(Int_t pe=0;pe<2;pe++)
8295 } // end of for(Int_t t=0;t<2;t++)
8296
1268c371 8297 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold:
489d5531 8298 // reduced correlations:
8299 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
8300 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8301 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8302 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
8303 // corrections for NUA:
8304 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
8305 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8306 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8307 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
8308 // differential Q-cumulants:
8309 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
8310 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8311 diffFlowCumulantsName += fAnalysisLabel->Data();
8312 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1268c371 8313 // detector bias to differential Q-cumulants:
8314 TList *diffFlowDetectorBiasHistList[2][2] = {{NULL}};
8315 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
8316 diffFlowDetectorBiasName += fAnalysisLabel->Data();
8317 TH1D *diffFlowDetectorBias[2][2][4] = {{{NULL}}};
489d5531 8318 // differential flow estimates from Q-cumulants:
8319 TList *diffFlowHistList[2][2] = {{NULL}};
8320 TString diffFlowName = "fDiffFlow";
8321 diffFlowName += fAnalysisLabel->Data();
8322 TH1D *diffFlow[2][2][4] = {{{NULL}}};
8323 // differential covariances:
8324 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
8325 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8326 diffFlowCovariancesName += fAnalysisLabel->Data();
8327 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
8328 for(Int_t t=0;t<2;t++) // type: RP or POI
8329 {
8330 for(Int_t pe=0;pe<2;pe++) // pt or eta
8331 {
8332 // reduced correlations:
8333 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8334 if(!diffFlowCorrelationsHistList[t][pe])
8335 {
8336 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8337 cout<<"t = "<<t<<endl;
8338 cout<<"pe = "<<pe<<endl;
8339 exit(0);
8340 }
8341 for(Int_t index=0;index<4;index++)
8342 {
8343 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())));
8344 if(diffFlowCorrelationsHist[t][pe][index])
8345 {
8346 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8347 } else
8348 {
8349 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8350 cout<<"t = "<<t<<endl;
8351 cout<<"pe = "<<pe<<endl;
8352 cout<<"index = "<<index<<endl;
8353 exit(0);
8354 }
8355 } // end of for(Int_t index=0;index<4;index++)
8356 // corrections:
8357 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8358 if(!diffFlowCorrectionsHistList[t][pe])
8359 {
8360 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8361 cout<<"t = "<<t<<endl;
8362 cout<<"pe = "<<pe<<endl;
8363 exit(0);
8364 }
8365 // correction terms for NUA:
8366 for(Int_t sc=0;sc<2;sc++) // sin or cos
8367 {
8368 for(Int_t cti=0;cti<9;cti++) // correction term index
8369 {
8370 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)));
8371 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8372 {
8373 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8374 } else
8375 {
8376 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8377 cout<<"t = "<<t<<endl;
8378 cout<<"pe = "<<pe<<endl;
8379 cout<<"sc = "<<sc<<endl;
8380 cout<<"cti = "<<cti<<endl;
8381 }
8382 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8383 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8384 // ...
8385 // differential Q-cumulants:
8386 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8387 if(!diffFlowCumulantsHistList[t][pe])
8388 {
8389 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8390 cout<<"t = "<<t<<endl;
8391 cout<<"pe = "<<pe<<endl;
8392 exit(0);
8393 }
8394 for(Int_t index=0;index<4;index++)
8395 {
8396 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())));
8397 if(diffFlowCumulants[t][pe][index])
8398 {
8399 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8400 } else
8401 {
8402 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8403 cout<<"t = "<<t<<endl;
8404 cout<<"pe = "<<pe<<endl;
8405 cout<<"index = "<<index<<endl;
8406 exit(0);
8407 }
8408 } // end of for(Int_t index=0;index<4;index++)
1268c371 8409 // Detector bias to differential Q-cumulants:
8410 diffFlowDetectorBiasHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8411 if(!diffFlowDetectorBiasHistList[t][pe])
8412 {
8413 cout<<"WARNING: diffFlowDetectorBiasHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8414 cout<<"t = "<<t<<endl;
8415 cout<<"pe = "<<pe<<endl;
8416 exit(0);
8417 }
8418 for(Int_t index=0;index<4;index++)
8419 {
8420 diffFlowDetectorBias[t][pe][index] = dynamic_cast<TH1D*>(diffFlowDetectorBiasHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data())));
8421 if(diffFlowDetectorBias[t][pe][index])
8422 {
8423 this->SetDiffFlowDetectorBias(diffFlowDetectorBias[t][pe][index],t,pe,index);
8424 } else
8425 {
8426 cout<<"WARNING: diffFlowDetectorBias[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8427 cout<<"t = "<<t<<endl;
8428 cout<<"pe = "<<pe<<endl;
8429 cout<<"index = "<<index<<endl;
8430 exit(0);
8431 }
8432 } // end of for(Int_t index=0;index<4;index++)
489d5531 8433 // differential flow estimates from Q-cumulants:
8434 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8435 if(!diffFlowHistList[t][pe])
8436 {
8437 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8438 cout<<"t = "<<t<<endl;
8439 cout<<"pe = "<<pe<<endl;
8440 exit(0);
8441 }
8442 for(Int_t index=0;index<4;index++)
8443 {
8444 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())));
8445 if(diffFlow[t][pe][index])
8446 {
8447 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8448 } else
8449 {
8450 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8451 cout<<"t = "<<t<<endl;
8452 cout<<"pe = "<<pe<<endl;
8453 cout<<"index = "<<index<<endl;
8454 exit(0);
8455 }
8456 } // end of for(Int_t index=0;index<4;index++)
8457 // differential covariances:
8458 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8459 if(!diffFlowCovariancesHistList[t][pe])
8460 {
8461 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8462 cout<<"t = "<<t<<endl;
8463 cout<<"pe = "<<pe<<endl;
8464 exit(0);
8465 }
8466 for(Int_t covIndex=0;covIndex<5;covIndex++)
8467 {
8468 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())));
8469 if(diffFlowCovariances[t][pe][covIndex])
8470 {
8471 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8472 } else
8473 {
8474 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8475 cout<<"t = "<<t<<endl;
8476 cout<<"pe = "<<pe<<endl;
8477 cout<<"covIndex = "<<covIndex<<endl;
8478 exit(0);
8479 }
8480 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8481 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8482 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8483 // sum of event weights for reduced correlations:
8484 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8485 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8486 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8487 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8488 for(Int_t t=0;t<2;t++) // type is RP or POI
8489 {
8490 for(Int_t pe=0;pe<2;pe++) // pt or eta
8491 {
8492 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8493 {
8494 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())));
8495 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8496 {
8497 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8498 cout<<"t = "<<t<<endl;
8499 cout<<"pe = "<<pe<<endl;
8500 cout<<"power = "<<p<<endl;
8501 exit(0);
8502 }
8503 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8504 {
8505 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())));
8506 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8507 {
8508 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8509 } else
8510 {
8511 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8512 cout<<"t = "<<t<<endl;
8513 cout<<"pe = "<<pe<<endl;
8514 cout<<"power = "<<p<<endl;
8515 cout<<"ew = "<<ew<<endl;
8516 exit(0);
8517 }
8518 }
8519 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8520 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8521 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8522 //
8523 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8524 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8525 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8526 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8527 for(Int_t t=0;t<2;t++) // type is RP or POI
8528 {
8529 for(Int_t pe=0;pe<2;pe++) // pt or eta
8530 {
8531 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8532 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8533 {
8534 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8535 cout<<"t = "<<t<<endl;
8536 cout<<"pe = "<<pe<<endl;
8537 exit(0);
8538 }
8539 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8540 {
8541 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8542 {
8543 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())));
8544 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8545 {
8546 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8547 } else
8548 {
8549 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8550 cout<<"t = "<<t<<endl;
8551 cout<<"pe = "<<pe<<endl;
8552 cout<<"mci1 = "<<mci1<<endl;
8553 cout<<"mci2 = "<<mci2<<endl;
8554 exit(0);
8555 }
8556 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8557 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8558 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8559 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8560 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8561
8562} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8563
489d5531 8564//================================================================================================================================
8565
1268c371 8566void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
8567{
8568 // Book all objects needed for 2D differential flow.
8569 // a) Define flags locally (to be improved: should I promote flags to data members?);
8570 // b) Book e-b-e quantities;
8571 // c) Book 2D profiles;
8572 // d) Book 2D histograms.
8573
8574 if(!fCalculate2DDiffFlow){return;}
8575
8576 // a) Define flags locally (to be improved: should I promote flags to data members?):
8577 TString typeFlag[2] = {"RP","POI"};
8578 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8579 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8580 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8581
8582 // b) Book e-b-e quantities:
8583 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8584 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8585 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8586 {
8587 for(Int_t m=0;m<4;m++)
8588 {
8589 for(Int_t k=0;k<9;k++)
8590 {
8591 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8592 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8593 }
8594 }
8595 }
8596 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8597 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8598 {
8599 for(Int_t k=0;k<9;k++)
8600 {
8601 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8602 }
8603 }
8604
8605 // c) Book 2D profiles:
8606 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8607 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8608 for(Int_t t=0;t<2;t++) // type: RP or POI
8609 {
8610 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8611 {
8612 f2DDiffFlowCorrelationsPro[t][rci] = new TProfile2D(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax,"");
8613 f2DDiffFlowCorrelationsPro[t][rci]->Sumw2();
8614 f2DDiffFlowCorrelationsPro[t][rci]->SetXTitle("p_{t}");
8615 f2DDiffFlowCorrelationsPro[t][rci]->SetYTitle("#eta");
8616 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCorrelationsPro[t][rci]);
8617 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8618 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
8619
8620 // d) Book 2D histograms:
8621 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8622 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8623 TString s2DDiffFlowName = "f2DDiffFlow";
8624 s2DDiffFlowName += fAnalysisLabel->Data();
8625 for(Int_t t=0;t<2;t++) // type: RP or POI
8626 {
8627 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8628 {
8629 // 2D diferential cumulants:
8630 f2DDiffFlowCumulants[t][rci] = new TH2D(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8631 f2DDiffFlowCumulants[t][rci]->SetXTitle("p_{t}");
8632 f2DDiffFlowCumulants[t][rci]->SetYTitle("#eta");
8633 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCumulants[t][rci]); // to be improved - moved to another list
8634 // 2D differential flow:
8635 f2DDiffFlow[t][rci] = new TH2D(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8636 f2DDiffFlow[t][rci]->SetXTitle("p_{t}");
8637 f2DDiffFlow[t][rci]->SetYTitle("#eta");
8638 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlow[t][rci]); // to be improved - moved to another list
8639 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8640 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
8641
8642} // void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
8643
8644//================================================================================================================================
489d5531 8645
8646void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8647{
8648 // Book all histograms and profiles needed for differential flow.
1268c371 8649 // a) Book profile to hold all flags for differential flow;
8650 // b) Define flags locally (to be improved: should I promote flags to data members?);
489d5531 8651 // c) Book e-b-e quantities;
8652 // d) Book profiles;
8653 // e) Book histograms holding final results.
8654
1268c371 8655 // a) Book profile to hold all flags for differential flow:
8656 TString diffFlowFlagsName = "fDiffFlowFlags";
8657 diffFlowFlagsName += fAnalysisLabel->Data();
8658 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for differential flow",5,0,5);
8659 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8660 fDiffFlowFlags->SetMarkerStyle(25);
8661 fDiffFlowFlags->SetLabelSize(0.04,"X");
8662 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8663 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"Calculate diff. flow");
8664 fDiffFlowFlags->GetXaxis()->SetBinLabel(2,"Particle weights");
8665 fDiffFlowFlags->GetXaxis()->SetBinLabel(3,"Event weights");
8666 fDiffFlowFlags->GetXaxis()->SetBinLabel(4,"Correct for NUA");
8667 fDiffFlowFlags->GetXaxis()->SetBinLabel(5,"Calculate 2D diff. flow");
8668 fDiffFlowList->Add(fDiffFlowFlags);
8669
8670 if(!fCalculateDiffFlow){return;}
8671
8672 // b) Define flags locally (to be improved: should I promote flags to data members?):
489d5531 8673 TString typeFlag[2] = {"RP","POI"};
8674 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8675 TString powerFlag[2] = {"linear","quadratic"};
8676 TString sinCosFlag[2] = {"sin","cos"};
8677 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8678 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8679 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
b40a910e 8680 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
489d5531 8681 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8682 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8683 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8684 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8685 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
1268c371 8686
489d5531 8687 // c) Book e-b-e quantities:
8688 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8689 // Explanantion of notation:
8690 // 1.) n is harmonic, m is multiple of harmonic;
8691 // 2.) k is power of particle weight;
8692 // 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);
8693 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8694 // (if i-th POI is also RP, than it is weighted with w_i^k);
8695 // 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
8696 // (i-th RP&&POI is weighted with w_i^k)
8697
8698 // 1D:
8699 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8700 {
8701 for(Int_t pe=0;pe<2;pe++) // pt or eta
8702 {
8703 for(Int_t m=0;m<4;m++) // multiple of harmonic
8704 {
8705 for(Int_t k=0;k<9;k++) // power of particle weight
8706 {
8707 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8708 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8709 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8710 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8711 }
8712 }
8713 }
8714 }
8715 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8716 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8717 {
8718 for(Int_t pe=0;pe<2;pe++) // pt or eta
8719 {
8720 for(Int_t k=0;k<9;k++) // power of particle weight
8721 {
8722 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8723 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8724 }
8725 }
8726 }
8727 // correction terms for nua:
8728 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8729 {
8730 for(Int_t pe=0;pe<2;pe++) // pt or eta
8731 {
8732 for(Int_t sc=0;sc<2;sc++) // sin or cos
8733 {
8734 for(Int_t cti=0;cti<9;cti++) // correction term index
8735 {
8736 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8737 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8738 }
8739 }
8740 }
8741 }
489d5531 8742 // reduced correlations e-b-e:
8743 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8744 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8745 for(Int_t t=0;t<2;t++) // type: RP or POI
8746 {
8747 for(Int_t pe=0;pe<2;pe++) // pt or eta
8748 {
8749 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8750 {
8751 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]);
8752 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8753 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8754 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8755 // event weights for reduced correlations e-b-e:
8756 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8757 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8758 for(Int_t t=0;t<2;t++) // type: RP or POI
8759 {
8760 for(Int_t pe=0;pe<2;pe++) // pt or eta
8761 {
8762 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8763 {
8764 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]);
8765 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8766 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8767 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8768
8769 // d) Book profiles;
8770 // reduced correlations:
8771 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8772 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 8773 // reduced squared correlations:
8774 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8775 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
489d5531 8776 // corrections terms:
8777 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8778 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b40a910e 8779 // reduced correlations:
489d5531 8780 for(Int_t t=0;t<2;t++) // type: RP or POI
8781 {
8782 for(Int_t pe=0;pe<2;pe++) // pt or eta
8783 {
8784 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8785 {
489d5531 8786 fDiffFlowCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
b40a910e 8787 fDiffFlowCorrelationsPro[t][pe][rci]->Sumw2();
489d5531 8788 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8789 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8790 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8791 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8792 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
b40a910e 8793 // reduced squared correlations:
8794 for(Int_t t=0;t<2;t++) // type: RP or POI
8795 {
8796 for(Int_t pe=0;pe<2;pe++) // pt or eta
8797 {
8798 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8799 {
8800 fDiffFlowSquaredCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
8801 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->Sumw2();
8802 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8803 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowSquaredCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8804 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8805 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8806 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
489d5531 8807 // correction terms for nua:
8808 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8809 {
8810 for(Int_t pe=0;pe<2;pe++) // pt or eta
8811 {
8812 for(Int_t sc=0;sc<2;sc++) // sin or cos
8813 {
8814 for(Int_t cti=0;cti<9;cti++) // correction term index
8815 {
8816 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]);
8817 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8818 }
8819 }
8820 }
8821 }
8822 // e) Book histograms holding final results.
8823 // reduced correlations:
8824 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8825 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8826 // corrections terms:
8827 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8828 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8829 // differential covariances:
8830 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8831 diffFlowCovariancesName += fAnalysisLabel->Data();
8832 // differential Q-cumulants:
8833 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8834 diffFlowCumulantsName += fAnalysisLabel->Data();
1268c371 8835 // Detector bias to differential Q-cumulants:
8836 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
8837 diffFlowDetectorBiasName += fAnalysisLabel->Data();
489d5531 8838 // differential flow:
8839 TString diffFlowName = "fDiffFlow";
8840 diffFlowName += fAnalysisLabel->Data();
8841 for(Int_t t=0;t<2;t++) // type: RP or POI
8842 {
8843 for(Int_t pe=0;pe<2;pe++) // pt or eta
8844 {
8845 for(Int_t index=0;index<4;index++)
8846 {
8847 // reduced correlations:
8848 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]);
8849 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8850 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8851 // differential Q-cumulants:
8852 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]);
8853 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8854 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
1268c371 8855 // Detector bias to differential Q-cumulants:
8856 fDiffFlowDetectorBias[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8857 fDiffFlowDetectorBias[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8858 fDiffFlowDetectorBias[t][pe][index]->SetTitle(Form("#frac{corrected}{measured} %s",differentialCumulantIndex[index].Data()));
8859 fDiffFlowDetectorBiasHistList[t][pe]->Add(fDiffFlowDetectorBias[t][pe][index]);
489d5531 8860 // differential flow estimates from Q-cumulants:
8861 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]);
8862 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8863 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8864 } // end of for(Int_t index=0;index<4;index++)
8865 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8866 {
8867 // differential covariances:
8868 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]);
8869 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8870 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8871 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8872 // products of both types of correlations:
8873 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8874 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8875 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8876 {
8877 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8878 {
8879 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]);
8880 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8881 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8882 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8883 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8884 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8885 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8886 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8887 // sums of event weights for reduced correlations:
8888 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8889 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8890 for(Int_t t=0;t<2;t++) // type is RP or POI
8891 {
8892 for(Int_t pe=0;pe<2;pe++) // pt or eta
8893 {
8894 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8895 {
8896 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8897 {
8898 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]);
8899 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8900 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8901 }
8902 }
8903 }
8904 }
8905 // sum of products of event weights for both types of correlations:
8906 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8907 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8908 for(Int_t t=0;t<2;t++) // type is RP or POI
8909 {
8910 for(Int_t pe=0;pe<2;pe++) // pt or eta
8911 {
8912 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8913 {
8914 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8915 {
8916 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]);
8917 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8918 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8919 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8920 }
8921 }
8922 }
8923 }
8924 // correction terms for nua:
8925 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8926 {
8927 for(Int_t pe=0;pe<2;pe++) // pt or eta
8928 {
8929 for(Int_t sc=0;sc<2;sc++) // sin or cos
8930 {
8931 for(Int_t cti=0;cti<9;cti++) // correction term index
8932 {
8933 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]);
8934 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8935 }
8936 }
8937 }
8938 }
8939
8940} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8941
489d5531 8942//================================================================================================================================
8943
489d5531 8944void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8945{
8946 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8947
b92ea2b9 8948 // Isotropic cumulants:
8949 Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
8950 Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
8951 Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
8952 Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
8953 //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
8954 //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
8955 //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
8956 //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
8957
8958 // Measured 2-, 4-, 6- and 8-particle correlations:
489d5531 8959 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
b92ea2b9 8960 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
489d5531 8961 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
b92ea2b9 8962 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
489d5531 8963 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
489d5531 8964 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
b92ea2b9 8965 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
489d5531 8966 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
b92ea2b9 8967
8968 // Non-isotropic terms:
8969 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
8970 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
8971 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
8972 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
8973 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
8974 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
8975 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
8976 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
8977 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
8978 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
8979 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
8980 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
8981
8982 // Shortcuts:
8983 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
8984 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
8985 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
8986 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
8987 Double_t a5 = 4.*c1*s1-s2;
8988
8989 // Covariances (including weight dependent prefactor):
8e1cefdd 8990 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
8991 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
8992 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
8993 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
8994 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
8995 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8996 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
8997 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8998 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
8999 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9000 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9001 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
9002 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9003 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9004 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9005 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9006 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9007 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9008 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9009 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9010 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9011 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9012 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9013 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9014 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9015 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9016 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9017 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9018 if(!fForgetAboutCovariances)
9019 {
9020 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
9021 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
9022 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
9023 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
9024 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9025 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9026 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9027 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9028 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
9029 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9030 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9031 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
9032 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9033 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9034 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9035 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9036 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9037 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9038 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9039 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9040 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9041 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9042 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9043 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9044 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9045 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9046 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9047 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9048 } // end of if(!fForgetAboutCovariances)
9049
b92ea2b9 9050 // Calculating generalized QC{2}:
9051 // Generalized QC{2}:
9052 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
9053 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
9054 // Statistical error of generalized QC{2}:
9055 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
9056 + 4.*pow(s1,2.)*pow(s1Error,2.)
9057 - 4*c1*wCov1-4*s1*wCov2
9058 + 8.*c1*s1*wCov3;
9059 // Store ratio of error squared - with/without NUA terms:
9060 Double_t ratioErrorSquaredQC2 = 0.;
9061 if(fIntFlowQcumulants->GetBinError(1)>0.)
9062 {
9063 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
9064 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
9065 }
9066 // If enabled, store error by including non-isotropic terms:
b77b6434 9067 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9068 {
9069 if(gQC2ErrorSquared>=0.)
9070 {
9071 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
9072 } else
9073 {
9074 fIntFlowQcumulants->SetBinError(1,0.);
9075 cout<<endl;
9076 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
9077 cout<<endl;
9078 }
b77b6434 9079 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9080 // Quantify detector bias to QC{2}:
9081 if(TMath::Abs(QC2)>0.)
9082 {
9083 fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2);
9084 if(QC2Error>0.)
9085 {
9086 Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
9087 if(errorSquared>0.)
9088 {
9089 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
9090 }
9091 }
9092 } // end of if(TMath::Abs(QC2)>0.)
9093
9094 // Calculating generalized QC{4}:
9095 // Generalized QC{4}:
9096 Double_t gQC4 = four-2.*pow(two,2.)
9097 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9098 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9099 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
9100 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
9101 // Statistical error of generalized QC{4}:
9102 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
9103 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
9104 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
9105 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
9106 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
9107 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
9108 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
9109 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
9110 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
9111 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
9112 // Store ratio of error squared - with/without NUA terms:
9113 Double_t ratioErrorSquaredQC4 = 0.;
9114 if(fIntFlowQcumulants->GetBinError(2)>0.)
9115 {
9116 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
9117 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
9118 }
b77b6434 9119 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9120 {
9121 if(gQC4ErrorSquared>=0.)
9122 {
9123 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
9124 } else
9125 {
9126 fIntFlowQcumulants->SetBinError(2,0.);
9127 cout<<endl;
9128 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
9129 cout<<endl;
9130 }
b77b6434 9131 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9132 // Quantify detector bias to QC{4}:
9133 if(TMath::Abs(QC4)>0.)
9134 {
9135 fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4);
9136 if(QC4Error>0.)
9137 {
9138 Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
9139 if(errorSquared>0.)
9140 {
9141 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
9142 }
9143 }
9144 } // end of if(TMath::Abs(QC4)>0.)
489d5531 9145
b92ea2b9 9146
9147 // .... to be improved (continued for 6th and 8th order) ....
9148
9149
2001bc3a 9150 // versus multiplicity:
b77b6434 9151 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
2001bc3a 9152 {
9153 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b77b6434 9154 Double_t value[4] = {0.}; // QCs vs M
9155 Double_t error[4] = {0.}; // error of QCs vs M
9156 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
9157 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
2001bc3a 9158 for(Int_t b=1;b<=nBins;b++)
9159 {
b92ea2b9 9160 // Measured correlations:
2001bc3a 9161 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
9162 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
b92ea2b9 9163 // Isotropic cumulants:
9164 QC2 = two;
9165 QC4 = four-2.*pow(two,2.);
9166 // Non-isotropic terms:
9167 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
9168 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
9169 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
9170 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
9171 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
9172 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
9173 // Generalized QC{2} vs M:
9174 gQC2 = two - pow(c1,2.) - pow(s1,2.);
b77b6434 9175 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
b92ea2b9 9176 // Generalized QC{4} vs M:
9177 gQC4 = four-2.*pow(two,2.)
9178 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9179 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9180 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
b77b6434 9181 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
b92ea2b9 9182 // Detector bias vs M:
9183 if(TMath::Abs(QC2)>0.)
9184 {
9185 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2);
9186 } // end of if(TMath::Abs(QC2)>0.)
9187 if(TMath::Abs(QC4)>0.)
9188 {
9189 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4);
b77b6434 9190 } // end of if(TMath::Abs(QC4)>0.)
9191 // Rebin in M:
9192 for(Int_t co=0;co<4;co++)
9193 {
9194 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
9195 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
9196 if(error[co]>0.)
9197 {
9198 dSum1[co]+=value[co]/(error[co]*error[co]);
9199 dSum2[co]+=1./(error[co]*error[co]);
9200 }
9201 } // end of for(Int_t co=0;co<4;co++)
9202 } // end of for(Int_t b=1;b<=nBins;b++)
9203 // Store rebinned Q-cumulants:
9204 if(fApplyCorrectionForNUAVsM)
9205 {
9206 for(Int_t co=0;co<4;co++)
9207 {
9208 if(dSum2[co]>0.)
9209 {
9210 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
9211 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
9212 }
9213 } // end of for(Int_t co=0;co<4;co++)
9214 } // end of if(fApplyCorrectionForNUAVsM)
9215 } // end of if(fCalculateCumulantsVsM)
2001bc3a 9216
489d5531 9217} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
0328db2d 9218
489d5531 9219//================================================================================================================================
9220
489d5531 9221void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9222{
0328db2d 9223 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 9224 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 9225 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 9226 //
9227 // Remark: Statistical error of correction temrs is calculated as:
9228 //
9229 // statistical error = termA * spread * termB:
9230 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
9231 // termB = 1/sqrt(1-termA^2)
9232
b92ea2b9 9233 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
9234 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
9235
489d5531 9236 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
9237 {
b92ea2b9 9238 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 9239 {
9240 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 9241 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
9242 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
9243 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
9244 Double_t termA = 0.;
9245 Double_t termB = 0.;
b92ea2b9 9246 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
0328db2d 9247 {
9248 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
9249 } else
9250 {
b92ea2b9 9251 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9252 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
0328db2d 9253 }
489d5531 9254 if(1.-pow(termA,2.) > 0.)
9255 {
9256 termB = 1./pow(1-pow(termA,2.),0.5);
9257 } else
9258 {
b92ea2b9 9259 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9260 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
489d5531 9261 }
9262 Double_t statisticalError = termA * spread * termB;
489d5531 9263 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 9264 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
b92ea2b9 9265 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
489d5531 9266 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
9267
9268} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9269
489d5531 9270//================================================================================================================================
9271
489d5531 9272void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9273{
9274 // Get pointers to all objects relevant for calculations with nested loops.
9275
9276 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
9277 if(nestedLoopsList)
9278 {
9279 this->SetNestedLoopsList(nestedLoopsList);
9280 } else
9281 {
9282 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9283 exit(0);
9284 }
9285
9286 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
9287 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
9288 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
9289 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
9290
9291 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
9292 evaluateNestedLoopsName += fAnalysisLabel->Data();
9293 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
9294 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
9295 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
9296 if(evaluateNestedLoops)
9297 {
9298 this->SetEvaluateNestedLoops(evaluateNestedLoops);
9299 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
9300 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
9301 }
9302 // nested loops relevant for integrated flow:
9303 if(bEvaluateIntFlowNestedLoops)
9304 {
9305 // correlations:
9306 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
9307 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
9308 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
9309 if(intFlowDirectCorrelations)
9310 {
9311 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
9312 } else
9313 {
9314 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9315 exit(0);
9316 }
9317 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9318 {
9319 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
9320 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
9321 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
9322 if(intFlowExtraDirectCorrelations)
9323 {
9324 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
9325 } else
9326 {
9327 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9328 exit(0);
9329 }
9330 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9331 // correction terms for non-uniform acceptance:
9332 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
9333 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9334 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
9335 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9336 {
9337 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
9338 if(intFlowDirectCorrectionTermsForNUA[sc])
9339 {
9340 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
9341 } else
9342 {
9343 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9344 cout<<"sc = "<<sc<<endl;
9345 exit(0);
9346 }
9347 } // end of for(Int_t sc=0;sc<2;sc++)
9348 } // end of if(bEvaluateIntFlowNestedLoops)
9349
9350 // nested loops relevant for differential flow:
9351 if(bEvaluateDiffFlowNestedLoops)
9352 {
9353 // correlations:
9354 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
9355 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
9356 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
9357 for(Int_t t=0;t<2;t++)
9358 {
9359 for(Int_t pe=0;pe<2;pe++)
9360 {
9361 for(Int_t ci=0;ci<4;ci++) // correlation index
9362 {
9363 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())));
9364 if(diffFlowDirectCorrelations[t][pe][ci])
9365 {
9366 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
9367 } else
9368 {
9369 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9370 cout<<"t = "<<t<<endl;
9371 cout<<"pe = "<<pe<<endl;
9372 cout<<"ci = "<<ci<<endl;
9373 }
9374 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9375 } // end of for(Int_t pe=0;pe<2;pe++)
9376 } // end of for(Int_t t=0;t<2;t++)
9377 // correction terms for non-uniform acceptance:
9378 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
9379 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9380 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
9381 for(Int_t t=0;t<2;t++)
9382 {
9383 for(Int_t pe=0;pe<2;pe++)
9384 {
9385 // correction terms for NUA:
9386 for(Int_t sc=0;sc<2;sc++) // sin or cos
9387 {
9388 for(Int_t cti=0;cti<9;cti++) // correction term index
9389 {
9390 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)));
9391 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
9392 {
9393 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
9394 } else
9395 {
9396 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9397 cout<<"t = "<<t<<endl;
9398 cout<<"pe = "<<pe<<endl;
9399 cout<<"sc = "<<sc<<endl;
9400 cout<<"cti = "<<cti<<endl;
9401 }
9402 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9403 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9404 } // end of for(Int_t pe=0;pe<2;pe++)
9405 } // end of for(Int_t t=0;t<2;t++)
9406 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
9407 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
9408 TH1D *noOfParticlesInBin = NULL;
9409 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
9410 if(noOfParticlesInBin)
9411 {
9412 this->SetNoOfParticlesInBin(noOfParticlesInBin);
9413 } else
9414 {
9415 cout<<endl;
9416 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9417 cout<<endl;
9418 }
9419 } // end of if(bEvaluateDiffFlowNestedLoops)
9420
9421} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9422
489d5531 9423//================================================================================================================================
9424
489d5531 9425void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9426{
9427 // Store flow harmonic in common control histograms.
9428
9429 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
dd442cd2 9430 if(fFillMultipleControlHistograms)
9431 {
9432 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
9433 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
9434 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
9435 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9436 }
9437
489d5531 9438} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9439
489d5531 9440//================================================================================================================================
9441
489d5531 9442void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9443{
9444 // Calculate all correlations needed for differential flow using particle weights.
9445
2a98ceb8 9446 Int_t t = 0; // type flag
9447 Int_t pe = 0; // ptEta flag
489d5531 9448
9449 if(type == "RP")
9450 {
9451 t = 0;
9452 } else if(type == "POI")
9453 {
9454 t = 1;
9455 }
9456
9457 if(ptOrEta == "Pt")
9458 {
9459 pe = 0;
9460 } else if(ptOrEta == "Eta")
9461 {
9462 pe = 1;
9463 }
9464
9465 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9466 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9467 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9468 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9469
9470 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9471 Double_t dReQ1n1k = (*fReQ)(0,1);
9472 Double_t dReQ2n2k = (*fReQ)(1,2);
9473 Double_t dReQ1n3k = (*fReQ)(0,3);
9474 //Double_t dReQ4n4k = (*fReQ)(3,4);
9475 Double_t dImQ1n1k = (*fImQ)(0,1);
9476 Double_t dImQ2n2k = (*fImQ)(1,2);
9477 Double_t dImQ1n3k = (*fImQ)(0,3);
9478 //Double_t dImQ4n4k = (*fImQ)(3,4);
9479
1268c371 9480 // S^M_{p,k} (see .h file for the definition of fSpk):
9481 Double_t dSM1p1k = (*fSpk)(0,1);
9482 Double_t dSM1p2k = (*fSpk)(0,2);
9483 Double_t dSM1p3k = (*fSpk)(0,3);
9484 Double_t dSM2p1k = (*fSpk)(1,1);
9485 Double_t dSM3p1k = (*fSpk)(2,1);
489d5531 9486
9487 // looping over all bins and calculating reduced correlations:
9488 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9489 {
9490 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9491 Double_t p1n0kRe = 0.;
9492 Double_t p1n0kIm = 0.;
9493
9494 // number of POIs in particular (pt,eta) bin):
9495 Double_t mp = 0.;
9496
9497 // real and imaginary parts of q_{m*n,k}:
9498 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9499 Double_t q1n2kRe = 0.;
9500 Double_t q1n2kIm = 0.;
9501 Double_t q2n1kRe = 0.;
9502 Double_t q2n1kIm = 0.;
9503
9504 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9505 Double_t s1p1k = 0.;
9506 Double_t s1p2k = 0.;
9507 Double_t s1p3k = 0.;
9508
9509 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9510 Double_t dM0111 = 0.;
9511
9512 if(type == "POI")
9513 {
9514 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9515 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9516 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9517 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9518
9519 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9520
9521 t = 1; // typeFlag = RP or POI
9522
9523 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9524 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9525 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9526 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9527 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9528 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9529 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9530 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9531 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9532
9533 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9534 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9535 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9536 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9537
9538 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9539 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9540 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9541 + 2.*(s1p3k-s1p2k*dSM1p1k));
9542 }
9543 else if(type == "RP")
9544 {
9545 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9546 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9547 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9548 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9549 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9550 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9551 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9552 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9553 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9554
9555 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9556 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9557 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9558 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9559
9560 // to be improved (cross-checked):
9561 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9562 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9563 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9564 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9565
9566 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9567
9568 t = 0; // typeFlag = RP or POI
9569
9570 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9571 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9572 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9573 + 2.*(s1p3k-s1p2k*dSM1p1k));
9574 //...............................................................................................
9575 }
9576
9577 // 2'-particle correlation:
9578 Double_t two1n1nW0W1 = 0.;
9579 if(mp*dSM1p1k-s1p1k)
9580 {
9581 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9582 / (mp*dSM1p1k-s1p1k);
9583
9584 // fill profile to get <<2'>>
b40a910e 9585 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9586 // fill profile to get <<2'>^2>
9587 fDiffFlowSquaredCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1*two1n1nW0W1,mp*dSM1p1k-s1p1k);
489d5531 9588 // histogram to store <2'> e-b-e (needed in some other methods):
9589 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9590 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9591 } // end of if(mp*dSM1p1k-s1p1k)
9592
9593 // 4'-particle correlation:
9594 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9595 if(dM0111)
9596 {
9597 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9598 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9599 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9600 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9601 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9602 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9603 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9604 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9605 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9606 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9607 + 2.*s1p1k*dSM1p2k
9608 - 6.*s1p3k)
9609 / dM0111; // to be improved (notation of dM0111)
9610
9611 // fill profile to get <<4'>>
b40a910e 9612 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9613 // fill profile to get <<4'>^2>
9614 fDiffFlowSquaredCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1*four1n1n1n1nW0W1W1W1,dM0111);
489d5531 9615 // histogram to store <4'> e-b-e (needed in some other methods):
9616 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9617 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9618 } // end of if(dM0111)
9619 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9620
9621} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9622
489d5531 9623//================================================================================================================================
9624
489d5531 9625void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9626{
9627 // Fill common control histograms.
9628
9629 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9630 fCommonHists->FillControlHistograms(anEvent);
dd442cd2 9631 if(fFillMultipleControlHistograms)
489d5531 9632 {
dd442cd2 9633 if(nRP>1)
489d5531 9634 {
dd442cd2 9635 fCommonHists2nd->FillControlHistograms(anEvent);
9636 if(nRP>3)
489d5531 9637 {
dd442cd2 9638 fCommonHists4th->FillControlHistograms(anEvent);
9639 if(nRP>5)
489d5531 9640 {
dd442cd2 9641 fCommonHists6th->FillControlHistograms(anEvent);
9642 if(nRP>7)
9643 {
9644 fCommonHists8th->FillControlHistograms(anEvent);
9645 } // end of if(nRP>7)
9646 } // end of if(nRP>5)
9647 } // end of if(nRP>3)
9648 } // end of if(nRP>1)
9649 } // end of if(fFillMultipleControlHistograms)
489d5531 9650
9651} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9652
489d5531 9653//================================================================================================================================
9654
489d5531 9655void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9656{
9657 // Reset all event by event quantities.
9658
1268c371 9659 // Reference flow:
489d5531 9660 fReQ->Zero();
9661 fImQ->Zero();
1268c371 9662 fSpk->Zero();
489d5531 9663 fIntFlowCorrelationsEBE->Reset();
9664 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9665 fIntFlowCorrelationsAllEBE->Reset();
9666
b92ea2b9 9667 for(Int_t sc=0;sc<2;sc++)
489d5531 9668 {
b92ea2b9 9669 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
9670 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 9671 }
9672
1268c371 9673 // Differential flow:
9674 if(fCalculateDiffFlow)
489d5531 9675 {
1268c371 9676 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
489d5531 9677 {
1268c371 9678 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 9679 {
1268c371 9680 for(Int_t m=0;m<4;m++) // multiple of harmonic
489d5531 9681 {
1268c371 9682 for(Int_t k=0;k<9;k++) // power of weight
9683 {
9684 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9685 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9686 }
9687 }
489d5531 9688 }
1268c371 9689 }
9690 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9691 {
9692 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 9693 {
1268c371 9694 for(Int_t k=0;k<9;k++)
9695 {
9696 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9697 }
489d5531 9698 }
9699 }
1268c371 9700 // e-b-e reduced correlations:
9701 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9702 {
9703 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 9704 {
1268c371 9705 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9706 {
9707 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9708 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9709 }
489d5531 9710 }
1268c371 9711 }
9712 // correction terms for NUA:
9713 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9714 {
9715 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 9716 {
1268c371 9717 for(Int_t sc=0;sc<2;sc++) // sin or cos
489d5531 9718 {
1268c371 9719 for(Int_t cti=0;cti<9;cti++) // correction term index
9720 {
489d5531 9721 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
1268c371 9722 }
489d5531 9723 }
1268c371 9724 }
9725 }
9726 } // end of if(fCalculateDiffFlow)
9727
489d5531 9728 // 2D (pt,eta)
1268c371 9729 if(fCalculate2DDiffFlow)
489d5531 9730 {
9731 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9732 {
9733 for(Int_t m=0;m<4;m++) // multiple of harmonic
9734 {
9735 for(Int_t k=0;k<9;k++) // power of weight
9736 {
b77b6434 9737 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
9738 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
489d5531 9739 }
9740 }
9741 }
9742 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9743 {
9744 for(Int_t k=0;k<9;k++)
9745 {
b77b6434 9746 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
489d5531 9747 }
9748 }
1268c371 9749 } // end of if(fCalculate2DDiffFlow)
489d5531 9750
9751} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9752
489d5531 9753//================================================================================================================================
9754
489d5531 9755void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9756{
9757 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9758
9759 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9760 // 0: <<sin n(psi1)>>
9761 // 1: <<sin n(psi1+phi2)>>
9762 // 2: <<sin n(psi1+phi2-phi3)>>
9763 // 3: <<sin n(psi1-phi2-phi3)>>:
9764 // 4:
9765 // 5:
9766 // 6:
9767
9768 // multiplicity:
1268c371 9769 Double_t dMult = (*fSpk)(0,0);
489d5531 9770
9771 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9772 Double_t dReQ1n = (*fReQ)(0,0);
9773 Double_t dReQ2n = (*fReQ)(1,0);
9774 //Double_t dReQ3n = (*fReQ)(2,0);
9775 //Double_t dReQ4n = (*fReQ)(3,0);
9776 Double_t dImQ1n = (*fImQ)(0,0);
9777 Double_t dImQ2n = (*fImQ)(1,0);
9778 //Double_t dImQ3n = (*fImQ)(2,0);
9779 //Double_t dImQ4n = (*fImQ)(3,0);
9780
2a98ceb8 9781 Int_t t = 0; // type flag
9782 Int_t pe = 0; // ptEta flag
489d5531 9783
9784 if(type == "RP")
9785 {
9786 t = 0;
9787 } else if(type == "POI")
9788 {
9789 t = 1;
9790 }
9791
9792 if(ptOrEta == "Pt")
9793 {
9794 pe = 0;
9795 } else if(ptOrEta == "Eta")
9796 {
9797 pe = 1;
9798 }
9799
9800 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9801 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9802 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9803 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9804
9805 // looping over all bins and calculating correction terms:
9806 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9807 {
9808 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9809 Double_t p1n0kRe = 0.;
9810 Double_t p1n0kIm = 0.;
9811
9812 // number of POIs in particular pt or eta bin:
9813 Double_t mp = 0.;
9814
9815 // 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):
9816 Double_t q1n0kRe = 0.;
9817 Double_t q1n0kIm = 0.;
9818 Double_t q2n0kRe = 0.;
9819 Double_t q2n0kIm = 0.;
9820
9821 // number of particles which are both RPs and POIs in particular pt or eta bin:
9822 Double_t mq = 0.;
9823
9824 if(type == "POI")
9825 {
9826 // q_{m*n,0}:
9827 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9828 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9829 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9830 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9831 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9832 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9833 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9834 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9835
9836 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9837 }
9838 else if(type == "RP")
9839 {
9840 // q_{m*n,0}:
9841 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9842 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9843 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9844 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9845 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9846 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9847 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9848 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9849
9850 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9851 }
9852 if(type == "POI")
9853 {
9854 // p_{m*n,0}:
9855 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9856 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9857 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9858 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9859
9860 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9861
9862 t = 1; // typeFlag = RP or POI
9863 }
9864 else if(type == "RP")
9865 {
9866 // p_{m*n,0} = q_{m*n,0}:
9867 p1n0kRe = q1n0kRe;
9868 p1n0kIm = q1n0kIm;
9869
9870 mp = mq;
9871
9872 t = 0; // typeFlag = RP or POI
9873 }
9874
9875 // <<sin n(psi1)>>:
9876 Double_t sinP1nPsi = 0.;
9877 if(mp)
9878 {
9879 sinP1nPsi = p1n0kIm/mp;
9880 // fill profile for <<sin n(psi1)>>:
9881 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9882 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9883 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9884 } // end of if(mp)
9885
9886 // <<sin n(psi1+phi2)>>:
9887 Double_t sinP1nPsiP1nPhi = 0.;
9888 if(mp*dMult-mq)
9889 {
9890 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9891 // fill profile for <<sin n(psi1+phi2)>>:
9892 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9893 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9894 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9895 } // end of if(mp*dMult-mq)
9896
9897 // <<sin n(psi1+phi2-phi3)>>:
9898 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9899 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9900 {
9901 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9902 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9903 - mq*dImQ1n+2.*q1n0kIm)
9904 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9905 // fill profile for <<sin n(psi1+phi2)>>:
9906 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9907 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9908 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9909 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9910
9911 // <<sin n(psi1-phi2-phi3)>>:
9912 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9913 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9914 {
9915 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9916 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9917 + 2.*mq*dImQ1n-2.*q1n0kIm)
9918 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9919 // fill profile for <<sin n(psi1+phi2)>>:
9920 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9921 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9922 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9923 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9924 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9925
9926} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9927
9928
9929//================================================================================================================================
9930
9931
9932void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9933{
9934 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9935
9936 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9937 // 0: <<cos n(psi)>>
9938 // 1: <<cos n(psi1+phi2)>>
9939 // 2: <<cos n(psi1+phi2-phi3)>>
9940 // 3: <<cos n(psi1-phi2-phi3)>>
9941 // 4:
9942 // 5:
9943 // 6:
9944
9945 // multiplicity:
1268c371 9946 Double_t dMult = (*fSpk)(0,0);
489d5531 9947
9948 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9949 Double_t dReQ1n = (*fReQ)(0,0);
9950 Double_t dReQ2n = (*fReQ)(1,0);
9951 //Double_t dReQ3n = (*fReQ)(2,0);
9952 //Double_t dReQ4n = (*fReQ)(3,0);
9953 Double_t dImQ1n = (*fImQ)(0,0);
9954 Double_t dImQ2n = (*fImQ)(1,0);
9955 //Double_t dImQ3n = (*fImQ)(2,0);
9956 //Double_t dImQ4n = (*fImQ)(3,0);
9957
2a98ceb8 9958 Int_t t = 0; // type flag
9959 Int_t pe = 0; // ptEta flag
489d5531 9960
9961 if(type == "RP")
9962 {
9963 t = 0;
9964 } else if(type == "POI")
9965 {
9966 t = 1;
9967 }
9968
9969 if(ptOrEta == "Pt")
9970 {
9971 pe = 0;
9972 } else if(ptOrEta == "Eta")
9973 {
9974 pe = 1;
9975 }
9976
9977 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9978 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9979 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9980 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9981
9982 // looping over all bins and calculating correction terms:
9983 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9984 {
9985 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9986 Double_t p1n0kRe = 0.;
9987 Double_t p1n0kIm = 0.;
9988
9989 // number of POIs in particular pt or eta bin:
9990 Double_t mp = 0.;
9991
9992 // 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):
9993 Double_t q1n0kRe = 0.;
9994 Double_t q1n0kIm = 0.;
9995 Double_t q2n0kRe = 0.;
9996 Double_t q2n0kIm = 0.;
9997
9998 // number of particles which are both RPs and POIs in particular pt or eta bin:
9999 Double_t mq = 0.;
10000
10001 if(type == "POI")
10002 {
10003 // q_{m*n,0}:
10004 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10005 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10006 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10007 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10008 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10009 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10010 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10011 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10012
10013 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10014 }
10015 else if(type == "RP")
10016 {
10017 // q_{m*n,0}:
10018 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10019 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10020 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10021 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10022 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10023 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10024 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10025 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10026
10027 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10028 }
10029 if(type == "POI")
10030 {
10031 // p_{m*n,0}:
10032 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10033 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10034 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10035 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10036
10037 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10038
10039 t = 1; // typeFlag = RP or POI
10040 }
10041 else if(type == "RP")
10042 {
10043 // p_{m*n,0} = q_{m*n,0}:
10044 p1n0kRe = q1n0kRe;
10045 p1n0kIm = q1n0kIm;
10046
10047 mp = mq;
10048
10049 t = 0; // typeFlag = RP or POI
10050 }
10051
10052 // <<cos n(psi1)>>:
10053 Double_t cosP1nPsi = 0.;
10054 if(mp)
10055 {
10056 cosP1nPsi = p1n0kRe/mp;
10057
10058 // fill profile for <<cos n(psi1)>>:
10059 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
10060 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
10061 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
10062 } // end of if(mp)
10063
10064 // <<cos n(psi1+phi2)>>:
10065 Double_t cosP1nPsiP1nPhi = 0.;
10066 if(mp*dMult-mq)
10067 {
10068 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
10069 // fill profile for <<sin n(psi1+phi2)>>:
10070 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
10071 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10072 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
10073 } // end of if(mp*dMult-mq)
10074
10075 // <<cos n(psi1+phi2-phi3)>>:
10076 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
10077 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10078 {
10079 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10080 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
10081 - mq*dReQ1n+2.*q1n0kRe)
10082 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10083 // fill profile for <<sin n(psi1+phi2)>>:
10084 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10085 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10086 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
10087 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10088
10089 // <<cos n(psi1-phi2-phi3)>>:
10090 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
10091 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10092 {
10093 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
10094 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
10095 - 2.*mq*dReQ1n+2.*q1n0kRe)
10096 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10097 // fill profile for <<sin n(psi1+phi2)>>:
10098 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10099 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10100 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
10101 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10102 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10103
10104} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
10105
489d5531 10106//==================================================================================================================================
10107
489d5531 10108void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10109{
1268c371 10110 // Transfer profiles into histogams and correctly propagate the error.
489d5531 10111
2a98ceb8 10112 Int_t t = 0; // type flag
10113 Int_t pe = 0; // ptEta flag
489d5531 10114
10115 if(type == "RP")
10116 {
10117 t = 0;
10118 } else if(type == "POI")
10119 {
10120 t = 1;
10121 }
10122
10123 if(ptOrEta == "Pt")
10124 {
10125 pe = 0;
10126 } else if(ptOrEta == "Eta")
10127 {
10128 pe = 1;
10129 }
10130
10131 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10132 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
10133 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10134 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10135
10136 for(Int_t sc=0;sc<2;sc++) // sin or cos
10137 {
10138 for(Int_t cti=0;cti<9;cti++) // correction term index
10139 {
10140 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10141 {
10142 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
10143 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
10144 // to be improved (propagate error correctly)
10145 // ...
10146 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10147 } // correction term index
10148 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10149
10150}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10151
489d5531 10152//==================================================================================================================================
10153
489d5531 10154void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10155{
1268c371 10156 // Calculate generalized differential flow cumulants (corrected for non-uniform acceptance).
10157
10158 // to be improved - propagate error also from non-isotropic terms
489d5531 10159
1268c371 10160 Int_t t = 0; // RP = 0, POI = 1
10161 Int_t pe = 0; // pt = 0, eta = 1
489d5531 10162
10163 if(type == "RP")
10164 {
1268c371 10165 t = 0;
489d5531 10166 } else if(type == "POI")
10167 {
1268c371 10168 t = 1;
489d5531 10169 }
10170
10171 if(ptOrEta == "Pt")
10172 {
1268c371 10173 pe = 0;
489d5531 10174 } else if(ptOrEta == "Eta")
10175 {
1268c371 10176 pe = 1;
489d5531 10177 }
1268c371 10178
10179 // Common:
489d5531 10180 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 10181 // 2-particle correlation:
10182 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
1268c371 10183 // sinus terms coming from reference flow:
489d5531 10184 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
10185 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
10186 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
1268c371 10187 // cosinus terms coming from reference flow:
489d5531 10188 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
10189 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
10190 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
10191
10192 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10193 {
10194 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
10195 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
10196 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
10197 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
10198 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
10199 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
10200 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
10201 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
10202 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
10203 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
1268c371 10204 // Generalized QC{2'}:
489d5531 10205 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
1268c371 10206 if(fApplyCorrectionForNUA)
10207 {
10208 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
10209 }
10210 if(TMath::Abs(twoPrime)>0.)
10211 {
10212 fDiffFlowDetectorBias[t][pe][0]->SetBinContent(b,qc2Prime/twoPrime); // detector bias = generalized/isotropic cumulant.
10213 }
10214 // Generalized QC{4'}:
489d5531 10215 Double_t qc4Prime = fourPrime-2.*twoPrime*two
10216 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
10217 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
10218 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
10219 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
10220 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
10221 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
10222 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
10223 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
10224 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10225 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
10226 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
10227 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10228 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
10229 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
10230 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10231 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10232 - 12.*cosP1nPhi*sinP1nPhi
10233 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
1268c371 10234 if(fApplyCorrectionForNUA)
10235 {
10236 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
10237 }
10238 if(TMath::Abs(fourPrime-2.*twoPrime*two)>0.)
10239 {
10240 fDiffFlowDetectorBias[t][pe][1]->SetBinContent(b,qc4Prime/(fourPrime-2.*twoPrime*two)); // detector bias = generalized/isotropic cumulant.
10241 }
489d5531 10242 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
10243
10244} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10245
1268c371 10246//==================================================================================================================================
489d5531 10247
10248void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
10249{
10250 // Calculate differential flow corrected for non-uniform acceptance.
10251
1268c371 10252 // to be improved: eventually I will have to access here masured correlations and NUA terms
10253 // instead of cumulants in order to propagate statistical error correctly also
10254 // to NUA terms (propagating errors directly from cumulants is WRONG for
10255 // differential flow becuase that doesn't account at all cross-covariance terms)
489d5531 10256
1268c371 10257 // REMARK: When NUA correction is apllied error for differential flow DOES NOT get corrected,
10258 // i.e. only value is being corrected, error is still the one relevant for isotropic
10259 // case. This eventually will be resolved.
10260
10261
10262 Int_t t = 0; // RP or POI
10263 Int_t pe = 0; // pt or eta
489d5531 10264
10265 if(type == "RP")
10266 {
1268c371 10267 t = 0;
489d5531 10268 } else if(type == "POI")
10269 {
1268c371 10270 t = 1;
10271 }
489d5531 10272 if(ptOrEta == "Pt")
10273 {
1268c371 10274 pe = 0;
489d5531 10275 } else if(ptOrEta == "Eta")
10276 {
1268c371 10277 pe = 1;
489d5531 10278 }
10279
1268c371 10280 // Common:
489d5531 10281 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
1268c371 10282 // Reference Q-cumulants
10283 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
10284 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
10285 // Loop over pt or eta bins:
489d5531 10286 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10287 {
1268c371 10288 // Differential Q-cumulants:
10289 Double_t qc2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b); // QC{2'}
10290 Double_t qc4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b); // QC{4'}
489d5531 10291 // v'{2}:
1268c371 10292 if(qc2>0.)
489d5531 10293 {
1268c371 10294 Double_t v2Prime = qc2Prime/pow(qc2,0.5);
10295 if(TMath::Abs(v2Prime)>0.){fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);}
489d5531 10296 }
489d5531 10297 // v'{4}:
1268c371 10298 if(qc4<0.)
489d5531 10299 {
1268c371 10300 Double_t v4Prime = -qc4Prime/pow(-qc4,3./4.);
10301 if(TMath::Abs(v4Prime)>0.){fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);}
489d5531 10302 }
10303 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
10304
10305} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
10306
489d5531 10307//==================================================================================================================================
10308
0328db2d 10309void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10310{
10311 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
10312
10313 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
10314 //
10315 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
10316 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
10317 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
10318 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
10319 // 5th bin: ---- EMPTY ----
10320 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
10321 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
10322 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
10323 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
10324 // 10th bin: ---- EMPTY ----
10325 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
10326 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
10327 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
10328 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
10329 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
10330 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
10331 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
10332 // 18th bin: ---- EMPTY ----
10333 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
10334 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
10335 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
10336 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
10337 // 23rd bin: ---- EMPTY ----
10338 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
10339 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
10340 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
10341 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
10342 // 28th bin: ---- EMPTY ----
10343 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
10344 // 30th bin: ---- EMPTY ----
10345 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
8ed4edc7 10346 // 32nd bin: ---- EMPTY ----
10347 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
10348 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
10349
489d5531 10350 Int_t nPrim = anEvent->NumberOfTracks();
10351 AliFlowTrackSimple *aftsTrack = NULL;
10352 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10353 Int_t n = fHarmonic;
10354 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 10355 Double_t dMult = (*fSpk)(0,0);
489d5531 10356 cout<<endl;
10357 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10358 if(dMult<2)
10359 {
10360 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10361 } else if (dMult>fMaxAllowedMultiplicity)
10362 {
10363 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10364 } else
10365 {
10366 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10367 }
10368
10369 // 2-particle correlations:
10370 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10371 {
10372 for(Int_t i1=0;i1<nPrim;i1++)
10373 {
10374 aftsTrack=anEvent->GetTrack(i1);
10375 if(!(aftsTrack->InRPSelection())) continue;
10376 phi1=aftsTrack->Phi();
10377 for(Int_t i2=0;i2<nPrim;i2++)
10378 {
10379 if(i2==i1)continue;
10380 aftsTrack=anEvent->GetTrack(i2);
10381 if(!(aftsTrack->InRPSelection())) continue;
10382 phi2=aftsTrack->Phi();
10383 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10384 // fill the profile with 2-p correlations:
10385 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
10386 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
10387 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
10388 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
10389 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10390 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10391 } // end of if(nPrim>=2)
10392
10393 // 3-particle correlations:
10394 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10395 {
10396 for(Int_t i1=0;i1<nPrim;i1++)
10397 {
10398 aftsTrack=anEvent->GetTrack(i1);
10399 if(!(aftsTrack->InRPSelection())) continue;
10400 phi1=aftsTrack->Phi();
10401 for(Int_t i2=0;i2<nPrim;i2++)
10402 {
10403 if(i2==i1)continue;
10404 aftsTrack=anEvent->GetTrack(i2);
10405 if(!(aftsTrack->InRPSelection())) continue;
10406 phi2=aftsTrack->Phi();
10407 for(Int_t i3=0;i3<nPrim;i3++)
10408 {
10409 if(i3==i1||i3==i2)continue;
10410 aftsTrack=anEvent->GetTrack(i3);
10411 if(!(aftsTrack->InRPSelection())) continue;
10412 phi3=aftsTrack->Phi();
10413 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10414 // fill the profile with 3-p correlations:
10415 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
10416 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
10417 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
10418 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
10419 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10420 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10421 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10422 } // end of if(nPrim>=3)
10423
10424 // 4-particle correlations:
10425 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10426 {
10427 for(Int_t i1=0;i1<nPrim;i1++)
10428 {
10429 aftsTrack=anEvent->GetTrack(i1);
10430 if(!(aftsTrack->InRPSelection())) continue;
10431 phi1=aftsTrack->Phi();
10432 for(Int_t i2=0;i2<nPrim;i2++)
10433 {
10434 if(i2==i1)continue;
10435 aftsTrack=anEvent->GetTrack(i2);
10436 if(!(aftsTrack->InRPSelection())) continue;
10437 phi2=aftsTrack->Phi();
10438 for(Int_t i3=0;i3<nPrim;i3++)
10439 {
10440 if(i3==i1||i3==i2)continue;
10441 aftsTrack=anEvent->GetTrack(i3);
10442 if(!(aftsTrack->InRPSelection())) continue;
10443 phi3=aftsTrack->Phi();
10444 for(Int_t i4=0;i4<nPrim;i4++)
10445 {
10446 if(i4==i1||i4==i2||i4==i3)continue;
10447 aftsTrack=anEvent->GetTrack(i4);
10448 if(!(aftsTrack->InRPSelection())) continue;
10449 phi4=aftsTrack->Phi();
10450 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10451 // fill the profile with 4-p correlations:
10452 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10453 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10454 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10455 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10456 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10457 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10458 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
8ed4edc7 10459 fIntFlowDirectCorrelations->Fill(32.,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
489d5531 10460 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10461 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10462 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10463 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10464 } // end of if(nPrim>=)
10465
10466 // 5-particle correlations:
10467 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10468 {
10469 for(Int_t i1=0;i1<nPrim;i1++)
10470 {
10471 aftsTrack=anEvent->GetTrack(i1);
10472 if(!(aftsTrack->InRPSelection())) continue;
10473 phi1=aftsTrack->Phi();
10474 for(Int_t i2=0;i2<nPrim;i2++)
10475 {
10476 if(i2==i1)continue;
10477 aftsTrack=anEvent->GetTrack(i2);
10478 if(!(aftsTrack->InRPSelection())) continue;
10479 phi2=aftsTrack->Phi();
10480 for(Int_t i3=0;i3<nPrim;i3++)
10481 {
10482 if(i3==i1||i3==i2)continue;
10483 aftsTrack=anEvent->GetTrack(i3);
10484 if(!(aftsTrack->InRPSelection())) continue;
10485 phi3=aftsTrack->Phi();
10486 for(Int_t i4=0;i4<nPrim;i4++)
10487 {
10488 if(i4==i1||i4==i2||i4==i3)continue;
10489 aftsTrack=anEvent->GetTrack(i4);
10490 if(!(aftsTrack->InRPSelection())) continue;
10491 phi4=aftsTrack->Phi();
10492 for(Int_t i5=0;i5<nPrim;i5++)
10493 {
10494 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10495 aftsTrack=anEvent->GetTrack(i5);
10496 if(!(aftsTrack->InRPSelection())) continue;
10497 phi5=aftsTrack->Phi();
10498 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10499 // fill the profile with 5-p correlations:
10500 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10501 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10502 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10503 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
8ed4edc7 10504 fIntFlowDirectCorrelations->Fill(33.,cos(2.*n*phi1+2.*n*phi2+2.*n*phi3-3.*n*phi4-3.*n*phi5),1.);
489d5531 10505 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10506 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10507 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10508 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10509 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10510 } // end of if(nPrim>=5)
10511
10512 // 6-particle correlations:
10513 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10514 {
10515 for(Int_t i1=0;i1<nPrim;i1++)
10516 {
10517 aftsTrack=anEvent->GetTrack(i1);
10518 if(!(aftsTrack->InRPSelection())) continue;
10519 phi1=aftsTrack->Phi();
10520 for(Int_t i2=0;i2<nPrim;i2++)
10521 {
10522 if(i2==i1)continue;
10523 aftsTrack=anEvent->GetTrack(i2);
10524 if(!(aftsTrack->InRPSelection())) continue;
10525 phi2=aftsTrack->Phi();
10526 for(Int_t i3=0;i3<nPrim;i3++)
10527 {
10528 if(i3==i1||i3==i2)continue;
10529 aftsTrack=anEvent->GetTrack(i3);
10530 if(!(aftsTrack->InRPSelection())) continue;
10531 phi3=aftsTrack->Phi();
10532 for(Int_t i4=0;i4<nPrim;i4++)
10533 {
10534 if(i4==i1||i4==i2||i4==i3)continue;
10535 aftsTrack=anEvent->GetTrack(i4);
10536 if(!(aftsTrack->InRPSelection())) continue;
10537 phi4=aftsTrack->Phi();
10538 for(Int_t i5=0;i5<nPrim;i5++)
10539 {
10540 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10541 aftsTrack=anEvent->GetTrack(i5);
10542 if(!(aftsTrack->InRPSelection())) continue;
10543 phi5=aftsTrack->Phi();
10544 for(Int_t i6=0;i6<nPrim;i6++)
10545 {
10546 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10547 aftsTrack=anEvent->GetTrack(i6);
10548 if(!(aftsTrack->InRPSelection())) continue;
10549 phi6=aftsTrack->Phi();
10550 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10551 // fill the profile with 6-p correlations:
10552 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10553 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}
10554 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}
10555 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}
10556 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10557 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10558 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10559 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10560 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10561 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10562 } // end of if(nPrim>=6)
10563
10564 // 7-particle correlations:
10565 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10566 {
10567 for(Int_t i1=0;i1<nPrim;i1++)
10568 {
10569 aftsTrack=anEvent->GetTrack(i1);
10570 if(!(aftsTrack->InRPSelection())) continue;
10571 phi1=aftsTrack->Phi();
10572 for(Int_t i2=0;i2<nPrim;i2++)
10573 {
10574 if(i2==i1)continue;
10575 aftsTrack=anEvent->GetTrack(i2);
10576 if(!(aftsTrack->InRPSelection())) continue;
10577 phi2=aftsTrack->Phi();
10578 for(Int_t i3=0;i3<nPrim;i3++)
10579 {
10580 if(i3==i1||i3==i2)continue;
10581 aftsTrack=anEvent->GetTrack(i3);
10582 if(!(aftsTrack->InRPSelection())) continue;
10583 phi3=aftsTrack->Phi();
10584 for(Int_t i4=0;i4<nPrim;i4++)
10585 {
10586 if(i4==i1||i4==i2||i4==i3)continue;
10587 aftsTrack=anEvent->GetTrack(i4);
10588 if(!(aftsTrack->InRPSelection())) continue;
10589 phi4=aftsTrack->Phi();
10590 for(Int_t i5=0;i5<nPrim;i5++)
10591 {
10592 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10593 aftsTrack=anEvent->GetTrack(i5);
10594 if(!(aftsTrack->InRPSelection())) continue;
10595 phi5=aftsTrack->Phi();
10596 for(Int_t i6=0;i6<nPrim;i6++)
10597 {
10598 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10599 aftsTrack=anEvent->GetTrack(i6);
10600 if(!(aftsTrack->InRPSelection())) continue;
10601 phi6=aftsTrack->Phi();
10602 for(Int_t i7=0;i7<nPrim;i7++)
10603 {
10604 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10605 aftsTrack=anEvent->GetTrack(i7);
10606 if(!(aftsTrack->InRPSelection())) continue;
10607 phi7=aftsTrack->Phi();
10608 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10609 // fill the profile with 7-p correlation:
10610 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}
10611 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10612 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10613 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10614 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10615 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10616 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10617 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10618 } // end of if(nPrim>=7)
10619
10620 // 8-particle correlations:
10621 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10622 {
10623 for(Int_t i1=0;i1<nPrim;i1++)
10624 {
10625 aftsTrack=anEvent->GetTrack(i1);
10626 if(!(aftsTrack->InRPSelection())) continue;
10627 phi1=aftsTrack->Phi();
10628 for(Int_t i2=0;i2<nPrim;i2++)
10629 {
10630 if(i2==i1)continue;
10631 aftsTrack=anEvent->GetTrack(i2);
10632 if(!(aftsTrack->InRPSelection())) continue;
10633 phi2=aftsTrack->Phi();
10634 for(Int_t i3=0;i3<nPrim;i3++)
10635 {
10636 if(i3==i1||i3==i2)continue;
10637 aftsTrack=anEvent->GetTrack(i3);
10638 if(!(aftsTrack->InRPSelection())) continue;
10639 phi3=aftsTrack->Phi();
10640 for(Int_t i4=0;i4<nPrim;i4++)
10641 {
10642 if(i4==i1||i4==i2||i4==i3)continue;
10643 aftsTrack=anEvent->GetTrack(i4);
10644 if(!(aftsTrack->InRPSelection())) continue;
10645 phi4=aftsTrack->Phi();
10646 for(Int_t i5=0;i5<nPrim;i5++)
10647 {
10648 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10649 aftsTrack=anEvent->GetTrack(i5);
10650 if(!(aftsTrack->InRPSelection())) continue;
10651 phi5=aftsTrack->Phi();
10652 for(Int_t i6=0;i6<nPrim;i6++)
10653 {
10654 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10655 aftsTrack=anEvent->GetTrack(i6);
10656 if(!(aftsTrack->InRPSelection())) continue;
10657 phi6=aftsTrack->Phi();
10658 for(Int_t i7=0;i7<nPrim;i7++)
10659 {
10660 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10661 aftsTrack=anEvent->GetTrack(i7);
10662 if(!(aftsTrack->InRPSelection())) continue;
10663 phi7=aftsTrack->Phi();
10664 for(Int_t i8=0;i8<nPrim;i8++)
10665 {
10666 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10667 aftsTrack=anEvent->GetTrack(i8);
10668 if(!(aftsTrack->InRPSelection())) continue;
10669 phi8=aftsTrack->Phi();
10670 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10671 // fill the profile with 8-p correlation:
10672 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}
10673 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10674 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10675 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10676 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10677 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10678 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10679 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10680 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10681 } // end of if(nPrim>=8)
10682
10683 cout<<endl;
10684
10685} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10686
10687
10688//==================================================================================================================================
10689
10690
10691void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10692{
10693 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10694
10695 cout<<endl;
10696 cout<<endl;
10697 cout<<" *****************************************"<<endl;
10698 cout<<" **** cross-checking the correlations ****"<<endl;
10699 cout<<" **** for integrated flow ****"<<endl;
10700 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10701 {
10702 cout<<" **** (particle weights not used) ****"<<endl;
10703 } else
10704 {
10705 cout<<" **** (particle weights used) ****"<<endl;
10706 }
10707 cout<<" *****************************************"<<endl;
10708 cout<<endl;
10709 cout<<endl;
10710
8ed4edc7 10711 Int_t ciMax = 34; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
489d5531 10712
10713 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10714 {
10715 ciMax = 11;
10716 }
10717
10718 for(Int_t ci=1;ci<=ciMax;ci++)
10719 {
10720 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10721 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10722 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10723 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10724 cout<<endl;
10725 }
10726
10727} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10728
10729
10730//================================================================================================================================
10731
10732
10733void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10734{
10735 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10736
10737 cout<<endl;
10738 cout<<endl;
10739 cout<<" *********************************************"<<endl;
10740 cout<<" **** cross-checking the correction terms ****"<<endl;
10741 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10742 cout<<" **** for integrated flow ****"<<endl;
10743 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10744 {
10745 cout<<" **** (particle weights not used) ****"<<endl;
10746 } else
10747 {
10748 cout<<" **** (particle weights used) ****"<<endl;
10749 }
10750 cout<<" *********************************************"<<endl;
10751 cout<<endl;
10752 cout<<endl;
10753
b92ea2b9 10754 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 10755 {
10756 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10757 {
10758 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10759 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10760 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10761 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10762 cout<<endl;
10763 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10764 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10765
10766} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10767
10768
10769//================================================================================================================================
10770
10771
0328db2d 10772void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 10773{
10774 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10775
10776 // Results are stored in profile fIntFlowDirectCorrelations.
10777 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10778 //
10779 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10780 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10781 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10782 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10783 // 5th bin: ---- EMPTY ----
10784 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10785 // 7th bin: <3>_{3n|2n,1n} = ...
10786 // 8th bin: <3>_{4n|2n,2n} = ...
10787 // 9th bin: <3>_{4n|3n,1n} = ...
10788 // 10th bin: ---- EMPTY ----
10789 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10790 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10791 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10792 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10793 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10794 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10795 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10796 // 18th bin: ---- EMPTY ----
10797 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10798 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10799 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10800 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10801 // 23rd bin: ---- EMPTY ----
10802 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10803 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10804 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10805 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10806 // 28th bin: ---- EMPTY ----
10807 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10808 // 30th bin: ---- EMPTY ----
10809 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 10810
489d5531 10811 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10812 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 10813
489d5531 10814 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10815 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10816 // ...
57340a27 10817
489d5531 10818 Int_t nPrim = anEvent->NumberOfTracks();
10819 AliFlowTrackSimple *aftsTrack = NULL;
10820 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10821 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10822 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10823 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10824 Int_t n = fHarmonic;
10825 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 10826 Double_t dMult = (*fSpk)(0,0);
489d5531 10827 cout<<endl;
10828 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10829 if(dMult<2)
10830 {
10831 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10832 } else if (dMult>fMaxAllowedMultiplicity)
10833 {
10834 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10835 } else
10836 {
10837 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10838 }
10839
10840 // 2-particle correlations:
10841 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10842 {
10843 // 2 nested loops multiparticle correlations using particle weights:
10844 for(Int_t i1=0;i1<nPrim;i1++)
10845 {
10846 aftsTrack=anEvent->GetTrack(i1);
10847 if(!(aftsTrack->InRPSelection())) continue;
10848 phi1=aftsTrack->Phi();
10849 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10850 for(Int_t i2=0;i2<nPrim;i2++)
10851 {
10852 if(i2==i1)continue;
10853 aftsTrack=anEvent->GetTrack(i2);
10854 if(!(aftsTrack->InRPSelection())) continue;
10855 phi2=aftsTrack->Phi();
10856 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10857 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10858 // 2-p correlations using particle weights:
10859 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10860 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))>
10861 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))>
10862 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))>
10863 // extra correlations:
10864 // 2-p extra correlations (do not appear if particle weights are not used):
10865 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10866 // ...
10867 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10868 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10869 } // end of if(nPrim>=2)
10870
10871 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 10872 {
489d5531 10873 // 3 nested loops multiparticle correlations using particle weights:
10874 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10875 {
489d5531 10876 aftsTrack=anEvent->GetTrack(i1);
10877 if(!(aftsTrack->InRPSelection())) continue;
10878 phi1=aftsTrack->Phi();
10879 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10880 for(Int_t i2=0;i2<nPrim;i2++)
10881 {
10882 if(i2==i1)continue;
10883 aftsTrack=anEvent->GetTrack(i2);
10884 if(!(aftsTrack->InRPSelection())) continue;
10885 phi2=aftsTrack->Phi();
10886 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10887 for(Int_t i3=0;i3<nPrim;i3++)
10888 {
10889 if(i3==i1||i3==i2)continue;
10890 aftsTrack=anEvent->GetTrack(i3);
10891 if(!(aftsTrack->InRPSelection())) continue;
10892 phi3=aftsTrack->Phi();
10893 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10894 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10895 // 3-p correlations using particle weights:
10896 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))>
10897 // ...
10898 // extra correlations:
10899 // 2-p extra correlations (do not appear if particle weights are not used):
10900 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10901 // ...
10902 // 3-p extra correlations (do not appear if particle weights are not used):
10903 // ...
10904 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10905 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10906 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10907 } // end of if(nPrim>=3)
57340a27 10908
489d5531 10909 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10910 {
10911 // 4 nested loops multiparticle correlations using particle weights:
10912 for(Int_t i1=0;i1<nPrim;i1++)
10913 {
10914 aftsTrack=anEvent->GetTrack(i1);
10915 if(!(aftsTrack->InRPSelection())) continue;
10916 phi1=aftsTrack->Phi();
10917 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10918 for(Int_t i2=0;i2<nPrim;i2++)
10919 {
10920 if(i2==i1)continue;
10921 aftsTrack=anEvent->GetTrack(i2);
10922 if(!(aftsTrack->InRPSelection())) continue;
10923 phi2=aftsTrack->Phi();
10924 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10925 for(Int_t i3=0;i3<nPrim;i3++)
10926 {
10927 if(i3==i1||i3==i2)continue;
10928 aftsTrack=anEvent->GetTrack(i3);
10929 if(!(aftsTrack->InRPSelection())) continue;
10930 phi3=aftsTrack->Phi();
10931 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10932 for(Int_t i4=0;i4<nPrim;i4++)
10933 {
10934 if(i4==i1||i4==i2||i4==i3)continue;
10935 aftsTrack=anEvent->GetTrack(i4);
10936 if(!(aftsTrack->InRPSelection())) continue;
10937 phi4=aftsTrack->Phi();
10938 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10939 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10940 // 4-p correlations using particle weights:
10941 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10942 // extra correlations:
10943 // 2-p extra correlations (do not appear if particle weights are not used):
10944 // ...
10945 // 3-p extra correlations (do not appear if particle weights are not used):
10946 // ...
10947 // 4-p extra correlations (do not appear if particle weights are not used):
10948 // ...
10949 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10950 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10951 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10952 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10953 } // end of if(nPrim>=4)
57340a27 10954
489d5531 10955 cout<<endl;
57340a27 10956
489d5531 10957} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 10958
489d5531 10959
10960//================================================================================================================================
10961
10962
10963void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10964{
489d5531 10965 // Cross-check results for extra multiparticle correlations needed for int. flow
10966 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 10967
489d5531 10968 cout<<endl;
10969 cout<<endl;
10970 cout<<" ***********************************************"<<endl;
10971 cout<<" **** cross-checking the extra correlations ****"<<endl;
10972 cout<<" **** for integrated flow ****"<<endl;
10973 cout<<" ***********************************************"<<endl;
10974 cout<<endl;
10975 cout<<endl;
10976
10977 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 10978 {
489d5531 10979 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
10980 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
10981 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
10982 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
10983 cout<<endl;
10984 }
57340a27 10985
489d5531 10986} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10987
10988
489d5531 10989//================================================================================================================================
3b552efe 10990
10991
0328db2d 10992void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10993{
10994 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
10995 //
10996 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
10997 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
10998 // (sc stands for either sin or cos):
10999
11000 // 1st bin: <<sc(n*(phi1))>>
11001 // 2nd bin: <<sc(n*(phi1+phi2))>>
11002 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
11003 // 4th bin: <<sc(n*(2phi1-phi2))>>
11004
11005 Int_t nPrim = anEvent->NumberOfTracks();
11006 AliFlowTrackSimple *aftsTrack = NULL;
11007 Double_t phi1=0., phi2=0., phi3=0.;
11008 Int_t n = fHarmonic;
11009 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 11010 Double_t dMult = (*fSpk)(0,0);
489d5531 11011 cout<<endl;
11012 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11013 if(dMult<1)
3b552efe 11014 {
489d5531 11015 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11016 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 11017 {
489d5531 11018 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11019 } else
11020 {
11021 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
11022 }
11023
11024 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11025 {
11026 // 1-particle correction terms for non-uniform acceptance:
11027 for(Int_t i1=0;i1<nPrim;i1++)
11028 {
11029 aftsTrack=anEvent->GetTrack(i1);
11030 if(!(aftsTrack->InRPSelection())) continue;
11031 phi1=aftsTrack->Phi();
11032 if(nPrim==1) cout<<i1<<"\r"<<flush;
11033 // sin terms:
11034 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
11035 // cos terms:
11036 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
11037 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11038 } // end of if(nPrim>=1)
11039
11040 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11041 {
11042 // 2-particle correction terms for non-uniform acceptance:
11043 for(Int_t i1=0;i1<nPrim;i1++)
11044 {
11045 aftsTrack=anEvent->GetTrack(i1);
11046 if(!(aftsTrack->InRPSelection())) continue;
11047 phi1=aftsTrack->Phi();
11048 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 11049 {
489d5531 11050 if(i2==i1)continue;
11051 aftsTrack=anEvent->GetTrack(i2);
11052 if(!(aftsTrack->InRPSelection())) continue;
11053 phi2=aftsTrack->Phi();
11054 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11055 // sin terms:
3b552efe 11056 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 11057 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
11058 // cos terms:
3b552efe 11059 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 11060 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
11061 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11062 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11063 } // end of if(nPrim>=2)
11064
11065 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11066 {
11067 // 3-particle correction terms for non-uniform acceptance:
11068 for(Int_t i1=0;i1<nPrim;i1++)
11069 {
11070 aftsTrack=anEvent->GetTrack(i1);
11071 if(!(aftsTrack->InRPSelection())) continue;
11072 phi1=aftsTrack->Phi();
11073 for(Int_t i2=0;i2<nPrim;i2++)
11074 {
11075 if(i2==i1)continue;
11076 aftsTrack=anEvent->GetTrack(i2);
11077 if(!(aftsTrack->InRPSelection())) continue;
11078 phi2=aftsTrack->Phi();
11079 for(Int_t i3=0;i3<nPrim;i3++)
11080 {
11081 if(i3==i1||i3==i2)continue;
11082 aftsTrack=anEvent->GetTrack(i3);
11083 if(!(aftsTrack->InRPSelection())) continue;
11084 phi3=aftsTrack->Phi();
11085 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
11086 // sin terms:
11087 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
11088 // cos terms:
11089 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
11090 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11091 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11092 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11093 } // end of if(nPrim>=3)
11094
11095 cout<<endl;
11096}
11097//================================================================================================================================
0328db2d 11098void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11099{
11100 // Evaluate reduced correlations with nested loops without using the particle weights.
11101
11102 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11103 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11104 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11105 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
11106 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
11107 // ...
11108
2a98ceb8 11109 Int_t typeFlag = 0;
11110 Int_t ptEtaFlag = 0;
489d5531 11111 if(type == "RP")
11112 {
11113 typeFlag = 0;
11114 } else if(type == "POI")
11115 {
11116 typeFlag = 1;
11117 }
11118 if(ptOrEta == "Pt")
11119 {
11120 ptEtaFlag = 0;
11121 } else if(ptOrEta == "Eta")
11122 {
11123 ptEtaFlag = 1;
11124 }
11125 // shortcuts:
11126 Int_t t = typeFlag;
11127 Int_t pe = ptEtaFlag;
11128
11129 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11130 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11131 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11132
11133 Int_t nPrim = anEvent->NumberOfTracks();
11134 AliFlowTrackSimple *aftsTrack = NULL;
11135
11136 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11137
3b552efe 11138 Int_t n = fHarmonic;
489d5531 11139
11140 // 2'-particle correlations:
11141 for(Int_t i1=0;i1<nPrim;i1++)
11142 {
11143 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11144 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11145 if(typeFlag==1) // this is diff flow of POIs
489d5531 11146 {
11147 if(ptOrEta == "Pt")
11148 {
11149 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11150 } else if (ptOrEta == "Eta")
11151 {
11152 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11153 }
11154 } else // this is diff flow of RPs
11155 {
489d5531 11156 if(ptOrEta == "Pt")
11157 {
11158 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11159 } else if (ptOrEta == "Eta")
11160 {
11161 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11162 }
11163 }
489d5531 11164
11165 psi1=aftsTrack->Phi();
11166 for(Int_t i2=0;i2<nPrim;i2++)
11167 {
11168 if(i2==i1)continue;
11169 aftsTrack=anEvent->GetTrack(i2);
11170 // RP condition (!(first) particle in the correlator must be RP):
11171 if(!(aftsTrack->InRPSelection()))continue;
11172 phi2=aftsTrack->Phi();
11173 // 2'-particle correlations:
11174 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
11175 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11176 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11177
11178 /*
11179
11180 // 3'-particle correlations:
11181 for(Int_t i1=0;i1<nPrim;i1++)
11182 {
11183 aftsTrack=anEvent->GetTrack(i1);
11184 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11185 if(ptOrEta == "Pt")
11186 {
11187 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11188 } else if (ptOrEta == "Eta")
11189 {
11190 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11191 }
11192 psi1=aftsTrack->Phi();
11193 for(Int_t i2=0;i2<nPrim;i2++)
11194 {
11195 if(i2==i1)continue;
11196 aftsTrack=anEvent->GetTrack(i2);
11197 // RP condition (!(first) particle in the correlator must be RP):
11198 if(!(aftsTrack->InRPSelection())) continue;
11199 phi2=aftsTrack->Phi();
11200 for(Int_t i3=0;i3<nPrim;i3++)
11201 {
11202 if(i3==i1||i3==i2)continue;
11203 aftsTrack=anEvent->GetTrack(i3);
11204 // RP condition (!(first) particle in the correlator must be RP):
11205 if(!(aftsTrack->InRPSelection())) continue;
11206 phi3=aftsTrack->Phi();
11207 // 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))>
11208 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11209 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11210 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11211
11212 */
11213
11214 // 4'-particle correlations:
11215 for(Int_t i1=0;i1<nPrim;i1++)
11216 {
11217 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11218 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11219 if(typeFlag==1) // this is diff flow of POIs
489d5531 11220 {
11221 if(ptOrEta == "Pt")
11222 {
11223 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11224 } else if (ptOrEta == "Eta")
11225 {
11226 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11227 }
11228 } else // this is diff flow of RPs
11229 {
489d5531 11230 if(ptOrEta == "Pt")
11231 {
11232 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11233 } else if (ptOrEta == "Eta")
11234 {
11235 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11236 }
11237 }
489d5531 11238
11239 psi1=aftsTrack->Phi();
11240 for(Int_t i2=0;i2<nPrim;i2++)
11241 {
11242 if(i2==i1) continue;
11243 aftsTrack=anEvent->GetTrack(i2);
11244 // RP condition (!(first) particle in the correlator must be RP):
11245 if(!(aftsTrack->InRPSelection())) continue;
11246 phi2=aftsTrack->Phi();
11247 for(Int_t i3=0;i3<nPrim;i3++)
11248 {
11249 if(i3==i1||i3==i2) continue;
11250 aftsTrack=anEvent->GetTrack(i3);
11251 // RP condition (!(first) particle in the correlator must be RP):
11252 if(!(aftsTrack->InRPSelection())) continue;
11253 phi3=aftsTrack->Phi();
11254 for(Int_t i4=0;i4<nPrim;i4++)
11255 {
11256 if(i4==i1||i4==i2||i4==i3) continue;
11257 aftsTrack=anEvent->GetTrack(i4);
11258 // RP condition (!(first) particle in the correlator must be RP):
11259 if(!(aftsTrack->InRPSelection())) continue;
11260 phi4=aftsTrack->Phi();
11261 // 4'-particle correlations:
11262 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
11263 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11264 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11265 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11266 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11267
11268 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 11269 for(Int_t i=0;i<nPrim;i++)
11270 {
11271 aftsTrack=anEvent->GetTrack(i);
11272 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11273 if(typeFlag==1) // this is diff flow of POIs
489d5531 11274 {
11275 if(ptOrEta == "Pt")
11276 {
11277 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11278 } else if (ptOrEta == "Eta")
11279 {
11280 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11281 }
11282 } else // this is diff flow of RPs
11283 {
489d5531 11284 if(ptOrEta == "Pt")
11285 {
11286 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11287 } else if (ptOrEta == "Eta")
11288 {
11289 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11290 }
11291 }
11292 if(t==1)t++;
11293 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 11294 }
11295
11296} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11297
11298
11299//================================================================================================================================
11300
11301
11302void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11303{
11304 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11305
2a98ceb8 11306 Int_t typeFlag = 0;
11307 Int_t ptEtaFlag = 0;
489d5531 11308 if(type == "RP")
11309 {
11310 typeFlag = 0;
11311 } else if(type == "POI")
11312 {
11313 typeFlag = 1;
11314 }
11315 if(ptOrEta == "Pt")
11316 {
11317 ptEtaFlag = 0;
11318 } else if(ptOrEta == "Eta")
11319 {
11320 ptEtaFlag = 1;
11321 }
11322 // shortcuts:
11323 Int_t t = typeFlag;
11324 Int_t pe = ptEtaFlag;
11325
11326 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11327 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11328 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
11329 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11330 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11331
11332 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11333
11334
11335 cout<<endl;
11336 cout<<" *****************************************"<<endl;
11337 cout<<" **** cross-checking the correlations ****"<<endl;
11338 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11339 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11340 {
11341 cout<<" **** (particle weights not used) ****"<<endl;
11342 } else
11343 {
11344 cout<<" **** (particle weights used) ****"<<endl;
11345 }
11346 cout<<" *****************************************"<<endl;
11347 cout<<endl;
11348 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11349 cout<<endl;
11350
11351 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
11352 {
11353 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
11354 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11355 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
11356 cout<<endl;
11357 } // end of for(Int_t rci=0;rci<4;rci++)
11358
11359} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11360
3b552efe 11361//================================================================================================================================
11362
489d5531 11363void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 11364{
11365 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
11366
11367 cout<<endl;
11368 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
11369 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
11370 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
11371 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
11372
489d5531 11373} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11374
3b552efe 11375//================================================================================================================================
11376
0328db2d 11377void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11378{
11379 // Evaluate reduced correlations with nested loops without using the particle weights.
11380
11381 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11382 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11383 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11384 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
11385 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
11386 // ...
11387
2a98ceb8 11388 Int_t typeFlag = 0;
11389 Int_t ptEtaFlag = 0;
489d5531 11390 if(type == "RP")
11391 {
11392 typeFlag = 0;
11393 } else if(type == "POI")
11394 {
11395 typeFlag = 1;
11396 }
11397 if(ptOrEta == "Pt")
11398 {
11399 ptEtaFlag = 0;
11400 } else if(ptOrEta == "Eta")
11401 {
11402 ptEtaFlag = 1;
11403 }
11404 // shortcuts:
11405 Int_t t = typeFlag;
11406 Int_t pe = ptEtaFlag;
11407
11408 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11409 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11410 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11411
11412 Int_t nPrim = anEvent->NumberOfTracks();
11413 AliFlowTrackSimple *aftsTrack = NULL;
11414
11415 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11416 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11417
11418 Int_t n = fHarmonic;
11419
11420 // 2'-particle correlations:
11421 for(Int_t i1=0;i1<nPrim;i1++)
11422 {
11423 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11424 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11425 if(typeFlag==1) // this is diff flow of POIs
489d5531 11426 {
11427 if(ptOrEta == "Pt")
11428 {
11429 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11430 } else if (ptOrEta == "Eta")
11431 {
11432 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11433 }
11434 } else // this is diff flow of RPs
11435 {
489d5531 11436 if(ptOrEta == "Pt")
11437 {
11438 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11439 } else if (ptOrEta == "Eta")
11440 {
11441 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11442 }
489d5531 11443 }
11444 psi1=aftsTrack->Phi();
11445 for(Int_t i2=0;i2<nPrim;i2++)
11446 {
11447 if(i2==i1) continue;
11448 aftsTrack=anEvent->GetTrack(i2);
11449 // RP condition (!(first) particle in the correlator must be RP):
11450 if(!(aftsTrack->InRPSelection())) continue;
11451 phi2=aftsTrack->Phi();
11452 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11453 // 2'-particle correlations:
11454 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11455 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11456 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11457
11458 // 4'-particle correlations:
11459 for(Int_t i1=0;i1<nPrim;i1++)
11460 {
11461 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11462 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11463 if(typeFlag==1) // this is diff flow of POIs
489d5531 11464 {
11465 if(ptOrEta == "Pt")
11466 {
11467 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11468 } else if (ptOrEta == "Eta")
11469 {
11470 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11471 }
11472 } else // this is diff flow of RPs
11473 {
489d5531 11474 if(ptOrEta == "Pt")
11475 {
11476 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11477 } else if (ptOrEta == "Eta")
11478 {
11479 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11480 }
489d5531 11481 }
11482 psi1=aftsTrack->Phi();
11483 for(Int_t i2=0;i2<nPrim;i2++)
11484 {
11485 if(i2==i1) continue;
11486 aftsTrack=anEvent->GetTrack(i2);
11487 // RP condition (!(first) particle in the correlator must be RP):
11488 if(!(aftsTrack->InRPSelection())) continue;
11489 phi2=aftsTrack->Phi();
11490 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11491 for(Int_t i3=0;i3<nPrim;i3++)
11492 {
11493 if(i3==i1||i3==i2) continue;
11494 aftsTrack=anEvent->GetTrack(i3);
11495 // RP condition (!(first) particle in the correlator must be RP):
11496 if(!(aftsTrack->InRPSelection())) continue;
11497 phi3=aftsTrack->Phi();
11498 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11499 for(Int_t i4=0;i4<nPrim;i4++)
11500 {
11501 if(i4==i1||i4==i2||i4==i3) continue;
11502 aftsTrack=anEvent->GetTrack(i4);
11503 // RP condition (!(first) particle in the correlator must be RP):
11504 if(!(aftsTrack->InRPSelection())) continue;
11505 phi4=aftsTrack->Phi();
11506 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11507 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11508 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11509 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11510 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11511 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11512 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11513
11514 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 11515 for(Int_t i=0;i<nPrim;i++)
11516 {
489d5531 11517 aftsTrack=anEvent->GetTrack(i);
11518 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11519 if(typeFlag==1) // this is diff flow of POIs
11520 {
11521 if(ptOrEta == "Pt")
11522 {
11523 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11524 } else if (ptOrEta == "Eta")
11525 {
11526 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11527 }
11528 } else // this is diff flow of RPs
11529 {
11530 if(ptOrEta == "Pt")
11531 {
11532 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11533 } else if (ptOrEta == "Eta")
11534 {
11535 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11536 }
11537 }
11538 if(t==1)t++;
11539 fNoOfParticlesInBin->Fill(t+pe+0.5);
11540 }
11541
11542} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11543
11544
11545//================================================================================================================================
11546
11547
0328db2d 11548void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11549{
11550 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11551
11552 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11553 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11554 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11555 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11556 // cti:
11557 // 0: <<sc n(psi1)>>
11558 // 1: <<sc n(psi1+phi2)>>
11559 // 2: <<sc n(psi1+phi2-phi3)>>
11560 // 3: <<sc n(psi1-phi2-phi3)>>
11561 // 4:
11562 // 5:
11563 // 6:
11564
2a98ceb8 11565 Int_t typeFlag = 0;
11566 Int_t ptEtaFlag = 0;
489d5531 11567 if(type == "RP")
11568 {
11569 typeFlag = 0;
11570 } else if(type == "POI")
11571 {
11572 typeFlag = 1;
11573 }
11574 if(ptOrEta == "Pt")
11575 {
11576 ptEtaFlag = 0;
11577 } else if(ptOrEta == "Eta")
11578 {
11579 ptEtaFlag = 1;
11580 }
11581 // shortcuts:
11582 Int_t t = typeFlag;
11583 Int_t pe = ptEtaFlag;
11584
11585 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11586 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11587 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11588
11589 Int_t nPrim = anEvent->NumberOfTracks();
11590 AliFlowTrackSimple *aftsTrack = NULL;
11591
11592 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11593
11594 Int_t n = fHarmonic;
11595
11596 // 1-particle correction terms:
11597 for(Int_t i1=0;i1<nPrim;i1++)
11598 {
11599 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11600 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11601 if(typeFlag==1) // this is diff flow of POIs
489d5531 11602 {
11603 if(ptOrEta == "Pt")
11604 {
11605 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11606 } else if (ptOrEta == "Eta")
11607 {
11608 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11609 }
11610 } else // this is diff flow of RPs
11611 {
489d5531 11612 if(ptOrEta == "Pt")
11613 {
11614 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11615 } else if (ptOrEta == "Eta")
11616 {
11617 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11618 }
11619 }
489d5531 11620 psi1=aftsTrack->Phi();
11621 // sin terms:
11622 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11623 // cos terms:
11624 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11625 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11626
11627 // 2-particle correction terms:
11628 for(Int_t i1=0;i1<nPrim;i1++)
11629 {
11630 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11631 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11632 if(typeFlag==1) // this is diff flow of POIs
489d5531 11633 {
11634 if(ptOrEta == "Pt")
11635 {
11636 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11637 } else if (ptOrEta == "Eta")
11638 {
11639 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11640 }
11641 } else // this is diff flow of RPs
11642 {
489d5531 11643 if(ptOrEta == "Pt")
11644 {
11645 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11646 } else if (ptOrEta == "Eta")
11647 {
11648 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11649 }
489d5531 11650 }
11651 psi1=aftsTrack->Phi();
11652 for(Int_t i2=0;i2<nPrim;i2++)
11653 {
11654 if(i2==i1) continue;
11655 aftsTrack=anEvent->GetTrack(i2);
11656 // RP condition (!(first) particle in the correlator must be RP):
11657 if(!(aftsTrack->InRPSelection())) continue;
11658 phi2=aftsTrack->Phi();
11659 // sin terms:
11660 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11661 // cos terms:
11662 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11663 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11664 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11665
11666 // 3-particle correction terms:
11667 for(Int_t i1=0;i1<nPrim;i1++)
11668 {
11669 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11670 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11671 if(typeFlag==1) // this is diff flow of POIs
489d5531 11672 {
11673 if(ptOrEta == "Pt")
11674 {
11675 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11676 } else if (ptOrEta == "Eta")
11677 {
11678 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11679 }
11680 } else // this is diff flow of RPs
11681 {
489d5531 11682 if(ptOrEta == "Pt")
11683 {
11684 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11685 } else if (ptOrEta == "Eta")
11686 {
11687 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11688 }
489d5531 11689 }
11690 psi1=aftsTrack->Phi();
11691 for(Int_t i2=0;i2<nPrim;i2++)
11692 {
11693 if(i2==i1) continue;
11694 aftsTrack=anEvent->GetTrack(i2);
11695 // RP condition (!(first) particle in the correlator must be RP):
11696 if(!(aftsTrack->InRPSelection())) continue;
11697 phi2=aftsTrack->Phi();
11698 for(Int_t i3=0;i3<nPrim;i3++)
11699 {
11700 if(i3==i1||i3==i2) continue;
11701 aftsTrack=anEvent->GetTrack(i3);
11702 // RP condition (!(first) particle in the correlator must be RP):
11703 if(!(aftsTrack->InRPSelection())) continue;
11704 phi3=aftsTrack->Phi();
11705 // sin terms:
11706 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11707 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11708 // cos terms:
11709 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11710 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11711 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11712 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11713 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11714
11715} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11716
11717
11718//================================================================================================================================
11719
11720
11721void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11722{
11723 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11724
2a98ceb8 11725 Int_t typeFlag = 0;
11726 Int_t ptEtaFlag = 0;
489d5531 11727 if(type == "RP")
11728 {
11729 typeFlag = 0;
11730 } else if(type == "POI")
11731 {
11732 typeFlag = 1;
11733 }
11734 if(ptOrEta == "Pt")
11735 {
11736 ptEtaFlag = 0;
11737 } else if(ptOrEta == "Eta")
11738 {
11739 ptEtaFlag = 1;
11740 }
11741 // shortcuts:
11742 Int_t t = typeFlag;
11743 Int_t pe = ptEtaFlag;
11744
11745 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11746 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11747 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11748 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)
11749 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)
11750 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11751 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11752
11753 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11754
11755 cout<<endl;
11756 cout<<" ******************************************"<<endl;
11757 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 11758 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 11759 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11760 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11761 {
11762 cout<<" **** (particle weights not used) ****"<<endl;
11763 } else
11764 {
11765 cout<<" **** (particle weights used) ****"<<endl;
11766 }
11767 cout<<" ******************************************"<<endl;
11768 cout<<endl;
11769 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11770 cout<<endl;
11771
11772 for(Int_t cti=0;cti<4;cti++) // correction term index
11773 {
11774 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11775 {
11776 if(sc==0) // to be improved (this can be implemented better)
11777 {
11778 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11779 } else
11780 {
11781 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11782 }
11783 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11784 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11785 cout<<endl;
11786 }
11787 } // end of for(Int_t rci=0;rci<4;rci++)
11788
11789} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11790
11791
57340a27 11792//================================================================================================================================
11793
489d5531 11794
11795void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11796{
11797 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11798
11799 // **********************************************************************
11800 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11801 // **********************************************************************
57340a27 11802
489d5531 11803 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 11804 //
489d5531 11805 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11806 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11807 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11808 // ...
11809
11810 // multiplicity (number of particles used to determine the reaction plane)
1268c371 11811 Double_t dMult = (*fSpk)(0,0);
489d5531 11812
11813 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11814 Double_t dReQ1n1k = (*fReQ)(0,1);
11815 Double_t dReQ2n2k = (*fReQ)(1,2);
11816 //Double_t dReQ3n3k = (*fReQ)(2,3);
11817 //Double_t dReQ4n4k = (*fReQ)(3,4);
11818 Double_t dReQ1n3k = (*fReQ)(0,3);
11819 Double_t dImQ1n1k = (*fImQ)(0,1);
11820 Double_t dImQ2n2k = (*fImQ)(1,2);
11821 //Double_t dImQ3n3k = (*fImQ)(2,3);
11822 //Double_t dImQ4n4k = (*fImQ)(3,4);
11823 //Double_t dImQ1n3k = (*fImQ)(0,3);
11824
11825 // dMs are variables introduced in order to simplify some Eqs. bellow:
11826 //..............................................................................................
1268c371 11827 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11828 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
11829 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 11830 //..............................................................................................
ecac11c2 11831 // 1-particle:
489d5531 11832 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11833
1268c371 11834 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 11835 {
1268c371 11836 cosP1nW1 = dReQ1n1k/(*fSpk)(0,1);
489d5531 11837
11838 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11839 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11840
11841 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
1268c371 11842 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSpk)(0,1));
489d5531 11843 }
11844
11845 // 2-particle:
11846 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11847
1268c371 11848 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 11849 {
11850 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11851
11852 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11853 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11854
11855 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11856 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11857 }
11858
11859 // 3-particle:
11860 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11861
1268c371 11862 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 11863 {
57340a27 11864 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11865 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
1268c371 11866 - 2.*((*fSpk)(0,2))*dReQ1n1k
489d5531 11867 + 2.*dReQ1n3k)
11868 / dM111;
11869
11870 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11871 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11872
11873 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11874 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11875 }
11876
11877} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11878
11879
11880//================================================================================================================================
11881
11882
11883void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11884{
11885 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11886
11887 // **********************************************************************
11888 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11889 // **********************************************************************
11890
11891 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 11892 //
489d5531 11893 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11894 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11895 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11896 // ...
11897
11898 // multiplicity (number of particles used to determine the reaction plane)
1268c371 11899 Double_t dMult = (*fSpk)(0,0);
489d5531 11900
11901 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11902 Double_t dReQ1n1k = (*fReQ)(0,1);
11903 Double_t dReQ2n2k = (*fReQ)(1,2);
11904 //Double_t dReQ3n3k = (*fReQ)(2,3);
11905 //Double_t dReQ4n4k = (*fReQ)(3,4);
11906 //Double_t dReQ1n3k = (*fReQ)(0,3);
11907 Double_t dImQ1n1k = (*fImQ)(0,1);
11908 Double_t dImQ2n2k = (*fImQ)(1,2);
11909 //Double_t dImQ3n3k = (*fImQ)(2,3);
11910 //Double_t dImQ4n4k = (*fImQ)(3,4);
11911 Double_t dImQ1n3k = (*fImQ)(0,3);
11912
11913 // dMs are variables introduced in order to simplify some Eqs. bellow:
11914 //..............................................................................................
1268c371 11915 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11916 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
11917 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 11918 //..............................................................................................
11919
11920 // 1-particle:
11921 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11922
1268c371 11923 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 11924 {
1268c371 11925 sinP1nW1 = dImQ1n1k/((*fSpk)(0,1));
489d5531 11926
11927 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11928 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11929
11930 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1268c371 11931 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSpk)(0,1));
489d5531 11932 }
11933
11934 // 2-particle:
11935 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11936
1268c371 11937 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 11938 {
11939 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11940
11941 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11942 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11943
11944 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11945 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11946 }
11947
11948 // 3-particle:
11949 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11950
1268c371 11951 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 11952 {
57340a27 11953 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11954 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
1268c371 11955 + 2.*((*fSpk)(0,2))*dImQ1n1k
489d5531 11956 - 2.*dImQ1n3k)
11957 / dM111;
11958
11959 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11960 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11961
11962 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11963 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11964 }
11965
11966} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11967
57340a27 11968//================================================================================================================================
489d5531 11969
0328db2d 11970void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11971{
11972 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11973
57340a27 11974 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11975 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 11976
57340a27 11977 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 11978 // organized as follows (sc stands for either sin or cos):
11979 //
11980 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
11981 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
11982 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 11983 // ...
489d5531 11984
11985 Int_t nPrim = anEvent->NumberOfTracks();
11986 AliFlowTrackSimple *aftsTrack = NULL;
11987 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11988 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11989 Double_t phi1=0., phi2=0., phi3=0.;
11990 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
11991 Int_t n = fHarmonic;
11992 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 11993 Double_t dMult = (*fSpk)(0,0);
489d5531 11994 cout<<endl;
11995 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11996 if(dMult<1)
11997 {
11998 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11999 } else if (dMult>fMaxAllowedMultiplicity)
12000 {
12001 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
12002 } else
12003 {
12004 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
12005 }
12006
12007 // 1-particle correction terms using particle weights:
12008 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12009 {
12010 for(Int_t i1=0;i1<nPrim;i1++)
12011 {
12012 aftsTrack=anEvent->GetTrack(i1);
12013 if(!(aftsTrack->InRPSelection())) continue;
12014 phi1=aftsTrack->Phi();
12015 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 12016 // 1-particle correction terms using particle weights:
489d5531 12017 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
12018 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 12019 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12020 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12021
489d5531 12022 // 2-particle correction terms using particle weights:
12023 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
12024 {
12025 for(Int_t i1=0;i1<nPrim;i1++)
12026 {
12027 aftsTrack=anEvent->GetTrack(i1);
12028 if(!(aftsTrack->InRPSelection())) continue;
12029 phi1=aftsTrack->Phi();
12030 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12031 for(Int_t i2=0;i2<nPrim;i2++)
12032 {
12033 if(i2==i1)continue;
12034 aftsTrack=anEvent->GetTrack(i2);
12035 if(!(aftsTrack->InRPSelection())) continue;
12036 phi2=aftsTrack->Phi();
12037 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12038 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 12039 // 2-p correction terms using particle weights:
489d5531 12040 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
12041 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
12042 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12043 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12044 } // end of if(nPrim>=2)
12045
12046 // 3-particle correction terms using particle weights:
12047 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12048 {
12049 for(Int_t i1=0;i1<nPrim;i1++)
12050 {
12051 aftsTrack=anEvent->GetTrack(i1);
12052 if(!(aftsTrack->InRPSelection())) continue;
12053 phi1=aftsTrack->Phi();
12054 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12055 for(Int_t i2=0;i2<nPrim;i2++)
12056 {
12057 if(i2==i1)continue;
12058 aftsTrack=anEvent->GetTrack(i2);
12059 if(!(aftsTrack->InRPSelection())) continue;
12060 phi2=aftsTrack->Phi();
12061 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12062 for(Int_t i3=0;i3<nPrim;i3++)
12063 {
12064 if(i3==i1||i3==i2)continue;
12065 aftsTrack=anEvent->GetTrack(i3);
12066 if(!(aftsTrack->InRPSelection())) continue;
12067 phi3=aftsTrack->Phi();
12068 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12069 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 12070 // 3-p correction terms using particle weights:
489d5531 12071 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
12072 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
12073 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12074 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12075 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12076 } // end of if(nPrim>=3)
12077
57340a27 12078 /*
12079
489d5531 12080 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
12081 {
12082 // 4 nested loops multiparticle correlations using particle weights:
12083 for(Int_t i1=0;i1<nPrim;i1++)
12084 {
12085 aftsTrack=anEvent->GetTrack(i1);
12086 if(!(aftsTrack->InRPSelection())) continue;
12087 phi1=aftsTrack->Phi();
12088 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12089 for(Int_t i2=0;i2<nPrim;i2++)
12090 {
12091 if(i2==i1)continue;
12092 aftsTrack=anEvent->GetTrack(i2);
12093 if(!(aftsTrack->InRPSelection())) continue;
12094 phi2=aftsTrack->Phi();
12095 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12096 for(Int_t i3=0;i3<nPrim;i3++)
12097 {
12098 if(i3==i1||i3==i2)continue;
12099 aftsTrack=anEvent->GetTrack(i3);
12100 if(!(aftsTrack->InRPSelection())) continue;
12101 phi3=aftsTrack->Phi();
12102 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12103 for(Int_t i4=0;i4<nPrim;i4++)
12104 {
12105 if(i4==i1||i4==i2||i4==i3)continue;
12106 aftsTrack=anEvent->GetTrack(i4);
12107 if(!(aftsTrack->InRPSelection())) continue;
12108 phi4=aftsTrack->Phi();
12109 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12110 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
12111 // 4-p correlations using particle weights:
12112 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
12113 // extra correlations:
12114 // 2-p extra correlations (do not appear if particle weights are not used):
12115 // ...
12116 // 3-p extra correlations (do not appear if particle weights are not used):
12117 // ...
12118 // 4-p extra correlations (do not appear if particle weights are not used):
12119 // ...
12120 } // end of for(Int_t i4=0;i4<nPrim;i4++)
12121 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12122 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12123 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12124 } // end of if(nPrim>=4)
12125
12126 */
12127
12128 cout<<endl;
12129
12130} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
12131
57340a27 12132//================================================================================================================================
489d5531 12133
489d5531 12134void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12135{
12136 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 12137
489d5531 12138 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 12139 //
489d5531 12140 // 0: <<cos n(psi)>>
12141 // 1: <<w2 cos n(psi1+phi2)>>
12142 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
12143 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
12144 // 4:
12145 // 5:
12146 // 6:
12147
12148 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12149 Double_t dReQ1n1k = (*fReQ)(0,1);
12150 Double_t dReQ2n2k = (*fReQ)(1,2);
12151 //Double_t dReQ1n3k = (*fReQ)(0,3);
12152 //Double_t dReQ4n4k = (*fReQ)(3,4);
12153 Double_t dImQ1n1k = (*fImQ)(0,1);
12154 Double_t dImQ2n2k = (*fImQ)(1,2);
12155 //Double_t dImQ1n3k = (*fImQ)(0,3);
12156 //Double_t dImQ4n4k = (*fImQ)(3,4);
12157
1268c371 12158 // S^M_{p,k} (see .h file for the definition of fSpk):
12159 Double_t dSM1p1k = (*fSpk)(0,1);
12160 Double_t dSM1p2k = (*fSpk)(0,2);
12161 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 12162
2a98ceb8 12163 Int_t t = 0; // type flag
12164 Int_t pe = 0; // ptEta flag
489d5531 12165
12166 if(type == "RP")
12167 {
12168 t = 0;
12169 } else if(type == "POI")
12170 {
12171 t = 1;
12172 }
12173
12174 if(ptOrEta == "Pt")
12175 {
12176 pe = 0;
12177 } else if(ptOrEta == "Eta")
12178 {
12179 pe = 1;
12180 }
12181
12182 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12183 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12184 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12185 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12186
12187 // looping over all bins and calculating correction terms:
12188 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12189 {
12190 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12191 Double_t p1n0kRe = 0.;
12192 Double_t p1n0kIm = 0.;
12193
12194 // number of POIs in particular pt or eta bin:
12195 Double_t mp = 0.;
12196
12197 // 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):
12198 Double_t q1n2kRe = 0.;
12199 Double_t q1n2kIm = 0.;
12200 Double_t q2n1kRe = 0.;
12201 Double_t q2n1kIm = 0.;
46b94261 12202
489d5531 12203 // s_{1,1}, s_{1,2} // to be improved (add explanation)
12204 Double_t s1p1k = 0.;
12205 Double_t s1p2k = 0.;
46b94261 12206
489d5531 12207 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12208 Double_t mq = 0.;
489d5531 12209
12210 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12211 Double_t dM01 = 0.;
12212 Double_t dM011 = 0.;
12213
12214 if(type == "POI")
12215 {
12216 // q_{m*n,k}:
12217 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12218 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12219 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12220 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12221 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12222 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12223 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12224 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12225 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 12226
489d5531 12227 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12228 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12229 }else if(type == "RP")
12230 {
12231 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12232 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12233 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12234 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12235 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12236 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12237 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12238 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12239 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12240 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12241 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12242 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 12243 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12244
489d5531 12245 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12246 }
3b552efe 12247
489d5531 12248 if(type == "POI")
3b552efe 12249 {
12250 // p_{m*n,k}:
489d5531 12251 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12252 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12253 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12254 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12255 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 12256 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12257 dM01 = mp*dSM1p1k-s1p1k;
12258 dM011 = mp*(dSM2p1k-dSM1p2k)
12259 - 2.*(s1p1k*dSM1p1k-s1p2k);
12260
12261 // typeFlag = RP (0) or POI (1):
12262 t = 1;
12263 } else if(type == "RP")
489d5531 12264 {
12265 // to be improved (cross-checked):
12266 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12267 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12268 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12269 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12270 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12271 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12272 dM01 = mp*dSM1p1k-s1p1k;
12273 dM011 = mp*(dSM2p1k-dSM1p2k)
12274 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 12275 // typeFlag = RP (0) or POI (1):
3b552efe 12276 t = 0;
12277 }
489d5531 12278
12279 // <<cos n(psi1)>>:
12280 Double_t cosP1nPsi = 0.;
12281 if(mp)
12282 {
12283 cosP1nPsi = p1n0kRe/mp;
12284
12285 // fill profile for <<cos n(psi1)>>:
12286 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
12287 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
12288 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 12289 } // end of if(mp)
57340a27 12290
489d5531 12291 // <<w2 cos n(psi1+phi2)>>:
12292 Double_t cosP1nPsiP1nPhiW2 = 0.;
12293 if(dM01)
12294 {
12295 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
12296 // fill profile for <<w2 cos n(psi1+phi2)>>:
12297 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
12298 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12299 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
12300 } // end of if(dM01)
12301
12302 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
12303 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12304 if(dM011)
12305 {
46b94261 12306 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12307 - p1n0kRe*dSM1p2k
12308 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
12309 - s1p1k*dReQ1n1k
12310 + 2.*q1n2kRe)
12311 / dM011;
489d5531 12312 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12313 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12314 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12315 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
12316 } // end of if(dM011)
12317
12318 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
12319 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12320 if(dM011)
12321 {
12322 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
12323 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 12324 - 2.*s1p1k*dReQ1n1k
489d5531 12325 + 2.*q1n2kRe)
12326 / dM011;
12327 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12328 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12329 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12330 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
12331 } // end of if(dM011)
12332
12333 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 12334
57340a27 12335} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12336
489d5531 12337
12338//================================================================================================================================
12339
12340
12341void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12342{
12343 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
12344
12345 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
12346 // 0: <<sin n(psi1)>>
12347 // 1: <<w2 sin n(psi1+phi2)>>
12348 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
12349 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
12350 // 4:
12351 // 5:
12352 // 6:
12353
12354 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12355 Double_t dReQ1n1k = (*fReQ)(0,1);
12356 Double_t dReQ2n2k = (*fReQ)(1,2);
12357 //Double_t dReQ1n3k = (*fReQ)(0,3);
12358 //Double_t dReQ4n4k = (*fReQ)(3,4);
12359 Double_t dImQ1n1k = (*fImQ)(0,1);
12360 Double_t dImQ2n2k = (*fImQ)(1,2);
12361 //Double_t dImQ1n3k = (*fImQ)(0,3);
12362 //Double_t dImQ4n4k = (*fImQ)(3,4);
12363
1268c371 12364 // S^M_{p,k} (see .h file for the definition of fSpk):
12365 Double_t dSM1p1k = (*fSpk)(0,1);
12366 Double_t dSM1p2k = (*fSpk)(0,2);
12367 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 12368
2a98ceb8 12369 Int_t t = 0; // type flag
12370 Int_t pe = 0; // ptEta flag
489d5531 12371
12372 if(type == "RP")
12373 {
12374 t = 0;
12375 } else if(type == "POI")
12376 {
12377 t = 1;
12378 }
12379
12380 if(ptOrEta == "Pt")
12381 {
12382 pe = 0;
12383 } else if(ptOrEta == "Eta")
12384 {
12385 pe = 1;
12386 }
12387
12388 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12389 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12390 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12391 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12392
12393 // looping over all bins and calculating correction terms:
12394 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12395 {
12396 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12397 Double_t p1n0kRe = 0.;
12398 Double_t p1n0kIm = 0.;
12399
12400 // number of POIs in particular pt or eta bin:
12401 Double_t mp = 0.;
12402
12403 // 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):
12404 Double_t q1n2kRe = 0.;
12405 Double_t q1n2kIm = 0.;
12406 Double_t q2n1kRe = 0.;
12407 Double_t q2n1kIm = 0.;
46b94261 12408
489d5531 12409 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12410 Double_t s1p1k = 0.;
12411 Double_t s1p2k = 0.;
46b94261 12412
489d5531 12413 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12414 Double_t mq = 0.;
489d5531 12415
12416 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12417 Double_t dM01 = 0.;
12418 Double_t dM011 = 0.;
12419
12420 if(type == "POI")
12421 {
12422 // q_{m*n,k}:
12423 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12424 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12425 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12426 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12427 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12428 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12429 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12430 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12431 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 12432
489d5531 12433 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12434 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12435 }else if(type == "RP")
12436 {
12437 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12438 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12439 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12440 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12441 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12442 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12443 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12444 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12445 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12446 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12447 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12448 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12449 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 12450 }
12451
12452 if(type == "POI")
12453 {
12454 // p_{m*n,k}:
489d5531 12455 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12456 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12457 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12458 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12459 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 12460 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12461 dM01 = mp*dSM1p1k-s1p1k;
12462 dM011 = mp*(dSM2p1k-dSM1p2k)
12463 - 2.*(s1p1k*dSM1p1k-s1p2k);
12464 // typeFlag = RP (0) or POI (1):
12465 t = 1;
489d5531 12466 } else if(type == "RP")
3b552efe 12467 {
489d5531 12468 // to be improved (cross-checked):
12469 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12470 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12471 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12472 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12473 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12474 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12475 dM01 = mp*dSM1p1k-s1p1k;
12476 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 12477 - 2.*(s1p1k*dSM1p1k-s1p2k);
12478 // typeFlag = RP (0) or POI (1):
3b552efe 12479 t = 0;
12480 }
12481
489d5531 12482 // <<sin n(psi1)>>:
12483 Double_t sinP1nPsi = 0.;
12484 if(mp)
12485 {
12486 sinP1nPsi = p1n0kIm/mp;
12487
12488 // fill profile for <<sin n(psi1)>>:
12489 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12490 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12491 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 12492 } // end of if(mp)
12493
489d5531 12494 // <<w2 sin n(psi1+phi2)>>:
12495 Double_t sinP1nPsiP1nPhiW2 = 0.;
12496 if(dM01)
12497 {
12498 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12499 // fill profile for <<w2 sin n(psi1+phi2)>>:
12500 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12501 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12502 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12503 } // end of if(mp*dMult-mq)
12504
12505 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12506 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12507 if(dM011)
12508 {
46b94261 12509 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12510 - p1n0kIm*dSM1p2k
12511 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12512 - s1p1k*dImQ1n1k
12513 + 2.*q1n2kIm)
12514 / dM011;
489d5531 12515 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12516 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12517 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12518 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12519 } // end of if(dM011)
12520
12521 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12522 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12523 if(dM011)
12524 {
12525 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12526 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 12527 + 2.*s1p1k*dImQ1n1k
489d5531 12528 - 2.*q1n2kIm)
12529 / dM011;
12530 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12531 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12532 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12533 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12534 } // end of if(dM011)
12535
12536 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12537
12538} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12539
12540
12541//================================================================================================================================
12542
12543
0328db2d 12544void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12545{
57340a27 12546 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 12547 // with using particle weights (both sin and cos terms) relevant for differential flow.
12548
57340a27 12549 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12550 // flagged both as POI and RP.
489d5531 12551 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12552 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12553 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12554 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12555 // cti:
12556 // 0: <<sc n(psi1)>>
12557 // 1: <<w2 sc n(psi1+phi2)>>
12558 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12559 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12560 // 4:
12561 // 5:
12562 // 6:
46b94261 12563
2a98ceb8 12564 Int_t typeFlag = 0;
12565 Int_t ptEtaFlag = 0;
489d5531 12566 if(type == "RP")
12567 {
12568 typeFlag = 0;
12569 } else if(type == "POI")
12570 {
12571 typeFlag = 1;
12572 }
12573 if(ptOrEta == "Pt")
12574 {
12575 ptEtaFlag = 0;
12576 } else if(ptOrEta == "Eta")
12577 {
12578 ptEtaFlag = 1;
12579 }
12580 // shortcuts:
12581 Int_t t = typeFlag;
12582 Int_t pe = ptEtaFlag;
12583
12584 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12585 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12586 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12587
12588 Int_t nPrim = anEvent->NumberOfTracks();
12589 AliFlowTrackSimple *aftsTrack = NULL;
12590
12591 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12592 Double_t wPhi2=1., wPhi3=1.;
12593
12594 Int_t n = fHarmonic;
12595
12596 // 1'-particle correction terms:
12597 for(Int_t i1=0;i1<nPrim;i1++)
12598 {
12599 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12600 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12601 if(typeFlag==1) // this is diff flow of POIs
489d5531 12602 {
12603 if(ptOrEta == "Pt")
12604 {
12605 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12606 } else if (ptOrEta == "Eta")
12607 {
12608 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12609 }
12610 } else // this is diff flow of RPs
12611 {
489d5531 12612 if(ptOrEta == "Pt")
12613 {
12614 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12615 } else if (ptOrEta == "Eta")
12616 {
12617 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12618 }
489d5531 12619 }
12620 psi1=aftsTrack->Phi();
12621 // sin terms:
12622 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12623 // cos terms:
12624 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12625 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12626
12627 // 2'-particle correction terms:
12628 for(Int_t i1=0;i1<nPrim;i1++)
12629 {
12630 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12631 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12632 if(typeFlag==1) // this is diff flow of POIs
489d5531 12633 {
12634 if(ptOrEta == "Pt")
12635 {
12636 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12637 } else if (ptOrEta == "Eta")
12638 {
12639 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12640 }
12641 } else // this is diff flow of RPs
12642 {
489d5531 12643 if(ptOrEta == "Pt")
12644 {
12645 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12646 } else if (ptOrEta == "Eta")
12647 {
12648 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12649 }
489d5531 12650 }
12651 psi1=aftsTrack->Phi();
12652 for(Int_t i2=0;i2<nPrim;i2++)
12653 {
12654 if(i2==i1) continue;
12655 aftsTrack=anEvent->GetTrack(i2);
12656 // RP condition (!(first) particle in the correlator must be RP):
12657 if(!(aftsTrack->InRPSelection())) continue;
46b94261 12658 phi2=aftsTrack->Phi();
489d5531 12659 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12660 // sin terms:
12661 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12662 // cos terms:
12663 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12664 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12665 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12666
12667 // 3'-particle correction terms:
12668 for(Int_t i1=0;i1<nPrim;i1++)
12669 {
12670 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12671 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12672 if(typeFlag==1) // this is diff flow of POIs
489d5531 12673 {
12674 if(ptOrEta == "Pt")
12675 {
12676 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12677 } else if (ptOrEta == "Eta")
12678 {
12679 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12680 }
12681 } else // this is diff flow of RPs
12682 {
489d5531 12683 if(ptOrEta == "Pt")
12684 {
12685 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12686 } else if (ptOrEta == "Eta")
12687 {
12688 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12689 }
489d5531 12690 }
12691 psi1=aftsTrack->Phi();
12692 for(Int_t i2=0;i2<nPrim;i2++)
12693 {
12694 if(i2==i1) continue;
12695 aftsTrack=anEvent->GetTrack(i2);
12696 // RP condition (!(first) particle in the correlator must be RP):
12697 if(!(aftsTrack->InRPSelection())) continue;
12698 phi2=aftsTrack->Phi();
12699 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12700 for(Int_t i3=0;i3<nPrim;i3++)
12701 {
12702 if(i3==i1||i3==i2) continue;
12703 aftsTrack=anEvent->GetTrack(i3);
12704 // RP condition (!(first) particle in the correlator must be RP):
12705 if(!(aftsTrack->InRPSelection())) continue;
12706 phi3=aftsTrack->Phi();
12707 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12708 // sin terms:
12709 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))>>
12710 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))>>
12711 // cos terms:
12712 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))>>
12713 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))>>
12714 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12715 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 12716 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 12717
12718} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12719
2001bc3a 12720//================================================================================================================================
12721
b3dacf6b 12722void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12723{
12724 // Check all pointers used in method Finish().
12725
b77b6434 12726 if(!fAvMultiplicity)
12727 {
12728 cout<<endl;
12729 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12730 cout<<endl;
12731 exit(0);
12732 }
b3dacf6b 12733 if(!fIntFlowCorrelationsPro)
12734 {
12735 cout<<endl;
12736 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12737 cout<<endl;
12738 exit(0);
12739 }
b40a910e 12740 if(!fIntFlowSquaredCorrelationsPro)
12741 {
12742 cout<<endl;
12743 cout<<" WARNING (QC): fIntFlowSquaredCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12744 cout<<endl;
12745 exit(0);
12746 }
b3dacf6b 12747 if(!fIntFlowCorrelationsHist)
12748 {
12749 cout<<endl;
12750 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12751 cout<<endl;
12752 exit(0);
12753 }
b77b6434 12754 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12755 {
12756 cout<<endl;
12757 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12758 cout<<endl;
12759 exit(0);
12760 }
b3dacf6b 12761 for(Int_t power=0;power<2;power++)
12762 {
12763 if(!fIntFlowSumOfEventWeights[power])
12764 {
12765 cout<<endl;
12766 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
12767 cout<<endl;
12768 exit(0);
12769 }
12770 } // end of for(Int_t power=0;power<2;power++)
12771 if(!fIntFlowProductOfCorrelationsPro)
12772 {
12773 cout<<endl;
12774 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12775 cout<<endl;
12776 exit(0);
12777 }
12778 if(!fIntFlowSumOfProductOfEventWeights)
12779 {
12780 cout<<endl;
12781 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12782 cout<<endl;
12783 exit(0);
12784 }
12785 if(!fIntFlowCovariances)
12786 {
12787 cout<<endl;
12788 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12789 cout<<endl;
12790 exit(0);
12791 }
12792 if(!fIntFlowQcumulants)
12793 {
12794 cout<<endl;
12795 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12796 cout<<endl;
12797 exit(0);
12798 }
0dd3b008 12799 if(!fIntFlow)
12800 {
12801 cout<<endl;
12802 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12803 cout<<endl;
12804 exit(0);
12805 }
12806 if(!fCommonHists)
12807 {
12808 cout<<endl;
12809 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12810 cout<<endl;
12811 exit(0);
12812 }
12813 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
12814 {
12815 cout<<endl;
12816 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
12817 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12818 cout<<endl;
12819 exit(0);
12820 }
b3dacf6b 12821
b92ea2b9 12822 // NUA stuff:
12823 for(Int_t sc=0;sc<2;sc++) // sin/cos
12824 {
12825 if(!fIntFlowCorrectionTermsForNUAPro[sc])
12826 {
12827 cout<<endl;
12828 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12829 cout<<endl;
12830 exit(0);
12831 }
12832 if(!fIntFlowCorrectionTermsForNUAHist[sc])
12833 {
12834 cout<<endl;
12835 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12836 cout<<endl;
12837 exit(0);
12838 }
12839 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12840 {
12841 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
12842 {
12843 cout<<endl;
12844 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
12845 cout<<endl;
12846 exit(0);
12847 }
12848 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12849 } // end of for(Int_t power=0;power<2;power++)
12850 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
12851 {
12852 cout<<endl;
12853 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12854 cout<<endl;
12855 exit(0);
12856 }
12857 if(!fIntFlowSumOfProductOfEventWeightsNUA)
12858 {
12859 cout<<endl;
12860 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12861 cout<<endl;
12862 exit(0);
12863 }
12864 if(!fIntFlowCovariancesNUA)
12865 {
12866 cout<<endl;
12867 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12868 cout<<endl;
12869 exit(0);
12870 }
12871 if(!fIntFlowQcumulantsErrorSquaredRatio)
12872 {
12873 cout<<endl;
12874 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12875 cout<<endl;
12876 exit(0);
12877 }
12878 if(!fIntFlowDetectorBias)
12879 {
12880 cout<<endl;
12881 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12882 cout<<endl;
12883 exit(0);
12884 }
12885
b3dacf6b 12886 // Versus multiplicity:
12887 if(!fCalculateCumulantsVsM){return;}
b77b6434 12888 for(Int_t co=0;co<=3;co++) // cumulant order
b3dacf6b 12889 {
b77b6434 12890 if(!fIntFlowQcumulantsVsM[co])
b3dacf6b 12891 {
12892 cout<<endl;
b77b6434 12893 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
b3dacf6b 12894 cout<<endl;
12895 exit(0);
12896 }
b77b6434 12897 if(!fIntFlowVsM[co])
b3dacf6b 12898 {
12899 cout<<endl;
b77b6434 12900 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12901 cout<<endl;
12902 exit(0);
12903 }
12904 if(!fIntFlowDetectorBiasVsM[co])
12905 {
12906 cout<<endl;
12907 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12908 cout<<endl;
12909 exit(0);
12910 }
12911 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
12912 for(Int_t ci=0;ci<=3;ci++) // correlation index
12913 {
12914 if(!fIntFlowCorrelationsVsMPro[ci])
12915 {
12916 cout<<endl;
12917 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b3dacf6b 12918 cout<<endl;
12919 exit(0);
12920 }
b40a910e 12921 if(!fIntFlowSquaredCorrelationsVsMPro[ci])
12922 {
12923 cout<<endl;
12924 cout<<Form(" WARNING (QC): fIntFlowSquaredCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
12925 cout<<endl;
12926 exit(0);
12927 }
b77b6434 12928 if(!fIntFlowCorrelationsVsMHist[ci])
b92ea2b9 12929 {
12930 cout<<endl;
b77b6434 12931 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b92ea2b9 12932 cout<<endl;
12933 exit(0);
12934 }
b3dacf6b 12935 for(Int_t power=0;power<2;power++)
12936 {
12937 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
12938 {
12939 cout<<endl;
12940 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
12941 cout<<endl;
12942 exit(0);
12943 }
12944 } // end of for(Int_t power=0;power<2;power++)
12945 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
12946 for(Int_t i=0;i<6;i++)
12947 {
12948 if(!fIntFlowProductOfCorrelationsVsMPro[i])
12949 {
12950 cout<<endl;
12951 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12952 cout<<endl;
12953 exit(0);
12954 }
12955 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
12956 {
12957 cout<<endl;
12958 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12959 cout<<endl;
12960 exit(0);
12961 }
12962 if(!fIntFlowCovariancesVsM[i])
12963 {
12964 cout<<endl;
12965 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12966 cout<<endl;
12967 exit(0);
12968 }
12969 } // end of for(Int_t i=0;i<6;i++)
12970 if(!fIntFlowRebinnedInM)
12971 {
12972 cout<<endl;
12973 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12974 cout<<endl;
12975 exit(0);
12976 }
12977 if(!fIntFlowQcumulantsRebinnedInM)
12978 {
12979 cout<<endl;
12980 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12981 cout<<endl;
12982 exit(0);
12983 }
12984
12985} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12986
12987//================================================================================================================================
12988
12989void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
12990{
1268c371 12991 // Check all pointers used in method Make(). // to be improved - check other pointers as well
b3dacf6b 12992
b77b6434 12993 if(!fAvMultiplicity)
12994 {
1268c371 12995 printf("\n WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 12996 exit(0);
12997 }
12998 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12999 {
1268c371 13000 printf("\n WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 13001 exit(0);
13002 }
1268c371 13003 // 2D:
13004 if(fCalculate2DDiffFlow)
13005 {
13006 for(Int_t t=0;t<2;t++) // type = RP or POI
13007 {
13008 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
13009 {
13010 if(!f2DDiffFlowCorrelationsPro[t][rci])
13011 {
13012 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in CheckPointersUsedInMake() !!!!\n\n",t,rci);
13013 exit(0);
13014 } // end of if(!f2DDiffFlowCorrelationsPro[t][rci])
13015 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
13016 } // end of for(Int_t t=0;t<2;t++)
13017 } // end of if(fCalculate2DDiffFlow)
b3dacf6b 13018
13019} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
13020
57340a27 13021