]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
allow for rebinning phi weights
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithQCumulants.cxx
CommitLineData
489d5531 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/**********************************
17 * flow analysis with Q-cumulants *
18 * *
ff70ca91 19 * author: Ante Bilandzic *
20 * (abilandzic@gmail.com) *
489d5531 21 *********************************/
22
23#define AliFlowAnalysisWithQCumulants_cxx
24
25#include "Riostream.h"
26#include "AliFlowCommonConstants.h"
27#include "AliFlowCommonHist.h"
28#include "AliFlowCommonHistResults.h"
29#include "TChain.h"
30
31#include "TFile.h"
32#include "TList.h"
33#include "TGraph.h"
34#include "TParticle.h"
35#include "TRandom3.h"
36#include "TStyle.h"
37#include "TProfile.h"
38#include "TProfile2D.h"
39#include "TProfile3D.h"
40#include "TMath.h"
41#include "TArrow.h"
42#include "TPaveLabel.h"
43#include "TCanvas.h"
44#include "AliFlowEventSimple.h"
45#include "AliFlowTrackSimple.h"
46#include "AliFlowAnalysisWithQCumulants.h"
47#include "TArrayD.h"
48#include "TRandom.h"
49#include "TF1.h"
50
51class TH1;
52class TH2;
53class TGraph;
54class TPave;
55class TLatex;
56class TMarker;
57class TRandom3;
58class TObjArray;
59class TList;
60class TCanvas;
61class TSystem;
62class TROOT;
63class AliFlowVector;
64class TVector;
65
66
67//================================================================================================================
68
69
70ClassImp(AliFlowAnalysisWithQCumulants)
71
72AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
73 // 0.) base:
74 fHistList(NULL),
75 // 1.) common:
76 fCommonHists(NULL),
77 fCommonHists2nd(NULL),
78 fCommonHists4th(NULL),
79 fCommonHists6th(NULL),
80 fCommonHists8th(NULL),
81 fCommonHistsResults2nd(NULL),
82 fCommonHistsResults4th(NULL),
83 fCommonHistsResults6th(NULL),
84 fCommonHistsResults8th(NULL),
85 fnBinsPhi(0),
86 fPhiMin(0),
87 fPhiMax(0),
88 fPhiBinWidth(0),
89 fnBinsPt(0),
90 fPtMin(0),
91 fPtMax(0),
92 fPtBinWidth(0),
93 fnBinsEta(0),
94 fEtaMin(0),
95 fEtaMax(0),
96 fEtaBinWidth(0),
97 fHarmonic(2),
98 fAnalysisLabel(NULL),
99 // 2a.) particle weights:
100 fWeightsList(NULL),
101 fUsePhiWeights(kFALSE),
102 fUsePtWeights(kFALSE),
103 fUseEtaWeights(kFALSE),
104 fUseParticleWeights(NULL),
105 fPhiWeights(NULL),
106 fPtWeights(NULL),
107 fEtaWeights(NULL),
108 // 2b.) event weights:
109 fMultiplicityWeight(NULL),
110 // 3.) integrated flow:
111 fIntFlowList(NULL),
112 fIntFlowProfiles(NULL),
113 fIntFlowResults(NULL),
114 fIntFlowFlags(NULL),
9da1a4f3 115 fApplyCorrectionForNUA(kTRUE),
2001bc3a 116 fApplyCorrectionForNUAVsM(kFALSE),
9da1a4f3 117 fnBinsMult(10000),
067e9bc8 118 fMinMult(0.),
119 fMaxMult(10000.),
489d5531 120 fReQ(NULL),
121 fImQ(NULL),
122 fSMpk(NULL),
123 fIntFlowCorrelationsEBE(NULL),
124 fIntFlowEventWeightsForCorrelationsEBE(NULL),
125 fIntFlowCorrelationsAllEBE(NULL),
126 fAvMultiplicity(NULL),
127 fIntFlowCorrelationsPro(NULL),
128 fIntFlowCorrelationsAllPro(NULL),
129 fIntFlowExtraCorrelationsPro(NULL),
130 fIntFlowProductOfCorrelationsPro(NULL),
0328db2d 131 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
489d5531 132 fIntFlowCorrelationsHist(NULL),
133 fIntFlowCorrelationsAllHist(NULL),
134 fIntFlowCovariances(NULL),
135 fIntFlowSumOfProductOfEventWeights(NULL),
0328db2d 136 fIntFlowCovariancesNUA(NULL),
137 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
489d5531 138 fIntFlowQcumulants(NULL),
139 fIntFlow(NULL),
2001bc3a 140 fIntFlowDetectorBias(NULL),
489d5531 141 // 4.) differential flow:
142 fDiffFlowList(NULL),
143 fDiffFlowProfiles(NULL),
144 fDiffFlowResults(NULL),
145 fDiffFlowFlags(NULL),
146 fCalculate2DFlow(kFALSE),
147 // 5.) distributions:
57340a27 148 fDistributionsList(NULL),
149 fDistributionsFlags(NULL),
489d5531 150 fStoreDistributions(kFALSE),
151 // x.) debugging and cross-checking:
152 fNestedLoopsList(NULL),
153 fEvaluateIntFlowNestedLoops(kFALSE),
154 fEvaluateDiffFlowNestedLoops(kFALSE),
155 fMaxAllowedMultiplicity(10),
156 fEvaluateNestedLoops(NULL),
157 fIntFlowDirectCorrelations(NULL),
158 fIntFlowExtraDirectCorrelations(NULL),
159 fCrossCheckInPtBinNo(10),
3b552efe 160 fCrossCheckInEtaBinNo(20),
489d5531 161 fNoOfParticlesInBin(NULL)
162 {
163 // constructor
164
165 // base list to hold all output objects:
166 fHistList = new TList();
167 fHistList->SetName("cobjQC");
168 fHistList->SetOwner(kTRUE);
169
170 // list to hold histograms with phi, pt and eta weights:
171 fWeightsList = new TList();
172
173 // multiplicity weight:
174 fMultiplicityWeight = new TString("combinations");
175
176 // analysis label;
177 fAnalysisLabel = new TString();
178
179 // initialize all arrays:
180 this->InitializeArraysForIntFlow();
181 this->InitializeArraysForDiffFlow();
182 this->InitializeArraysForDistributions();
183 this->InitializeArraysForNestedLoops();
184
185 } // end of constructor
186
187
188//================================================================================================================
189
190
191AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
192{
193 // destructor
194
195 delete fHistList;
196
197} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
198
199
200//================================================================================================================
201
202
203void AliFlowAnalysisWithQCumulants::Init()
204{
3b552efe 205 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 206 // b) Access all common constants;
207 // c) Book all objects;
3b552efe 208 // d) Store flags for integrated and differential flow;
489d5531 209 // e) Store flags for distributions of corelations;
210 // f) Store harmonic which will be estimated.
3b552efe 211
489d5531 212 //save old value and prevent histograms from being added to directory
213 //to avoid name clashes in case multiple analaysis objects are used
214 //in an analysis
215 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
216 TH1::AddDirectory(kFALSE);
217
3b552efe 218 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 219 this->CrossCheckSettings();
220 // b) Access all common constants:
221 this->AccessConstants();
222 // c) Book all objects:
223 this->BookAndFillWeightsHistograms();
224 this->BookAndNestAllLists();
225 this->BookCommonHistograms();
226 this->BookEverythingForIntegratedFlow();
227 this->BookEverythingForDifferentialFlow();
228 this->BookEverythingForDistributions();
229 this->BookEverythingForNestedLoops();
230 // d) Store flags for integrated and differential flow:
231 this->StoreIntFlowFlags();
3b552efe 232 this->StoreDiffFlowFlags();
489d5531 233 // e) Store flags for distributions of corelations:
234 this->StoreFlagsForDistributions();
235 // f) Store harmonic which will be estimated:
236 this->StoreHarmonic();
237
238 TH1::AddDirectory(oldHistAddStatus);
239} // end of void AliFlowAnalysisWithQCumulants::Init()
240
241
242//================================================================================================================
243
244
245void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
246{
247 // Running over data only in this method.
248
249 // a) Fill the common control histograms and call the method to fill fAvMultiplicity;
250 // b) Loop over data and calculate e-b-e quantities;
251 // c) Call all the methods;
252 // d) Debugging and cross-checking (evaluate nested loops);
253 // e) Reset all event by event quantities.
254
255 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
256 Double_t dPt = 0.; // transverse momentum
257 Double_t dEta = 0.; // pseudorapidity
258
259 Double_t wPhi = 1.; // phi weight
260 Double_t wPt = 1.; // pt weight
261 Double_t wEta = 1.; // eta weight
262
263 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9f33751d 264
489d5531 265 // a) Fill the common control histograms and call the method to fill fAvMultiplicity:
266 this->FillCommonControlHistograms(anEvent);
267 this->FillAverageMultiplicities(nRP);
268
269 // b) Loop over data and calculate e-b-e quantities:
9f33751d 270 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
489d5531 271 // nRP = # of particles used to determine the reaction plane;
272 // nPOI = # of particles of interest for a detailed flow analysis;
489d5531 273
274 AliFlowTrackSimple *aftsTrack = NULL;
275
276 for(Int_t i=0;i<nPrim;i++)
277 {
278 aftsTrack=anEvent->GetTrack(i);
279 if(aftsTrack)
280 {
281 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
282 Int_t n = fHarmonic; // shortcut for the harmonic
283 if(aftsTrack->InRPSelection()) // RP condition:
284 {
285 dPhi = aftsTrack->Phi();
286 dPt = aftsTrack->Pt();
287 dEta = aftsTrack->Eta();
288 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
289 {
290 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
291 }
292 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
293 {
294 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
295 }
296 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
297 {
298 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
299 }
300
301 // integrated flow:
302 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
303 for(Int_t m=0;m<4;m++)
304 {
305 for(Int_t k=0;k<9;k++)
306 {
307 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
308 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
309 }
310 }
311 // calculate S^{M}_{p,k} for this event
312 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
313 for(Int_t p=0;p<8;p++)
314 {
315 for(Int_t k=0;k<9;k++)
316 {
317 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
318 }
319 }
320
321 // differential flow:
322 // 1D (pt):
323 // (r_{m*m,k}(pt)):
324 for(Int_t m=0;m<4;m++)
325 {
326 for(Int_t k=0;k<9;k++)
327 {
328 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
329 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
330 }
331 }
332
333 // s_{k}(pt) for RPs // to be improved (clarified)
334 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
335 for(Int_t k=0;k<9;k++)
336 {
337 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
338 }
339 // 1D (eta):
340 // (r_{m*m,k}(eta)):
341 for(Int_t m=0;m<4;m++)
342 {
343 for(Int_t k=0;k<9;k++)
344 {
345 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
346 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
347 }
348 }
349 // s_{k}(eta) for RPs // to be improved (clarified)
350 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
351 for(Int_t k=0;k<9;k++)
352 {
353 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
354 }
355
356
357
358 /*
359 // 2D (pt,eta):
360 if(fCalculate2DFlow)
361 {
362 // (r_{m*m,k}(pt,eta)):
363 for(Int_t m=0;m<4;m++)
364 {
365 for(Int_t k=0;k<9;k++)
366 {
367 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
368 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
369 }
370 }
371 // s_{k}(pt,eta) for RPs // to be improved (clarified)
372 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
373 for(Int_t k=0;k<9;k++)
374 {
375 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
376 }
377 } // end of if(fCalculate2DFlow)
378 */
379
380
381
382 if(aftsTrack->InPOISelection())
383 {
384 // 1D (pt):
385 // (q_{m*m,k}(pt)):
386 for(Int_t m=0;m<4;m++)
387 {
388 for(Int_t k=0;k<9;k++)
389 {
390 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
391 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
392 }
393 }
394 // s_{k}(pt) for RP&&POIs // to be improved (clarified)
395 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
396 for(Int_t k=0;k<9;k++)
397 {
398 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
399 }
400 // 1D (eta):
401 // (q_{m*m,k}(eta)):
402 for(Int_t m=0;m<4;m++)
403 {
404 for(Int_t k=0;k<9;k++)
405 {
406 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
407 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
408 }
409 }
410 // s_{k}(eta) for RP&&POIs // to be improved (clarified)
411 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
412 for(Int_t k=0;k<9;k++)
413 {
414 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
415 }
416
417 /*
418 // 2D (pt,eta)
419 if(fCalculate2DFlow)
420 {
421 // (q_{m*m,k}(pt,eta)):
422 for(Int_t m=0;m<4;m++)
423 {
424 for(Int_t k=0;k<9;k++)
425 {
426 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
427 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
428 }
429 }
430 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
431 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
432 for(Int_t k=0;k<9;k++)
433 {
434 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
435 }
436 } // end of if(fCalculate2DFlow)
437 */
438
439 } // end of if(aftsTrack->InPOISelection())
440
441
442
443 } // end of if(pTrack->InRPSelection())
444
445
446
447 if(aftsTrack->InPOISelection())
448 {
449 dPhi = aftsTrack->Phi();
450 dPt = aftsTrack->Pt();
451 dEta = aftsTrack->Eta();
452
453 // 1D (pt)
454 // p_n(m*n,0):
455 for(Int_t m=0;m<4;m++)
456 {
457 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
458 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
459 }
460 // 1D (eta)
461 // p_n(m*n,0):
462 for(Int_t m=0;m<4;m++)
463 {
464 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
465 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
466 }
467
468
469 /*
470 // 2D (pt,eta):
471 if(fCalculate2DFlow)
472 {
473 // p_n(m*n,0):
474 for(Int_t m=0;m<4;m++)
475 {
476 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
477 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
478 }
479 } // end of if(fCalculate2DFlow)
480 */
481
482
483 } // end of if(pTrack->InPOISelection() )
484
485
486 } else // to if(aftsTrack)
487 {
488 cout<<endl;
489 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
490 cout<<endl;
491 }
492 } // end of for(Int_t i=0;i<nPrim;i++)
493
494 // calculate the final expressions for S^{M}_{p,k}:
495 for(Int_t p=0;p<8;p++)
496 {
497 for(Int_t k=0;k<9;k++)
498 {
499 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
500 }
501 }
502
503 // *****************************
504 // **** CALL THE METHODS *******
505 // *****************************
506 // integrated flow:
507 if(!fEvaluateIntFlowNestedLoops)
508 {
509 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
510 {
511 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights
0328db2d 512 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 513 {
514 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights
515 }
516
517 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();
518 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();
519 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();
520 if(fApplyCorrectionForNUA)
521 {
57340a27 522 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
523 {
489d5531 524 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();
525 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();
57340a27 526 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
527 {
489d5531 528 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();
57340a27 529 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
530 }
0328db2d 531
532 if(nRP>0) this->CalculateIntFlowProductOfCorrectionTermsForNUA();
533 if(nRP>0) this->CalculateIntFlowSumOfEventWeightsNUA();
534 if(nRP>0) this->CalculateIntFlowSumOfProductOfEventWeightsNUA();
489d5531 535 } // end of if(fApplyCorrectionForNUA)
536 } // end of if(!fEvaluateIntFlowNestedLoops)
537
538 // differential flow:
539 if(!fEvaluateDiffFlowNestedLoops)
540 {
541 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
542 {
543 // without using particle weights:
544 this->CalculateDiffFlowCorrelations("RP","Pt");
545 this->CalculateDiffFlowCorrelations("RP","Eta");
546 this->CalculateDiffFlowCorrelations("POI","Pt");
57340a27 547 this->CalculateDiffFlowCorrelations("POI","Eta");
548 if(fApplyCorrectionForNUA)
549 {
489d5531 550 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
551 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
552 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
553 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
554 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
555 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
556 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
57340a27 557 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
489d5531 558 } // end of if(fApplyCorrectionForNUA)
559 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
560 {
561 // with using particle weights:
562 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
563 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
564 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
565 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
57340a27 566 if(fApplyCorrectionForNUA)
567 {
489d5531 568 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
569 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
570 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
571 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
572 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
573 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
574 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
57340a27 575 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
489d5531 576 } // end of if(fApplyCorrectionForNUA)
577 }
57340a27 578
489d5531 579 // whether or not using particle weights the following is calculated in the same way:
580 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
581 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
582 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
583 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
584 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
585 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
586 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
587 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
588 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
589 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
590 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
591 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
592 } // end of if(!fEvaluateDiffFlowNestedLoops)
593
594
595
596 // with weights:
597 // ...
598
599 /*
600 // 2D differential flow
601 if(fCalculate2DFlow)
602 {
603 // without weights:
604 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
605 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
606
607 // with weights:
608 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
609 {
610 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
611 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
612 }
613 } // end of if(fCalculate2DFlow)
614 */
57340a27 615
616 // distributions of correlations:
617 if(fStoreDistributions)
618 {
619 this->StoreDistributionsOfCorrelations();
620 }
489d5531 621
622 // d) Debugging and cross-checking (evaluate nested loops):
623 // d1) cross-checking results for integrated flow:
624 if(fEvaluateIntFlowNestedLoops)
625 {
626 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
627 {
628 // without using particle weights:
629 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
630 {
631 // correlations:
632 this->CalculateIntFlowCorrelations(); // from Q-vectors
633 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
634 // correction for non-uniform acceptance:
635 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
636 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
637 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
638 }
639 // using particle weights:
640 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
641 {
642 // correlations:
643 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
644 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
645 // correction for non-uniform acceptance:
646 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
647 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
57340a27 648 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
489d5531 649 }
650 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
651 {
652 cout<<endl;
653 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
654 } else
655 {
656 cout<<endl;
657 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
658 }
659 } // end of if(fEvaluateIntFlowNestedLoops)
660
661 // d2) cross-checking results for differential flow:
662 if(fEvaluateDiffFlowNestedLoops)
663 {
664 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
665 {
666 // without using particle weights:
667 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
668 {
669 // reduced correlations:
670 // Q-vectors:
671 this->CalculateDiffFlowCorrelations("RP","Pt");
672 this->CalculateDiffFlowCorrelations("RP","Eta");
673 this->CalculateDiffFlowCorrelations("POI","Pt");
674 this->CalculateDiffFlowCorrelations("POI","Eta");
675 // nested loops:
676 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
677 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
678 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
679 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
680 // reduced corrections for non-uniform acceptance:
681 // Q-vectors:
682 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
683 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
684 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
685 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
686 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
687 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
688 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
689 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
690 // nested loops:
691 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
692 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
693 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
694 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
695 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
696 // using particle weights:
697 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
698 {
699 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
700 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
701 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
702 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
703 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
704 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
705 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
706 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
707 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
708 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
709 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
710 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
711 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
712 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
713 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
3b552efe 714 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
489d5531 715 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
716 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
717 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
718 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
719 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
720 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
721 } // end of if(fEvaluateDiffFlowNestedLoops)
722
723 // e) Reset all event by event quantities:
724 this->ResetEventByEventQuantities();
725
726} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
727
728
729//================================================================================================================================
730
731
732void AliFlowAnalysisWithQCumulants::Finish()
733{
6fbbbbf1 734
735
736 cout<<endl;
737 cout<<"QC"<<endl;
738 for(Int_t b=1;b<=10;b++)
739 {
740 cout<<"b = "<<b<<": "<<fDiffFlowCorrelationsPro[1][0][0]
741->GetBinContent(b)<<endl;
742 }
743
744
745
746
747
489d5531 748 // Calculate the final results.
749 // a) acces the constants;
750 // b) access the flags;
751 // c) calculate the final results for integrated flow (without and with weights);
752 // d) store in AliFlowCommonHistResults and print the final results for integrated flow;
753 // e) calculate the final results for differential flow (without and with weights);
754 // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));
755 // g) cross-check the results: results from Q-vectors vs results from nested loops
756
757 // ******************************
758 // **** ACCESS THE CONSTANTS ****
759 // ******************************
760
761 this->AccessConstants();
762
763 if(fCommonHists && fCommonHists->GetHarmonic())
764 {
765 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1); // to be improved (moved somewhere else)
766 }
767
768 // **************************
ff70ca91 769 // **** ACCESS THE FLAGS **** // to be improved (moved somewhere else)
489d5531 770 // **************************
771 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
772 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
773 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
3b552efe 774 fApplyCorrectionForNUA = (Int_t)fIntFlowFlags->GetBinContent(3);
489d5531 775 fPrintFinalResults[0] = (Int_t)fIntFlowFlags->GetBinContent(4);
776 fPrintFinalResults[1] = (Int_t)fIntFlowFlags->GetBinContent(5);
777 fPrintFinalResults[2] = (Int_t)fIntFlowFlags->GetBinContent(6);
2001bc3a 778 fApplyCorrectionForNUAVsM = (Int_t)fIntFlowFlags->GetBinContent(7);
489d5531 779 fEvaluateIntFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(1);
780 fEvaluateDiffFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(2);
781 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
782 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
783
784 // *********************************************************
785 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****
786 // *********************************************************
787
788 this->FinalizeCorrelationsIntFlow();
789 this->CalculateCovariancesIntFlow();
790 this->CalculateCumulantsIntFlow();
791 this->CalculateIntFlow();
792
793 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
794 {
795 this->FinalizeCorrectionTermsForNUAIntFlow();
067e9bc8 796 // this->CalculateCovariancesNUAIntFlow(); // to be improved (enabled eventually)
489d5531 797 this->CalculateQcumulantsCorrectedForNUAIntFlow();
798 this->CalculateIntFlowCorrectedForNUA();
2001bc3a 799 this->CalculateDetectorEffectsForTrueCorrelations();
489d5531 800 }
801
802 // ***************************************************************
803 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****
804 // ***************************************************************
805
806 this->FillCommonHistResultsIntFlow();
807
3b552efe 808 if(fPrintFinalResults[0])
809 {
2001bc3a 810 this->PrintFinalResultsForIntegratedFlow("RF");
489d5531 811 }
812
813 // ***********************************************************
814 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
815 // ***********************************************************
816
817 this->FinalizeReducedCorrelations("RP","Pt");
818 this->FinalizeReducedCorrelations("RP","Eta");
819 this->FinalizeReducedCorrelations("POI","Pt");
820 this->FinalizeReducedCorrelations("POI","Eta");
821 this->CalculateDiffFlowCovariances("RP","Pt");
822 this->CalculateDiffFlowCovariances("RP","Eta");
823 this->CalculateDiffFlowCovariances("POI","Pt");
824 this->CalculateDiffFlowCovariances("POI","Eta");
825 this->CalculateDiffFlowCumulants("RP","Pt");
826 this->CalculateDiffFlowCumulants("RP","Eta");
827 this->CalculateDiffFlowCumulants("POI","Pt");
828 this->CalculateDiffFlowCumulants("POI","Eta");
829 this->CalculateDiffFlow("RP","Pt");
830 this->CalculateDiffFlow("RP","Eta");
831 this->CalculateDiffFlow("POI","Pt");
832 this->CalculateDiffFlow("POI","Eta");
833
834 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
835 {
836 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
837 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
838 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
839 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
840 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
841 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
842 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
843 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
844 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
845 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
846 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
847 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
3b552efe 848 }
489d5531 849
850 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
851 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
852
853 // *****************************************************************
854 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
855 // *****************************************************************
856 this->FillCommonHistResultsDiffFlow("RP");
857 this->FillCommonHistResultsDiffFlow("POI");
858
3b552efe 859 if(fPrintFinalResults[1])
860 {
489d5531 861 this->PrintFinalResultsForIntegratedFlow("RP");
3b552efe 862 }
863 if(fPrintFinalResults[2])
864 {
489d5531 865 this->PrintFinalResultsForIntegratedFlow("POI");
866 }
867 // g) cross-check the results: results from Q-vectors vs results from nested loops
868
869 // g1) integrated flow:
870 if(fEvaluateIntFlowNestedLoops)
871 {
872 this->CrossCheckIntFlowCorrelations();
873 this->CrossCheckIntFlowCorrectionTermsForNUA();
874 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations();
875 } // end of if(fEvaluateIntFlowNestedLoops)
876
877 // g2) differential flow:
878 if(fEvaluateDiffFlowNestedLoops)
879 {
3b552efe 880 // correlations:
489d5531 881 this->PrintNumberOfParticlesInSelectedBin();
882 this->CrossCheckDiffFlowCorrelations("RP","Pt");
883 this->CrossCheckDiffFlowCorrelations("RP","Eta");
884 this->CrossCheckDiffFlowCorrelations("POI","Pt");
885 this->CrossCheckDiffFlowCorrelations("POI","Eta");
886 // correction terms for non-uniform acceptance:
887 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
888 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
889 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
890 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
891 } // end of if(fEvaluateDiffFlowNestedLoops)
892
893} // end of AliFlowAnalysisWithQCumulants::Finish()
894
895
896//================================================================================================================================
897
898
899void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
900{
901 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
902
903 // multiplicity:
904 Double_t dMult = (*fSMpk)(0,0);
905
906 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
907 Double_t dReQ1n = (*fReQ)(0,0);
908 Double_t dReQ2n = (*fReQ)(1,0);
909 //Double_t dReQ3n = (*fReQ)(2,0);
910 //Double_t dReQ4n = (*fReQ)(3,0);
911 Double_t dImQ1n = (*fImQ)(0,0);
912 Double_t dImQ2n = (*fImQ)(1,0);
913 //Double_t dImQ3n = (*fImQ)(2,0);
914 //Double_t dImQ4n = (*fImQ)(3,0);
915
916 // *************************************************************
917 // **** corrections for non-uniform acceptance (cos terms): ****
918 // *************************************************************
919 //
920 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
921 // are stored in 1D profile fQCorrectionsCos.
922 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
923 // --------------------------------------------------------------------------------------------------------------------
924 // 1st bin: <<cos(n*(phi1))>> = cosP1n
925 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
926 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
927 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
928 // --------------------------------------------------------------------------------------------------------------------
929
930 // 1-particle:
931 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
932
933 if(dMult>0)
934 {
935 cosP1n = dReQ1n/dMult;
936
937 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
938 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
0328db2d 939 // event weights for NUA terms:
940 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
489d5531 941
942 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
943 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
2001bc3a 944 fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);
489d5531 945 }
946
947 // 2-particle:
3b552efe 948 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
489d5531 949 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
950
951 if(dMult>1)
952 {
953 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
954 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
955
956 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
3b552efe 957 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
489d5531 958 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
0328db2d 959 // event weights for NUA terms:
960 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
961 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
962
489d5531 963 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
3b552efe 964 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
489d5531 965 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
2001bc3a 966 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
967 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
489d5531 968 }
969
970 // 3-particle:
971 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
972
973 if(dMult>2)
974 {
975 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
976 / (dMult*(dMult-1)*(dMult-2));
977
978 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
979 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
0328db2d 980 // event weights for NUA terms:
981 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 982
983 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
2001bc3a 984 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
985 fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
489d5531 986 }
987
988} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
989
990
991//================================================================================================================================
992
993
994void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
995{
996 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
997
998 // multiplicity:
999 Double_t dMult = (*fSMpk)(0,0);
1000
1001 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1002 Double_t dReQ1n = (*fReQ)(0,0);
1003 Double_t dReQ2n = (*fReQ)(1,0);
1004 //Double_t dReQ3n = (*fReQ)(2,0);
1005 //Double_t dReQ4n = (*fReQ)(3,0);
1006 Double_t dImQ1n = (*fImQ)(0,0);
1007 Double_t dImQ2n = (*fImQ)(1,0);
1008 //Double_t dImQ3n = (*fImQ)(2,0);
1009 //Double_t dImQ4n = (*fImQ)(3,0);
1010
1011 // *************************************************************
1012 // **** corrections for non-uniform acceptance (sin terms): ****
1013 // *************************************************************
1014 //
1015 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
1016 // are stored in 1D profile fQCorrectionsSin.
1017 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
1018 // --------------------------------------------------------------------------------------------------------------------
1019 // 1st bin: <<sin(n*(phi1))>> = sinP1n
1020 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1021 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1022 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1023 // --------------------------------------------------------------------------------------------------------------------
1024
1025 // 1-particle:
1026 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1027
1028 if(dMult>0)
1029 {
1030 sinP1n = dImQ1n/dMult;
1031
1032 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
0328db2d 1033 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1034 // event weights for NUA terms:
1035 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
489d5531 1036
1037 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1038 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
2001bc3a 1039 fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);
489d5531 1040 }
1041
1042 // 2-particle:
1043 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1044 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1045 if(dMult>1)
1046 {
3b552efe 1047 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
489d5531 1048 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1049
1050 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1051 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
3b552efe 1052 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
0328db2d 1053 // event weights for NUA terms:
1054 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1055 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
489d5531 1056
1057 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1058 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1059 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
2001bc3a 1060 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1061 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
489d5531 1062 }
1063
1064 // 3-particle:
1065 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1066
1067 if(dMult>2)
1068 {
1069 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1070 / (dMult*(dMult-1)*(dMult-2));
1071
1072 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1073 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
0328db2d 1074 // event weights for NUA terms:
1075 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1076
1077 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
2001bc3a 1078 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1079 fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
489d5531 1080 }
1081
1082} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1083
1084
1085//================================================================================================================================
1086
1087
1088void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1089{
1090 // a) Get pointers for common control and common result histograms and profiles.
1091 // b) Get pointers for histograms with particle weights.
1092 // c) Get pointers for histograms and profiles relevant for integrated flow.
1093 // d) Get pointers for histograms and profiles relevant for differental flow.
1094 // e) Get pointers for histograms and profiles holding results obtained with nested loops.
1095
1096 if(outputListHistos)
3b552efe 1097 {
1098 this->SetHistList(outputListHistos);
1099 if(!fHistList)
1100 {
1101 cout<<endl;
1102 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1103 cout<<endl;
1104 exit(0);
489d5531 1105 }
1106 this->GetPointersForCommonHistograms();
1107 this->GetPointersForParticleWeightsHistograms();
1108 this->GetPointersForIntFlowHistograms();
1109 this->GetPointersForDiffFlowHistograms();
1110 this->GetPointersForNestedLoopsHistograms();
3b552efe 1111 } else
1112 {
1113 cout<<endl;
1114 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1115 cout<<endl;
1116 exit(0);
489d5531 1117 }
1118
1119} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
ad87ae62 1120
1121
489d5531 1122//================================================================================================================================
1123
1124
1125TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
ad87ae62 1126{
489d5531 1127 // project 2D profile onto pt axis to get 1D profile
1128
1129 Int_t nBinsPt = profilePtEta->GetNbinsX();
1130 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1131 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1132
1133 Int_t nBinsEta = profilePtEta->GetNbinsY();
1134
1135 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1136
1137 for(Int_t p=1;p<=nBinsPt;p++)
1138 {
1139 Double_t contentPt = 0.;
1140 Double_t entryPt = 0.;
1141 Double_t spreadPt = 0.;
1142 Double_t sum1 = 0.;
1143 Double_t sum2 = 0.;
1144 Double_t sum3 = 0.;
1145 for(Int_t e=1;e<=nBinsEta;e++)
1146 {
1147 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1148 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1149 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1150
1151 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1152 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1153 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1154 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1155 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1156 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1157 }
1158 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1159 {
1160 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1161 }
1162 profilePt->SetBinContent(p,contentPt);
1163 profilePt->SetBinEntries(p,entryPt);
1164 {
1165 profilePt->SetBinError(p,spreadPt);
1166 }
1167
1168 }
1169
1170 return profilePt;
1171
1172} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1173
1174
1175//================================================================================================================================
1176
1177
1178TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1179{
1180 // project 2D profile onto eta axis to get 1D profile
1181
1182 Int_t nBinsEta = profilePtEta->GetNbinsY();
1183 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1184 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1185
1186 Int_t nBinsPt = profilePtEta->GetNbinsX();
1187
1188 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1189
1190 for(Int_t e=1;e<=nBinsEta;e++)
1191 {
1192 Double_t contentEta = 0.;
1193 Double_t entryEta = 0.;
1194 for(Int_t p=1;p<=nBinsPt;p++)
1195 {
1196 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1197 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1198 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1199 }
1200 profileEta->SetBinContent(e,contentEta);
1201 profileEta->SetBinEntries(e,entryEta);
1202 }
1203
1204 return profileEta;
1205
1206} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1207
489d5531 1208//================================================================================================================================
1209
489d5531 1210void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1211{
2001bc3a 1212 // Printing on the screen the final results for integrated flow (RF, POI and RP).
489d5531 1213
1214 Int_t n = fHarmonic;
1215
2001bc3a 1216 if(type == "RF" || type == "RP" || type == "POI")
489d5531 1217 {
2001bc3a 1218 if(!(fCommonHists && fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
489d5531 1219 {
2001bc3a 1220 cout<<"WARNING: fCommonHistsResults && fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
489d5531 1221 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;
1222 }
1223 } else
1224 {
2001bc3a 1225 cout<<"WARNING: type is not from {RF, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;
489d5531 1226 exit(0);
1227 }
1228
1229 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1230 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1231
2001bc3a 1232 if(type == "RF")
489d5531 1233 {
1234 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1235 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1236 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1237 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1238 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1239 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1240 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1241 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1242 } else if(type == "RP")
1243 {
1244 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1245 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1246 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1247 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1248 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1249 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1250 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1251 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1252 } else if(type == "POI")
1253 {
1254 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1255 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1256 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1257 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1258 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1259 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1260 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1261 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1262 }
1263
1264 TString title = " flow estimates from Q-cumulants";
1265 TString subtitle = " (";
1266
1267 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1268 {
1269 subtitle.Append(type);
1270 subtitle.Append(", without weights)");
1271 } else
1272 {
1273 subtitle.Append(type);
1274 subtitle.Append(", with weights)");
1275 }
1276
1277 cout<<endl;
1278 cout<<"*************************************"<<endl;
1279 cout<<"*************************************"<<endl;
1280 cout<<title.Data()<<endl;
1281 cout<<subtitle.Data()<<endl;
1282 cout<<endl;
1283
1284 for(Int_t i=0;i<4;i++)
1285 {
2001bc3a 1286 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
489d5531 1287 }
2001bc3a 1288
489d5531 1289 cout<<endl;
2001bc3a 1290
1291 if(type == "RF")
489d5531 1292 {
2001bc3a 1293 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1294 }
1295 else if (type == "RP")
1296 {
2001bc3a 1297 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
489d5531 1298 }
1299 else if (type == "POI")
1300 {
2001bc3a 1301 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1302 }
1303
489d5531 1304 cout<<"*************************************"<<endl;
1305 cout<<"*************************************"<<endl;
1306 cout<<endl;
1307
2001bc3a 1308}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
489d5531 1309
1310//================================================================================================================================
1311
489d5531 1312void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1313{
1314 //store the final results in output .root file
1315 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1316 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1317 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1318 delete output;
1319}
1320
1321
1322//================================================================================================================================
1323
1324
1325void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1326{
1327 //store the final results in output .root file
1328 fHistList->SetName("cobjQC");
1329 fHistList->SetOwner(kTRUE);
1330 outputFileName->Add(fHistList);
1331 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1332}
1333
1334
1335//================================================================================================================================
1336
1337
1338void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1339{
1340 // Book common control histograms and common histograms for final results.
1341 // common control histogram (ALL events)
1342 TString commonHistsName = "AliFlowCommonHistQC";
1343 commonHistsName += fAnalysisLabel->Data();
1344 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1345 fHistList->Add(fCommonHists);
1346 // common control histogram (for events with 2 and more particles)
1347 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1348 commonHists2ndOrderName += fAnalysisLabel->Data();
1349 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1350 fHistList->Add(fCommonHists2nd);
1351 // common control histogram (for events with 4 and more particles)
1352 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1353 commonHists4thOrderName += fAnalysisLabel->Data();
1354 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1355 fHistList->Add(fCommonHists4th);
1356 // common control histogram (for events with 6 and more particles)
1357 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1358 commonHists6thOrderName += fAnalysisLabel->Data();
1359 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1360 fHistList->Add(fCommonHists6th);
1361 // common control histogram (for events with 8 and more particles)
1362 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1363 commonHists8thOrderName += fAnalysisLabel->Data();
1364 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1365 fHistList->Add(fCommonHists8th);
1366 // common histograms for final results (calculated for events with 2 and more particles)
1367 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1368 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1369 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1370 fHistList->Add(fCommonHistsResults2nd);
1371 // common histograms for final results (calculated for events with 4 and more particles)
1372 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1373 commonHistResults4thOrderName += fAnalysisLabel->Data();
1374 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1375 fHistList->Add(fCommonHistsResults4th);
1376 // common histograms for final results (calculated for events with 6 and more particles)
1377 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1378 commonHistResults6thOrderName += fAnalysisLabel->Data();
1379 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1380 fHistList->Add(fCommonHistsResults6th);
1381 // common histograms for final results (calculated for events with 8 and more particles)
1382 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1383 commonHistResults8thOrderName += fAnalysisLabel->Data();
1384 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1385 fHistList->Add(fCommonHistsResults8th);
1386
1387} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1388
1389
1390//================================================================================================================================
1391
1392
1393void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1394{
1395 // book and fill histograms which hold phi, pt and eta weights
1396
1397 if(!fWeightsList)
1398 {
1399 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1400 exit(0);
1401 }
1402
1403 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1404 fUseParticleWeightsName += fAnalysisLabel->Data();
1405 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1406 fUseParticleWeights->SetLabelSize(0.06);
1407 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1408 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1409 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1410 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1411 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1412 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1413 fWeightsList->Add(fUseParticleWeights);
1414
1415 if(fUsePhiWeights)
1416 {
1417 if(fWeightsList->FindObject("phi_weights"))
1418 {
1419 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1420 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1421 {
1422 cout<<endl;
1423 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1424 cout<<endl;
6fbbbbf1 1425 //exit(0);
489d5531 1426 }
1427 } else
1428 {
1429 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1430 exit(0);
1431 }
1432 } // end of if(fUsePhiWeights)
1433
1434 if(fUsePtWeights)
1435 {
1436 if(fWeightsList->FindObject("pt_weights"))
1437 {
1438 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1439 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1440 {
1441 cout<<endl;
1442 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1443 cout<<endl;
6fbbbbf1 1444 //exit(0);
489d5531 1445 }
1446 } else
1447 {
1448 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1449 exit(0);
1450 }
1451 } // end of if(fUsePtWeights)
1452
1453 if(fUseEtaWeights)
1454 {
1455 if(fWeightsList->FindObject("eta_weights"))
1456 {
1457 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1458 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1459 {
1460 cout<<endl;
1461 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1462 cout<<endl;
6fbbbbf1 1463 //exit(0);
489d5531 1464 }
1465 } else
1466 {
1467 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1468 exit(0);
1469 }
1470 } // end of if(fUseEtaWeights)
1471
1472} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1473
1474
1475//================================================================================================================================
1476
1477
1478void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1479{
1480 // Book all objects for integrated flow:
1481 // a) Book profile to hold all flags for integrated flow.
1482 // b) Book event-by-event quantities.
1483 // c) Book profiles. // to be improved (comment)
1484 // d) Book histograms holding the final results.
1485
1486 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1487 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1488
1489 // a) Book profile to hold all flags for integrated flow:
1490 TString intFlowFlagsName = "fIntFlowFlags";
1491 intFlowFlagsName += fAnalysisLabel->Data();
2001bc3a 1492 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",7,0,7);
489d5531 1493 fIntFlowFlags->SetTickLength(-0.01,"Y");
1494 fIntFlowFlags->SetMarkerStyle(25);
1495 fIntFlowFlags->SetLabelSize(0.05);
1496 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1497 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1498 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1499 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1500 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print NONAME results");
1501 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
3b552efe 1502 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
2001bc3a 1503 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Corrected for NUA vs M?");
489d5531 1504 fIntFlowList->Add(fIntFlowFlags);
1505
1506 // b) Book event-by-event quantities:
1507 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1508 fReQ = new TMatrixD(4,9);
1509 fImQ = new TMatrixD(4,9);
1510 fSMpk = new TMatrixD(8,9);
1511 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1512 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1513 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1514 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1515 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1516 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1517 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1518 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1519 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1520 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1521 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1522 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);
1523 // average correction terms for non-uniform acceptance for single event
1524 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1525 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1526 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1527 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1528 {
1529 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()),10,0,10);
1530 }
0328db2d 1531 // event weights for terms for non-uniform acceptance:
1532 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1533 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1534 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1535 {
1536 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()),10,0,10);
1537 }
489d5531 1538 // c) Book profiles: // to be improved (comment)
1539 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1540 TString avMultiplicityName = "fAvMultiplicity";
1541 avMultiplicityName += fAnalysisLabel->Data();
1542 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1543 fAvMultiplicity->SetTickLength(-0.01,"Y");
1544 fAvMultiplicity->SetMarkerStyle(25);
1545 fAvMultiplicity->SetLabelSize(0.05);
1546 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1547 fAvMultiplicity->SetYTitle("Average Multiplicity");
1548 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1549 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1550 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1551 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1552 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1553 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1554 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1555 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1556 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1557 fIntFlowProfiles->Add(fAvMultiplicity);
1558 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1559 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1560 intFlowCorrelationsProName += fAnalysisLabel->Data();
1561 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1562 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1563 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1564 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1565 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
1566 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2>>");
1567 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<4>>");
1568 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<6>>");
1569 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<8>>");
1570 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
ff70ca91 1571 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is biased estimator):
1572 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"};
ff70ca91 1573 for(Int_t ci=0;ci<4;ci++) // correlation index
1574 {
1575 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1576 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1577 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1578 Form("%s vs multiplicity",correlationFlag[ci].Data()),
9da1a4f3 1579 fnBinsMult,fMinMult,fMaxMult,"s");
ff70ca91 1580 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1581 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1582 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
1583 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 1584 // averaged all correlations for all events (with wrong errors!):
1585 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1586 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1587 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");
1588 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1589 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1590 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1591 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1592 // 2-p correlations:
1593 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1594 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1595 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1596 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1597 // 3-p correlations:
1598 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1599 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1600 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1601 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1602 // 4-p correlations:
1603 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1604 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1605 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1606 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1607 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1608 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1609 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1610 // 5-p correlations:
1611 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1612 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1613 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1614 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1615 // 6-p correlations:
1616 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1617 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1618 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1619 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1620 // 7-p correlations:
1621 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1622 // 8-p correlations:
1623 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1624 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1625 // when particle weights are used some extra correlations appear:
1626 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1627 {
1628 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1629 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1630 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1631 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1632 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1633 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1634 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1635 // extra 2-p correlations:
1636 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1637 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1638 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1639 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1640 // average product of correlations <2>, <4>, <6> and <8>:
1641 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1642 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1643 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1644 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1645 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1646 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1647 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
1648 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2><4>>");
1649 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<2><6>>");
1650 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<2><8>>");
1651 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<4><6>>");
1652 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(5,"<<4><8>>");
1653 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(6,"<<6><8>>");
1654 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
ff70ca91 1655 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1656 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
1657 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1658 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1659 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
1660 for(Int_t pi=0;pi<6;pi++)
1661 {
1662 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1663 Form("%s versus multiplicity",productFlag[pi].Data()),
9da1a4f3 1664 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1665 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1666 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1667 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 1668 // average product of correction terms for NUA:
1669 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1670 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1671 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1672 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1673 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1674 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1675 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1676 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1677 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1678 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1679 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1680 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1681 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1682 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1683 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1684 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1685 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1686 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1687 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1688 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1689 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1690 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1691 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1692 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1693 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1694 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1695 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1696 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1697 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1698 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1699 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1700 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1701 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1702 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1703 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
489d5531 1704 // average correction terms for non-uniform acceptance (with wrong errors!):
1705 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1706 {
1707 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1708 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1709 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()),10,0,10,"s");
1710 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1711 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1712 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1713 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
1714 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("<<%s(n(phi1))>>",sinCosFlag[sc].Data()));
1715 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("<<%s(n(phi1+phi2))>>",sinCosFlag[sc].Data()));
1716 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("<<%s(n(phi1-phi2-phi3))>>",sinCosFlag[sc].Data()));
1717 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("<<%s(n(2phi1-phi2))>>",sinCosFlag[sc].Data()));
1718 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
2001bc3a 1719 // versus multiplicity:
1720 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
1721 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
1722 {
1723 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
1724 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
1725 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); // to be improved - added on purpose option "" instead of "s" only here
1726 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]->SetDefaultSumw2();
1727 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
1728 }
489d5531 1729 } // end of for(Int_t sc=0;sc<2;sc++)
1730
1731 // d) Book histograms holding the final results:
1732 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1733 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1734 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1735 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1736 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1737 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1738 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1739 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1740 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1741 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1742 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1743 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1744 fIntFlowResults->Add(fIntFlowCorrelationsHist);
ff70ca91 1745 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
1746 for(Int_t ci=0;ci<4;ci++) // correlation index
1747 {
1748 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1749 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1750 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1751 Form("%s vs multiplicity",correlationFlag[ci].Data()),
9da1a4f3 1752 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1753 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1754 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1755 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1756 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 1757 // average all correlations for all events (with correct errors!):
1758 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1759 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
1760 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);
1761 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1762 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1763 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1764 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1765 // 2-p correlations:
1766 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1767 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1768 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1769 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1770 // 3-p correlations:
1771 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1772 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1773 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1774 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1775 // 4-p correlations:
1776 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1777 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1778 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1779 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1780 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1781 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1782 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1783 // 5-p correlations:
1784 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1785 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1786 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1787 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1788 // 6-p correlations:
1789 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1790 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1791 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1792 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1793 // 7-p correlations:
1794 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1795 // 8-p correlations:
1796 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1797 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1798 // average correction terms for non-uniform acceptance (with correct errors!):
1799 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1800 {
1801 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1802 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
1803 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()),10,0,10);
1804 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1805 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1806 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1807 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
1808 // .........................................................................
1809 // 1-p terms:
1810 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
1811 // 2-p terms:
1812 // 3-p terms:
1813 // ...
1814 // .........................................................................
1815 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1816 } // end of for(Int_t sc=0;sc<2;sc++)
1817 // covariances (multiplied with weight dependent prefactor):
1818 TString intFlowCovariancesName = "fIntFlowCovariances";
1819 intFlowCovariancesName += fAnalysisLabel->Data();
1820 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1821 fIntFlowCovariances->SetLabelSize(0.04);
1822 fIntFlowCovariances->SetMarkerStyle(25);
1823 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1824 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1825 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1826 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1827 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1828 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1829 fIntFlowResults->Add(fIntFlowCovariances);
1830 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1831 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1832 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1833 for(Int_t power=0;power<2;power++)
1834 {
1835 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);
1836 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1837 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1838 if(power == 0)
1839 {
1840 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1841 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1842 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1843 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1844 } else if (power == 1)
1845 {
1846 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1847 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1848 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1849 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1850 }
1851 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1852 }
1853 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1854 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1855 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1856 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1857 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1858 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1859 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1860 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1861 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1862 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1863 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1864 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1865 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
ff70ca91 1866 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1867 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
1868 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1869 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1870 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1871 for(Int_t ci=0;ci<6;ci++)
1872 {
1873 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1874 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
9da1a4f3 1875 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1876 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1877 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1878 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1879 }
1880 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1881 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
1882 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1883 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1884 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>}"},
1885 {"#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}"}};
1886 for(Int_t si=0;si<4;si++)
1887 {
1888 for(Int_t power=0;power<2;power++)
1889 {
1890 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1891 Form("%s vs multiplicity",sumFlag[power][si].Data()),
9da1a4f3 1892 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1893 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1894 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1895 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1896 } // end of for(Int_t power=0;power<2;power++)
1897 } // end of for(Int_t si=0;si<4;si++)
1898 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1899 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1900 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
1901 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1902 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1903 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>}",
1904 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1905 for(Int_t pi=0;pi<6;pi++)
1906 {
1907 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1908 Form("%s versus multiplicity",sopowFlag[pi].Data()),
9da1a4f3 1909 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1910 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1911 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1912 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1913 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 1914 // covariances of NUA terms (multiplied with weight dependent prefactor):
1915 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1916 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1917 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1918 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1919 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1920 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1921 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1922 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1923 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1924 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1925 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1926 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1927 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1928 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1929 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1930 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1931 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1932 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1933 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1934 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1935 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1936 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1937 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1938 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1939 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1940 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1941 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1942 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1943 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1944 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1945 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1946 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1947 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1948 fIntFlowResults->Add(fIntFlowCovariancesNUA);
1949 // sum of linear and quadratic event weights for NUA terms:
1950 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
1951 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
1952 for(Int_t sc=0;sc<2;sc++)
1953 {
1954 for(Int_t power=0;power<2;power++)
1955 {
1956 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()),3,0,3);
1957 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
1958 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
1959 if(power == 0)
1960 {
1961 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
1962 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
1963 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
1964 } else if(power == 1)
1965 {
1966 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
1967 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
1968 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
1969 }
1970 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
1971 }
1972 }
1973 // sum of products of event weights for NUA terms:
1974 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
1975 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
1976 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
1977 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
1978 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
1979 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
1980 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
1981 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
1982 // ....
1983 // to be improved - add labels for remaining bins
1984 // ....
1985 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
489d5531 1986 // final results for integrated Q-cumulants:
1987 TString intFlowQcumulantsName = "fIntFlowQcumulants";
1988 intFlowQcumulantsName += fAnalysisLabel->Data();
1989 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);
1990 fIntFlowQcumulants->SetLabelSize(0.05);
1991 fIntFlowQcumulants->SetMarkerStyle(25);
1992 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(1,"QC{2}");
1993 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(2,"QC{4}");
1994 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(3,"QC{6}");
1995 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(4,"QC{8}");
1996 fIntFlowResults->Add(fIntFlowQcumulants);
ff70ca91 1997 // final results for integrated Q-cumulants versus multiplicity:
1998 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
1999 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2000 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
2001 for(Int_t co=0;co<4;co++) // cumulant order
2002 {
2003 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2004 Form("%s vs multipicity",cumulantFlag[co].Data()),
9da1a4f3 2005 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 2006 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2007 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2008 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2009 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 2010 // final integrated flow estimates from Q-cumulants:
2011 TString intFlowName = "fIntFlow";
2012 intFlowName += fAnalysisLabel->Data();
2013 // integrated flow from Q-cumulants:
2014 fIntFlow = new TH1D(intFlowName.Data(),"Integrated flow estimates from Q-cumulants",4,0,4);
2015 fIntFlow->SetLabelSize(0.05);
2016 fIntFlow->SetMarkerStyle(25);
ff70ca91 2017 (fIntFlow->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}"); // to be improved (harwired harmonic)
2018 (fIntFlow->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}"); // to be improved (harwired harmonic)
2019 (fIntFlow->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}"); // to be improved (harwired harmonic)
2020 (fIntFlow->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}"); // to be improved (harwired harmonic)
2021 fIntFlowResults->Add(fIntFlow);
2022 // integrated flow from Q-cumulants: versus multiplicity:
2023 TString intFlowVsMName = "fIntFlowVsM";
2024 intFlowVsMName += fAnalysisLabel->Data();
2025 TString flowFlag[4] = {"v_{2}{2,QC}","v_{2}{4,QC}","v_{2}{6,QC}","v_{2}{8,QC}"}; // to be improved (harwired harmonic)
2026 for(Int_t co=0;co<4;co++) // cumulant order
2027 {
2028 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2029 Form("%s vs multipicity",flowFlag[co].Data()),
9da1a4f3 2030 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 2031 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2032 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2033 fIntFlowResults->Add(fIntFlowVsM[co]);
2034 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2001bc3a 2035 // quantifying detector effects effects to correlations:
2036 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2037 intFlowDetectorBiasName += fAnalysisLabel->Data();
2038 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2039 fIntFlowDetectorBias->SetLabelSize(0.05);
2040 fIntFlowDetectorBias->SetMarkerStyle(25);
2041 for(Int_t ci=0;ci<4;ci++)
2042 {
2043 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2044 }
2045 fIntFlowResults->Add(fIntFlowDetectorBias);
2046 // quantifying detector effects to correlations versus multiplicity:
2047 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2048 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2049 for(Int_t ci=0;ci<4;ci++) // correlation index
2050 {
2051 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2052 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2053 fnBinsMult,fMinMult,fMaxMult);
2054 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2055 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
2056 if(fApplyCorrectionForNUAVsM){fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);}
2057 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 2058
2059 /* // to be improved (removed):
2060 // final average weighted multi-particle correlations for all events calculated from Q-vectors
2061 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
2062 fQCorrelations[1]->SetTickLength(-0.01,"Y");
2063 fQCorrelations[1]->SetMarkerStyle(25);
2064 fQCorrelations[1]->SetLabelSize(0.03);
2065 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
2066 // 2-particle correlations:
2067 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2068 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
2069 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
2070 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
2071 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2072 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
2073 // 3-particle correlations:
2074 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
2075 // 4-particle correlations:
2076 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
2077 // add fQCorrelations[1] to the list fIntFlowList:
2078 fIntFlowList->Add(fQCorrelations[1]);
2079 */
2080
2081} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2082
2083
2084//================================================================================================================================
2085
2086
2087void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2088{
2089 // Initialize arrays of all objects relevant for calculations with nested loops.
2090
2091 // integrated flow:
2092 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2093 {
2094 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2095 }
2096
2097 // differential flow:
2098 // correlations:
2099 for(Int_t t=0;t<2;t++) // type: RP or POI
2100 {
2101 for(Int_t pe=0;pe<2;pe++) // pt or eta
2102 {
2103 for(Int_t ci=0;ci<4;ci++) // correlation index
2104 {
2105 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2106 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2107 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2108 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2109 // correction terms for non-uniform acceptance:
2110 for(Int_t t=0;t<2;t++) // type: RP or POI
2111 {
2112 for(Int_t pe=0;pe<2;pe++) // pt or eta
2113 {
2114 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2115 {
2116 for(Int_t cti=0;cti<9;cti++) // correction term index
2117 {
2118 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2119 }
2120 }
2121 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2122 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2123
2124
2125} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2126
2127
2128//================================================================================================================================
2129
2130
2131void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2132{
2133 // Book all objects relevant for calculations with nested loops.
2134
2135 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2136 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2137 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2138 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2139 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2140 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2141
2142 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2143 evaluateNestedLoopsName += fAnalysisLabel->Data();
2144 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2145 fEvaluateNestedLoops->SetLabelSize(0.03);
2146 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2147 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2148 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2149 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2150 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2151 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2152 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2153 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2154 fNestedLoopsList->Add(fEvaluateNestedLoops);
2155 // nested loops for integrated flow:
2156 if(fEvaluateIntFlowNestedLoops)
2157 {
2158 // correlations:
2159 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2160 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
2161 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");
2162 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2163 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2164 {
2165 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2166 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2167 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2168 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2169 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2170 // correction terms for non-uniform acceptance:
2171 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2172 {
2173 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2174 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2175 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");
2176 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2177 } // end of for(Int_t sc=0;sc<2;sc++)
2178 } // end of if(fEvaluateIntFlowNestedLoops)
2179
2180 // nested loops for differential flow:
2181 if(fEvaluateDiffFlowNestedLoops)
2182 {
2183 // reduced correlations:
2184 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2185 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2186 for(Int_t t=0;t<2;t++) // type: RP or POI
2187 {
2188 for(Int_t pe=0;pe<2;pe++) // pt or eta
2189 {
2190 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2191 {
2192 // reduced correlations:
2193 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");
2194 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2195 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2196 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2197 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2198 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2199 // correction terms for non-uniform acceptance:
2200 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2201 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2202 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2203 {
2204 for(Int_t pe=0;pe<2;pe++) // pt or eta
2205 {
2206 for(Int_t sc=0;sc<2;sc++) // sin or cos
2207 {
2208 for(Int_t cti=0;cti<9;cti++) // correction term index
2209 {
2210 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");
2211 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2212 }
2213 }
2214 }
3b552efe 2215 }
2216 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2217 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2218 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
489d5531 2219 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2220 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2221 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
3b552efe 2222 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
489d5531 2223 fNestedLoopsList->Add(fNoOfParticlesInBin);
2224 } // end of if(fEvaluateDiffFlowNestedLoops)
2225
2226} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2227
2228
2229//================================================================================================================================
2230
2231
2232void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2233{
2234 // calculate all correlations needed for integrated flow
57340a27 2235
489d5531 2236 // multiplicity:
2237 Double_t dMult = (*fSMpk)(0,0);
57340a27 2238
489d5531 2239 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2240 Double_t dReQ1n = (*fReQ)(0,0);
2241 Double_t dReQ2n = (*fReQ)(1,0);
2242 Double_t dReQ3n = (*fReQ)(2,0);
2243 Double_t dReQ4n = (*fReQ)(3,0);
2244 Double_t dImQ1n = (*fImQ)(0,0);
2245 Double_t dImQ2n = (*fImQ)(1,0);
2246 Double_t dImQ3n = (*fImQ)(2,0);
2247 Double_t dImQ4n = (*fImQ)(3,0);
2248
2249 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2250 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2251
2252 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2253 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2254
2255 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2256 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2257
2258 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2259 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2260
2261 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2262 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2263 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2264
2265 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2266 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2267
2268 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2269 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2270
2271 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2272 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2273
2274 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2275 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2276
2277 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2278 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2279
2280 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2281 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2282
2283 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2284 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2285
2286 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2287 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2288
2289 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2290 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2291 + dImQ3n*dImQ2n*dReQ1n;
2292
2293 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2294 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2295
2296 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2297 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2298
2299 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2300 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2301 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2302
2303 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2304 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2305
2306 // |Q_{2n}|^2 |Q_{n}|^2
2307 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2308
2309 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2310 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2311 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2312
2313 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2314 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2315
2316 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2317 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2318 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2319
2320 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2321 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2322
2323 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2324 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2325 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2326
2327 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2328 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2329 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2330
2331 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2332 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2333 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2334 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2335
2336 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2337 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2338 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2339 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2340
2341 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2342 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2343 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2344
2345 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2346 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2347 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2348
2349
2350 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2351 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2352 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2353 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2354 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2355
2356 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2357 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2358 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2359 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2360
2361 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2362 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2363 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2364 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2365
2366 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2367 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2368 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2369 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2370
2371 // |Q_{2n}|^2 |Q_{n}|^4
2372 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2373
2374 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2375 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2376 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2377 + 2.*dReQ1n*dImQ1n*dImQ2n);
2378
2379 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2380 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2381 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2382 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2383
2384
2385
2386
2387 // **************************************
2388 // **** multi-particle correlations: ****
2389 // **************************************
2390 //
2391 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)
2392 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)
2393 // --------------------------------------------------------------------------------------------------------------------
2394 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2395 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2396 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2397 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2398 // 5th bin: ---- EMPTY ----
2399 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2400 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2401 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2402 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2403 // 10th bin: ---- EMPTY ----
2404 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2405 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2406 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2407 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2408 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2409 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2410 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2411 // 18th bin: ---- EMPTY ----
2412 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2413 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2414 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2415 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2416 // 23rd bin: ---- EMPTY ----
2417 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2418 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2419 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2420 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2421 // 28th bin: ---- EMPTY ----
2422 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2423 // 30th bin: ---- EMPTY ----
2424 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2425 // --------------------------------------------------------------------------------------------------------------------
2426
2427 // 2-particle:
2428 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2429 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2430 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2431 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2432
2433 if(dMult>1)
2434 {
2435 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2436 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2437 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2438 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2439
2440 // average 2-particle correlations for single event:
2441 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2442 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2443 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2444 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2445
2446 // average 2-particle correlations for all events:
2447 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2448 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2449 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2450 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2451
2452 // store separetately <2> (to be improved: do I really need this?)
2453 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2454
2455 // to be improved (this can be implemented better):
2456 Double_t mWeight2p = 0.;
2457 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2458 {
2459 mWeight2p = dMult*(dMult-1.);
2460 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2461 {
2462 mWeight2p = 1.;
2463 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2464 {
2465 mWeight2p = dMult;
2466 }
2467
2468 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2469 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
2001bc3a 2470 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
489d5531 2471
2472 // distribution of <cos(n*(phi1-phi2))>:
2473 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2474 } // end of if(dMult>1)
2475
2476 // 3-particle:
2477 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2478 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2479 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2480 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2481
2482 if(dMult>2)
2483 {
2484 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2485 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2486 / (dMult*(dMult-1.)*(dMult-2.));
2487 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2488 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2489 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2490 / (dMult*(dMult-1.)*(dMult-2.));
2491 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2492 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2493 / (dMult*(dMult-1.)*(dMult-2.));
2494 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2495 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2496 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2497 / (dMult*(dMult-1.)*(dMult-2.));
2498
2499 // average 3-particle correlations for single event:
2500 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2501 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2502 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2503 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2504
2505 // average 3-particle correlations for all events:
2506 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2507 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2508 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2509 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2510 } // end of if(dMult>2)
2511
2512 // 4-particle:
2513 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2514 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2515 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2516 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2517 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2518 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2519 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2520
2521 if(dMult>3)
2522 {
2523 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2524 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2525 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2526 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2527 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2528 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2529 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2530 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2531 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2532 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2533 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2534 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2535 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2536 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2537 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2538 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2539 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2540 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2541 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2542 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2543 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2544 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2545 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2546 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2547 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2548 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2549 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2550 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2551 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2552 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2553 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2554 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2555 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2556 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2557 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2558 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2559
2560 // average 4-particle correlations for single event:
2561 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2562 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2563 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2564 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2565 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2566 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2567 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2568
2569 // average 4-particle correlations for all events:
2570 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2571 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2572 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2573 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2574 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2575 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2576 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2577
2578 // store separetately <4> (to be improved: do I really need this?)
2579 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2580
2581 // to be improved (this can be implemented better):
2582 Double_t mWeight4p = 0.;
2583 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2584 {
2585 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2586 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2587 {
2588 mWeight4p = 1.;
2589 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2590 {
2591 mWeight4p = dMult;
2592 }
2593
2594 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2595 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
2001bc3a 2596 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
489d5531 2597
2598 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2599 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2600
2601 } // end of if(dMult>3)
2602
2603 // 5-particle:
2604 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2605 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2606 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2607 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2608
2609 if(dMult>4)
2610 {
2611 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2612 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2613 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2614 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2615 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2616 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2617 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2618 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2619 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2620 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2621 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2622
2623 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2624 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2625 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2626 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2627 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2628 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2629 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2630 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2631 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2632 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2633 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2634 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2635 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2636
2637 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2638 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2639 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2640 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2641 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2642 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2643 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2644
2645 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2646 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2647 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2648 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2649 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2650 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2651 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2652 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2653 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2654 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2655 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2656 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2657 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2658 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2659 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2660 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2661
2662 // average 5-particle correlations for single event:
2663 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2664 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2665 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2666 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2667
2668 // average 5-particle correlations for all events:
2669 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2670 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2671 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2672 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2673 } // end of if(dMult>4)
2674
2675 // 6-particle:
2676 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2677 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2678 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2679 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2680
2681 if(dMult>5)
2682 {
2683 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2684 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2685 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2686 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2687 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2688 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2689 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2690 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2691 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2692 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2693 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2694
2695 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2696 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2697 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2698 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2699 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2700 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2701 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2702 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2703 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2704 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2705 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2706 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2707 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2708 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2709
2710 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2711 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2712 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2713 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2714 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2715 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2716 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2717
2718 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2719 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2720 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2721 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2722 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2723 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2724 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2725 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2726
2727 // average 6-particle correlations for single event:
2728 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2729 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2730 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2731 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2732
2733 // average 6-particle correlations for all events:
2734 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2735 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2736 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2737 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2738
2739 // store separetately <6> (to be improved: do I really need this?)
2740 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2741
2742 // to be improved (this can be implemented better):
2743 Double_t mWeight6p = 0.;
2744 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2745 {
2746 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2747 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2748 {
2749 mWeight6p = 1.;
2750 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2751 {
2752 mWeight6p = dMult;
2753 }
2754
2755 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2756 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
2001bc3a 2757 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
489d5531 2758
2759 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2760 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2761 } // end of if(dMult>5)
2762
2763 // 7-particle:
2764 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2765
2766 if(dMult>6)
2767 {
2768 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2769 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2770 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2771 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2772 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2773 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2774 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2775 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2776 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2777 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2778 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2779 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2780 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2781 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2782 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2783 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2784
2785 // average 7-particle correlations for single event:
2786 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2787
2788 // average 7-particle correlations for all events:
2789 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2790 } // end of if(dMult>6)
2791
2792 // 8-particle:
2793 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2794 if(dMult>7)
2795 {
2796 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2797 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2798 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2799 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2800 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2801 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2802 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2803 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2804 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2805 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2806 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2807 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2808 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2809
2810 // average 8-particle correlations for single event:
2811 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2812
2813 // average 8-particle correlations for all events:
2814 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2815
2816 // store separetately <8> (to be improved: do I really need this?)
2817 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2818
2819 // to be improved (this can be implemented better):
2820 Double_t mWeight8p = 0.;
2821 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2822 {
2823 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2824 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2825 {
2826 mWeight8p = 1.;
2827 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2828 {
2829 mWeight8p = dMult;
2830 }
2831
2832 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
2833 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2001bc3a 2834 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
489d5531 2835
2836 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2837 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2838 } // end of if(dMult>7)
2839
2840} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2841
2842
2843//================================================================================================================================
2844
2845
2846void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2847{
0328db2d 2848 // Calculate averages of products of correlations for integrated flow.
489d5531 2849
2001bc3a 2850 // multiplicity:
2851 Double_t dMult = (*fSMpk)(0,0);
2852
489d5531 2853 Int_t counter = 0;
2854
2855 for(Int_t ci1=1;ci1<4;ci1++)
2856 {
2857 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
2858 {
ff70ca91 2859 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
2860 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2861 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2862 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2863 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2864 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
2001bc3a 2865 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5,
ff70ca91 2866 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2867 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2868 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2869 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2870 counter++;
489d5531 2871 }
2872 }
2873
2874} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2875
2876
2877//================================================================================================================================
2878
2879
0328db2d 2880void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
2881{
2882 // Calculate averages of products of correction terms for NUA.
2883
2884 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
2885 // 1st bin: <<2><cos(phi)>>
2886 // 2nd bin: <<2><sin(phi)>>
2887 // 3rd bin: <<cos(phi)><sin(phi)>>
2888 // 4th bin: <<2><cos(phi1+phi2)>>
2889 // 5th bin: <<2><sin(phi1+phi2)>>
2890 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
2891 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
2892 // 8th bin: <<4><cos(phi1)>>
2893 // 9th bin: <<4><sin(phi1)>>
2894 // 10th bin: <<4><cos(phi1+phi2)>>
2895 // 11th bin: <<4><sin(phi1+phi2)>>
2896 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
2897 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
2898 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
2899 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
2900 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
2901 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
2902 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
2903 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
2904 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
2905 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
2906 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
2907 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
2908 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
2909 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
2910 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
2911 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
2912
2913 // <<2><cos(phi)>>:
2914 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
2915 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
2916 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2917 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
2918 // <<2><sin(phi)>>:
2919 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
2920 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2921 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2922 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2923 // <<cos(phi)><sin(phi)>>:
2924 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
2925 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2926 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2927 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2928 // <<2><cos(phi1+phi2)>>:
2929 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
2930 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2931 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2932 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2933 // <<2><sin(phi1+phi2)>>:
2934 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
2935 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2936 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2937 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2938 // <<2><cos(phi1-phi2-phi3)>>:
2939 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
2940 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2941 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2942 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2943 // <<2><sin(phi1-phi2-phi3)>>:
2944 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
2945 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2946 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2947 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2948 // <<4><cos(phi1)>>:
2949 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
2950 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
2951 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2952 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
2953 // <<4><sin(phi1)>>:
2954 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
2955 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2956 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2957 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2958 // <<4><cos(phi1+phi2)>>:
2959 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
2960 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2961 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2962 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2963 // <<4><sin(phi1+phi2)>>:
2964 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
2965 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2966 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2967 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2968 // <<4><cos(phi1-phi2-phi3)>>:
2969 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
2970 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2971 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2972 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2973 // <<4><sin(phi1-phi2-phi3)>>:
2974 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
2975 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2976 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2977 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2978 // <<cos(phi1)><cos(phi1+phi2)>>:
2979 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
2980 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2981 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2982 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2983 // <<cos(phi1)><sin(phi1+phi2)>>:
2984 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
2985 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2986 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2987 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2988 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
2989 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
2990 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2991 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2992 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2993 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
2994 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
2995 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2996 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2997 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2998 // <<sin(phi1)><cos(phi1+phi2)>>:
2999 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3000 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3001 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3002 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3003 // <<sin(phi1)><sin(phi1+phi2)>>:
3004 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3005 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3006 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3007 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3008 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3009 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3010 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3011 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3012 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3013 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3014 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3015 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3016 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3017 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3018 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3019 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3020 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3021 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3022 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3023 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3024 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3025 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3026 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3027 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3028 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3029 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3030 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3031 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3032 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3033 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3034 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3035 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3036 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3037 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3038 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3039 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3040 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3041 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3042 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3043 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3044 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3045 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3046 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3047 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3048
3049} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3050
3051
3052//================================================================================================================================
3053
3054
489d5531 3055void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3056{
3057 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3058 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3059 // b) Store in histogram fIntFlowCovariances for instance the following:
3060 //
3061 // 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)]
3062 //
3063 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3064 // c) Binning of fIntFlowCovariances is organized as follows:
3065 //
3066 // 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)]
3067 // 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)]
3068 // 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)]
3069 // 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)]
3070 // 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)]
3071 // 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)]
3072
3073 for(Int_t power=0;power<2;power++)
3074 {
3075 if(!(fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro
3076 && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights
3077 && fIntFlowCovariances))
3078 {
3079 cout<<"WARNING: fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro "<<endl;
3080 cout<<" && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights"<<endl;
3081 cout<<" && fIntFlowCovariances is NULL in AFAWQC::FCIF() !!!!"<<endl;
3082 cout<<"power = "<<power<<endl;
3083 exit(0);
3084 }
3085 }
3086
3087 // average 2-, 4-, 6- and 8-particle correlations for all events:
3088 Double_t correlation[4] = {0.};
3089 for(Int_t ci=0;ci<4;ci++)
3090 {
3091 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3092 }
3093 // average products of 2-, 4-, 6- and 8-particle correlations:
3094 Double_t productOfCorrelations[4][4] = {{0.}};
3095 Int_t productOfCorrelationsLabel = 1;
3096 // denominators in the expressions for the unbiased estimator for covariance:
3097 Double_t denominator[4][4] = {{0.}};
3098 Int_t sumOfProductOfEventWeightsLabel1 = 1;
3099 // weight dependent prefactor which multiply unbiased estimators for covariances:
3100 Double_t wPrefactor[4][4] = {{0.}};
3101 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3102 for(Int_t c1=0;c1<4;c1++)
3103 {
3104 for(Int_t c2=c1+1;c2<4;c2++)
3105 {
3106 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
3107 if(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) && fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1))
3108 {
3109 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))/
3110 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3111 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3112
3113 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)/
3114 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3115 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3116
3117
3118 }
3119 productOfCorrelationsLabel++;
3120 sumOfProductOfEventWeightsLabel1++;
3121 sumOfProductOfEventWeightsLabel2++;
3122 }
3123 }
3124
3125 // covariance label:
3126 Int_t covarianceLabel = 1;
3127 for(Int_t c1=0;c1<4;c1++)
3128 {
3129 for(Int_t c2=c1+1;c2<4;c2++)
3130 {
3131 if(denominator[c1][c2])
3132 {
3133 // covariances:
3134 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
3135 // covarianced multiplied with weight dependent prefactor:
3136 Double_t wCov = cov * wPrefactor[c1][c2];
3137 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3138 }
3139 covarianceLabel++;
3140 }
3141 }
3142
9da1a4f3 3143 // versus multiplicity:
3144 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3145 for(Int_t b=1;b<=nBins;b++)
3146 {
3147 // average 2-, 4-, 6- and 8-particle correlations for all events:
3148 Double_t correlationVsM[4] = {0.};
3149 for(Int_t ci=0;ci<4;ci++)
3150 {
3151 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3152 } // end of for(Int_t ci=0;ci<4;ci++)
3153 // average products of 2-, 4-, 6- and 8-particle correlations:
3154 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
3155 Int_t productOfCorrelationsLabelVsM = 1;
3156 // denominators in the expressions for the unbiased estimator for covariance:
3157 Double_t denominatorVsM[4][4] = {{0.}};
3158 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
3159 // weight dependent prefactor which multiply unbiased estimators for covariances:
3160 Double_t wPrefactorVsM[4][4] = {{0.}};
3161 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
3162 for(Int_t c1=0;c1<4;c1++)
3163 {
3164 for(Int_t c2=c1+1;c2<4;c2++)
3165 {
3166 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
3167 if(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b) && fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b))
3168 {
3169 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))/
3170 (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3171 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3172
3173 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)/
3174 (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3175 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3176
3177
3178 }
3179 productOfCorrelationsLabelVsM++;
3180 sumOfProductOfEventWeightsLabel1VsM++;
3181 sumOfProductOfEventWeightsLabel2VsM++;
3182 } // end of for(Int_t c1=0;c1<4;c1++)
3183 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3184 // covariance label:
3185 Int_t covarianceLabelVsM = 1;
3186 for(Int_t c1=0;c1<4;c1++)
3187 {
3188 for(Int_t c2=c1+1;c2<4;c2++)
3189 {
3190 if(denominatorVsM[c1][c2])
3191 {
3192 // covariances:
3193 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
3194 // covarianced multiplied with weight dependent prefactor:
3195 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
3196 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
3197 }
3198 covarianceLabelVsM++;
3199 }
3200 }
3201 } // end of for(Int_t b=1;b<=nBins;b++)
3202
489d5531 3203} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3204
489d5531 3205//================================================================================================================================
3206
0328db2d 3207void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3208{
3209 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3210 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3211 //
3212 // 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)]
3213 //
3214 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3215 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3216 //
3217 // 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)]
3218 // 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)]
3219 // 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)]
3220 // ...
3221
3222 // Cov(<2>,<cos(phi)>):
3223 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3224 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3225 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3226 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3227 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3228 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3229 // numerator in the expression for the the unbiased estimator for covariance:
3230 Double_t numerator1 = product1 - term1st1*term2nd1;
3231 // denominator in the expression for the the unbiased estimator for covariance:
3232 Double_t denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3233 // covariance:
3234 Double_t covariance1 = numerator1/denominator1;
3235 // weight dependent prefactor for covariance:
3236 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3237 // finally, store "weighted" covariance:
3238 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3239
3240 // Cov(<2>,<sin(phi)>):
3241 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3242 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3243 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3244 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3245 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3246 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3247 // numerator in the expression for the the unbiased estimator for covariance:
3248 Double_t numerator2 = product2 - term1st2*term2nd2;
3249 // denominator in the expression for the the unbiased estimator for covariance:
3250 Double_t denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3251 // covariance:
3252 Double_t covariance2 = numerator2/denominator2;
3253 // weight dependent prefactor for covariance:
3254 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3255 // finally, store "weighted" covariance:
3256 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3257
3258 // Cov(<cos(phi)>,<sin(phi)>):
3259 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3260 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3261 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3262 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3263 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3264 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3265 // numerator in the expression for the the unbiased estimator for covariance:
3266 Double_t numerator3 = product3 - term1st3*term2nd3;
3267 // denominator in the expression for the the unbiased estimator for covariance:
3268 Double_t denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3269 // covariance:
3270 Double_t covariance3 = numerator3/denominator3;
3271 // weight dependent prefactor for covariance:
3272 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3273 // finally, store "weighted" covariance:
3274 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3275
3276 // Cov(<2>,<cos(phi1+phi2)>):
3277 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3278 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3279 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3280 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3281 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3282 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3283 // numerator in the expression for the the unbiased estimator for covariance:
3284 Double_t numerator4 = product4 - term1st4*term2nd4;
3285 // denominator in the expression for the the unbiased estimator for covariance:
3286 Double_t denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3287 // covariance:
3288 Double_t covariance4 = numerator4/denominator4;
3289 // weight dependent prefactor for covariance:
3290 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3291 // finally, store "weighted" covariance:
3292 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3293
3294 // Cov(<2>,<sin(phi1+phi2)>):
3295 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3296 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3297 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3298 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3299 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3300 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3301 // numerator in the expression for the the unbiased estimator for covariance:
3302 Double_t numerator5 = product5 - term1st5*term2nd5;
3303 // denominator in the expression for the the unbiased estimator for covariance:
3304 Double_t denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3305 // covariance:
3306 Double_t covariance5 = numerator5/denominator5;
3307 // weight dependent prefactor for covariance:
3308 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3309 // finally, store "weighted" covariance:
3310 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3311
3312 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3313 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3314 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3315 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3316 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3317 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3318 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3319 // numerator in the expression for the the unbiased estimator for covariance:
3320 Double_t numerator6 = product6 - term1st6*term2nd6;
3321 // denominator in the expression for the the unbiased estimator for covariance:
3322 Double_t denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3323 // covariance:
3324 Double_t covariance6 = numerator6/denominator6;
3325 // weight dependent prefactor for covariance:
3326 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3327 // finally, store "weighted" covariance:
3328 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3329
3330 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3331 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3332 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3333 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3334 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3335 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3336 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3337 // numerator in the expression for the the unbiased estimator for covariance:
3338 Double_t numerator7 = product7 - term1st7*term2nd7;
3339 // denominator in the expression for the the unbiased estimator for covariance:
3340 Double_t denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3341 // covariance:
3342 Double_t covariance7 = numerator7/denominator7;
3343 // weight dependent prefactor for covariance:
3344 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3345 // finally, store "weighted" covariance:
3346 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3347
3348 // Cov(<4>,<cos(phi1>):
3349 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3350 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3351 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3352 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3353 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3354 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3355 // numerator in the expression for the the unbiased estimator for covariance:
3356 Double_t numerator8 = product8 - term1st8*term2nd8;
3357 // denominator in the expression for the the unbiased estimator for covariance:
3358 Double_t denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3359 // covariance:
3360 Double_t covariance8 = numerator8/denominator8;
3361 // weight dependent prefactor for covariance:
3362 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3363 // finally, store "weighted" covariance:
3364 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3365
3366 // Cov(<4>,<sin(phi1)>):
3367 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3368 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3369 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3370 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3371 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3372 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3373 // numerator in the expression for the the unbiased estimator for covariance:
3374 Double_t numerator9 = product9 - term1st9*term2nd9;
3375 // denominator in the expression for the the unbiased estimator for covariance:
3376 Double_t denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3377 // covariance:
3378 Double_t covariance9 = numerator9/denominator9;
3379 // weight dependent prefactor for covariance:
3380 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3381 // finally, store "weighted" covariance:
3382 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3383
3384 // Cov(<4>,<cos(phi1+phi2)>):
3385 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3386 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3387 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3388 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3389 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3390 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3391 // numerator in the expression for the the unbiased estimator for covariance:
3392 Double_t numerator10 = product10 - term1st10*term2nd10;
3393 // denominator in the expression for the the unbiased estimator for covariance:
3394 Double_t denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3395 // covariance:
3396 Double_t covariance10 = numerator10/denominator10;
3397 // weight dependent prefactor for covariance:
3398 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3399 // finally, store "weighted" covariance:
3400 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3401
3402 // Cov(<4>,<sin(phi1+phi2)>):
3403 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3404 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3405 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3406 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3407 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3408 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3409 // numerator in the expression for the the unbiased estimator for covariance:
3410 Double_t numerator11 = product11 - term1st11*term2nd11;
3411 // denominator in the expression for the the unbiased estimator for covariance:
3412 Double_t denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3413 // covariance:
3414 Double_t covariance11 = numerator11/denominator11;
3415 // weight dependent prefactor for covariance:
3416 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3417 // finally, store "weighted" covariance:
3418 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3419
3420 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3421 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3422 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3423 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3424 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3425 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3426 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3427 // numerator in the expression for the the unbiased estimator for covariance:
3428 Double_t numerator12 = product12 - term1st12*term2nd12;
3429 // denominator in the expression for the the unbiased estimator for covariance:
3430 Double_t denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3431 // covariance:
3432 Double_t covariance12 = numerator12/denominator12;
3433 // weight dependent prefactor for covariance:
3434 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3435 // finally, store "weighted" covariance:
3436 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3437
3438 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3439 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3440 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3441 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3442 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3443 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3444 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3445 // numerator in the expression for the the unbiased estimator for covariance:
3446 Double_t numerator13 = product13 - term1st13*term2nd13;
3447 // denominator in the expression for the the unbiased estimator for covariance:
3448 Double_t denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3449 // covariance:
3450 Double_t covariance13 = numerator13/denominator13;
3451 // weight dependent prefactor for covariance:
3452 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3453 // finally, store "weighted" covariance:
3454 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3455
3456 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3457 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3458 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3459 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3460 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3461 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3462 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3463 // numerator in the expression for the the unbiased estimator for covariance:
3464 Double_t numerator14 = product14 - term1st14*term2nd14;
3465 // denominator in the expression for the the unbiased estimator for covariance:
3466 Double_t denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3467 // covariance:
3468 Double_t covariance14 = numerator14/denominator14;
3469 // weight dependent prefactor for covariance:
3470 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3471 // finally, store "weighted" covariance:
3472 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3473
3474 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3475 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3476 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3477 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3478 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3479 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3480 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3481 // numerator in the expression for the the unbiased estimator for covariance:
3482 Double_t numerator15 = product15 - term1st15*term2nd15;
3483 // denominator in the expression for the the unbiased estimator for covariance:
3484 Double_t denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3485 // covariance:
3486 Double_t covariance15 = numerator15/denominator15;
3487 // weight dependent prefactor for covariance:
3488 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3489 // finally, store "weighted" covariance:
3490 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3491
3492 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3493 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3494 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3495 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3496 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3497 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3498 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3499 // numerator in the expression for the the unbiased estimator for covariance:
3500 Double_t numerator16 = product16 - term1st16*term2nd16;
3501 // denominator in the expression for the the unbiased estimator for covariance:
3502 Double_t denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3503 // covariance:
3504 Double_t covariance16 = numerator16/denominator16;
3505 // weight dependent prefactor for covariance:
3506 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3507 // finally, store "weighted" covariance:
3508 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3509
3510 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3511 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3512 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3513 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3514 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3515 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3516 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3517 // numerator in the expression for the the unbiased estimator for covariance:
3518 Double_t numerator17 = product17 - term1st17*term2nd17;
3519 // denominator in the expression for the the unbiased estimator for covariance:
3520 Double_t denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3521 // covariance:
3522 Double_t covariance17 = numerator17/denominator17;
3523 // weight dependent prefactor for covariance:
3524 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3525 // finally, store "weighted" covariance:
3526 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3527
3528 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3529 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3530 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3531 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3532 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3533 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3534 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3535 // numerator in the expression for the the unbiased estimator for covariance:
3536 Double_t numerator18 = product18 - term1st18*term2nd18;
3537 // denominator in the expression for the the unbiased estimator for covariance:
3538 Double_t denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3539 // covariance:
3540 Double_t covariance18 = numerator18/denominator18;
3541 // weight dependent prefactor for covariance:
3542 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3543 // finally, store "weighted" covariance:
3544 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3545
3546 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3547 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3548 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3549 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3550 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3551 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3552 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3553 // numerator in the expression for the the unbiased estimator for covariance:
3554 Double_t numerator19 = product19 - term1st19*term2nd19;
3555 // denominator in the expression for the the unbiased estimator for covariance:
3556 Double_t denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3557 // covariance:
3558 Double_t covariance19 = numerator19/denominator19;
3559 // weight dependent prefactor for covariance:
3560 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3561 // finally, store "weighted" covariance:
3562 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3563
3564 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3565 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3566 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3567 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3568 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3569 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3570 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3571 // numerator in the expression for the the unbiased estimator for covariance:
3572 Double_t numerator20 = product20 - term1st20*term2nd20;
3573 // denominator in the expression for the the unbiased estimator for covariance:
3574 Double_t denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3575 // covariance:
3576 Double_t covariance20 = numerator20/denominator20;
3577 // weight dependent prefactor for covariance:
3578 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3579 // finally, store "weighted" covariance:
3580 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3581
3582 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3583 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3584 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3585 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3586 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3587 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3588 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3589 // numerator in the expression for the the unbiased estimator for covariance:
3590 Double_t numerator21 = product21 - term1st21*term2nd21;
3591 // denominator in the expression for the the unbiased estimator for covariance:
3592 Double_t denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3593 // covariance:
3594 Double_t covariance21 = numerator21/denominator21;
3595 // weight dependent prefactor for covariance:
3596 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3597 // finally, store "weighted" covariance:
3598 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3599
3600 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3601 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3602 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3603 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3604 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3605 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3606 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3607 // numerator in the expression for the the unbiased estimator for covariance:
3608 Double_t numerator22 = product22 - term1st22*term2nd22;
3609 // denominator in the expression for the the unbiased estimator for covariance:
3610 Double_t denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3611 // covariance:
3612 Double_t covariance22 = numerator22/denominator22;
3613 // weight dependent prefactor for covariance:
3614 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3615 // finally, store "weighted" covariance:
3616 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3617
3618 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3619 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3620 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3621 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3622 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3623 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3624 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3625 // numerator in the expression for the the unbiased estimator for covariance:
3626 Double_t numerator23 = product23 - term1st23*term2nd23;
3627 // denominator in the expression for the the unbiased estimator for covariance:
3628 Double_t denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3629 // covariance:
3630 Double_t covariance23 = numerator23/denominator23;
3631 // weight dependent prefactor for covariance:
3632 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3633 // finally, store "weighted" covariance:
3634 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
3635
3636 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3637 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3638 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3639 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3640 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3641 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3642 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3643 // numerator in the expression for the the unbiased estimator for covariance:
3644 Double_t numerator24 = product24 - term1st24*term2nd24;
3645 // denominator in the expression for the the unbiased estimator for covariance:
3646 Double_t denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3647 // covariance:
3648 Double_t covariance24 = numerator24/denominator24;
3649 // weight dependent prefactor for covariance:
3650 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3651 // finally, store "weighted" covariance:
3652 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
3653
3654 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3655 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3656 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3657 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3658 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3659 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3660 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3661 // numerator in the expression for the the unbiased estimator for covariance:
3662 Double_t numerator25 = product25 - term1st25*term2nd25;
3663 // denominator in the expression for the the unbiased estimator for covariance:
3664 Double_t denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3665 // covariance:
3666 Double_t covariance25 = numerator25/denominator25;
3667 // weight dependent prefactor for covariance:
3668 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3669 // finally, store "weighted" covariance:
3670 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
3671
3672 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3673 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3674 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3675 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3676 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3677 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3678 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3679 // numerator in the expression for the the unbiased estimator for covariance:
3680 Double_t numerator26 = product26 - term1st26*term2nd26;
3681 // denominator in the expression for the the unbiased estimator for covariance:
3682 Double_t denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3683 // covariance:
3684 Double_t covariance26 = numerator26/denominator26;
3685 // weight dependent prefactor for covariance:
3686 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3687 // finally, store "weighted" covariance:
3688 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
3689
3690 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
3691 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3692 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1-phi2-phi3)>>
3693 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3694 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1-phi2-phi3)>}
3695 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3696 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
3697 // numerator in the expression for the the unbiased estimator for covariance:
3698 Double_t numerator27 = product27 - term1st27*term2nd27;
3699 // denominator in the expression for the the unbiased estimator for covariance:
3700 Double_t denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3701 // covariance:
3702 Double_t covariance27 = numerator27/denominator27;
3703 // weight dependent prefactor for covariance:
3704 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3705 // finally, store "weighted" covariance:
3706 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
3707
3708} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3709
3710
3711//================================================================================================================================
3712
3713
489d5531 3714void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3715{
3716 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
3717 // correctly calculate the statistical errors and store the final results and
3718 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
3719 //
3720 // Remark: Statistical error of correlation is calculated as:
3721 //
3722 // statistical error = termA * spread * termB:
3723 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
3724 // termB = 1/sqrt(1-termA^2)
3725
3726 for(Int_t power=0;power<2;power++)
3727 {
3728 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power]))
3729 {
3730 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;
3731 cout<<"power = "<<power<<endl;
3732 exit(0);
3733 }
3734 }
3735
3736 for(Int_t ci=1;ci<=4;ci++) // correlation index
3737 {
3738 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
3739 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);
3740 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
3741 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
3742 Double_t termA = 0.;
3743 Double_t termB = 0.;
3744 if(sumOfLinearEventWeights)
3745 {
3746 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
3747 } else
3748 {
3749 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;
3750 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3751 }
3752 if(1.-pow(termA,2.) > 0.)
3753 {
3754 termB = 1./pow(1-pow(termA,2.),0.5);
3755 } else
3756 {
3757 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
3758 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3759 }
3760 Double_t statisticalError = termA * spread * termB;
3761 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
3762 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
ff70ca91 3763 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3764
3765 // versus multiplicity:
3766 for(Int_t ci=0;ci<=3;ci++) // correlation index
3767 {
3768 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
3769 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
3770 {
3771 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3772 Double_t spreadVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinError(b);
3773 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
3774 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
3775 Double_t termAVsM = 0.;
3776 Double_t termBVsM = 0.;
3777 if(sumOfLinearEventWeightsVsM)
3778 {
3779 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
3780 } else
3781 {
9da1a4f3 3782 //cout<<"WARNING: sumOfLinearEventWeightsVsM == 0 in AFAWQC::FCIF() !!!!"<<endl;
3783 //cout<<" (for "<<2*(ci+1)<<"-particle correlation versus multiplicity)"<<endl;
ff70ca91 3784 }
3785 if(1.-pow(termAVsM,2.) > 0.)
3786 {
3787 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
3788 } else
3789 {
9da1a4f3 3790 //cout<<"WARNING: 1.-pow(termAVsM,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
3791 //cout<<" (for "<<2*(ci+1)<<"-particle correlation versus multiplicity)"<<endl;
ff70ca91 3792 }
3793 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
3794 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
3795 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
3796 } // end of for(Int_t b=1;b<=nBins;b++)
3797 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3798
489d5531 3799} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3800
489d5531 3801//================================================================================================================================
3802
489d5531 3803void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
3804{
3805 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
3806
3807 // Binning of fAverageMultiplicity is organized as follows:
3808 // 1st bin: all events (including the empty ones)
3809 // 2nd bin: event with # of RPs greater or equal to 1
3810 // 3rd bin: event with # of RPs greater or equal to 2
3811 // 4th bin: event with # of RPs greater or equal to 3
3812 // 5th bin: event with # of RPs greater or equal to 4
3813 // 6th bin: event with # of RPs greater or equal to 5
3814 // 7th bin: event with # of RPs greater or equal to 6
3815 // 8th bin: event with # of RPs greater or equal to 7
3816 // 9th bin: event with # of RPs greater or equal to 8
3817
3818 if(!fAvMultiplicity)
3819 {
3820 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
3821 exit(0);
3822 }
3823
3824 if(nRP<0)
3825 {
3826 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
3827 exit(0);
3828 }
3829
3830 for(Int_t i=0;i<9;i++)
3831 {
3832 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
3833 }
3834
3835} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
3836
3837
3838//================================================================================================================================
3839
3840
3841void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
3842{
3843 // a) Calculate Q-cumulants from the measured multiparticle correlations.
3844 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants.
3845 // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
3846 // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)
3847 // is called afterwards to correct for this bias.
3848 // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.
3849 // Binning of fCumulants is organized as follows:
3850 //
3851 // 1st bin: QC{2}
3852 // 2nd bin: QC{4}
3853 // 3rd bin: QC{6}
3854 // 4th bin: QC{8}
3855
3856 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants))
3857 {
3858 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants is NULL in AFAWQC::CCIF() !!!!"<<endl;
3859 exit(0);
3860 }
3861
3862 // correlations:
3863 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
3864 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
3865 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
3866 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
3867
3868 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
3869 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
3870 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
3871 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
3872 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
3873
3874 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
3875 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
3876 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
3877 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
3878 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
3879 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
3880 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
3881
3882 // Q-cumulants:
3883 Double_t qc2 = 0.; // QC{2}
3884 Double_t qc4 = 0.; // QC{4}
3885 Double_t qc6 = 0.; // QC{6}
3886 Double_t qc8 = 0.; // QC{8}
3887 if(two) qc2 = two;
3888 if(four) qc4 = four-2.*pow(two,2.);
3889 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
3890 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
3891
3892 // statistical errors of Q-cumulants:
3893 Double_t qc2Error = 0.;
3894 Double_t qc4Error = 0.;
3895 Double_t qc6Error = 0.;
3896 Double_t qc8Error = 0.;
3897
3898 // squared statistical errors of Q-cumulants:
3899 //Double_t qc2ErrorSquared = 0.;
3900 Double_t qc4ErrorSquared = 0.;
3901 Double_t qc6ErrorSquared = 0.;
3902 Double_t qc8ErrorSquared = 0.;
3903
3904 // statistical error of QC{2}:
3905 qc2Error = twoError;
3906
3907 // statistical error of QC{4}:
3908 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
3909 - 8.*two*wCov24;
3910 if(qc4ErrorSquared>0.)
3911 {
3912 qc4Error = pow(qc4ErrorSquared,0.5);
3913 } else
3914 {
3915 cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;
3916 }
3917
3918 // statistical error of QC{6}:
3919 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
3920 + 81.*pow(two,2.)*pow(fourError,2.)
3921 + pow(sixError,2.)
3922 - 162.*two*(4.*pow(two,2.)-four)*wCov24
3923 + 18.*(4.*pow(two,2.)-four)*wCov26
3924 - 18.*two*wCov46;
3925
3926 if(qc6ErrorSquared>0.)
3927 {
3928 qc6Error = pow(qc6ErrorSquared,0.5);
3929 } else
3930 {
3931 cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;
3932 }
3933
3934 // statistical error of QC{8}:
3935 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
3936 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
3937 + 256.*pow(two,2.)*pow(sixError,2.)
3938 + pow(eightError,2.)
3939 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
3940 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
3941 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
3942 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
3943 + 72.*(4.*pow(two,2.)-four)*wCov48
3944 - 32.*two*wCov68;
3945 if(qc8ErrorSquared>0.)
3946 {
3947 qc8Error = pow(qc8ErrorSquared,0.5);
3948 } else
3949 {
3950 cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;
3951 }
3952
3953 // store the results and statistical errors for Q-cumulants:
3954 fIntFlowQcumulants->SetBinContent(1,qc2);
9f33751d 3955 if(TMath::Abs(qc2)>1.e-44){fIntFlowQcumulants->SetBinError(1,qc2Error);}
489d5531 3956 fIntFlowQcumulants->SetBinContent(2,qc4);
9f33751d 3957 if(TMath::Abs(qc4)>1.e-44){fIntFlowQcumulants->SetBinError(2,qc4Error);}
489d5531 3958 fIntFlowQcumulants->SetBinContent(3,qc6);
9f33751d 3959 if(TMath::Abs(qc6)>1.e-44){fIntFlowQcumulants->SetBinError(3,qc6Error);}
489d5531 3960 fIntFlowQcumulants->SetBinContent(4,qc8);
9f33751d 3961 if(TMath::Abs(qc8)>1.e-44){fIntFlowQcumulants->SetBinError(4,qc8Error);}
9da1a4f3 3962
3963 // versus multiplicity:
3964 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3965 for(Int_t b=1;b<=nBins;b++)
3966 {
3967 // correlations:
3968 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
3969 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
3970 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
3971 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
3972
3973 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
3974 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
3975 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
3976 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
3977 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
3978
3979 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
3980 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
3981 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
3982 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
3983 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
3984 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
3985 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
3986
3987 // Q-cumulants:
3988 qc2 = 0.; // QC{2}
3989 qc4 = 0.; // QC{4}
3990 qc6 = 0.; // QC{6}
3991 qc8 = 0.; // QC{8}
3992 if(two) qc2 = two;
3993 if(four) qc4 = four-2.*pow(two,2.);
3994 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
3995 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
3996
3997 // statistical errors of Q-cumulants:
3998 qc2Error = 0.;
3999 qc4Error = 0.;
4000 qc6Error = 0.;
4001 qc8Error = 0.;
4002
4003 // squared statistical errors of Q-cumulants:
4004 //Double_t qc2ErrorSquared = 0.;
4005 qc4ErrorSquared = 0.;
4006 qc6ErrorSquared = 0.;
4007 qc8ErrorSquared = 0.;
4008
4009 // statistical error of QC{2}:
4010 qc2Error = twoError;
4011
4012 // statistical error of QC{4}:
4013 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4014 - 8.*two*wCov24;
4015 if(qc4ErrorSquared>0.)
4016 {
4017 qc4Error = pow(qc4ErrorSquared,0.5);
4018 } else
4019 {
4020 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4021 }
4022
4023 // statistical error of QC{6}:
4024 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4025 + 81.*pow(two,2.)*pow(fourError,2.)
4026 + pow(sixError,2.)
4027 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4028 + 18.*(4.*pow(two,2.)-four)*wCov26
4029 - 18.*two*wCov46;
4030
4031 if(qc6ErrorSquared>0.)
4032 {
4033 qc6Error = pow(qc6ErrorSquared,0.5);
4034 } else
4035 {
4036 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4037 }
4038
4039 // statistical error of QC{8}:
4040 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4041 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4042 + 256.*pow(two,2.)*pow(sixError,2.)
4043 + pow(eightError,2.)
4044 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4045 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4046 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4047 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4048 + 72.*(4.*pow(two,2.)-four)*wCov48
4049 - 32.*two*wCov68;
4050 if(qc8ErrorSquared>0.)
4051 {
4052 qc8Error = pow(qc8ErrorSquared,0.5);
4053 } else
4054 {
4055 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4056 }
4057
4058 // store the results and statistical errors for Q-cumulants:
4059 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
9f33751d 4060 if(TMath::Abs(qc2)>1.e-44){fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);}
9da1a4f3 4061 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
9f33751d 4062 if(TMath::Abs(qc4)>1.e-44){fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);}
9da1a4f3 4063 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
9f33751d 4064 if(TMath::Abs(qc6)>1.e-44){fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);}
9da1a4f3 4065 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
9f33751d 4066 if(TMath::Abs(qc8)>1.e-44){fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);}
9da1a4f3 4067 } // end of for(Int_t b=1;b<=nBins;b++)
489d5531 4068
4069} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4070
489d5531 4071//================================================================================================================================
4072
489d5531 4073void AliFlowAnalysisWithQCumulants::CalculateIntFlow()
4074{
0328db2d 4075 // a) Calculate the final results for reference flow estimates from Q-cumulants.
4076 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of reference flow estimates.
4077 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
489d5531 4078 // Binning of fIntFlow is organized as follows:
4079 //
4080 // 1st bin: v{2,QC}
4081 // 2nd bin: v{4,QC}
4082 // 3rd bin: v{6,QC}
4083 // 4th bin: v{8,QC}
4084
4085 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))
4086 {
4087 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;
4088 exit(0);
4089 }
4090
4091 // Q-cumulants:
4092 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
4093 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
4094 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
4095 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
4096
4097 // correlations:
4098 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4099 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4100 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4101 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
4102
4103 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4104 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4105 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4106 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4107 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
4108
4109 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4110 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4111 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4112 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4113 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4114 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4115 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4116
4117 // integrated flow estimates:
4118 Double_t v2 = 0.; // v{2,QC}
4119 Double_t v4 = 0.; // v{4,QC}
4120 Double_t v6 = 0.; // v{6,QC}
4121 Double_t v8 = 0.; // v{8,QC}
4122
4123 // calculate integrated flow estimates from Q-cumulants:
4124 if(qc2>=0.) v2 = pow(qc2,1./2.);
4125 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
4126 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
4127 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
4128
4129 // statistical errors of integrated flow estimates:
4130 Double_t v2Error = 0.; // statistical error of v{2,QC}
4131 Double_t v4Error = 0.; // statistical error of v{4,QC}
4132 Double_t v6Error = 0.; // statistical error of v{6,QC}
4133 Double_t v8Error = 0.; // statistical error of v{8,QC}
4134
4135 // squares of statistical errors of integrated flow estimates:
4136 Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
4137 Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
4138 Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
4139 Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
4140
4141 // calculate squared statistical errors of integrated flow estimates:
4142 if(two > 0.)
4143 {
4144 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
4145 }
4146 if(2.*pow(two,2.)-four > 0.)
4147 {
4148 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*
4149 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
4150 }
4151 if(six-9.*four*two+12.*pow(two,3.) > 0.)
4152 {
4153 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*
4154 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4155 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
4156 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
4157 }
4158 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
4159 {
4160 v8ErrorSquared = (4./pow(33,1./4.))*(1./pow(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.),7./4.))*
4161 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4162 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4163 + pow(two,2.)*pow(sixError,2.)
4164 + (1./256.)*pow(eightError,2.)
4165 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4166 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4167 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4168 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
4169 + (9./32.)*(4.*pow(two,2.)-four)*wCov48
4170 - (1./8.)*two*wCov68);
4171 }
4172
4173 // calculate statistical errors of integrated flow estimates:
4174 if(v2ErrorSquared > 0.)
4175 {
4176 v2Error = pow(v2ErrorSquared,0.5);
4177 } else
4178 {
4179 cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;
4180 }
4181 if(v4ErrorSquared > 0.)
4182 {
4183 v4Error = pow(v4ErrorSquared,0.5);
4184 } else
4185 {
4186 cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;
4187 }
4188 if(v6ErrorSquared > 0.)
4189 {
4190 v6Error = pow(v6ErrorSquared,0.5);
4191 } else
4192 {
4193 cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;
4194 }
4195 if(v8ErrorSquared > 0.)
4196 {
4197 v8Error = pow(v8ErrorSquared,0.5);
4198 } else
4199 {
4200 cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;
4201 }
4202
4203 // store the results and statistical errors of integrated flow estimates:
4204 fIntFlow->SetBinContent(1,v2);
4205 fIntFlow->SetBinError(1,v2Error);
4206 fIntFlow->SetBinContent(2,v4);
4207 fIntFlow->SetBinError(2,v4Error);
4208 fIntFlow->SetBinContent(3,v6);
4209 fIntFlow->SetBinError(3,v6Error);
4210 fIntFlow->SetBinContent(4,v8);
4211 fIntFlow->SetBinError(4,v8Error);
9da1a4f3 4212
4213 // versus multiplicity:
4214 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4215 for(Int_t b=1;b<=nBins;b++)
4216 {
4217 // Q-cumulants:
4218 qc2 = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
4219 qc4 = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
4220 qc6 = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
4221 qc8 = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
4222
4223 // correlations:
4224 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
4225 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
4226 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
4227 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
4228
4229 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4230 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
4231 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
4232 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
4233 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
4234
4235 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4236 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4237 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4238 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4239 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4240 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4241 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4242
4243 // integrated flow estimates:
4244 v2 = 0.; // v{2,QC}
4245 v4 = 0.; // v{4,QC}
4246 v6 = 0.; // v{6,QC}
4247 v8 = 0.; // v{8,QC}
4248
4249 // calculate integrated flow estimates from Q-cumulants:
4250 if(qc2>=0.) v2 = pow(qc2,1./2.);
4251 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
4252 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
4253 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
4254
4255 // statistical errors of integrated flow estimates:
4256 v2Error = 0.; // statistical error of v{2,QC}
4257 v4Error = 0.; // statistical error of v{4,QC}
4258 v6Error = 0.; // statistical error of v{6,QC}
4259 v8Error = 0.; // statistical error of v{8,QC}
4260
4261 // squares of statistical errors of integrated flow estimates:
4262 v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
4263 v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
4264 v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
4265 v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
4266
4267 // calculate squared statistical errors of integrated flow estimates:
4268 if(two > 0.)
4269 {
4270 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
4271 }
4272 if(2.*pow(two,2.)-four > 0.)
4273 {
4274 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*
4275 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
4276 }
4277 if(six-9.*four*two+12.*pow(two,3.) > 0.)
4278 {
4279 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*
4280 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4281 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
4282 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
4283 }
4284 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
4285 {
4286 v8ErrorSquared = (4./pow(33,1./4.))*(1./pow(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.),7./4.))*
4287 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4288 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4289 + pow(two,2.)*pow(sixError,2.)
4290 + (1./256.)*pow(eightError,2.)
4291 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4292 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4293 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4294 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
4295 + (9./32.)*(4.*pow(two,2.)-four)*wCov48
4296 - (1./8.)*two*wCov68);
4297 }
4298
4299 // calculate statistical errors of integrated flow estimates:
4300 if(v2ErrorSquared > 0.)
4301 {
4302 v2Error = pow(v2ErrorSquared,0.5);
4303 } else
4304 {
4305 // cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;
4306 }
4307 if(v4ErrorSquared > 0.)
4308 {
4309 v4Error = pow(v4ErrorSquared,0.5);
4310 } else
4311 {
4312 // cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;
4313 }
4314 if(v6ErrorSquared > 0.)
4315 {
4316 v6Error = pow(v6ErrorSquared,0.5);
4317 } else
4318 {
4319 // cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;
4320 }
4321 if(v8ErrorSquared > 0.)
4322 {
4323 v8Error = pow(v8ErrorSquared,0.5);
4324 } else
4325 {
4326 // cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;
4327 }
4328
4329 // store the results and statistical errors of integrated flow estimates:
4330 fIntFlowVsM[0]->SetBinContent(b,v2);
4331 fIntFlowVsM[0]->SetBinError(b,v2Error);
4332 fIntFlowVsM[1]->SetBinContent(b,v4);
4333 fIntFlowVsM[1]->SetBinError(b,v4Error);
4334 fIntFlowVsM[2]->SetBinContent(b,v6);
4335 fIntFlowVsM[2]->SetBinError(b,v6Error);
4336 fIntFlowVsM[3]->SetBinContent(b,v8);
4337 fIntFlowVsM[3]->SetBinError(b,v8Error);
4338 } // end of for(Int_t b=1;b<=nBins;b++)
489d5531 4339
4340} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()
4341
489d5531 4342//================================================================================================================================
4343
489d5531 4344void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4345{
4346 // Fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
4347
4348 if(!fIntFlow)
4349 {
4350 cout<<"WARNING: fIntFlow is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
4351 exit(0);
4352 }
4353
4354 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
4355 {
4356 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
4357 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
4358 exit(0);
4359 }
4360
4361 Double_t v2 = fIntFlow->GetBinContent(1);
4362 Double_t v4 = fIntFlow->GetBinContent(2);
4363 Double_t v6 = fIntFlow->GetBinContent(3);
4364 Double_t v8 = fIntFlow->GetBinContent(4);
4365
4366 Double_t v2Error = fIntFlow->GetBinError(1);
4367 Double_t v4Error = fIntFlow->GetBinError(2);
4368 Double_t v6Error = fIntFlow->GetBinError(3);
4369 Double_t v8Error = fIntFlow->GetBinError(4);
4370
4371 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error); // to be improved (hardwired 2nd in the name)
4372 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error); // to be improved (hardwired 4th in the name)
4373 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4374 {
4375 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error); // to be improved (hardwired 6th in the name)
4376 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error); // to be improved (hardwired 8th in the name)
4377 }
4378
4379} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4380
4381
4382//================================================================================================================================
4383
4384
4385/*
4386void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4387{
4388 // apply correction for non-uniform acceptance to cumulants for integrated flow
4389 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
4390
4391 // shortcuts for the flags:
4392 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4393 Int_t eW = -1;
4394
4395 if(eventWeights == "exact")
4396 {
4397 eW = 0;
4398 }
4399
4400 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
4401 {
4402 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
4403 cout<<"pW = "<<pW<<endl;
4404 cout<<"eW = "<<eW<<endl;
4405 exit(0);
4406 }
4407
4408 // non-corrected cumulants:
4409 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
4410 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
4411 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
4412 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
4413 // statistical error of non-corrected cumulants:
4414 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
4415 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
4416 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
4417 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
4418 // corrections for non-uniform acceptance:
4419 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
4420 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
4421 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
4422 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
4423 // corrected cumulants:
4424 Double_t qc2Corrected = qc2 + qc2Correction;
4425 Double_t qc4Corrected = qc4 + qc4Correction;
4426 Double_t qc6Corrected = qc6 + qc6Correction;
4427 Double_t qc8Corrected = qc8 + qc8Correction;
4428
4429 // ... to be improved (I need here also to correct error of QCs for NUA.
4430 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
4431
4432 // store corrected results and statistical errors for cumulants:
4433 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
4434 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
4435 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
4436 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
4437 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
4438 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
4439 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
4440 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
4441
4442} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4443*/
4444
4445
4446//================================================================================================================================
4447
4448
4449/*
4450void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4451{
4452 // print on the screen QC{n,biased}/QC{n,corrected}
4453
4454 // shortcuts for the flags:
4455 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4456
4457 Int_t eW = -1;
4458
4459 if(eventWeights == "exact")
4460 {
4461 eW = 0;
4462 }
4463
4464 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
4465 {
4466 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
4467 cout<<"pW = "<<pW<<endl;
4468 cout<<"eW = "<<eW<<endl;
4469 exit(0);
4470 }
4471
4472 cout<<endl;
4473 cout<<" Quantifying the bias to Q-cumulants from"<<endl;
4474 cout<<" non-uniform acceptance of the detector:"<<endl;
4475 cout<<endl;
4476
4477 if(fCumulants[pW][eW][1]->GetBinContent(1))
4478 {
4479 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
4480 }
4481 if(fCumulants[pW][eW][1]->GetBinContent(2))
4482 {
4483 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
4484 }
4485
4486 cout<<endl;
4487
4488} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4489*/
4490
4491
4492//================================================================================================================================
4493
4494
4495void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4496{
4497 // Calculate all correlations needed for integrated flow using particle weights.
4498
4499 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4500 //
4501 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4502 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4503 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4504 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4505 // 5th bin: ---- EMPTY ----
4506 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4507 // 7th bin: <3>_{3n|2n,1n} = ...
4508 // 8th bin: <3>_{4n|2n,2n} = ...
4509 // 9th bin: <3>_{4n|3n,1n} = ...
4510 // 10th bin: ---- EMPTY ----
4511 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4512 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4513 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4514 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4515 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4516 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4517 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4518 // 18th bin: ---- EMPTY ----
4519 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4520 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4521 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4522 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4523 // 23rd bin: ---- EMPTY ----
4524 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4525 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4526 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4527 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4528 // 28th bin: ---- EMPTY ----
4529 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4530 // 30th bin: ---- EMPTY ----
4531 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4532
4533 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4534 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4535
4536 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4537 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4538
4539 // multiplicity (number of particles used to determine the reaction plane)
4540 Double_t dMult = (*fSMpk)(0,0);
4541
4542 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4543 Double_t dReQ1n1k = (*fReQ)(0,1);
4544 Double_t dReQ2n2k = (*fReQ)(1,2);
4545 Double_t dReQ3n3k = (*fReQ)(2,3);
4546 Double_t dReQ4n4k = (*fReQ)(3,4);
4547 Double_t dReQ1n3k = (*fReQ)(0,3);
4548 Double_t dImQ1n1k = (*fImQ)(0,1);
4549 Double_t dImQ2n2k = (*fImQ)(1,2);
4550 Double_t dImQ3n3k = (*fImQ)(2,3);
4551 Double_t dImQ4n4k = (*fImQ)(3,4);
4552 Double_t dImQ1n3k = (*fImQ)(0,3);
4553
4554 // dMs are variables introduced in order to simplify some Eqs. bellow:
4555 //..............................................................................................
4556 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4557 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4558 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4559 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4560 Double_t dM31 = (*fSMpk)(0,3)*(*fSMpk)(0,1)-(*fSMpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j
4561 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4562 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4563 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4564 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4565 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
4566 //..............................................................................................
4567
4568 // 2-particle correlations:
4569 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4570 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4571 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4572 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4573 if(dMult>1)
4574 {
4575 if(dM11)
4576 {
4577 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
4578 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4579 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4580 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4581 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4582 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4583 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4584 }
4585 if(dM22)
4586 {
4587 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
4588 // ...
4589 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4590 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4591 }
4592 if(dM33)
4593 {
4594 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
4595 // ...
4596 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4597 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4598 }
4599 if(dM44)
4600 {
4601 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
4602 // ...
4603 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4604 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4605 }
4606 } // end of if(dMult>1)
4607
4608 // extra 2-particle correlations:
4609 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4610 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4611 if(dMult>1)
4612 {
4613 if(dM31)
4614 {
4615 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
4616 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4617 }
4618 if(dM211)
4619 {
4620 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
4621 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
4622 - (*fSMpk)(0,4)))/dM211;
4623 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4624 }
4625 } // end of if(dMult>1)
4626 //..............................................................................................
4627
4628 //..............................................................................................
4629 // 3-particle correlations:
4630 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4631
4632 if(dMult>2)
4633 {
4634 if(dM211)
4635 {
4636 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4637 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4638 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
4639 + 2.*(*fSMpk)(0,4))/dM211;
4640 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4641 }
4642 } // end of if(dMult>2)
4643 //..............................................................................................
4644
4645 //..............................................................................................
4646 // 4-particle correlations:
4647 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4648 if(dMult>3)
4649 {
4650 if(dM1111)
4651 {
4652 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4653 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4654 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4655 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
4656 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4657 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
4658
4659 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4660 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4661 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4662 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4663 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
4664 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4665 }
4666 } // end of if(dMult>3)
4667 //..............................................................................................
4668
4669} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4670
4671
4672//================================================================================================================================
4673
4674
4675void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
4676{
4677 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
4678 // Remark: here we take weighted correlations!
4679
4680 /*
4681
4682 // binning of fQProductsW is organized as follows:
4683 //
4684 // 1st bin: <2><4>
4685 // 2nd bin: <2><6>
4686 // 3rd bin: <2><8>
4687 // 4th bin: <4><6>
4688 // 5th bin: <4><8>
4689 // 6th bin: <6><8>
4690
4691 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
4692
4693 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4694 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4695 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4696 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
4697
4698 Double_t twoEBEW = 0.; // <2>
4699 Double_t fourEBEW = 0.; // <4>
4700
4701 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
4702 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
4703
4704 // <2><4>
4705 if(dMult>3)
4706 {
4707 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
4708 }
4709
4710 */
4711
4712} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
4713
4714
4715//================================================================================================================================
4716
4717
4718void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4719{
4720 // Initialize all arrays used to calculate integrated flow.
4721
4722 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4723 {
4724 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
0328db2d 4725 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
489d5531 4726 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4727 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
2001bc3a 4728 for(Int_t ci=0;ci<4;ci++) // correction term index
4729 {
4730 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
4731 }
0328db2d 4732 for(Int_t power=0;power<2;power++) // linear or quadratic
4733 {
4734 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4735 }
489d5531 4736 }
4737 for(Int_t power=0;power<2;power++) // linear or quadratic
4738 {
4739 fIntFlowSumOfEventWeights[power] = NULL;
4740 }
4741 for(Int_t i=0;i<3;i++) // print on the screen the final results (0=NONAME, 1=RP, 2=POI)
4742 {
4743 fPrintFinalResults[i] = kTRUE;
4744 }
ff70ca91 4745 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4746 {
4747 fIntFlowCorrelationsVsMPro[ci] = NULL;
4748 fIntFlowCorrelationsVsMHist[ci] = NULL;
4749 fIntFlowQcumulantsVsM[ci] = NULL;
4750 fIntFlowVsM[ci] = NULL;
2001bc3a 4751 fIntFlowDetectorBiasVsM[ci] = NULL;
ff70ca91 4752 for(Int_t lc=0;lc<2;lc++)
4753 {
4754 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4755 }
4756 }
4757 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4758 {
4759 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4760 fIntFlowCovariancesVsM[pi] = NULL;
4761 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4762 }
4763
489d5531 4764} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4765
489d5531 4766//================================================================================================================================
4767
489d5531 4768void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4769{
4770 // Initialize all arrays needed to calculate differential flow.
4771 // a) Initialize lists holding profiles;
4772 // b) Initialize lists holding histograms;
4773 // c) Initialize event-by-event quantities;
4774 // d) Initialize profiles;
4775 // e) Initialize histograms holding final results.
4776
4777 // a) Initialize lists holding profiles;
4778 for(Int_t t=0;t<2;t++) // type (RP, POI)
4779 {
4780 for(Int_t pe=0;pe<2;pe++) // pt or eta
4781 {
4782 fDiffFlowCorrelationsProList[t][pe] = NULL;
4783 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4784 fDiffFlowCorrectionsProList[t][pe] = NULL;
4785 }
4786 }
4787
4788 // b) Initialize lists holding histograms;
4789 for(Int_t t=0;t<2;t++) // type (RP, POI)
4790 {
4791 for(Int_t pe=0;pe<2;pe++) // pt or eta
4792 {
4793 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4794 for(Int_t power=0;power<2;power++)
4795 {
4796 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
4797 } // end of for(Int_t power=0;power<2;power++)
4798 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
4799 fDiffFlowCorrectionsHistList[t][pe] = NULL;
4800 fDiffFlowCovariancesHistList[t][pe] = NULL;
4801 fDiffFlowCumulantsHistList[t][pe] = NULL;
4802 fDiffFlowHistList[t][pe] = NULL;
4803 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4804 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
4805
4806 // c) Initialize event-by-event quantities:
4807 // 1D:
4808 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4809 {
4810 for(Int_t pe=0;pe<2;pe++) // pt or eta
4811 {
4812 for(Int_t m=0;m<4;m++) // multiple of harmonic
4813 {
4814 for(Int_t k=0;k<9;k++) // power of weight
4815 {
4816 fReRPQ1dEBE[t][pe][m][k] = NULL;
4817 fImRPQ1dEBE[t][pe][m][k] = NULL;
4818 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4819 }
4820 }
4821 }
4822 }
4823 // 1D:
4824 for(Int_t t=0;t<2;t++) // type (RP or POI)
4825 {
4826 for(Int_t pe=0;pe<2;pe++) // pt or eta
4827 {
4828 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4829 {
4830 for(Int_t cti=0;cti<9;cti++) // correction term index
4831 {
4832 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
4833 }
4834 }
4835 }
4836 }
4837 // 2D:
4838 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4839 {
4840 for(Int_t m=0;m<4;m++) // multiple of harmonic
4841 {
4842 for(Int_t k=0;k<9;k++) // power of weight
4843 {
4844 fReRPQ2dEBE[t][m][k] = NULL;
4845 fImRPQ2dEBE[t][m][k] = NULL;
4846 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4847 }
4848 }
4849 }
4850
4851 // d) Initialize profiles:
4852 for(Int_t t=0;t<2;t++) // type: RP or POI
4853 {
4854 for(Int_t pe=0;pe<2;pe++) // pt or eta
4855 {
4856 for(Int_t ci=0;ci<4;ci++) // correlation index
4857 {
4858 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
4859 } // end of for(Int_t ci=0;ci<4;ci++)
4860 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4861 {
4862 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4863 {
4864 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
4865 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4866 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4867 // correction terms for nua:
4868 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4869 {
4870 for(Int_t cti=0;cti<9;cti++) // correction term index
4871 {
4872 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
4873 }
4874 }
4875 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4876 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4877
4878 // e) Initialize histograms holding final results.
4879 for(Int_t t=0;t<2;t++) // type: RP or POI
4880 {
4881 for(Int_t pe=0;pe<2;pe++) // pt or eta
4882 {
4883 for(Int_t ci=0;ci<4;ci++) // correlation index
4884 {
4885 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
4886 fDiffFlowCumulants[t][pe][ci] = NULL;
4887 fDiffFlow[t][pe][ci] = NULL;
4888 } // end of for(Int_t ci=0;ci<4;ci++)
4889 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4890 {
4891 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
4892 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4893 // correction terms for nua:
4894 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4895 {
4896 for(Int_t cti=0;cti<9;cti++) // correction term index
4897 {
4898 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
4899 }
4900 }
4901 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4902 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4903
4904 // sum of event weights for reduced correlations:
4905 for(Int_t t=0;t<2;t++) // type = RP or POI
4906 {
4907 for(Int_t pe=0;pe<2;pe++) // pt or eta
4908 {
4909 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
4910 {
4911 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
4912 {
4913 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
4914 }
4915 }
4916 }
4917 }
4918 // product of event weights for both types of correlations:
4919 for(Int_t t=0;t<2;t++) // type = RP or POI
4920 {
4921 for(Int_t pe=0;pe<2;pe++) // pt or eta
4922 {
4923 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4924 {
4925 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4926 {
4927 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
4928 }
4929 }
4930 }
4931 }
4932
4933
4934
4935
4936 /*
4937
4938 // nested lists in fDiffFlowProfiles:
4939 for(Int_t t=0;t<2;t++)
4940 {
4941 fDFPType[t] = NULL;
4942 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
4943 {
4944 fDFPParticleWeights[t][pW] = NULL;
4945 for(Int_t eW=0;eW<2;eW++)
4946 {
4947 fDFPEventWeights[t][pW][eW] = NULL;
4948 fDiffFlowCorrelations[t][pW][eW] = NULL;
4949 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
4950 for(Int_t sc=0;sc<2;sc++)
4951 {
4952 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
4953 }
4954 }
4955 }
4956 }
4957
4958
4959 */
4960
4961
4962
4963 /*
4964 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
4965 {
4966 for(Int_t eW=0;eW<2;eW++)
4967 {
4968 // correlations:
4969 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
4970 {
4971 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
4972 }
4973 // products of correlations:
4974 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
4975 {
4976 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
4977 }
4978 // correction terms:
4979 for(Int_t sc=0;sc<2;sc++)
4980 {
4981 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
4982 {
4983 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
4984 }
4985 }
4986 }
4987 }
4988 */
4989
4990} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4991
4992
4993//================================================================================================================================
4994 /*
4995
4996
4997void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
4998{
4999 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
5000
5001 if(type == "RP") // to be improved (removed)
5002 {
5003 cout<<endl;
5004 }
5005 // ...
5006
5007
5008 Int_t typeFlag = -1;
5009
5010 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
5011 // index:
5012 // 0: <2'>
5013 // 1: <4'>
5014
5015 // multiplicity:
5016 Double_t dMult = (*fSMpk)(0,0);
5017
5018 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5019 Double_t dReQ1n = (*fReQ)(0,0);
5020 Double_t dReQ2n = (*fReQ)(1,0);
5021 //Double_t dReQ3n = (*fReQ)(2,0);
5022 //Double_t dReQ4n = (*fReQ)(3,0);
5023 Double_t dImQ1n = (*fImQ)(0,0);
5024 Double_t dImQ2n = (*fImQ)(1,0);
5025 //Double_t dImQ3n = (*fImQ)(2,0);
5026 //Double_t dImQ4n = (*fImQ)(3,0);
5027
5028 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
5029 for(Int_t p=1;p<=fnBinsPt;p++)
5030 {
5031 for(Int_t e=1;e<=fnBinsEta;e++)
5032 {
5033 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5034 Double_t p1n0kRe = 0.;
5035 Double_t p1n0kIm = 0.;
5036
5037 // number of POIs in particular (pt,eta) bin:
5038 Double_t mp = 0.;
5039
5040 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin):
5041 Double_t q1n0kRe = 0.;
5042 Double_t q1n0kIm = 0.;
5043 Double_t q2n0kRe = 0.;
5044 Double_t q2n0kIm = 0.;
5045
5046 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
5047 Double_t mq = 0.;
5048
5049 // q_{m*n,0}:
5050 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
5051 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
5052 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
5053 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
5054 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
5055 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
5056 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
5057 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
5058
5059 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5060
5061 if(type == "POI")
5062 {
5063 // p_{m*n,0}:
5064 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5065 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5066 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5067 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5068
5069 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5070
5071 typeFlag = 1;
5072 }
5073 else if(type == "RP")
5074 {
5075 // p_{m*n,0} = q_{m*n,0}:
5076 p1n0kRe = q1n0kRe;
5077 p1n0kIm = q1n0kIm;
5078 mp = mq;
5079
5080 typeFlag = 0;
5081 }
5082
5083 // count events with non-empty (pt,eta) bin:
5084 if(mp>0)
5085 {
5086 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
5087 }
5088
5089 // 2'-particle correlation for particular (pt,eta) bin:
5090 Double_t two1n1nPtEta = 0.;
5091 if(mp*dMult-mq)
5092 {
5093 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
5094 / (mp*dMult-mq);
5095
5096 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
5097 if(type == "POI")
5098 {
5099 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5100
5101 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5102 }
5103 else if(type == "RP")
5104 {
5105 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5106 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5107 }
5108 } // end of if(mp*dMult-mq)
5109
5110 // 4'-particle correlation:
5111 Double_t four1n1n1n1nPtEta = 0.;
5112 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5113 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
5114 {
5115 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5116 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
5117 - 2.*q2n0kIm*dReQ1n*dImQ1n
5118 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
5119 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
5120 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5121 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
5122 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
5123 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
5124 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5125 + 2.*mq*dMult
5126 - 6.*mq)
5127 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5128 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5129
5130 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5131 if(type == "POI")
5132 {
5133 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5134 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5135 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5136
5137 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5138 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5139 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5140 }
5141 else if(type == "RP")
5142 {
5143 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5144 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5145 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5146
5147 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5148 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5149 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5150 }
5151 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5152 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
5153
5154 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5155 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5156
5157
5158
5159
5160
5161} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
5162
5163
5164
5165
5166
5167
5168//================================================================================================================================
5169
5170
5171void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5172{
5173 // calculate all weighted correlations needed for differential flow
5174
5175 if(type == "RP") // to be improved (removed)
5176 {
5177 cout<<endl;
5178 }
5179 // ...
5180
5181
5182
5183
5184 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5185 Double_t dReQ1n1k = (*fReQ)(0,1);
5186 Double_t dReQ2n2k = (*fReQ)(1,2);
5187 Double_t dReQ1n3k = (*fReQ)(0,3);
5188 //Double_t dReQ4n4k = (*fReQ)(3,4);
5189 Double_t dImQ1n1k = (*fImQ)(0,1);
5190 Double_t dImQ2n2k = (*fImQ)(1,2);
5191 Double_t dImQ1n3k = (*fImQ)(0,3);
5192 //Double_t dImQ4n4k = (*fImQ)(3,4);
5193
5194 // S^M_{p,k} (see .h file for the definition of fSMpk):
5195 Double_t dSM1p1k = (*fSMpk)(0,1);
5196 Double_t dSM1p2k = (*fSMpk)(0,2);
5197 Double_t dSM1p3k = (*fSMpk)(0,3);
5198 Double_t dSM2p1k = (*fSMpk)(1,1);
5199 Double_t dSM3p1k = (*fSMpk)(2,1);
5200
5201 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
5202 for(Int_t p=1;p<=fnBinsPt;p++)
5203 {
5204 for(Int_t e=1;e<=fnBinsEta;e++)
5205 {
5206 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5207 Double_t p1n0kRe = 0.;
5208 Double_t p1n0kIm = 0.;
5209
5210 // number of POIs in particular (pt,eta) bin):
5211 Double_t mp = 0.;
5212
5213 // real and imaginary parts of q_{m*n,k}:
5214 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
5215 Double_t q1n2kRe = 0.;
5216 Double_t q1n2kIm = 0.;
5217 Double_t q2n1kRe = 0.;
5218 Double_t q2n1kIm = 0.;
5219
5220 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5221 Double_t s1p1k = 0.;
5222 Double_t s1p2k = 0.;
5223 Double_t s1p3k = 0.;
5224
5225 // M0111 from Eq. (118) in QC2c (to be improved (notation))
5226 Double_t dM0111 = 0.;
5227
5228 if(type == "POI")
5229 {
5230 // p_{m*n,0}:
5231 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5232 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5233 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5234 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5235
5236 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5237
5238 // q_{m*n,k}:
5239 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
5240 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
5241 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
5242 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
5243 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
5244 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
5245 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
5246 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
5247
5248 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5249 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
5250 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
5251 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
5252
5253 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5254 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5255 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5256 + 2.*(s1p3k-s1p2k*dSM1p1k));
5257 }
5258 else if(type == "RP")
5259 {
5260 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
5261 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5262 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
5263 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
5264
5265 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5266
5267 // q_{m*n,k}:
5268 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
5269 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
5270 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
5271 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
5272 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
5273 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
5274 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
5275 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
5276
5277 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5278 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
5279 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
5280 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
5281
5282 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5283 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5284 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5285 + 2.*(s1p3k-s1p2k*dSM1p1k));
5286 //...............................................................................................
5287 }
5288
5289 // 2'-particle correlation:
5290 Double_t two1n1nW0W1PtEta = 0.;
5291 if(mp*dSM1p1k-s1p1k)
5292 {
5293 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
5294 / (mp*dSM1p1k-s1p1k);
5295
5296 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5297 if(type == "POI")
5298 {
5299 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5300 // mp*dSM1p1k-s1p1k);
5301 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5302 }
5303 else if(type == "RP")
5304 {
5305 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5306 // mp*dSM1p1k-s1p1k);
5307 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5308 }
5309 } // end of if(mp*dMult-dmPrimePrimePtEta)
5310
5311 // 4'-particle correlation:
5312 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
5313 if(dM0111)
5314 {
5315 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5316 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
5317 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
5318 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
5319 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
5320 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5321 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
5322 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
5323 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
5324 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
5325 + 2.*s1p1k*dSM1p2k
5326 - 6.*s1p3k)
5327 / dM0111; // to be imropoved (notation of dM0111)
5328
5329 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5330 if(type == "POI")
5331 {
5332 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5333 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5334 }
5335 else if(type == "RP")
5336 {
5337 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5338 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5339 }
5340 } // end of if(dM0111)
5341
5342 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5343 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5344
5345
5346
5347
5348} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5349
5350
5351//================================================================================================================================
5352
5353 */
5354
5355/*
5356void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5357{
5358 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
5359 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
5360 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
5361
5362 Int_t typeFlag = -1;
5363 Int_t pWeightsFlag = -1;
5364 Int_t eWeightsFlag = -1;
5365
5366 if(type == "RP")
5367 {
5368 typeFlag = 0;
5369 } else if(type == "POI")
5370 {
5371 typeFlag = 1;
5372 } else
5373 {
5374 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
5375 exit(0);
5376 }
5377
5378 if(!useParticleWeights)
5379 {
5380 pWeightsFlag = 0;
5381 } else
5382 {
5383 pWeightsFlag = 1;
5384 }
5385
5386 if(eventWeights == "exact")
5387 {
5388 eWeightsFlag = 0;
5389 }
5390
5391 // shortcuts:
5392 Int_t t = typeFlag;
5393 Int_t pW = pWeightsFlag;
5394 Int_t eW = eWeightsFlag;
5395
5396 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
5397 // pt:
5398 for(Int_t p=1;p<fnBinsPt;p++)
5399 {
5400 Double_t contentPt = 0.;
5401 for(Int_t e=1;e<=fnBinsEta;e++)
5402 {
5403 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5404 }
5405 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
5406 }
5407 // eta:
5408 for(Int_t e=1;e<fnBinsEta;e++)
5409 {
5410 Double_t contentEta = 0.;
5411 for(Int_t p=1;p<=fnBinsPt;p++)
5412 {
5413 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5414 }
5415 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
5416 }
5417
5418 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
5419 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
5420
5421 for(Int_t pe=0;pe<2;pe++) // pt or eta
5422 {
5423 for(Int_t ci=0;ci<4;ci++) // correlation index
5424 {
5425 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
5426 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
5427 }
5428 }
5429
5430 // transfer 2D profile into 2D histogram:
5431 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
5432 for(Int_t ci=0;ci<4;ci++)
5433 {
5434 for(Int_t p=1;p<=fnBinsPt;p++)
5435 {
5436 for(Int_t e=1;e<=fnBinsEta;e++)
5437 {
5438 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5439 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5440 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
5441 Double_t error = 0.;
5442 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
5443 if(nEvts>0)
5444 {
5445 error = spread/pow(nEvts,0.5);
5446 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
5447 }
5448 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5449 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5450 } // end of for(Int_t ci=0;ci<4;ci++)
5451
5452 // transfer 1D profile into 1D histogram (pt):
5453 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5454 for(Int_t ci=0;ci<4;ci++)
5455 {
5456 for(Int_t p=1;p<=fnBinsPt;p++)
5457 {
5458 if(profile[0][ci])
5459 {
5460 Double_t correlation = profile[0][ci]->GetBinContent(p);
5461 Double_t spread = profile[0][ci]->GetBinError(p);
5462 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
5463 Double_t error = 0.;
5464 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
5465 if(nEvts>0)
5466 {
5467 error = spread/pow(nEvts,0.5);
5468 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
5469 }
5470 }
5471 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5472 } // end of for(Int_t ci=0;ci<4;ci++)
5473
5474 // transfer 1D profile into 1D histogram (eta):
5475 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5476 for(Int_t ci=0;ci<4;ci++)
5477 {
5478 for(Int_t e=1;e<=fnBinsEta;e++)
5479 {
5480 if(profile[1][ci])
5481 {
5482 Double_t correlation = profile[1][ci]->GetBinContent(e);
5483 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
5484 }
5485 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5486 } // end of for(Int_t ci=0;ci<4;ci++)
5487
5488} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5489*/
5490
5491
5492//================================================================================================================================
5493
5494
5495void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5496{
5497 // calcualate cumulants for differential flow from measured correlations
5498 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
5499 // to be improved (description)
5500
5501 Int_t typeFlag = -1;
5502 Int_t ptEtaFlag = -1;
5503
5504 if(type == "RP")
5505 {
5506 typeFlag = 0;
5507 } else if(type == "POI")
5508 {
5509 typeFlag = 1;
5510 }
5511
5512 if(ptOrEta == "Pt")
5513 {
5514 ptEtaFlag = 0;
5515 } else if(ptOrEta == "Eta")
5516 {
5517 ptEtaFlag = 1;
5518 }
5519
5520 // shortcuts:
5521 Int_t t = typeFlag;
5522 Int_t pe = ptEtaFlag;
5523
5524 // common:
5525 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5526
5527 // correlation <<2>>:
5528 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5529
5530 // 1D:
5531 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5532 {
5533 // reduced correlations:
5534 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)
5535 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)
5536 // final statistical error of reduced correlations:
5537 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
5538 // QC{2'}:
5539 Double_t qc2Prime = twoPrime; // QC{2'}
5540 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
5541 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5542 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
5543 // QC{4'}:
5544 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5545 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5546 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5547
5548
5549 /*
5550 // 2D (pt,eta):
5551 // to be improved (see documentation if I can do all this without looping)
5552 for(Int_t p=1;p<=fnBinsPt;p++)
5553 {
5554 for(Int_t e=1;e<=fnBinsEta;e++)
5555 {
5556 // reduced correlations:
5557 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5558 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5559 for(Int_t nua=0;nua<2;nua++)
5560 {
5561 // QC{2'}:
5562 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5563 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
5564 // QC{4'}:
5565 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5566 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
5567 } // end of for(Int_t nua=0;nua<2;nua++)
5568 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5569 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5570 */
5571
5572} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5573
5574
5575//================================================================================================================================
5576
5577
5578void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5579{
5580 // calculate final results for integrated flow of RPs and POIs
5581
5582 Int_t typeFlag = -1;
5583
5584 if(type == "RP")
5585 {
5586 typeFlag = 0;
5587 } else if(type == "POI")
5588 {
5589 typeFlag = 1;
5590 } else
5591 {
5592 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
5593 exit(0);
5594 }
5595
5596 // shortcuts:
5597 Int_t t = typeFlag;
5598
5599 // pt yield:
5600 TH1F *yield2ndPt = NULL;
5601 TH1F *yield4thPt = NULL;
5602 TH1F *yield6thPt = NULL;
5603 TH1F *yield8thPt = NULL;
5604
5605 if(type == "POI")
5606 {
5607 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5608 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5609 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5610 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5611 }
5612 else if(type == "RP")
5613 {
5614 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5615 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5616 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5617 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5618 }
5619
5620 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5621
5622 TH1D *flow2ndPt = NULL;
5623 TH1D *flow4thPt = NULL;
5624 TH1D *flow6thPt = NULL;
5625 TH1D *flow8thPt = NULL;
5626
5627 // to be improved (hardwired pt index)
5628 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5629 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5630 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5631 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
5632
5633 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5634 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5635
5636 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5637 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5638
5639 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5640 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5641
5642 // looping over pt bins:
5643 for(Int_t p=1;p<nBinsPt+1;p++)
5644 {
5645 dvn2nd = flow2ndPt->GetBinContent(p);
5646 dvn4th = flow4thPt->GetBinContent(p);
5647 dvn6th = flow6thPt->GetBinContent(p);
5648 dvn8th = flow8thPt->GetBinContent(p);
5649
5650 dErrvn2nd = flow2ndPt->GetBinError(p);
5651 dErrvn4th = flow4thPt->GetBinError(p);
5652 dErrvn6th = flow6thPt->GetBinError(p);
5653 dErrvn8th = flow8thPt->GetBinError(p);
5654
5655 dYield2nd = yield2ndPt->GetBinContent(p);
5656 dYield4th = yield4thPt->GetBinContent(p);
5657 dYield6th = yield6thPt->GetBinContent(p);
5658 dYield8th = yield8thPt->GetBinContent(p);
5659
5660 dVn2nd += dvn2nd*dYield2nd;
5661 dVn4th += dvn4th*dYield4th;
5662 dVn6th += dvn6th*dYield6th;
5663 dVn8th += dvn8th*dYield8th;
5664
5665 dSum2nd += dYield2nd;
5666 dSum4th += dYield4th;
5667 dSum6th += dYield6th;
5668 dSum8th += dYield8th;
5669
5670 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5671 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5672 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5673 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5674
5675 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5676
5677 // normalizing the results for integrated flow:
5678 if(dSum2nd)
5679 {
5680 dVn2nd /= dSum2nd;
5681 dErrVn2nd /= (dSum2nd*dSum2nd);
5682 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5683 }
5684 if(dSum4th)
5685 {
5686 dVn4th /= dSum4th;
5687 dErrVn4th /= (dSum4th*dSum4th);
5688 dErrVn4th = TMath::Sqrt(dErrVn4th);
5689 }
5690 //if(dSum6th) dVn6th/=dSum6th;
5691 //if(dSum8th) dVn8th/=dSum8th;
5692
5693 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5694 if(type == "POI")
5695 {
5696 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5697 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5698 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5699 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5700 }
5701 else if (type == "RP")
5702 {
5703 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5704 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5705 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5706 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5707 }
5708
5709 delete flow2ndPt;
5710 delete flow4thPt;
5711 //delete flow6thPt;
5712 //delete flow8thPt;
5713
5714 delete yield2ndPt;
5715 delete yield4thPt;
5716 delete yield6thPt;
5717 delete yield8thPt;
5718
5719} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5720
5721
5722//================================================================================================================================
5723
5724
5725void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5726{
5727 // Initialize all arrays used for distributions.
5728
5729 // a) Initialize arrays of histograms used to hold distributions of correlations;
5730 // b) Initialize array to hold min and max values of correlations.
5731
5732 // a) Initialize arrays of histograms used to hold distributions of correlations:
5733 for(Int_t di=0;di<4;di++) // distribution index
5734 {
5735 fDistributions[di] = NULL;
5736 }
5737
5738 // b) Initialize default min and max values of correlations:
5739 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5740 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5741 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5742 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5743 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5744 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5745 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5746 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5747 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5748
5749} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5750
5751
5752//================================================================================================================================
5753
5754
5755void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5756{
5757 // a) Book profile to hold all flags for distributions of correlations;
5758 // b) Book all histograms to hold distributions of correlations.
5759
5760 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5761
5762 // a) Book profile to hold all flags for distributions of correlations:
5763 TString distributionsFlagsName = "fDistributionsFlags";
5764 distributionsFlagsName += fAnalysisLabel->Data();
5765 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5766 fDistributionsFlags->SetTickLength(-0.01,"Y");
5767 fDistributionsFlags->SetMarkerStyle(25);
5768 fDistributionsFlags->SetLabelSize(0.05);
5769 fDistributionsFlags->SetLabelOffset(0.02,"Y");
5770 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
5771 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
5772 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
5773 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
5774 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
5775 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
5776 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
5777 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
5778 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
5779 fDistributionsList->Add(fDistributionsFlags);
5780
5781 // b) Book all histograms to hold distributions of correlations.
5782 if(fStoreDistributions)
5783 {
5784 TString distributionsName = "fDistributions";
5785 distributionsName += fAnalysisLabel->Data();
5786 for(Int_t di=0;di<4;di++) // distribution index
5787 {
5788 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
5789 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
5790 fDistributionsList->Add(fDistributions[di]);
5791 } // end of for(Int_t di=0;di<4;di++) // distribution index
5792 } // end of if(fStoreDistributions)
5793
5794} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5795
5796
5797//================================================================================================================================
5798
5799
5800void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5801{
5802 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
5803
5804 if(!fDistributionsFlags)
5805 {
5806 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
5807 exit(0);
5808 }
5809
5810 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
5811 // store min and max values of correlations:
5812 for(Int_t di=0;di<4;di++) // distribution index
5813 {
5814 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
5815 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
5816 }
5817
5818} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5819
5820
5821//================================================================================================================================
5822
5823
5824void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5825{
5826 // Store distributions of correlations.
5827
5828 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
5829 {
5830 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
5831 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
5832 exit(0);
5833 }
5834
5835 for(Int_t di=0;di<4;di++) // distribution index
5836 {
5837 if(!fDistributions[di])
5838 {
5839 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
5840 cout<<"di = "<<di<<endl;
5841 exit(0);
5842 } else
5843 {
5844 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
5845 }
5846 } // end of for(Int_t di=0;di<4;di++) // distribution index
5847
5848} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5849
5850
5851//================================================================================================================================
5852
5853
5854void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5855{
5856 // Book and nest all lists nested in the base list fHistList.
5857 // a) Book and nest lists for integrated flow;
5858 // b) Book and nest lists for differential flow;
5859 // c) Book and nest list for particle weights;
5860 // d) Book and nest list for distributions;
5861 // e) Book and nest list for nested loops;
5862
5863 // a) Book and nest all lists for integrated flow:
5864 // base list for integrated flow:
5865 fIntFlowList = new TList();
5866 fIntFlowList->SetName("Integrated Flow");
5867 fIntFlowList->SetOwner(kTRUE);
5868 fHistList->Add(fIntFlowList);
5869 // list holding profiles:
5870 fIntFlowProfiles = new TList();
5871 fIntFlowProfiles->SetName("Profiles");
5872 fIntFlowProfiles->SetOwner(kTRUE);
5873 fIntFlowList->Add(fIntFlowProfiles);
5874 // list holding histograms with results:
5875 fIntFlowResults = new TList();
5876 fIntFlowResults->SetName("Results");
5877 fIntFlowResults->SetOwner(kTRUE);
5878 fIntFlowList->Add(fIntFlowResults);
5879
5880 // b) Book and nest lists for differential flow;
5881 fDiffFlowList = new TList();
5882 fDiffFlowList->SetName("Differential Flow");
5883 fDiffFlowList->SetOwner(kTRUE);
5884 fHistList->Add(fDiffFlowList);
5885 // list holding profiles:
5886 fDiffFlowProfiles = new TList();
5887 fDiffFlowProfiles->SetName("Profiles");
5888 fDiffFlowProfiles->SetOwner(kTRUE);
5889 fDiffFlowList->Add(fDiffFlowProfiles);
5890 // list holding histograms with results:
5891 fDiffFlowResults = new TList();
5892 fDiffFlowResults->SetName("Results");
5893 fDiffFlowResults->SetOwner(kTRUE);
5894 fDiffFlowList->Add(fDiffFlowResults);
5895 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
5896 TList list;
5897 list.SetOwner(kTRUE);
5898 TString typeFlag[2] = {"RP","POI"};
5899 TString ptEtaFlag[2] = {"p_{T}","#eta"};
5900 TString powerFlag[2] = {"linear","quadratic"};
5901 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
5902 for(Int_t t=0;t<2;t++) // type: RP or POI
5903 {
5904 for(Int_t pe=0;pe<2;pe++) // pt or eta
5905 {
5906 // list holding profiles with correlations:
5907 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
5908 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5909 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
5910 // list holding profiles with products of correlations:
5911 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
5912 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5913 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
5914 // list holding profiles with corrections:
5915 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
5916 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5917 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
5918 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5919 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5920 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
5921 for(Int_t t=0;t<2;t++) // type: RP or POI
5922 {
5923 for(Int_t pe=0;pe<2;pe++) // pt or eta
5924 {
5925 // list holding histograms with correlations:
5926 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
5927 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5928 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
5929 // list holding histograms with corrections:
5930 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
5931 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5932 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
5933 for(Int_t power=0;power<2;power++)
5934 {
5935 // list holding histograms with sums of event weights:
5936 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
5937 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5938 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
5939 } // end of for(Int_t power=0;power<2;power++)
5940 // list holding histograms with sums of products of event weights:
5941 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
5942 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5943 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
5944 // list holding histograms with covariances of correlations:
5945 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
5946 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5947 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
5948 // list holding histograms with differential Q-cumulants:
5949 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
5950 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5951 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
5952 // list holding histograms with differential flow estimates from Q-cumulants:
5953 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
5954 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5955 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
5956 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5957 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5958
5959 // c) Book and nest list for particle weights:
5960 fWeightsList->SetName("Weights");
5961 fWeightsList->SetOwner(kTRUE);
5962 fHistList->Add(fWeightsList);
5963
5964 // d) Book and nest list for distributions:
5965 fDistributionsList = new TList();
5966 fDistributionsList->SetName("Distributions");
5967 fDistributionsList->SetOwner(kTRUE);
5968 fHistList->Add(fDistributionsList);
5969
5970 // e) Book and nest list for nested loops:
5971 fNestedLoopsList = new TList();
5972 fNestedLoopsList->SetName("Nested Loops");
5973 fNestedLoopsList->SetOwner(kTRUE);
5974 fHistList->Add(fNestedLoopsList);
5975
5976} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5977
5978
5979//================================================================================================================================
5980
5981
5982void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
5983{
5984 // fill common result histograms for differential flow
5985
5986 Int_t typeFlag = -1;
5987 //Int_t ptEtaFlag = -1;
5988
5989 if(type == "RP")
5990 {
5991 typeFlag = 0;
5992 } else if(type == "POI")
5993 {
5994 typeFlag = 1;
5995 }
5996
5997 // shortcuts:
5998 Int_t t = typeFlag;
5999 //Int_t pe = ptEtaFlag;
6000
6001 // to be improved (implement protection here)
6002
6003 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
6004 {
6005 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
6006 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
6007 exit(0);
6008 }
6009
6010 // pt:
6011 for(Int_t p=1;p<=fnBinsPt;p++)
6012 {
6013 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
6014 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
6015 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
6016 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
6017
6018 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
6019 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
6020 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
6021 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
6022
6023 if(type == "RP")
6024 {
6025 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
6026 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
6027 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
6028 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
6029 } else if(type == "POI")
6030 {
6031 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
6032 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
6033 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
6034 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
6035 }
6036 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6037
6038 // eta:
6039 for(Int_t e=1;e<=fnBinsEta;e++)
6040 {
6041 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
6042 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
6043 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
6044 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
6045
6046 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
6047 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
6048 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
6049 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
6050
6051 if(type == "RP")
6052 {
6053 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6054 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6055 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6056 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6057 } else if(type == "POI")
6058 {
6059 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6060 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6061 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6062 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6063 }
6064 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6065
6066} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6067
6068
6069//================================================================================================================================
6070
6071
6072void AliFlowAnalysisWithQCumulants::AccessConstants()
6073{
6074 // Access needed common constants from AliFlowCommonConstants
6075
6076 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6077 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6078 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6079 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
6080 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6081 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6082 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6083 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
6084 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6085 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6086 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6087 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
6088
6089} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
6090
6091
6092//================================================================================================================================
6093
6094
6095void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6096{
6097 // a) Cross check if the choice for multiplicity weights make sense;
6098
6099 // a) Cross check if the choice for multiplicity weights make sense:
6100 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6101 strcmp(fMultiplicityWeight->Data(),"unit") &&
6102 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6103 {
6104 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6105 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6106 exit(0);
6107 }
6108
6109} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6110
489d5531 6111//================================================================================================================================
6112
489d5531 6113void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6114{
0328db2d 6115 // Calculate sum of linear and quadratic event weights for correlations.
2001bc3a 6116
6117 // multiplicity:
6118 Double_t dMult = (*fSMpk)(0,0);
9f33751d 6119
489d5531 6120 for(Int_t p=0;p<2;p++) // power-1
6121 {
6122 for(Int_t ci=0;ci<4;ci++) // correlation index
6123 {
6124 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
2001bc3a 6125 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
489d5531 6126 }
6127 }
6128
6129} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6130
489d5531 6131//================================================================================================================================
6132
0328db2d 6133void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6134{
0328db2d 6135 // Calculate sum of linear and quadratic event weights for NUA terms.
6136
6137 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
489d5531 6138 {
0328db2d 6139 for(Int_t p=0;p<2;p++) // power-1
6140 {
6141 for(Int_t ci=0;ci<3;ci++) // nua term index
6142 {
6143 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
489d5531 6144 }
0328db2d 6145 }
6146 }
6147
6148} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6149
0328db2d 6150//================================================================================================================================
6151
0328db2d 6152void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6153{
ff70ca91 6154 // Calculate sum of product of event weights for correlations.
2001bc3a 6155
6156 // multiplicity:
6157 Double_t dMult = (*fSMpk)(0,0);
6158
489d5531 6159 Int_t counter = 0;
6160
6161 for(Int_t ci1=1;ci1<4;ci1++)
6162 {
6163 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6164 {
ff70ca91 6165 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6166 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6167 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2001bc3a 6168 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5,
ff70ca91 6169 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6170 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6171 counter++;
489d5531 6172 }
6173 }
6174
0328db2d 6175} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6176
0328db2d 6177//================================================================================================================================
6178
0328db2d 6179void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6180{
6181 // Calculate sum of product of event weights for NUA terms.
6182
6183 // w_{<2>} * w_{<cos(#phi)>}:
6184 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6185 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6186 // w_{<2>} * w_{<sin(#phi)>}:
6187 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6188 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6189 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6190 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6191 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6192 // w_{<2>} * w{<cos(phi1+phi2)>}
6193 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6194 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6195 // w_{<2>} * w{<sin(phi1+phi2)>}
6196 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6197 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6198 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6199 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6200 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6201 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6202 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6203 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6204 // w_{<4>} * w{<cos(phi1)>}
6205 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6206 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6207 // w_{<4>} * w{<sin(phi1)>}
6208 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6209 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6210 // w_{<4>} * w{<cos(phi1+phi2)>}
6211 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6212 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6213 // w_{<4>} * w{<sin(phi1+phi2)>}
6214 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6215 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6216 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6217 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6218 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6219 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6220 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6221 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6222 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6223 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6224 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6225 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6226 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6227 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6228 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6229 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6230 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6231 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6232 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6233 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6234 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6235 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6236 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6237 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6238 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6239 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6240 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6241 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6242 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6243 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6244 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6245 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6246 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6247 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6248 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6249 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6250 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6251 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6252 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6253 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6254 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6255 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6256 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6257 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6258 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6259 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6260 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6261 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6262 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6263 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6264
6265} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
489d5531 6266
6267
6268//================================================================================================================================
6269
6270
6271void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6272{
6273 // calculate reduced correlations for RPs or POIs in pt or eta bins
6274
6275 // multiplicity:
6276 Double_t dMult = (*fSMpk)(0,0);
6277
6278 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6279 Double_t dReQ1n = (*fReQ)(0,0);
6280 Double_t dReQ2n = (*fReQ)(1,0);
6281 //Double_t dReQ3n = (*fReQ)(2,0);
6282 //Double_t dReQ4n = (*fReQ)(3,0);
6283 Double_t dImQ1n = (*fImQ)(0,0);
6284 Double_t dImQ2n = (*fImQ)(1,0);
6285 //Double_t dImQ3n = (*fImQ)(2,0);
6286 //Double_t dImQ4n = (*fImQ)(3,0);
6287
6288 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6289 //
6290 // 0: <<2'>>
6291 // 1: <<4'>>
6292 // 2: <<6'>>
6293 // 3: <<8'>>
6294
6295 Int_t t = -1; // type flag
6296 Int_t pe = -1; // ptEta flag
6297
6298 if(type == "RP")
6299 {
6300 t = 0;
6301 } else if(type == "POI")
6302 {
6303 t = 1;
6304 }
6305
6306 if(ptOrEta == "Pt")
6307 {
6308 pe = 0;
6309 } else if(ptOrEta == "Eta")
6310 {
6311 pe = 1;
6312 }
6313
6314 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6315 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6316 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6317 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6318
6319 // looping over all bins and calculating reduced correlations:
6320 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6321 {
6322 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6323 Double_t p1n0kRe = 0.;
6324 Double_t p1n0kIm = 0.;
6325
6326 // number of POIs in particular pt or eta bin:
6327 Double_t mp = 0.;
6328
6329 // 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):
6330 Double_t q1n0kRe = 0.;
6331 Double_t q1n0kIm = 0.;
6332 Double_t q2n0kRe = 0.;
6333 Double_t q2n0kIm = 0.;
6334
6335 // number of particles which are both RPs and POIs in particular pt or eta bin:
6336 Double_t mq = 0.;
6337
6338 if(type == "POI")
6339 {
6340 // q_{m*n,0}:
6341 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6342 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6343 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6344 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6345 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6346 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6347 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6348 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6349
6350 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6351 }
6352 else if(type == "RP")
6353 {
6354 // q_{m*n,0}:
6355 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6356 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6357 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6358 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6359 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6360 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6361 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6362 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6363
6364 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6365 }
6366
6367 if(type == "POI")
6368 {
6369 // p_{m*n,0}:
6370 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6371 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6372 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6373 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6374
6375 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6376
6377 t = 1; // typeFlag = RP or POI
6378 }
6379 else if(type == "RP")
6380 {
6381 // p_{m*n,0} = q_{m*n,0}:
6382 p1n0kRe = q1n0kRe;
6383 p1n0kIm = q1n0kIm;
6384
6385 mp = mq;
6386
6387 t = 0; // typeFlag = RP or POI
6388 }
6389
6390 // 2'-particle correlation for particular (pt,eta) bin:
6391 Double_t two1n1nPtEta = 0.;
6392 if(mp*dMult-mq)
6393 {
6394 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6395 / (mp*dMult-mq);
6396
6397 if(type == "POI") // to be improved (I do not this if)
6398 {
6399 // fill profile to get <<2'>> for POIs
6400 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6401 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6402 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
6403 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq);
6404 }
6405 else if(type == "RP") // to be improved (I do not this if)
6406 {
6407 // profile to get <<2'>> for RPs:
6408 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6409 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6410 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
6411 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq);
6412 }
6413 } // end of if(mp*dMult-mq)
6414
6415 // 4'-particle correlation:
6416 Double_t four1n1n1n1nPtEta = 0.;
6417 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6418 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6419 {
6420 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6421 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6422 - 2.*q2n0kIm*dReQ1n*dImQ1n
6423 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6424 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6425 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6426 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6427 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6428 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6429 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6430 + 2.*mq*dMult
6431 - 6.*mq)
6432 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6433 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6434
6435 if(type == "POI")
6436 {
6437 // profile to get <<4'>> for POIs:
6438 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6439 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6440 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6441 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6442 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6443 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6444 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6445 }
6446 else if(type == "RP")
6447 {
6448 // profile to get <<4'>> for RPs:
6449 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6450 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6451 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6452 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6453 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6454 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6455 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6456 }
6457 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6458 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6459
6460 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6461
6462
6463} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6464
6465
6466//================================================================================================================================
6467
6468
6469void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6470{
6471 // Calculate sums of various event weights for reduced correlations.
6472 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6473
6474 Int_t typeFlag = -1;
6475 Int_t ptEtaFlag = -1;
6476
6477 if(type == "RP")
6478 {
6479 typeFlag = 0;
6480 } else if(type == "POI")
6481 {
6482 typeFlag = 1;
6483 }
6484
6485 if(ptOrEta == "Pt")
6486 {
6487 ptEtaFlag = 0;
6488 } else if(ptOrEta == "Eta")
6489 {
6490 ptEtaFlag = 1;
6491 }
6492
6493 // shortcuts:
6494 Int_t t = typeFlag;
6495 Int_t pe = ptEtaFlag;
6496
6497 // binning:
6498 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6499 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6500 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6501 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6502
6503 for(Int_t rpq=0;rpq<3;rpq++)
6504 {
6505 for(Int_t m=0;m<4;m++)
6506 {
6507 for(Int_t k=0;k<9;k++)
6508 {
6509 if(!fReRPQ1dEBE[rpq][pe][m][k])
6510 {
6511 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6512 cout<<"pe = "<<pe<<endl;
6513 cout<<"rpq = "<<rpq<<endl;
6514 cout<<"m = "<<m<<endl;
6515 cout<<"k = "<<k<<endl;
6516 exit(0);
6517 }
6518 }
6519 }
6520 }
6521
6522 // multiplicities:
6523 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6524 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6525 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6526 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6527
6528 // event weights for reduced correlations:
6529 Double_t dw2 = 0.; // event weight for <2'>
6530 Double_t dw4 = 0.; // event weight for <4'>
6531 //Double_t dw6 = 0.; // event weight for <6'>
6532 //Double_t dw8 = 0.; // event weight for <8'>
6533
6534 // looping over bins:
6535 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6536 {
6537 if(type == "RP")
6538 {
6539 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6540 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6541 } else if(type == "POI")
6542 {
6543 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6544 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6545 }
6546
6547 // event weight for <2'>:
6548 dw2 = mp*dMult-mq;
6549 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6550 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6551
6552 // event weight for <4'>:
6553 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6554 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6555 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6556 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6557
6558 // event weight for <6'>:
6559 //dw6 = ...;
6560 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6561 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6562
6563 // event weight for <8'>:
6564 //dw8 = ...;
6565 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6566 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6567 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6568
6569} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6570
6571
6572//================================================================================================================================
6573
6574
6575void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6576{
6577 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6578 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6579 //
6580 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6581 // 1.) i<j
6582 // 2.) do not store terms which DO NOT include reduced correlations;
6583 // Table:
6584 // [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'>]
6585
6586 Int_t typeFlag = -1;
6587 Int_t ptEtaFlag = -1;
6588
6589 if(type == "RP")
6590 {
6591 typeFlag = 0;
6592 } else if(type == "POI")
6593 {
6594 typeFlag = 1;
6595 }
6596
6597 if(ptOrEta == "Pt")
6598 {
6599 ptEtaFlag = 0;
6600 } else if(ptOrEta == "Eta")
6601 {
6602 ptEtaFlag = 1;
6603 }
6604
6605 // shortcuts:
6606 Int_t t = typeFlag;
6607 Int_t pe = ptEtaFlag;
6608
6609 // binning:
6610 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6611 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6612 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6613 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6614
6615 // protection:
6616 for(Int_t rpq=0;rpq<3;rpq++)
6617 {
6618 for(Int_t m=0;m<4;m++)
6619 {
6620 for(Int_t k=0;k<9;k++)
6621 {
6622 if(!fReRPQ1dEBE[rpq][pe][m][k])
6623 {
6624 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6625 cout<<"pe = "<<pe<<endl;
6626 cout<<"rpq = "<<rpq<<endl;
6627 cout<<"m = "<<m<<endl;
6628 cout<<"k = "<<k<<endl;
6629 exit(0);
6630 }
6631 }
6632 }
6633 }
6634
6635 // multiplicities:
6636 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6637 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6638 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6639 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6640
6641 // event weights for correlations:
6642 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6643 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6644 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6645 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6646
6647 // event weights for reduced correlations:
6648 Double_t dw2 = 0.; // event weight for <2'>
6649 Double_t dw4 = 0.; // event weight for <4'>
6650 //Double_t dw6 = 0.; // event weight for <6'>
6651 //Double_t dw8 = 0.; // event weight for <8'>
6652
6653 // looping over bins:
6654 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6655 {
6656 if(type == "RP")
6657 {
6658 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6659 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6660 } else if(type == "POI")
6661 {
6662 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6663 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6664 }
6665
6666 // event weight for <2'>:
6667 dw2 = mp*dMult-mq;
6668 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6669 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6670 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6671 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6672
6673 // event weight for <4'>:
6674 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6675 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6676 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6677 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6678 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6679 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6680 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6681
6682 // event weight for <6'>:
6683 //dw6 = ...;
6684 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6685 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6686 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6687 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6688 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6689 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6690 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6691
6692 // event weight for <8'>:
6693 //dw8 = ...;
6694 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6695 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6696 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6697 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6698 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6699 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6700 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6701
6702 // Table:
6703 // [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'>]
6704
6705 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6706
6707
6708
6709} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6710
6711
6712//================================================================================================================================
6713
6714
6715void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6716{
6717 // Transfer profiles into histograms and calculate statistical errors correctly.
6718
6719 Int_t typeFlag = -1;
6720 Int_t ptEtaFlag = -1;
6721
6722 if(type == "RP")
6723 {
6724 typeFlag = 0;
6725 } else if(type == "POI")
6726 {
6727 typeFlag = 1;
6728 }
6729
6730 if(ptOrEta == "Pt")
6731 {
6732 ptEtaFlag = 0;
6733 } else if(ptOrEta == "Eta")
6734 {
6735 ptEtaFlag = 1;
6736 }
6737
6738 // shortcuts:
6739 Int_t t = typeFlag;
6740 Int_t pe = ptEtaFlag;
6741
6742 for(Int_t rci=0;rci<4;rci++)
6743 {
6744 if(!fDiffFlowCorrelationsPro[t][pe][rci])
6745 {
6746 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6747 cout<<"t = "<<t<<endl;
6748 cout<<"pe = "<<pe<<endl;
6749 cout<<"rci = "<<rci<<endl;
6750 exit(0);
6751 }
6752 for(Int_t power=0;power<2;power++)
6753 {
6754 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
6755 {
6756 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6757 cout<<"t = "<<t<<endl;
6758 cout<<"pe = "<<pe<<endl;
6759 cout<<"power = "<<power<<endl;
6760 cout<<"rci = "<<rci<<endl;
6761 exit(0);
6762 }
6763 } // end of for(Int_t power=0;power<2;power++)
6764 } // end of for(Int_t rci=0;rci<4;rci++)
6765
6766 // common:
6767 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6768
6769 // transfer 1D profile into 1D histogram:
6770 Double_t correlation = 0.;
6771 Double_t spread = 0.;
6772 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
6773 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
6774 Double_t error = 0.; // error = termA * spread * termB
6775 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
6776 // termB = 1/pow(1-termA^2,0.5)
6777 Double_t termA = 0.;
6778 Double_t termB = 0.;
6779 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
6780 {
6781 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
6782 {
6783 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
6784 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);
6785 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
6786 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
6787 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
6788 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
6789 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
6790 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
6791 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
6792 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6793 } // end of for(Int_t rci=0;rci<4;rci++)
6794
6795} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6796
6797
6798//================================================================================================================================
6799
6800
6801void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6802{
6803 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
6804 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
6805 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
6806 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
6807 // <6'><8'>, <8><8'>.
6808
6809 Int_t typeFlag = -1;
6810 Int_t ptEtaFlag = -1;
6811
6812 if(type == "RP")
6813 {
6814 typeFlag = 0;
6815 } else if(type == "POI")
6816 {
6817 typeFlag = 1;
6818 }
6819
6820 if(ptOrEta == "Pt")
6821 {
6822 ptEtaFlag = 0;
6823 } else if(ptOrEta == "Eta")
6824 {
6825 ptEtaFlag = 1;
6826 }
6827
6828 // shortcuts:
6829 Int_t t = typeFlag;
6830 Int_t pe = ptEtaFlag;
6831
6832 // common:
6833 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6834 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6835 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6836
6837 // protections // to be improved (add protection for all pointers in this method)
6838 if(!fIntFlowCorrelationsEBE)
6839 {
6840 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
6841 exit(0);
6842 }
6843
6844 /*
6845 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
6846 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6847 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6848 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6849 */
6850
6851 // e-b-e correlations:
6852 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
6853 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
6854 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
6855 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
6856
6857 // event weights for correlations:
6858 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
6859 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
6860 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
6861 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
6862
6863 // e-b-e reduced correlations:
6864 Double_t twoReducedEBE = 0.; // <2'>
6865 Double_t fourReducedEBE = 0.; // <4'>
6866 Double_t sixReducedEBE = 0.; // <6'>
6867 Double_t eightReducedEBE = 0.; // <8'>
6868
6869 // event weights for reduced correlations:
6870 Double_t dw2 = 0.; // event weight for <2'>
6871 Double_t dw4 = 0.; // event weight for <4'>
6872 //Double_t dw6 = 0.; // event weight for <6'>
6873 //Double_t dw8 = 0.; // event weight for <8'>
6874
6875 // looping over bins:
6876 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6877 {
6878 // e-b-e reduced correlations:
6879 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
6880 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
6881 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
6882 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
6883
6884 /*
6885 // to be improved (I should not do this here again)
6886 if(type == "RP")
6887 {
6888 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6889 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6890 } else if(type == "POI")
6891 {
6892 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6893 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6894 }
6895
6896 // event weights for reduced correlations:
6897 dw2 = mp*dMult-mq; // weight for <2'>
6898 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6899 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
6900 //dw6 = ...
6901 //dw8 = ...
6902
6903 */
6904
6905 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
6906 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
6907
6908 // storing all products:
6909 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
6910 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
6911 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
6912 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
6913
6914 // event weight for <4'>:
6915 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
6916 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
6917 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
6918 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
6919 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
6920
6921 // event weight for <6'>:
6922 //dw6 = ...;
6923 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
6924 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
6925 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
6926 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
6927 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
6928 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
6929 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6930
6931 // event weight for <8'>:
6932 //dw8 = ...;
6933 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
6934 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
6935 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
6936 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
6937 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
6938 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6939 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
6940 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
6941
6942} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6943
6944
6945//================================================================================================================================
6946
6947
6948void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
6949{
6950 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
6951 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
6952 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
6953 //
6954 // 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)]
6955 //
6956 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
6957 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
6958 //
6959 // 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)]
6960 // 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)]
6961 // 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)]
6962 // 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)]
6963 // 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)]
6964 // ...
6965
6966 Int_t typeFlag = -1;
6967 Int_t ptEtaFlag = -1;
6968
6969 if(type == "RP")
6970 {
6971 typeFlag = 0;
6972 } else if(type == "POI")
6973 {
6974 typeFlag = 1;
6975 }
6976
6977 if(ptOrEta == "Pt")
6978 {
6979 ptEtaFlag = 0;
6980 } else if(ptOrEta == "Eta")
6981 {
6982 ptEtaFlag = 1;
6983 }
6984
6985 // shortcuts:
6986 Int_t t = typeFlag;
6987 Int_t pe = ptEtaFlag;
6988
6989 // common:
6990 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6991 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
6992 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6993 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6994
6995 // average correlations:
6996 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
6997 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
6998 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
6999 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7000
7001 // sum of weights for correlation:
7002 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
7003 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7004 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7005 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7006
7007 // average reduced correlations:
7008 Double_t twoReduced = 0.; // <<2'>>
7009 Double_t fourReduced = 0.; // <<4'>>
7010 //Double_t sixReduced = 0.; // <<6'>>
7011 //Double_t eightReduced = 0.; // <<8'>>
7012
7013 // sum of weights for reduced correlation:
7014 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7015 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7016 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7017 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7018
7019 // product of weights for reduced correlation:
7020 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7021 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7022 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7023 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7024 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7025 // ...
7026
7027 // products for differential flow:
7028 Double_t twoTwoReduced = 0; // <<2><2'>>
7029 Double_t twoFourReduced = 0; // <<2><4'>>
7030 Double_t fourTwoReduced = 0; // <<4><2'>>
7031 Double_t fourFourReduced = 0; // <<4><4'>>
7032 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7033
7034 // denominators in the expressions for the unbiased estimators for covariances:
7035 // denominator = 1 - term1/(term2*term3)
7036 // prefactor = term1/(term2*term3)
7037 Double_t denominator = 0.;
7038 Double_t prefactor = 0.;
7039 Double_t term1 = 0.;
7040 Double_t term2 = 0.;
7041 Double_t term3 = 0.;
7042
7043 // unbiased estimators for covariances for differential flow:
7044 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7045 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7046 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7047 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7048 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7049 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7050 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7051 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7052 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7053 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7054
7055 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7056 {
7057 // average reduced corelations:
7058 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7059 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7060 // average products:
7061 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7062 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7063 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7064 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7065 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7066 // sum of weights for reduced correlations:
7067 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7068 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7069 // products of weights for correlations:
7070 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7071 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7072 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7073 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7074 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7075 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7076 // prefactor (multiplies Cov's) = term1/(term2*term3)
7077 // <2>,<2'>:
7078 term1 = productOfWeightsForTwoTwoReduced;
7079 term2 = sumOfWeightsForTwo;
7080 term3 = sumOfWeightsForTwoReduced;
7081 if(term2*term3>0.)
7082 {
7083 denominator = 1.-term1/(term2*term3);
7084 prefactor = term1/(term2*term3);
0328db2d 7085 if(TMath::Abs(denominator)>1e-6)
489d5531 7086 {
7087 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7088 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7089 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7090 }
7091 }
7092 // <2>,<4'>:
7093 term1 = productOfWeightsForTwoFourReduced;
7094 term2 = sumOfWeightsForTwo;
7095 term3 = sumOfWeightsForFourReduced;
7096 if(term2*term3>0.)
7097 {
7098 denominator = 1.-term1/(term2*term3);
7099 prefactor = term1/(term2*term3);
0328db2d 7100 if(TMath::Abs(denominator)>1e-6)
489d5531 7101 {
7102 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7103 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7104 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7105 }
7106 }
7107 // <4>,<2'>:
7108 term1 = productOfWeightsForFourTwoReduced;
7109 term2 = sumOfWeightsForFour;
7110 term3 = sumOfWeightsForTwoReduced;
7111 if(term2*term3>0.)
7112 {
7113 denominator = 1.-term1/(term2*term3);
7114 prefactor = term1/(term2*term3);
0328db2d 7115 if(TMath::Abs(denominator)>1e-6)
489d5531 7116 {
7117 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7118 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7119 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7120 }
7121 }
7122 // <4>,<4'>:
7123 term1 = productOfWeightsForFourFourReduced;
7124 term2 = sumOfWeightsForFour;
7125 term3 = sumOfWeightsForFourReduced;
7126 if(term2*term3>0.)
7127 {
7128 denominator = 1.-term1/(term2*term3);
7129 prefactor = term1/(term2*term3);
0328db2d 7130 if(TMath::Abs(denominator)>1e-6)
489d5531 7131 {
7132 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7133 wCovFourFourReduced = covFourFourReduced*prefactor;
7134 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7135 }
7136 }
7137 // <2'>,<4'>:
7138 term1 = productOfWeightsForTwoReducedFourReduced;
7139 term2 = sumOfWeightsForTwoReduced;
7140 term3 = sumOfWeightsForFourReduced;
7141 if(term2*term3>0.)
7142 {
7143 denominator = 1.-term1/(term2*term3);
7144 prefactor = term1/(term2*term3);
0328db2d 7145 if(TMath::Abs(denominator)>1e-6)
489d5531 7146 {
7147 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7148 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7149 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7150 }
7151 }
7152 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7153
7154} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
7155
7156
7157//================================================================================================================================
7158
7159
7160void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
7161{
7162 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)
7163
7164 Int_t typeFlag = -1;
7165 Int_t ptEtaFlag = -1;
7166
7167 if(type == "RP")
7168 {
7169 typeFlag = 0;
7170 } else if(type == "POI")
7171 {
7172 typeFlag = 1;
7173 }
7174
7175 if(ptOrEta == "Pt")
7176 {
7177 ptEtaFlag = 0;
7178 } else if(ptOrEta == "Eta")
7179 {
7180 ptEtaFlag = 1;
7181 }
7182
7183 // shortcuts:
7184 Int_t t = typeFlag;
7185 Int_t pe = ptEtaFlag;
7186
7187 // common:
7188 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7189
7190 // correlations:
7191 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7192 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7193
7194 // statistical errors of correlations:
7195 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
7196 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
7197
7198 // reduced correlations:
7199 Double_t twoReduced = 0.; // <<2'>>
7200 Double_t fourReduced = 0.; // <<4'>>
7201
7202 // statistical errors of reduced correlations:
7203 Double_t twoReducedError = 0.;
7204 Double_t fourReducedError = 0.;
7205
7206 // covariances:
7207 Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)
7208 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
7209 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
7210 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
7211 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
7212 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
7213
7214 // differential flow:
7215 Double_t v2Prime = 0.; // v'{2}
7216 Double_t v4Prime = 0.; // v'{4}
7217
7218 // statistical error of differential flow:
7219 Double_t v2PrimeError = 0.;
7220 Double_t v4PrimeError = 0.;
7221
7222 // squared statistical error of differential flow:
7223 Double_t v2PrimeErrorSquared = 0.;
7224 Double_t v4PrimeErrorSquared = 0.;
7225
7226 // loop over pt or eta bins:
7227 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7228 {
7229 // reduced correlations and statistical errors:
7230 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7231 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
7232 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7233 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
7234 // covariances:
7235 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
7236 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
7237 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
7238 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
7239 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
7240 // differential flow:
7241 // v'{2}:
7242 if(two>0.)
7243 {
7244 v2Prime = twoReduced/pow(two,0.5);
7245 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
7246 (pow(twoReduced,2.)*pow(twoError,2.)
7247 + 4.*pow(two,2.)*pow(twoReducedError,2.)
7248 - 4.*two*twoReduced*wCovTwoTwoReduced);
7249
7250
7251 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
7252 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
60694576 7253 if(TMath::Abs(v2Prime)>1.e-44)fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
489d5531 7254 }
7255 // differential flow:
7256 // v'{4}
7257 if(2.*pow(two,2.)-four > 0.)
7258 {
7259 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
7260 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
7261 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
7262 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
7263 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
7264 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
7265 - (3./2.)*(2.*two*twoReduced-fourReduced)
7266 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
7267 - 4.*two*(2.*pow(two,2.)-four)
7268 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
7269 + 2.*(2.*pow(two,2.)-four)
7270 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
7271 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
7272 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
7273 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
7274 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
7275 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
60694576 7276 if(TMath::Abs(v4Prime)>1.e-44)fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
489d5531 7277 }
7278
7279 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
7280
7281
7282
7283
7284 /*
7285 // 2D:
7286 for(Int_t nua=0;nua<2;nua++)
7287 {
7288 for(Int_t p=1;p<=fnBinsPt;p++)
7289 {
7290 for(Int_t e=1;e<=fnBinsEta;e++)
7291 {
7292 // differential cumulants:
7293 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
7294 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
7295 // differential flow:
7296 Double_t v2Prime = 0.;
7297 Double_t v4Prime = 0.;
7298 if(v2)
7299 {
7300 v2Prime = qc2Prime/v2;
7301 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
7302 }
7303 if(v4)
7304 {
7305 v4Prime = -qc4Prime/pow(v4,3.);
7306 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
7307 }
7308 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7309 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7310 } // end of for(Int_t nua=0;nua<2;nua++)
7311 */
7312
7313} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7314
7315
7316//================================================================================================================================
7317
7318
7319void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7320{
7321 // a) Store all flags for integrated flow in profile fIntFlowFlags.
7322
7323 if(!fIntFlowFlags)
7324 {
7325 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
7326 exit(0);
7327 }
7328
7329 // particle weights used or not:
7330 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
7331 // which event weights were used:
7332 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
7333 {
7334 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
7335 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
7336 {
7337 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
7338 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
7339 {
7340 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7341 }
7342 // corrected for non-uniform acceptance or not:
7343 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7344 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7345 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7346 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
2001bc3a 7347 fIntFlowFlags->Fill(6.5,(Int_t)fApplyCorrectionForNUAVsM);
7348
489d5531 7349} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7350
7351
7352//================================================================================================================================
7353
7354
7355void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7356{
7357 // Store all flags for differential flow in the profile fDiffFlowFlags.
7358
7359 if(!fDiffFlowFlags)
7360 {
7361 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;
7362 exit(0);
7363 }
7364
7365 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not
7366 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved
7367 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7368 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not
7369
7370} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7371
7372
7373//================================================================================================================================
7374
7375
7376void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7377{
7378 // Access all pointers to common control and common result histograms and profiles.
7379
7380 TString commonHistsName = "AliFlowCommonHistQC";
7381 commonHistsName += fAnalysisLabel->Data();
7382 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
7383 if(commonHist) this->SetCommonHists(commonHist);
7384 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7385 commonHists2ndOrderName += fAnalysisLabel->Data();
7386 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7387 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7388 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7389 commonHists4thOrderName += fAnalysisLabel->Data();
7390 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7391 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7392 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7393 commonHists6thOrderName += fAnalysisLabel->Data();
7394 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7395 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7396 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7397 commonHists8thOrderName += fAnalysisLabel->Data();
7398 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
7399 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7400 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7401 commonHistResults2ndOrderName += fAnalysisLabel->Data();
ecac11c2 7402 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*> (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
489d5531 7403 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7404 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7405 commonHistResults4thOrderName += fAnalysisLabel->Data();
7406 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7407 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7408 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7409 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7410 commonHistResults6thOrderName += fAnalysisLabel->Data();
7411 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7412 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7413 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7414 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7415 commonHistResults8thOrderName += fAnalysisLabel->Data();
7416 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7417 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7418 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7419
7420} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7421
7422
7423//================================================================================================================================
7424
7425
7426void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7427{
7428 // Get pointers for histograms with particle weights.
7429
7430 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
7431 if(weightsList) this->SetWeightsList(weightsList);
7432 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7433 fUseParticleWeightsName += fAnalysisLabel->Data();
7434 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7435 if(useParticleWeights)
7436 {
7437 this->SetUseParticleWeights(useParticleWeights);
7438 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7439 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7440 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7441 }
7442} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7443
7444
7445//================================================================================================================================
7446
7447
7448void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7449{
7450 // Get pointers for histograms and profiles relevant for integrated flow:
7451 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7452 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7453 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7454 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7455
7456 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7457 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
ff70ca91 7458 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"}; // to be improved (should I promote this to data member?)
489d5531 7459
7460 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7461 TList *intFlowList = NULL;
7462 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7463 if(!intFlowList)
7464 {
7465 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7466 exit(0);
7467 }
7468
7469 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7470 TString intFlowFlagsName = "fIntFlowFlags";
7471 intFlowFlagsName += fAnalysisLabel->Data();
7472 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7473 Bool_t bApplyCorrectionForNUA = kFALSE;
7474 if(intFlowFlags)
7475 {
7476 this->SetIntFlowFlags(intFlowFlags);
7477 bApplyCorrectionForNUA = (Int_t)intFlowFlags->GetBinContent(3);
7478 this->SetApplyCorrectionForNUA(bApplyCorrectionForNUA);
7479 } else
7480 {
7481 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7482 }
7483
7484 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7485 TList *intFlowProfiles = NULL;
7486 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7487 if(intFlowProfiles)
7488 {
7489 // average multiplicities:
7490 TString avMultiplicityName = "fAvMultiplicity";
7491 avMultiplicityName += fAnalysisLabel->Data();
7492 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7493 if(avMultiplicity)
7494 {
7495 this->SetAvMultiplicity(avMultiplicity);
7496 } else
7497 {
7498 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7499 }
7500 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7501 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7502 intFlowCorrelationsProName += fAnalysisLabel->Data();
7503 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7504 if(intFlowCorrelationsPro)
7505 {
7506 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7507 } else
7508 {
7509 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7510 }
7511 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
7512 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7513 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7514 for(Int_t ci=0;ci<4;ci++) // correlation index
7515 {
7516 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7517 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7518 if(intFlowCorrelationsVsMPro)
7519 {
7520 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7521 } else
7522 {
7523 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7524 }
7525 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 7526 // average all correlations for integrated flow (with wrong errors!):
7527 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7528 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7529 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7530 if(intFlowCorrelationsAllPro)
7531 {
7532 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7533 } else
7534 {
7535 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7536 }
7537 // average extra correlations for integrated flow (which appear only when particle weights are used):
7538 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7539 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7540 {
7541 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7542 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7543 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7544 if(intFlowExtraCorrelationsPro)
7545 {
7546 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7547 } else
7548 {
7549 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7550 }
7551 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7552 // average products of correlations <2>, <4>, <6> and <8>:
7553 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7554 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7555 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7556 if(intFlowProductOfCorrelationsPro)
7557 {
7558 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7559 } else
7560 {
7561 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7562 }
7563 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7564 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
7565 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7566 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7567 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7568 for(Int_t pi=0;pi<6;pi++)
7569 {
7570 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7571 if(intFlowProductOfCorrelationsVsMPro)
7572 {
7573 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7574 } else
7575 {
7576 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7577 }
7578 } // end of for(Int_t pi=0;pi<6;pi++)
489d5531 7579 // average correction terms for non-uniform acceptance (with wrong errors!):
7580 for(Int_t sc=0;sc<2;sc++)
7581 {
7582 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7583 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7584 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7585 if(intFlowCorrectionTermsForNUAPro)
7586 {
7587 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7588 } else
7589 {
7590 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7591 cout<<"sc = "<<sc<<endl;
7592 }
2001bc3a 7593 // versus multiplicity:
7594 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
7595 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
7596 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
7597 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7598 {
7599 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
7600 if(intFlowCorrectionTermsForNUAVsMPro)
7601 {
7602 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
7603 } else
7604 {
7605 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7606 cout<<"sc = "<<sc<<endl;
7607 cout<<"ci = "<<ci<<endl;
7608 }
7609 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
489d5531 7610 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 7611 // average products of correction terms for NUA:
7612 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7613 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7614 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7615 if(intFlowProductOfCorrectionTermsForNUAPro)
7616 {
7617 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7618 } else
7619 {
7620 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7621 }
489d5531 7622 } else // to if(intFlowProfiles)
7623 {
7624 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7625 }
7626
7627 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7628 TList *intFlowResults = NULL;
7629 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7630 if(intFlowResults)
7631 {
7632 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7633 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7634 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7635 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7636 if(intFlowCorrelationsHist)
7637 {
7638 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7639 } else
7640 {
7641 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7642 }
ff70ca91 7643 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
7644 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7645 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7646 for(Int_t ci=0;ci<4;ci++) // correlation index
7647 {
7648 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7649 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7650 if(intFlowCorrelationsVsMHist)
7651 {
7652 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7653 } else
7654 {
7655 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7656 }
7657 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 7658 // average all correlations for integrated flow (with correct errors!):
7659 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7660 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7661 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7662 if(intFlowCorrelationsAllHist)
7663 {
7664 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7665 } else
7666 {
7667 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7668 }
7669 // average correction terms for non-uniform acceptance (with correct errors!):
7670 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7671 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7672 for(Int_t sc=0;sc<2;sc++)
7673 {
7674 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7675 if(intFlowCorrectionTermsForNUAHist)
7676 {
7677 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7678 } else
7679 {
7680 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7681 cout<<"sc = "<<sc<<endl;
7682 }
7683 } // end of for(Int_t sc=0;sc<2;sc++)
7684 // covariances (multiplied with weight dependent prefactor):
7685 TString intFlowCovariancesName = "fIntFlowCovariances";
7686 intFlowCovariancesName += fAnalysisLabel->Data();
7687 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7688 if(intFlowCovariances)
7689 {
7690 this->SetIntFlowCovariances(intFlowCovariances);
7691 } else
7692 {
7693 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7694 }
7695 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7696 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7697 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7698 for(Int_t power=0;power<2;power++)
7699 {
7700 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7701 if(intFlowSumOfEventWeights)
7702 {
7703 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7704 } else
7705 {
7706 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7707 cout<<"power = "<<power<<endl;
7708 }
7709 } // end of for(Int_t power=0;power<2;power++)
7710 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7711 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7712 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7713 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7714 if(intFlowSumOfProductOfEventWeights)
7715 {
7716 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7717 } else
7718 {
7719 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7720 }
ff70ca91 7721 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7722 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
7723 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7724 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7725 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7726 for(Int_t ci=0;ci<6;ci++)
7727 {
7728 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7729 if(intFlowCovariancesVsM)
7730 {
7731 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
7732 } else
7733 {
7734 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7735 }
7736 } // end of for(Int_t ci=0;ci<6;ci++)
7737 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7738 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7739 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7740 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7741 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>}"},
7742 {"#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}"}};
7743 for(Int_t si=0;si<4;si++)
7744 {
7745 for(Int_t power=0;power<2;power++)
7746 {
7747 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7748 if(intFlowSumOfEventWeightsVsM)
7749 {
7750 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7751 } else
7752 {
7753 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7754 }
7755 } // end of for(Int_t power=0;power<2;power++)
7756 } // end of for(Int_t si=0;si<4;si++)
7757 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7758 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7759 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
7760 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7761 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7762 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>}",
7763 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7764 for(Int_t pi=0;pi<6;pi++)
7765 {
7766 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7767 if(intFlowSumOfProductOfEventWeightsVsM)
7768 {
7769 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7770 } else
7771 {
7772 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7773 }
7774 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 7775 // covariances for NUA (multiplied with weight dependent prefactor):
7776 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7777 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7778 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7779 if(intFlowCovariancesNUA)
7780 {
7781 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7782 } else
7783 {
7784 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7785 }
7786 // sum of linear and quadratic event weights NUA terms:
7787 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7788 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7789 for(Int_t sc=0;sc<2;sc++)
7790 {
7791 for(Int_t power=0;power<2;power++)
7792 {
7793 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7794 if(intFlowSumOfEventWeightsNUA)
7795 {
7796 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7797 } else
7798 {
7799 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7800 cout<<"sc = "<<sc<<endl;
7801 cout<<"power = "<<power<<endl;
7802 }
7803 } // end of for(Int_t power=0;power<2;power++)
7804 } // end of for(Int_t sc=0;sc<2;sc++)
7805 // sum of products of event weights for NUA terms:
7806 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7807 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7808 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7809 if(intFlowSumOfProductOfEventWeightsNUA)
7810 {
7811 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7812 } else
7813 {
7814 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7815 }
489d5531 7816 // final results for integrated Q-cumulants:
7817 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7818 intFlowQcumulantsName += fAnalysisLabel->Data();
7819 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7820 if(intFlowQcumulants)
7821 {
7822 this->SetIntFlowQcumulants(intFlowQcumulants);
7823 } else
7824 {
7825 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7826 }
ff70ca91 7827 // final results for integrated Q-cumulants versus multiplicity:
7828 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7829 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7830 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
7831 for(Int_t co=0;co<4;co++) // cumulant order
7832 {
7833 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7834 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7835 if(intFlowQcumulantsVsM)
7836 {
7837 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7838 } else
7839 {
7840 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7841 }
7842 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 7843 // final integrated flow estimates from Q-cumulants:
7844 TString intFlowName = "fIntFlow";
7845 intFlowName += fAnalysisLabel->Data();
7846 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7847 if(intFlow)
7848 {
7849 this->SetIntFlow(intFlow);
7850 } else
7851 {
7852 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7853 }
7854 // integrated flow from Q-cumulants versus multiplicity:
7855 TString intFlowVsMName = "fIntFlowVsM";
7856 intFlowVsMName += fAnalysisLabel->Data();
7857 TString flowFlag[4] = {"v_{2}{2,QC}","v_{2}{4,QC}","v_{2}{6,QC}","v_{2}{8,QC}"}; // to be improved (harwired harmonic)
7858 for(Int_t co=0;co<4;co++) // cumulant order
7859 {
7860 TH1D *intFlowVsM = dynamic_cast<TH1D*>
7861 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
7862 if(intFlowVsM)
7863 {
7864 this->SetIntFlowVsM(intFlowVsM,co);
7865 } else
7866 {
7867 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7868 }
7869 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2001bc3a 7870 // quantifying detector effects effects to correlations:
7871 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
7872 intFlowDetectorBiasName += fAnalysisLabel->Data();
7873 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
7874 if(intFlowDetectorBias)
7875 {
7876 this->SetIntFlowDetectorBias(intFlowDetectorBias);
7877 } else
7878 {
7879 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7880 }
7881 // quantifying detector effects effects to correlations vs multiplicity:
7882 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
7883 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
7884 for(Int_t ci=0;ci<4;ci++) // correlation index
7885 {
7886 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
7887 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
7888 if(intFlowDetectorBiasVsM)
7889 {
7890 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
7891 } else
7892 {
7893 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7894 }
7895 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 7896 } else // to if(intFlowResults)
7897 {
7898 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7899 }
ff70ca91 7900
489d5531 7901} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7902
489d5531 7903//================================================================================================================================
7904
489d5531 7905void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
7906{
7907 // Get pointer to all objects relevant for differential flow.
7908 // a) Define flags locally (to be improved: should I promote flags to data members?);
7909 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
7910 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
7911 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
7912 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
7913
7914 // a) Define flags locally (to be improved: should I promote flags to data members?):
7915 TString typeFlag[2] = {"RP","POI"};
7916 TString ptEtaFlag[2] = {"p_{T}","#eta"};
7917 TString powerFlag[2] = {"linear","quadratic"};
7918 TString sinCosFlag[2] = {"sin","cos"};
7919 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
7920 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
7921 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
7922 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
7923 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
7924
7925 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
7926 TList *diffFlowList = NULL;
7927 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
7928 if(!diffFlowList)
7929 {
7930 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7931 exit(0);
7932 }
7933 // list holding nested lists containing profiles:
7934 TList *diffFlowListProfiles = NULL;
7935 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
7936 if(!diffFlowListProfiles)
7937 {
7938 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7939 exit(0);
7940 }
7941 // list holding nested lists containing 2D and 1D histograms with final results:
7942 TList *diffFlowListResults = NULL;
7943 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
7944 if(!diffFlowListResults)
7945 {
7946 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7947 exit(0);
7948 }
7949
7950 // c) Get pointer to profile holding all flags for differential flow;
7951 TString diffFlowFlagsName = "fDiffFlowFlags";
7952 diffFlowFlagsName += fAnalysisLabel->Data();
7953 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
7954 Bool_t bCalculate2DFlow = kFALSE;
7955 if(diffFlowFlags)
7956 {
7957 this->SetDiffFlowFlags(diffFlowFlags);
7958 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);
7959 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?)
7960 }
7961
7962 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
7963 // correlations:
7964 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
7965 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
7966 diffFlowCorrelationsProName += fAnalysisLabel->Data();
7967 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
7968 // products of correlations:
7969 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
7970 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
7971 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7972 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
7973 // corrections:
7974 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
7975 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
7976 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7977 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
7978 for(Int_t t=0;t<2;t++)
7979 {
7980 for(Int_t pe=0;pe<2;pe++)
7981 {
7982 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7983 if(!diffFlowCorrelationsProList[t][pe])
7984 {
7985 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7986 cout<<"t = "<<t<<endl;
7987 cout<<"pe = "<<pe<<endl;
7988 exit(0);
7989 }
7990 for(Int_t ci=0;ci<4;ci++) // correlation index
7991 {
7992 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())));
7993 if(diffFlowCorrelationsPro[t][pe][ci])
7994 {
7995 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
7996 } else
7997 {
7998 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7999 cout<<"t = "<<t<<endl;
8000 cout<<"pe = "<<pe<<endl;
8001 cout<<"ci = "<<ci<<endl;
8002 }
8003 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8004 // products of correlations:
8005 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8006 if(!diffFlowProductOfCorrelationsProList[t][pe])
8007 {
8008 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8009 cout<<"t = "<<t<<endl;
8010 cout<<"pe = "<<pe<<endl;
8011 exit(0);
8012 }
8013 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8014 {
8015 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8016 {
8017 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())));
8018 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
8019 {
8020 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
8021 } else
8022 {
8023 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8024 cout<<"t = "<<t<<endl;
8025 cout<<"pe = "<<pe<<endl;
8026 cout<<"mci1 = "<<mci1<<endl;
8027 cout<<"mci2 = "<<mci2<<endl;
8028 }
8029 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8030 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8031 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8032 // corrections:
8033 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8034 if(!diffFlowCorrectionsProList[t][pe])
8035 {
8036 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8037 cout<<"t = "<<t<<endl;
8038 cout<<"pe = "<<pe<<endl;
8039 exit(0);
8040 }
8041 // correction terms for NUA:
8042 for(Int_t sc=0;sc<2;sc++) // sin or cos
8043 {
8044 for(Int_t cti=0;cti<9;cti++) // correction term index
8045 {
8046 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)));
8047 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
8048 {
8049 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
8050 } else
8051 {
8052 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8053 cout<<"t = "<<t<<endl;
8054 cout<<"pe = "<<pe<<endl;
8055 cout<<"sc = "<<sc<<endl;
8056 cout<<"cti = "<<cti<<endl;
8057 }
8058 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8059 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8060 // ...
8061 } // end of for(Int_t pe=0;pe<2;pe++)
8062 } // end of for(Int_t t=0;t<2;t++)
8063
8064 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8065 // reduced correlations:
8066 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
8067 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8068 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8069 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
8070 // corrections for NUA:
8071 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
8072 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8073 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8074 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
8075 // differential Q-cumulants:
8076 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
8077 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8078 diffFlowCumulantsName += fAnalysisLabel->Data();
8079 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
8080 // differential flow estimates from Q-cumulants:
8081 TList *diffFlowHistList[2][2] = {{NULL}};
8082 TString diffFlowName = "fDiffFlow";
8083 diffFlowName += fAnalysisLabel->Data();
8084 TH1D *diffFlow[2][2][4] = {{{NULL}}};
8085 // differential covariances:
8086 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
8087 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8088 diffFlowCovariancesName += fAnalysisLabel->Data();
8089 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
8090 for(Int_t t=0;t<2;t++) // type: RP or POI
8091 {
8092 for(Int_t pe=0;pe<2;pe++) // pt or eta
8093 {
8094 // reduced correlations:
8095 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8096 if(!diffFlowCorrelationsHistList[t][pe])
8097 {
8098 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8099 cout<<"t = "<<t<<endl;
8100 cout<<"pe = "<<pe<<endl;
8101 exit(0);
8102 }
8103 for(Int_t index=0;index<4;index++)
8104 {
8105 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())));
8106 if(diffFlowCorrelationsHist[t][pe][index])
8107 {
8108 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8109 } else
8110 {
8111 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8112 cout<<"t = "<<t<<endl;
8113 cout<<"pe = "<<pe<<endl;
8114 cout<<"index = "<<index<<endl;
8115 exit(0);
8116 }
8117 } // end of for(Int_t index=0;index<4;index++)
8118 // corrections:
8119 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8120 if(!diffFlowCorrectionsHistList[t][pe])
8121 {
8122 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8123 cout<<"t = "<<t<<endl;
8124 cout<<"pe = "<<pe<<endl;
8125 exit(0);
8126 }
8127 // correction terms for NUA:
8128 for(Int_t sc=0;sc<2;sc++) // sin or cos
8129 {
8130 for(Int_t cti=0;cti<9;cti++) // correction term index
8131 {
8132 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)));
8133 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8134 {
8135 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8136 } else
8137 {
8138 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8139 cout<<"t = "<<t<<endl;
8140 cout<<"pe = "<<pe<<endl;
8141 cout<<"sc = "<<sc<<endl;
8142 cout<<"cti = "<<cti<<endl;
8143 }
8144 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8145 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8146 // ...
8147 // differential Q-cumulants:
8148 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8149 if(!diffFlowCumulantsHistList[t][pe])
8150 {
8151 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8152 cout<<"t = "<<t<<endl;
8153 cout<<"pe = "<<pe<<endl;
8154 exit(0);
8155 }
8156 for(Int_t index=0;index<4;index++)
8157 {
8158 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())));
8159 if(diffFlowCumulants[t][pe][index])
8160 {
8161 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8162 } else
8163 {
8164 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8165 cout<<"t = "<<t<<endl;
8166 cout<<"pe = "<<pe<<endl;
8167 cout<<"index = "<<index<<endl;
8168 exit(0);
8169 }
8170 } // end of for(Int_t index=0;index<4;index++)
8171 // differential flow estimates from Q-cumulants:
8172 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8173 if(!diffFlowHistList[t][pe])
8174 {
8175 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8176 cout<<"t = "<<t<<endl;
8177 cout<<"pe = "<<pe<<endl;
8178 exit(0);
8179 }
8180 for(Int_t index=0;index<4;index++)
8181 {
8182 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())));
8183 if(diffFlow[t][pe][index])
8184 {
8185 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8186 } else
8187 {
8188 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8189 cout<<"t = "<<t<<endl;
8190 cout<<"pe = "<<pe<<endl;
8191 cout<<"index = "<<index<<endl;
8192 exit(0);
8193 }
8194 } // end of for(Int_t index=0;index<4;index++)
8195 // differential covariances:
8196 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8197 if(!diffFlowCovariancesHistList[t][pe])
8198 {
8199 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8200 cout<<"t = "<<t<<endl;
8201 cout<<"pe = "<<pe<<endl;
8202 exit(0);
8203 }
8204 for(Int_t covIndex=0;covIndex<5;covIndex++)
8205 {
8206 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())));
8207 if(diffFlowCovariances[t][pe][covIndex])
8208 {
8209 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8210 } else
8211 {
8212 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8213 cout<<"t = "<<t<<endl;
8214 cout<<"pe = "<<pe<<endl;
8215 cout<<"covIndex = "<<covIndex<<endl;
8216 exit(0);
8217 }
8218 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8219 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8220 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8221 // sum of event weights for reduced correlations:
8222 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8223 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8224 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8225 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8226 for(Int_t t=0;t<2;t++) // type is RP or POI
8227 {
8228 for(Int_t pe=0;pe<2;pe++) // pt or eta
8229 {
8230 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8231 {
8232 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())));
8233 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8234 {
8235 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8236 cout<<"t = "<<t<<endl;
8237 cout<<"pe = "<<pe<<endl;
8238 cout<<"power = "<<p<<endl;
8239 exit(0);
8240 }
8241 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8242 {
8243 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())));
8244 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8245 {
8246 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8247 } else
8248 {
8249 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8250 cout<<"t = "<<t<<endl;
8251 cout<<"pe = "<<pe<<endl;
8252 cout<<"power = "<<p<<endl;
8253 cout<<"ew = "<<ew<<endl;
8254 exit(0);
8255 }
8256 }
8257 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8258 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8259 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8260 //
8261 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8262 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8263 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8264 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8265 for(Int_t t=0;t<2;t++) // type is RP or POI
8266 {
8267 for(Int_t pe=0;pe<2;pe++) // pt or eta
8268 {
8269 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8270 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8271 {
8272 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8273 cout<<"t = "<<t<<endl;
8274 cout<<"pe = "<<pe<<endl;
8275 exit(0);
8276 }
8277 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8278 {
8279 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8280 {
8281 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())));
8282 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8283 {
8284 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8285 } else
8286 {
8287 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8288 cout<<"t = "<<t<<endl;
8289 cout<<"pe = "<<pe<<endl;
8290 cout<<"mci1 = "<<mci1<<endl;
8291 cout<<"mci2 = "<<mci2<<endl;
8292 exit(0);
8293 }
8294 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8295 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8296 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8297 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8298 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8299
8300} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8301
8302
8303//================================================================================================================================
8304
8305
8306void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8307{
8308 // Book all histograms and profiles needed for differential flow.
8309 // a) Define flags locally (to be improved: should I promote flags to data members?);
8310 // b) Book profile to hold all flags for differential flow;
8311 // c) Book e-b-e quantities;
8312 // d) Book profiles;
8313 // e) Book histograms holding final results.
8314
8315 // a) Define flags locally (to be improved: should I promote flags to data members?):
8316 TString typeFlag[2] = {"RP","POI"};
8317 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8318 TString powerFlag[2] = {"linear","quadratic"};
8319 TString sinCosFlag[2] = {"sin","cos"};
8320 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8321 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8322 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8323 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8324 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8325 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8326 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8327 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
8328
8329 // b) Book profile to hold all flags for differential flow:
8330 TString diffFlowFlagsName = "fDiffFlowFlags";
8331 diffFlowFlagsName += fAnalysisLabel->Data();
8332 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);
8333 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8334 fDiffFlowFlags->SetMarkerStyle(25);
8335 fDiffFlowFlags->SetLabelSize(0.05);
8336 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8337 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");
8338 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");
8339 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");
8340 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");
8341 fDiffFlowList->Add(fDiffFlowFlags);
8342
8343 // c) Book e-b-e quantities:
8344 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8345 // Explanantion of notation:
8346 // 1.) n is harmonic, m is multiple of harmonic;
8347 // 2.) k is power of particle weight;
8348 // 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);
8349 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8350 // (if i-th POI is also RP, than it is weighted with w_i^k);
8351 // 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
8352 // (i-th RP&&POI is weighted with w_i^k)
8353
8354 // 1D:
8355 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8356 {
8357 for(Int_t pe=0;pe<2;pe++) // pt or eta
8358 {
8359 for(Int_t m=0;m<4;m++) // multiple of harmonic
8360 {
8361 for(Int_t k=0;k<9;k++) // power of particle weight
8362 {
8363 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8364 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8365 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8366 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8367 }
8368 }
8369 }
8370 }
8371 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8372 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8373 {
8374 for(Int_t pe=0;pe<2;pe++) // pt or eta
8375 {
8376 for(Int_t k=0;k<9;k++) // power of particle weight
8377 {
8378 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8379 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8380 }
8381 }
8382 }
8383 // correction terms for nua:
8384 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8385 {
8386 for(Int_t pe=0;pe<2;pe++) // pt or eta
8387 {
8388 for(Int_t sc=0;sc<2;sc++) // sin or cos
8389 {
8390 for(Int_t cti=0;cti<9;cti++) // correction term index
8391 {
8392 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8393 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8394 }
8395 }
8396 }
8397 }
8398 // 2D:
8399 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8400 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8401 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8402 {
8403 for(Int_t m=0;m<4;m++)
8404 {
8405 for(Int_t k=0;k<9;k++)
8406 {
8407 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8408 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8409 }
8410 }
8411 }
8412 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8413 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8414 {
8415 for(Int_t k=0;k<9;k++)
8416 {
8417 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8418 }
8419 }
8420 // reduced correlations e-b-e:
8421 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8422 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8423 for(Int_t t=0;t<2;t++) // type: RP or POI
8424 {
8425 for(Int_t pe=0;pe<2;pe++) // pt or eta
8426 {
8427 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8428 {
8429 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]);
8430 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8431 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8432 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8433 // event weights for reduced correlations e-b-e:
8434 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8435 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8436 for(Int_t t=0;t<2;t++) // type: RP or POI
8437 {
8438 for(Int_t pe=0;pe<2;pe++) // pt or eta
8439 {
8440 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8441 {
8442 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]);
8443 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8444 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8445 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8446
8447 // d) Book profiles;
8448 // reduced correlations:
8449 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8450 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8451 // corrections terms:
8452 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8453 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8454 for(Int_t t=0;t<2;t++) // type: RP or POI
8455 {
8456 for(Int_t pe=0;pe<2;pe++) // pt or eta
8457 {
8458 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8459 {
8460 // reduced correlations:
8461 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");
8462 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8463 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8464 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8465 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8466 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8467 // correction terms for nua:
8468 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8469 {
8470 for(Int_t pe=0;pe<2;pe++) // pt or eta
8471 {
8472 for(Int_t sc=0;sc<2;sc++) // sin or cos
8473 {
8474 for(Int_t cti=0;cti<9;cti++) // correction term index
8475 {
8476 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]);
8477 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8478 }
8479 }
8480 }
8481 }
8482 // e) Book histograms holding final results.
8483 // reduced correlations:
8484 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8485 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8486 // corrections terms:
8487 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8488 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8489 // differential covariances:
8490 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8491 diffFlowCovariancesName += fAnalysisLabel->Data();
8492 // differential Q-cumulants:
8493 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8494 diffFlowCumulantsName += fAnalysisLabel->Data();
8495 // differential flow:
8496 TString diffFlowName = "fDiffFlow";
8497 diffFlowName += fAnalysisLabel->Data();
8498 for(Int_t t=0;t<2;t++) // type: RP or POI
8499 {
8500 for(Int_t pe=0;pe<2;pe++) // pt or eta
8501 {
8502 for(Int_t index=0;index<4;index++)
8503 {
8504 // reduced correlations:
8505 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]);
8506 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8507 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8508 // differential Q-cumulants:
8509 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]);
8510 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8511 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
8512 // differential flow estimates from Q-cumulants:
8513 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]);
8514 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8515 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8516 } // end of for(Int_t index=0;index<4;index++)
8517 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8518 {
8519 // differential covariances:
8520 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]);
8521 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8522 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8523 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8524 // products of both types of correlations:
8525 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8526 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8527 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8528 {
8529 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8530 {
8531 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]);
8532 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8533 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8534 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8535 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8536 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8537 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8538 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8539 // sums of event weights for reduced correlations:
8540 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8541 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8542 for(Int_t t=0;t<2;t++) // type is RP or POI
8543 {
8544 for(Int_t pe=0;pe<2;pe++) // pt or eta
8545 {
8546 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8547 {
8548 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8549 {
8550 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]);
8551 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8552 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8553 }
8554 }
8555 }
8556 }
8557 // sum of products of event weights for both types of correlations:
8558 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8559 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8560 for(Int_t t=0;t<2;t++) // type is RP or POI
8561 {
8562 for(Int_t pe=0;pe<2;pe++) // pt or eta
8563 {
8564 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8565 {
8566 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8567 {
8568 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]);
8569 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8570 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8571 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8572 }
8573 }
8574 }
8575 }
8576 // correction terms for nua:
8577 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8578 {
8579 for(Int_t pe=0;pe<2;pe++) // pt or eta
8580 {
8581 for(Int_t sc=0;sc<2;sc++) // sin or cos
8582 {
8583 for(Int_t cti=0;cti<9;cti++) // correction term index
8584 {
8585 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]);
8586 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8587 }
8588 }
8589 }
8590 }
8591
8592} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8593
8594
8595//================================================================================================================================
8596
8597/*
8598void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)
8599{
8600 // Calculate final corrections for non-uniform acceptance for Q-cumulants.
8601
8602 // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,
8603 // binning of fCorrectionsForNUA is organized as follows:
8604 //
8605 // 1st bin: correction to QC{2}
8606 // 2nd bin: correction to QC{4}
8607 // 3rd bin: correction to QC{6}
8608 // 4th bin: correction to QC{8}
8609
8610 // shortcuts flags:
8611 Int_t pW = (Int_t)(useParticleWeights);
8612
8613 Int_t eW = -1;
8614
8615 if(eventWeights == "exact")
8616 {
8617 eW = 0;
8618 }
8619
8620 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
8621 {
8622 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
8623 {
8624 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
8625 cout<<"pW = "<<pW<<endl;
8626 cout<<"eW = "<<eW<<endl;
8627 cout<<"sc = "<<sc<<endl;
8628 exit(0);
8629 }
8630 }
8631
8632 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
8633 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
8634 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
8635 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
8636 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
8637
8638 // correction terms to QC{2}:
8639 // <<cos(n*phi1)>>^2
8640 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
8641 // <<sin(n*phi1)>>^2
8642 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
8643 // final corrections for non-uniform acceptance to QC{2}:
8644 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
8645 fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
8646
8647 // correction terms to QC{4}:
8648 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8649 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
8650 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8651 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
8652 // <<cos(n*(phi1+phi2))>>^2
8653 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
8654 // <<sin(n*(phi1+phi2))>>^2
8655 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
8656 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8657 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
8658 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8659 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8660 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
8661 * fQCorrections[pW][eW][1]->GetBinContent(1)
8662 * fQCorrections[pW][eW][0]->GetBinContent(1);
8663 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8664 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8665 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8666 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
8667 // final correction to QC{4}:
8668 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
8669 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8670 fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
8671
8672 // ... to be improved (continued for 6th and 8th order)
8673
8674
8675} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()
8676*/
8677
8678//================================================================================================================================
8679
8680
8681void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8682{
8683 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8684
8685 // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):
8686 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8687 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8688 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8689 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8690
8691 // statistical error of measured 2-, 4-, 6- and 8-particle correlations:
8692 //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
8693 //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
8694 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
8695 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
8696
8697 // QC{2}:
8698 // <<cos(n*phi1)>>^2
8699 Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2);
8700 //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2);
8701 // <<sin(n*phi1)>>^2
8702 Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2);
8703 //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2);
8704 // generalized QC{2}:
8705 Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)
8706 fIntFlowQcumulants->SetBinContent(1,gQC2);
8707 //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error)
8708
8709 // QC{4}:
8710 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8711 Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8712 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3);
8713 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8714 Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)
8715 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3);
8716 // <<cos(n*(phi1+phi2))>>^2
8717 Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2);
8718 // <<sin(n*(phi1+phi2))>>^2
8719 Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2);
8720 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8721 Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)
8722 * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8723 - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8724 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8725 Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)
8726 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8727 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1);
8728 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8729 Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8730 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8731 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8732 Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8733 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2);
8734 // generalized QC{4}:
8735 Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm
8736 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8737 fIntFlowQcumulants->SetBinContent(2,gQC4);
8738 //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error)
8739
8740 // ... to be improved (continued for 6th and 8th order)
8741
2001bc3a 8742 // versus multiplicity:
8743 if(fApplyCorrectionForNUAVsM)
8744 {
8745 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
8746 for(Int_t b=1;b<=nBins;b++)
8747 {
8748 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
8749 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
8750 // generalized QC{2} vs M:
8751 two1stTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2); // <<cos(n*phi1)>>^2 vs M
8752 two2ndTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2); // <<sin(n*phi1)>>^2 vs M
8753 gQC2 = two - two1stTerm - two2ndTerm;
8754 fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);
8755 // generalized QC{4} vs M:
8756 four1stTerm = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b)
8757 * fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>> vs M
8758 four2ndTerm = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b)
8759 * fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>> vs M
8760 four3rdTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b),2); // <<cos(n*(phi1+phi2))>>^2 vs M
8761 four4thTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b),2); // <<sin(n*(phi1+phi2))>>^2 vs M
8762 four5thTerm = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b)
8763 * (pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2)
8764 - pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2)); //<<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2-<<sin(n*phi1)>>^2) vs M
8765 four6thTerm = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b)
8766 * fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b)
8767 * fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>> vs M
8768 four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2)
8769 + pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2)); // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2) vs M
8770 four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2)
8771 + pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2),2); // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8772 gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm
8773 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8774 fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);
8775 } // end of for(Int_t b=1;b<=nBins;b++)
8776 } // end of if(fApplyCorrectionForNUAVsM)
8777
489d5531 8778} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8779
489d5531 8780//================================================================================================================================
8781
489d5531 8782void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
8783{
8784 // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).
8785
8786 // to be improved: add protection for NULL pointers, propagate statistical errors from
8787 // measured correlations and correction terms
8788
8789 // generalized Q-cumulants:
8790 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
8791 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
8792 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
8793 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
8794
8795 // integrated flow estimates:
8796 Double_t v2 = 0.; // v{2,QC}
8797 Double_t v4 = 0.; // v{4,QC}
8798 //Double_t v6 = 0.; // v{6,QC}
8799 //Double_t v8 = 0.; // v{8,QC}
8800
8801 // calculate integrated flow estimates from generalized Q-cumulants:
8802 if(qc2>=0.) v2 = pow(qc2,1./2.);
8803 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
8804 //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
8805 //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
8806
8807 // store integrated flow estimates from generalized Q-cumulants:
8808 fIntFlow->SetBinContent(1,v2);
8809 fIntFlow->SetBinContent(2,v4);
8810 //fIntFlow->SetBinContent(3,v6);
8811 //fIntFlow->SetBinContent(4,v8);
0328db2d 8812
8813 /*
8814 // propagate correctly error by including non-isotropic terms (to be improved - moved somewhere else):
8815 // correlations:
8816 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8817 //Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8818 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8819 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8820 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
8821 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
8822 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
8823 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
8824 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
8825 // nua terms:
8826 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(phi1)>>
8827 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
8828 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
8829 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(phi1)>>
8830 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
8831 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
8832 // statistical errors of nua terms:
8833 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <cos(phi1)>
8834 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <cos(phi1+phi2)>
8835 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <cos(phi1-phi2-phi3)>
8836 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <sin(phi1)>
8837 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <sin(phi1+phi2)>
8838 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <sin(phi1-phi2-phi3)>
8839
8840 // covariances for nua:
8841 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
8842 Double_t wCov2c1 = fIntFlowCovariancesNUA->GetBinContent(1);
8843 Double_t wCov2s1 = fIntFlowCovariancesNUA->GetBinContent(2);
8844 Double_t wCovc1s1 = fIntFlowCovariancesNUA->GetBinContent(3);
8845 Double_t wCov2c2 = fIntFlowCovariancesNUA->GetBinContent(4);
8846 Double_t wCov2s2 = fIntFlowCovariancesNUA->GetBinContent(5);
8847 Double_t wCov2c3 = fIntFlowCovariancesNUA->GetBinContent(6);
8848 Double_t wCov2s3 = fIntFlowCovariancesNUA->GetBinContent(7);
8849 Double_t wCov4c1 = fIntFlowCovariancesNUA->GetBinContent(8);
8850 Double_t wCov4s1 = fIntFlowCovariancesNUA->GetBinContent(9);
8851 Double_t wCov4c2 = fIntFlowCovariancesNUA->GetBinContent(10);
8852 Double_t wCov4s2 = fIntFlowCovariancesNUA->GetBinContent(11);
8853 Double_t wCov4c3 = fIntFlowCovariancesNUA->GetBinContent(12);
8854 Double_t wCov4s3 = fIntFlowCovariancesNUA->GetBinContent(13);
8855 Double_t wCovc1c2 = fIntFlowCovariancesNUA->GetBinContent(14);
8856 Double_t wCovc1s2 = fIntFlowCovariancesNUA->GetBinContent(15);
8857 Double_t wCovc1c3 = fIntFlowCovariancesNUA->GetBinContent(16);
8858 Double_t wCovc1s3 = fIntFlowCovariancesNUA->GetBinContent(17);
8859 Double_t wCovs1c2 = fIntFlowCovariancesNUA->GetBinContent(18);
8860 Double_t wCovs1s2 = fIntFlowCovariancesNUA->GetBinContent(19);
8861 Double_t wCovs1c3 = fIntFlowCovariancesNUA->GetBinContent(20);
8862 Double_t wCovs1s3 = fIntFlowCovariancesNUA->GetBinContent(21);
8863 Double_t wCovc2s2 = fIntFlowCovariancesNUA->GetBinContent(22);
8864 Double_t wCovc2c3 = fIntFlowCovariancesNUA->GetBinContent(23);
8865 Double_t wCovc2s3 = fIntFlowCovariancesNUA->GetBinContent(24);
8866 Double_t wCovs2c3 = fIntFlowCovariancesNUA->GetBinContent(25);
8867 Double_t wCovs2s3 = fIntFlowCovariancesNUA->GetBinContent(26);
8868 Double_t wCovc3s3 = fIntFlowCovariancesNUA->GetBinContent(27);
8869 */
8870
8871 /*
8872 // 2nd order:
8873 Double_t err2ndSquared = (1./(4.*pow(v2,2.)))
8874 * (pow(twoError,2.)+4.*pow(s1*s1Error,2.)+4.*pow(c1*c1Error,2.)
8875 // to be improved (add eventually also covariance terms)
8876 //- 4.*c1*wCov2c1-4.*s1*wCov2s1+8.*c1*s1*wCovc1s1
8877 );
8878 if(err2ndSquared>=0.)
8879 {
8880 fIntFlow->SetBinError(1,pow(err2ndSquared,0.5)); // to be improved (enabled eventually)
8881 } else
8882 {
8883 cout<<"WARNING: Statistical error of v{2,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
8884 }
8885 // 4th order:
8886 Double_t err4thSquared = (1./(16.*pow(v4,6.)))
8887 * (pow(4.*pow(two,2.)-8.*(pow(c1,2.)+pow(s1,2.)),2.)*pow(twoError,2.)
8888 + pow(fourError,2.)
8889 + 16.*pow(6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two,2.)*pow(c1Error,2.)
8890 + 16.*pow(6.*pow(c1,2.)*s1+2.*c2*s1+6.*pow(s1,3.)-2.*c1*s2-s3-4.*s1*two,2.)*pow(s1Error,2.)
8891 + 4.*pow(c2-2.*(pow(c1,2.)-pow(s1,2.)),2.)*pow(c2Error,2.)
8892 + 4.*pow(4*c1*s1-s2,2.)*pow(s2Error,2.)
8893 + 16.*pow(c1,2.)*pow(c3Error,2.)
8894 + 16.*pow(s1,2.)*pow(s3Error,2.)
8895 // to be improved (add eventually also covariance terms)
8896 // ...
8897 );
8898 if(err4thSquared>=0.)
8899 {
8900 fIntFlow->SetBinError(2,pow(err4thSquared,0.5)); // to be improved (enabled eventually)
8901 } else
8902 {
8903 cout<<"WARNING: Statistical error of v{4,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
8904 }
8905 */
8906
489d5531 8907} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
8908
8909
8910//================================================================================================================================
8911
8912
8913void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
8914{
0328db2d 8915 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 8916 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 8917 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 8918 //
8919 // Remark: Statistical error of correction temrs is calculated as:
8920 //
8921 // statistical error = termA * spread * termB:
8922 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
8923 // termB = 1/sqrt(1-termA^2)
8924
489d5531 8925 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
8926 {
0328db2d 8927 for(Int_t ci=1;ci<=3;ci++) // correction term index
489d5531 8928 {
8929 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 8930 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
8931 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
8932 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
8933 Double_t termA = 0.;
8934 Double_t termB = 0.;
8935 if(sumOfLinearEventWeights)
8936 {
8937 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
8938 } else
8939 {
8940 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
8941 cout<<" (for "<<ci<<"-th correction term)"<<endl;
8942 }
489d5531 8943 if(1.-pow(termA,2.) > 0.)
8944 {
8945 termB = 1./pow(1-pow(termA,2.),0.5);
8946 } else
8947 {
0328db2d 8948 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
8949 cout<<" (for "<<ci<<"-th correction term)"<<endl;
489d5531 8950 }
8951 Double_t statisticalError = termA * spread * termB;
489d5531 8952 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 8953 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
489d5531 8954 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
8955 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
8956
8957} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
8958
8959
8960//================================================================================================================================
8961
8962
8963void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
8964{
8965 // Get pointers to all objects relevant for calculations with nested loops.
8966
8967 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
8968 if(nestedLoopsList)
8969 {
8970 this->SetNestedLoopsList(nestedLoopsList);
8971 } else
8972 {
8973 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8974 exit(0);
8975 }
8976
8977 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
8978 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
8979 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
8980 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
8981
8982 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
8983 evaluateNestedLoopsName += fAnalysisLabel->Data();
8984 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
8985 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
8986 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
8987 if(evaluateNestedLoops)
8988 {
8989 this->SetEvaluateNestedLoops(evaluateNestedLoops);
8990 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
8991 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
8992 }
8993 // nested loops relevant for integrated flow:
8994 if(bEvaluateIntFlowNestedLoops)
8995 {
8996 // correlations:
8997 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
8998 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
8999 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
9000 if(intFlowDirectCorrelations)
9001 {
9002 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
9003 } else
9004 {
9005 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9006 exit(0);
9007 }
9008 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9009 {
9010 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
9011 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
9012 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
9013 if(intFlowExtraDirectCorrelations)
9014 {
9015 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
9016 } else
9017 {
9018 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9019 exit(0);
9020 }
9021 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9022 // correction terms for non-uniform acceptance:
9023 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
9024 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9025 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
9026 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9027 {
9028 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
9029 if(intFlowDirectCorrectionTermsForNUA[sc])
9030 {
9031 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
9032 } else
9033 {
9034 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9035 cout<<"sc = "<<sc<<endl;
9036 exit(0);
9037 }
9038 } // end of for(Int_t sc=0;sc<2;sc++)
9039 } // end of if(bEvaluateIntFlowNestedLoops)
9040
9041 // nested loops relevant for differential flow:
9042 if(bEvaluateDiffFlowNestedLoops)
9043 {
9044 // correlations:
9045 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
9046 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
9047 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
9048 for(Int_t t=0;t<2;t++)
9049 {
9050 for(Int_t pe=0;pe<2;pe++)
9051 {
9052 for(Int_t ci=0;ci<4;ci++) // correlation index
9053 {
9054 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())));
9055 if(diffFlowDirectCorrelations[t][pe][ci])
9056 {
9057 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
9058 } else
9059 {
9060 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9061 cout<<"t = "<<t<<endl;
9062 cout<<"pe = "<<pe<<endl;
9063 cout<<"ci = "<<ci<<endl;
9064 }
9065 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9066 } // end of for(Int_t pe=0;pe<2;pe++)
9067 } // end of for(Int_t t=0;t<2;t++)
9068 // correction terms for non-uniform acceptance:
9069 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
9070 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9071 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
9072 for(Int_t t=0;t<2;t++)
9073 {
9074 for(Int_t pe=0;pe<2;pe++)
9075 {
9076 // correction terms for NUA:
9077 for(Int_t sc=0;sc<2;sc++) // sin or cos
9078 {
9079 for(Int_t cti=0;cti<9;cti++) // correction term index
9080 {
9081 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)));
9082 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
9083 {
9084 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
9085 } else
9086 {
9087 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9088 cout<<"t = "<<t<<endl;
9089 cout<<"pe = "<<pe<<endl;
9090 cout<<"sc = "<<sc<<endl;
9091 cout<<"cti = "<<cti<<endl;
9092 }
9093 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9094 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9095 } // end of for(Int_t pe=0;pe<2;pe++)
9096 } // end of for(Int_t t=0;t<2;t++)
9097 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
9098 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
9099 TH1D *noOfParticlesInBin = NULL;
9100 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
9101 if(noOfParticlesInBin)
9102 {
9103 this->SetNoOfParticlesInBin(noOfParticlesInBin);
9104 } else
9105 {
9106 cout<<endl;
9107 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9108 cout<<endl;
9109 }
9110 } // end of if(bEvaluateDiffFlowNestedLoops)
9111
9112} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9113
9114
9115//================================================================================================================================
9116
9117
9118void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9119{
9120 // Store flow harmonic in common control histograms.
9121
9122 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
9123 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
9124 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
9125 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
9126 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9127
9128} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9129
9130
9131//================================================================================================================================
9132
9133
9134void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9135{
9136 // Calculate all correlations needed for differential flow using particle weights.
9137
9138 Int_t t = -1; // type flag
9139 Int_t pe = -1; // ptEta flag
9140
9141 if(type == "RP")
9142 {
9143 t = 0;
9144 } else if(type == "POI")
9145 {
9146 t = 1;
9147 }
9148
9149 if(ptOrEta == "Pt")
9150 {
9151 pe = 0;
9152 } else if(ptOrEta == "Eta")
9153 {
9154 pe = 1;
9155 }
9156
9157 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9158 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9159 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9160 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9161
9162 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9163 Double_t dReQ1n1k = (*fReQ)(0,1);
9164 Double_t dReQ2n2k = (*fReQ)(1,2);
9165 Double_t dReQ1n3k = (*fReQ)(0,3);
9166 //Double_t dReQ4n4k = (*fReQ)(3,4);
9167 Double_t dImQ1n1k = (*fImQ)(0,1);
9168 Double_t dImQ2n2k = (*fImQ)(1,2);
9169 Double_t dImQ1n3k = (*fImQ)(0,3);
9170 //Double_t dImQ4n4k = (*fImQ)(3,4);
9171
9172 // S^M_{p,k} (see .h file for the definition of fSMpk):
9173 Double_t dSM1p1k = (*fSMpk)(0,1);
9174 Double_t dSM1p2k = (*fSMpk)(0,2);
9175 Double_t dSM1p3k = (*fSMpk)(0,3);
9176 Double_t dSM2p1k = (*fSMpk)(1,1);
9177 Double_t dSM3p1k = (*fSMpk)(2,1);
9178
9179 // looping over all bins and calculating reduced correlations:
9180 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9181 {
9182 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9183 Double_t p1n0kRe = 0.;
9184 Double_t p1n0kIm = 0.;
9185
9186 // number of POIs in particular (pt,eta) bin):
9187 Double_t mp = 0.;
9188
9189 // real and imaginary parts of q_{m*n,k}:
9190 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9191 Double_t q1n2kRe = 0.;
9192 Double_t q1n2kIm = 0.;
9193 Double_t q2n1kRe = 0.;
9194 Double_t q2n1kIm = 0.;
9195
9196 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9197 Double_t s1p1k = 0.;
9198 Double_t s1p2k = 0.;
9199 Double_t s1p3k = 0.;
9200
9201 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9202 Double_t dM0111 = 0.;
9203
9204 if(type == "POI")
9205 {
9206 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9207 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9208 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9209 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9210
9211 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9212
9213 t = 1; // typeFlag = RP or POI
9214
9215 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9216 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9217 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9218 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9219 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9220 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9221 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9222 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9223 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9224
9225 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9226 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9227 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9228 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9229
9230 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9231 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9232 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9233 + 2.*(s1p3k-s1p2k*dSM1p1k));
9234 }
9235 else if(type == "RP")
9236 {
9237 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9238 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9239 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9240 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9241 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9242 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9243 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9244 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9245 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9246
9247 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9248 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9249 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9250 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9251
9252 // to be improved (cross-checked):
9253 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9254 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9255 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9256 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9257
9258 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9259
9260 t = 0; // typeFlag = RP or POI
9261
9262 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9263 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9264 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9265 + 2.*(s1p3k-s1p2k*dSM1p1k));
9266 //...............................................................................................
9267 }
9268
9269 // 2'-particle correlation:
9270 Double_t two1n1nW0W1 = 0.;
9271 if(mp*dSM1p1k-s1p1k)
9272 {
9273 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9274 / (mp*dSM1p1k-s1p1k);
9275
9276 // fill profile to get <<2'>>
9277 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9278 // histogram to store <2'> e-b-e (needed in some other methods):
9279 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9280 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9281 } // end of if(mp*dSM1p1k-s1p1k)
9282
9283 // 4'-particle correlation:
9284 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9285 if(dM0111)
9286 {
9287 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9288 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9289 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9290 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9291 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9292 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9293 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9294 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9295 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9296 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9297 + 2.*s1p1k*dSM1p2k
9298 - 6.*s1p3k)
9299 / dM0111; // to be improved (notation of dM0111)
9300
9301 // fill profile to get <<4'>>
9302 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9303 // histogram to store <4'> e-b-e (needed in some other methods):
9304 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9305 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9306 } // end of if(dM0111)
9307 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9308
9309} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9310
9311
9312//================================================================================================================================
9313
9314
9315void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9316{
9317 // Fill common control histograms.
9318
9319 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9320 fCommonHists->FillControlHistograms(anEvent);
9321 if(nRP>1)
9322 {
9323 fCommonHists2nd->FillControlHistograms(anEvent);
9324 if(nRP>3)
9325 {
9326 fCommonHists4th->FillControlHistograms(anEvent);
9327 if(nRP>5)
9328 {
9329 fCommonHists6th->FillControlHistograms(anEvent);
9330 if(nRP>7)
9331 {
9332 fCommonHists8th->FillControlHistograms(anEvent);
9333 } // end of if(nRP>7)
9334 } // end of if(nRP>5)
9335 } // end of if(nRP>3)
9336 } // end of if(nRP>1)
9337
9338} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9339
9340
9341//================================================================================================================================
9342
9343
9344void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9345{
9346 // Reset all event by event quantities.
9347
9348 // integrated flow:
9349 fReQ->Zero();
9350 fImQ->Zero();
9351 fSMpk->Zero();
9352 fIntFlowCorrelationsEBE->Reset();
9353 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9354 fIntFlowCorrelationsAllEBE->Reset();
9355
9356 if(fApplyCorrectionForNUA)
9357 {
9358 for(Int_t sc=0;sc<2;sc++)
9359 {
9360 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
0328db2d 9361 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 9362 }
9363 }
9364
9365 // differential flow:
9366 // 1D:
9367 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9368 {
9369 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9370 {
9371 for(Int_t m=0;m<4;m++) // multiple of harmonic
9372 {
9373 for(Int_t k=0;k<9;k++) // power of weight
9374 {
9375 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9376 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9377 }
9378 }
9379 }
9380 }
9381
9382 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9383 {
9384 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9385 {
9386 for(Int_t k=0;k<9;k++)
9387 {
9388 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9389 }
9390 }
9391 }
9392
9393 // e-b-e reduced correlations:
9394 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9395 {
9396 for(Int_t pe=0;pe<2;pe++) // pt or eta
9397 {
9398 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9399 {
9400 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9401 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9402 }
9403 }
9404 }
9405
9406 // correction terms for NUA:
9407 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9408 {
9409 for(Int_t pe=0;pe<2;pe++) // pt or eta
9410 {
9411 for(Int_t sc=0;sc<2;sc++) // sin or cos
9412 {
9413 for(Int_t cti=0;cti<9;cti++) // correction term index
9414 {
9415 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
9416 }
9417 }
9418 }
9419 }
9420
9421 // 2D (pt,eta)
9422 if(fCalculate2DFlow)
9423 {
9424 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9425 {
9426 for(Int_t m=0;m<4;m++) // multiple of harmonic
9427 {
9428 for(Int_t k=0;k<9;k++) // power of weight
9429 {
9430 if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();
9431 if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();
9432 }
9433 }
9434 }
9435 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9436 {
9437 for(Int_t k=0;k<9;k++)
9438 {
9439 if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();
9440 }
9441 }
9442 } // end of if(fCalculate2DFlow)
9443
9444} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9445
9446
9447//================================================================================================================================
9448
9449
9450void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9451{
9452 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9453
9454 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9455 // 0: <<sin n(psi1)>>
9456 // 1: <<sin n(psi1+phi2)>>
9457 // 2: <<sin n(psi1+phi2-phi3)>>
9458 // 3: <<sin n(psi1-phi2-phi3)>>:
9459 // 4:
9460 // 5:
9461 // 6:
9462
9463 // multiplicity:
9464 Double_t dMult = (*fSMpk)(0,0);
9465
9466 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9467 Double_t dReQ1n = (*fReQ)(0,0);
9468 Double_t dReQ2n = (*fReQ)(1,0);
9469 //Double_t dReQ3n = (*fReQ)(2,0);
9470 //Double_t dReQ4n = (*fReQ)(3,0);
9471 Double_t dImQ1n = (*fImQ)(0,0);
9472 Double_t dImQ2n = (*fImQ)(1,0);
9473 //Double_t dImQ3n = (*fImQ)(2,0);
9474 //Double_t dImQ4n = (*fImQ)(3,0);
9475
9476 Int_t t = -1; // type flag
9477 Int_t pe = -1; // ptEta flag
9478
9479 if(type == "RP")
9480 {
9481 t = 0;
9482 } else if(type == "POI")
9483 {
9484 t = 1;
9485 }
9486
9487 if(ptOrEta == "Pt")
9488 {
9489 pe = 0;
9490 } else if(ptOrEta == "Eta")
9491 {
9492 pe = 1;
9493 }
9494
9495 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9496 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9497 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9498 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9499
9500 // looping over all bins and calculating correction terms:
9501 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9502 {
9503 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9504 Double_t p1n0kRe = 0.;
9505 Double_t p1n0kIm = 0.;
9506
9507 // number of POIs in particular pt or eta bin:
9508 Double_t mp = 0.;
9509
9510 // 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):
9511 Double_t q1n0kRe = 0.;
9512 Double_t q1n0kIm = 0.;
9513 Double_t q2n0kRe = 0.;
9514 Double_t q2n0kIm = 0.;
9515
9516 // number of particles which are both RPs and POIs in particular pt or eta bin:
9517 Double_t mq = 0.;
9518
9519 if(type == "POI")
9520 {
9521 // q_{m*n,0}:
9522 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9523 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9524 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9525 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9526 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9527 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9528 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9529 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9530
9531 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9532 }
9533 else if(type == "RP")
9534 {
9535 // q_{m*n,0}:
9536 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9537 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9538 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9539 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9540 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9541 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9542 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9543 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9544
9545 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9546 }
9547 if(type == "POI")
9548 {
9549 // p_{m*n,0}:
9550 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9551 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9552 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9553 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9554
9555 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9556
9557 t = 1; // typeFlag = RP or POI
9558 }
9559 else if(type == "RP")
9560 {
9561 // p_{m*n,0} = q_{m*n,0}:
9562 p1n0kRe = q1n0kRe;
9563 p1n0kIm = q1n0kIm;
9564
9565 mp = mq;
9566
9567 t = 0; // typeFlag = RP or POI
9568 }
9569
9570 // <<sin n(psi1)>>:
9571 Double_t sinP1nPsi = 0.;
9572 if(mp)
9573 {
9574 sinP1nPsi = p1n0kIm/mp;
9575 // fill profile for <<sin n(psi1)>>:
9576 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9577 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9578 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9579 } // end of if(mp)
9580
9581 // <<sin n(psi1+phi2)>>:
9582 Double_t sinP1nPsiP1nPhi = 0.;
9583 if(mp*dMult-mq)
9584 {
9585 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9586 // fill profile for <<sin n(psi1+phi2)>>:
9587 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9588 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9589 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9590 } // end of if(mp*dMult-mq)
9591
9592 // <<sin n(psi1+phi2-phi3)>>:
9593 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9594 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9595 {
9596 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9597 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9598 - mq*dImQ1n+2.*q1n0kIm)
9599 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9600 // fill profile for <<sin n(psi1+phi2)>>:
9601 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9602 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9603 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9604 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9605
9606 // <<sin n(psi1-phi2-phi3)>>:
9607 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9608 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9609 {
9610 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9611 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9612 + 2.*mq*dImQ1n-2.*q1n0kIm)
9613 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9614 // fill profile for <<sin n(psi1+phi2)>>:
9615 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9616 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9617 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9618 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9619 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9620
9621} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9622
9623
9624//================================================================================================================================
9625
9626
9627void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9628{
9629 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9630
9631 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9632 // 0: <<cos n(psi)>>
9633 // 1: <<cos n(psi1+phi2)>>
9634 // 2: <<cos n(psi1+phi2-phi3)>>
9635 // 3: <<cos n(psi1-phi2-phi3)>>
9636 // 4:
9637 // 5:
9638 // 6:
9639
9640 // multiplicity:
9641 Double_t dMult = (*fSMpk)(0,0);
9642
9643 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9644 Double_t dReQ1n = (*fReQ)(0,0);
9645 Double_t dReQ2n = (*fReQ)(1,0);
9646 //Double_t dReQ3n = (*fReQ)(2,0);
9647 //Double_t dReQ4n = (*fReQ)(3,0);
9648 Double_t dImQ1n = (*fImQ)(0,0);
9649 Double_t dImQ2n = (*fImQ)(1,0);
9650 //Double_t dImQ3n = (*fImQ)(2,0);
9651 //Double_t dImQ4n = (*fImQ)(3,0);
9652
9653 Int_t t = -1; // type flag
9654 Int_t pe = -1; // ptEta flag
9655
9656 if(type == "RP")
9657 {
9658 t = 0;
9659 } else if(type == "POI")
9660 {
9661 t = 1;
9662 }
9663
9664 if(ptOrEta == "Pt")
9665 {
9666 pe = 0;
9667 } else if(ptOrEta == "Eta")
9668 {
9669 pe = 1;
9670 }
9671
9672 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9673 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9674 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9675 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9676
9677 // looping over all bins and calculating correction terms:
9678 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9679 {
9680 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9681 Double_t p1n0kRe = 0.;
9682 Double_t p1n0kIm = 0.;
9683
9684 // number of POIs in particular pt or eta bin:
9685 Double_t mp = 0.;
9686
9687 // 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):
9688 Double_t q1n0kRe = 0.;
9689 Double_t q1n0kIm = 0.;
9690 Double_t q2n0kRe = 0.;
9691 Double_t q2n0kIm = 0.;
9692
9693 // number of particles which are both RPs and POIs in particular pt or eta bin:
9694 Double_t mq = 0.;
9695
9696 if(type == "POI")
9697 {
9698 // q_{m*n,0}:
9699 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9700 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9701 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9702 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9703 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9704 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9705 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9706 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9707
9708 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9709 }
9710 else if(type == "RP")
9711 {
9712 // q_{m*n,0}:
9713 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9714 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9715 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9716 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9717 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9718 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9719 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9720 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9721
9722 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9723 }
9724 if(type == "POI")
9725 {
9726 // p_{m*n,0}:
9727 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9728 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9729 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9730 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9731
9732 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9733
9734 t = 1; // typeFlag = RP or POI
9735 }
9736 else if(type == "RP")
9737 {
9738 // p_{m*n,0} = q_{m*n,0}:
9739 p1n0kRe = q1n0kRe;
9740 p1n0kIm = q1n0kIm;
9741
9742 mp = mq;
9743
9744 t = 0; // typeFlag = RP or POI
9745 }
9746
9747 // <<cos n(psi1)>>:
9748 Double_t cosP1nPsi = 0.;
9749 if(mp)
9750 {
9751 cosP1nPsi = p1n0kRe/mp;
9752
9753 // fill profile for <<cos n(psi1)>>:
9754 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
9755 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
9756 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
9757 } // end of if(mp)
9758
9759 // <<cos n(psi1+phi2)>>:
9760 Double_t cosP1nPsiP1nPhi = 0.;
9761 if(mp*dMult-mq)
9762 {
9763 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
9764 // fill profile for <<sin n(psi1+phi2)>>:
9765 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
9766 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9767 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
9768 } // end of if(mp*dMult-mq)
9769
9770 // <<cos n(psi1+phi2-phi3)>>:
9771 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
9772 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9773 {
9774 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9775 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
9776 - mq*dReQ1n+2.*q1n0kRe)
9777 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9778 // fill profile for <<sin n(psi1+phi2)>>:
9779 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9780 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9781 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
9782 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9783
9784 // <<cos n(psi1-phi2-phi3)>>:
9785 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
9786 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9787 {
9788 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
9789 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
9790 - 2.*mq*dReQ1n+2.*q1n0kRe)
9791 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9792 // fill profile for <<sin n(psi1+phi2)>>:
9793 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9794 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9795 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
9796 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9797 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9798
9799} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9800
9801
9802//==================================================================================================================================
9803
9804
9805void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9806{
9807 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)
9808
9809 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging)
9810
9811 Int_t t = -1; // type flag
9812 Int_t pe = -1; // ptEta flag
9813
9814 if(type == "RP")
9815 {
9816 t = 0;
9817 } else if(type == "POI")
9818 {
9819 t = 1;
9820 }
9821
9822 if(ptOrEta == "Pt")
9823 {
9824 pe = 0;
9825 } else if(ptOrEta == "Eta")
9826 {
9827 pe = 1;
9828 }
9829
9830 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9831 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
9832 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9833 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9834
9835 for(Int_t sc=0;sc<2;sc++) // sin or cos
9836 {
9837 for(Int_t cti=0;cti<9;cti++) // correction term index
9838 {
9839 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9840 {
9841 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
9842 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
9843 // to be improved (propagate error correctly)
9844 // ...
9845 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9846 } // correction term index
9847 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9848
9849}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9850
9851
9852//==================================================================================================================================
9853
9854
9855void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9856{
9857 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)
9858
9859 Int_t typeFlag = -1;
9860 Int_t ptEtaFlag = -1;
9861
9862 if(type == "RP")
9863 {
9864 typeFlag = 0;
9865 } else if(type == "POI")
9866 {
9867 typeFlag = 1;
9868 }
9869
9870 if(ptOrEta == "Pt")
9871 {
9872 ptEtaFlag = 0;
9873 } else if(ptOrEta == "Eta")
9874 {
9875 ptEtaFlag = 1;
9876 }
9877
9878 // shortcuts:
9879 Int_t t = typeFlag;
9880 Int_t pe = ptEtaFlag;
9881
9882 // common:
9883 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9884
9885 // 2-particle correlation:
9886 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
9887 // sin term coming from integrated flow:
9888 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
9889 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
9890 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
9891 // cos term coming from integrated flow:
9892 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
9893 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
9894 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
9895
9896 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9897 {
9898 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
9899 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
9900 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
9901 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
9902 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
9903 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
9904 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
9905 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
9906 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
9907 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
9908 // generalized QC{2'}:
9909 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
9910 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
9911 // generalized QC{4'}:
9912 Double_t qc4Prime = fourPrime-2.*twoPrime*two
9913 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
9914 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
9915 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
9916 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
9917 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
9918 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
9919 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
9920 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
9921 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
9922 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
9923 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
9924 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
9925 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
9926 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
9927 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
9928 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
9929 - 12.*cosP1nPhi*sinP1nPhi
9930 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
9931 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
9932 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
9933
9934} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9935
9936
9937//==================================================================================================================================
9938
9939
9940void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
9941{
9942 // Calculate differential flow corrected for non-uniform acceptance.
9943
9944 // to be improved (rewritten completely)
9945
9946 Int_t typeFlag = -1;
9947 Int_t ptEtaFlag = -1;
9948
9949 if(type == "RP")
9950 {
9951 typeFlag = 0;
9952 } else if(type == "POI")
9953 {
9954 typeFlag = 1;
9955 }
9956
9957 if(ptOrEta == "Pt")
9958 {
9959 ptEtaFlag = 0;
9960 } else if(ptOrEta == "Eta")
9961 {
9962 ptEtaFlag = 1;
9963 }
9964
9965 // shortcuts:
9966 Int_t t = typeFlag;
9967 Int_t pe = ptEtaFlag;
9968
9969 // common:
9970 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9971
9972 // to be improved: access here generalized QC{2} and QC{4} instead:
9973 Double_t dV2 = fIntFlow->GetBinContent(1);
9974 Double_t dV4 = fIntFlow->GetBinContent(2);
9975
9976 // loop over pt or eta bins:
9977 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9978 {
9979 // generalized QC{2'}:
9980 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);
9981 // v'{2}:
9982 if(dV2>0)
9983 {
9984 Double_t v2Prime = gQC2Prime/dV2;
9985 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
9986 }
9987 // generalized QC{4'}:
9988 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);
9989 // v'{4}:
9990 if(dV4>0)
9991 {
9992 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);
9993 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
9994 }
9995 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
9996
9997} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
9998
9999
10000//==================================================================================================================================
10001
10002
0328db2d 10003void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10004{
10005 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
10006
10007 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
10008 //
10009 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
10010 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
10011 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
10012 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
10013 // 5th bin: ---- EMPTY ----
10014 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
10015 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
10016 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
10017 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
10018 // 10th bin: ---- EMPTY ----
10019 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
10020 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
10021 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
10022 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
10023 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
10024 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
10025 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
10026 // 18th bin: ---- EMPTY ----
10027 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
10028 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
10029 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
10030 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
10031 // 23rd bin: ---- EMPTY ----
10032 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
10033 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
10034 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
10035 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
10036 // 28th bin: ---- EMPTY ----
10037 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
10038 // 30th bin: ---- EMPTY ----
10039 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
10040
10041 Int_t nPrim = anEvent->NumberOfTracks();
10042 AliFlowTrackSimple *aftsTrack = NULL;
10043 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10044 Int_t n = fHarmonic;
10045 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10046 Double_t dMult = (*fSMpk)(0,0);
10047 cout<<endl;
10048 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10049 if(dMult<2)
10050 {
10051 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10052 } else if (dMult>fMaxAllowedMultiplicity)
10053 {
10054 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10055 } else
10056 {
10057 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10058 }
10059
10060 // 2-particle correlations:
10061 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10062 {
10063 for(Int_t i1=0;i1<nPrim;i1++)
10064 {
10065 aftsTrack=anEvent->GetTrack(i1);
10066 if(!(aftsTrack->InRPSelection())) continue;
10067 phi1=aftsTrack->Phi();
10068 for(Int_t i2=0;i2<nPrim;i2++)
10069 {
10070 if(i2==i1)continue;
10071 aftsTrack=anEvent->GetTrack(i2);
10072 if(!(aftsTrack->InRPSelection())) continue;
10073 phi2=aftsTrack->Phi();
10074 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10075 // fill the profile with 2-p correlations:
10076 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
10077 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
10078 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
10079 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
10080 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10081 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10082 } // end of if(nPrim>=2)
10083
10084 // 3-particle correlations:
10085 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10086 {
10087 for(Int_t i1=0;i1<nPrim;i1++)
10088 {
10089 aftsTrack=anEvent->GetTrack(i1);
10090 if(!(aftsTrack->InRPSelection())) continue;
10091 phi1=aftsTrack->Phi();
10092 for(Int_t i2=0;i2<nPrim;i2++)
10093 {
10094 if(i2==i1)continue;
10095 aftsTrack=anEvent->GetTrack(i2);
10096 if(!(aftsTrack->InRPSelection())) continue;
10097 phi2=aftsTrack->Phi();
10098 for(Int_t i3=0;i3<nPrim;i3++)
10099 {
10100 if(i3==i1||i3==i2)continue;
10101 aftsTrack=anEvent->GetTrack(i3);
10102 if(!(aftsTrack->InRPSelection())) continue;
10103 phi3=aftsTrack->Phi();
10104 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10105 // fill the profile with 3-p correlations:
10106 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
10107 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
10108 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
10109 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
10110 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10111 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10112 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10113 } // end of if(nPrim>=3)
10114
10115 // 4-particle correlations:
10116 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10117 {
10118 for(Int_t i1=0;i1<nPrim;i1++)
10119 {
10120 aftsTrack=anEvent->GetTrack(i1);
10121 if(!(aftsTrack->InRPSelection())) continue;
10122 phi1=aftsTrack->Phi();
10123 for(Int_t i2=0;i2<nPrim;i2++)
10124 {
10125 if(i2==i1)continue;
10126 aftsTrack=anEvent->GetTrack(i2);
10127 if(!(aftsTrack->InRPSelection())) continue;
10128 phi2=aftsTrack->Phi();
10129 for(Int_t i3=0;i3<nPrim;i3++)
10130 {
10131 if(i3==i1||i3==i2)continue;
10132 aftsTrack=anEvent->GetTrack(i3);
10133 if(!(aftsTrack->InRPSelection())) continue;
10134 phi3=aftsTrack->Phi();
10135 for(Int_t i4=0;i4<nPrim;i4++)
10136 {
10137 if(i4==i1||i4==i2||i4==i3)continue;
10138 aftsTrack=anEvent->GetTrack(i4);
10139 if(!(aftsTrack->InRPSelection())) continue;
10140 phi4=aftsTrack->Phi();
10141 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10142 // fill the profile with 4-p correlations:
10143 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10144 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10145 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10146 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10147 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10148 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10149 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
10150 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10151 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10152 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10153 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10154 } // end of if(nPrim>=)
10155
10156 // 5-particle correlations:
10157 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10158 {
10159 for(Int_t i1=0;i1<nPrim;i1++)
10160 {
10161 aftsTrack=anEvent->GetTrack(i1);
10162 if(!(aftsTrack->InRPSelection())) continue;
10163 phi1=aftsTrack->Phi();
10164 for(Int_t i2=0;i2<nPrim;i2++)
10165 {
10166 if(i2==i1)continue;
10167 aftsTrack=anEvent->GetTrack(i2);
10168 if(!(aftsTrack->InRPSelection())) continue;
10169 phi2=aftsTrack->Phi();
10170 for(Int_t i3=0;i3<nPrim;i3++)
10171 {
10172 if(i3==i1||i3==i2)continue;
10173 aftsTrack=anEvent->GetTrack(i3);
10174 if(!(aftsTrack->InRPSelection())) continue;
10175 phi3=aftsTrack->Phi();
10176 for(Int_t i4=0;i4<nPrim;i4++)
10177 {
10178 if(i4==i1||i4==i2||i4==i3)continue;
10179 aftsTrack=anEvent->GetTrack(i4);
10180 if(!(aftsTrack->InRPSelection())) continue;
10181 phi4=aftsTrack->Phi();
10182 for(Int_t i5=0;i5<nPrim;i5++)
10183 {
10184 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10185 aftsTrack=anEvent->GetTrack(i5);
10186 if(!(aftsTrack->InRPSelection())) continue;
10187 phi5=aftsTrack->Phi();
10188 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10189 // fill the profile with 5-p correlations:
10190 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10191 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10192 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10193 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
10194 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10195 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10196 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10197 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10198 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10199 } // end of if(nPrim>=5)
10200
10201 // 6-particle correlations:
10202 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10203 {
10204 for(Int_t i1=0;i1<nPrim;i1++)
10205 {
10206 aftsTrack=anEvent->GetTrack(i1);
10207 if(!(aftsTrack->InRPSelection())) continue;
10208 phi1=aftsTrack->Phi();
10209 for(Int_t i2=0;i2<nPrim;i2++)
10210 {
10211 if(i2==i1)continue;
10212 aftsTrack=anEvent->GetTrack(i2);
10213 if(!(aftsTrack->InRPSelection())) continue;
10214 phi2=aftsTrack->Phi();
10215 for(Int_t i3=0;i3<nPrim;i3++)
10216 {
10217 if(i3==i1||i3==i2)continue;
10218 aftsTrack=anEvent->GetTrack(i3);
10219 if(!(aftsTrack->InRPSelection())) continue;
10220 phi3=aftsTrack->Phi();
10221 for(Int_t i4=0;i4<nPrim;i4++)
10222 {
10223 if(i4==i1||i4==i2||i4==i3)continue;
10224 aftsTrack=anEvent->GetTrack(i4);
10225 if(!(aftsTrack->InRPSelection())) continue;
10226 phi4=aftsTrack->Phi();
10227 for(Int_t i5=0;i5<nPrim;i5++)
10228 {
10229 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10230 aftsTrack=anEvent->GetTrack(i5);
10231 if(!(aftsTrack->InRPSelection())) continue;
10232 phi5=aftsTrack->Phi();
10233 for(Int_t i6=0;i6<nPrim;i6++)
10234 {
10235 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10236 aftsTrack=anEvent->GetTrack(i6);
10237 if(!(aftsTrack->InRPSelection())) continue;
10238 phi6=aftsTrack->Phi();
10239 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10240 // fill the profile with 6-p correlations:
10241 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10242 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}
10243 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}
10244 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}
10245 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10246 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10247 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10248 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10249 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10250 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10251 } // end of if(nPrim>=6)
10252
10253 // 7-particle correlations:
10254 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10255 {
10256 for(Int_t i1=0;i1<nPrim;i1++)
10257 {
10258 aftsTrack=anEvent->GetTrack(i1);
10259 if(!(aftsTrack->InRPSelection())) continue;
10260 phi1=aftsTrack->Phi();
10261 for(Int_t i2=0;i2<nPrim;i2++)
10262 {
10263 if(i2==i1)continue;
10264 aftsTrack=anEvent->GetTrack(i2);
10265 if(!(aftsTrack->InRPSelection())) continue;
10266 phi2=aftsTrack->Phi();
10267 for(Int_t i3=0;i3<nPrim;i3++)
10268 {
10269 if(i3==i1||i3==i2)continue;
10270 aftsTrack=anEvent->GetTrack(i3);
10271 if(!(aftsTrack->InRPSelection())) continue;
10272 phi3=aftsTrack->Phi();
10273 for(Int_t i4=0;i4<nPrim;i4++)
10274 {
10275 if(i4==i1||i4==i2||i4==i3)continue;
10276 aftsTrack=anEvent->GetTrack(i4);
10277 if(!(aftsTrack->InRPSelection())) continue;
10278 phi4=aftsTrack->Phi();
10279 for(Int_t i5=0;i5<nPrim;i5++)
10280 {
10281 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10282 aftsTrack=anEvent->GetTrack(i5);
10283 if(!(aftsTrack->InRPSelection())) continue;
10284 phi5=aftsTrack->Phi();
10285 for(Int_t i6=0;i6<nPrim;i6++)
10286 {
10287 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10288 aftsTrack=anEvent->GetTrack(i6);
10289 if(!(aftsTrack->InRPSelection())) continue;
10290 phi6=aftsTrack->Phi();
10291 for(Int_t i7=0;i7<nPrim;i7++)
10292 {
10293 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10294 aftsTrack=anEvent->GetTrack(i7);
10295 if(!(aftsTrack->InRPSelection())) continue;
10296 phi7=aftsTrack->Phi();
10297 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10298 // fill the profile with 7-p correlation:
10299 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}
10300 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10301 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10302 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10303 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10304 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10305 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10306 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10307 } // end of if(nPrim>=7)
10308
10309 // 8-particle correlations:
10310 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10311 {
10312 for(Int_t i1=0;i1<nPrim;i1++)
10313 {
10314 aftsTrack=anEvent->GetTrack(i1);
10315 if(!(aftsTrack->InRPSelection())) continue;
10316 phi1=aftsTrack->Phi();
10317 for(Int_t i2=0;i2<nPrim;i2++)
10318 {
10319 if(i2==i1)continue;
10320 aftsTrack=anEvent->GetTrack(i2);
10321 if(!(aftsTrack->InRPSelection())) continue;
10322 phi2=aftsTrack->Phi();
10323 for(Int_t i3=0;i3<nPrim;i3++)
10324 {
10325 if(i3==i1||i3==i2)continue;
10326 aftsTrack=anEvent->GetTrack(i3);
10327 if(!(aftsTrack->InRPSelection())) continue;
10328 phi3=aftsTrack->Phi();
10329 for(Int_t i4=0;i4<nPrim;i4++)
10330 {
10331 if(i4==i1||i4==i2||i4==i3)continue;
10332 aftsTrack=anEvent->GetTrack(i4);
10333 if(!(aftsTrack->InRPSelection())) continue;
10334 phi4=aftsTrack->Phi();
10335 for(Int_t i5=0;i5<nPrim;i5++)
10336 {
10337 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10338 aftsTrack=anEvent->GetTrack(i5);
10339 if(!(aftsTrack->InRPSelection())) continue;
10340 phi5=aftsTrack->Phi();
10341 for(Int_t i6=0;i6<nPrim;i6++)
10342 {
10343 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10344 aftsTrack=anEvent->GetTrack(i6);
10345 if(!(aftsTrack->InRPSelection())) continue;
10346 phi6=aftsTrack->Phi();
10347 for(Int_t i7=0;i7<nPrim;i7++)
10348 {
10349 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10350 aftsTrack=anEvent->GetTrack(i7);
10351 if(!(aftsTrack->InRPSelection())) continue;
10352 phi7=aftsTrack->Phi();
10353 for(Int_t i8=0;i8<nPrim;i8++)
10354 {
10355 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10356 aftsTrack=anEvent->GetTrack(i8);
10357 if(!(aftsTrack->InRPSelection())) continue;
10358 phi8=aftsTrack->Phi();
10359 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10360 // fill the profile with 8-p correlation:
10361 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}
10362 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10363 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10364 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10365 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10366 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10367 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10368 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10369 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10370 } // end of if(nPrim>=8)
10371
10372 cout<<endl;
10373
10374} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10375
10376
10377//==================================================================================================================================
10378
10379
10380void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10381{
10382 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10383
10384 cout<<endl;
10385 cout<<endl;
10386 cout<<" *****************************************"<<endl;
10387 cout<<" **** cross-checking the correlations ****"<<endl;
10388 cout<<" **** for integrated flow ****"<<endl;
10389 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10390 {
10391 cout<<" **** (particle weights not used) ****"<<endl;
10392 } else
10393 {
10394 cout<<" **** (particle weights used) ****"<<endl;
10395 }
10396 cout<<" *****************************************"<<endl;
10397 cout<<endl;
10398 cout<<endl;
10399
10400 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
10401
10402 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10403 {
10404 ciMax = 11;
10405 }
10406
10407 for(Int_t ci=1;ci<=ciMax;ci++)
10408 {
10409 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10410 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10411 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10412 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10413 cout<<endl;
10414 }
10415
10416} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10417
10418
10419//================================================================================================================================
10420
10421
10422void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10423{
10424 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10425
10426 cout<<endl;
10427 cout<<endl;
10428 cout<<" *********************************************"<<endl;
10429 cout<<" **** cross-checking the correction terms ****"<<endl;
10430 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10431 cout<<" **** for integrated flow ****"<<endl;
10432 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10433 {
10434 cout<<" **** (particle weights not used) ****"<<endl;
10435 } else
10436 {
10437 cout<<" **** (particle weights used) ****"<<endl;
10438 }
10439 cout<<" *********************************************"<<endl;
10440 cout<<endl;
10441 cout<<endl;
10442
10443 for(Int_t ci=1;ci<=10;ci++) // correction term index
10444 {
10445 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10446 {
10447 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10448 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10449 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10450 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10451 cout<<endl;
10452 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10453 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10454
10455} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10456
10457
10458//================================================================================================================================
10459
10460
0328db2d 10461void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 10462{
10463 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10464
10465 // Results are stored in profile fIntFlowDirectCorrelations.
10466 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10467 //
10468 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10469 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10470 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10471 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10472 // 5th bin: ---- EMPTY ----
10473 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10474 // 7th bin: <3>_{3n|2n,1n} = ...
10475 // 8th bin: <3>_{4n|2n,2n} = ...
10476 // 9th bin: <3>_{4n|3n,1n} = ...
10477 // 10th bin: ---- EMPTY ----
10478 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10479 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10480 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10481 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10482 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10483 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10484 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10485 // 18th bin: ---- EMPTY ----
10486 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10487 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10488 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10489 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10490 // 23rd bin: ---- EMPTY ----
10491 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10492 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10493 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10494 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10495 // 28th bin: ---- EMPTY ----
10496 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10497 // 30th bin: ---- EMPTY ----
10498 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 10499
489d5531 10500 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10501 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 10502
489d5531 10503 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10504 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10505 // ...
57340a27 10506
489d5531 10507 Int_t nPrim = anEvent->NumberOfTracks();
10508 AliFlowTrackSimple *aftsTrack = NULL;
10509 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10510 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10511 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10512 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10513 Int_t n = fHarmonic;
10514 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10515 Double_t dMult = (*fSMpk)(0,0);
10516 cout<<endl;
10517 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10518 if(dMult<2)
10519 {
10520 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10521 } else if (dMult>fMaxAllowedMultiplicity)
10522 {
10523 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10524 } else
10525 {
10526 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10527 }
10528
10529 // 2-particle correlations:
10530 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10531 {
10532 // 2 nested loops multiparticle correlations using particle weights:
10533 for(Int_t i1=0;i1<nPrim;i1++)
10534 {
10535 aftsTrack=anEvent->GetTrack(i1);
10536 if(!(aftsTrack->InRPSelection())) continue;
10537 phi1=aftsTrack->Phi();
10538 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10539 for(Int_t i2=0;i2<nPrim;i2++)
10540 {
10541 if(i2==i1)continue;
10542 aftsTrack=anEvent->GetTrack(i2);
10543 if(!(aftsTrack->InRPSelection())) continue;
10544 phi2=aftsTrack->Phi();
10545 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10546 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10547 // 2-p correlations using particle weights:
10548 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10549 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))>
10550 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))>
10551 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))>
10552 // extra correlations:
10553 // 2-p extra correlations (do not appear if particle weights are not used):
10554 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10555 // ...
10556 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10557 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10558 } // end of if(nPrim>=2)
10559
10560 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 10561 {
489d5531 10562 // 3 nested loops multiparticle correlations using particle weights:
10563 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10564 {
489d5531 10565 aftsTrack=anEvent->GetTrack(i1);
10566 if(!(aftsTrack->InRPSelection())) continue;
10567 phi1=aftsTrack->Phi();
10568 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10569 for(Int_t i2=0;i2<nPrim;i2++)
10570 {
10571 if(i2==i1)continue;
10572 aftsTrack=anEvent->GetTrack(i2);
10573 if(!(aftsTrack->InRPSelection())) continue;
10574 phi2=aftsTrack->Phi();
10575 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10576 for(Int_t i3=0;i3<nPrim;i3++)
10577 {
10578 if(i3==i1||i3==i2)continue;
10579 aftsTrack=anEvent->GetTrack(i3);
10580 if(!(aftsTrack->InRPSelection())) continue;
10581 phi3=aftsTrack->Phi();
10582 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10583 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10584 // 3-p correlations using particle weights:
10585 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))>
10586 // ...
10587 // extra correlations:
10588 // 2-p extra correlations (do not appear if particle weights are not used):
10589 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10590 // ...
10591 // 3-p extra correlations (do not appear if particle weights are not used):
10592 // ...
10593 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10594 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10595 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10596 } // end of if(nPrim>=3)
57340a27 10597
489d5531 10598 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10599 {
10600 // 4 nested loops multiparticle correlations using particle weights:
10601 for(Int_t i1=0;i1<nPrim;i1++)
10602 {
10603 aftsTrack=anEvent->GetTrack(i1);
10604 if(!(aftsTrack->InRPSelection())) continue;
10605 phi1=aftsTrack->Phi();
10606 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10607 for(Int_t i2=0;i2<nPrim;i2++)
10608 {
10609 if(i2==i1)continue;
10610 aftsTrack=anEvent->GetTrack(i2);
10611 if(!(aftsTrack->InRPSelection())) continue;
10612 phi2=aftsTrack->Phi();
10613 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10614 for(Int_t i3=0;i3<nPrim;i3++)
10615 {
10616 if(i3==i1||i3==i2)continue;
10617 aftsTrack=anEvent->GetTrack(i3);
10618 if(!(aftsTrack->InRPSelection())) continue;
10619 phi3=aftsTrack->Phi();
10620 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10621 for(Int_t i4=0;i4<nPrim;i4++)
10622 {
10623 if(i4==i1||i4==i2||i4==i3)continue;
10624 aftsTrack=anEvent->GetTrack(i4);
10625 if(!(aftsTrack->InRPSelection())) continue;
10626 phi4=aftsTrack->Phi();
10627 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10628 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10629 // 4-p correlations using particle weights:
10630 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10631 // extra correlations:
10632 // 2-p extra correlations (do not appear if particle weights are not used):
10633 // ...
10634 // 3-p extra correlations (do not appear if particle weights are not used):
10635 // ...
10636 // 4-p extra correlations (do not appear if particle weights are not used):
10637 // ...
10638 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10639 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10640 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10641 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10642 } // end of if(nPrim>=4)
57340a27 10643
489d5531 10644 cout<<endl;
57340a27 10645
489d5531 10646} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 10647
489d5531 10648
10649//================================================================================================================================
10650
10651
10652void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10653{
489d5531 10654 // Cross-check results for extra multiparticle correlations needed for int. flow
10655 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 10656
489d5531 10657 cout<<endl;
10658 cout<<endl;
10659 cout<<" ***********************************************"<<endl;
10660 cout<<" **** cross-checking the extra correlations ****"<<endl;
10661 cout<<" **** for integrated flow ****"<<endl;
10662 cout<<" ***********************************************"<<endl;
10663 cout<<endl;
10664 cout<<endl;
10665
10666 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 10667 {
489d5531 10668 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
10669 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
10670 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
10671 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
10672 cout<<endl;
10673 }
57340a27 10674
489d5531 10675} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10676
10677
489d5531 10678//================================================================================================================================
3b552efe 10679
10680
0328db2d 10681void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10682{
10683 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
10684 //
10685 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
10686 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
10687 // (sc stands for either sin or cos):
10688
10689 // 1st bin: <<sc(n*(phi1))>>
10690 // 2nd bin: <<sc(n*(phi1+phi2))>>
10691 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
10692 // 4th bin: <<sc(n*(2phi1-phi2))>>
10693
10694 Int_t nPrim = anEvent->NumberOfTracks();
10695 AliFlowTrackSimple *aftsTrack = NULL;
10696 Double_t phi1=0., phi2=0., phi3=0.;
10697 Int_t n = fHarmonic;
10698 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10699 Double_t dMult = (*fSMpk)(0,0);
10700 cout<<endl;
10701 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10702 if(dMult<1)
3b552efe 10703 {
489d5531 10704 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10705 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 10706 {
489d5531 10707 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10708 } else
10709 {
10710 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10711 }
10712
10713 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10714 {
10715 // 1-particle correction terms for non-uniform acceptance:
10716 for(Int_t i1=0;i1<nPrim;i1++)
10717 {
10718 aftsTrack=anEvent->GetTrack(i1);
10719 if(!(aftsTrack->InRPSelection())) continue;
10720 phi1=aftsTrack->Phi();
10721 if(nPrim==1) cout<<i1<<"\r"<<flush;
10722 // sin terms:
10723 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
10724 // cos terms:
10725 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
10726 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10727 } // end of if(nPrim>=1)
10728
10729 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10730 {
10731 // 2-particle correction terms for non-uniform acceptance:
10732 for(Int_t i1=0;i1<nPrim;i1++)
10733 {
10734 aftsTrack=anEvent->GetTrack(i1);
10735 if(!(aftsTrack->InRPSelection())) continue;
10736 phi1=aftsTrack->Phi();
10737 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 10738 {
489d5531 10739 if(i2==i1)continue;
10740 aftsTrack=anEvent->GetTrack(i2);
10741 if(!(aftsTrack->InRPSelection())) continue;
10742 phi2=aftsTrack->Phi();
10743 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10744 // sin terms:
3b552efe 10745 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 10746 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
10747 // cos terms:
3b552efe 10748 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 10749 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
10750 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10751 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10752 } // end of if(nPrim>=2)
10753
10754 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10755 {
10756 // 3-particle correction terms for non-uniform acceptance:
10757 for(Int_t i1=0;i1<nPrim;i1++)
10758 {
10759 aftsTrack=anEvent->GetTrack(i1);
10760 if(!(aftsTrack->InRPSelection())) continue;
10761 phi1=aftsTrack->Phi();
10762 for(Int_t i2=0;i2<nPrim;i2++)
10763 {
10764 if(i2==i1)continue;
10765 aftsTrack=anEvent->GetTrack(i2);
10766 if(!(aftsTrack->InRPSelection())) continue;
10767 phi2=aftsTrack->Phi();
10768 for(Int_t i3=0;i3<nPrim;i3++)
10769 {
10770 if(i3==i1||i3==i2)continue;
10771 aftsTrack=anEvent->GetTrack(i3);
10772 if(!(aftsTrack->InRPSelection())) continue;
10773 phi3=aftsTrack->Phi();
10774 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
10775 // sin terms:
10776 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
10777 // cos terms:
10778 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
10779 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10780 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10781 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10782 } // end of if(nPrim>=3)
10783
10784 cout<<endl;
10785}
10786//================================================================================================================================
0328db2d 10787void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 10788{
10789 // Evaluate reduced correlations with nested loops without using the particle weights.
10790
10791 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10792 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
10793 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
10794 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
10795 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
10796 // ...
10797
10798 Int_t typeFlag = -1;
10799 Int_t ptEtaFlag = -1;
10800 if(type == "RP")
10801 {
10802 typeFlag = 0;
10803 } else if(type == "POI")
10804 {
10805 typeFlag = 1;
10806 }
10807 if(ptOrEta == "Pt")
10808 {
10809 ptEtaFlag = 0;
10810 } else if(ptOrEta == "Eta")
10811 {
10812 ptEtaFlag = 1;
10813 }
10814 // shortcuts:
10815 Int_t t = typeFlag;
10816 Int_t pe = ptEtaFlag;
10817
10818 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10819 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10820 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10821
10822 Int_t nPrim = anEvent->NumberOfTracks();
10823 AliFlowTrackSimple *aftsTrack = NULL;
10824
10825 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10826
3b552efe 10827 Int_t n = fHarmonic;
489d5531 10828
10829 // 2'-particle correlations:
10830 for(Int_t i1=0;i1<nPrim;i1++)
10831 {
10832 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10833 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10834 if(typeFlag==1) // this is diff flow of POIs
489d5531 10835 {
10836 if(ptOrEta == "Pt")
10837 {
10838 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10839 } else if (ptOrEta == "Eta")
10840 {
10841 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10842 }
10843 } else // this is diff flow of RPs
10844 {
489d5531 10845 if(ptOrEta == "Pt")
10846 {
10847 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10848 } else if (ptOrEta == "Eta")
10849 {
10850 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10851 }
10852 }
489d5531 10853
10854 psi1=aftsTrack->Phi();
10855 for(Int_t i2=0;i2<nPrim;i2++)
10856 {
10857 if(i2==i1)continue;
10858 aftsTrack=anEvent->GetTrack(i2);
10859 // RP condition (!(first) particle in the correlator must be RP):
10860 if(!(aftsTrack->InRPSelection()))continue;
10861 phi2=aftsTrack->Phi();
10862 // 2'-particle correlations:
10863 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
10864 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10865 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10866
10867 /*
10868
10869 // 3'-particle correlations:
10870 for(Int_t i1=0;i1<nPrim;i1++)
10871 {
10872 aftsTrack=anEvent->GetTrack(i1);
10873 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10874 if(ptOrEta == "Pt")
10875 {
10876 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10877 } else if (ptOrEta == "Eta")
10878 {
10879 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10880 }
10881 psi1=aftsTrack->Phi();
10882 for(Int_t i2=0;i2<nPrim;i2++)
10883 {
10884 if(i2==i1)continue;
10885 aftsTrack=anEvent->GetTrack(i2);
10886 // RP condition (!(first) particle in the correlator must be RP):
10887 if(!(aftsTrack->InRPSelection())) continue;
10888 phi2=aftsTrack->Phi();
10889 for(Int_t i3=0;i3<nPrim;i3++)
10890 {
10891 if(i3==i1||i3==i2)continue;
10892 aftsTrack=anEvent->GetTrack(i3);
10893 // RP condition (!(first) particle in the correlator must be RP):
10894 if(!(aftsTrack->InRPSelection())) continue;
10895 phi3=aftsTrack->Phi();
10896 // 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))>
10897 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10898 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10899 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10900
10901 */
10902
10903 // 4'-particle correlations:
10904 for(Int_t i1=0;i1<nPrim;i1++)
10905 {
10906 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10907 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10908 if(typeFlag==1) // this is diff flow of POIs
489d5531 10909 {
10910 if(ptOrEta == "Pt")
10911 {
10912 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10913 } else if (ptOrEta == "Eta")
10914 {
10915 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10916 }
10917 } else // this is diff flow of RPs
10918 {
489d5531 10919 if(ptOrEta == "Pt")
10920 {
10921 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10922 } else if (ptOrEta == "Eta")
10923 {
10924 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10925 }
10926 }
489d5531 10927
10928 psi1=aftsTrack->Phi();
10929 for(Int_t i2=0;i2<nPrim;i2++)
10930 {
10931 if(i2==i1) continue;
10932 aftsTrack=anEvent->GetTrack(i2);
10933 // RP condition (!(first) particle in the correlator must be RP):
10934 if(!(aftsTrack->InRPSelection())) continue;
10935 phi2=aftsTrack->Phi();
10936 for(Int_t i3=0;i3<nPrim;i3++)
10937 {
10938 if(i3==i1||i3==i2) continue;
10939 aftsTrack=anEvent->GetTrack(i3);
10940 // RP condition (!(first) particle in the correlator must be RP):
10941 if(!(aftsTrack->InRPSelection())) continue;
10942 phi3=aftsTrack->Phi();
10943 for(Int_t i4=0;i4<nPrim;i4++)
10944 {
10945 if(i4==i1||i4==i2||i4==i3) continue;
10946 aftsTrack=anEvent->GetTrack(i4);
10947 // RP condition (!(first) particle in the correlator must be RP):
10948 if(!(aftsTrack->InRPSelection())) continue;
10949 phi4=aftsTrack->Phi();
10950 // 4'-particle correlations:
10951 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
10952 }//end of for(Int_t i4=0;i4<nPrim;i4++)
10953 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10954 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10955 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10956
10957 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 10958 for(Int_t i=0;i<nPrim;i++)
10959 {
10960 aftsTrack=anEvent->GetTrack(i);
10961 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10962 if(typeFlag==1) // this is diff flow of POIs
489d5531 10963 {
10964 if(ptOrEta == "Pt")
10965 {
10966 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10967 } else if (ptOrEta == "Eta")
10968 {
10969 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10970 }
10971 } else // this is diff flow of RPs
10972 {
489d5531 10973 if(ptOrEta == "Pt")
10974 {
10975 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10976 } else if (ptOrEta == "Eta")
10977 {
10978 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10979 }
10980 }
10981 if(t==1)t++;
10982 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 10983 }
10984
10985} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
10986
10987
10988//================================================================================================================================
10989
10990
10991void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
10992{
10993 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
10994
10995 Int_t typeFlag = -1;
10996 Int_t ptEtaFlag = -1;
10997 if(type == "RP")
10998 {
10999 typeFlag = 0;
11000 } else if(type == "POI")
11001 {
11002 typeFlag = 1;
11003 }
11004 if(ptOrEta == "Pt")
11005 {
11006 ptEtaFlag = 0;
11007 } else if(ptOrEta == "Eta")
11008 {
11009 ptEtaFlag = 1;
11010 }
11011 // shortcuts:
11012 Int_t t = typeFlag;
11013 Int_t pe = ptEtaFlag;
11014
11015 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11016 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11017 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
11018 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11019 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11020
11021 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11022
11023
11024 cout<<endl;
11025 cout<<" *****************************************"<<endl;
11026 cout<<" **** cross-checking the correlations ****"<<endl;
11027 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11028 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11029 {
11030 cout<<" **** (particle weights not used) ****"<<endl;
11031 } else
11032 {
11033 cout<<" **** (particle weights used) ****"<<endl;
11034 }
11035 cout<<" *****************************************"<<endl;
11036 cout<<endl;
11037 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11038 cout<<endl;
11039
11040 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
11041 {
11042 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
11043 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11044 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
11045 cout<<endl;
11046 } // end of for(Int_t rci=0;rci<4;rci++)
11047
11048} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11049
3b552efe 11050//================================================================================================================================
11051
489d5531 11052void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 11053{
11054 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
11055
11056 cout<<endl;
11057 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
11058 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
11059 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
11060 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
11061
489d5531 11062} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11063
3b552efe 11064//================================================================================================================================
11065
0328db2d 11066void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11067{
11068 // Evaluate reduced correlations with nested loops without using the particle weights.
11069
11070 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11071 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11072 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11073 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
11074 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
11075 // ...
11076
11077 Int_t typeFlag = -1;
11078 Int_t ptEtaFlag = -1;
11079 if(type == "RP")
11080 {
11081 typeFlag = 0;
11082 } else if(type == "POI")
11083 {
11084 typeFlag = 1;
11085 }
11086 if(ptOrEta == "Pt")
11087 {
11088 ptEtaFlag = 0;
11089 } else if(ptOrEta == "Eta")
11090 {
11091 ptEtaFlag = 1;
11092 }
11093 // shortcuts:
11094 Int_t t = typeFlag;
11095 Int_t pe = ptEtaFlag;
11096
11097 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11098 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11099 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11100
11101 Int_t nPrim = anEvent->NumberOfTracks();
11102 AliFlowTrackSimple *aftsTrack = NULL;
11103
11104 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11105 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11106
11107 Int_t n = fHarmonic;
11108
11109 // 2'-particle correlations:
11110 for(Int_t i1=0;i1<nPrim;i1++)
11111 {
11112 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11113 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11114 if(typeFlag==1) // this is diff flow of POIs
489d5531 11115 {
11116 if(ptOrEta == "Pt")
11117 {
11118 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11119 } else if (ptOrEta == "Eta")
11120 {
11121 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11122 }
11123 } else // this is diff flow of RPs
11124 {
489d5531 11125 if(ptOrEta == "Pt")
11126 {
11127 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11128 } else if (ptOrEta == "Eta")
11129 {
11130 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11131 }
489d5531 11132 }
11133 psi1=aftsTrack->Phi();
11134 for(Int_t i2=0;i2<nPrim;i2++)
11135 {
11136 if(i2==i1) continue;
11137 aftsTrack=anEvent->GetTrack(i2);
11138 // RP condition (!(first) particle in the correlator must be RP):
11139 if(!(aftsTrack->InRPSelection())) continue;
11140 phi2=aftsTrack->Phi();
11141 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11142 // 2'-particle correlations:
11143 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11144 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11145 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11146
11147 // 4'-particle correlations:
11148 for(Int_t i1=0;i1<nPrim;i1++)
11149 {
11150 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11151 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11152 if(typeFlag==1) // this is diff flow of POIs
489d5531 11153 {
11154 if(ptOrEta == "Pt")
11155 {
11156 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11157 } else if (ptOrEta == "Eta")
11158 {
11159 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11160 }
11161 } else // this is diff flow of RPs
11162 {
489d5531 11163 if(ptOrEta == "Pt")
11164 {
11165 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11166 } else if (ptOrEta == "Eta")
11167 {
11168 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11169 }
489d5531 11170 }
11171 psi1=aftsTrack->Phi();
11172 for(Int_t i2=0;i2<nPrim;i2++)
11173 {
11174 if(i2==i1) continue;
11175 aftsTrack=anEvent->GetTrack(i2);
11176 // RP condition (!(first) particle in the correlator must be RP):
11177 if(!(aftsTrack->InRPSelection())) continue;
11178 phi2=aftsTrack->Phi();
11179 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11180 for(Int_t i3=0;i3<nPrim;i3++)
11181 {
11182 if(i3==i1||i3==i2) continue;
11183 aftsTrack=anEvent->GetTrack(i3);
11184 // RP condition (!(first) particle in the correlator must be RP):
11185 if(!(aftsTrack->InRPSelection())) continue;
11186 phi3=aftsTrack->Phi();
11187 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11188 for(Int_t i4=0;i4<nPrim;i4++)
11189 {
11190 if(i4==i1||i4==i2||i4==i3) continue;
11191 aftsTrack=anEvent->GetTrack(i4);
11192 // RP condition (!(first) particle in the correlator must be RP):
11193 if(!(aftsTrack->InRPSelection())) continue;
11194 phi4=aftsTrack->Phi();
11195 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11196 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11197 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11198 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11199 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11200 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11201 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11202
11203 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 11204 for(Int_t i=0;i<nPrim;i++)
11205 {
489d5531 11206 aftsTrack=anEvent->GetTrack(i);
11207 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11208 if(typeFlag==1) // this is diff flow of POIs
11209 {
11210 if(ptOrEta == "Pt")
11211 {
11212 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11213 } else if (ptOrEta == "Eta")
11214 {
11215 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11216 }
11217 } else // this is diff flow of RPs
11218 {
11219 if(ptOrEta == "Pt")
11220 {
11221 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11222 } else if (ptOrEta == "Eta")
11223 {
11224 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11225 }
11226 }
11227 if(t==1)t++;
11228 fNoOfParticlesInBin->Fill(t+pe+0.5);
11229 }
11230
11231} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11232
11233
11234//================================================================================================================================
11235
11236
0328db2d 11237void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11238{
11239 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11240
11241 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11242 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11243 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11244 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11245 // cti:
11246 // 0: <<sc n(psi1)>>
11247 // 1: <<sc n(psi1+phi2)>>
11248 // 2: <<sc n(psi1+phi2-phi3)>>
11249 // 3: <<sc n(psi1-phi2-phi3)>>
11250 // 4:
11251 // 5:
11252 // 6:
11253
11254 Int_t typeFlag = -1;
11255 Int_t ptEtaFlag = -1;
11256 if(type == "RP")
11257 {
11258 typeFlag = 0;
11259 } else if(type == "POI")
11260 {
11261 typeFlag = 1;
11262 }
11263 if(ptOrEta == "Pt")
11264 {
11265 ptEtaFlag = 0;
11266 } else if(ptOrEta == "Eta")
11267 {
11268 ptEtaFlag = 1;
11269 }
11270 // shortcuts:
11271 Int_t t = typeFlag;
11272 Int_t pe = ptEtaFlag;
11273
11274 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11275 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11276 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11277
11278 Int_t nPrim = anEvent->NumberOfTracks();
11279 AliFlowTrackSimple *aftsTrack = NULL;
11280
11281 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11282
11283 Int_t n = fHarmonic;
11284
11285 // 1-particle correction terms:
11286 for(Int_t i1=0;i1<nPrim;i1++)
11287 {
11288 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11289 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11290 if(typeFlag==1) // this is diff flow of POIs
489d5531 11291 {
11292 if(ptOrEta == "Pt")
11293 {
11294 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11295 } else if (ptOrEta == "Eta")
11296 {
11297 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11298 }
11299 } else // this is diff flow of RPs
11300 {
489d5531 11301 if(ptOrEta == "Pt")
11302 {
11303 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11304 } else if (ptOrEta == "Eta")
11305 {
11306 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11307 }
11308 }
489d5531 11309 psi1=aftsTrack->Phi();
11310 // sin terms:
11311 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11312 // cos terms:
11313 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11314 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11315
11316 // 2-particle correction terms:
11317 for(Int_t i1=0;i1<nPrim;i1++)
11318 {
11319 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11320 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11321 if(typeFlag==1) // this is diff flow of POIs
489d5531 11322 {
11323 if(ptOrEta == "Pt")
11324 {
11325 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11326 } else if (ptOrEta == "Eta")
11327 {
11328 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11329 }
11330 } else // this is diff flow of RPs
11331 {
489d5531 11332 if(ptOrEta == "Pt")
11333 {
11334 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11335 } else if (ptOrEta == "Eta")
11336 {
11337 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11338 }
489d5531 11339 }
11340 psi1=aftsTrack->Phi();
11341 for(Int_t i2=0;i2<nPrim;i2++)
11342 {
11343 if(i2==i1) continue;
11344 aftsTrack=anEvent->GetTrack(i2);
11345 // RP condition (!(first) particle in the correlator must be RP):
11346 if(!(aftsTrack->InRPSelection())) continue;
11347 phi2=aftsTrack->Phi();
11348 // sin terms:
11349 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11350 // cos terms:
11351 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11352 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11353 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11354
11355 // 3-particle correction terms:
11356 for(Int_t i1=0;i1<nPrim;i1++)
11357 {
11358 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11359 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11360 if(typeFlag==1) // this is diff flow of POIs
489d5531 11361 {
11362 if(ptOrEta == "Pt")
11363 {
11364 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11365 } else if (ptOrEta == "Eta")
11366 {
11367 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11368 }
11369 } else // this is diff flow of RPs
11370 {
489d5531 11371 if(ptOrEta == "Pt")
11372 {
11373 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11374 } else if (ptOrEta == "Eta")
11375 {
11376 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11377 }
489d5531 11378 }
11379 psi1=aftsTrack->Phi();
11380 for(Int_t i2=0;i2<nPrim;i2++)
11381 {
11382 if(i2==i1) continue;
11383 aftsTrack=anEvent->GetTrack(i2);
11384 // RP condition (!(first) particle in the correlator must be RP):
11385 if(!(aftsTrack->InRPSelection())) continue;
11386 phi2=aftsTrack->Phi();
11387 for(Int_t i3=0;i3<nPrim;i3++)
11388 {
11389 if(i3==i1||i3==i2) continue;
11390 aftsTrack=anEvent->GetTrack(i3);
11391 // RP condition (!(first) particle in the correlator must be RP):
11392 if(!(aftsTrack->InRPSelection())) continue;
11393 phi3=aftsTrack->Phi();
11394 // sin terms:
11395 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11396 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11397 // cos terms:
11398 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11399 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11400 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11401 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11402 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11403
11404} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11405
11406
11407//================================================================================================================================
11408
11409
11410void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11411{
11412 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11413
11414 Int_t typeFlag = -1;
11415 Int_t ptEtaFlag = -1;
11416 if(type == "RP")
11417 {
11418 typeFlag = 0;
11419 } else if(type == "POI")
11420 {
11421 typeFlag = 1;
11422 }
11423 if(ptOrEta == "Pt")
11424 {
11425 ptEtaFlag = 0;
11426 } else if(ptOrEta == "Eta")
11427 {
11428 ptEtaFlag = 1;
11429 }
11430 // shortcuts:
11431 Int_t t = typeFlag;
11432 Int_t pe = ptEtaFlag;
11433
11434 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11435 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11436 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11437 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)
11438 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)
11439 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11440 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11441
11442 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11443
11444 cout<<endl;
11445 cout<<" ******************************************"<<endl;
11446 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 11447 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 11448 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11449 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11450 {
11451 cout<<" **** (particle weights not used) ****"<<endl;
11452 } else
11453 {
11454 cout<<" **** (particle weights used) ****"<<endl;
11455 }
11456 cout<<" ******************************************"<<endl;
11457 cout<<endl;
11458 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11459 cout<<endl;
11460
11461 for(Int_t cti=0;cti<4;cti++) // correction term index
11462 {
11463 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11464 {
11465 if(sc==0) // to be improved (this can be implemented better)
11466 {
11467 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11468 } else
11469 {
11470 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11471 }
11472 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11473 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11474 cout<<endl;
11475 }
11476 } // end of for(Int_t rci=0;rci<4;rci++)
11477
11478} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11479
11480
57340a27 11481//================================================================================================================================
11482
489d5531 11483
11484void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11485{
11486 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11487
11488 // **********************************************************************
11489 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11490 // **********************************************************************
57340a27 11491
489d5531 11492 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 11493 //
489d5531 11494 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11495 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11496 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11497 // ...
11498
11499 // multiplicity (number of particles used to determine the reaction plane)
11500 Double_t dMult = (*fSMpk)(0,0);
11501
11502 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11503 Double_t dReQ1n1k = (*fReQ)(0,1);
11504 Double_t dReQ2n2k = (*fReQ)(1,2);
11505 //Double_t dReQ3n3k = (*fReQ)(2,3);
11506 //Double_t dReQ4n4k = (*fReQ)(3,4);
11507 Double_t dReQ1n3k = (*fReQ)(0,3);
11508 Double_t dImQ1n1k = (*fImQ)(0,1);
11509 Double_t dImQ2n2k = (*fImQ)(1,2);
11510 //Double_t dImQ3n3k = (*fImQ)(2,3);
11511 //Double_t dImQ4n4k = (*fImQ)(3,4);
11512 //Double_t dImQ1n3k = (*fImQ)(0,3);
11513
11514 // dMs are variables introduced in order to simplify some Eqs. bellow:
11515 //..............................................................................................
11516 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11517 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11518 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11519 //..............................................................................................
ecac11c2 11520 // 1-particle:
489d5531 11521 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11522
0328db2d 11523 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11524 {
11525 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1);
11526
11527 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11528 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11529
11530 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
11531 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1));
11532 }
11533
11534 // 2-particle:
11535 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11536
0328db2d 11537 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11538 {
11539 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11540
11541 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11542 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11543
11544 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11545 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11546 }
11547
11548 // 3-particle:
11549 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11550
0328db2d 11551 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11552 {
57340a27 11553 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11554 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
11555 - 2.*((*fSMpk)(0,2))*dReQ1n1k
489d5531 11556 + 2.*dReQ1n3k)
11557 / dM111;
11558
11559 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11560 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11561
11562 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11563 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11564 }
11565
11566} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11567
11568
11569//================================================================================================================================
11570
11571
11572void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11573{
11574 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11575
11576 // **********************************************************************
11577 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11578 // **********************************************************************
11579
11580 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 11581 //
489d5531 11582 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11583 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11584 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11585 // ...
11586
11587 // multiplicity (number of particles used to determine the reaction plane)
11588 Double_t dMult = (*fSMpk)(0,0);
11589
11590 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11591 Double_t dReQ1n1k = (*fReQ)(0,1);
11592 Double_t dReQ2n2k = (*fReQ)(1,2);
11593 //Double_t dReQ3n3k = (*fReQ)(2,3);
11594 //Double_t dReQ4n4k = (*fReQ)(3,4);
11595 //Double_t dReQ1n3k = (*fReQ)(0,3);
11596 Double_t dImQ1n1k = (*fImQ)(0,1);
11597 Double_t dImQ2n2k = (*fImQ)(1,2);
11598 //Double_t dImQ3n3k = (*fImQ)(2,3);
11599 //Double_t dImQ4n4k = (*fImQ)(3,4);
11600 Double_t dImQ1n3k = (*fImQ)(0,3);
11601
11602 // dMs are variables introduced in order to simplify some Eqs. bellow:
11603 //..............................................................................................
11604 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11605 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11606 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11607 //..............................................................................................
11608
11609 // 1-particle:
11610 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11611
0328db2d 11612 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11613 {
11614 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1));
11615
11616 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11617 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11618
11619 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11620 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1));
11621 }
11622
11623 // 2-particle:
11624 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11625
0328db2d 11626 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11627 {
11628 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11629
11630 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11631 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11632
11633 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11634 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11635 }
11636
11637 // 3-particle:
11638 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11639
0328db2d 11640 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11641 {
57340a27 11642 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11643 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
11644 + 2.*((*fSMpk)(0,2))*dImQ1n1k
489d5531 11645 - 2.*dImQ1n3k)
11646 / dM111;
11647
11648 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11649 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11650
11651 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11652 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11653 }
11654
11655} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11656
11657
57340a27 11658//================================================================================================================================
489d5531 11659
11660
0328db2d 11661void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11662{
11663 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11664
57340a27 11665 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11666 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 11667
57340a27 11668 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 11669 // organized as follows (sc stands for either sin or cos):
11670 //
11671 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
11672 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
11673 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 11674 // ...
489d5531 11675
11676 Int_t nPrim = anEvent->NumberOfTracks();
11677 AliFlowTrackSimple *aftsTrack = NULL;
11678 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11679 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11680 Double_t phi1=0., phi2=0., phi3=0.;
11681 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
11682 Int_t n = fHarmonic;
11683 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11684 Double_t dMult = (*fSMpk)(0,0);
11685 cout<<endl;
11686 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11687 if(dMult<1)
11688 {
11689 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11690 } else if (dMult>fMaxAllowedMultiplicity)
11691 {
11692 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11693 } else
11694 {
11695 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11696 }
11697
11698 // 1-particle correction terms using particle weights:
11699 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11700 {
11701 for(Int_t i1=0;i1<nPrim;i1++)
11702 {
11703 aftsTrack=anEvent->GetTrack(i1);
11704 if(!(aftsTrack->InRPSelection())) continue;
11705 phi1=aftsTrack->Phi();
11706 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 11707 // 1-particle correction terms using particle weights:
489d5531 11708 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
11709 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 11710 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11711 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11712
489d5531 11713 // 2-particle correction terms using particle weights:
11714 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11715 {
11716 for(Int_t i1=0;i1<nPrim;i1++)
11717 {
11718 aftsTrack=anEvent->GetTrack(i1);
11719 if(!(aftsTrack->InRPSelection())) continue;
11720 phi1=aftsTrack->Phi();
11721 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11722 for(Int_t i2=0;i2<nPrim;i2++)
11723 {
11724 if(i2==i1)continue;
11725 aftsTrack=anEvent->GetTrack(i2);
11726 if(!(aftsTrack->InRPSelection())) continue;
11727 phi2=aftsTrack->Phi();
11728 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11729 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 11730 // 2-p correction terms using particle weights:
489d5531 11731 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
11732 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
11733 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11734 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11735 } // end of if(nPrim>=2)
11736
11737 // 3-particle correction terms using particle weights:
11738 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11739 {
11740 for(Int_t i1=0;i1<nPrim;i1++)
11741 {
11742 aftsTrack=anEvent->GetTrack(i1);
11743 if(!(aftsTrack->InRPSelection())) continue;
11744 phi1=aftsTrack->Phi();
11745 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11746 for(Int_t i2=0;i2<nPrim;i2++)
11747 {
11748 if(i2==i1)continue;
11749 aftsTrack=anEvent->GetTrack(i2);
11750 if(!(aftsTrack->InRPSelection())) continue;
11751 phi2=aftsTrack->Phi();
11752 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11753 for(Int_t i3=0;i3<nPrim;i3++)
11754 {
11755 if(i3==i1||i3==i2)continue;
11756 aftsTrack=anEvent->GetTrack(i3);
11757 if(!(aftsTrack->InRPSelection())) continue;
11758 phi3=aftsTrack->Phi();
11759 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11760 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 11761 // 3-p correction terms using particle weights:
489d5531 11762 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
11763 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
11764 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11765 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11766 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11767 } // end of if(nPrim>=3)
11768
57340a27 11769 /*
11770
489d5531 11771 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11772 {
11773 // 4 nested loops multiparticle correlations using particle weights:
11774 for(Int_t i1=0;i1<nPrim;i1++)
11775 {
11776 aftsTrack=anEvent->GetTrack(i1);
11777 if(!(aftsTrack->InRPSelection())) continue;
11778 phi1=aftsTrack->Phi();
11779 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11780 for(Int_t i2=0;i2<nPrim;i2++)
11781 {
11782 if(i2==i1)continue;
11783 aftsTrack=anEvent->GetTrack(i2);
11784 if(!(aftsTrack->InRPSelection())) continue;
11785 phi2=aftsTrack->Phi();
11786 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11787 for(Int_t i3=0;i3<nPrim;i3++)
11788 {
11789 if(i3==i1||i3==i2)continue;
11790 aftsTrack=anEvent->GetTrack(i3);
11791 if(!(aftsTrack->InRPSelection())) continue;
11792 phi3=aftsTrack->Phi();
11793 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11794 for(Int_t i4=0;i4<nPrim;i4++)
11795 {
11796 if(i4==i1||i4==i2||i4==i3)continue;
11797 aftsTrack=anEvent->GetTrack(i4);
11798 if(!(aftsTrack->InRPSelection())) continue;
11799 phi4=aftsTrack->Phi();
11800 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11801 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11802 // 4-p correlations using particle weights:
11803 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11804 // extra correlations:
11805 // 2-p extra correlations (do not appear if particle weights are not used):
11806 // ...
11807 // 3-p extra correlations (do not appear if particle weights are not used):
11808 // ...
11809 // 4-p extra correlations (do not appear if particle weights are not used):
11810 // ...
11811 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11812 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11813 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11814 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11815 } // end of if(nPrim>=4)
11816
11817 */
11818
11819 cout<<endl;
11820
11821} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
11822
11823
57340a27 11824//================================================================================================================================
489d5531 11825
11826
11827void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
11828{
11829 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 11830
489d5531 11831 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 11832 //
489d5531 11833 // 0: <<cos n(psi)>>
11834 // 1: <<w2 cos n(psi1+phi2)>>
11835 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
11836 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
11837 // 4:
11838 // 5:
11839 // 6:
11840
11841 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11842 Double_t dReQ1n1k = (*fReQ)(0,1);
11843 Double_t dReQ2n2k = (*fReQ)(1,2);
11844 //Double_t dReQ1n3k = (*fReQ)(0,3);
11845 //Double_t dReQ4n4k = (*fReQ)(3,4);
11846 Double_t dImQ1n1k = (*fImQ)(0,1);
11847 Double_t dImQ2n2k = (*fImQ)(1,2);
11848 //Double_t dImQ1n3k = (*fImQ)(0,3);
11849 //Double_t dImQ4n4k = (*fImQ)(3,4);
11850
11851 // S^M_{p,k} (see .h file for the definition of fSMpk):
11852 Double_t dSM1p1k = (*fSMpk)(0,1);
11853 Double_t dSM1p2k = (*fSMpk)(0,2);
11854 Double_t dSM2p1k = (*fSMpk)(1,1);
11855
11856 Int_t t = -1; // type flag
11857 Int_t pe = -1; // ptEta flag
11858
11859 if(type == "RP")
11860 {
11861 t = 0;
11862 } else if(type == "POI")
11863 {
11864 t = 1;
11865 }
11866
11867 if(ptOrEta == "Pt")
11868 {
11869 pe = 0;
11870 } else if(ptOrEta == "Eta")
11871 {
11872 pe = 1;
11873 }
11874
11875 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11876 Double_t minPtEta[2] = {fPtMin,fEtaMin};
11877 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11878 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11879
11880 // looping over all bins and calculating correction terms:
11881 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11882 {
11883 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
11884 Double_t p1n0kRe = 0.;
11885 Double_t p1n0kIm = 0.;
11886
11887 // number of POIs in particular pt or eta bin:
11888 Double_t mp = 0.;
11889
11890 // 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):
11891 Double_t q1n2kRe = 0.;
11892 Double_t q1n2kIm = 0.;
11893 Double_t q2n1kRe = 0.;
11894 Double_t q2n1kIm = 0.;
46b94261 11895
489d5531 11896 // s_{1,1}, s_{1,2} // to be improved (add explanation)
11897 Double_t s1p1k = 0.;
11898 Double_t s1p2k = 0.;
46b94261 11899
489d5531 11900 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 11901 Double_t mq = 0.;
489d5531 11902
11903 // M0111 from Eq. (118) in QC2c (to be improved (notation))
11904 Double_t dM01 = 0.;
11905 Double_t dM011 = 0.;
11906
11907 if(type == "POI")
11908 {
11909 // q_{m*n,k}:
11910 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
11911 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
11912 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
11913 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
11914 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
11915 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
11916 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
11917 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
11918 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 11919
489d5531 11920 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
11921 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
11922 }else if(type == "RP")
11923 {
11924 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
11925 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
11926 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
11927 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
11928 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
11929 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
11930 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
11931 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
11932 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
11933 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
11934 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
11935 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 11936 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
11937
489d5531 11938 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11939 }
3b552efe 11940
489d5531 11941 if(type == "POI")
3b552efe 11942 {
11943 // p_{m*n,k}:
489d5531 11944 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
11945 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
11946 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 11947 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
11948 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 11949 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11950 dM01 = mp*dSM1p1k-s1p1k;
11951 dM011 = mp*(dSM2p1k-dSM1p2k)
11952 - 2.*(s1p1k*dSM1p1k-s1p2k);
11953
11954 // typeFlag = RP (0) or POI (1):
11955 t = 1;
11956 } else if(type == "RP")
489d5531 11957 {
11958 // to be improved (cross-checked):
11959 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
11960 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
11961 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
11962 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
11963 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11964 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11965 dM01 = mp*dSM1p1k-s1p1k;
11966 dM011 = mp*(dSM2p1k-dSM1p2k)
11967 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 11968 // typeFlag = RP (0) or POI (1):
3b552efe 11969 t = 0;
11970 }
489d5531 11971
11972 // <<cos n(psi1)>>:
11973 Double_t cosP1nPsi = 0.;
11974 if(mp)
11975 {
11976 cosP1nPsi = p1n0kRe/mp;
11977
11978 // fill profile for <<cos n(psi1)>>:
11979 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
11980 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
11981 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 11982 } // end of if(mp)
57340a27 11983
489d5531 11984 // <<w2 cos n(psi1+phi2)>>:
11985 Double_t cosP1nPsiP1nPhiW2 = 0.;
11986 if(dM01)
11987 {
11988 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
11989 // fill profile for <<w2 cos n(psi1+phi2)>>:
11990 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
11991 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
11992 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
11993 } // end of if(dM01)
11994
11995 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
11996 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
11997 if(dM011)
11998 {
46b94261 11999 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12000 - p1n0kRe*dSM1p2k
12001 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
12002 - s1p1k*dReQ1n1k
12003 + 2.*q1n2kRe)
12004 / dM011;
489d5531 12005 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12006 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12007 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12008 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
12009 } // end of if(dM011)
12010
12011 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
12012 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12013 if(dM011)
12014 {
12015 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
12016 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 12017 - 2.*s1p1k*dReQ1n1k
489d5531 12018 + 2.*q1n2kRe)
12019 / dM011;
12020 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12021 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12022 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12023 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
12024 } // end of if(dM011)
12025
12026 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 12027
57340a27 12028} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12029
489d5531 12030
12031//================================================================================================================================
12032
12033
12034void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12035{
12036 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
12037
12038 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
12039 // 0: <<sin n(psi1)>>
12040 // 1: <<w2 sin n(psi1+phi2)>>
12041 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
12042 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
12043 // 4:
12044 // 5:
12045 // 6:
12046
12047 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12048 Double_t dReQ1n1k = (*fReQ)(0,1);
12049 Double_t dReQ2n2k = (*fReQ)(1,2);
12050 //Double_t dReQ1n3k = (*fReQ)(0,3);
12051 //Double_t dReQ4n4k = (*fReQ)(3,4);
12052 Double_t dImQ1n1k = (*fImQ)(0,1);
12053 Double_t dImQ2n2k = (*fImQ)(1,2);
12054 //Double_t dImQ1n3k = (*fImQ)(0,3);
12055 //Double_t dImQ4n4k = (*fImQ)(3,4);
12056
12057 // S^M_{p,k} (see .h file for the definition of fSMpk):
12058 Double_t dSM1p1k = (*fSMpk)(0,1);
12059 Double_t dSM1p2k = (*fSMpk)(0,2);
12060 Double_t dSM2p1k = (*fSMpk)(1,1);
12061
12062 Int_t t = -1; // type flag
12063 Int_t pe = -1; // ptEta flag
12064
12065 if(type == "RP")
12066 {
12067 t = 0;
12068 } else if(type == "POI")
12069 {
12070 t = 1;
12071 }
12072
12073 if(ptOrEta == "Pt")
12074 {
12075 pe = 0;
12076 } else if(ptOrEta == "Eta")
12077 {
12078 pe = 1;
12079 }
12080
12081 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12082 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12083 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12084 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12085
12086 // looping over all bins and calculating correction terms:
12087 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12088 {
12089 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12090 Double_t p1n0kRe = 0.;
12091 Double_t p1n0kIm = 0.;
12092
12093 // number of POIs in particular pt or eta bin:
12094 Double_t mp = 0.;
12095
12096 // 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):
12097 Double_t q1n2kRe = 0.;
12098 Double_t q1n2kIm = 0.;
12099 Double_t q2n1kRe = 0.;
12100 Double_t q2n1kIm = 0.;
46b94261 12101
489d5531 12102 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12103 Double_t s1p1k = 0.;
12104 Double_t s1p2k = 0.;
46b94261 12105
489d5531 12106 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 12107 Double_t mq = 0.;
489d5531 12108
12109 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12110 Double_t dM01 = 0.;
12111 Double_t dM011 = 0.;
12112
12113 if(type == "POI")
12114 {
12115 // q_{m*n,k}:
12116 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12117 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12118 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12119 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12120 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12121 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12122 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12123 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12124 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 12125
489d5531 12126 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12127 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12128 }else if(type == "RP")
12129 {
12130 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12131 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12132 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12133 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12134 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12135 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12136 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12137 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12138 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12139 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12140 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12141 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12142 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 12143 }
12144
12145 if(type == "POI")
12146 {
12147 // p_{m*n,k}:
489d5531 12148 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12149 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12150 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12151 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12152 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 12153 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12154 dM01 = mp*dSM1p1k-s1p1k;
12155 dM011 = mp*(dSM2p1k-dSM1p2k)
12156 - 2.*(s1p1k*dSM1p1k-s1p2k);
12157 // typeFlag = RP (0) or POI (1):
12158 t = 1;
489d5531 12159 } else if(type == "RP")
3b552efe 12160 {
489d5531 12161 // to be improved (cross-checked):
12162 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12163 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12164 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12165 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12166 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12167 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12168 dM01 = mp*dSM1p1k-s1p1k;
12169 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 12170 - 2.*(s1p1k*dSM1p1k-s1p2k);
12171 // typeFlag = RP (0) or POI (1):
3b552efe 12172 t = 0;
12173 }
12174
489d5531 12175 // <<sin n(psi1)>>:
12176 Double_t sinP1nPsi = 0.;
12177 if(mp)
12178 {
12179 sinP1nPsi = p1n0kIm/mp;
12180
12181 // fill profile for <<sin n(psi1)>>:
12182 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12183 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12184 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 12185 } // end of if(mp)
12186
489d5531 12187 // <<w2 sin n(psi1+phi2)>>:
12188 Double_t sinP1nPsiP1nPhiW2 = 0.;
12189 if(dM01)
12190 {
12191 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12192 // fill profile for <<w2 sin n(psi1+phi2)>>:
12193 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12194 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12195 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12196 } // end of if(mp*dMult-mq)
12197
12198 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12199 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12200 if(dM011)
12201 {
46b94261 12202 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12203 - p1n0kIm*dSM1p2k
12204 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12205 - s1p1k*dImQ1n1k
12206 + 2.*q1n2kIm)
12207 / dM011;
489d5531 12208 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12209 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12210 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12211 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12212 } // end of if(dM011)
12213
12214 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12215 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12216 if(dM011)
12217 {
12218 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12219 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 12220 + 2.*s1p1k*dImQ1n1k
489d5531 12221 - 2.*q1n2kIm)
12222 / dM011;
12223 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12224 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12225 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12226 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12227 } // end of if(dM011)
12228
12229 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12230
12231} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12232
12233
12234//================================================================================================================================
12235
12236
0328db2d 12237void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12238{
57340a27 12239 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 12240 // with using particle weights (both sin and cos terms) relevant for differential flow.
12241
57340a27 12242 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12243 // flagged both as POI and RP.
489d5531 12244 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12245 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12246 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12247 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12248 // cti:
12249 // 0: <<sc n(psi1)>>
12250 // 1: <<w2 sc n(psi1+phi2)>>
12251 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12252 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12253 // 4:
12254 // 5:
12255 // 6:
46b94261 12256
489d5531 12257 Int_t typeFlag = -1;
12258 Int_t ptEtaFlag = -1;
12259 if(type == "RP")
12260 {
12261 typeFlag = 0;
12262 } else if(type == "POI")
12263 {
12264 typeFlag = 1;
12265 }
12266 if(ptOrEta == "Pt")
12267 {
12268 ptEtaFlag = 0;
12269 } else if(ptOrEta == "Eta")
12270 {
12271 ptEtaFlag = 1;
12272 }
12273 // shortcuts:
12274 Int_t t = typeFlag;
12275 Int_t pe = ptEtaFlag;
12276
12277 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12278 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12279 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12280
12281 Int_t nPrim = anEvent->NumberOfTracks();
12282 AliFlowTrackSimple *aftsTrack = NULL;
12283
12284 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12285 Double_t wPhi2=1., wPhi3=1.;
12286
12287 Int_t n = fHarmonic;
12288
12289 // 1'-particle correction terms:
12290 for(Int_t i1=0;i1<nPrim;i1++)
12291 {
12292 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12293 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12294 if(typeFlag==1) // this is diff flow of POIs
489d5531 12295 {
12296 if(ptOrEta == "Pt")
12297 {
12298 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12299 } else if (ptOrEta == "Eta")
12300 {
12301 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12302 }
12303 } else // this is diff flow of RPs
12304 {
489d5531 12305 if(ptOrEta == "Pt")
12306 {
12307 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12308 } else if (ptOrEta == "Eta")
12309 {
12310 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12311 }
489d5531 12312 }
12313 psi1=aftsTrack->Phi();
12314 // sin terms:
12315 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12316 // cos terms:
12317 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12318 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12319
12320 // 2'-particle correction terms:
12321 for(Int_t i1=0;i1<nPrim;i1++)
12322 {
12323 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12324 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12325 if(typeFlag==1) // this is diff flow of POIs
489d5531 12326 {
12327 if(ptOrEta == "Pt")
12328 {
12329 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12330 } else if (ptOrEta == "Eta")
12331 {
12332 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12333 }
12334 } else // this is diff flow of RPs
12335 {
489d5531 12336 if(ptOrEta == "Pt")
12337 {
12338 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12339 } else if (ptOrEta == "Eta")
12340 {
12341 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12342 }
489d5531 12343 }
12344 psi1=aftsTrack->Phi();
12345 for(Int_t i2=0;i2<nPrim;i2++)
12346 {
12347 if(i2==i1) continue;
12348 aftsTrack=anEvent->GetTrack(i2);
12349 // RP condition (!(first) particle in the correlator must be RP):
12350 if(!(aftsTrack->InRPSelection())) continue;
46b94261 12351 phi2=aftsTrack->Phi();
489d5531 12352 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12353 // sin terms:
12354 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12355 // cos terms:
12356 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12357 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12358 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12359
12360 // 3'-particle correction terms:
12361 for(Int_t i1=0;i1<nPrim;i1++)
12362 {
12363 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12364 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12365 if(typeFlag==1) // this is diff flow of POIs
489d5531 12366 {
12367 if(ptOrEta == "Pt")
12368 {
12369 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12370 } else if (ptOrEta == "Eta")
12371 {
12372 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12373 }
12374 } else // this is diff flow of RPs
12375 {
489d5531 12376 if(ptOrEta == "Pt")
12377 {
12378 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12379 } else if (ptOrEta == "Eta")
12380 {
12381 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12382 }
489d5531 12383 }
12384 psi1=aftsTrack->Phi();
12385 for(Int_t i2=0;i2<nPrim;i2++)
12386 {
12387 if(i2==i1) continue;
12388 aftsTrack=anEvent->GetTrack(i2);
12389 // RP condition (!(first) particle in the correlator must be RP):
12390 if(!(aftsTrack->InRPSelection())) continue;
12391 phi2=aftsTrack->Phi();
12392 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12393 for(Int_t i3=0;i3<nPrim;i3++)
12394 {
12395 if(i3==i1||i3==i2) continue;
12396 aftsTrack=anEvent->GetTrack(i3);
12397 // RP condition (!(first) particle in the correlator must be RP):
12398 if(!(aftsTrack->InRPSelection())) continue;
12399 phi3=aftsTrack->Phi();
12400 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12401 // sin terms:
12402 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))>>
12403 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))>>
12404 // cos terms:
12405 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))>>
12406 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))>>
12407 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12408 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 12409 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 12410
12411} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12412
2001bc3a 12413//================================================================================================================================
12414
12415void AliFlowAnalysisWithQCumulants::CalculateDetectorEffectsForTrueCorrelations()
12416{
12417 // Quantify detector effects for true correlations.
12418
12419 // to be improved: add protection for the pointers used in this method
12420
12421 Double_t measured[4] = {0.}; // measured true correlation (a.k.a. cumulant)
12422 Double_t corrected[4] = {0.}; // true correlation corrected for detector effects (a.k.a. generalized cumulant)
12423
12424 // measured correlations:
12425 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
12426 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
12427 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
12428 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
12429 // measured true correlations (a.k.a. cumulants):
12430 if(two) measured[0] = two;
12431 if(four) measured[1] = four-2.*pow(two,2.);
12432 if(six) measured[2] = six-9.*two*four+12.*pow(two,3.);
12433 if(eight) measured[3] = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
12434
12435 for(Int_t ci=0;ci<=1;ci++) // correlation index // to be improved (enabled also for QC{6} and QC{8} eventually)
12436 {
12437 corrected[ci] = fIntFlowQcumulants->GetBinContent(ci+1);
12438 if(TMath::Abs(measured[ci])>1.e-44)
12439 {
12440 fIntFlowDetectorBias->SetBinContent(ci+1,corrected[ci]/measured[ci]);
12441 }
12442 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
12443
12444 // versus multiplicity:
12445 if(!fApplyCorrectionForNUAVsM) return;
12446 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
12447 for(Int_t b=1;b<=nBins;b++)
12448 {
12449 // measured correlations vs M:
12450 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
12451 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
12452 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
12453 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
12454 // measured true correlations (a.k.a. cumulants) vs M:
12455 measured[0] = 0.; // QC{2} vs M
12456 measured[1] = 0.; // QC{4} vs M
12457 measured[2] = 0.; // QC{6} vs M
12458 measured[3] = 0.; // QC{8} vs M
12459 if(two) measured[0] = two;
12460 if(four) measured[1] = four-2.*pow(two,2.);
12461 if(six) measured[2] = six-9.*two*four+12.*pow(two,3.);
12462 if(eight) measured[3] = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
12463 corrected[0] = 0.; // generalized QC{2} vs M
12464 corrected[1] = 0.; // generalized QC{4} vs M
12465 corrected[2] = 0.; // generalized QC{6} vs M
12466 corrected[3] = 0.; // generalized QC{8} vs M
12467 for(Int_t ci=0;ci<=1;ci++) // correlation index // to be improved (enabled also for QC{6} and QC{8} eventually)
12468 {
12469 corrected[ci] = fIntFlowQcumulantsVsM[ci]->GetBinContent(b);
12470 if(TMath::Abs(measured[ci])>1.e-44)
12471 {
12472 fIntFlowDetectorBiasVsM[ci]->SetBinContent(b,corrected[ci]/measured[ci]);
12473 }
12474 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
12475 } // end of for(Int_t b=1;b<=nBins;b++)
489d5531 12476
2001bc3a 12477} // end of AliFlowAnalysisWithQCumulants::CalculateDetectorEffectsForTrueCorrelations()
57340a27 12478
12479
12480