]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
fixed extension mode. in AOD input mode, extensions have to call mgr->GetOutputEventH...
[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"));
7437 if(weightsList) this->SetWeightsList(weightsList);
7438 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7439 fUseParticleWeightsName += fAnalysisLabel->Data();
7440 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7441 if(useParticleWeights)
7442 {
7443 this->SetUseParticleWeights(useParticleWeights);
7444 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7445 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7446 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7447 }
7448} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7449
7450
7451//================================================================================================================================
7452
7453
7454void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7455{
7456 // Get pointers for histograms and profiles relevant for integrated flow:
7457 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7458 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7459 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7460 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7461
7462 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7463 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
b40a910e 7464 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?)
7465 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 7466
7467 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7468 TList *intFlowList = NULL;
7469 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7470 if(!intFlowList)
7471 {
7472 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7473 exit(0);
7474 }
7475
b92ea2b9 7476 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7477 TString intFlowFlagsName = "fIntFlowFlags";
7478 intFlowFlagsName += fAnalysisLabel->Data();
7479 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7480 if(intFlowFlags)
7481 {
7482 this->SetIntFlowFlags(intFlowFlags);
7483 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
7484 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
7485 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
7486 } else
7487 {
7488 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7489 }
489d5531 7490
7491 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7492 TList *intFlowProfiles = NULL;
7493 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7494 if(intFlowProfiles)
7495 {
7496 // average multiplicities:
7497 TString avMultiplicityName = "fAvMultiplicity";
7498 avMultiplicityName += fAnalysisLabel->Data();
7499 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7500 if(avMultiplicity)
7501 {
7502 this->SetAvMultiplicity(avMultiplicity);
7503 } else
7504 {
7505 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7506 }
7507 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7508 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7509 intFlowCorrelationsProName += fAnalysisLabel->Data();
7510 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7511 if(intFlowCorrelationsPro)
7512 {
7513 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7514 } else
7515 {
7516 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7517 }
b40a910e 7518 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8^2>>:
7519 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
7520 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
7521 TProfile *intFlowSquaredCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowSquaredCorrelationsProName.Data()));
7522 if(intFlowSquaredCorrelationsPro)
7523 {
7524 this->SetIntFlowSquaredCorrelationsPro(intFlowSquaredCorrelationsPro);
7525 } else
7526 {
7527 cout<<"WARNING: intFlowSquaredCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7528 }
b3dacf6b 7529 if(fCalculateCumulantsVsM)
ff70ca91 7530 {
b40a910e 7531 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
b3dacf6b 7532 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7533 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7534 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7535 {
b3dacf6b 7536 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7537 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7538 if(intFlowCorrelationsVsMPro)
7539 {
7540 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7541 } else
7542 {
7543 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7544 }
7545 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b40a910e 7546 // Average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
7547 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
7548 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
7549 for(Int_t ci=0;ci<4;ci++) // correlation index
7550 {
7551 TProfile *intFlowSquaredCorrelationsVsMPro = dynamic_cast<TProfile*>
7552 (intFlowProfiles->FindObject(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data())));
7553 if(intFlowSquaredCorrelationsVsMPro)
7554 {
7555 this->SetIntFlowSquaredCorrelationsVsMPro(intFlowSquaredCorrelationsVsMPro,ci);
7556 } else
7557 {
7558 cout<<"WARNING: "<<Form("intFlowSquaredCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7559 }
7560 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b3dacf6b 7561 } // end of if(fCalculateCumulantsVsM)
489d5531 7562 // average all correlations for integrated flow (with wrong errors!):
7563 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7564 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7565 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7566 if(intFlowCorrelationsAllPro)
7567 {
7568 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7569 } else
7570 {
7571 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7572 }
7573 // average extra correlations for integrated flow (which appear only when particle weights are used):
7574 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7575 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7576 {
7577 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7578 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7579 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7580 if(intFlowExtraCorrelationsPro)
7581 {
7582 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7583 } else
7584 {
7585 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7586 }
7587 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7588 // average products of correlations <2>, <4>, <6> and <8>:
7589 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7590 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7591 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7592 if(intFlowProductOfCorrelationsPro)
7593 {
7594 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7595 } else
7596 {
7597 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7598 }
7599 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7600 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
b3dacf6b 7601 if(fCalculateCumulantsVsM)
7602 {
7603 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7604 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7605 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7606 for(Int_t pi=0;pi<6;pi++)
7607 {
7608 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7609 if(intFlowProductOfCorrelationsVsMPro)
7610 {
7611 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7612 } else
7613 {
7614 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7615 }
7616 } // end of for(Int_t pi=0;pi<6;pi++)
7617 } // end of if(fCalculateCumulantsVsM)
489d5531 7618 // average correction terms for non-uniform acceptance (with wrong errors!):
7619 for(Int_t sc=0;sc<2;sc++)
7620 {
7621 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7622 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7623 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7624 if(intFlowCorrectionTermsForNUAPro)
7625 {
7626 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7627 } else
7628 {
7629 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7630 cout<<"sc = "<<sc<<endl;
7631 }
2001bc3a 7632 // versus multiplicity:
b3dacf6b 7633 if(fCalculateCumulantsVsM)
2001bc3a 7634 {
b3dacf6b 7635 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
7636 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
7637 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
7638 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2001bc3a 7639 {
b3dacf6b 7640 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
7641 if(intFlowCorrectionTermsForNUAVsMPro)
7642 {
7643 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
7644 } else
7645 {
7646 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7647 cout<<"sc = "<<sc<<endl;
7648 cout<<"ci = "<<ci<<endl;
7649 }
7650 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7651 } // end of if(fCalculateCumulantsVsM)
489d5531 7652 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 7653 // average products of correction terms for NUA:
7654 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7655 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7656 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7657 if(intFlowProductOfCorrectionTermsForNUAPro)
7658 {
7659 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7660 } else
7661 {
7662 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7663 }
489d5531 7664 } else // to if(intFlowProfiles)
7665 {
7666 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7667 }
7668
7669 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7670 TList *intFlowResults = NULL;
7671 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7672 if(intFlowResults)
7673 {
7674 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7675 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7676 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7677 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7678 if(intFlowCorrelationsHist)
7679 {
7680 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7681 } else
7682 {
7683 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7684 }
ff70ca91 7685 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
b3dacf6b 7686 if(fCalculateCumulantsVsM)
ff70ca91 7687 {
b3dacf6b 7688 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7689 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7690 for(Int_t ci=0;ci<4;ci++) // correlation index
ff70ca91 7691 {
b3dacf6b 7692 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7693 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7694 if(intFlowCorrelationsVsMHist)
7695 {
7696 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7697 } else
7698 {
7699 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7700 }
7701 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7702 } // end of if(fCalculateCumulantsVsM)
489d5531 7703 // average all correlations for integrated flow (with correct errors!):
7704 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7705 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7706 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7707 if(intFlowCorrelationsAllHist)
7708 {
7709 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7710 } else
7711 {
7712 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7713 }
7714 // average correction terms for non-uniform acceptance (with correct errors!):
7715 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7716 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7717 for(Int_t sc=0;sc<2;sc++)
7718 {
7719 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7720 if(intFlowCorrectionTermsForNUAHist)
7721 {
7722 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7723 } else
7724 {
7725 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7726 cout<<"sc = "<<sc<<endl;
7727 }
7728 } // end of for(Int_t sc=0;sc<2;sc++)
7729 // covariances (multiplied with weight dependent prefactor):
7730 TString intFlowCovariancesName = "fIntFlowCovariances";
7731 intFlowCovariancesName += fAnalysisLabel->Data();
7732 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7733 if(intFlowCovariances)
7734 {
7735 this->SetIntFlowCovariances(intFlowCovariances);
7736 } else
7737 {
7738 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7739 }
7740 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7741 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7742 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7743 for(Int_t power=0;power<2;power++)
7744 {
7745 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7746 if(intFlowSumOfEventWeights)
7747 {
7748 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7749 } else
7750 {
7751 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7752 cout<<"power = "<<power<<endl;
7753 }
7754 } // end of for(Int_t power=0;power<2;power++)
7755 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7756 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7757 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7758 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7759 if(intFlowSumOfProductOfEventWeights)
7760 {
7761 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7762 } else
7763 {
7764 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7765 }
ff70ca91 7766 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7767 // [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 7768 if(fCalculateCumulantsVsM)
ff70ca91 7769 {
b3dacf6b 7770 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7771 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7772 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7773 for(Int_t ci=0;ci<6;ci++)
7774 {
7775 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7776 if(intFlowCovariancesVsM)
ff70ca91 7777 {
b3dacf6b 7778 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
ff70ca91 7779 } else
7780 {
b3dacf6b 7781 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7782 }
b3dacf6b 7783 } // end of for(Int_t ci=0;ci<6;ci++)
7784 } // end of if(fCalculateCumulantsVsM)
7785 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7786 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7787 if(fCalculateCumulantsVsM)
7788 {
7789 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7790 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7791 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>}"},
7792 {"#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}"}};
7793 for(Int_t si=0;si<4;si++)
7794 {
7795 for(Int_t power=0;power<2;power++)
7796 {
7797 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7798 if(intFlowSumOfEventWeightsVsM)
7799 {
7800 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7801 } else
7802 {
7803 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7804 }
7805 } // end of for(Int_t power=0;power<2;power++)
7806 } // end of for(Int_t si=0;si<4;si++)
7807 } // end of if(fCalculateCumulantsVsM)
ff70ca91 7808 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7809 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7810 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
b3dacf6b 7811 if(fCalculateCumulantsVsM)
ff70ca91 7812 {
b3dacf6b 7813 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7814 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7815 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>}",
7816 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7817 for(Int_t pi=0;pi<6;pi++)
ff70ca91 7818 {
b3dacf6b 7819 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7820 if(intFlowSumOfProductOfEventWeightsVsM)
7821 {
7822 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7823 } else
7824 {
7825 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7826 }
7827 } // end of for(Int_t pi=0;pi<6;pi++)
7828 } // end of if(fCalculateCumulantsVsM)
0328db2d 7829 // covariances for NUA (multiplied with weight dependent prefactor):
7830 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7831 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7832 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7833 if(intFlowCovariancesNUA)
7834 {
7835 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7836 } else
7837 {
7838 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7839 }
7840 // sum of linear and quadratic event weights NUA terms:
7841 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7842 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7843 for(Int_t sc=0;sc<2;sc++)
7844 {
7845 for(Int_t power=0;power<2;power++)
7846 {
7847 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7848 if(intFlowSumOfEventWeightsNUA)
7849 {
7850 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7851 } else
7852 {
7853 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7854 cout<<"sc = "<<sc<<endl;
7855 cout<<"power = "<<power<<endl;
7856 }
7857 } // end of for(Int_t power=0;power<2;power++)
7858 } // end of for(Int_t sc=0;sc<2;sc++)
7859 // sum of products of event weights for NUA terms:
7860 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7861 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7862 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7863 if(intFlowSumOfProductOfEventWeightsNUA)
7864 {
7865 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7866 } else
7867 {
7868 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7869 }
b3dacf6b 7870 // Final results for reference Q-cumulants:
489d5531 7871 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7872 intFlowQcumulantsName += fAnalysisLabel->Data();
7873 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7874 if(intFlowQcumulants)
7875 {
7876 this->SetIntFlowQcumulants(intFlowQcumulants);
7877 } else
7878 {
7879 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7880 }
b3dacf6b 7881 // Final results for reference Q-cumulants rebinned in M:
7882 if(fCalculateCumulantsVsM)
7883 {
7884 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
7885 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
7886 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
7887 if(intFlowQcumulantsRebinnedInM)
7888 {
7889 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
7890 } else
7891 {
7892 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7893 }
7894 } // end of if(fCalculateCumulantsVsM)
b92ea2b9 7895 // Ratio between error squared: with/without non-isotropic terms:
7896 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
7897 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
7898 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
7899 if(intFlowQcumulantsErrorSquaredRatio)
7900 {
7901 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
7902 } else
7903 {
7904 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7905 }
ff70ca91 7906 // final results for integrated Q-cumulants versus multiplicity:
ff70ca91 7907 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
b3dacf6b 7908 if(fCalculateCumulantsVsM)
ff70ca91 7909 {
b3dacf6b 7910 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7911 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7912 for(Int_t co=0;co<4;co++) // cumulant order
ff70ca91 7913 {
b3dacf6b 7914 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7915 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7916 if(intFlowQcumulantsVsM)
7917 {
7918 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7919 } else
7920 {
7921 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7922 }
7923 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7924 } // end of if(fCalculateCumulantsVsM)
7925 // Final reference flow estimates from Q-cumulants:
489d5531 7926 TString intFlowName = "fIntFlow";
7927 intFlowName += fAnalysisLabel->Data();
7928 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7929 if(intFlow)
7930 {
7931 this->SetIntFlow(intFlow);
7932 } else
7933 {
7934 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7935 }
b3dacf6b 7936 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
7937 if(fCalculateCumulantsVsM)
ff70ca91 7938 {
b3dacf6b 7939 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
7940 intFlowRebinnedInMName += fAnalysisLabel->Data();
7941 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
7942 if(intFlowRebinnedInM)
ff70ca91 7943 {
b3dacf6b 7944 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
7945 } else
ff70ca91 7946 {
b3dacf6b 7947 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7948 }
7949 } // end of if(fCalculateCumulantsVsM)
7950 // integrated flow from Q-cumulants versus multiplicity:
7951 if(fCalculateCumulantsVsM)
7952 {
7953 TString intFlowVsMName = "fIntFlowVsM";
7954 intFlowVsMName += fAnalysisLabel->Data();
b77b6434 7955 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 7956 for(Int_t co=0;co<4;co++) // cumulant order
7957 {
7958 TH1D *intFlowVsM = dynamic_cast<TH1D*>
b77b6434 7959 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
b3dacf6b 7960 if(intFlowVsM)
7961 {
7962 this->SetIntFlowVsM(intFlowVsM,co);
7963 } else
7964 {
7965 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7966 }
7967 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7968 } // end of if(fCalculateCumulantsVsM)
2001bc3a 7969 // quantifying detector effects effects to correlations:
7970 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
7971 intFlowDetectorBiasName += fAnalysisLabel->Data();
7972 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
7973 if(intFlowDetectorBias)
7974 {
7975 this->SetIntFlowDetectorBias(intFlowDetectorBias);
7976 } else
7977 {
7978 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7979 }
7980 // quantifying detector effects effects to correlations vs multiplicity:
b77b6434 7981 if(fCalculateCumulantsVsM)
2001bc3a 7982 {
3c5d5752 7983 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
7984 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
7985 for(Int_t ci=0;ci<4;ci++) // correlation index
2001bc3a 7986 {
3c5d5752 7987 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
7988 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
7989 if(intFlowDetectorBiasVsM)
7990 {
7991 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
7992 } else
7993 {
7994 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7995 }
7996 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
b77b6434 7997 } // end of if(fCalculateCumulantsVsM)
489d5531 7998 } else // to if(intFlowResults)
7999 {
8000 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8001 }
ff70ca91 8002
489d5531 8003} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8004
489d5531 8005//================================================================================================================================
8006
1268c371 8007void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8008{
8009 // Get pointers for 2D differential flow histograms.
8010 // a) Check pointers used in this method;
8011 // b) Get pointers to 2D differential flow lists;
8012 // c) Get pointers to 2D differential flow profiles;
8013 // d) Get pointers to 2D differential flow histograms.
8014
8015 // a) Check pointers used in this method:
8016 if(!fDiffFlowList)
8017 {
8018 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPF2DDFH() !!!!\n");
8019 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8020 exit(0);
8021 }
8022 if(!fDiffFlowFlags)
8023 {
8024 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPF2DDFH() !!!!\n\n");
8025 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8026 exit(0);
8027 }
8028
8029 // b) Get pointers to 2D differential flow lists:
8030 this->SetCalculate2DDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(5)); // to be improved - hardwired 5
8031 if(!fCalculate2DDiffFlow){return;}
8032 TString typeFlag[2] = {"RP","POI"};
8033 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8034 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8035 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8036 // Base list:
8037 TString diffFlow2DListName = "2D";
8038 diffFlow2DListName += fAnalysisLabel->Data();
8039 fDiffFlow2D = dynamic_cast<TList*>(fDiffFlowList->FindObject(diffFlow2DListName.Data()));
8040 if(!fDiffFlow2D)
8041 {
8042 printf("\n WARNING (QC): fDiffFlow2D is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8043 exit(0);
8044 }
8045 // Lists holding profiles with 2D correlations:
8046 TString s2DDiffFlowCorrelationsProListName = "Profiles with 2D correlations";
8047 s2DDiffFlowCorrelationsProListName += fAnalysisLabel->Data(); // to be improved
8048 for(Int_t t=0;t<2;t++)
8049 {
8050 f2DDiffFlowCorrelationsProList[t] = dynamic_cast<TList*>(fDiffFlow2D->FindObject(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data())));
8051 if(!f2DDiffFlowCorrelationsProList[t])
8052 {
8053 printf("\n WARNING (QC): f2DDiffFlowCorrelationsProList[%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t);
8054 exit(0);
8055 }
8056 } // end of for(Int_t t=0;t<2;t++)
8057
8058 // c) Get pointers to 2D differential flow profiles:
8059 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8060 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8061 for(Int_t t=0;t<2;t++) // type: RP or POI
8062 {
8063 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8064 {
8065 f2DDiffFlowCorrelationsPro[t][rci] = dynamic_cast<TProfile2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data())));
8066 if(!f2DDiffFlowCorrelationsPro[t][rci])
8067 {
8068 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8069 exit(0);
8070 } else
8071 {
8072 this->Set2DDiffFlowCorrelationsPro(f2DDiffFlowCorrelationsPro[t][rci],t,rci);
8073 }
8074 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8075 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8076
8077 // d) Get pointers to 2D differential flow histograms:
8078 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8079 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8080 TString s2DDiffFlowName = "f2DDiffFlow";
8081 s2DDiffFlowName += fAnalysisLabel->Data();
8082 for(Int_t t=0;t<2;t++) // type: RP or POI
8083 {
8084 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8085 {
8086 // 2D differential cumulants:
8087 f2DDiffFlowCumulants[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data())));
8088 if(!f2DDiffFlowCumulants[t][rci])
8089 {
8090 printf("\n WARNING (QC): f2DDiffFlowCumulants[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8091 exit(0);
8092 } else
8093 {
8094 this->Set2DDiffFlowCumulants(f2DDiffFlowCumulants[t][rci],t,rci);
8095 }
8096 // 2D differential flow:
8097 f2DDiffFlow[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data())));
8098 if(!f2DDiffFlow[t][rci])
8099 {
8100 printf("\n WARNING (QC): f2DDiffFlow[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8101 exit(0);
8102 } else
8103 {
8104 this->Set2DDiffFlow(f2DDiffFlow[t][rci],t,rci);
8105 }
8106 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8107 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8108
8109} // end of void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8110
8111//================================================================================================================================
8112
489d5531 8113void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8114{
8115 // Get pointer to all objects relevant for differential flow.
1268c371 8116 // a) Get pointer to base list for differential flow fDiffFlowList;
8117 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags;
8118 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults;
8119 // d) Define flags locally (to be improved: should I promote these flags to data members?);
8120 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8121 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8122
8123 // a) Get pointer to base list for differential flow fDiffFlowList:
8124 fDiffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
8125 if(!fDiffFlowList)
489d5531 8126 {
1268c371 8127 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8128 exit(0);
8129 }
1268c371 8130
8131 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags:
8132 TString diffFlowFlagsName = "fDiffFlowFlags";
8133 diffFlowFlagsName += fAnalysisLabel->Data();
8134 fDiffFlowFlags = dynamic_cast<TProfile*>(fDiffFlowList->FindObject(diffFlowFlagsName.Data()));
8135 if(fDiffFlowFlags)
8136 {
8137 this->SetCalculateDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(1)); // to be improved - hardwired 5
8138 } else
8139 {
8140 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8141 printf("\n Flags in method Finish() are wrong.\n\n");
8142 exit(0);
8143 }
8144
8145 if(!fCalculateDiffFlow){return;} // IMPORTANT: do not move this anywhere above in this method (to be improved)
8146
8147 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults:
8148 // List holding nested lists holding profiles:
489d5531 8149 TList *diffFlowListProfiles = NULL;
1268c371 8150 diffFlowListProfiles = dynamic_cast<TList*>(fDiffFlowList->FindObject("Profiles"));
489d5531 8151 if(!diffFlowListProfiles)
8152 {
1268c371 8153 printf("\n WARNING (QC): diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8154 exit(0);
8155 }
1268c371 8156 // List holding nested lists holding histograms with final results:
489d5531 8157 TList *diffFlowListResults = NULL;
1268c371 8158 diffFlowListResults = dynamic_cast<TList*>(fDiffFlowList->FindObject("Results"));
489d5531 8159 if(!diffFlowListResults)
8160 {
1268c371 8161 printf("\n WARNING (QC): diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!\n\n");
489d5531 8162 exit(0);
8163 }
8164
1268c371 8165 // d) Define flags locally (to be improved: should I promote these flags to data members?):
8166 TString typeFlag[2] = {"RP","POI"};
8167 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8168 TString powerFlag[2] = {"linear","quadratic"};
8169 TString sinCosFlag[2] = {"sin","cos"};
8170 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8171 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8172 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8173 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
8174 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8175 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
489d5531 8176
1268c371 8177 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold:
489d5531 8178 // correlations:
8179 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
8180 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8181 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 8182 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
8183 // squared correlations:
8184 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8185 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8186 TProfile *diffFlowSquaredCorrelationsPro[2][2][4] = {{{NULL}}};
489d5531 8187 // products of correlations:
8188 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
8189 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8190 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8191 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
8192 // corrections:
8193 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
8194 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8195 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8196 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
8197 for(Int_t t=0;t<2;t++)
8198 {
8199 for(Int_t pe=0;pe<2;pe++)
8200 {
8201 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8202 if(!diffFlowCorrelationsProList[t][pe])
8203 {
8204 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8205 cout<<"t = "<<t<<endl;
8206 cout<<"pe = "<<pe<<endl;
8207 exit(0);
8208 }
8209 for(Int_t ci=0;ci<4;ci++) // correlation index
8210 {
b40a910e 8211 // reduced correlations:
489d5531 8212 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())));
8213 if(diffFlowCorrelationsPro[t][pe][ci])
8214 {
8215 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
8216 } else
8217 {
8218 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8219 cout<<"t = "<<t<<endl;
8220 cout<<"pe = "<<pe<<endl;
8221 cout<<"ci = "<<ci<<endl;
8222 }
b40a910e 8223 // reduced squared correlations:
8224 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())));
8225 if(diffFlowSquaredCorrelationsPro[t][pe][ci])
8226 {
8227 this->SetDiffFlowSquaredCorrelationsPro(diffFlowSquaredCorrelationsPro[t][pe][ci],t,pe,ci);
8228 } else
8229 {
8230 cout<<"WARNING: diffFlowSquaredCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8231 cout<<"t = "<<t<<endl;
8232 cout<<"pe = "<<pe<<endl;
8233 cout<<"ci = "<<ci<<endl;
8234 }
489d5531 8235 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8236 // products of correlations:
8237 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8238 if(!diffFlowProductOfCorrelationsProList[t][pe])
8239 {
8240 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8241 cout<<"t = "<<t<<endl;
8242 cout<<"pe = "<<pe<<endl;
8243 exit(0);
8244 }
8245 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8246 {
8247 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8248 {
8249 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())));
8250 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
8251 {
8252 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
8253 } else
8254 {
b40a910e 8255 cout<<"WARNING: diffFlowProductOfCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
489d5531 8256 cout<<"t = "<<t<<endl;
8257 cout<<"pe = "<<pe<<endl;
8258 cout<<"mci1 = "<<mci1<<endl;
8259 cout<<"mci2 = "<<mci2<<endl;
8260 }
8261 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8262 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8263 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8264 // corrections:
8265 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8266 if(!diffFlowCorrectionsProList[t][pe])
8267 {
8268 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8269 cout<<"t = "<<t<<endl;
8270 cout<<"pe = "<<pe<<endl;
8271 exit(0);
8272 }
8273 // correction terms for NUA:
8274 for(Int_t sc=0;sc<2;sc++) // sin or cos
8275 {
8276 for(Int_t cti=0;cti<9;cti++) // correction term index
8277 {
8278 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)));
8279 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
8280 {
8281 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
8282 } else
8283 {
8284 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8285 cout<<"t = "<<t<<endl;
8286 cout<<"pe = "<<pe<<endl;
8287 cout<<"sc = "<<sc<<endl;
8288 cout<<"cti = "<<cti<<endl;
8289 }
8290 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8291 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8292 // ...
8293 } // end of for(Int_t pe=0;pe<2;pe++)
8294 } // end of for(Int_t t=0;t<2;t++)
8295
1268c371 8296 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold:
489d5531 8297 // reduced correlations:
8298 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
8299 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8300 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8301 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
8302 // corrections for NUA:
8303 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
8304 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8305 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8306 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
8307 // differential Q-cumulants:
8308 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
8309 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8310 diffFlowCumulantsName += fAnalysisLabel->Data();
8311 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1268c371 8312 // detector bias to differential Q-cumulants:
8313 TList *diffFlowDetectorBiasHistList[2][2] = {{NULL}};
8314 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
8315 diffFlowDetectorBiasName += fAnalysisLabel->Data();
8316 TH1D *diffFlowDetectorBias[2][2][4] = {{{NULL}}};
489d5531 8317 // differential flow estimates from Q-cumulants:
8318 TList *diffFlowHistList[2][2] = {{NULL}};
8319 TString diffFlowName = "fDiffFlow";
8320 diffFlowName += fAnalysisLabel->Data();
8321 TH1D *diffFlow[2][2][4] = {{{NULL}}};
8322 // differential covariances:
8323 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
8324 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8325 diffFlowCovariancesName += fAnalysisLabel->Data();
8326 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
8327 for(Int_t t=0;t<2;t++) // type: RP or POI
8328 {
8329 for(Int_t pe=0;pe<2;pe++) // pt or eta
8330 {
8331 // reduced correlations:
8332 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8333 if(!diffFlowCorrelationsHistList[t][pe])
8334 {
8335 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8336 cout<<"t = "<<t<<endl;
8337 cout<<"pe = "<<pe<<endl;
8338 exit(0);
8339 }
8340 for(Int_t index=0;index<4;index++)
8341 {
8342 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())));
8343 if(diffFlowCorrelationsHist[t][pe][index])
8344 {
8345 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8346 } else
8347 {
8348 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8349 cout<<"t = "<<t<<endl;
8350 cout<<"pe = "<<pe<<endl;
8351 cout<<"index = "<<index<<endl;
8352 exit(0);
8353 }
8354 } // end of for(Int_t index=0;index<4;index++)
8355 // corrections:
8356 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8357 if(!diffFlowCorrectionsHistList[t][pe])
8358 {
8359 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8360 cout<<"t = "<<t<<endl;
8361 cout<<"pe = "<<pe<<endl;
8362 exit(0);
8363 }
8364 // correction terms for NUA:
8365 for(Int_t sc=0;sc<2;sc++) // sin or cos
8366 {
8367 for(Int_t cti=0;cti<9;cti++) // correction term index
8368 {
8369 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)));
8370 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8371 {
8372 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8373 } else
8374 {
8375 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8376 cout<<"t = "<<t<<endl;
8377 cout<<"pe = "<<pe<<endl;
8378 cout<<"sc = "<<sc<<endl;
8379 cout<<"cti = "<<cti<<endl;
8380 }
8381 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8382 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8383 // ...
8384 // differential Q-cumulants:
8385 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8386 if(!diffFlowCumulantsHistList[t][pe])
8387 {
8388 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8389 cout<<"t = "<<t<<endl;
8390 cout<<"pe = "<<pe<<endl;
8391 exit(0);
8392 }
8393 for(Int_t index=0;index<4;index++)
8394 {
8395 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())));
8396 if(diffFlowCumulants[t][pe][index])
8397 {
8398 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8399 } else
8400 {
8401 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8402 cout<<"t = "<<t<<endl;
8403 cout<<"pe = "<<pe<<endl;
8404 cout<<"index = "<<index<<endl;
8405 exit(0);
8406 }
8407 } // end of for(Int_t index=0;index<4;index++)
1268c371 8408 // Detector bias to differential Q-cumulants:
8409 diffFlowDetectorBiasHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8410 if(!diffFlowDetectorBiasHistList[t][pe])
8411 {
8412 cout<<"WARNING: diffFlowDetectorBiasHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8413 cout<<"t = "<<t<<endl;
8414 cout<<"pe = "<<pe<<endl;
8415 exit(0);
8416 }
8417 for(Int_t index=0;index<4;index++)
8418 {
8419 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())));
8420 if(diffFlowDetectorBias[t][pe][index])
8421 {
8422 this->SetDiffFlowDetectorBias(diffFlowDetectorBias[t][pe][index],t,pe,index);
8423 } else
8424 {
8425 cout<<"WARNING: diffFlowDetectorBias[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8426 cout<<"t = "<<t<<endl;
8427 cout<<"pe = "<<pe<<endl;
8428 cout<<"index = "<<index<<endl;
8429 exit(0);
8430 }
8431 } // end of for(Int_t index=0;index<4;index++)
489d5531 8432 // differential flow estimates from Q-cumulants:
8433 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8434 if(!diffFlowHistList[t][pe])
8435 {
8436 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8437 cout<<"t = "<<t<<endl;
8438 cout<<"pe = "<<pe<<endl;
8439 exit(0);
8440 }
8441 for(Int_t index=0;index<4;index++)
8442 {
8443 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())));
8444 if(diffFlow[t][pe][index])
8445 {
8446 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8447 } else
8448 {
8449 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8450 cout<<"t = "<<t<<endl;
8451 cout<<"pe = "<<pe<<endl;
8452 cout<<"index = "<<index<<endl;
8453 exit(0);
8454 }
8455 } // end of for(Int_t index=0;index<4;index++)
8456 // differential covariances:
8457 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8458 if(!diffFlowCovariancesHistList[t][pe])
8459 {
8460 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8461 cout<<"t = "<<t<<endl;
8462 cout<<"pe = "<<pe<<endl;
8463 exit(0);
8464 }
8465 for(Int_t covIndex=0;covIndex<5;covIndex++)
8466 {
8467 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())));
8468 if(diffFlowCovariances[t][pe][covIndex])
8469 {
8470 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8471 } else
8472 {
8473 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8474 cout<<"t = "<<t<<endl;
8475 cout<<"pe = "<<pe<<endl;
8476 cout<<"covIndex = "<<covIndex<<endl;
8477 exit(0);
8478 }
8479 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8480 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8481 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8482 // sum of event weights for reduced correlations:
8483 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8484 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8485 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8486 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8487 for(Int_t t=0;t<2;t++) // type is RP or POI
8488 {
8489 for(Int_t pe=0;pe<2;pe++) // pt or eta
8490 {
8491 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8492 {
8493 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())));
8494 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8495 {
8496 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8497 cout<<"t = "<<t<<endl;
8498 cout<<"pe = "<<pe<<endl;
8499 cout<<"power = "<<p<<endl;
8500 exit(0);
8501 }
8502 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8503 {
8504 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())));
8505 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8506 {
8507 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8508 } else
8509 {
8510 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8511 cout<<"t = "<<t<<endl;
8512 cout<<"pe = "<<pe<<endl;
8513 cout<<"power = "<<p<<endl;
8514 cout<<"ew = "<<ew<<endl;
8515 exit(0);
8516 }
8517 }
8518 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8519 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8520 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8521 //
8522 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8523 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8524 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8525 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8526 for(Int_t t=0;t<2;t++) // type is RP or POI
8527 {
8528 for(Int_t pe=0;pe<2;pe++) // pt or eta
8529 {
8530 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8531 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8532 {
8533 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8534 cout<<"t = "<<t<<endl;
8535 cout<<"pe = "<<pe<<endl;
8536 exit(0);
8537 }
8538 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8539 {
8540 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8541 {
8542 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())));
8543 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8544 {
8545 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8546 } else
8547 {
8548 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8549 cout<<"t = "<<t<<endl;
8550 cout<<"pe = "<<pe<<endl;
8551 cout<<"mci1 = "<<mci1<<endl;
8552 cout<<"mci2 = "<<mci2<<endl;
8553 exit(0);
8554 }
8555 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8556 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8557 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8558 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8559 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8560
8561} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8562
489d5531 8563//================================================================================================================================
8564
1268c371 8565void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
8566{
8567 // Book all objects needed for 2D differential flow.
8568 // a) Define flags locally (to be improved: should I promote flags to data members?);
8569 // b) Book e-b-e quantities;
8570 // c) Book 2D profiles;
8571 // d) Book 2D histograms.
8572
8573 if(!fCalculate2DDiffFlow){return;}
8574
8575 // a) Define flags locally (to be improved: should I promote flags to data members?):
8576 TString typeFlag[2] = {"RP","POI"};
8577 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8578 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8579 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8580
8581 // b) Book e-b-e quantities:
8582 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8583 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8584 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8585 {
8586 for(Int_t m=0;m<4;m++)
8587 {
8588 for(Int_t k=0;k<9;k++)
8589 {
8590 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8591 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8592 }
8593 }
8594 }
8595 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8596 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8597 {
8598 for(Int_t k=0;k<9;k++)
8599 {
8600 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8601 }
8602 }
8603
8604 // c) Book 2D profiles:
8605 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8606 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8607 for(Int_t t=0;t<2;t++) // type: RP or POI
8608 {
8609 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8610 {
8611 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,"");
8612 f2DDiffFlowCorrelationsPro[t][rci]->Sumw2();
8613 f2DDiffFlowCorrelationsPro[t][rci]->SetXTitle("p_{t}");
8614 f2DDiffFlowCorrelationsPro[t][rci]->SetYTitle("#eta");
8615 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCorrelationsPro[t][rci]);
8616 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8617 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
8618
8619 // d) Book 2D histograms:
8620 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8621 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8622 TString s2DDiffFlowName = "f2DDiffFlow";
8623 s2DDiffFlowName += fAnalysisLabel->Data();
8624 for(Int_t t=0;t<2;t++) // type: RP or POI
8625 {
8626 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8627 {
8628 // 2D diferential cumulants:
8629 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);
8630 f2DDiffFlowCumulants[t][rci]->SetXTitle("p_{t}");
8631 f2DDiffFlowCumulants[t][rci]->SetYTitle("#eta");
8632 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCumulants[t][rci]); // to be improved - moved to another list
8633 // 2D differential flow:
8634 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);
8635 f2DDiffFlow[t][rci]->SetXTitle("p_{t}");
8636 f2DDiffFlow[t][rci]->SetYTitle("#eta");
8637 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlow[t][rci]); // to be improved - moved to another list
8638 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8639 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
8640
8641} // void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
8642
8643//================================================================================================================================
489d5531 8644
8645void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8646{
8647 // Book all histograms and profiles needed for differential flow.
1268c371 8648 // a) Book profile to hold all flags for differential flow;
8649 // b) Define flags locally (to be improved: should I promote flags to data members?);
489d5531 8650 // c) Book e-b-e quantities;
8651 // d) Book profiles;
8652 // e) Book histograms holding final results.
8653
1268c371 8654 // a) Book profile to hold all flags for differential flow:
8655 TString diffFlowFlagsName = "fDiffFlowFlags";
8656 diffFlowFlagsName += fAnalysisLabel->Data();
8657 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for differential flow",5,0,5);
8658 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8659 fDiffFlowFlags->SetMarkerStyle(25);
8660 fDiffFlowFlags->SetLabelSize(0.04,"X");
8661 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8662 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"Calculate diff. flow");
8663 fDiffFlowFlags->GetXaxis()->SetBinLabel(2,"Particle weights");
8664 fDiffFlowFlags->GetXaxis()->SetBinLabel(3,"Event weights");
8665 fDiffFlowFlags->GetXaxis()->SetBinLabel(4,"Correct for NUA");
8666 fDiffFlowFlags->GetXaxis()->SetBinLabel(5,"Calculate 2D diff. flow");
8667 fDiffFlowList->Add(fDiffFlowFlags);
8668
8669 if(!fCalculateDiffFlow){return;}
8670
8671 // b) Define flags locally (to be improved: should I promote flags to data members?):
489d5531 8672 TString typeFlag[2] = {"RP","POI"};
8673 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8674 TString powerFlag[2] = {"linear","quadratic"};
8675 TString sinCosFlag[2] = {"sin","cos"};
8676 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8677 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8678 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
b40a910e 8679 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
489d5531 8680 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8681 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8682 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8683 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8684 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
1268c371 8685
489d5531 8686 // c) Book e-b-e quantities:
8687 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8688 // Explanantion of notation:
8689 // 1.) n is harmonic, m is multiple of harmonic;
8690 // 2.) k is power of particle weight;
8691 // 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);
8692 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8693 // (if i-th POI is also RP, than it is weighted with w_i^k);
8694 // 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
8695 // (i-th RP&&POI is weighted with w_i^k)
8696
8697 // 1D:
8698 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8699 {
8700 for(Int_t pe=0;pe<2;pe++) // pt or eta
8701 {
8702 for(Int_t m=0;m<4;m++) // multiple of harmonic
8703 {
8704 for(Int_t k=0;k<9;k++) // power of particle weight
8705 {
8706 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8707 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8708 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8709 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8710 }
8711 }
8712 }
8713 }
8714 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8715 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8716 {
8717 for(Int_t pe=0;pe<2;pe++) // pt or eta
8718 {
8719 for(Int_t k=0;k<9;k++) // power of particle weight
8720 {
8721 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8722 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8723 }
8724 }
8725 }
8726 // correction terms for nua:
8727 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8728 {
8729 for(Int_t pe=0;pe<2;pe++) // pt or eta
8730 {
8731 for(Int_t sc=0;sc<2;sc++) // sin or cos
8732 {
8733 for(Int_t cti=0;cti<9;cti++) // correction term index
8734 {
8735 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8736 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8737 }
8738 }
8739 }
8740 }
489d5531 8741 // reduced correlations e-b-e:
8742 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8743 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8744 for(Int_t t=0;t<2;t++) // type: RP or POI
8745 {
8746 for(Int_t pe=0;pe<2;pe++) // pt or eta
8747 {
8748 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8749 {
8750 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]);
8751 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8752 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8753 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8754 // event weights for reduced correlations e-b-e:
8755 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8756 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8757 for(Int_t t=0;t<2;t++) // type: RP or POI
8758 {
8759 for(Int_t pe=0;pe<2;pe++) // pt or eta
8760 {
8761 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8762 {
8763 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]);
8764 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8765 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8766 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8767
8768 // d) Book profiles;
8769 // reduced correlations:
8770 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8771 diffFlowCorrelationsProName += fAnalysisLabel->Data();
b40a910e 8772 // reduced squared correlations:
8773 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8774 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
489d5531 8775 // corrections terms:
8776 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8777 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
b40a910e 8778 // reduced correlations:
489d5531 8779 for(Int_t t=0;t<2;t++) // type: RP or POI
8780 {
8781 for(Int_t pe=0;pe<2;pe++) // pt or eta
8782 {
8783 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8784 {
489d5531 8785 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 8786 fDiffFlowCorrelationsPro[t][pe][rci]->Sumw2();
489d5531 8787 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8788 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8789 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8790 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8791 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
b40a910e 8792 // reduced squared correlations:
8793 for(Int_t t=0;t<2;t++) // type: RP or POI
8794 {
8795 for(Int_t pe=0;pe<2;pe++) // pt or eta
8796 {
8797 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8798 {
8799 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");
8800 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->Sumw2();
8801 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8802 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowSquaredCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8803 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8804 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8805 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
489d5531 8806 // correction terms for nua:
8807 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8808 {
8809 for(Int_t pe=0;pe<2;pe++) // pt or eta
8810 {
8811 for(Int_t sc=0;sc<2;sc++) // sin or cos
8812 {
8813 for(Int_t cti=0;cti<9;cti++) // correction term index
8814 {
8815 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]);
8816 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8817 }
8818 }
8819 }
8820 }
8821 // e) Book histograms holding final results.
8822 // reduced correlations:
8823 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8824 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8825 // corrections terms:
8826 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8827 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8828 // differential covariances:
8829 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8830 diffFlowCovariancesName += fAnalysisLabel->Data();
8831 // differential Q-cumulants:
8832 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8833 diffFlowCumulantsName += fAnalysisLabel->Data();
1268c371 8834 // Detector bias to differential Q-cumulants:
8835 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
8836 diffFlowDetectorBiasName += fAnalysisLabel->Data();
489d5531 8837 // differential flow:
8838 TString diffFlowName = "fDiffFlow";
8839 diffFlowName += fAnalysisLabel->Data();
8840 for(Int_t t=0;t<2;t++) // type: RP or POI
8841 {
8842 for(Int_t pe=0;pe<2;pe++) // pt or eta
8843 {
8844 for(Int_t index=0;index<4;index++)
8845 {
8846 // reduced correlations:
8847 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]);
8848 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8849 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8850 // differential Q-cumulants:
8851 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]);
8852 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8853 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
1268c371 8854 // Detector bias to differential Q-cumulants:
8855 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]);
8856 fDiffFlowDetectorBias[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8857 fDiffFlowDetectorBias[t][pe][index]->SetTitle(Form("#frac{corrected}{measured} %s",differentialCumulantIndex[index].Data()));
8858 fDiffFlowDetectorBiasHistList[t][pe]->Add(fDiffFlowDetectorBias[t][pe][index]);
489d5531 8859 // differential flow estimates from Q-cumulants:
8860 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]);
8861 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8862 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8863 } // end of for(Int_t index=0;index<4;index++)
8864 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8865 {
8866 // differential covariances:
8867 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]);
8868 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8869 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8870 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8871 // products of both types of correlations:
8872 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8873 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8874 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8875 {
8876 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8877 {
8878 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]);
8879 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8880 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8881 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8882 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8883 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8884 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8885 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8886 // sums of event weights for reduced correlations:
8887 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8888 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8889 for(Int_t t=0;t<2;t++) // type is RP or POI
8890 {
8891 for(Int_t pe=0;pe<2;pe++) // pt or eta
8892 {
8893 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8894 {
8895 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8896 {
8897 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]);
8898 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8899 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8900 }
8901 }
8902 }
8903 }
8904 // sum of products of event weights for both types of correlations:
8905 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8906 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8907 for(Int_t t=0;t<2;t++) // type is RP or POI
8908 {
8909 for(Int_t pe=0;pe<2;pe++) // pt or eta
8910 {
8911 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8912 {
8913 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8914 {
8915 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]);
8916 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8917 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8918 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8919 }
8920 }
8921 }
8922 }
8923 // correction terms for nua:
8924 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8925 {
8926 for(Int_t pe=0;pe<2;pe++) // pt or eta
8927 {
8928 for(Int_t sc=0;sc<2;sc++) // sin or cos
8929 {
8930 for(Int_t cti=0;cti<9;cti++) // correction term index
8931 {
8932 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]);
8933 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8934 }
8935 }
8936 }
8937 }
8938
8939} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8940
489d5531 8941//================================================================================================================================
8942
489d5531 8943void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8944{
8945 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8946
b92ea2b9 8947 // Isotropic cumulants:
8948 Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
8949 Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
8950 Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
8951 Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
8952 //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
8953 //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
8954 //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
8955 //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
8956
8957 // Measured 2-, 4-, 6- and 8-particle correlations:
489d5531 8958 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
b92ea2b9 8959 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
489d5531 8960 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
b92ea2b9 8961 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
489d5531 8962 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
489d5531 8963 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
b92ea2b9 8964 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
489d5531 8965 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
b92ea2b9 8966
8967 // Non-isotropic terms:
8968 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
8969 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
8970 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
8971 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
8972 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
8973 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
8974 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
8975 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
8976 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
8977 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
8978 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
8979 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
8980
8981 // Shortcuts:
8982 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
8983 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
8984 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
8985 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
8986 Double_t a5 = 4.*c1*s1-s2;
8987
8988 // Covariances (including weight dependent prefactor):
8e1cefdd 8989 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
8990 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
8991 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
8992 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
8993 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
8994 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
8995 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
8996 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
8997 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
8998 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
8999 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9000 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
9001 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9002 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9003 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9004 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9005 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9006 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9007 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9008 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9009 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9010 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9011 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9012 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9013 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9014 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9015 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9016 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9017 if(!fForgetAboutCovariances)
9018 {
9019 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
9020 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
9021 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
9022 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
9023 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9024 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9025 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9026 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9027 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
9028 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9029 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9030 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
9031 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9032 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9033 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9034 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9035 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9036 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9037 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9038 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9039 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9040 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9041 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9042 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9043 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9044 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9045 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9046 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9047 } // end of if(!fForgetAboutCovariances)
9048
b92ea2b9 9049 // Calculating generalized QC{2}:
9050 // Generalized QC{2}:
9051 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
9052 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
9053 // Statistical error of generalized QC{2}:
9054 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
9055 + 4.*pow(s1,2.)*pow(s1Error,2.)
9056 - 4*c1*wCov1-4*s1*wCov2
9057 + 8.*c1*s1*wCov3;
9058 // Store ratio of error squared - with/without NUA terms:
9059 Double_t ratioErrorSquaredQC2 = 0.;
9060 if(fIntFlowQcumulants->GetBinError(1)>0.)
9061 {
9062 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
9063 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
9064 }
9065 // If enabled, store error by including non-isotropic terms:
b77b6434 9066 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9067 {
9068 if(gQC2ErrorSquared>=0.)
9069 {
9070 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
9071 } else
9072 {
9073 fIntFlowQcumulants->SetBinError(1,0.);
9074 cout<<endl;
9075 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
9076 cout<<endl;
9077 }
b77b6434 9078 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9079 // Quantify detector bias to QC{2}:
9080 if(TMath::Abs(QC2)>0.)
9081 {
9082 fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2);
9083 if(QC2Error>0.)
9084 {
9085 Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
9086 if(errorSquared>0.)
9087 {
9088 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
9089 }
9090 }
9091 } // end of if(TMath::Abs(QC2)>0.)
9092
9093 // Calculating generalized QC{4}:
9094 // Generalized QC{4}:
9095 Double_t gQC4 = four-2.*pow(two,2.)
9096 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9097 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9098 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
9099 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
9100 // Statistical error of generalized QC{4}:
9101 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
9102 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
9103 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
9104 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
9105 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
9106 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
9107 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
9108 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
9109 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
9110 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
9111 // Store ratio of error squared - with/without NUA terms:
9112 Double_t ratioErrorSquaredQC4 = 0.;
9113 if(fIntFlowQcumulants->GetBinError(2)>0.)
9114 {
9115 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
9116 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
9117 }
b77b6434 9118 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9119 {
9120 if(gQC4ErrorSquared>=0.)
9121 {
9122 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
9123 } else
9124 {
9125 fIntFlowQcumulants->SetBinError(2,0.);
9126 cout<<endl;
9127 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
9128 cout<<endl;
9129 }
b77b6434 9130 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
b92ea2b9 9131 // Quantify detector bias to QC{4}:
9132 if(TMath::Abs(QC4)>0.)
9133 {
9134 fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4);
9135 if(QC4Error>0.)
9136 {
9137 Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
9138 if(errorSquared>0.)
9139 {
9140 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
9141 }
9142 }
9143 } // end of if(TMath::Abs(QC4)>0.)
489d5531 9144
b92ea2b9 9145
9146 // .... to be improved (continued for 6th and 8th order) ....
9147
9148
2001bc3a 9149 // versus multiplicity:
b77b6434 9150 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
2001bc3a 9151 {
9152 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
b77b6434 9153 Double_t value[4] = {0.}; // QCs vs M
9154 Double_t error[4] = {0.}; // error of QCs vs M
9155 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
9156 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
2001bc3a 9157 for(Int_t b=1;b<=nBins;b++)
9158 {
b92ea2b9 9159 // Measured correlations:
2001bc3a 9160 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
9161 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
b92ea2b9 9162 // Isotropic cumulants:
9163 QC2 = two;
9164 QC4 = four-2.*pow(two,2.);
9165 // Non-isotropic terms:
9166 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
9167 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
9168 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
9169 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
9170 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
9171 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
9172 // Generalized QC{2} vs M:
9173 gQC2 = two - pow(c1,2.) - pow(s1,2.);
b77b6434 9174 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
b92ea2b9 9175 // Generalized QC{4} vs M:
9176 gQC4 = four-2.*pow(two,2.)
9177 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9178 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9179 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
b77b6434 9180 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
b92ea2b9 9181 // Detector bias vs M:
9182 if(TMath::Abs(QC2)>0.)
9183 {
9184 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2);
9185 } // end of if(TMath::Abs(QC2)>0.)
9186 if(TMath::Abs(QC4)>0.)
9187 {
9188 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4);
b77b6434 9189 } // end of if(TMath::Abs(QC4)>0.)
9190 // Rebin in M:
9191 for(Int_t co=0;co<4;co++)
9192 {
9193 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
9194 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
9195 if(error[co]>0.)
9196 {
9197 dSum1[co]+=value[co]/(error[co]*error[co]);
9198 dSum2[co]+=1./(error[co]*error[co]);
9199 }
9200 } // end of for(Int_t co=0;co<4;co++)
9201 } // end of for(Int_t b=1;b<=nBins;b++)
9202 // Store rebinned Q-cumulants:
9203 if(fApplyCorrectionForNUAVsM)
9204 {
9205 for(Int_t co=0;co<4;co++)
9206 {
9207 if(dSum2[co]>0.)
9208 {
9209 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
9210 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
9211 }
9212 } // end of for(Int_t co=0;co<4;co++)
9213 } // end of if(fApplyCorrectionForNUAVsM)
9214 } // end of if(fCalculateCumulantsVsM)
2001bc3a 9215
489d5531 9216} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
0328db2d 9217
489d5531 9218//================================================================================================================================
9219
489d5531 9220void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9221{
0328db2d 9222 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 9223 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 9224 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 9225 //
9226 // Remark: Statistical error of correction temrs is calculated as:
9227 //
9228 // statistical error = termA * spread * termB:
9229 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
9230 // termB = 1/sqrt(1-termA^2)
9231
b92ea2b9 9232 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
9233 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
9234
489d5531 9235 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
9236 {
b92ea2b9 9237 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 9238 {
9239 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 9240 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
9241 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
9242 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
9243 Double_t termA = 0.;
9244 Double_t termB = 0.;
b92ea2b9 9245 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
0328db2d 9246 {
9247 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
9248 } else
9249 {
b92ea2b9 9250 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9251 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
0328db2d 9252 }
489d5531 9253 if(1.-pow(termA,2.) > 0.)
9254 {
9255 termB = 1./pow(1-pow(termA,2.),0.5);
9256 } else
9257 {
b92ea2b9 9258 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9259 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
489d5531 9260 }
9261 Double_t statisticalError = termA * spread * termB;
489d5531 9262 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 9263 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
b92ea2b9 9264 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
489d5531 9265 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
9266
9267} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9268
489d5531 9269//================================================================================================================================
9270
489d5531 9271void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9272{
9273 // Get pointers to all objects relevant for calculations with nested loops.
9274
9275 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
9276 if(nestedLoopsList)
9277 {
9278 this->SetNestedLoopsList(nestedLoopsList);
9279 } else
9280 {
9281 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9282 exit(0);
9283 }
9284
9285 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
9286 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
9287 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
9288 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
9289
9290 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
9291 evaluateNestedLoopsName += fAnalysisLabel->Data();
9292 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
9293 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
9294 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
9295 if(evaluateNestedLoops)
9296 {
9297 this->SetEvaluateNestedLoops(evaluateNestedLoops);
9298 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
9299 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
9300 }
9301 // nested loops relevant for integrated flow:
9302 if(bEvaluateIntFlowNestedLoops)
9303 {
9304 // correlations:
9305 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
9306 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
9307 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
9308 if(intFlowDirectCorrelations)
9309 {
9310 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
9311 } else
9312 {
9313 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9314 exit(0);
9315 }
9316 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9317 {
9318 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
9319 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
9320 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
9321 if(intFlowExtraDirectCorrelations)
9322 {
9323 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
9324 } else
9325 {
9326 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9327 exit(0);
9328 }
9329 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9330 // correction terms for non-uniform acceptance:
9331 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
9332 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9333 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
9334 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9335 {
9336 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
9337 if(intFlowDirectCorrectionTermsForNUA[sc])
9338 {
9339 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
9340 } else
9341 {
9342 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9343 cout<<"sc = "<<sc<<endl;
9344 exit(0);
9345 }
9346 } // end of for(Int_t sc=0;sc<2;sc++)
9347 } // end of if(bEvaluateIntFlowNestedLoops)
9348
9349 // nested loops relevant for differential flow:
9350 if(bEvaluateDiffFlowNestedLoops)
9351 {
9352 // correlations:
9353 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
9354 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
9355 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
9356 for(Int_t t=0;t<2;t++)
9357 {
9358 for(Int_t pe=0;pe<2;pe++)
9359 {
9360 for(Int_t ci=0;ci<4;ci++) // correlation index
9361 {
9362 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())));
9363 if(diffFlowDirectCorrelations[t][pe][ci])
9364 {
9365 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
9366 } else
9367 {
9368 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9369 cout<<"t = "<<t<<endl;
9370 cout<<"pe = "<<pe<<endl;
9371 cout<<"ci = "<<ci<<endl;
9372 }
9373 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9374 } // end of for(Int_t pe=0;pe<2;pe++)
9375 } // end of for(Int_t t=0;t<2;t++)
9376 // correction terms for non-uniform acceptance:
9377 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
9378 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9379 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
9380 for(Int_t t=0;t<2;t++)
9381 {
9382 for(Int_t pe=0;pe<2;pe++)
9383 {
9384 // correction terms for NUA:
9385 for(Int_t sc=0;sc<2;sc++) // sin or cos
9386 {
9387 for(Int_t cti=0;cti<9;cti++) // correction term index
9388 {
9389 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)));
9390 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
9391 {
9392 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
9393 } else
9394 {
9395 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9396 cout<<"t = "<<t<<endl;
9397 cout<<"pe = "<<pe<<endl;
9398 cout<<"sc = "<<sc<<endl;
9399 cout<<"cti = "<<cti<<endl;
9400 }
9401 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9402 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9403 } // end of for(Int_t pe=0;pe<2;pe++)
9404 } // end of for(Int_t t=0;t<2;t++)
9405 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
9406 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
9407 TH1D *noOfParticlesInBin = NULL;
9408 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
9409 if(noOfParticlesInBin)
9410 {
9411 this->SetNoOfParticlesInBin(noOfParticlesInBin);
9412 } else
9413 {
9414 cout<<endl;
9415 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9416 cout<<endl;
9417 }
9418 } // end of if(bEvaluateDiffFlowNestedLoops)
9419
9420} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9421
489d5531 9422//================================================================================================================================
9423
489d5531 9424void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9425{
9426 // Store flow harmonic in common control histograms.
9427
9428 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
dd442cd2 9429 if(fFillMultipleControlHistograms)
9430 {
9431 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
9432 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
9433 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
9434 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9435 }
9436
489d5531 9437} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9438
489d5531 9439//================================================================================================================================
9440
489d5531 9441void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9442{
9443 // Calculate all correlations needed for differential flow using particle weights.
9444
2a98ceb8 9445 Int_t t = 0; // type flag
9446 Int_t pe = 0; // ptEta flag
489d5531 9447
9448 if(type == "RP")
9449 {
9450 t = 0;
9451 } else if(type == "POI")
9452 {
9453 t = 1;
9454 }
9455
9456 if(ptOrEta == "Pt")
9457 {
9458 pe = 0;
9459 } else if(ptOrEta == "Eta")
9460 {
9461 pe = 1;
9462 }
9463
9464 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9465 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9466 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9467 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9468
9469 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9470 Double_t dReQ1n1k = (*fReQ)(0,1);
9471 Double_t dReQ2n2k = (*fReQ)(1,2);
9472 Double_t dReQ1n3k = (*fReQ)(0,3);
9473 //Double_t dReQ4n4k = (*fReQ)(3,4);
9474 Double_t dImQ1n1k = (*fImQ)(0,1);
9475 Double_t dImQ2n2k = (*fImQ)(1,2);
9476 Double_t dImQ1n3k = (*fImQ)(0,3);
9477 //Double_t dImQ4n4k = (*fImQ)(3,4);
9478
1268c371 9479 // S^M_{p,k} (see .h file for the definition of fSpk):
9480 Double_t dSM1p1k = (*fSpk)(0,1);
9481 Double_t dSM1p2k = (*fSpk)(0,2);
9482 Double_t dSM1p3k = (*fSpk)(0,3);
9483 Double_t dSM2p1k = (*fSpk)(1,1);
9484 Double_t dSM3p1k = (*fSpk)(2,1);
489d5531 9485
9486 // looping over all bins and calculating reduced correlations:
9487 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9488 {
9489 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9490 Double_t p1n0kRe = 0.;
9491 Double_t p1n0kIm = 0.;
9492
9493 // number of POIs in particular (pt,eta) bin):
9494 Double_t mp = 0.;
9495
9496 // real and imaginary parts of q_{m*n,k}:
9497 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9498 Double_t q1n2kRe = 0.;
9499 Double_t q1n2kIm = 0.;
9500 Double_t q2n1kRe = 0.;
9501 Double_t q2n1kIm = 0.;
9502
9503 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9504 Double_t s1p1k = 0.;
9505 Double_t s1p2k = 0.;
9506 Double_t s1p3k = 0.;
9507
9508 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9509 Double_t dM0111 = 0.;
9510
9511 if(type == "POI")
9512 {
9513 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9514 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9515 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9516 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9517
9518 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9519
9520 t = 1; // typeFlag = RP or POI
9521
9522 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9523 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9524 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9525 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9526 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9527 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9528 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9529 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9530 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9531
9532 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9533 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9534 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9535 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9536
9537 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9538 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9539 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9540 + 2.*(s1p3k-s1p2k*dSM1p1k));
9541 }
9542 else if(type == "RP")
9543 {
9544 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9545 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9546 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9547 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9548 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9549 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9550 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9551 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9552 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9553
9554 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9555 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9556 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9557 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9558
9559 // to be improved (cross-checked):
9560 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9561 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9562 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9563 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9564
9565 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9566
9567 t = 0; // typeFlag = RP or POI
9568
9569 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9570 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9571 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9572 + 2.*(s1p3k-s1p2k*dSM1p1k));
9573 //...............................................................................................
9574 }
9575
9576 // 2'-particle correlation:
9577 Double_t two1n1nW0W1 = 0.;
9578 if(mp*dSM1p1k-s1p1k)
9579 {
9580 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9581 / (mp*dSM1p1k-s1p1k);
9582
9583 // fill profile to get <<2'>>
b40a910e 9584 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9585 // fill profile to get <<2'>^2>
9586 fDiffFlowSquaredCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1*two1n1nW0W1,mp*dSM1p1k-s1p1k);
489d5531 9587 // histogram to store <2'> e-b-e (needed in some other methods):
9588 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9589 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9590 } // end of if(mp*dSM1p1k-s1p1k)
9591
9592 // 4'-particle correlation:
9593 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9594 if(dM0111)
9595 {
9596 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9597 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9598 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9599 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9600 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9601 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9602 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9603 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9604 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9605 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9606 + 2.*s1p1k*dSM1p2k
9607 - 6.*s1p3k)
9608 / dM0111; // to be improved (notation of dM0111)
9609
9610 // fill profile to get <<4'>>
b40a910e 9611 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9612 // fill profile to get <<4'>^2>
9613 fDiffFlowSquaredCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1*four1n1n1n1nW0W1W1W1,dM0111);
489d5531 9614 // histogram to store <4'> e-b-e (needed in some other methods):
9615 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9616 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9617 } // end of if(dM0111)
9618 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9619
9620} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9621
489d5531 9622//================================================================================================================================
9623
489d5531 9624void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9625{
9626 // Fill common control histograms.
9627
9628 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9629 fCommonHists->FillControlHistograms(anEvent);
dd442cd2 9630 if(fFillMultipleControlHistograms)
489d5531 9631 {
dd442cd2 9632 if(nRP>1)
489d5531 9633 {
dd442cd2 9634 fCommonHists2nd->FillControlHistograms(anEvent);
9635 if(nRP>3)
489d5531 9636 {
dd442cd2 9637 fCommonHists4th->FillControlHistograms(anEvent);
9638 if(nRP>5)
489d5531 9639 {
dd442cd2 9640 fCommonHists6th->FillControlHistograms(anEvent);
9641 if(nRP>7)
9642 {
9643 fCommonHists8th->FillControlHistograms(anEvent);
9644 } // end of if(nRP>7)
9645 } // end of if(nRP>5)
9646 } // end of if(nRP>3)
9647 } // end of if(nRP>1)
9648 } // end of if(fFillMultipleControlHistograms)
489d5531 9649
9650} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9651
489d5531 9652//================================================================================================================================
9653
489d5531 9654void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9655{
9656 // Reset all event by event quantities.
9657
1268c371 9658 // Reference flow:
489d5531 9659 fReQ->Zero();
9660 fImQ->Zero();
1268c371 9661 fSpk->Zero();
489d5531 9662 fIntFlowCorrelationsEBE->Reset();
9663 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9664 fIntFlowCorrelationsAllEBE->Reset();
9665
b92ea2b9 9666 for(Int_t sc=0;sc<2;sc++)
489d5531 9667 {
b92ea2b9 9668 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
9669 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 9670 }
9671
1268c371 9672 // Differential flow:
9673 if(fCalculateDiffFlow)
489d5531 9674 {
1268c371 9675 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
489d5531 9676 {
1268c371 9677 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 9678 {
1268c371 9679 for(Int_t m=0;m<4;m++) // multiple of harmonic
489d5531 9680 {
1268c371 9681 for(Int_t k=0;k<9;k++) // power of weight
9682 {
9683 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9684 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9685 }
9686 }
489d5531 9687 }
1268c371 9688 }
9689 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9690 {
9691 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
489d5531 9692 {
1268c371 9693 for(Int_t k=0;k<9;k++)
9694 {
9695 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9696 }
489d5531 9697 }
9698 }
1268c371 9699 // e-b-e reduced correlations:
9700 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9701 {
9702 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 9703 {
1268c371 9704 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9705 {
9706 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9707 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9708 }
489d5531 9709 }
1268c371 9710 }
9711 // correction terms for NUA:
9712 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9713 {
9714 for(Int_t pe=0;pe<2;pe++) // pt or eta
489d5531 9715 {
1268c371 9716 for(Int_t sc=0;sc<2;sc++) // sin or cos
489d5531 9717 {
1268c371 9718 for(Int_t cti=0;cti<9;cti++) // correction term index
9719 {
489d5531 9720 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
1268c371 9721 }
489d5531 9722 }
1268c371 9723 }
9724 }
9725 } // end of if(fCalculateDiffFlow)
9726
489d5531 9727 // 2D (pt,eta)
1268c371 9728 if(fCalculate2DDiffFlow)
489d5531 9729 {
9730 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9731 {
9732 for(Int_t m=0;m<4;m++) // multiple of harmonic
9733 {
9734 for(Int_t k=0;k<9;k++) // power of weight
9735 {
b77b6434 9736 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
9737 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
489d5531 9738 }
9739 }
9740 }
9741 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9742 {
9743 for(Int_t k=0;k<9;k++)
9744 {
b77b6434 9745 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
489d5531 9746 }
9747 }
1268c371 9748 } // end of if(fCalculate2DDiffFlow)
489d5531 9749
9750} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9751
489d5531 9752//================================================================================================================================
9753
489d5531 9754void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9755{
9756 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9757
9758 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9759 // 0: <<sin n(psi1)>>
9760 // 1: <<sin n(psi1+phi2)>>
9761 // 2: <<sin n(psi1+phi2-phi3)>>
9762 // 3: <<sin n(psi1-phi2-phi3)>>:
9763 // 4:
9764 // 5:
9765 // 6:
9766
9767 // multiplicity:
1268c371 9768 Double_t dMult = (*fSpk)(0,0);
489d5531 9769
9770 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9771 Double_t dReQ1n = (*fReQ)(0,0);
9772 Double_t dReQ2n = (*fReQ)(1,0);
9773 //Double_t dReQ3n = (*fReQ)(2,0);
9774 //Double_t dReQ4n = (*fReQ)(3,0);
9775 Double_t dImQ1n = (*fImQ)(0,0);
9776 Double_t dImQ2n = (*fImQ)(1,0);
9777 //Double_t dImQ3n = (*fImQ)(2,0);
9778 //Double_t dImQ4n = (*fImQ)(3,0);
9779
2a98ceb8 9780 Int_t t = 0; // type flag
9781 Int_t pe = 0; // ptEta flag
489d5531 9782
9783 if(type == "RP")
9784 {
9785 t = 0;
9786 } else if(type == "POI")
9787 {
9788 t = 1;
9789 }
9790
9791 if(ptOrEta == "Pt")
9792 {
9793 pe = 0;
9794 } else if(ptOrEta == "Eta")
9795 {
9796 pe = 1;
9797 }
9798
9799 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9800 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9801 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9802 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9803
9804 // looping over all bins and calculating correction terms:
9805 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9806 {
9807 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9808 Double_t p1n0kRe = 0.;
9809 Double_t p1n0kIm = 0.;
9810
9811 // number of POIs in particular pt or eta bin:
9812 Double_t mp = 0.;
9813
9814 // 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):
9815 Double_t q1n0kRe = 0.;
9816 Double_t q1n0kIm = 0.;
9817 Double_t q2n0kRe = 0.;
9818 Double_t q2n0kIm = 0.;
9819
9820 // number of particles which are both RPs and POIs in particular pt or eta bin:
9821 Double_t mq = 0.;
9822
9823 if(type == "POI")
9824 {
9825 // q_{m*n,0}:
9826 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9827 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9828 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9829 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9830 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9831 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9832 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9833 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9834
9835 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9836 }
9837 else if(type == "RP")
9838 {
9839 // q_{m*n,0}:
9840 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9841 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9842 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9843 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9844 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9845 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9846 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9847 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9848
9849 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9850 }
9851 if(type == "POI")
9852 {
9853 // p_{m*n,0}:
9854 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9855 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9856 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9857 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9858
9859 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9860
9861 t = 1; // typeFlag = RP or POI
9862 }
9863 else if(type == "RP")
9864 {
9865 // p_{m*n,0} = q_{m*n,0}:
9866 p1n0kRe = q1n0kRe;
9867 p1n0kIm = q1n0kIm;
9868
9869 mp = mq;
9870
9871 t = 0; // typeFlag = RP or POI
9872 }
9873
9874 // <<sin n(psi1)>>:
9875 Double_t sinP1nPsi = 0.;
9876 if(mp)
9877 {
9878 sinP1nPsi = p1n0kIm/mp;
9879 // fill profile for <<sin n(psi1)>>:
9880 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9881 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9882 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9883 } // end of if(mp)
9884
9885 // <<sin n(psi1+phi2)>>:
9886 Double_t sinP1nPsiP1nPhi = 0.;
9887 if(mp*dMult-mq)
9888 {
9889 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9890 // fill profile for <<sin n(psi1+phi2)>>:
9891 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9892 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9893 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9894 } // end of if(mp*dMult-mq)
9895
9896 // <<sin n(psi1+phi2-phi3)>>:
9897 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9898 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9899 {
9900 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9901 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9902 - mq*dImQ1n+2.*q1n0kIm)
9903 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9904 // fill profile for <<sin n(psi1+phi2)>>:
9905 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9906 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9907 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9908 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9909
9910 // <<sin n(psi1-phi2-phi3)>>:
9911 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9912 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9913 {
9914 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9915 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9916 + 2.*mq*dImQ1n-2.*q1n0kIm)
9917 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9918 // fill profile for <<sin n(psi1+phi2)>>:
9919 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9920 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9921 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9922 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9923 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9924
9925} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9926
9927
9928//================================================================================================================================
9929
9930
9931void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9932{
9933 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9934
9935 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9936 // 0: <<cos n(psi)>>
9937 // 1: <<cos n(psi1+phi2)>>
9938 // 2: <<cos n(psi1+phi2-phi3)>>
9939 // 3: <<cos n(psi1-phi2-phi3)>>
9940 // 4:
9941 // 5:
9942 // 6:
9943
9944 // multiplicity:
1268c371 9945 Double_t dMult = (*fSpk)(0,0);
489d5531 9946
9947 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9948 Double_t dReQ1n = (*fReQ)(0,0);
9949 Double_t dReQ2n = (*fReQ)(1,0);
9950 //Double_t dReQ3n = (*fReQ)(2,0);
9951 //Double_t dReQ4n = (*fReQ)(3,0);
9952 Double_t dImQ1n = (*fImQ)(0,0);
9953 Double_t dImQ2n = (*fImQ)(1,0);
9954 //Double_t dImQ3n = (*fImQ)(2,0);
9955 //Double_t dImQ4n = (*fImQ)(3,0);
9956
2a98ceb8 9957 Int_t t = 0; // type flag
9958 Int_t pe = 0; // ptEta flag
489d5531 9959
9960 if(type == "RP")
9961 {
9962 t = 0;
9963 } else if(type == "POI")
9964 {
9965 t = 1;
9966 }
9967
9968 if(ptOrEta == "Pt")
9969 {
9970 pe = 0;
9971 } else if(ptOrEta == "Eta")
9972 {
9973 pe = 1;
9974 }
9975
9976 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9977 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9978 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9979 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9980
9981 // looping over all bins and calculating correction terms:
9982 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9983 {
9984 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9985 Double_t p1n0kRe = 0.;
9986 Double_t p1n0kIm = 0.;
9987
9988 // number of POIs in particular pt or eta bin:
9989 Double_t mp = 0.;
9990
9991 // 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):
9992 Double_t q1n0kRe = 0.;
9993 Double_t q1n0kIm = 0.;
9994 Double_t q2n0kRe = 0.;
9995 Double_t q2n0kIm = 0.;
9996
9997 // number of particles which are both RPs and POIs in particular pt or eta bin:
9998 Double_t mq = 0.;
9999
10000 if(type == "POI")
10001 {
10002 // q_{m*n,0}:
10003 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10004 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10005 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10006 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10007 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10008 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10009 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10010 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10011
10012 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10013 }
10014 else if(type == "RP")
10015 {
10016 // q_{m*n,0}:
10017 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10018 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10019 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10020 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10021 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10022 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10023 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10024 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10025
10026 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10027 }
10028 if(type == "POI")
10029 {
10030 // p_{m*n,0}:
10031 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10032 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10033 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10034 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10035
10036 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10037
10038 t = 1; // typeFlag = RP or POI
10039 }
10040 else if(type == "RP")
10041 {
10042 // p_{m*n,0} = q_{m*n,0}:
10043 p1n0kRe = q1n0kRe;
10044 p1n0kIm = q1n0kIm;
10045
10046 mp = mq;
10047
10048 t = 0; // typeFlag = RP or POI
10049 }
10050
10051 // <<cos n(psi1)>>:
10052 Double_t cosP1nPsi = 0.;
10053 if(mp)
10054 {
10055 cosP1nPsi = p1n0kRe/mp;
10056
10057 // fill profile for <<cos n(psi1)>>:
10058 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
10059 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
10060 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
10061 } // end of if(mp)
10062
10063 // <<cos n(psi1+phi2)>>:
10064 Double_t cosP1nPsiP1nPhi = 0.;
10065 if(mp*dMult-mq)
10066 {
10067 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
10068 // fill profile for <<sin n(psi1+phi2)>>:
10069 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
10070 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10071 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
10072 } // end of if(mp*dMult-mq)
10073
10074 // <<cos n(psi1+phi2-phi3)>>:
10075 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
10076 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10077 {
10078 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10079 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
10080 - mq*dReQ1n+2.*q1n0kRe)
10081 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10082 // fill profile for <<sin n(psi1+phi2)>>:
10083 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10084 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10085 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
10086 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10087
10088 // <<cos n(psi1-phi2-phi3)>>:
10089 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
10090 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10091 {
10092 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
10093 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
10094 - 2.*mq*dReQ1n+2.*q1n0kRe)
10095 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10096 // fill profile for <<sin n(psi1+phi2)>>:
10097 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10098 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10099 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
10100 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10101 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10102
10103} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
10104
489d5531 10105//==================================================================================================================================
10106
489d5531 10107void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10108{
1268c371 10109 // Transfer profiles into histogams and correctly propagate the error.
489d5531 10110
2a98ceb8 10111 Int_t t = 0; // type flag
10112 Int_t pe = 0; // ptEta flag
489d5531 10113
10114 if(type == "RP")
10115 {
10116 t = 0;
10117 } else if(type == "POI")
10118 {
10119 t = 1;
10120 }
10121
10122 if(ptOrEta == "Pt")
10123 {
10124 pe = 0;
10125 } else if(ptOrEta == "Eta")
10126 {
10127 pe = 1;
10128 }
10129
10130 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10131 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
10132 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10133 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10134
10135 for(Int_t sc=0;sc<2;sc++) // sin or cos
10136 {
10137 for(Int_t cti=0;cti<9;cti++) // correction term index
10138 {
10139 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10140 {
10141 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
10142 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
10143 // to be improved (propagate error correctly)
10144 // ...
10145 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10146 } // correction term index
10147 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10148
10149}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10150
489d5531 10151//==================================================================================================================================
10152
489d5531 10153void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10154{
1268c371 10155 // Calculate generalized differential flow cumulants (corrected for non-uniform acceptance).
10156
10157 // to be improved - propagate error also from non-isotropic terms
489d5531 10158
1268c371 10159 Int_t t = 0; // RP = 0, POI = 1
10160 Int_t pe = 0; // pt = 0, eta = 1
489d5531 10161
10162 if(type == "RP")
10163 {
1268c371 10164 t = 0;
489d5531 10165 } else if(type == "POI")
10166 {
1268c371 10167 t = 1;
489d5531 10168 }
10169
10170 if(ptOrEta == "Pt")
10171 {
1268c371 10172 pe = 0;
489d5531 10173 } else if(ptOrEta == "Eta")
10174 {
1268c371 10175 pe = 1;
489d5531 10176 }
1268c371 10177
10178 // Common:
489d5531 10179 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
489d5531 10180 // 2-particle correlation:
10181 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
1268c371 10182 // sinus terms coming from reference flow:
489d5531 10183 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
10184 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
10185 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
1268c371 10186 // cosinus terms coming from reference flow:
489d5531 10187 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
10188 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
10189 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
10190
10191 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10192 {
10193 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
10194 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
10195 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
10196 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
10197 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
10198 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
10199 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
10200 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
10201 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
10202 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
1268c371 10203 // Generalized QC{2'}:
489d5531 10204 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
1268c371 10205 if(fApplyCorrectionForNUA)
10206 {
10207 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
10208 }
10209 if(TMath::Abs(twoPrime)>0.)
10210 {
10211 fDiffFlowDetectorBias[t][pe][0]->SetBinContent(b,qc2Prime/twoPrime); // detector bias = generalized/isotropic cumulant.
10212 }
10213 // Generalized QC{4'}:
489d5531 10214 Double_t qc4Prime = fourPrime-2.*twoPrime*two
10215 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
10216 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
10217 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
10218 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
10219 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
10220 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
10221 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
10222 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
10223 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10224 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
10225 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
10226 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10227 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
10228 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
10229 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10230 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10231 - 12.*cosP1nPhi*sinP1nPhi
10232 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
1268c371 10233 if(fApplyCorrectionForNUA)
10234 {
10235 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
10236 }
10237 if(TMath::Abs(fourPrime-2.*twoPrime*two)>0.)
10238 {
10239 fDiffFlowDetectorBias[t][pe][1]->SetBinContent(b,qc4Prime/(fourPrime-2.*twoPrime*two)); // detector bias = generalized/isotropic cumulant.
10240 }
489d5531 10241 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
10242
10243} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10244
1268c371 10245//==================================================================================================================================
489d5531 10246
10247void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
10248{
10249 // Calculate differential flow corrected for non-uniform acceptance.
10250
1268c371 10251 // to be improved: eventually I will have to access here masured correlations and NUA terms
10252 // instead of cumulants in order to propagate statistical error correctly also
10253 // to NUA terms (propagating errors directly from cumulants is WRONG for
10254 // differential flow becuase that doesn't account at all cross-covariance terms)
489d5531 10255
1268c371 10256 // REMARK: When NUA correction is apllied error for differential flow DOES NOT get corrected,
10257 // i.e. only value is being corrected, error is still the one relevant for isotropic
10258 // case. This eventually will be resolved.
10259
10260
10261 Int_t t = 0; // RP or POI
10262 Int_t pe = 0; // pt or eta
489d5531 10263
10264 if(type == "RP")
10265 {
1268c371 10266 t = 0;
489d5531 10267 } else if(type == "POI")
10268 {
1268c371 10269 t = 1;
10270 }
489d5531 10271 if(ptOrEta == "Pt")
10272 {
1268c371 10273 pe = 0;
489d5531 10274 } else if(ptOrEta == "Eta")
10275 {
1268c371 10276 pe = 1;
489d5531 10277 }
10278
1268c371 10279 // Common:
489d5531 10280 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
1268c371 10281 // Reference Q-cumulants
10282 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
10283 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
10284 // Loop over pt or eta bins:
489d5531 10285 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10286 {
1268c371 10287 // Differential Q-cumulants:
10288 Double_t qc2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b); // QC{2'}
10289 Double_t qc4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b); // QC{4'}
489d5531 10290 // v'{2}:
1268c371 10291 if(qc2>0.)
489d5531 10292 {
1268c371 10293 Double_t v2Prime = qc2Prime/pow(qc2,0.5);
10294 if(TMath::Abs(v2Prime)>0.){fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);}
489d5531 10295 }
489d5531 10296 // v'{4}:
1268c371 10297 if(qc4<0.)
489d5531 10298 {
1268c371 10299 Double_t v4Prime = -qc4Prime/pow(-qc4,3./4.);
10300 if(TMath::Abs(v4Prime)>0.){fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);}
489d5531 10301 }
10302 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
10303
10304} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
10305
489d5531 10306//==================================================================================================================================
10307
0328db2d 10308void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10309{
10310 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
10311
10312 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
10313 //
10314 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
10315 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
10316 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
10317 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
10318 // 5th bin: ---- EMPTY ----
10319 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
10320 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
10321 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
10322 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
10323 // 10th bin: ---- EMPTY ----
10324 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
10325 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
10326 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
10327 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
10328 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
10329 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
10330 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
10331 // 18th bin: ---- EMPTY ----
10332 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
10333 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
10334 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
10335 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
10336 // 23rd bin: ---- EMPTY ----
10337 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
10338 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
10339 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
10340 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
10341 // 28th bin: ---- EMPTY ----
10342 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
10343 // 30th bin: ---- EMPTY ----
10344 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
8ed4edc7 10345 // 32nd bin: ---- EMPTY ----
10346 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
10347 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
10348
489d5531 10349 Int_t nPrim = anEvent->NumberOfTracks();
10350 AliFlowTrackSimple *aftsTrack = NULL;
10351 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10352 Int_t n = fHarmonic;
10353 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 10354 Double_t dMult = (*fSpk)(0,0);
489d5531 10355 cout<<endl;
10356 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10357 if(dMult<2)
10358 {
10359 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10360 } else if (dMult>fMaxAllowedMultiplicity)
10361 {
10362 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10363 } else
10364 {
10365 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10366 }
10367
10368 // 2-particle correlations:
10369 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10370 {
10371 for(Int_t i1=0;i1<nPrim;i1++)
10372 {
10373 aftsTrack=anEvent->GetTrack(i1);
10374 if(!(aftsTrack->InRPSelection())) continue;
10375 phi1=aftsTrack->Phi();
10376 for(Int_t i2=0;i2<nPrim;i2++)
10377 {
10378 if(i2==i1)continue;
10379 aftsTrack=anEvent->GetTrack(i2);
10380 if(!(aftsTrack->InRPSelection())) continue;
10381 phi2=aftsTrack->Phi();
10382 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10383 // fill the profile with 2-p correlations:
10384 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
10385 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
10386 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
10387 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
10388 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10389 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10390 } // end of if(nPrim>=2)
10391
10392 // 3-particle correlations:
10393 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10394 {
10395 for(Int_t i1=0;i1<nPrim;i1++)
10396 {
10397 aftsTrack=anEvent->GetTrack(i1);
10398 if(!(aftsTrack->InRPSelection())) continue;
10399 phi1=aftsTrack->Phi();
10400 for(Int_t i2=0;i2<nPrim;i2++)
10401 {
10402 if(i2==i1)continue;
10403 aftsTrack=anEvent->GetTrack(i2);
10404 if(!(aftsTrack->InRPSelection())) continue;
10405 phi2=aftsTrack->Phi();
10406 for(Int_t i3=0;i3<nPrim;i3++)
10407 {
10408 if(i3==i1||i3==i2)continue;
10409 aftsTrack=anEvent->GetTrack(i3);
10410 if(!(aftsTrack->InRPSelection())) continue;
10411 phi3=aftsTrack->Phi();
10412 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10413 // fill the profile with 3-p correlations:
10414 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
10415 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
10416 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
10417 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
10418 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10419 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10420 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10421 } // end of if(nPrim>=3)
10422
10423 // 4-particle correlations:
10424 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10425 {
10426 for(Int_t i1=0;i1<nPrim;i1++)
10427 {
10428 aftsTrack=anEvent->GetTrack(i1);
10429 if(!(aftsTrack->InRPSelection())) continue;
10430 phi1=aftsTrack->Phi();
10431 for(Int_t i2=0;i2<nPrim;i2++)
10432 {
10433 if(i2==i1)continue;
10434 aftsTrack=anEvent->GetTrack(i2);
10435 if(!(aftsTrack->InRPSelection())) continue;
10436 phi2=aftsTrack->Phi();
10437 for(Int_t i3=0;i3<nPrim;i3++)
10438 {
10439 if(i3==i1||i3==i2)continue;
10440 aftsTrack=anEvent->GetTrack(i3);
10441 if(!(aftsTrack->InRPSelection())) continue;
10442 phi3=aftsTrack->Phi();
10443 for(Int_t i4=0;i4<nPrim;i4++)
10444 {
10445 if(i4==i1||i4==i2||i4==i3)continue;
10446 aftsTrack=anEvent->GetTrack(i4);
10447 if(!(aftsTrack->InRPSelection())) continue;
10448 phi4=aftsTrack->Phi();
10449 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10450 // fill the profile with 4-p correlations:
10451 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10452 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10453 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10454 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10455 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10456 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10457 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
8ed4edc7 10458 fIntFlowDirectCorrelations->Fill(32.,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
489d5531 10459 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10460 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10461 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10462 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10463 } // end of if(nPrim>=)
10464
10465 // 5-particle correlations:
10466 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10467 {
10468 for(Int_t i1=0;i1<nPrim;i1++)
10469 {
10470 aftsTrack=anEvent->GetTrack(i1);
10471 if(!(aftsTrack->InRPSelection())) continue;
10472 phi1=aftsTrack->Phi();
10473 for(Int_t i2=0;i2<nPrim;i2++)
10474 {
10475 if(i2==i1)continue;
10476 aftsTrack=anEvent->GetTrack(i2);
10477 if(!(aftsTrack->InRPSelection())) continue;
10478 phi2=aftsTrack->Phi();
10479 for(Int_t i3=0;i3<nPrim;i3++)
10480 {
10481 if(i3==i1||i3==i2)continue;
10482 aftsTrack=anEvent->GetTrack(i3);
10483 if(!(aftsTrack->InRPSelection())) continue;
10484 phi3=aftsTrack->Phi();
10485 for(Int_t i4=0;i4<nPrim;i4++)
10486 {
10487 if(i4==i1||i4==i2||i4==i3)continue;
10488 aftsTrack=anEvent->GetTrack(i4);
10489 if(!(aftsTrack->InRPSelection())) continue;
10490 phi4=aftsTrack->Phi();
10491 for(Int_t i5=0;i5<nPrim;i5++)
10492 {
10493 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10494 aftsTrack=anEvent->GetTrack(i5);
10495 if(!(aftsTrack->InRPSelection())) continue;
10496 phi5=aftsTrack->Phi();
10497 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10498 // fill the profile with 5-p correlations:
10499 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10500 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10501 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10502 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
8ed4edc7 10503 fIntFlowDirectCorrelations->Fill(33.,cos(2.*n*phi1+2.*n*phi2+2.*n*phi3-3.*n*phi4-3.*n*phi5),1.);
489d5531 10504 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10505 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10506 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10507 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10508 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10509 } // end of if(nPrim>=5)
10510
10511 // 6-particle correlations:
10512 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10513 {
10514 for(Int_t i1=0;i1<nPrim;i1++)
10515 {
10516 aftsTrack=anEvent->GetTrack(i1);
10517 if(!(aftsTrack->InRPSelection())) continue;
10518 phi1=aftsTrack->Phi();
10519 for(Int_t i2=0;i2<nPrim;i2++)
10520 {
10521 if(i2==i1)continue;
10522 aftsTrack=anEvent->GetTrack(i2);
10523 if(!(aftsTrack->InRPSelection())) continue;
10524 phi2=aftsTrack->Phi();
10525 for(Int_t i3=0;i3<nPrim;i3++)
10526 {
10527 if(i3==i1||i3==i2)continue;
10528 aftsTrack=anEvent->GetTrack(i3);
10529 if(!(aftsTrack->InRPSelection())) continue;
10530 phi3=aftsTrack->Phi();
10531 for(Int_t i4=0;i4<nPrim;i4++)
10532 {
10533 if(i4==i1||i4==i2||i4==i3)continue;
10534 aftsTrack=anEvent->GetTrack(i4);
10535 if(!(aftsTrack->InRPSelection())) continue;
10536 phi4=aftsTrack->Phi();
10537 for(Int_t i5=0;i5<nPrim;i5++)
10538 {
10539 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10540 aftsTrack=anEvent->GetTrack(i5);
10541 if(!(aftsTrack->InRPSelection())) continue;
10542 phi5=aftsTrack->Phi();
10543 for(Int_t i6=0;i6<nPrim;i6++)
10544 {
10545 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10546 aftsTrack=anEvent->GetTrack(i6);
10547 if(!(aftsTrack->InRPSelection())) continue;
10548 phi6=aftsTrack->Phi();
10549 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10550 // fill the profile with 6-p correlations:
10551 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10552 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}
10553 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}
10554 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}
10555 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10556 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10557 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10558 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10559 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10560 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10561 } // end of if(nPrim>=6)
10562
10563 // 7-particle correlations:
10564 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10565 {
10566 for(Int_t i1=0;i1<nPrim;i1++)
10567 {
10568 aftsTrack=anEvent->GetTrack(i1);
10569 if(!(aftsTrack->InRPSelection())) continue;
10570 phi1=aftsTrack->Phi();
10571 for(Int_t i2=0;i2<nPrim;i2++)
10572 {
10573 if(i2==i1)continue;
10574 aftsTrack=anEvent->GetTrack(i2);
10575 if(!(aftsTrack->InRPSelection())) continue;
10576 phi2=aftsTrack->Phi();
10577 for(Int_t i3=0;i3<nPrim;i3++)
10578 {
10579 if(i3==i1||i3==i2)continue;
10580 aftsTrack=anEvent->GetTrack(i3);
10581 if(!(aftsTrack->InRPSelection())) continue;
10582 phi3=aftsTrack->Phi();
10583 for(Int_t i4=0;i4<nPrim;i4++)
10584 {
10585 if(i4==i1||i4==i2||i4==i3)continue;
10586 aftsTrack=anEvent->GetTrack(i4);
10587 if(!(aftsTrack->InRPSelection())) continue;
10588 phi4=aftsTrack->Phi();
10589 for(Int_t i5=0;i5<nPrim;i5++)
10590 {
10591 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10592 aftsTrack=anEvent->GetTrack(i5);
10593 if(!(aftsTrack->InRPSelection())) continue;
10594 phi5=aftsTrack->Phi();
10595 for(Int_t i6=0;i6<nPrim;i6++)
10596 {
10597 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10598 aftsTrack=anEvent->GetTrack(i6);
10599 if(!(aftsTrack->InRPSelection())) continue;
10600 phi6=aftsTrack->Phi();
10601 for(Int_t i7=0;i7<nPrim;i7++)
10602 {
10603 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10604 aftsTrack=anEvent->GetTrack(i7);
10605 if(!(aftsTrack->InRPSelection())) continue;
10606 phi7=aftsTrack->Phi();
10607 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10608 // fill the profile with 7-p correlation:
10609 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}
10610 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10611 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10612 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10613 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10614 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10615 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10616 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10617 } // end of if(nPrim>=7)
10618
10619 // 8-particle correlations:
10620 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10621 {
10622 for(Int_t i1=0;i1<nPrim;i1++)
10623 {
10624 aftsTrack=anEvent->GetTrack(i1);
10625 if(!(aftsTrack->InRPSelection())) continue;
10626 phi1=aftsTrack->Phi();
10627 for(Int_t i2=0;i2<nPrim;i2++)
10628 {
10629 if(i2==i1)continue;
10630 aftsTrack=anEvent->GetTrack(i2);
10631 if(!(aftsTrack->InRPSelection())) continue;
10632 phi2=aftsTrack->Phi();
10633 for(Int_t i3=0;i3<nPrim;i3++)
10634 {
10635 if(i3==i1||i3==i2)continue;
10636 aftsTrack=anEvent->GetTrack(i3);
10637 if(!(aftsTrack->InRPSelection())) continue;
10638 phi3=aftsTrack->Phi();
10639 for(Int_t i4=0;i4<nPrim;i4++)
10640 {
10641 if(i4==i1||i4==i2||i4==i3)continue;
10642 aftsTrack=anEvent->GetTrack(i4);
10643 if(!(aftsTrack->InRPSelection())) continue;
10644 phi4=aftsTrack->Phi();
10645 for(Int_t i5=0;i5<nPrim;i5++)
10646 {
10647 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10648 aftsTrack=anEvent->GetTrack(i5);
10649 if(!(aftsTrack->InRPSelection())) continue;
10650 phi5=aftsTrack->Phi();
10651 for(Int_t i6=0;i6<nPrim;i6++)
10652 {
10653 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10654 aftsTrack=anEvent->GetTrack(i6);
10655 if(!(aftsTrack->InRPSelection())) continue;
10656 phi6=aftsTrack->Phi();
10657 for(Int_t i7=0;i7<nPrim;i7++)
10658 {
10659 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10660 aftsTrack=anEvent->GetTrack(i7);
10661 if(!(aftsTrack->InRPSelection())) continue;
10662 phi7=aftsTrack->Phi();
10663 for(Int_t i8=0;i8<nPrim;i8++)
10664 {
10665 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10666 aftsTrack=anEvent->GetTrack(i8);
10667 if(!(aftsTrack->InRPSelection())) continue;
10668 phi8=aftsTrack->Phi();
10669 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10670 // fill the profile with 8-p correlation:
10671 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}
10672 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10673 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10674 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10675 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10676 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10677 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10678 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10679 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10680 } // end of if(nPrim>=8)
10681
10682 cout<<endl;
10683
10684} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10685
10686
10687//==================================================================================================================================
10688
10689
10690void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10691{
10692 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10693
10694 cout<<endl;
10695 cout<<endl;
10696 cout<<" *****************************************"<<endl;
10697 cout<<" **** cross-checking the correlations ****"<<endl;
10698 cout<<" **** for integrated flow ****"<<endl;
10699 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10700 {
10701 cout<<" **** (particle weights not used) ****"<<endl;
10702 } else
10703 {
10704 cout<<" **** (particle weights used) ****"<<endl;
10705 }
10706 cout<<" *****************************************"<<endl;
10707 cout<<endl;
10708 cout<<endl;
10709
8ed4edc7 10710 Int_t ciMax = 34; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
489d5531 10711
10712 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10713 {
10714 ciMax = 11;
10715 }
10716
10717 for(Int_t ci=1;ci<=ciMax;ci++)
10718 {
10719 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10720 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10721 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10722 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10723 cout<<endl;
10724 }
10725
10726} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10727
10728
10729//================================================================================================================================
10730
10731
10732void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10733{
10734 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10735
10736 cout<<endl;
10737 cout<<endl;
10738 cout<<" *********************************************"<<endl;
10739 cout<<" **** cross-checking the correction terms ****"<<endl;
10740 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10741 cout<<" **** for integrated flow ****"<<endl;
10742 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10743 {
10744 cout<<" **** (particle weights not used) ****"<<endl;
10745 } else
10746 {
10747 cout<<" **** (particle weights used) ****"<<endl;
10748 }
10749 cout<<" *********************************************"<<endl;
10750 cout<<endl;
10751 cout<<endl;
10752
b92ea2b9 10753 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 10754 {
10755 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10756 {
10757 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10758 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10759 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10760 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10761 cout<<endl;
10762 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10763 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10764
10765} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10766
10767
10768//================================================================================================================================
10769
10770
0328db2d 10771void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 10772{
10773 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10774
10775 // Results are stored in profile fIntFlowDirectCorrelations.
10776 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10777 //
10778 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10779 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10780 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10781 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10782 // 5th bin: ---- EMPTY ----
10783 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10784 // 7th bin: <3>_{3n|2n,1n} = ...
10785 // 8th bin: <3>_{4n|2n,2n} = ...
10786 // 9th bin: <3>_{4n|3n,1n} = ...
10787 // 10th bin: ---- EMPTY ----
10788 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10789 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10790 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10791 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10792 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10793 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10794 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10795 // 18th bin: ---- EMPTY ----
10796 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10797 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10798 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10799 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10800 // 23rd bin: ---- EMPTY ----
10801 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10802 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10803 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10804 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10805 // 28th bin: ---- EMPTY ----
10806 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10807 // 30th bin: ---- EMPTY ----
10808 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 10809
489d5531 10810 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10811 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 10812
489d5531 10813 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10814 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10815 // ...
57340a27 10816
489d5531 10817 Int_t nPrim = anEvent->NumberOfTracks();
10818 AliFlowTrackSimple *aftsTrack = NULL;
10819 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10820 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10821 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10822 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10823 Int_t n = fHarmonic;
10824 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 10825 Double_t dMult = (*fSpk)(0,0);
489d5531 10826 cout<<endl;
10827 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10828 if(dMult<2)
10829 {
10830 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10831 } else if (dMult>fMaxAllowedMultiplicity)
10832 {
10833 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10834 } else
10835 {
10836 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10837 }
10838
10839 // 2-particle correlations:
10840 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10841 {
10842 // 2 nested loops multiparticle correlations using particle weights:
10843 for(Int_t i1=0;i1<nPrim;i1++)
10844 {
10845 aftsTrack=anEvent->GetTrack(i1);
10846 if(!(aftsTrack->InRPSelection())) continue;
10847 phi1=aftsTrack->Phi();
10848 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10849 for(Int_t i2=0;i2<nPrim;i2++)
10850 {
10851 if(i2==i1)continue;
10852 aftsTrack=anEvent->GetTrack(i2);
10853 if(!(aftsTrack->InRPSelection())) continue;
10854 phi2=aftsTrack->Phi();
10855 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10856 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10857 // 2-p correlations using particle weights:
10858 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10859 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))>
10860 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))>
10861 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))>
10862 // extra correlations:
10863 // 2-p extra correlations (do not appear if particle weights are not used):
10864 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10865 // ...
10866 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10867 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10868 } // end of if(nPrim>=2)
10869
10870 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 10871 {
489d5531 10872 // 3 nested loops multiparticle correlations using particle weights:
10873 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10874 {
489d5531 10875 aftsTrack=anEvent->GetTrack(i1);
10876 if(!(aftsTrack->InRPSelection())) continue;
10877 phi1=aftsTrack->Phi();
10878 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10879 for(Int_t i2=0;i2<nPrim;i2++)
10880 {
10881 if(i2==i1)continue;
10882 aftsTrack=anEvent->GetTrack(i2);
10883 if(!(aftsTrack->InRPSelection())) continue;
10884 phi2=aftsTrack->Phi();
10885 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10886 for(Int_t i3=0;i3<nPrim;i3++)
10887 {
10888 if(i3==i1||i3==i2)continue;
10889 aftsTrack=anEvent->GetTrack(i3);
10890 if(!(aftsTrack->InRPSelection())) continue;
10891 phi3=aftsTrack->Phi();
10892 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10893 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10894 // 3-p correlations using particle weights:
10895 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))>
10896 // ...
10897 // extra correlations:
10898 // 2-p extra correlations (do not appear if particle weights are not used):
10899 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10900 // ...
10901 // 3-p extra correlations (do not appear if particle weights are not used):
10902 // ...
10903 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10904 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10905 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10906 } // end of if(nPrim>=3)
57340a27 10907
489d5531 10908 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10909 {
10910 // 4 nested loops multiparticle correlations using particle weights:
10911 for(Int_t i1=0;i1<nPrim;i1++)
10912 {
10913 aftsTrack=anEvent->GetTrack(i1);
10914 if(!(aftsTrack->InRPSelection())) continue;
10915 phi1=aftsTrack->Phi();
10916 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10917 for(Int_t i2=0;i2<nPrim;i2++)
10918 {
10919 if(i2==i1)continue;
10920 aftsTrack=anEvent->GetTrack(i2);
10921 if(!(aftsTrack->InRPSelection())) continue;
10922 phi2=aftsTrack->Phi();
10923 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10924 for(Int_t i3=0;i3<nPrim;i3++)
10925 {
10926 if(i3==i1||i3==i2)continue;
10927 aftsTrack=anEvent->GetTrack(i3);
10928 if(!(aftsTrack->InRPSelection())) continue;
10929 phi3=aftsTrack->Phi();
10930 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10931 for(Int_t i4=0;i4<nPrim;i4++)
10932 {
10933 if(i4==i1||i4==i2||i4==i3)continue;
10934 aftsTrack=anEvent->GetTrack(i4);
10935 if(!(aftsTrack->InRPSelection())) continue;
10936 phi4=aftsTrack->Phi();
10937 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10938 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10939 // 4-p correlations using particle weights:
10940 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10941 // extra correlations:
10942 // 2-p extra correlations (do not appear if particle weights are not used):
10943 // ...
10944 // 3-p extra correlations (do not appear if particle weights are not used):
10945 // ...
10946 // 4-p extra correlations (do not appear if particle weights are not used):
10947 // ...
10948 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10949 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10950 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10951 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10952 } // end of if(nPrim>=4)
57340a27 10953
489d5531 10954 cout<<endl;
57340a27 10955
489d5531 10956} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 10957
489d5531 10958
10959//================================================================================================================================
10960
10961
10962void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10963{
489d5531 10964 // Cross-check results for extra multiparticle correlations needed for int. flow
10965 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 10966
489d5531 10967 cout<<endl;
10968 cout<<endl;
10969 cout<<" ***********************************************"<<endl;
10970 cout<<" **** cross-checking the extra correlations ****"<<endl;
10971 cout<<" **** for integrated flow ****"<<endl;
10972 cout<<" ***********************************************"<<endl;
10973 cout<<endl;
10974 cout<<endl;
10975
10976 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 10977 {
489d5531 10978 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
10979 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
10980 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
10981 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
10982 cout<<endl;
10983 }
57340a27 10984
489d5531 10985} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10986
10987
489d5531 10988//================================================================================================================================
3b552efe 10989
10990
0328db2d 10991void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10992{
10993 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
10994 //
10995 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
10996 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
10997 // (sc stands for either sin or cos):
10998
10999 // 1st bin: <<sc(n*(phi1))>>
11000 // 2nd bin: <<sc(n*(phi1+phi2))>>
11001 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
11002 // 4th bin: <<sc(n*(2phi1-phi2))>>
11003
11004 Int_t nPrim = anEvent->NumberOfTracks();
11005 AliFlowTrackSimple *aftsTrack = NULL;
11006 Double_t phi1=0., phi2=0., phi3=0.;
11007 Int_t n = fHarmonic;
11008 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 11009 Double_t dMult = (*fSpk)(0,0);
489d5531 11010 cout<<endl;
11011 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11012 if(dMult<1)
3b552efe 11013 {
489d5531 11014 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11015 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 11016 {
489d5531 11017 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11018 } else
11019 {
11020 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
11021 }
11022
11023 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11024 {
11025 // 1-particle correction terms for non-uniform acceptance:
11026 for(Int_t i1=0;i1<nPrim;i1++)
11027 {
11028 aftsTrack=anEvent->GetTrack(i1);
11029 if(!(aftsTrack->InRPSelection())) continue;
11030 phi1=aftsTrack->Phi();
11031 if(nPrim==1) cout<<i1<<"\r"<<flush;
11032 // sin terms:
11033 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
11034 // cos terms:
11035 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
11036 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11037 } // end of if(nPrim>=1)
11038
11039 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11040 {
11041 // 2-particle correction terms for non-uniform acceptance:
11042 for(Int_t i1=0;i1<nPrim;i1++)
11043 {
11044 aftsTrack=anEvent->GetTrack(i1);
11045 if(!(aftsTrack->InRPSelection())) continue;
11046 phi1=aftsTrack->Phi();
11047 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 11048 {
489d5531 11049 if(i2==i1)continue;
11050 aftsTrack=anEvent->GetTrack(i2);
11051 if(!(aftsTrack->InRPSelection())) continue;
11052 phi2=aftsTrack->Phi();
11053 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11054 // sin terms:
3b552efe 11055 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 11056 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
11057 // cos terms:
3b552efe 11058 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 11059 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
11060 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11061 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11062 } // end of if(nPrim>=2)
11063
11064 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11065 {
11066 // 3-particle correction terms for non-uniform acceptance:
11067 for(Int_t i1=0;i1<nPrim;i1++)
11068 {
11069 aftsTrack=anEvent->GetTrack(i1);
11070 if(!(aftsTrack->InRPSelection())) continue;
11071 phi1=aftsTrack->Phi();
11072 for(Int_t i2=0;i2<nPrim;i2++)
11073 {
11074 if(i2==i1)continue;
11075 aftsTrack=anEvent->GetTrack(i2);
11076 if(!(aftsTrack->InRPSelection())) continue;
11077 phi2=aftsTrack->Phi();
11078 for(Int_t i3=0;i3<nPrim;i3++)
11079 {
11080 if(i3==i1||i3==i2)continue;
11081 aftsTrack=anEvent->GetTrack(i3);
11082 if(!(aftsTrack->InRPSelection())) continue;
11083 phi3=aftsTrack->Phi();
11084 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
11085 // sin terms:
11086 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
11087 // cos terms:
11088 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
11089 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11090 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11091 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11092 } // end of if(nPrim>=3)
11093
11094 cout<<endl;
11095}
11096//================================================================================================================================
0328db2d 11097void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11098{
11099 // Evaluate reduced correlations with nested loops without using the particle weights.
11100
11101 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11102 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11103 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11104 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
11105 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
11106 // ...
11107
2a98ceb8 11108 Int_t typeFlag = 0;
11109 Int_t ptEtaFlag = 0;
489d5531 11110 if(type == "RP")
11111 {
11112 typeFlag = 0;
11113 } else if(type == "POI")
11114 {
11115 typeFlag = 1;
11116 }
11117 if(ptOrEta == "Pt")
11118 {
11119 ptEtaFlag = 0;
11120 } else if(ptOrEta == "Eta")
11121 {
11122 ptEtaFlag = 1;
11123 }
11124 // shortcuts:
11125 Int_t t = typeFlag;
11126 Int_t pe = ptEtaFlag;
11127
11128 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11129 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11130 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11131
11132 Int_t nPrim = anEvent->NumberOfTracks();
11133 AliFlowTrackSimple *aftsTrack = NULL;
11134
11135 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11136
3b552efe 11137 Int_t n = fHarmonic;
489d5531 11138
11139 // 2'-particle correlations:
11140 for(Int_t i1=0;i1<nPrim;i1++)
11141 {
11142 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11143 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11144 if(typeFlag==1) // this is diff flow of POIs
489d5531 11145 {
11146 if(ptOrEta == "Pt")
11147 {
11148 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11149 } else if (ptOrEta == "Eta")
11150 {
11151 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11152 }
11153 } else // this is diff flow of RPs
11154 {
489d5531 11155 if(ptOrEta == "Pt")
11156 {
11157 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11158 } else if (ptOrEta == "Eta")
11159 {
11160 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11161 }
11162 }
489d5531 11163
11164 psi1=aftsTrack->Phi();
11165 for(Int_t i2=0;i2<nPrim;i2++)
11166 {
11167 if(i2==i1)continue;
11168 aftsTrack=anEvent->GetTrack(i2);
11169 // RP condition (!(first) particle in the correlator must be RP):
11170 if(!(aftsTrack->InRPSelection()))continue;
11171 phi2=aftsTrack->Phi();
11172 // 2'-particle correlations:
11173 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
11174 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11175 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11176
11177 /*
11178
11179 // 3'-particle correlations:
11180 for(Int_t i1=0;i1<nPrim;i1++)
11181 {
11182 aftsTrack=anEvent->GetTrack(i1);
11183 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11184 if(ptOrEta == "Pt")
11185 {
11186 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11187 } else if (ptOrEta == "Eta")
11188 {
11189 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11190 }
11191 psi1=aftsTrack->Phi();
11192 for(Int_t i2=0;i2<nPrim;i2++)
11193 {
11194 if(i2==i1)continue;
11195 aftsTrack=anEvent->GetTrack(i2);
11196 // RP condition (!(first) particle in the correlator must be RP):
11197 if(!(aftsTrack->InRPSelection())) continue;
11198 phi2=aftsTrack->Phi();
11199 for(Int_t i3=0;i3<nPrim;i3++)
11200 {
11201 if(i3==i1||i3==i2)continue;
11202 aftsTrack=anEvent->GetTrack(i3);
11203 // RP condition (!(first) particle in the correlator must be RP):
11204 if(!(aftsTrack->InRPSelection())) continue;
11205 phi3=aftsTrack->Phi();
11206 // 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))>
11207 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11208 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11209 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11210
11211 */
11212
11213 // 4'-particle correlations:
11214 for(Int_t i1=0;i1<nPrim;i1++)
11215 {
11216 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11217 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11218 if(typeFlag==1) // this is diff flow of POIs
489d5531 11219 {
11220 if(ptOrEta == "Pt")
11221 {
11222 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11223 } else if (ptOrEta == "Eta")
11224 {
11225 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11226 }
11227 } else // this is diff flow of RPs
11228 {
489d5531 11229 if(ptOrEta == "Pt")
11230 {
11231 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11232 } else if (ptOrEta == "Eta")
11233 {
11234 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11235 }
11236 }
489d5531 11237
11238 psi1=aftsTrack->Phi();
11239 for(Int_t i2=0;i2<nPrim;i2++)
11240 {
11241 if(i2==i1) continue;
11242 aftsTrack=anEvent->GetTrack(i2);
11243 // RP condition (!(first) particle in the correlator must be RP):
11244 if(!(aftsTrack->InRPSelection())) continue;
11245 phi2=aftsTrack->Phi();
11246 for(Int_t i3=0;i3<nPrim;i3++)
11247 {
11248 if(i3==i1||i3==i2) continue;
11249 aftsTrack=anEvent->GetTrack(i3);
11250 // RP condition (!(first) particle in the correlator must be RP):
11251 if(!(aftsTrack->InRPSelection())) continue;
11252 phi3=aftsTrack->Phi();
11253 for(Int_t i4=0;i4<nPrim;i4++)
11254 {
11255 if(i4==i1||i4==i2||i4==i3) continue;
11256 aftsTrack=anEvent->GetTrack(i4);
11257 // RP condition (!(first) particle in the correlator must be RP):
11258 if(!(aftsTrack->InRPSelection())) continue;
11259 phi4=aftsTrack->Phi();
11260 // 4'-particle correlations:
11261 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
11262 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11263 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11264 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11265 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11266
11267 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 11268 for(Int_t i=0;i<nPrim;i++)
11269 {
11270 aftsTrack=anEvent->GetTrack(i);
11271 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11272 if(typeFlag==1) // this is diff flow of POIs
489d5531 11273 {
11274 if(ptOrEta == "Pt")
11275 {
11276 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11277 } else if (ptOrEta == "Eta")
11278 {
11279 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11280 }
11281 } else // this is diff flow of RPs
11282 {
489d5531 11283 if(ptOrEta == "Pt")
11284 {
11285 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11286 } else if (ptOrEta == "Eta")
11287 {
11288 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11289 }
11290 }
11291 if(t==1)t++;
11292 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 11293 }
11294
11295} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11296
11297
11298//================================================================================================================================
11299
11300
11301void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11302{
11303 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11304
2a98ceb8 11305 Int_t typeFlag = 0;
11306 Int_t ptEtaFlag = 0;
489d5531 11307 if(type == "RP")
11308 {
11309 typeFlag = 0;
11310 } else if(type == "POI")
11311 {
11312 typeFlag = 1;
11313 }
11314 if(ptOrEta == "Pt")
11315 {
11316 ptEtaFlag = 0;
11317 } else if(ptOrEta == "Eta")
11318 {
11319 ptEtaFlag = 1;
11320 }
11321 // shortcuts:
11322 Int_t t = typeFlag;
11323 Int_t pe = ptEtaFlag;
11324
11325 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11326 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11327 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
11328 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11329 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11330
11331 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11332
11333
11334 cout<<endl;
11335 cout<<" *****************************************"<<endl;
11336 cout<<" **** cross-checking the correlations ****"<<endl;
11337 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11338 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11339 {
11340 cout<<" **** (particle weights not used) ****"<<endl;
11341 } else
11342 {
11343 cout<<" **** (particle weights used) ****"<<endl;
11344 }
11345 cout<<" *****************************************"<<endl;
11346 cout<<endl;
11347 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11348 cout<<endl;
11349
11350 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
11351 {
11352 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
11353 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11354 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
11355 cout<<endl;
11356 } // end of for(Int_t rci=0;rci<4;rci++)
11357
11358} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11359
3b552efe 11360//================================================================================================================================
11361
489d5531 11362void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 11363{
11364 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
11365
11366 cout<<endl;
11367 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
11368 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
11369 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
11370 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
11371
489d5531 11372} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11373
3b552efe 11374//================================================================================================================================
11375
0328db2d 11376void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11377{
11378 // Evaluate reduced correlations with nested loops without using the particle weights.
11379
11380 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11381 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11382 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11383 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
11384 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
11385 // ...
11386
2a98ceb8 11387 Int_t typeFlag = 0;
11388 Int_t ptEtaFlag = 0;
489d5531 11389 if(type == "RP")
11390 {
11391 typeFlag = 0;
11392 } else if(type == "POI")
11393 {
11394 typeFlag = 1;
11395 }
11396 if(ptOrEta == "Pt")
11397 {
11398 ptEtaFlag = 0;
11399 } else if(ptOrEta == "Eta")
11400 {
11401 ptEtaFlag = 1;
11402 }
11403 // shortcuts:
11404 Int_t t = typeFlag;
11405 Int_t pe = ptEtaFlag;
11406
11407 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11408 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11409 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11410
11411 Int_t nPrim = anEvent->NumberOfTracks();
11412 AliFlowTrackSimple *aftsTrack = NULL;
11413
11414 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11415 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11416
11417 Int_t n = fHarmonic;
11418
11419 // 2'-particle correlations:
11420 for(Int_t i1=0;i1<nPrim;i1++)
11421 {
11422 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11423 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11424 if(typeFlag==1) // this is diff flow of POIs
489d5531 11425 {
11426 if(ptOrEta == "Pt")
11427 {
11428 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11429 } else if (ptOrEta == "Eta")
11430 {
11431 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11432 }
11433 } else // this is diff flow of RPs
11434 {
489d5531 11435 if(ptOrEta == "Pt")
11436 {
11437 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11438 } else if (ptOrEta == "Eta")
11439 {
11440 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11441 }
489d5531 11442 }
11443 psi1=aftsTrack->Phi();
11444 for(Int_t i2=0;i2<nPrim;i2++)
11445 {
11446 if(i2==i1) continue;
11447 aftsTrack=anEvent->GetTrack(i2);
11448 // RP condition (!(first) particle in the correlator must be RP):
11449 if(!(aftsTrack->InRPSelection())) continue;
11450 phi2=aftsTrack->Phi();
11451 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11452 // 2'-particle correlations:
11453 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11454 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11455 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11456
11457 // 4'-particle correlations:
11458 for(Int_t i1=0;i1<nPrim;i1++)
11459 {
11460 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11461 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11462 if(typeFlag==1) // this is diff flow of POIs
489d5531 11463 {
11464 if(ptOrEta == "Pt")
11465 {
11466 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11467 } else if (ptOrEta == "Eta")
11468 {
11469 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11470 }
11471 } else // this is diff flow of RPs
11472 {
489d5531 11473 if(ptOrEta == "Pt")
11474 {
11475 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11476 } else if (ptOrEta == "Eta")
11477 {
11478 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11479 }
489d5531 11480 }
11481 psi1=aftsTrack->Phi();
11482 for(Int_t i2=0;i2<nPrim;i2++)
11483 {
11484 if(i2==i1) continue;
11485 aftsTrack=anEvent->GetTrack(i2);
11486 // RP condition (!(first) particle in the correlator must be RP):
11487 if(!(aftsTrack->InRPSelection())) continue;
11488 phi2=aftsTrack->Phi();
11489 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11490 for(Int_t i3=0;i3<nPrim;i3++)
11491 {
11492 if(i3==i1||i3==i2) continue;
11493 aftsTrack=anEvent->GetTrack(i3);
11494 // RP condition (!(first) particle in the correlator must be RP):
11495 if(!(aftsTrack->InRPSelection())) continue;
11496 phi3=aftsTrack->Phi();
11497 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11498 for(Int_t i4=0;i4<nPrim;i4++)
11499 {
11500 if(i4==i1||i4==i2||i4==i3) continue;
11501 aftsTrack=anEvent->GetTrack(i4);
11502 // RP condition (!(first) particle in the correlator must be RP):
11503 if(!(aftsTrack->InRPSelection())) continue;
11504 phi4=aftsTrack->Phi();
11505 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11506 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11507 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11508 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11509 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11510 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11511 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11512
11513 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 11514 for(Int_t i=0;i<nPrim;i++)
11515 {
489d5531 11516 aftsTrack=anEvent->GetTrack(i);
11517 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11518 if(typeFlag==1) // this is diff flow of POIs
11519 {
11520 if(ptOrEta == "Pt")
11521 {
11522 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11523 } else if (ptOrEta == "Eta")
11524 {
11525 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11526 }
11527 } else // this is diff flow of RPs
11528 {
11529 if(ptOrEta == "Pt")
11530 {
11531 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11532 } else if (ptOrEta == "Eta")
11533 {
11534 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11535 }
11536 }
11537 if(t==1)t++;
11538 fNoOfParticlesInBin->Fill(t+pe+0.5);
11539 }
11540
11541} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11542
11543
11544//================================================================================================================================
11545
11546
0328db2d 11547void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11548{
11549 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11550
11551 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11552 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11553 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11554 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11555 // cti:
11556 // 0: <<sc n(psi1)>>
11557 // 1: <<sc n(psi1+phi2)>>
11558 // 2: <<sc n(psi1+phi2-phi3)>>
11559 // 3: <<sc n(psi1-phi2-phi3)>>
11560 // 4:
11561 // 5:
11562 // 6:
11563
2a98ceb8 11564 Int_t typeFlag = 0;
11565 Int_t ptEtaFlag = 0;
489d5531 11566 if(type == "RP")
11567 {
11568 typeFlag = 0;
11569 } else if(type == "POI")
11570 {
11571 typeFlag = 1;
11572 }
11573 if(ptOrEta == "Pt")
11574 {
11575 ptEtaFlag = 0;
11576 } else if(ptOrEta == "Eta")
11577 {
11578 ptEtaFlag = 1;
11579 }
11580 // shortcuts:
11581 Int_t t = typeFlag;
11582 Int_t pe = ptEtaFlag;
11583
11584 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11585 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11586 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11587
11588 Int_t nPrim = anEvent->NumberOfTracks();
11589 AliFlowTrackSimple *aftsTrack = NULL;
11590
11591 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11592
11593 Int_t n = fHarmonic;
11594
11595 // 1-particle correction terms:
11596 for(Int_t i1=0;i1<nPrim;i1++)
11597 {
11598 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11599 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11600 if(typeFlag==1) // this is diff flow of POIs
489d5531 11601 {
11602 if(ptOrEta == "Pt")
11603 {
11604 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11605 } else if (ptOrEta == "Eta")
11606 {
11607 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11608 }
11609 } else // this is diff flow of RPs
11610 {
489d5531 11611 if(ptOrEta == "Pt")
11612 {
11613 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11614 } else if (ptOrEta == "Eta")
11615 {
11616 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11617 }
11618 }
489d5531 11619 psi1=aftsTrack->Phi();
11620 // sin terms:
11621 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11622 // cos terms:
11623 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11624 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11625
11626 // 2-particle correction terms:
11627 for(Int_t i1=0;i1<nPrim;i1++)
11628 {
11629 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11630 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11631 if(typeFlag==1) // this is diff flow of POIs
489d5531 11632 {
11633 if(ptOrEta == "Pt")
11634 {
11635 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11636 } else if (ptOrEta == "Eta")
11637 {
11638 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11639 }
11640 } else // this is diff flow of RPs
11641 {
489d5531 11642 if(ptOrEta == "Pt")
11643 {
11644 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11645 } else if (ptOrEta == "Eta")
11646 {
11647 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11648 }
489d5531 11649 }
11650 psi1=aftsTrack->Phi();
11651 for(Int_t i2=0;i2<nPrim;i2++)
11652 {
11653 if(i2==i1) continue;
11654 aftsTrack=anEvent->GetTrack(i2);
11655 // RP condition (!(first) particle in the correlator must be RP):
11656 if(!(aftsTrack->InRPSelection())) continue;
11657 phi2=aftsTrack->Phi();
11658 // sin terms:
11659 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11660 // cos terms:
11661 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11662 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11663 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11664
11665 // 3-particle correction terms:
11666 for(Int_t i1=0;i1<nPrim;i1++)
11667 {
11668 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11669 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11670 if(typeFlag==1) // this is diff flow of POIs
489d5531 11671 {
11672 if(ptOrEta == "Pt")
11673 {
11674 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11675 } else if (ptOrEta == "Eta")
11676 {
11677 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11678 }
11679 } else // this is diff flow of RPs
11680 {
489d5531 11681 if(ptOrEta == "Pt")
11682 {
11683 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11684 } else if (ptOrEta == "Eta")
11685 {
11686 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11687 }
489d5531 11688 }
11689 psi1=aftsTrack->Phi();
11690 for(Int_t i2=0;i2<nPrim;i2++)
11691 {
11692 if(i2==i1) continue;
11693 aftsTrack=anEvent->GetTrack(i2);
11694 // RP condition (!(first) particle in the correlator must be RP):
11695 if(!(aftsTrack->InRPSelection())) continue;
11696 phi2=aftsTrack->Phi();
11697 for(Int_t i3=0;i3<nPrim;i3++)
11698 {
11699 if(i3==i1||i3==i2) continue;
11700 aftsTrack=anEvent->GetTrack(i3);
11701 // RP condition (!(first) particle in the correlator must be RP):
11702 if(!(aftsTrack->InRPSelection())) continue;
11703 phi3=aftsTrack->Phi();
11704 // sin terms:
11705 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11706 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11707 // cos terms:
11708 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11709 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11710 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11711 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11712 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11713
11714} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11715
11716
11717//================================================================================================================================
11718
11719
11720void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11721{
11722 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11723
2a98ceb8 11724 Int_t typeFlag = 0;
11725 Int_t ptEtaFlag = 0;
489d5531 11726 if(type == "RP")
11727 {
11728 typeFlag = 0;
11729 } else if(type == "POI")
11730 {
11731 typeFlag = 1;
11732 }
11733 if(ptOrEta == "Pt")
11734 {
11735 ptEtaFlag = 0;
11736 } else if(ptOrEta == "Eta")
11737 {
11738 ptEtaFlag = 1;
11739 }
11740 // shortcuts:
11741 Int_t t = typeFlag;
11742 Int_t pe = ptEtaFlag;
11743
11744 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11745 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11746 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11747 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)
11748 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)
11749 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11750 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11751
11752 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11753
11754 cout<<endl;
11755 cout<<" ******************************************"<<endl;
11756 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 11757 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 11758 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11759 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11760 {
11761 cout<<" **** (particle weights not used) ****"<<endl;
11762 } else
11763 {
11764 cout<<" **** (particle weights used) ****"<<endl;
11765 }
11766 cout<<" ******************************************"<<endl;
11767 cout<<endl;
11768 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11769 cout<<endl;
11770
11771 for(Int_t cti=0;cti<4;cti++) // correction term index
11772 {
11773 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11774 {
11775 if(sc==0) // to be improved (this can be implemented better)
11776 {
11777 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11778 } else
11779 {
11780 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11781 }
11782 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11783 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11784 cout<<endl;
11785 }
11786 } // end of for(Int_t rci=0;rci<4;rci++)
11787
11788} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11789
11790
57340a27 11791//================================================================================================================================
11792
489d5531 11793
11794void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11795{
11796 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11797
11798 // **********************************************************************
11799 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11800 // **********************************************************************
57340a27 11801
489d5531 11802 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 11803 //
489d5531 11804 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11805 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11806 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11807 // ...
11808
11809 // multiplicity (number of particles used to determine the reaction plane)
1268c371 11810 Double_t dMult = (*fSpk)(0,0);
489d5531 11811
11812 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11813 Double_t dReQ1n1k = (*fReQ)(0,1);
11814 Double_t dReQ2n2k = (*fReQ)(1,2);
11815 //Double_t dReQ3n3k = (*fReQ)(2,3);
11816 //Double_t dReQ4n4k = (*fReQ)(3,4);
11817 Double_t dReQ1n3k = (*fReQ)(0,3);
11818 Double_t dImQ1n1k = (*fImQ)(0,1);
11819 Double_t dImQ2n2k = (*fImQ)(1,2);
11820 //Double_t dImQ3n3k = (*fImQ)(2,3);
11821 //Double_t dImQ4n4k = (*fImQ)(3,4);
11822 //Double_t dImQ1n3k = (*fImQ)(0,3);
11823
11824 // dMs are variables introduced in order to simplify some Eqs. bellow:
11825 //..............................................................................................
1268c371 11826 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11827 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
11828 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 11829 //..............................................................................................
ecac11c2 11830 // 1-particle:
489d5531 11831 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11832
1268c371 11833 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 11834 {
1268c371 11835 cosP1nW1 = dReQ1n1k/(*fSpk)(0,1);
489d5531 11836
11837 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11838 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11839
11840 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
1268c371 11841 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSpk)(0,1));
489d5531 11842 }
11843
11844 // 2-particle:
11845 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11846
1268c371 11847 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 11848 {
11849 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11850
11851 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11852 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11853
11854 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11855 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11856 }
11857
11858 // 3-particle:
11859 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11860
1268c371 11861 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 11862 {
57340a27 11863 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11864 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
1268c371 11865 - 2.*((*fSpk)(0,2))*dReQ1n1k
489d5531 11866 + 2.*dReQ1n3k)
11867 / dM111;
11868
11869 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11870 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11871
11872 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11873 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11874 }
11875
11876} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11877
11878
11879//================================================================================================================================
11880
11881
11882void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11883{
11884 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11885
11886 // **********************************************************************
11887 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11888 // **********************************************************************
11889
11890 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 11891 //
489d5531 11892 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11893 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11894 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11895 // ...
11896
11897 // multiplicity (number of particles used to determine the reaction plane)
1268c371 11898 Double_t dMult = (*fSpk)(0,0);
489d5531 11899
11900 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11901 Double_t dReQ1n1k = (*fReQ)(0,1);
11902 Double_t dReQ2n2k = (*fReQ)(1,2);
11903 //Double_t dReQ3n3k = (*fReQ)(2,3);
11904 //Double_t dReQ4n4k = (*fReQ)(3,4);
11905 //Double_t dReQ1n3k = (*fReQ)(0,3);
11906 Double_t dImQ1n1k = (*fImQ)(0,1);
11907 Double_t dImQ2n2k = (*fImQ)(1,2);
11908 //Double_t dImQ3n3k = (*fImQ)(2,3);
11909 //Double_t dImQ4n4k = (*fImQ)(3,4);
11910 Double_t dImQ1n3k = (*fImQ)(0,3);
11911
11912 // dMs are variables introduced in order to simplify some Eqs. bellow:
11913 //..............................................................................................
1268c371 11914 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11915 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
11916 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
489d5531 11917 //..............................................................................................
11918
11919 // 1-particle:
11920 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11921
1268c371 11922 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
489d5531 11923 {
1268c371 11924 sinP1nW1 = dImQ1n1k/((*fSpk)(0,1));
489d5531 11925
11926 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11927 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11928
11929 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1268c371 11930 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSpk)(0,1));
489d5531 11931 }
11932
11933 // 2-particle:
11934 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11935
1268c371 11936 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
489d5531 11937 {
11938 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11939
11940 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11941 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11942
11943 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11944 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11945 }
11946
11947 // 3-particle:
11948 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11949
1268c371 11950 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
489d5531 11951 {
57340a27 11952 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11953 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
1268c371 11954 + 2.*((*fSpk)(0,2))*dImQ1n1k
489d5531 11955 - 2.*dImQ1n3k)
11956 / dM111;
11957
11958 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11959 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11960
11961 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11962 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11963 }
11964
11965} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11966
57340a27 11967//================================================================================================================================
489d5531 11968
0328db2d 11969void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11970{
11971 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11972
57340a27 11973 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11974 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 11975
57340a27 11976 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 11977 // organized as follows (sc stands for either sin or cos):
11978 //
11979 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
11980 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
11981 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 11982 // ...
489d5531 11983
11984 Int_t nPrim = anEvent->NumberOfTracks();
11985 AliFlowTrackSimple *aftsTrack = NULL;
11986 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11987 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11988 Double_t phi1=0., phi2=0., phi3=0.;
11989 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
11990 Int_t n = fHarmonic;
11991 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
1268c371 11992 Double_t dMult = (*fSpk)(0,0);
489d5531 11993 cout<<endl;
11994 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11995 if(dMult<1)
11996 {
11997 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11998 } else if (dMult>fMaxAllowedMultiplicity)
11999 {
12000 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
12001 } else
12002 {
12003 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
12004 }
12005
12006 // 1-particle correction terms using particle weights:
12007 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12008 {
12009 for(Int_t i1=0;i1<nPrim;i1++)
12010 {
12011 aftsTrack=anEvent->GetTrack(i1);
12012 if(!(aftsTrack->InRPSelection())) continue;
12013 phi1=aftsTrack->Phi();
12014 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 12015 // 1-particle correction terms using particle weights:
489d5531 12016 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
12017 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 12018 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12019 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12020
489d5531 12021 // 2-particle correction terms using particle weights:
12022 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
12023 {
12024 for(Int_t i1=0;i1<nPrim;i1++)
12025 {
12026 aftsTrack=anEvent->GetTrack(i1);
12027 if(!(aftsTrack->InRPSelection())) continue;
12028 phi1=aftsTrack->Phi();
12029 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12030 for(Int_t i2=0;i2<nPrim;i2++)
12031 {
12032 if(i2==i1)continue;
12033 aftsTrack=anEvent->GetTrack(i2);
12034 if(!(aftsTrack->InRPSelection())) continue;
12035 phi2=aftsTrack->Phi();
12036 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12037 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 12038 // 2-p correction terms using particle weights:
489d5531 12039 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
12040 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
12041 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12042 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12043 } // end of if(nPrim>=2)
12044
12045 // 3-particle correction terms using particle weights:
12046 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12047 {
12048 for(Int_t i1=0;i1<nPrim;i1++)
12049 {
12050 aftsTrack=anEvent->GetTrack(i1);
12051 if(!(aftsTrack->InRPSelection())) continue;
12052 phi1=aftsTrack->Phi();
12053 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12054 for(Int_t i2=0;i2<nPrim;i2++)
12055 {
12056 if(i2==i1)continue;
12057 aftsTrack=anEvent->GetTrack(i2);
12058 if(!(aftsTrack->InRPSelection())) continue;
12059 phi2=aftsTrack->Phi();
12060 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12061 for(Int_t i3=0;i3<nPrim;i3++)
12062 {
12063 if(i3==i1||i3==i2)continue;
12064 aftsTrack=anEvent->GetTrack(i3);
12065 if(!(aftsTrack->InRPSelection())) continue;
12066 phi3=aftsTrack->Phi();
12067 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12068 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 12069 // 3-p correction terms using particle weights:
489d5531 12070 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
12071 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
12072 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12073 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12074 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12075 } // end of if(nPrim>=3)
12076
57340a27 12077 /*
12078
489d5531 12079 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
12080 {
12081 // 4 nested loops multiparticle correlations using particle weights:
12082 for(Int_t i1=0;i1<nPrim;i1++)
12083 {
12084 aftsTrack=anEvent->GetTrack(i1);
12085 if(!(aftsTrack->InRPSelection())) continue;
12086 phi1=aftsTrack->Phi();
12087 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12088 for(Int_t i2=0;i2<nPrim;i2++)
12089 {
12090 if(i2==i1)continue;
12091 aftsTrack=anEvent->GetTrack(i2);
12092 if(!(aftsTrack->InRPSelection())) continue;
12093 phi2=aftsTrack->Phi();
12094 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12095 for(Int_t i3=0;i3<nPrim;i3++)
12096 {
12097 if(i3==i1||i3==i2)continue;
12098 aftsTrack=anEvent->GetTrack(i3);
12099 if(!(aftsTrack->InRPSelection())) continue;
12100 phi3=aftsTrack->Phi();
12101 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12102 for(Int_t i4=0;i4<nPrim;i4++)
12103 {
12104 if(i4==i1||i4==i2||i4==i3)continue;
12105 aftsTrack=anEvent->GetTrack(i4);
12106 if(!(aftsTrack->InRPSelection())) continue;
12107 phi4=aftsTrack->Phi();
12108 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12109 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
12110 // 4-p correlations using particle weights:
12111 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
12112 // extra correlations:
12113 // 2-p extra correlations (do not appear if particle weights are not used):
12114 // ...
12115 // 3-p extra correlations (do not appear if particle weights are not used):
12116 // ...
12117 // 4-p extra correlations (do not appear if particle weights are not used):
12118 // ...
12119 } // end of for(Int_t i4=0;i4<nPrim;i4++)
12120 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12121 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12122 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12123 } // end of if(nPrim>=4)
12124
12125 */
12126
12127 cout<<endl;
12128
12129} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
12130
57340a27 12131//================================================================================================================================
489d5531 12132
489d5531 12133void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12134{
12135 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 12136
489d5531 12137 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 12138 //
489d5531 12139 // 0: <<cos n(psi)>>
12140 // 1: <<w2 cos n(psi1+phi2)>>
12141 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
12142 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
12143 // 4:
12144 // 5:
12145 // 6:
12146
12147 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12148 Double_t dReQ1n1k = (*fReQ)(0,1);
12149 Double_t dReQ2n2k = (*fReQ)(1,2);
12150 //Double_t dReQ1n3k = (*fReQ)(0,3);
12151 //Double_t dReQ4n4k = (*fReQ)(3,4);
12152 Double_t dImQ1n1k = (*fImQ)(0,1);
12153 Double_t dImQ2n2k = (*fImQ)(1,2);
12154 //Double_t dImQ1n3k = (*fImQ)(0,3);
12155 //Double_t dImQ4n4k = (*fImQ)(3,4);
12156
1268c371 12157 // S^M_{p,k} (see .h file for the definition of fSpk):
12158 Double_t dSM1p1k = (*fSpk)(0,1);
12159 Double_t dSM1p2k = (*fSpk)(0,2);
12160 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 12161
2a98ceb8 12162 Int_t t = 0; // type flag
12163 Int_t pe = 0; // ptEta flag
489d5531 12164
12165 if(type == "RP")
12166 {
12167 t = 0;
12168 } else if(type == "POI")
12169 {
12170 t = 1;
12171 }
12172
12173 if(ptOrEta == "Pt")
12174 {
12175 pe = 0;
12176 } else if(ptOrEta == "Eta")
12177 {
12178 pe = 1;
12179 }
12180
12181 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12182 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12183 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12184 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12185
12186 // looping over all bins and calculating correction terms:
12187 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12188 {
12189 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12190 Double_t p1n0kRe = 0.;
12191 Double_t p1n0kIm = 0.;
12192
12193 // number of POIs in particular pt or eta bin:
12194 Double_t mp = 0.;
12195
12196 // 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):
12197 Double_t q1n2kRe = 0.;
12198 Double_t q1n2kIm = 0.;
12199 Double_t q2n1kRe = 0.;
12200 Double_t q2n1kIm = 0.;
46b94261 12201
489d5531 12202 // s_{1,1}, s_{1,2} // to be improved (add explanation)
12203 Double_t s1p1k = 0.;
12204 Double_t s1p2k = 0.;
46b94261 12205
489d5531 12206 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12207 Double_t mq = 0.;
489d5531 12208
12209 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12210 Double_t dM01 = 0.;
12211 Double_t dM011 = 0.;
12212
12213 if(type == "POI")
12214 {
12215 // q_{m*n,k}:
12216 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12217 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12218 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12219 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12220 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12221 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12222 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12223 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12224 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 12225
489d5531 12226 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12227 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12228 }else if(type == "RP")
12229 {
12230 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12231 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12232 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12233 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12234 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12235 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12236 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12237 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12238 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12239 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12240 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12241 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 12242 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12243
489d5531 12244 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12245 }
3b552efe 12246
489d5531 12247 if(type == "POI")
3b552efe 12248 {
12249 // p_{m*n,k}:
489d5531 12250 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12251 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12252 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12253 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12254 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 12255 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12256 dM01 = mp*dSM1p1k-s1p1k;
12257 dM011 = mp*(dSM2p1k-dSM1p2k)
12258 - 2.*(s1p1k*dSM1p1k-s1p2k);
12259
12260 // typeFlag = RP (0) or POI (1):
12261 t = 1;
12262 } else if(type == "RP")
489d5531 12263 {
12264 // to be improved (cross-checked):
12265 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12266 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12267 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12268 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12269 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12270 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12271 dM01 = mp*dSM1p1k-s1p1k;
12272 dM011 = mp*(dSM2p1k-dSM1p2k)
12273 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 12274 // typeFlag = RP (0) or POI (1):
3b552efe 12275 t = 0;
12276 }
489d5531 12277
12278 // <<cos n(psi1)>>:
12279 Double_t cosP1nPsi = 0.;
12280 if(mp)
12281 {
12282 cosP1nPsi = p1n0kRe/mp;
12283
12284 // fill profile for <<cos n(psi1)>>:
12285 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
12286 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
12287 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 12288 } // end of if(mp)
57340a27 12289
489d5531 12290 // <<w2 cos n(psi1+phi2)>>:
12291 Double_t cosP1nPsiP1nPhiW2 = 0.;
12292 if(dM01)
12293 {
12294 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
12295 // fill profile for <<w2 cos n(psi1+phi2)>>:
12296 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
12297 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12298 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
12299 } // end of if(dM01)
12300
12301 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
12302 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12303 if(dM011)
12304 {
46b94261 12305 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12306 - p1n0kRe*dSM1p2k
12307 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
12308 - s1p1k*dReQ1n1k
12309 + 2.*q1n2kRe)
12310 / dM011;
489d5531 12311 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12312 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12313 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12314 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
12315 } // end of if(dM011)
12316
12317 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
12318 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12319 if(dM011)
12320 {
12321 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
12322 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 12323 - 2.*s1p1k*dReQ1n1k
489d5531 12324 + 2.*q1n2kRe)
12325 / dM011;
12326 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12327 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12328 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12329 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
12330 } // end of if(dM011)
12331
12332 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 12333
57340a27 12334} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12335
489d5531 12336
12337//================================================================================================================================
12338
12339
12340void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12341{
12342 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
12343
12344 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
12345 // 0: <<sin n(psi1)>>
12346 // 1: <<w2 sin n(psi1+phi2)>>
12347 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
12348 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
12349 // 4:
12350 // 5:
12351 // 6:
12352
12353 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12354 Double_t dReQ1n1k = (*fReQ)(0,1);
12355 Double_t dReQ2n2k = (*fReQ)(1,2);
12356 //Double_t dReQ1n3k = (*fReQ)(0,3);
12357 //Double_t dReQ4n4k = (*fReQ)(3,4);
12358 Double_t dImQ1n1k = (*fImQ)(0,1);
12359 Double_t dImQ2n2k = (*fImQ)(1,2);
12360 //Double_t dImQ1n3k = (*fImQ)(0,3);
12361 //Double_t dImQ4n4k = (*fImQ)(3,4);
12362
1268c371 12363 // S^M_{p,k} (see .h file for the definition of fSpk):
12364 Double_t dSM1p1k = (*fSpk)(0,1);
12365 Double_t dSM1p2k = (*fSpk)(0,2);
12366 Double_t dSM2p1k = (*fSpk)(1,1);
489d5531 12367
2a98ceb8 12368 Int_t t = 0; // type flag
12369 Int_t pe = 0; // ptEta flag
489d5531 12370
12371 if(type == "RP")
12372 {
12373 t = 0;
12374 } else if(type == "POI")
12375 {
12376 t = 1;
12377 }
12378
12379 if(ptOrEta == "Pt")
12380 {
12381 pe = 0;
12382 } else if(ptOrEta == "Eta")
12383 {
12384 pe = 1;
12385 }
12386
12387 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12388 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12389 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12390 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12391
12392 // looping over all bins and calculating correction terms:
12393 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12394 {
12395 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12396 Double_t p1n0kRe = 0.;
12397 Double_t p1n0kIm = 0.;
12398
12399 // number of POIs in particular pt or eta bin:
12400 Double_t mp = 0.;
12401
12402 // 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):
12403 Double_t q1n2kRe = 0.;
12404 Double_t q1n2kIm = 0.;
12405 Double_t q2n1kRe = 0.;
12406 Double_t q2n1kIm = 0.;
46b94261 12407
489d5531 12408 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12409 Double_t s1p1k = 0.;
12410 Double_t s1p2k = 0.;
46b94261 12411
489d5531 12412 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12413 Double_t mq = 0.;
489d5531 12414
12415 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12416 Double_t dM01 = 0.;
12417 Double_t dM011 = 0.;
12418
12419 if(type == "POI")
12420 {
12421 // q_{m*n,k}:
12422 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12423 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12424 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12425 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12426 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12427 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12428 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12429 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12430 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 12431
489d5531 12432 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12433 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12434 }else if(type == "RP")
12435 {
12436 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12437 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12438 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12439 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12440 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12441 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12442 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12443 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12444 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12445 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12446 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12447 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12448 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 12449 }
12450
12451 if(type == "POI")
12452 {
12453 // p_{m*n,k}:
489d5531 12454 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12455 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12456 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12457 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12458 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 12459 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12460 dM01 = mp*dSM1p1k-s1p1k;
12461 dM011 = mp*(dSM2p1k-dSM1p2k)
12462 - 2.*(s1p1k*dSM1p1k-s1p2k);
12463 // typeFlag = RP (0) or POI (1):
12464 t = 1;
489d5531 12465 } else if(type == "RP")
3b552efe 12466 {
489d5531 12467 // to be improved (cross-checked):
12468 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12469 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12470 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12471 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12472 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12473 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12474 dM01 = mp*dSM1p1k-s1p1k;
12475 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 12476 - 2.*(s1p1k*dSM1p1k-s1p2k);
12477 // typeFlag = RP (0) or POI (1):
3b552efe 12478 t = 0;
12479 }
12480
489d5531 12481 // <<sin n(psi1)>>:
12482 Double_t sinP1nPsi = 0.;
12483 if(mp)
12484 {
12485 sinP1nPsi = p1n0kIm/mp;
12486
12487 // fill profile for <<sin n(psi1)>>:
12488 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12489 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12490 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 12491 } // end of if(mp)
12492
489d5531 12493 // <<w2 sin n(psi1+phi2)>>:
12494 Double_t sinP1nPsiP1nPhiW2 = 0.;
12495 if(dM01)
12496 {
12497 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12498 // fill profile for <<w2 sin n(psi1+phi2)>>:
12499 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12500 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12501 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12502 } // end of if(mp*dMult-mq)
12503
12504 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12505 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12506 if(dM011)
12507 {
46b94261 12508 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12509 - p1n0kIm*dSM1p2k
12510 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12511 - s1p1k*dImQ1n1k
12512 + 2.*q1n2kIm)
12513 / dM011;
489d5531 12514 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12515 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12516 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12517 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12518 } // end of if(dM011)
12519
12520 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12521 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12522 if(dM011)
12523 {
12524 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12525 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 12526 + 2.*s1p1k*dImQ1n1k
489d5531 12527 - 2.*q1n2kIm)
12528 / dM011;
12529 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12530 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12531 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12532 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12533 } // end of if(dM011)
12534
12535 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12536
12537} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12538
12539
12540//================================================================================================================================
12541
12542
0328db2d 12543void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12544{
57340a27 12545 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 12546 // with using particle weights (both sin and cos terms) relevant for differential flow.
12547
57340a27 12548 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12549 // flagged both as POI and RP.
489d5531 12550 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12551 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12552 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12553 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12554 // cti:
12555 // 0: <<sc n(psi1)>>
12556 // 1: <<w2 sc n(psi1+phi2)>>
12557 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12558 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12559 // 4:
12560 // 5:
12561 // 6:
46b94261 12562
2a98ceb8 12563 Int_t typeFlag = 0;
12564 Int_t ptEtaFlag = 0;
489d5531 12565 if(type == "RP")
12566 {
12567 typeFlag = 0;
12568 } else if(type == "POI")
12569 {
12570 typeFlag = 1;
12571 }
12572 if(ptOrEta == "Pt")
12573 {
12574 ptEtaFlag = 0;
12575 } else if(ptOrEta == "Eta")
12576 {
12577 ptEtaFlag = 1;
12578 }
12579 // shortcuts:
12580 Int_t t = typeFlag;
12581 Int_t pe = ptEtaFlag;
12582
12583 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12584 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12585 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12586
12587 Int_t nPrim = anEvent->NumberOfTracks();
12588 AliFlowTrackSimple *aftsTrack = NULL;
12589
12590 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12591 Double_t wPhi2=1., wPhi3=1.;
12592
12593 Int_t n = fHarmonic;
12594
12595 // 1'-particle correction terms:
12596 for(Int_t i1=0;i1<nPrim;i1++)
12597 {
12598 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12599 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12600 if(typeFlag==1) // this is diff flow of POIs
489d5531 12601 {
12602 if(ptOrEta == "Pt")
12603 {
12604 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12605 } else if (ptOrEta == "Eta")
12606 {
12607 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12608 }
12609 } else // this is diff flow of RPs
12610 {
489d5531 12611 if(ptOrEta == "Pt")
12612 {
12613 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12614 } else if (ptOrEta == "Eta")
12615 {
12616 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12617 }
489d5531 12618 }
12619 psi1=aftsTrack->Phi();
12620 // sin terms:
12621 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12622 // cos terms:
12623 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12624 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12625
12626 // 2'-particle correction terms:
12627 for(Int_t i1=0;i1<nPrim;i1++)
12628 {
12629 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12630 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12631 if(typeFlag==1) // this is diff flow of POIs
489d5531 12632 {
12633 if(ptOrEta == "Pt")
12634 {
12635 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12636 } else if (ptOrEta == "Eta")
12637 {
12638 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12639 }
12640 } else // this is diff flow of RPs
12641 {
489d5531 12642 if(ptOrEta == "Pt")
12643 {
12644 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12645 } else if (ptOrEta == "Eta")
12646 {
12647 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12648 }
489d5531 12649 }
12650 psi1=aftsTrack->Phi();
12651 for(Int_t i2=0;i2<nPrim;i2++)
12652 {
12653 if(i2==i1) continue;
12654 aftsTrack=anEvent->GetTrack(i2);
12655 // RP condition (!(first) particle in the correlator must be RP):
12656 if(!(aftsTrack->InRPSelection())) continue;
46b94261 12657 phi2=aftsTrack->Phi();
489d5531 12658 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12659 // sin terms:
12660 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12661 // cos terms:
12662 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12663 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12664 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12665
12666 // 3'-particle correction terms:
12667 for(Int_t i1=0;i1<nPrim;i1++)
12668 {
12669 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12670 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12671 if(typeFlag==1) // this is diff flow of POIs
489d5531 12672 {
12673 if(ptOrEta == "Pt")
12674 {
12675 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12676 } else if (ptOrEta == "Eta")
12677 {
12678 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12679 }
12680 } else // this is diff flow of RPs
12681 {
489d5531 12682 if(ptOrEta == "Pt")
12683 {
12684 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12685 } else if (ptOrEta == "Eta")
12686 {
12687 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12688 }
489d5531 12689 }
12690 psi1=aftsTrack->Phi();
12691 for(Int_t i2=0;i2<nPrim;i2++)
12692 {
12693 if(i2==i1) continue;
12694 aftsTrack=anEvent->GetTrack(i2);
12695 // RP condition (!(first) particle in the correlator must be RP):
12696 if(!(aftsTrack->InRPSelection())) continue;
12697 phi2=aftsTrack->Phi();
12698 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12699 for(Int_t i3=0;i3<nPrim;i3++)
12700 {
12701 if(i3==i1||i3==i2) continue;
12702 aftsTrack=anEvent->GetTrack(i3);
12703 // RP condition (!(first) particle in the correlator must be RP):
12704 if(!(aftsTrack->InRPSelection())) continue;
12705 phi3=aftsTrack->Phi();
12706 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12707 // sin terms:
12708 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))>>
12709 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))>>
12710 // cos terms:
12711 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))>>
12712 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))>>
12713 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12714 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 12715 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 12716
12717} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12718
2001bc3a 12719//================================================================================================================================
12720
b3dacf6b 12721void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12722{
12723 // Check all pointers used in method Finish().
12724
b77b6434 12725 if(!fAvMultiplicity)
12726 {
12727 cout<<endl;
12728 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12729 cout<<endl;
12730 exit(0);
12731 }
b3dacf6b 12732 if(!fIntFlowCorrelationsPro)
12733 {
12734 cout<<endl;
12735 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12736 cout<<endl;
12737 exit(0);
12738 }
b40a910e 12739 if(!fIntFlowSquaredCorrelationsPro)
12740 {
12741 cout<<endl;
12742 cout<<" WARNING (QC): fIntFlowSquaredCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12743 cout<<endl;
12744 exit(0);
12745 }
b3dacf6b 12746 if(!fIntFlowCorrelationsHist)
12747 {
12748 cout<<endl;
12749 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12750 cout<<endl;
12751 exit(0);
12752 }
b77b6434 12753 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12754 {
12755 cout<<endl;
12756 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12757 cout<<endl;
12758 exit(0);
12759 }
b3dacf6b 12760 for(Int_t power=0;power<2;power++)
12761 {
12762 if(!fIntFlowSumOfEventWeights[power])
12763 {
12764 cout<<endl;
12765 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
12766 cout<<endl;
12767 exit(0);
12768 }
12769 } // end of for(Int_t power=0;power<2;power++)
12770 if(!fIntFlowProductOfCorrelationsPro)
12771 {
12772 cout<<endl;
12773 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12774 cout<<endl;
12775 exit(0);
12776 }
12777 if(!fIntFlowSumOfProductOfEventWeights)
12778 {
12779 cout<<endl;
12780 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12781 cout<<endl;
12782 exit(0);
12783 }
12784 if(!fIntFlowCovariances)
12785 {
12786 cout<<endl;
12787 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12788 cout<<endl;
12789 exit(0);
12790 }
12791 if(!fIntFlowQcumulants)
12792 {
12793 cout<<endl;
12794 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12795 cout<<endl;
12796 exit(0);
12797 }
0dd3b008 12798 if(!fIntFlow)
12799 {
12800 cout<<endl;
12801 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12802 cout<<endl;
12803 exit(0);
12804 }
12805 if(!fCommonHists)
12806 {
12807 cout<<endl;
12808 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12809 cout<<endl;
12810 exit(0);
12811 }
12812 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
12813 {
12814 cout<<endl;
12815 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
12816 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12817 cout<<endl;
12818 exit(0);
12819 }
b3dacf6b 12820
b92ea2b9 12821 // NUA stuff:
12822 for(Int_t sc=0;sc<2;sc++) // sin/cos
12823 {
12824 if(!fIntFlowCorrectionTermsForNUAPro[sc])
12825 {
12826 cout<<endl;
12827 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12828 cout<<endl;
12829 exit(0);
12830 }
12831 if(!fIntFlowCorrectionTermsForNUAHist[sc])
12832 {
12833 cout<<endl;
12834 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12835 cout<<endl;
12836 exit(0);
12837 }
12838 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12839 {
12840 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
12841 {
12842 cout<<endl;
12843 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
12844 cout<<endl;
12845 exit(0);
12846 }
12847 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12848 } // end of for(Int_t power=0;power<2;power++)
12849 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
12850 {
12851 cout<<endl;
12852 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12853 cout<<endl;
12854 exit(0);
12855 }
12856 if(!fIntFlowSumOfProductOfEventWeightsNUA)
12857 {
12858 cout<<endl;
12859 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12860 cout<<endl;
12861 exit(0);
12862 }
12863 if(!fIntFlowCovariancesNUA)
12864 {
12865 cout<<endl;
12866 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12867 cout<<endl;
12868 exit(0);
12869 }
12870 if(!fIntFlowQcumulantsErrorSquaredRatio)
12871 {
12872 cout<<endl;
12873 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12874 cout<<endl;
12875 exit(0);
12876 }
12877 if(!fIntFlowDetectorBias)
12878 {
12879 cout<<endl;
12880 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12881 cout<<endl;
12882 exit(0);
12883 }
12884
b3dacf6b 12885 // Versus multiplicity:
12886 if(!fCalculateCumulantsVsM){return;}
b77b6434 12887 for(Int_t co=0;co<=3;co++) // cumulant order
b3dacf6b 12888 {
b77b6434 12889 if(!fIntFlowQcumulantsVsM[co])
b3dacf6b 12890 {
12891 cout<<endl;
b77b6434 12892 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
b3dacf6b 12893 cout<<endl;
12894 exit(0);
12895 }
b77b6434 12896 if(!fIntFlowVsM[co])
b3dacf6b 12897 {
12898 cout<<endl;
b77b6434 12899 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12900 cout<<endl;
12901 exit(0);
12902 }
12903 if(!fIntFlowDetectorBiasVsM[co])
12904 {
12905 cout<<endl;
12906 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
12907 cout<<endl;
12908 exit(0);
12909 }
12910 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
12911 for(Int_t ci=0;ci<=3;ci++) // correlation index
12912 {
12913 if(!fIntFlowCorrelationsVsMPro[ci])
12914 {
12915 cout<<endl;
12916 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b3dacf6b 12917 cout<<endl;
12918 exit(0);
12919 }
b40a910e 12920 if(!fIntFlowSquaredCorrelationsVsMPro[ci])
12921 {
12922 cout<<endl;
12923 cout<<Form(" WARNING (QC): fIntFlowSquaredCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
12924 cout<<endl;
12925 exit(0);
12926 }
b77b6434 12927 if(!fIntFlowCorrelationsVsMHist[ci])
b92ea2b9 12928 {
12929 cout<<endl;
b77b6434 12930 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
b92ea2b9 12931 cout<<endl;
12932 exit(0);
12933 }
b3dacf6b 12934 for(Int_t power=0;power<2;power++)
12935 {
12936 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
12937 {
12938 cout<<endl;
12939 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
12940 cout<<endl;
12941 exit(0);
12942 }
12943 } // end of for(Int_t power=0;power<2;power++)
12944 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
12945 for(Int_t i=0;i<6;i++)
12946 {
12947 if(!fIntFlowProductOfCorrelationsVsMPro[i])
12948 {
12949 cout<<endl;
12950 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12951 cout<<endl;
12952 exit(0);
12953 }
12954 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
12955 {
12956 cout<<endl;
12957 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12958 cout<<endl;
12959 exit(0);
12960 }
12961 if(!fIntFlowCovariancesVsM[i])
12962 {
12963 cout<<endl;
12964 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12965 cout<<endl;
12966 exit(0);
12967 }
12968 } // end of for(Int_t i=0;i<6;i++)
12969 if(!fIntFlowRebinnedInM)
12970 {
12971 cout<<endl;
12972 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12973 cout<<endl;
12974 exit(0);
12975 }
12976 if(!fIntFlowQcumulantsRebinnedInM)
12977 {
12978 cout<<endl;
12979 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12980 cout<<endl;
12981 exit(0);
12982 }
12983
12984} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12985
12986//================================================================================================================================
12987
12988void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
12989{
1268c371 12990 // Check all pointers used in method Make(). // to be improved - check other pointers as well
b3dacf6b 12991
b77b6434 12992 if(!fAvMultiplicity)
12993 {
1268c371 12994 printf("\n WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 12995 exit(0);
12996 }
12997 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12998 {
1268c371 12999 printf("\n WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!\n\n");
b77b6434 13000 exit(0);
13001 }
1268c371 13002 // 2D:
13003 if(fCalculate2DDiffFlow)
13004 {
13005 for(Int_t t=0;t<2;t++) // type = RP or POI
13006 {
13007 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
13008 {
13009 if(!f2DDiffFlowCorrelationsPro[t][rci])
13010 {
13011 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in CheckPointersUsedInMake() !!!!\n\n",t,rci);
13012 exit(0);
13013 } // end of if(!f2DDiffFlowCorrelationsPro[t][rci])
13014 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
13015 } // end of for(Int_t t=0;t<2;t++)
13016 } // end of if(fCalculate2DDiffFlow)
b3dacf6b 13017
13018} // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
13019
57340a27 13020